From b6f05dd14f516a3a94dced71ed11b04a6d939739 Mon Sep 17 00:00:00 2001 From: 8bitkick <8bitkick@users.noreply.github.com> Date: Wed, 10 Apr 2019 21:08:06 -0700 Subject: [PATCH 01/53] RGB16 red masked to 5 bits Prevents high green bits overlapping to low red. --- src/ArduinoGraphics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ArduinoGraphics.cpp b/src/ArduinoGraphics.cpp index e80e4b3..bedd1a7 100644 --- a/src/ArduinoGraphics.cpp +++ b/src/ArduinoGraphics.cpp @@ -298,7 +298,7 @@ void ArduinoGraphics::imageRGB16(const Image& img, int x, int y, int width, int for (int i = 0; i < width; i++) { uint16_t pixel = *data++; - set(x + i, y + j, (pixel >> 8), ((pixel >> 3) & 0xfc), (pixel << 3) & 0xf8); + set(x + i, y + j, ((pixel >> 8) & 0xf8), ((pixel >> 3) & 0xfc), (pixel << 3) & 0xf8); } data += (img.width() - width); From 7c0ecdd297033ab92a7ddd1b39ca156e3041dfd0 Mon Sep 17 00:00:00 2001 From: Sandeep Mistry Date: Mon, 7 Oct 2019 17:22:37 -0400 Subject: [PATCH 02/53] Add Github workflows for compiling examples and spell checking --- .github/workflows/compile-examples.yml | 19 +++++++++++++++++++ .github/workflows/spell-check.yml | 11 +++++++++++ README.adoc | 2 ++ 3 files changed, 32 insertions(+) create mode 100644 .github/workflows/compile-examples.yml create mode 100644 .github/workflows/spell-check.yml diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml new file mode 100644 index 0000000..93357ec --- /dev/null +++ b/.github/workflows/compile-examples.yml @@ -0,0 +1,19 @@ +name: Compile Examples +on: [push, pull_request] +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + fqbn: [ + "arduino:samd:mkrzero" + ] + + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + - uses: arduino/actions/libraries/compile-examples@master + with: + fqbn: ${{ matrix.fqbn }} diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml new file mode 100644 index 0000000..7b45d77 --- /dev/null +++ b/.github/workflows/spell-check.yml @@ -0,0 +1,11 @@ +name: Spell Check +on: [push, pull_request] +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + - uses: arduino/actions/libraries/spell-check@master diff --git a/README.adoc b/README.adoc index 38c6684..135197f 100644 --- a/README.adoc +++ b/README.adoc @@ -1,5 +1,7 @@ = ArduinoGraphics Library for Arduino = +image:https://github.com/arduino-libraries/ArduinoGraphics/workflows/Compile%20Examples/badge.svg["Compile Examples Status", link="https://github.com/arduino-libraries/ArduinoGraphics/actions?workflow=Compile+Examples"] image:https://github.com/arduino-libraries/ArduinoGraphics/workflows/Spell%20Check/badge.svg["Spell Check Status", link="https://github.com/arduino-libraries/ArduinoGraphics/actions?workflow=Spell+Check"] + Core graphics library for Arduino. Based on the Processing API. For more information about this library please visit us at https://www.arduino.cc/en/Reference/ArduinoGraphics From e9880f03503a43b74fb2f746b6cad5504f6c15f7 Mon Sep 17 00:00:00 2001 From: per1234 Date: Thu, 19 Mar 2020 08:06:37 -0700 Subject: [PATCH 03/53] Add example sketch The example sketch uses the ArduinoGraphics library to draw ASCII art and print it to the Serial Monitor. --- examples/ASCIIDraw/ASCIIDraw.ino | 107 +++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 examples/ASCIIDraw/ASCIIDraw.ino diff --git a/examples/ASCIIDraw/ASCIIDraw.ino b/examples/ASCIIDraw/ASCIIDraw.ino new file mode 100644 index 0000000..398a40d --- /dev/null +++ b/examples/ASCIIDraw/ASCIIDraw.ino @@ -0,0 +1,107 @@ +/* + ASCIIDraw + + Use the ArduinoGraphics library to draw ASCII art on the Serial Monitor. + + This is intended primarily to allow testing of the library. + See the Arduino_MKRRGB library for a more useful demonstration of the ArduinoGraphics library. + + The circuit: + - Arduino board + + This example code is in the public domain. +*/ + +#include + +const byte canvasWidth = 61; +const byte canvasHeight = 27; + +class ASCIIDrawClass : public ArduinoGraphics { + public: + // can be used with an object of any class that inherits from the Print class + ASCIIDrawClass(Print &printObject = (Print &)Serial) : + ArduinoGraphics(canvasWidth, canvasHeight), + _printObject(&printObject) {} + + // this function is called by the ArduinoGraphics library's functions + virtual void set(int x, int y, uint8_t r, uint8_t g, uint8_t b) { + // the r parameter is (mis)used to set the character to draw with + _canvasBuffer[x][y] = r; + // cast unused parameters to void to fix "unused parameter" warning + (void)g; + (void)b; + } + + // display the drawing + void endDraw() { + ArduinoGraphics::endDraw(); + + for (byte row = 0; row < canvasHeight; row++) { + for (byte column = 0; column < canvasWidth; column++) { + // handle unset parts of buffer + if (_canvasBuffer[column][row] == 0) { + _canvasBuffer[column][row] = ' '; + } + _printObject->print(_canvasBuffer[column][row]); + } + _printObject->println(); + } + } + + private: + Print *_printObject; + char _canvasBuffer[canvasWidth][canvasHeight] = {{0}}; +}; + +ASCIIDrawClass ASCIIDraw; + +void setup() { + Serial.begin(9600); + while (!Serial) { + ; // wait for serial port to connect. Needed for native USB port only + } + + ASCIIDraw.beginDraw(); + + // configure the character used to fill the background. The second and third parameters are ignored + ASCIIDraw.background('+', 0, 0); + ASCIIDraw.clear(); + + // add the outer border + ASCIIDraw.stroke('-', 0, 0); + ASCIIDraw.fill('*', 0, 0); + const byte outerBorderThickness = 1; + ASCIIDraw.rect(outerBorderThickness, outerBorderThickness, canvasWidth - outerBorderThickness * 2, canvasHeight - outerBorderThickness * 2); + + // add the inner border + ASCIIDraw.stroke('+', 0, 0); + ASCIIDraw.fill('O', 0, 0); + const byte borderThickness = outerBorderThickness + 6; + ASCIIDraw.rect(borderThickness, borderThickness, canvasWidth - borderThickness * 2, canvasHeight - borderThickness * 2); + + // add the text + ASCIIDraw.background(' ', 0, 0); + ASCIIDraw.stroke('@', 0, 0); + const char text[] = "ARDUINO"; + ASCIIDraw.textFont(Font_5x7); + const byte textWidth = strlen(text) * ASCIIDraw.textFontWidth(); + const byte textHeight = ASCIIDraw.textFontHeight(); + const byte textX = (canvasWidth - textWidth) / 2; + const byte textY = (canvasHeight - textHeight) / 2; + ASCIIDraw.text(text, textX, textY); + + // underline the text + ASCIIDraw.stroke('-', 0, 0); + ASCIIDraw.line(textX, textY + textHeight - 1, textX + textWidth - 1, textY + textHeight - 1); + + // add some accents to the underline + ASCIIDraw.stroke('+', 0, 0); + ASCIIDraw.point(textX + 4, textY + textHeight - 1); + ASCIIDraw.point(textX + textWidth - 1 - 4, textY + textHeight - 1); + + // print the drawing to the Serial Monitor + ASCIIDraw.endDraw(); +} + +void loop() {} From ba36c7c3b82d34a607510e47213ad620ca0905e2 Mon Sep 17 00:00:00 2001 From: per1234 Date: Thu, 19 Mar 2020 07:58:10 -0700 Subject: [PATCH 04/53] Fix bug that caused bitmap to not display when y > height Use of incorrect variable name caused the bitmap to not display when the y position was greater than the bitmap height. --- src/ArduinoGraphics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ArduinoGraphics.cpp b/src/ArduinoGraphics.cpp index bedd1a7..6e15198 100644 --- a/src/ArduinoGraphics.cpp +++ b/src/ArduinoGraphics.cpp @@ -236,7 +236,7 @@ void ArduinoGraphics::bitmap(const uint8_t* data, int x, int y, int width, int h return; } - if ((data == NULL) || ((x + width) < 0) || ((y + height) < 0) || (x > _width) || (y > height)) { + if ((data == NULL) || ((x + width) < 0) || ((y + height) < 0) || (x > _width) || (y > _height)) { // offscreen return; } From 3b5dc25e6d75050455c23f0fbf2470165e8091d9 Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 20 Apr 2021 06:35:57 -0700 Subject: [PATCH 05/53] Configure Dependabot to check for outdated actions used in workflows Dependabot will periodically check the versions of all actions used in the repository's workflows. If any are found to be outdated, it will submit a pull request to update them. NOTE: Dependabot's PRs will sometimes try to pin to the patch version of the action (e.g., updating `uses: foo/bar@v1` to `uses: foo/bar@v2.3.4`). When the action author has provided a major version ref, use that instead (e.g., `uses: foo/bar@v2`). Dependabot will automatically close its PR once the workflow has been updated. More information: https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot --- .github/dependabot.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..03600dd --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +# See: https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#about-the-dependabotyml-file +version: 2 + +updates: + # Configure check for outdated GitHub Actions actions in workflows. + # See: https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot + - package-ecosystem: github-actions + directory: / # Check the repository's workflows under /.github/workflows/ + schedule: + interval: daily From 2c1a336c7a51ba1b7d5913324e7fef161753f3f3 Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 20 Apr 2021 06:38:09 -0700 Subject: [PATCH 06/53] Update "smoke test" examples compilation CI workflow On every push or pull request that affects library source or example files, and periodically, compile all example sketches for the specified boards. --- .github/workflows/compile-examples.yml | 71 ++++++++++++++++++++------ README.adoc | 7 ++- 2 files changed, 61 insertions(+), 17 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 93357ec..96652c0 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -1,19 +1,60 @@ name: Compile Examples -on: [push, pull_request] + +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows +on: + push: + paths: + - ".github/workflows/compile-examples.yml" + - "library.properties" + - "examples/**" + - "src/**" + pull_request: + paths: + - ".github/workflows/compile-examples.yml" + - "library.properties" + - "examples/**" + - "src/**" + schedule: + # Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms). + - cron: "0 8 * * TUE" + workflow_dispatch: + repository_dispatch: + jobs: - build: - runs-on: ubuntu-latest + build: + name: ${{ matrix.board.fqbn }} + runs-on: ubuntu-latest + + strategy: + fail-fast: false + + matrix: + board: + - fqbn: arduino:samd:arduino_zero_edbg + platforms: | + - name: arduino:samd + - fqbn: arduino:samd:mkrzero + platforms: | + - name: arduino:samd + - fqbn: arduino:samd:nano_33_iot + platforms: | + - name: arduino:samd + + steps: + - name: Checkout repository + uses: actions/checkout@v2 - strategy: - matrix: - fqbn: [ - "arduino:samd:mkrzero" - ] + - name: Compile examples + uses: arduino/compile-sketches@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + fqbn: ${{ matrix.board.fqbn }} + platforms: ${{ matrix.board.platforms }} + libraries: | + # Install the library from the local path. + - source-path: ./ + # Additional library dependencies can be listed here. + # See: https://github.com/arduino/compile-sketches#libraries + sketch-paths: | + - examples - steps: - - uses: actions/checkout@v1 - with: - fetch-depth: 1 - - uses: arduino/actions/libraries/compile-examples@master - with: - fqbn: ${{ matrix.fqbn }} diff --git a/README.adoc b/README.adoc index 135197f..0b944a5 100644 --- a/README.adoc +++ b/README.adoc @@ -1,6 +1,9 @@ -= ArduinoGraphics Library for Arduino = +:repository-owner: arduino-libraries +:repository-name: ArduinoGraphics -image:https://github.com/arduino-libraries/ArduinoGraphics/workflows/Compile%20Examples/badge.svg["Compile Examples Status", link="https://github.com/arduino-libraries/ArduinoGraphics/actions?workflow=Compile+Examples"] image:https://github.com/arduino-libraries/ArduinoGraphics/workflows/Spell%20Check/badge.svg["Spell Check Status", link="https://github.com/arduino-libraries/ArduinoGraphics/actions?workflow=Spell+Check"] += {repository-name} Library for Arduino = + +image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/compile-examples.yml/badge.svg["Compile Examples status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/compile-examples.yml"] Core graphics library for Arduino. Based on the Processing API. From e7d75fef4d7d6d81a3564a702eb7c3c15bc9ee97 Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 20 Apr 2021 06:38:56 -0700 Subject: [PATCH 07/53] Report changes in memory usage that would result from merging a PR On creation or commit to a pull request, a report of the resulting change in memory usage of the examples will be commented to the PR thread. --- .github/workflows/compile-examples.yml | 11 +++++++++++ .github/workflows/report-size-deltas.yml | 24 ++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 .github/workflows/report-size-deltas.yml diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 96652c0..811e7bd 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -25,6 +25,9 @@ jobs: name: ${{ matrix.board.fqbn }} runs-on: ubuntu-latest + env: + SKETCHES_REPORTS_PATH: sketches-reports + strategy: fail-fast: false @@ -57,4 +60,12 @@ jobs: # See: https://github.com/arduino/compile-sketches#libraries sketch-paths: | - examples + enable-deltas-report: true + sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }} + - name: Save sketches report as workflow artifact + uses: actions/upload-artifact@v2 + with: + if-no-files-found: error + path: ${{ env.SKETCHES_REPORTS_PATH }} + name: ${{ env.SKETCHES_REPORTS_PATH }} diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml new file mode 100644 index 0000000..652be5d --- /dev/null +++ b/.github/workflows/report-size-deltas.yml @@ -0,0 +1,24 @@ +name: Report Size Deltas + +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows +on: + push: + paths: + - ".github/workflows/report-size-deltas.yml" + schedule: + # Run at the minimum interval allowed by GitHub Actions. + # Note: GitHub Actions periodically has outages which result in workflow failures. + # In this event, the workflows will start passing again once the service recovers. + - cron: "*/5 * * * *" + workflow_dispatch: + repository_dispatch: + +jobs: + report: + runs-on: ubuntu-latest + steps: + - name: Comment size deltas reports to PRs + uses: arduino/report-size-deltas@v1 + with: + # The name of the workflow artifact created by the sketch compilation workflow + sketches-reports-source: sketches-reports From c1cd7905b6bf736f68ad3288c3b0849b66344dfb Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 20 Apr 2021 06:39:19 -0700 Subject: [PATCH 08/53] Update CI workflow to check for commonly misspelled words On every push, pull request, and periodically, use the codespell-project/actions-codespell action to check for commonly misspelled words. In the event of a false positive, the problematic word should be added, in all lowercase, to the ignore-words-list field of ./.codespellrc. Regardless of the case of the word in the false positive, it must be in all lowercase in the ignore list. The ignore list is comma-separated with no spaces. --- .codespellrc | 7 +++++++ .github/workflows/spell-check.yml | 29 ++++++++++++++++++++--------- README.adoc | 1 + 3 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 .codespellrc diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000..101edae --- /dev/null +++ b/.codespellrc @@ -0,0 +1,7 @@ +# See: https://github.com/codespell-project/codespell#using-a-config-file +[codespell] +# In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here: +ignore-words-list = , +check-filenames = +check-hidden = +skip = ./.git diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml index 7b45d77..01bee87 100644 --- a/.github/workflows/spell-check.yml +++ b/.github/workflows/spell-check.yml @@ -1,11 +1,22 @@ name: Spell Check -on: [push, pull_request] + +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows +on: + push: + pull_request: + schedule: + # Run every Tuesday at 8 AM UTC to catch new misspelling detections resulting from dictionary updates. + - cron: "0 8 * * TUE" + workflow_dispatch: + repository_dispatch: + jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - with: - fetch-depth: 1 - - uses: arduino/actions/libraries/spell-check@master + spellcheck: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Spell check + uses: codespell-project/actions-codespell@master diff --git a/README.adoc b/README.adoc index 0b944a5..3f9d65c 100644 --- a/README.adoc +++ b/README.adoc @@ -4,6 +4,7 @@ = {repository-name} Library for Arduino = image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/compile-examples.yml/badge.svg["Compile Examples status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/compile-examples.yml"] +image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check.yml/badge.svg["Spell Check status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check.yml"] Core graphics library for Arduino. Based on the Processing API. From 322f187c4999007ce95e1a85f33ce35ba0649a25 Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 20 Apr 2021 06:39:46 -0700 Subject: [PATCH 09/53] Add CI workflow to do Arduino project-specific linting On every push, pull request, and periodically, run Arduino Lint to check for common problems not related to the project code. --- .github/workflows/check-arduino.yml | 28 ++++++++++++++++++++++++++++ README.adoc | 1 + 2 files changed, 29 insertions(+) create mode 100644 .github/workflows/check-arduino.yml diff --git a/.github/workflows/check-arduino.yml b/.github/workflows/check-arduino.yml new file mode 100644 index 0000000..0d969f6 --- /dev/null +++ b/.github/workflows/check-arduino.yml @@ -0,0 +1,28 @@ +name: Check Arduino + +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows +on: + push: + pull_request: + schedule: + # Run every Tuesday at 8 AM UTC to catch breakage caused by new rules added to Arduino Lint. + - cron: "0 8 * * TUE" + workflow_dispatch: + repository_dispatch: + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Arduino Lint + uses: arduino/arduino-lint-action@v1 + with: + compliance: specification + library-manager: update + # Always use this setting for official repositories. Remove for 3rd party projects. + official: true + project-type: library diff --git a/README.adoc b/README.adoc index 3f9d65c..a77a80e 100644 --- a/README.adoc +++ b/README.adoc @@ -3,6 +3,7 @@ = {repository-name} Library for Arduino = +image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-arduino.yml/badge.svg["Check Arduino status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-arduino.yml"] image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/compile-examples.yml/badge.svg["Compile Examples status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/compile-examples.yml"] image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check.yml/badge.svg["Spell Check status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check.yml"] From ea0d71a1c2b5549b92afb5c36d0924d5c451d0b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20S=C3=B6derby?= <35461661+karlsoderby@users.noreply.github.com> Date: Wed, 30 Jun 2021 12:15:12 +0200 Subject: [PATCH 10/53] Add docs folder --- docs/api.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ docs/readme.md | 13 +++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 docs/api.md create mode 100644 docs/readme.md diff --git a/docs/api.md b/docs/api.md new file mode 100644 index 0000000..b9f3b87 --- /dev/null +++ b/docs/api.md @@ -0,0 +1,52 @@ +# ArduinoGraphics Library + +## Methods + +### `begin()` + +Description +Initializes the graphics device. + +#### Syntax + +`YourScreen.begin()` + +#### Parameters + +None + +#### Returns + +1 for success, 0 on failure. + +#### Example + +```arduino +if (!YourScreen.begin() { + Serial.println(“Failed to initialize the display!”); + while (1); +} +``` + +### `end()` + +Description +Stops the graphics device. + +#### Syntax + +`YourScreen.end()` + +#### Parameters + +None + +#### Returns + +Nothing + +#### Example + +```arduino +YourScreen.end(); +``` diff --git a/docs/readme.md b/docs/readme.md new file mode 100644 index 0000000..92ff8db --- /dev/null +++ b/docs/readme.md @@ -0,0 +1,13 @@ +# Arduino Graphics Library + +This is a library that allows you to draw and write on screens with graphical primitives; it requires a specific hardware interfacce library to drive the screen you are using, therefore every screen type should have its own hardware specific library. + +To use this library + +``` +#include +``` + +To let you easily understand the usage of the graphics primitives, we are using a dummy screen object named YourScreen that should be substituted with the real one, Eg. MATRIX, OLED, TFT and so on. Refer to the hardware interfacing library of your screen to get more details. + +The style and syntax of this library is inspired by [Processing 3](https://processing.org/) and we believe that learning Processing is very helpful to develop complex applications that combine the versatility of Arduino driven hardware with the power of a pc based graphical interface. \ No newline at end of file From 486e46cd0e42c8eb0af411a0f388cf65b06f0de7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20S=C3=B6derby?= <35461661+karlsoderby@users.noreply.github.com> Date: Mon, 26 Jul 2021 09:54:50 +0200 Subject: [PATCH 11/53] Update api.md --- docs/api.md | 789 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 782 insertions(+), 7 deletions(-) diff --git a/docs/api.md b/docs/api.md index b9f3b87..491bb9c 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1,15 +1,20 @@ -# ArduinoGraphics Library +# Arduino Graphics Library ## Methods ### `begin()` -Description +#### Description + + Initializes the graphics device. #### Syntax -`YourScreen.begin()` +``` +YourScreen.begin() +``` + #### Parameters @@ -21,32 +26,802 @@ None #### Example -```arduino +``` if (!YourScreen.begin() { Serial.println(“Failed to initialize the display!”); while (1); } ``` + + ### `end()` -Description +#### Description + Stops the graphics device. #### Syntax -`YourScreen.end()` +``` +YourScreen.end() + +``` + #### Parameters + None + #### Returns Nothing #### Example -```arduino +``` YourScreen.end(); ``` + + + +### `width()` + +#### Description + + +Returns the pixel width of the graphics device. + +#### Syntax + +``` +YourScreen.width() + +``` + + +#### Parameters + + +None + +#### Returns + +Returns the pixel width of the graphics device. + +#### Example + +``` +int w = YourScreen.width(); +``` + + +### `height()` + +#### Description + + +Returns the pixel height of the graphics device. + +#### Syntax + +``` +YourScreen.height() + +``` + + +#### Parameters + + +None + +#### Returns + +Returns the pixel height of the graphics device. + +#### Example + +``` +int h = YourScreen.height(); +``` + + +### `beginDraw()` + +#### Description + + +Begins a drawing operation. + +#### Syntax + +``` +YourScreen.beginDraw() + +``` + + +#### Parameters + + +None + + +#### Returns + +Nothing + +#### Example + + +YourScreen.beginDraw(); +YourScreen.set(0, 0, 255, 0, 0); +YourScreen.endDraw(); + + + +### `endDraw()` + +#### Description + + +Ends a drawing operation, any drawing operations after beginDraw() is called will be displayed to the screen. + +#### Syntax + +``` +YourScreen.endDraw() + +``` + + +#### Parameters + + +None + + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.set(0, 0, 255, 0, 0); +YourScreen.endDraw(); +``` + + +### `background()` + +#### Description + + +Set the background color of drawing operations. Used when calling clear() or drawing text. + +#### Syntax + +``` +YourScreen.background(r, g, b) +YourScreen.background(color) + +``` + + +#### Parameters + + +- r: red color value (0 - 255) +- g: green color value (0 - 255) +- b: blue color value (0 - 255) +- color: 24-bit RGB color, 0xrrggbb + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.background(255, 0, 0); +YourScreen.clear(); +YourScreen.endDraw(); +``` + + +### `clear()` + +#### Description + + +Set clear the screen contents, uses the background colour set in background(). + +#### Syntax + +``` +YourScreen.clear() + +``` + + +#### Parameters + + +None + + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.background(255, 0, 0); +YourScreen.clear(); +YourScreen.endDraw(); +``` + + + +### `fill()` + +#### Description + + +Set the fill color of drawing operations. + +#### Syntax + +``` +YourScreen.fill(r, g, b) +YourScreen.fill(color) + +``` + + +#### Parameters + + +- r: red color value (0 - 255) +- g: green color value (0 - 255) +- b: blue color value (0 - 255) +- color: 24-bit RGB color, 0xrrggbb + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.clear(); +YourScreen.noStroke(); +YourScreen.fill(255, 255, 0); +YourScreen.rect(0, 0, YourScreen.width(), YourScreen.height()); +YourScreen.endDraw(); +``` + + +### `noFill()` + +#### Description + + +Clears the fill color of drawing operations. + +#### Syntax + +``` +YourScreen.noFill() + +``` + + +#### Parameters + + +None + + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.clear(); +YourScreen.stroke(255, 0, 255); +YourScreen.noFill(); +YourScreen.rect(0, 0, YourScreen.width(), YourScreen.height()); +YourScreen.endDraw(); +``` + + +### `stroke()` + +#### Description + + +Set the stroke color of drawing operations. + +#### Syntax + +``` +YourScreen.stroke(r, g, b) +YourScreen.stroke(color) + +``` + + +#### Parameters + + +- r: red color value (0 - 255) +- g: green color value (0 - 255) +- b: blue color value (0 - 255) +- color: 24-bit RGB color, 0xrrggbb + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.clear(); +YourScreen.stroke(255, 0, 255); +YourScreen.noFill(); +YourScreen.rect(0, 0, YourScreen.width(), YourScreen.height()); +YourScreen.endDraw(); +``` + + + +### `noStroke()` + +#### Description + + +Clears the stroke color of drawing operations. + +#### Syntax + +``` +YourScreen.noStroke() + +``` + + +#### Parameters + + +None + + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.clear(); +YourScreen.noStroke(); +YourScreen.fill(255, 255, 0); +YourScreen.rect(0, 0, YourScreen.width(), YourScreen.height()); +YourScreen.endDraw(); +``` + + +### `line()` + +#### Description + + +Stroke a line, uses the stroke color set in stroke(). + +#### Syntax + +``` +YourScreen.line(x1, y1, x2, y2) + +``` + + +#### Parameters + + +- x1: x position of the starting point of the line +- y1: y position of the starting point of the line +- x2: x position of the end point of the line +- y2: y position of the end point of the line + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.clear(); +YourScreen.stroke(0, 0, 255); +YourScreen.line(0, 0, YourScreen.width() - 1, YourScreen.height() - 1); +YourScreen.endDraw(); +``` + + +### `point()` + +#### Description + + +Stroke a point, uses the stroke color set in stroke(). + +#### Syntax + +``` +YourScreen.point(x, y) + +``` + + +#### Parameters + + +x: x position of the point +y: y position of the point + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.clear(); +YourScreen.stroke(0, 255, 0); +YourScreen.point(1, 1); +YourScreen.endDraw(); +``` + + +### `rect()` + +#### Description + + +Stroke and fill a rectangle, uses the stroke color set in stroke() and the fill color set in fill(). + +#### Syntax + +``` +YourScreen.rect(x, y, width, height) + +``` + + +#### Parameters + + +- x: x position of the rectangle +- y: y position of the rectangle +- width: width of the rectangle +- height: height of the rectangle + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.clear(); +YourScreen.noStroke(); +YourScreen.fill(255, 255, 0); +YourScreen.rect(0, 0, YourScreen.width(), YourScreen.height()); +YourScreen.endDraw(); +``` + + +### `text()` + +#### Description + + +Draw some text, uses the stroke color set in stroke() and the background color set in background(). + +#### Syntax + +``` +YourScreen.text(string) +YourScreen.text(string, x, y) + +``` + + +#### Parameters + + +- string: string to draw +- x: x position for the start of the text +- y: y position for the start of the text + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.clear(); +YourScreen.stroke(255, 255, 255); +YourScreen.text("abc", 0, 1); +YourScreen.endDraw(); +``` + + +### `textFont()` + +#### Description + + +Sets the font uses for text. The library current has the Font_4x6 and Font_5x7 built in. + +#### Syntax + +``` +YourScreen.textFont(font) + +``` + + +#### Parameters + + +font: font to set + + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.clear(); +YourScreen.stroke(255, 255, 255); +YourScreen.textFont(Font_5x7); +YourScreen.text("abc", 0, 1); +YourScreen.endDraw(); +``` + + +### `textFontWidth()` + +#### Description + + +Returns the width, in pixels, of the current font. + +#### Syntax + +``` +YourScreen.textFontWidth() + +``` + + +#### Parameters + + +None + + +#### Returns + +Nothing + +#### Example + +``` +int w = YourScreen.textFontWidth(); +``` + + +### `textFontHeight()` + +#### Description + + +Returns the height, in pixels, of the current font. + +#### Syntax + +``` +YourScreen.textFontHeight() + +``` + + +#### Parameters + + +None + + +#### Returns + +Nothing + +#### Example + +``` +int h = YourScreen.textFontHeight(); +``` + + +### `set()` + +#### Description + + +Set a pixel’s color value. + +#### Syntax + +``` +YourScreen.set(x, y, r, g, b) +YourScreen.set(x, y, color) + +``` + + +#### Parameters + + +x: x position of the pixel +y: y position of the pixel +r: red color value (0 - 255) +g: green color value (0 - 255) +b: blue color value (0 - 255) +color: 24-bit RGB color, 0xrrggbb + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.point(1, 1, 0, 255, 0); +YourScreen.endDraw(); +``` + + +### `beginText()` + +#### Description + + +Start the process of displaying and optionally scrolling text. The Print interface can be used to set the text. + +#### Syntax + +``` +YourScreen.beginText() +YourScreen.beginText(x, y, r, g, b) +YourScreen.beginText(x, y, color) + +``` + + +#### Parameters + + +x: x position of the text +y: y position of the text +r: red color value (0 - 255) +g: green color value (0 - 255) +b: blue color value (0 - 255) +color: 24-bit RGB color, 0xrrggbb + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginText(0, 0, 127, 0, 0); +YourScreen.print("Hi"); +YourScreen.endText(); +``` + + +### `endText()` + +#### Description + + +End the process of displaying and optionally scrolling text. + +#### Syntax + +``` +YourScreen.endText() +YourScreen.endText(scrollDirection) + +``` + + +#### Parameters + + +scrollDirection: (optional) the direction to scroll, defaults to NO_SCROLL if not provided. Valid options are NO_SCROLL, SCROLL_LEFT, SCROLL_RIGHT, SCROLL_UP, SCROLL_DOWN + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginText(0, 0, 127, 0, 0); +YourScreen.print("Hi"); +YourScreen.endText(); +``` + + +### `textScrollSpeed()` + +#### Description + + +Sets the text scrolling speed, the speed controls the delay in milliseconds between scrolling each pixel. + +#### Syntax + +``` +YourScreen.textScrollSpeed(speed) + +``` + + +#### Parameters + + +speed: scroll speed + + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginText(0, 0, 127, 0, 0); +YourScreen.textScrollSpeed(500); +YourScreen.print("Hello There!"); +YourScreen.endText(true); +``` + From b2168e6d059e69747ee8694d95487ff2f86e4847 Mon Sep 17 00:00:00 2001 From: Elena Marzi Tornblad Date: Sat, 13 Nov 2021 21:55:08 +0100 Subject: [PATCH 12/53] Fix color bug in clear() method The green and blue components of the background were switched in the clear() method. --- src/ArduinoGraphics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ArduinoGraphics.cpp b/src/ArduinoGraphics.cpp index 6e15198..5aeff55 100644 --- a/src/ArduinoGraphics.cpp +++ b/src/ArduinoGraphics.cpp @@ -83,7 +83,7 @@ void ArduinoGraphics::clear() { for (int x = 0; x < _width; x++) { for (int y = 0; y < _height; y++) { - set(x, y, _backgroundR, _backgroundB, _backgroundG); + set(x, y, _backgroundR, _backgroundG, _backgroundB); } } } From 3835c7250a00621d002692845c35f6b4063cfba2 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 10 Jan 2022 01:06:03 -0800 Subject: [PATCH 13/53] Add GitHub Actions workflow to synchronize with shared repository labels (#23) On every push that changes relevant files, and periodically, configure the repository's issue and pull request labels according to the universal, shared, and local label configuration files. --- .github/dependabot.yml | 2 + .github/workflows/sync-labels.yml | 138 ++++++++++++++++++++++++++++++ 2 files changed, 140 insertions(+) create mode 100644 .github/workflows/sync-labels.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 03600dd..fa738ec 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,3 +8,5 @@ updates: directory: / # Check the repository's workflows under /.github/workflows/ schedule: interval: daily + labels: + - "topic: infrastructure" diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml new file mode 100644 index 0000000..3ee6feb --- /dev/null +++ b/.github/workflows/sync-labels.yml @@ -0,0 +1,138 @@ +# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/sync-labels.md +name: Sync Labels + +# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows +on: + push: + paths: + - ".github/workflows/sync-labels.ya?ml" + - ".github/label-configuration-files/*.ya?ml" + pull_request: + paths: + - ".github/workflows/sync-labels.ya?ml" + - ".github/label-configuration-files/*.ya?ml" + schedule: + # Run daily at 8 AM UTC to sync with changes to shared label configurations. + - cron: "0 8 * * *" + workflow_dispatch: + repository_dispatch: + +env: + CONFIGURATIONS_FOLDER: .github/label-configuration-files + CONFIGURATIONS_ARTIFACT: label-configuration-files + +jobs: + check: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Download JSON schema for labels configuration file + id: download-schema + uses: carlosperate/download-file-action@v1 + with: + file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json + location: ${{ runner.temp }}/label-configuration-schema + + - name: Install JSON schema validator + run: | + sudo npm install \ + --global \ + ajv-cli \ + ajv-formats + + - name: Validate local labels configuration + run: | + # See: https://github.com/ajv-validator/ajv-cli#readme + ajv validate \ + --all-errors \ + -c ajv-formats \ + -s "${{ steps.download-schema.outputs.file-path }}" \ + -d "${{ env.CONFIGURATIONS_FOLDER }}/*.{yml,yaml}" + + download: + needs: check + runs-on: ubuntu-latest + + strategy: + matrix: + filename: + # Filenames of the shared configurations to apply to the repository in addition to the local configuration. + # https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/sync-labels + - universal.yml + + steps: + - name: Download + uses: carlosperate/download-file-action@v1 + with: + file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }} + + - name: Pass configuration files to next job via workflow artifact + uses: actions/upload-artifact@v2 + with: + path: | + *.yaml + *.yml + if-no-files-found: error + name: ${{ env.CONFIGURATIONS_ARTIFACT }} + + sync: + needs: download + runs-on: ubuntu-latest + + steps: + - name: Set environment variables + run: | + # See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable + echo "MERGED_CONFIGURATION_PATH=${{ runner.temp }}/labels.yml" >> "$GITHUB_ENV" + + - name: Determine whether to dry run + id: dry-run + if: > + github.event_name == 'pull_request' || + ( + ( + github.event_name == 'push' || + github.event_name == 'workflow_dispatch' + ) && + github.ref != format('refs/heads/{0}', github.event.repository.default_branch) + ) + run: | + # Use of this flag in the github-label-sync command will cause it to only check the validity of the + # configuration. + echo "::set-output name=flag::--dry-run" + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Download configuration files artifact + uses: actions/download-artifact@v2 + with: + name: ${{ env.CONFIGURATIONS_ARTIFACT }} + path: ${{ env.CONFIGURATIONS_FOLDER }} + + - name: Remove unneeded artifact + uses: geekyeggo/delete-artifact@v1 + with: + name: ${{ env.CONFIGURATIONS_ARTIFACT }} + + - name: Merge label configuration files + run: | + # Merge all configuration files + shopt -s extglob + cat "${{ env.CONFIGURATIONS_FOLDER }}"/*.@(yml|yaml) > "${{ env.MERGED_CONFIGURATION_PATH }}" + + - name: Install github-label-sync + run: sudo npm install --global github-label-sync + + - name: Sync labels + env: + GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # See: https://github.com/Financial-Times/github-label-sync + github-label-sync \ + --labels "${{ env.MERGED_CONFIGURATION_PATH }}" \ + ${{ steps.dry-run.outputs.flag }} \ + ${{ github.repository }} From cc97d209d077acc86e1013421c75cd0884054153 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Mar 2022 02:14:57 +0000 Subject: [PATCH 14/53] Bump actions/checkout from 2 to 3 Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/check-arduino.yml | 2 +- .github/workflows/compile-examples.yml | 2 +- .github/workflows/spell-check.yml | 2 +- .github/workflows/sync-labels.yml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check-arduino.yml b/.github/workflows/check-arduino.yml index 0d969f6..3e0d26c 100644 --- a/.github/workflows/check-arduino.yml +++ b/.github/workflows/check-arduino.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Arduino Lint uses: arduino/arduino-lint-action@v1 diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 811e7bd..e73871a 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -45,7 +45,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Compile examples uses: arduino/compile-sketches@v1 diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml index 01bee87..3f6b03f 100644 --- a/.github/workflows/spell-check.yml +++ b/.github/workflows/spell-check.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Spell check uses: codespell-project/actions-codespell@master diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 3ee6feb..4ea5755 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -27,7 +27,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Download JSON schema for labels configuration file id: download-schema @@ -105,7 +105,7 @@ jobs: echo "::set-output name=flag::--dry-run" - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Download configuration files artifact uses: actions/download-artifact@v2 From aca891474ff0cfec76a7423ed132d106669918d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 02:12:16 +0000 Subject: [PATCH 15/53] Bump actions/upload-artifact from 2 to 3 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/compile-examples.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index e73871a..326b00a 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -64,7 +64,7 @@ jobs: sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }} - name: Save sketches report as workflow artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: if-no-files-found: error path: ${{ env.SKETCHES_REPORTS_PATH }} diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 4ea5755..1d969d5 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -70,7 +70,7 @@ jobs: file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }} - name: Pass configuration files to next job via workflow artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: path: | *.yaml From 15ebb22f4c1490e6b42655b6a3e6a08b495a4025 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 02:12:18 +0000 Subject: [PATCH 16/53] Bump actions/download-artifact from 2 to 3 Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 2 to 3. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/sync-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 4ea5755..e84e803 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -108,7 +108,7 @@ jobs: uses: actions/checkout@v3 - name: Download configuration files artifact - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} path: ${{ env.CONFIGURATIONS_FOLDER }} From 71ed5d909a5a1e5ffa13e4c992951eb624090d29 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 Oct 2022 02:12:11 +0000 Subject: [PATCH 17/53] Bump geekyeggo/delete-artifact from 1 to 2 Bumps [geekyeggo/delete-artifact](https://github.com/geekyeggo/delete-artifact) from 1 to 2. - [Release notes](https://github.com/geekyeggo/delete-artifact/releases) - [Commits](https://github.com/geekyeggo/delete-artifact/compare/v1...v2) --- updated-dependencies: - dependency-name: geekyeggo/delete-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/sync-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 986bda6..10abaea 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -114,7 +114,7 @@ jobs: path: ${{ env.CONFIGURATIONS_FOLDER }} - name: Remove unneeded artifact - uses: geekyeggo/delete-artifact@v1 + uses: geekyeggo/delete-artifact@v2 with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} From c213ff9617a25191593defac8709cdb712237aac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Oct 2022 02:12:22 +0000 Subject: [PATCH 18/53] Bump carlosperate/download-file-action from 1 to 2 Bumps [carlosperate/download-file-action](https://github.com/carlosperate/download-file-action) from 1 to 2. - [Release notes](https://github.com/carlosperate/download-file-action/releases) - [Commits](https://github.com/carlosperate/download-file-action/compare/v1...v2) --- updated-dependencies: - dependency-name: carlosperate/download-file-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/sync-labels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 10abaea..94938f3 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -31,7 +31,7 @@ jobs: - name: Download JSON schema for labels configuration file id: download-schema - uses: carlosperate/download-file-action@v1 + uses: carlosperate/download-file-action@v2 with: file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json location: ${{ runner.temp }}/label-configuration-schema @@ -65,7 +65,7 @@ jobs: steps: - name: Download - uses: carlosperate/download-file-action@v1 + uses: carlosperate/download-file-action@v2 with: file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }} From 001f35ce87d064f9df7253aac9d03ea64e93c3ed Mon Sep 17 00:00:00 2001 From: Leonardo Cavagnis Date: Fri, 14 Apr 2023 15:47:33 +0200 Subject: [PATCH 19/53] adding circle and ellipse drawing functions --- docs/api.md | 77 +++++++++++++++++++++++++++++++++++++++++ keywords.txt | 2 ++ src/ArduinoGraphics.cpp | 47 +++++++++++++++++++++++++ src/ArduinoGraphics.h | 4 ++- 4 files changed, 129 insertions(+), 1 deletion(-) diff --git a/docs/api.md b/docs/api.md index 491bb9c..a870920 100644 --- a/docs/api.md +++ b/docs/api.md @@ -539,6 +539,83 @@ YourScreen.endDraw(); ``` +### `circle()` + +#### Description + + +Stroke and fill a circle, uses the stroke color set in stroke() and the fill color set in fill(). + +#### Syntax + +``` +YourScreen.circle(x, y, diameter) + +``` + + +#### Parameters + + +- x: x center position of the circle +- y: y center position of the circle +- diameter: diameter of the circle + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.clear(); +YourScreen.noStroke(); +YourScreen.fill(255, 255, 0); +YourScreen.circle(YourScreen.width()/2, YourScreen.height()/2, YourScreen.height()); +YourScreen.endDraw(); +``` + + +### `ellipse()` + +#### Description + + +Stroke and fill an ellipse, uses the stroke color set in stroke() and the fill color set in fill(). + +#### Syntax + +``` +YourScreen.ellipse(x, y, width, height) + +``` + + +#### Parameters + + +- x: x center position of the ellipse +- y: y center position of the ellipse +- width: width of the ellipse +- height: height of the ellipse + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.clear(); +YourScreen.noStroke(); +YourScreen.fill(255, 255, 0); +YourScreen.ellipse(YourScreen.width()/2, YourScreen.height()/2, YourScreen.width(), YourScreen.height()); +YourScreen.endDraw(); +``` + + ### `text()` #### Description diff --git a/keywords.txt b/keywords.txt index 5c7d60b..ce07cc7 100644 --- a/keywords.txt +++ b/keywords.txt @@ -33,6 +33,8 @@ line KEYWORD2 point KEYWORD2 quad KEYWORD2 rect KEYWORD2 +circle KEYWORD2 +ellipse KEYWORD2 text KEYWORD2 textFont KEYWORD2 diff --git a/src/ArduinoGraphics.cpp b/src/ArduinoGraphics.cpp index 5aeff55..15fe1ad 100644 --- a/src/ArduinoGraphics.cpp +++ b/src/ArduinoGraphics.cpp @@ -59,6 +59,12 @@ int ArduinoGraphics::height() return _height; } +uint32_t ArduinoGraphics::background() +{ + uint32_t bg = (uint32_t)((uint32_t)(_backgroundR << 16) | (uint32_t)(_backgroundG << 8) | (uint32_t)(_backgroundB << 0)); + return bg; +} + void ArduinoGraphics::beginDraw() { } @@ -124,6 +130,47 @@ void ArduinoGraphics::noStroke() _stroke = false; } +void ArduinoGraphics::circle(int x, int y, int diameter) +{ + ellipse(x, y, diameter, diameter); +} + +void ArduinoGraphics::ellipse(int x, int y, int width, int height) +{ + if (!_stroke && !_fill) { + return; + } + + int32_t a = width / 2; + int32_t b = height / 2; + int64_t a2 = a * a; + int64_t b2 = b * b; + int64_t i, j; + + if (_fill) { + for (j = -b; j <= b; j++) { + for (i = -a; i <= a; i++) { + if (i*i*b2 + j*j*a2 <= a2*b2) { + set(x + i, y + j, _fillR, _fillG, _fillB); + } + } + } + } + if (_stroke) { + int x_val, y_val; + for (i = -a; i <= a; i++) { + y_val = b * sqrt(1 - (double)i*i / a2); + set(x + i, y + y_val, _strokeR, _strokeG, _strokeB); + set(x + i, y - y_val, _strokeR, _strokeG, _strokeB); + } + for (j = -b; j <= b; j++) { + x_val = a * sqrt(1 - (double)j*j / b2); + set(x + x_val, y + j, _strokeR, _strokeG, _strokeB); + set(x - x_val, y + j, _strokeR, _strokeG, _strokeB); + } + } +} + void ArduinoGraphics::line(int x1, int y1, int x2, int y2) { if (!_stroke) { diff --git a/src/ArduinoGraphics.h b/src/ArduinoGraphics.h index f5468b0..1f1c914 100644 --- a/src/ArduinoGraphics.h +++ b/src/ArduinoGraphics.h @@ -43,6 +43,7 @@ class ArduinoGraphics : public Print { int width(); int height(); + uint32_t background(); virtual void beginDraw(); virtual void endDraw(); @@ -58,7 +59,8 @@ class ArduinoGraphics : public Print { void noStroke(); //virtual void arc(int x, int y, int width, int height, int start, int stop); - //virtual void ellipse(int x, int y, int width, int height); + virtual void circle(int x, int y, int diameter); + virtual void ellipse(int x, int y, int width, int height); virtual void line(int x1, int y1, int x2, int y2); virtual void point(int x, int y); //virtual void quad(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4); From feeb5fc56dfa6f1dd7d3aa116f10dafd45b713e9 Mon Sep 17 00:00:00 2001 From: Leonardo Cavagnis Date: Wed, 24 May 2023 17:16:02 +0200 Subject: [PATCH 20/53] add HasIncludeArduinoGraphics.h file --- src/HasIncludeArduinoGraphics.h | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 src/HasIncludeArduinoGraphics.h diff --git a/src/HasIncludeArduinoGraphics.h b/src/HasIncludeArduinoGraphics.h new file mode 100644 index 0000000..cc27970 --- /dev/null +++ b/src/HasIncludeArduinoGraphics.h @@ -0,0 +1,4 @@ +/* +This file is intentionally left blank. +Do not remove this comment. +*/ \ No newline at end of file From e018025634a9a825c4f78c153a98e9f0b2c5d30f Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Fri, 26 May 2023 17:14:34 +0200 Subject: [PATCH 21/53] Publish 1.1.0 --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index 2494df5..7933150 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=ArduinoGraphics -version=1.0.0 +version=1.1.0 author=Arduino maintainer=Arduino sentence=Core graphics library for Arduino. From f2f55859f571fd7feded046f5dc8c9ac267af499 Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 27 Jun 2023 01:42:01 -0700 Subject: [PATCH 22/53] Adjust spell check tool configuration to avoid false positive The repository's CI system includes a check for commonly misspelled words. The latest version of the codespell tool dependency used for this spell check is always used. This means that the results of the spell check can change as new versions of the tool are released. The recent codespell release introduced a false positive result. This is corrected by adding the word to the ignore list in the codespell configuration file. --- .codespellrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codespellrc b/.codespellrc index 101edae..33d69d0 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,7 +1,7 @@ # See: https://github.com/codespell-project/codespell#using-a-config-file [codespell] # In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here: -ignore-words-list = , +ignore-words-list = mis check-filenames = check-hidden = skip = ./.git From 33e287df351c52513d96186a4a0d675863724235 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Sep 2023 05:58:26 +0200 Subject: [PATCH 23/53] Bump actions/checkout from 3 to 4 (#32) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/check-arduino.yml | 2 +- .github/workflows/compile-examples.yml | 2 +- .github/workflows/spell-check.yml | 2 +- .github/workflows/sync-labels.yml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check-arduino.yml b/.github/workflows/check-arduino.yml index 3e0d26c..adb330f 100644 --- a/.github/workflows/check-arduino.yml +++ b/.github/workflows/check-arduino.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Arduino Lint uses: arduino/arduino-lint-action@v1 diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 326b00a..643b064 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -45,7 +45,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Compile examples uses: arduino/compile-sketches@v1 diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml index 3f6b03f..ef7d894 100644 --- a/.github/workflows/spell-check.yml +++ b/.github/workflows/spell-check.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Spell check uses: codespell-project/actions-codespell@master diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 94938f3..9cde1ac 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -27,7 +27,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Download JSON schema for labels configuration file id: download-schema @@ -105,7 +105,7 @@ jobs: echo "::set-output name=flag::--dry-run" - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Download configuration files artifact uses: actions/download-artifact@v3 From b8b2c9b53e4dbbe8297fc4c919a500a8eb23d7e8 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Thu, 11 Jan 2024 06:47:09 +0100 Subject: [PATCH 24/53] Fix: Clear up artefacts after when using scrolling text. (#36) This fixes #27. --- .gitignore | 1 + src/ArduinoGraphics.cpp | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..485dee6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea diff --git a/src/ArduinoGraphics.cpp b/src/ArduinoGraphics.cpp index 15fe1ad..3590eec 100644 --- a/src/ArduinoGraphics.cpp +++ b/src/ArduinoGraphics.cpp @@ -436,7 +436,9 @@ void ArduinoGraphics::endText(int scrollDirection) for (int i = 0; i < scrollLength; i++) { beginDraw(); - text(_textBuffer, _textX - i, _textY); + int const text_x = _textX - i; + text(_textBuffer, text_x, _textY); + bitmap(_font->data[0x20], text_x - 1, _textY, 1, _font->height); endDraw(); delay(_textScrollSpeed); @@ -446,7 +448,9 @@ void ArduinoGraphics::endText(int scrollDirection) for (int i = 0; i < scrollLength; i++) { beginDraw(); - text(_textBuffer, _textX - (scrollLength - i - 1), _textY); + int const text_x = _textX - (scrollLength - i - 1); + text(_textBuffer, text_x, _textY); + bitmap(_font->data[0x20], text_x - 1, _textY, 1, _font->height); endDraw(); delay(_textScrollSpeed); @@ -456,7 +460,9 @@ void ArduinoGraphics::endText(int scrollDirection) for (int i = 0; i < scrollLength; i++) { beginDraw(); - text(_textBuffer, _textX, _textY - i); + int const text_y = _textY - i; + text(_textBuffer, _textX, text_y); + bitmap(_font->data[0x20], _textX, text_y - 1, _font->width, 1); endDraw(); delay(_textScrollSpeed); @@ -466,7 +472,9 @@ void ArduinoGraphics::endText(int scrollDirection) for (int i = 0; i < scrollLength; i++) { beginDraw(); - text(_textBuffer, _textX, _textY - (scrollLength - i - 1)); + int const text_y = _textY - (scrollLength - i - 1); + text(_textBuffer, _textX, text_y); + bitmap(_font->data[0x20], _textX, text_y - 1, _font->width, 1); endDraw(); delay(_textScrollSpeed); From e9e081a63bc50adfabdfe3c2103118d47ca8a79a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Feb 2024 11:09:16 +0100 Subject: [PATCH 25/53] Bump actions/download-artifact from 3 to 4 (#33) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/sync-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 9cde1ac..885a8ac 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -108,7 +108,7 @@ jobs: uses: actions/checkout@v4 - name: Download configuration files artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} path: ${{ env.CONFIGURATIONS_FOLDER }} From 184849da937f0e6e15b3b4e4b449b09119be6487 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Feb 2024 11:09:35 +0100 Subject: [PATCH 26/53] Bump actions/upload-artifact from 3 to 4 (#34) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/compile-examples.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 643b064..6a642b5 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -64,7 +64,7 @@ jobs: sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }} - name: Save sketches report as workflow artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: if-no-files-found: error path: ${{ env.SKETCHES_REPORTS_PATH }} diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 885a8ac..2e1d6e0 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -70,7 +70,7 @@ jobs: file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }} - name: Pass configuration files to next job via workflow artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: | *.yaml From 2eaeb4cae057e0181a4e54449ac745f3bd929fdf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Feb 2024 11:10:01 +0100 Subject: [PATCH 27/53] Bump geekyeggo/delete-artifact from 2 to 4 (#35) Bumps [geekyeggo/delete-artifact](https://github.com/geekyeggo/delete-artifact) from 2 to 4. - [Release notes](https://github.com/geekyeggo/delete-artifact/releases) - [Changelog](https://github.com/GeekyEggo/delete-artifact/blob/main/CHANGELOG.md) - [Commits](https://github.com/geekyeggo/delete-artifact/compare/v2...v4) --- updated-dependencies: - dependency-name: geekyeggo/delete-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/sync-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 2e1d6e0..47ac50a 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -114,7 +114,7 @@ jobs: path: ${{ env.CONFIGURATIONS_FOLDER }} - name: Remove unneeded artifact - uses: geekyeggo/delete-artifact@v2 + uses: geekyeggo/delete-artifact@v4 with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} From 3a67d0b929e6dbaff122d43d26894e6ba22f5838 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Wed, 14 Feb 2024 11:18:09 +0100 Subject: [PATCH 28/53] Fix regression concerning report-size-deltas (#37) * Fix regression concerning report-size-deltas For more information see here: https://github.com/arduino/report-size-deltas/blob/main/docs/FAQ.md#size-deltas-report-workflow-triggered-by-schedule-event . * Fix: erroneous constant used for path. --- .github/workflows/compile-examples.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 6a642b5..d80f79f 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -36,12 +36,15 @@ jobs: - fqbn: arduino:samd:arduino_zero_edbg platforms: | - name: arduino:samd + artifact-name-suffix: arduino-samd-arduino_zero_edbg - fqbn: arduino:samd:mkrzero platforms: | - name: arduino:samd + artifact-name-suffix: arduino-samd-mkrzero - fqbn: arduino:samd:nano_33_iot platforms: | - name: arduino:samd + artifact-name-suffix: arduino-samd-nano_33_iot steps: - name: Checkout repository @@ -67,5 +70,5 @@ jobs: uses: actions/upload-artifact@v4 with: if-no-files-found: error + name: sketches-report-${{ matrix.board.artifact-name-suffix }} path: ${{ env.SKETCHES_REPORTS_PATH }} - name: ${{ env.SKETCHES_REPORTS_PATH }} From 01ac2e5ef2394b66490b738d732dc9126f205afe Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Wed, 14 Feb 2024 11:18:33 +0100 Subject: [PATCH 29/53] Release v1.1.1. --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index 7933150..b896c9a 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=ArduinoGraphics -version=1.1.0 +version=1.1.1 author=Arduino maintainer=Arduino sentence=Core graphics library for Arduino. From cac25edced590e38cc6e4867dadff514e185e69a Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Wed, 21 Feb 2024 06:56:45 +0100 Subject: [PATCH 30/53] Fix regression: report size delta size on PR. (#39) The necessary steps have in fact been documented here: https://github.com/arduino/report-size-deltas/blob/main/docs/FAQ.md#workflow-triggered-by-pull_request-event but I have overlooked them when I fixed the upload issue. With this PR the size deltas are - once again - reported within the PR. --- .github/workflows/compile-examples.yml | 27 ++++++++++++++++++++---- .github/workflows/report-size-deltas.yml | 24 --------------------- 2 files changed, 23 insertions(+), 28 deletions(-) delete mode 100644 .github/workflows/report-size-deltas.yml diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index d80f79f..13d1e0f 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -20,14 +20,15 @@ on: workflow_dispatch: repository_dispatch: +env: + # It's convenient to set variables for values used multiple times in the workflow. + SKETCHES_REPORTS_PATH: sketches-reports + jobs: - build: + compile: name: ${{ matrix.board.fqbn }} runs-on: ubuntu-latest - env: - SKETCHES_REPORTS_PATH: sketches-reports - strategy: fail-fast: false @@ -72,3 +73,21 @@ jobs: if-no-files-found: error name: sketches-report-${{ matrix.board.artifact-name-suffix }} path: ${{ env.SKETCHES_REPORTS_PATH }} + + # When using a matrix to compile for multiple boards, it's necessary to use a separate job for the deltas report + report: + needs: compile # Wait for the compile job to finish to get the data for the report + if: github.event_name == 'pull_request' # Only run the job when the workflow is triggered by a pull request + runs-on: ubuntu-latest + + steps: + # This step is needed to get the size data produced by the compile jobs + - name: Download sketches reports artifacts + uses: actions/download-artifact@v4 + with: + # All workflow artifacts will be downloaded to this location. + path: ${{ env.SKETCHES_REPORTS_PATH }} + + - uses: arduino/report-size-deltas@v1 + with: + sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }} diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml deleted file mode 100644 index 652be5d..0000000 --- a/.github/workflows/report-size-deltas.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Report Size Deltas - -# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows -on: - push: - paths: - - ".github/workflows/report-size-deltas.yml" - schedule: - # Run at the minimum interval allowed by GitHub Actions. - # Note: GitHub Actions periodically has outages which result in workflow failures. - # In this event, the workflows will start passing again once the service recovers. - - cron: "*/5 * * * *" - workflow_dispatch: - repository_dispatch: - -jobs: - report: - runs-on: ubuntu-latest - steps: - - name: Comment size deltas reports to PRs - uses: arduino/report-size-deltas@v1 - with: - # The name of the workflow artifact created by the sketch compilation workflow - sketches-reports-source: sketches-reports From ab427be6d27fb22de28e96db4f435f1f3fcfe8c4 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Wed, 21 Feb 2024 18:55:39 +0100 Subject: [PATCH 31/53] Revert "Fix regression: report size delta size on PR. (#39)" This reverts commit cac25edced590e38cc6e4867dadff514e185e69a. --- .github/workflows/compile-examples.yml | 27 ++++-------------------- .github/workflows/report-size-deltas.yml | 24 +++++++++++++++++++++ 2 files changed, 28 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/report-size-deltas.yml diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 13d1e0f..d80f79f 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -20,15 +20,14 @@ on: workflow_dispatch: repository_dispatch: -env: - # It's convenient to set variables for values used multiple times in the workflow. - SKETCHES_REPORTS_PATH: sketches-reports - jobs: - compile: + build: name: ${{ matrix.board.fqbn }} runs-on: ubuntu-latest + env: + SKETCHES_REPORTS_PATH: sketches-reports + strategy: fail-fast: false @@ -73,21 +72,3 @@ jobs: if-no-files-found: error name: sketches-report-${{ matrix.board.artifact-name-suffix }} path: ${{ env.SKETCHES_REPORTS_PATH }} - - # When using a matrix to compile for multiple boards, it's necessary to use a separate job for the deltas report - report: - needs: compile # Wait for the compile job to finish to get the data for the report - if: github.event_name == 'pull_request' # Only run the job when the workflow is triggered by a pull request - runs-on: ubuntu-latest - - steps: - # This step is needed to get the size data produced by the compile jobs - - name: Download sketches reports artifacts - uses: actions/download-artifact@v4 - with: - # All workflow artifacts will be downloaded to this location. - path: ${{ env.SKETCHES_REPORTS_PATH }} - - - uses: arduino/report-size-deltas@v1 - with: - sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }} diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml new file mode 100644 index 0000000..652be5d --- /dev/null +++ b/.github/workflows/report-size-deltas.yml @@ -0,0 +1,24 @@ +name: Report Size Deltas + +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows +on: + push: + paths: + - ".github/workflows/report-size-deltas.yml" + schedule: + # Run at the minimum interval allowed by GitHub Actions. + # Note: GitHub Actions periodically has outages which result in workflow failures. + # In this event, the workflows will start passing again once the service recovers. + - cron: "*/5 * * * *" + workflow_dispatch: + repository_dispatch: + +jobs: + report: + runs-on: ubuntu-latest + steps: + - name: Comment size deltas reports to PRs + uses: arduino/report-size-deltas@v1 + with: + # The name of the workflow artifact created by the sketch compilation workflow + sketches-reports-source: sketches-reports From c9ec0e44178f5788319edd9706e90533286e44ca Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Wed, 21 Feb 2024 18:56:12 +0100 Subject: [PATCH 32/53] Correct workflow artifact name pattern in size deltas report workflow The "sketches-reports-source" input of the "arduino/report-size-deltas" GitHub Actions action defines the regular expression that matches the names of the sketches report workflow artifacts produced by the "Compile Examples" workflow. The key string in the names of these artifacts was set to "sketches-report" when the "Compile Examples" workflow was adjusted for compatibility with the breaking changes introduced by updating to version 4.x of the workflow's "actions/upload-artifact" GitHub Actions action dependency. The pattern set in the size deltas report workflow was "sketches-reports". The "s" at the end of that pattern caused it to no longer match against the key string in the artifact names after that adjustment of the "Compile Examples" workflow, resulting in size deltas reports no longer being generated by the workflow. Although a minimal fix would be to simply remove the "s" from the end of the pattern, the decision was made to use a more strict regular expression. This will make it easier for maintainers and contributors to understand that this value is a regular expression and the exact nature of how that regular expression functio --- .github/workflows/report-size-deltas.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml index 652be5d..39e2a0a 100644 --- a/.github/workflows/report-size-deltas.yml +++ b/.github/workflows/report-size-deltas.yml @@ -20,5 +20,5 @@ jobs: - name: Comment size deltas reports to PRs uses: arduino/report-size-deltas@v1 with: - # The name of the workflow artifact created by the sketch compilation workflow - sketches-reports-source: sketches-reports + # Regex matching the names of the workflow artifacts created by the "Compile Examples" workflow + sketches-reports-source: ^sketches-report-.+ From 72388e28e8ad2e44211917dfffc7d3571f609513 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Thu, 22 Feb 2024 10:12:03 +0100 Subject: [PATCH 33/53] Fix: do not crash on ASCII chars with a numeric value exceeding 127. (#41) --- src/ArduinoGraphics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ArduinoGraphics.cpp b/src/ArduinoGraphics.cpp index 3590eec..b47c2b5 100644 --- a/src/ArduinoGraphics.cpp +++ b/src/ArduinoGraphics.cpp @@ -238,7 +238,7 @@ void ArduinoGraphics::text(const char* str, int x, int y) } while (*str) { - int c = *str++; + uint8_t const c = (uint8_t)*str++; if (c == '\n') { y += _font->height; From 7c067b602e9c449bb67d2743ea6f50fa54f12c20 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Thu, 22 Feb 2024 10:43:13 +0100 Subject: [PATCH 34/53] Update font generator script to work with python 3.x --- extras/generate_font.py | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/extras/generate_font.py b/extras/generate_font.py index de786e5..016f634 100755 --- a/extras/generate_font.py +++ b/extras/generate_font.py @@ -60,22 +60,27 @@ out = open(output, "w") -print >> out, "#include \"Font.h\"" -print >> out -print >> out, "const struct Font %s = {" % ( name ) -print >> out, " %d," % ( fontWidth ) -print >> out, " %d," % ( fontHeight ) -print >> out, " (const uint8_t*[]){" +out.write("#include \"Font.h\"\n") +out.write("\n") +out.write("const struct Font %s = {" % ( name )) +out.write("\n") +out.write(" %d," % ( fontWidth )) +out.write("\n") +out.write(" %d," % ( fontHeight )) +out.write("\n") +out.write(" (const uint8_t*[]){\n") for c in range (0, 255): if None == fontCharacters[c]: - print >> out, " NULL," + out.write(" NULL,\n") else: - print >> out, " // %s" % (fontCharacterNames[c]) - print >> out, " (const uint8_t[]){" + out.write(" // %s" % (fontCharacterNames[c])) + out.write("\n") + out.write(" (const uint8_t[]){\n") for i in range(0, fontHeight): - print >> out, " 0b%s," % ('{0:08b}'.format(fontCharacters[c][i])) - print >> out, " }," -print >> out, " }" -print >> out, "};" + out.write(" 0b%s," % ('{0:08b}'.format(fontCharacters[c][i]))) + out.write("\n") + out.write(" },\n") +out.write(" }\n") +out.write("};\n") out.close() From 8d32f4edf46d335a289c33c184480830a5695255 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Thu, 22 Feb 2024 10:45:33 +0100 Subject: [PATCH 35/53] Add minimum documentation on how to generate a font bitmap. --- README.adoc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.adoc b/README.adoc index a77a80e..eeee79b 100644 --- a/README.adoc +++ b/README.adoc @@ -28,3 +28,10 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +== How-to generate bitmaps from the fonts == +[source,bash] +---- +cd extra +./generate_font.py 5x7.bdf Font_5x7.c Font_5x7 +---- From e9fdae19160c260609f0ff3e1d462cc24eb7ba90 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Thu, 22 Feb 2024 12:25:55 +0100 Subject: [PATCH 36/53] Release v1.1.2. --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index b896c9a..3ee6369 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=ArduinoGraphics -version=1.1.1 +version=1.1.2 author=Arduino maintainer=Arduino sentence=Core graphics library for Arduino. From e0928dab86af9feeaa91448093b3650766c3a013 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Mar 2024 14:47:56 +0100 Subject: [PATCH 37/53] Bump geekyeggo/delete-artifact from 4 to 5 (#43) Bumps [geekyeggo/delete-artifact](https://github.com/geekyeggo/delete-artifact) from 4 to 5. - [Release notes](https://github.com/geekyeggo/delete-artifact/releases) - [Changelog](https://github.com/GeekyEggo/delete-artifact/blob/main/CHANGELOG.md) - [Commits](https://github.com/geekyeggo/delete-artifact/compare/v4...v5) --- updated-dependencies: - dependency-name: geekyeggo/delete-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/sync-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 47ac50a..53a9f54 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -114,7 +114,7 @@ jobs: path: ${{ env.CONFIGURATIONS_FOLDER }} - name: Remove unneeded artifact - uses: geekyeggo/delete-artifact@v4 + uses: geekyeggo/delete-artifact@v5 with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} From bdfd5040817575e5f46399be34b4ac3616443aa6 Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 28 May 2024 02:26:51 -0700 Subject: [PATCH 38/53] Remove superfluous blank lines from documentation Previously, the documentation contained a large number of unnecessary blank lines. Since these serve no purpose and give the source content an unprofessional and sloppy appearance, they are removed. --- docs/api.md | 137 ---------------------------------------------------- 1 file changed, 137 deletions(-) diff --git a/docs/api.md b/docs/api.md index a870920..6940ae4 100644 --- a/docs/api.md +++ b/docs/api.md @@ -6,7 +6,6 @@ #### Description - Initializes the graphics device. #### Syntax @@ -15,7 +14,6 @@ Initializes the graphics device. YourScreen.begin() ``` - #### Parameters None @@ -33,8 +31,6 @@ if (!YourScreen.begin() { } ``` - - ### `end()` #### Description @@ -45,16 +41,12 @@ Stops the graphics device. ``` YourScreen.end() - ``` - #### Parameters - None - #### Returns Nothing @@ -65,26 +57,20 @@ Nothing YourScreen.end(); ``` - - ### `width()` #### Description - Returns the pixel width of the graphics device. #### Syntax ``` YourScreen.width() - ``` - #### Parameters - None #### Returns @@ -97,25 +83,20 @@ Returns the pixel width of the graphics device. int w = YourScreen.width(); ``` - ### `height()` #### Description - Returns the pixel height of the graphics device. #### Syntax ``` YourScreen.height() - ``` - #### Parameters - None #### Returns @@ -128,62 +109,48 @@ Returns the pixel height of the graphics device. int h = YourScreen.height(); ``` - ### `beginDraw()` #### Description - Begins a drawing operation. #### Syntax ``` YourScreen.beginDraw() - ``` - #### Parameters - None - #### Returns Nothing #### Example - YourScreen.beginDraw(); YourScreen.set(0, 0, 255, 0, 0); YourScreen.endDraw(); - - ### `endDraw()` #### Description - Ends a drawing operation, any drawing operations after beginDraw() is called will be displayed to the screen. #### Syntax ``` YourScreen.endDraw() - ``` - #### Parameters - None - #### Returns Nothing @@ -196,12 +163,10 @@ YourScreen.set(0, 0, 255, 0, 0); YourScreen.endDraw(); ``` - ### `background()` #### Description - Set the background color of drawing operations. Used when calling clear() or drawing text. #### Syntax @@ -209,13 +174,10 @@ Set the background color of drawing operations. Used when calling clear() or dra ``` YourScreen.background(r, g, b) YourScreen.background(color) - ``` - #### Parameters - - r: red color value (0 - 255) - g: green color value (0 - 255) - b: blue color value (0 - 255) @@ -234,28 +196,22 @@ YourScreen.clear(); YourScreen.endDraw(); ``` - ### `clear()` #### Description - Set clear the screen contents, uses the background colour set in background(). #### Syntax ``` YourScreen.clear() - ``` - #### Parameters - None - #### Returns Nothing @@ -269,13 +225,10 @@ YourScreen.clear(); YourScreen.endDraw(); ``` - - ### `fill()` #### Description - Set the fill color of drawing operations. #### Syntax @@ -283,13 +236,10 @@ Set the fill color of drawing operations. ``` YourScreen.fill(r, g, b) YourScreen.fill(color) - ``` - #### Parameters - - r: red color value (0 - 255) - g: green color value (0 - 255) - b: blue color value (0 - 255) @@ -310,28 +260,22 @@ YourScreen.rect(0, 0, YourScreen.width(), YourScreen.height()); YourScreen.endDraw(); ``` - ### `noFill()` #### Description - Clears the fill color of drawing operations. #### Syntax ``` YourScreen.noFill() - ``` - #### Parameters - None - #### Returns Nothing @@ -347,12 +291,10 @@ YourScreen.rect(0, 0, YourScreen.width(), YourScreen.height()); YourScreen.endDraw(); ``` - ### `stroke()` #### Description - Set the stroke color of drawing operations. #### Syntax @@ -360,13 +302,10 @@ Set the stroke color of drawing operations. ``` YourScreen.stroke(r, g, b) YourScreen.stroke(color) - ``` - #### Parameters - - r: red color value (0 - 255) - g: green color value (0 - 255) - b: blue color value (0 - 255) @@ -387,29 +326,22 @@ YourScreen.rect(0, 0, YourScreen.width(), YourScreen.height()); YourScreen.endDraw(); ``` - - ### `noStroke()` #### Description - Clears the stroke color of drawing operations. #### Syntax ``` YourScreen.noStroke() - ``` - #### Parameters - None - #### Returns Nothing @@ -425,25 +357,20 @@ YourScreen.rect(0, 0, YourScreen.width(), YourScreen.height()); YourScreen.endDraw(); ``` - ### `line()` #### Description - Stroke a line, uses the stroke color set in stroke(). #### Syntax ``` YourScreen.line(x1, y1, x2, y2) - ``` - #### Parameters - - x1: x position of the starting point of the line - y1: y position of the starting point of the line - x2: x position of the end point of the line @@ -463,25 +390,20 @@ YourScreen.line(0, 0, YourScreen.width() - 1, YourScreen.height() - 1); YourScreen.endDraw(); ``` - ### `point()` #### Description - Stroke a point, uses the stroke color set in stroke(). #### Syntax ``` YourScreen.point(x, y) - ``` - #### Parameters - x: x position of the point y: y position of the point @@ -499,25 +421,20 @@ YourScreen.point(1, 1); YourScreen.endDraw(); ``` - ### `rect()` #### Description - Stroke and fill a rectangle, uses the stroke color set in stroke() and the fill color set in fill(). #### Syntax ``` YourScreen.rect(x, y, width, height) - ``` - #### Parameters - - x: x position of the rectangle - y: y position of the rectangle - width: width of the rectangle @@ -538,25 +455,20 @@ YourScreen.rect(0, 0, YourScreen.width(), YourScreen.height()); YourScreen.endDraw(); ``` - ### `circle()` #### Description - Stroke and fill a circle, uses the stroke color set in stroke() and the fill color set in fill(). #### Syntax ``` YourScreen.circle(x, y, diameter) - ``` - #### Parameters - - x: x center position of the circle - y: y center position of the circle - diameter: diameter of the circle @@ -576,25 +488,20 @@ YourScreen.circle(YourScreen.width()/2, YourScreen.height()/2, YourScreen.height YourScreen.endDraw(); ``` - ### `ellipse()` #### Description - Stroke and fill an ellipse, uses the stroke color set in stroke() and the fill color set in fill(). #### Syntax ``` YourScreen.ellipse(x, y, width, height) - ``` - #### Parameters - - x: x center position of the ellipse - y: y center position of the ellipse - width: width of the ellipse @@ -615,12 +522,10 @@ YourScreen.ellipse(YourScreen.width()/2, YourScreen.height()/2, YourScreen.width YourScreen.endDraw(); ``` - ### `text()` #### Description - Draw some text, uses the stroke color set in stroke() and the background color set in background(). #### Syntax @@ -628,13 +533,10 @@ Draw some text, uses the stroke color set in stroke() and the background color s ``` YourScreen.text(string) YourScreen.text(string, x, y) - ``` - #### Parameters - - string: string to draw - x: x position for the start of the text - y: y position for the start of the text @@ -653,28 +555,22 @@ YourScreen.text("abc", 0, 1); YourScreen.endDraw(); ``` - ### `textFont()` #### Description - Sets the font uses for text. The library current has the Font_4x6 and Font_5x7 built in. #### Syntax ``` YourScreen.textFont(font) - ``` - #### Parameters - font: font to set - #### Returns Nothing @@ -690,12 +586,10 @@ YourScreen.text("abc", 0, 1); YourScreen.endDraw(); ``` - ### `textFontWidth()` #### Description - Returns the width, in pixels, of the current font. #### Syntax @@ -705,13 +599,10 @@ YourScreen.textFontWidth() ``` - #### Parameters - None - #### Returns Nothing @@ -722,28 +613,22 @@ Nothing int w = YourScreen.textFontWidth(); ``` - ### `textFontHeight()` #### Description - Returns the height, in pixels, of the current font. #### Syntax ``` YourScreen.textFontHeight() - ``` - #### Parameters - None - #### Returns Nothing @@ -754,12 +639,10 @@ Nothing int h = YourScreen.textFontHeight(); ``` - ### `set()` #### Description - Set a pixel’s color value. #### Syntax @@ -767,13 +650,10 @@ Set a pixel’s color value. ``` YourScreen.set(x, y, r, g, b) YourScreen.set(x, y, color) - ``` - #### Parameters - x: x position of the pixel y: y position of the pixel r: red color value (0 - 255) @@ -793,12 +673,10 @@ YourScreen.point(1, 1, 0, 255, 0); YourScreen.endDraw(); ``` - ### `beginText()` #### Description - Start the process of displaying and optionally scrolling text. The Print interface can be used to set the text. #### Syntax @@ -807,13 +685,10 @@ Start the process of displaying and optionally scrolling text. The Print interfa YourScreen.beginText() YourScreen.beginText(x, y, r, g, b) YourScreen.beginText(x, y, color) - ``` - #### Parameters - x: x position of the text y: y position of the text r: red color value (0 - 255) @@ -833,12 +708,10 @@ YourScreen.print("Hi"); YourScreen.endText(); ``` - ### `endText()` #### Description - End the process of displaying and optionally scrolling text. #### Syntax @@ -846,13 +719,10 @@ End the process of displaying and optionally scrolling text. ``` YourScreen.endText() YourScreen.endText(scrollDirection) - ``` - #### Parameters - scrollDirection: (optional) the direction to scroll, defaults to NO_SCROLL if not provided. Valid options are NO_SCROLL, SCROLL_LEFT, SCROLL_RIGHT, SCROLL_UP, SCROLL_DOWN #### Returns @@ -867,28 +737,22 @@ YourScreen.print("Hi"); YourScreen.endText(); ``` - ### `textScrollSpeed()` #### Description - Sets the text scrolling speed, the speed controls the delay in milliseconds between scrolling each pixel. #### Syntax ``` YourScreen.textScrollSpeed(speed) - ``` - #### Parameters - speed: scroll speed - #### Returns Nothing @@ -901,4 +765,3 @@ YourScreen.textScrollSpeed(500); YourScreen.print("Hello There!"); YourScreen.endText(true); ``` - From df7a773e51f43ff8c39929b0e268cfc60c46a8f7 Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 28 May 2024 02:28:38 -0700 Subject: [PATCH 39/53] Correct syntax errors in documentation code snippet --- docs/api.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api.md b/docs/api.md index 6940ae4..f4d9b59 100644 --- a/docs/api.md +++ b/docs/api.md @@ -25,8 +25,8 @@ None #### Example ``` -if (!YourScreen.begin() { - Serial.println(“Failed to initialize the display!”); +if (!YourScreen.begin()) { + Serial.println("Failed to initialize the display!"); while (1); } ``` From 96b58bb28fc38e68e6c2cde76687642e82c20269 Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 28 May 2024 02:35:13 -0700 Subject: [PATCH 40/53] Add missing markup to API documentation --- docs/api.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/api.md b/docs/api.md index f4d9b59..cc2e698 100644 --- a/docs/api.md +++ b/docs/api.md @@ -131,9 +131,11 @@ Nothing #### Example +``` YourScreen.beginDraw(); YourScreen.set(0, 0, 255, 0, 0); YourScreen.endDraw(); +``` ### `endDraw()` From a3e7f1eb86f15b1e6aa090a8ee2c15e2305d8cdf Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 28 May 2024 02:35:45 -0700 Subject: [PATCH 41/53] Fix typos in documentation --- README.adoc | 2 +- docs/api.md | 4 ++-- docs/readme.md | 2 +- extras/generate_font.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.adoc b/README.adoc index eeee79b..83baac9 100644 --- a/README.adoc +++ b/README.adoc @@ -32,6 +32,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA == How-to generate bitmaps from the fonts == [source,bash] ---- -cd extra +cd extras ./generate_font.py 5x7.bdf Font_5x7.c Font_5x7 ---- diff --git a/docs/api.md b/docs/api.md index cc2e698..db063a3 100644 --- a/docs/api.md +++ b/docs/api.md @@ -202,7 +202,7 @@ YourScreen.endDraw(); #### Description -Set clear the screen contents, uses the background colour set in background(). +Clear the screen contents, uses the background colour set in background(). #### Syntax @@ -561,7 +561,7 @@ YourScreen.endDraw(); #### Description -Sets the font uses for text. The library current has the Font_4x6 and Font_5x7 built in. +Sets the font used for text. The library current has the Font_4x6 and Font_5x7 built in. #### Syntax diff --git a/docs/readme.md b/docs/readme.md index 92ff8db..4260bca 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -1,6 +1,6 @@ # Arduino Graphics Library -This is a library that allows you to draw and write on screens with graphical primitives; it requires a specific hardware interfacce library to drive the screen you are using, therefore every screen type should have its own hardware specific library. +This is a library that allows you to draw and write on screens with graphical primitives; it requires a specific hardware interface library to drive the screen you are using, therefore every screen type should have its own hardware specific library. To use this library diff --git a/extras/generate_font.py b/extras/generate_font.py index 016f634..48efb84 100755 --- a/extras/generate_font.py +++ b/extras/generate_font.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# This file is part of the MKRRGBMatrix library. +# This file is part of the ArduinoGraphics library. # Copyright (c) 2018 Arduino SA. All rights reserved. # # This library is free software; you can redistribute it and/or From 0ea3666b05e5573ad9ae8148050dc62b560716eb Mon Sep 17 00:00:00 2001 From: kurte Date: Sun, 11 Aug 2024 16:58:55 -0700 Subject: [PATCH 42/53] Allow the fixed fonts to be scaled up. On larger displays, the two built in fonts are almost invisible. One possible solution is to supply some larger fonts. Another approach is to do, like several TFT display drivers do and allow you to scale the system fixed fonts up to a larger size. Decided this was the easiest approach, and did a quick implementation of it. Like the Adafruit displays, I allowed you to set different scale factors for X and Y. I added a scaledBitmap function which is a modified version of the current bitmap function. I also changed all of the text functions to use it. I left the unscalled version of the API, although I have it simply call the scaled version with scales 1 and 1, as since these methods are virtual, potentially some other subclasses might use and/or implement their own version. Updated the textFontWidth and textFontHeight to multiply the height * the scale as the one example sketch here needs it. I also updated the sketch to scale the canvas to take the font size into account. This appears to work with the changes and I have not used or tested the scroll code. Its sizing should be updated teh same way the test sketch was with the changes with the textFontWidth and textFontHeight changes Update api.md Forgot to update the AsciiDraw example sketch Code Review requested changes _textsize_x -> _textSizeX (ditto for y) setTextSize() -> textSize() scaledBitmap -> bitmap with the extra parameters with defaults --- docs/api.md | 35 ++++++++++++++++++++ examples/ASCIIDraw/ASCIIDraw.ino | 6 ++-- src/ArduinoGraphics.cpp | 57 ++++++++++++++++++++------------ src/ArduinoGraphics.h | 7 +++- 4 files changed, 81 insertions(+), 24 deletions(-) diff --git a/docs/api.md b/docs/api.md index db063a3..8827301 100644 --- a/docs/api.md +++ b/docs/api.md @@ -641,6 +641,41 @@ Nothing int h = YourScreen.textFontHeight(); ``` +### `textSize()` + +#### Description + +Set a text scale factor + +#### Syntax + +``` +YourScreen.textSize(scale) +YourScreen.textSize(scaleX, scaleY) +``` + +#### Parameters + +scale: scale factor used for both x and y +scaleX: x scale factor +scaleY: y scale factor + +#### Returns + +Nothing + +#### Example + +``` +YourScreen.beginDraw(); +YourScreen.clear(); +YourScreen.stroke(255, 255, 255); +YourScreen.textFont(Font_5x7); +YourScreen.textSize(5); +YourScreen.text("abc", 0, 1); +YourScreen.endDraw(); +``` + ### `set()` #### Description diff --git a/examples/ASCIIDraw/ASCIIDraw.ino b/examples/ASCIIDraw/ASCIIDraw.ino index 398a40d..dfb6bb3 100644 --- a/examples/ASCIIDraw/ASCIIDraw.ino +++ b/examples/ASCIIDraw/ASCIIDraw.ino @@ -14,8 +14,9 @@ #include -const byte canvasWidth = 61; -const byte canvasHeight = 27; +const byte fontSize = 3; +const byte canvasWidth = fontSize * (5 * 7) + 26; +const byte canvasHeight = fontSize * 7 + 20; class ASCIIDrawClass : public ArduinoGraphics { public: @@ -85,6 +86,7 @@ void setup() { ASCIIDraw.stroke('@', 0, 0); const char text[] = "ARDUINO"; ASCIIDraw.textFont(Font_5x7); + ASCIIDraw.textSize(fontSize); const byte textWidth = strlen(text) * ASCIIDraw.textFontWidth(); const byte textHeight = ASCIIDraw.textFontHeight(); const byte textX = (canvasWidth - textWidth) / 2; diff --git a/src/ArduinoGraphics.cpp b/src/ArduinoGraphics.cpp index b47c2b5..8ed68a0 100644 --- a/src/ArduinoGraphics.cpp +++ b/src/ArduinoGraphics.cpp @@ -26,7 +26,9 @@ ArduinoGraphics::ArduinoGraphics(int width, int height) : _width(width), _height(height), - _font(NULL) + _font(NULL), + _textSizeX(1), + _textSizeY(1) { } @@ -241,7 +243,7 @@ void ArduinoGraphics::text(const char* str, int x, int y) uint8_t const c = (uint8_t)*str++; if (c == '\n') { - y += _font->height; + y += _font->height * _textSizeY; } else if (c == '\r') { x = 0; } else if (c == 0xc2 || c == 0xc3) { @@ -254,10 +256,10 @@ void ArduinoGraphics::text(const char* str, int x, int y) } if (b) { - bitmap(b, x, y, _font->width, _font->height); + bitmap(b, x, y, _font->width, _font->height, _textSizeX, _textSizeY); } - x += _font->width; + x += _font->width * _textSizeX; } } } @@ -269,38 +271,51 @@ void ArduinoGraphics::textFont(const Font& which) int ArduinoGraphics::textFontWidth() const { - return (_font ? _font->width : 0); + return (_font ? _font->width * _textSizeX : 0); } int ArduinoGraphics::textFontHeight() const { - return (_font ? _font->height : 0); + return (_font ? _font->height* _textSizeY : 0); } -void ArduinoGraphics::bitmap(const uint8_t* data, int x, int y, int width, int height) +void ArduinoGraphics::textSize(uint8_t sx, uint8_t sy) { - if (!_stroke) { + _textSizeX = (sx > 0)? sx : 1; + _textSizeY = (sy > 0)? sy : 1; +} + + +void ArduinoGraphics::bitmap(const uint8_t* data, int x, int y, int w, int h, uint8_t scale_x, uint8_t scale_y) { + if (!_stroke || !scale_x || !scale_y) { return; } - if ((data == NULL) || ((x + width) < 0) || ((y + height) < 0) || (x > _width) || (y > _height)) { + if ((data == nullptr) || ((x + (w * scale_x) < 0)) || ((y + (h * scale_y) < 0)) || (x > _width) || (y > _height)) { // offscreen return; } - for (int j = 0; j < height; j++) { + int xStart = x; + for (int j = 0; j < h; j++) { uint8_t b = data[j]; - - for (int i = 0; i < width; i++) { - if (b & (1 << (7 - i))) { - set(x + i, y + j, _strokeR, _strokeG, _strokeB); - } else { - set(x + i, y + j, _backgroundR, _backgroundG, _backgroundB); + for (uint8_t ys = 0; ys < scale_y; ys++) { + if (ys >= _height) return; + x = xStart; // reset for each row + for (int i = 0; i < w; i++) { + if (b & (1 << (7 - i))) { + for (uint8_t xs = 0; xs < scale_x; xs++) set(x++, y, _strokeR, _strokeG, _strokeB); + } else { + for (uint8_t xs = 0; xs < scale_x; xs++) set(x++, y, _backgroundR, _backgroundG, _backgroundB); + } + if (x >= _width) break; } + y++; } } } + void ArduinoGraphics::imageRGB(const Image& img, int x, int y, int width, int height) { const uint8_t* data = img.data(); @@ -359,7 +374,7 @@ void ArduinoGraphics::image(const Image& img, int x, int y) void ArduinoGraphics::image(const Image& img, int x, int y, int width, int height) { - if (!img || ((x + width) < 0) || ((y + height) < 0) || (x > _width) || (y > height)) { + if (!img || ((x + width) < 0) || ((y + height) < 0) || (x > _width) || (y > _height)) { // offscreen return; } @@ -438,7 +453,7 @@ void ArduinoGraphics::endText(int scrollDirection) beginDraw(); int const text_x = _textX - i; text(_textBuffer, text_x, _textY); - bitmap(_font->data[0x20], text_x - 1, _textY, 1, _font->height); + bitmap(_font->data[0x20], text_x - 1, _textY, 1, _font->height, _textSizeX, _textSizeY); endDraw(); delay(_textScrollSpeed); @@ -450,7 +465,7 @@ void ArduinoGraphics::endText(int scrollDirection) beginDraw(); int const text_x = _textX - (scrollLength - i - 1); text(_textBuffer, text_x, _textY); - bitmap(_font->data[0x20], text_x - 1, _textY, 1, _font->height); + bitmap(_font->data[0x20], text_x - 1, _textY, 1, _font->height, _textSizeX, _textSizeY); endDraw(); delay(_textScrollSpeed); @@ -462,7 +477,7 @@ void ArduinoGraphics::endText(int scrollDirection) beginDraw(); int const text_y = _textY - i; text(_textBuffer, _textX, text_y); - bitmap(_font->data[0x20], _textX, text_y - 1, _font->width, 1); + bitmap(_font->data[0x20], _textX, text_y - 1, _font->width, 1, _textSizeX, _textSizeY); endDraw(); delay(_textScrollSpeed); @@ -474,7 +489,7 @@ void ArduinoGraphics::endText(int scrollDirection) beginDraw(); int const text_y = _textY - (scrollLength - i - 1); text(_textBuffer, _textX, text_y); - bitmap(_font->data[0x20], _textX, text_y - 1, _font->width, 1); + bitmap(_font->data[0x20], _textX, text_y - 1, _font->width, 1, _textSizeX, _textSizeY); endDraw(); delay(_textScrollSpeed); diff --git a/src/ArduinoGraphics.h b/src/ArduinoGraphics.h index 1f1c914..3386dfa 100644 --- a/src/ArduinoGraphics.h +++ b/src/ArduinoGraphics.h @@ -70,6 +70,8 @@ class ArduinoGraphics : public Print { virtual void text(const char* str, int x = 0, int y = 0); virtual void text(const String& str, int x = 0, int y = 0) { text(str.c_str(), x, y); } virtual void textFont(const Font& which); + virtual void textSize(uint8_t s) {textSize(s, s);} + virtual void textSize(uint8_t sx, uint8_t sy); virtual int textFontWidth() const; virtual int textFontHeight() const; @@ -91,7 +93,8 @@ class ArduinoGraphics : public Print { virtual void textScrollSpeed(unsigned long speed = 150); protected: - virtual void bitmap(const uint8_t* data, int x, int y, int width, int height); + virtual void bitmap(const uint8_t* data, int x, int y, int w, int h, uint8_t scale_x = 1, + uint8_t scale_y = 1); virtual void imageRGB(const Image& img, int x, int y, int width, int height); virtual void imageRGB24(const Image& img, int x, int y, int width, int height); virtual void imageRGB16(const Image& img, int x, int y, int width, int height); @@ -114,6 +117,8 @@ class ArduinoGraphics : public Print { uint8_t _textR, _textG, _textB; int _textX; int _textY; + uint8_t _textSizeX; + uint8_t _textSizeY; unsigned long _textScrollSpeed; }; From 676f83ca7a9a766d246a98be7d8d2f232a259d8e Mon Sep 17 00:00:00 2001 From: Omar Ali Hassan <36759605+OmarAli3@users.noreply.github.com> Date: Mon, 30 Mar 2020 12:17:59 +0200 Subject: [PATCH 43/53] add function to clear specific point --- src/ArduinoGraphics.cpp | 5 +++++ src/ArduinoGraphics.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/ArduinoGraphics.cpp b/src/ArduinoGraphics.cpp index 8ed68a0..852c273 100644 --- a/src/ArduinoGraphics.cpp +++ b/src/ArduinoGraphics.cpp @@ -96,6 +96,11 @@ void ArduinoGraphics::clear() } } +void ArduinoGraphics::clear(int x, int y) +{ + set(x, y, _backgroundR, _backgroundB, _backgroundG); +} + void ArduinoGraphics::fill(uint8_t r, uint8_t g, uint8_t b) { _fill = true; diff --git a/src/ArduinoGraphics.h b/src/ArduinoGraphics.h index 3386dfa..69166e6 100644 --- a/src/ArduinoGraphics.h +++ b/src/ArduinoGraphics.h @@ -51,6 +51,7 @@ class ArduinoGraphics : public Print { void background(uint8_t r, uint8_t g, uint8_t b); void background(uint32_t color); void clear(); + void clear(int x, int y); //clear specific point void fill(uint8_t r, uint8_t g, uint8_t b); void fill(uint32_t color); void noFill(); From 04aa61b5a337a6a13143fe1d8af1b5c36acb1e20 Mon Sep 17 00:00:00 2001 From: Omar Ali Hassan Date: Wed, 4 Sep 2024 09:38:09 -0700 Subject: [PATCH 44/53] Update src/ArduinoGraphics.h to remove unnecessary comment Co-authored-by: Leonardo Cavagnis <45899760+leonardocavagnis@users.noreply.github.com> --- src/ArduinoGraphics.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ArduinoGraphics.h b/src/ArduinoGraphics.h index 69166e6..6776f86 100644 --- a/src/ArduinoGraphics.h +++ b/src/ArduinoGraphics.h @@ -51,7 +51,7 @@ class ArduinoGraphics : public Print { void background(uint8_t r, uint8_t g, uint8_t b); void background(uint32_t color); void clear(); - void clear(int x, int y); //clear specific point + void clear(int x, int y); void fill(uint8_t r, uint8_t g, uint8_t b); void fill(uint32_t color); void noFill(); From 4572a10257e34de1e5e60b2ea306336e23212eaf Mon Sep 17 00:00:00 2001 From: Omar Ali Date: Wed, 4 Sep 2024 20:00:52 +0300 Subject: [PATCH 45/53] Update API documentation for clear() method --- docs/api.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/api.md b/docs/api.md index 8827301..004b2b6 100644 --- a/docs/api.md +++ b/docs/api.md @@ -202,17 +202,19 @@ YourScreen.endDraw(); #### Description -Clear the screen contents, uses the background colour set in background(). +Clear the screen contents or a specific pixel, uses the background colour set in background(). #### Syntax ``` YourScreen.clear() +YourScreen.clear(x, y) ``` #### Parameters -None +- x: x position of the pixel to clear +- y: y position of the pixel to clear #### Returns From 5696697fabd30e2d60679d1c2856180ff8911864 Mon Sep 17 00:00:00 2001 From: Leonardo Cavagnis <45899760+leonardocavagnis@users.noreply.github.com> Date: Thu, 5 Sep 2024 11:37:29 +0200 Subject: [PATCH 46/53] Update library.properties Release v1.1.3. --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index 3ee6369..8378e06 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=ArduinoGraphics -version=1.1.2 +version=1.1.3 author=Arduino maintainer=Arduino sentence=Core graphics library for Arduino. From 206c7269b637bc963b0d1a2170fc7071264a6694 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 02:47:02 +0000 Subject: [PATCH 47/53] Bump arduino/arduino-lint-action from 1 to 2 Bumps [arduino/arduino-lint-action](https://github.com/arduino/arduino-lint-action) from 1 to 2. - [Release notes](https://github.com/arduino/arduino-lint-action/releases) - [Commits](https://github.com/arduino/arduino-lint-action/compare/v1...v2) --- updated-dependencies: - dependency-name: arduino/arduino-lint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/check-arduino.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-arduino.yml b/.github/workflows/check-arduino.yml index adb330f..e818685 100644 --- a/.github/workflows/check-arduino.yml +++ b/.github/workflows/check-arduino.yml @@ -19,7 +19,7 @@ jobs: uses: actions/checkout@v4 - name: Arduino Lint - uses: arduino/arduino-lint-action@v1 + uses: arduino/arduino-lint-action@v2 with: compliance: specification library-manager: update From 9b2d4143b83f088b06e084b057b5a7fb8db73883 Mon Sep 17 00:00:00 2001 From: seaxwi <71350948+seaxwi@users.noreply.github.com> Date: Mon, 4 Nov 2024 16:03:29 +0100 Subject: [PATCH 48/53] Declare compatibility with renesas_uno architecture --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index 8378e06..0495428 100644 --- a/library.properties +++ b/library.properties @@ -6,5 +6,5 @@ sentence=Core graphics library for Arduino. paragraph=Based on the Processing API. category=Display url=http://github.com/arduino-libraries/ArduinoGraphics -architectures=samd +architectures=samd,renesas_uno includes=ArduinoGraphics.h From e0415f19cf540edd901bce76ba37f52e54440898 Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 11 Feb 2025 21:50:42 -0800 Subject: [PATCH 49/53] Correct scroll length for left and up directions Previously, the calculation for the distance of leftward and upward scrolling resulted in the text bitmap not being scrolled completely off the display. For leftward scrolling, this would be noticeable in the case where the bitmap of the last character in the string had populated pixels on the rightmost column. For upward scrolling, this would be noticeable in the case where the bitmap of any character in the string had populated pixels on the bottom row. --- src/ArduinoGraphics.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ArduinoGraphics.cpp b/src/ArduinoGraphics.cpp index 852c273..eef26da 100644 --- a/src/ArduinoGraphics.cpp +++ b/src/ArduinoGraphics.cpp @@ -452,7 +452,7 @@ void ArduinoGraphics::endText(int scrollDirection) stroke(_textR, _textG, _textB); if (scrollDirection == SCROLL_LEFT) { - int scrollLength = _textBuffer.length() * textFontWidth() + _textX; + int scrollLength = _textBuffer.length() * textFontWidth() + _textX + 1; for (int i = 0; i < scrollLength; i++) { beginDraw(); @@ -476,7 +476,7 @@ void ArduinoGraphics::endText(int scrollDirection) delay(_textScrollSpeed); } } else if (scrollDirection == SCROLL_UP) { - int scrollLength = textFontHeight() + _textY; + int scrollLength = textFontHeight() + _textY + 1; for (int i = 0; i < scrollLength; i++) { beginDraw(); From ce5ac8ec6497ceffc0c2e91432d8b15fd4bdd0bc Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 10 Feb 2025 19:12:43 -0800 Subject: [PATCH 50/53] Correct text scroll trail clearing coordinates calculation for left and up directions The `endText` function has the capability to scroll the printed text. In order to ensure artifacts are not left behind on the display while scrolling, the library must clear the pixels at the previous location of the text after each frame of the scrolling animation. Previously, the code to handle this clearing incorrectly calculated the clearing coordinates for the leftwards (`SCROLL_LEFT`) and upwards (`SCROLL_UP`) scroll directions, having two separate problems: * The offset was subtracted rather than added. * An offset of 1 was used, which did not consider the width/height of the text. This bug might not be immediately apparent to the user because many character bitmaps do not populate any pixels on the rightmost column or bottom row of the grid, and thus those characters provide incidental self scroll trail clearing. However, this is not the case for all characters and those would cause a trail of artifacts to be left behind on the display when scrolled. The clearing coordinates calculation code is hereby corrected. NOTE: The coordinates calculation will still be incorrect for multi-line strings. However, this is not a regression because it was also incorrect before this change. The scroll trail clearing code has never had any provisions for handling multi-line strings so addition of such support is out of scope for this commit. In addition, the text scrolling code (not the scroll trail clearing code) has never correctly handled horizontal scrolling of multi-line strings, so until that is fixed it is only the lack of correct scroll trail clearing for vertical scrolling that is impactful to users. --- src/ArduinoGraphics.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ArduinoGraphics.cpp b/src/ArduinoGraphics.cpp index 852c273..06f61da 100644 --- a/src/ArduinoGraphics.cpp +++ b/src/ArduinoGraphics.cpp @@ -458,7 +458,7 @@ void ArduinoGraphics::endText(int scrollDirection) beginDraw(); int const text_x = _textX - i; text(_textBuffer, text_x, _textY); - bitmap(_font->data[0x20], text_x - 1, _textY, 1, _font->height, _textSizeX, _textSizeY); + bitmap(_font->data[0x20], text_x + _textBuffer.length() * _font->width, _textY, 1, _font->height, _textSizeX, _textSizeY); endDraw(); delay(_textScrollSpeed); @@ -482,7 +482,7 @@ void ArduinoGraphics::endText(int scrollDirection) beginDraw(); int const text_y = _textY - i; text(_textBuffer, _textX, text_y); - bitmap(_font->data[0x20], _textX, text_y - 1, _font->width, 1, _textSizeX, _textSizeY); + bitmap(_font->data[0x20], _textX, text_y + _font->height, _font->width, 1, _textSizeX, _textSizeY); endDraw(); delay(_textScrollSpeed); From 83d6df0c238e9b39b40c3835f74897d62eba2409 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 10 Feb 2025 21:18:11 -0800 Subject: [PATCH 51/53] Clear trail for full string width when scrolling text vertically The `endText` function has the capability to scroll the printed text. In order to ensure artifacts are not left behind on the display while scrolling, the library must clear the pixels at the previous location of the text after each frame of the scrolling animation. Previously, the code to handle this clearing for vertical scrolling only cleared a single character's width. This meant that scroll trail clearing was only done for the first character in the string. This bug might not be immediately apparent to the user because many character bitmaps do not populate any pixels on the top or bottom row of the grid, and thus those characters provide incidental self scroll trail clearing. However, this is not the case for all characters and those would cause a trail of artifacts to be left behind on the display when scrolled. The vertical scroll trail clearing code is hereby corrected to cover the full width of the string. Previously the `ArduinoGraphics::bitmap` function was used by the clearing code. That approach was reasonable for clearing the scroll trail of a single character, but due to the function's eight pixel width limitation, it is not suitable to use with strings. In this application where a line of arbitrary length, but only one pixel thick is needed, the `ArduinoGraphics::line` function is the suitable tool. So the code is ported to using `ArduinoGraphics::line`. NOTE: The calculations of the length of the clearing line will still be incorrect for multi-line strings. However, this is not a regression because it was also incorrect before this change. The scroll trail clearing code has never had any provisions for handling multi-line strings so adding such support is out of scope for this commit. In addition, the text scrolling code (not the scroll trail clearing code) has never correctly handled horizontal scrolling of multi-line strings, so until that is fixed it is only the lack of correct scroll trail clearing for vertical scrolling that is impactful to users. --- .codespellrc | 2 +- src/ArduinoGraphics.cpp | 39 ++++++++++++++++++++++++++++++++++----- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/.codespellrc b/.codespellrc index 33d69d0..a41b93c 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,7 +1,7 @@ # See: https://github.com/codespell-project/codespell#using-a-config-file [codespell] # In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here: -ignore-words-list = mis +ignore-words-list = cleary,mis check-filenames = check-hidden = skip = ./.git diff --git a/src/ArduinoGraphics.cpp b/src/ArduinoGraphics.cpp index 06f61da..89083c0 100644 --- a/src/ArduinoGraphics.cpp +++ b/src/ArduinoGraphics.cpp @@ -448,17 +448,21 @@ void ArduinoGraphics::endText(int scrollDirection) uint8_t strokeG = _strokeG; uint8_t strokeB = _strokeB; - - stroke(_textR, _textG, _textB); - if (scrollDirection == SCROLL_LEFT) { int scrollLength = _textBuffer.length() * textFontWidth() + _textX; for (int i = 0; i < scrollLength; i++) { beginDraw(); + int const text_x = _textX - i; + stroke(_textR, _textG, _textB); text(_textBuffer, text_x, _textY); - bitmap(_font->data[0x20], text_x + _textBuffer.length() * _font->width, _textY, 1, _font->height, _textSizeX, _textSizeY); + + // clear previous position + const int clearX = text_x + _textBuffer.length() * _font->width; + stroke(_backgroundR, _backgroundG, _backgroundB); + line(clearX, _textY, clearX, _textY + _font->height - 1); + endDraw(); delay(_textScrollSpeed); @@ -468,9 +472,18 @@ void ArduinoGraphics::endText(int scrollDirection) for (int i = 0; i < scrollLength; i++) { beginDraw(); + int const text_x = _textX - (scrollLength - i - 1); + stroke(_textR, _textG, _textB); text(_textBuffer, text_x, _textY); + + // clear previous position + const int clearX = text_x - 1; + stroke(_backgroundR, _backgroundG, _backgroundB); + line(clearX, _textY, clearX, _textY + _font->height - 1); + bitmap(_font->data[0x20], text_x - 1, _textY, 1, _font->height, _textSizeX, _textSizeY); + endDraw(); delay(_textScrollSpeed); @@ -480,9 +493,16 @@ void ArduinoGraphics::endText(int scrollDirection) for (int i = 0; i < scrollLength; i++) { beginDraw(); + int const text_y = _textY - i; + stroke(_textR, _textG, _textB); text(_textBuffer, _textX, text_y); - bitmap(_font->data[0x20], _textX, text_y + _font->height, _font->width, 1, _textSizeX, _textSizeY); + + // clear previous position + const int clearY = text_y + _font->height; + stroke(_backgroundR, _backgroundG, _backgroundB); + line(_textX, clearY, _textX + (_font->width * _textBuffer.length()) - 1, clearY); + endDraw(); delay(_textScrollSpeed); @@ -492,8 +512,16 @@ void ArduinoGraphics::endText(int scrollDirection) for (int i = 0; i < scrollLength; i++) { beginDraw(); + int const text_y = _textY - (scrollLength - i - 1); + stroke(_textR, _textG, _textB); text(_textBuffer, _textX, text_y); + + // clear previous position + const int clearY = text_y - 1; + stroke(_backgroundR, _backgroundG, _backgroundB); + line(_textX, clearY, _textX + (_font->width * _textBuffer.length()) - 1, clearY); + bitmap(_font->data[0x20], _textX, text_y - 1, _font->width, 1, _textSizeX, _textSizeY); endDraw(); @@ -501,6 +529,7 @@ void ArduinoGraphics::endText(int scrollDirection) } } else { beginDraw(); + stroke(_textR, _textG, _textB); text(_textBuffer, _textX, _textY); endDraw(); } From a6eecc7c84cd7835323e635f44bd11ab6ec929e1 Mon Sep 17 00:00:00 2001 From: Leonardo Cavagnis <45899760+leonardocavagnis@users.noreply.github.com> Date: Thu, 24 Apr 2025 15:41:31 +0200 Subject: [PATCH 52/53] Fix license to MPL-2.0 (#53) * update license to MPL-2.0 * Update README.md --- LICENSE | 373 ++++++++++++++++++++++++++++++++++++++++ README.adoc | 37 ---- README.md | 9 + docs/readme.md | 9 +- src/ArduinoGraphics.cpp | 16 +- src/ArduinoGraphics.h | 16 +- src/Font.h | 16 +- src/Font_4x6.c | 16 +- src/Font_5x7.c | 16 +- src/Image.cpp | 16 +- src/Image.h | 16 +- 11 files changed, 397 insertions(+), 143 deletions(-) create mode 100644 LICENSE delete mode 100644 README.adoc create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a612ad9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/README.adoc b/README.adoc deleted file mode 100644 index 83baac9..0000000 --- a/README.adoc +++ /dev/null @@ -1,37 +0,0 @@ -:repository-owner: arduino-libraries -:repository-name: ArduinoGraphics - -= {repository-name} Library for Arduino = - -image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-arduino.yml/badge.svg["Check Arduino status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-arduino.yml"] -image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/compile-examples.yml/badge.svg["Compile Examples status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/compile-examples.yml"] -image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check.yml/badge.svg["Spell Check status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check.yml"] - -Core graphics library for Arduino. Based on the Processing API. - -For more information about this library please visit us at https://www.arduino.cc/en/Reference/ArduinoGraphics - -== License == - -Copyright (c) 2019 Arduino SA. All rights reserved. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -== How-to generate bitmaps from the fonts == -[source,bash] ----- -cd extras -./generate_font.py 5x7.bdf Font_5x7.c Font_5x7 ----- diff --git a/README.md b/README.md new file mode 100644 index 0000000..b4f164f --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# ArduinoGraphics Library for Arduino + +![Check Arduino status](https://github.com/arduino-libraries/ArduinoGraphics/actions/workflows/check-arduino.yml/badge.svg) +![Compile Examples status](https://github.com/arduino-libraries/ArduinoGraphics/actions/workflows/compile-examples.yml/badge.svg) +![Spell Check status](https://github.com/arduino-libraries/ArduinoGraphics/actions/workflows/spell-check.yml/badge.svg) + +Core graphics library for Arduino. Based on the Processing API. + +📖 For more information about this library please read the documentation [here](./docs/) or visit us at [https://www.arduino.cc/en/Reference/ArduinoGraphics](https://www.arduino.cc/en/Reference/ArduinoGraphics) diff --git a/docs/readme.md b/docs/readme.md index 4260bca..0dd9764 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -10,4 +10,11 @@ To use this library To let you easily understand the usage of the graphics primitives, we are using a dummy screen object named YourScreen that should be substituted with the real one, Eg. MATRIX, OLED, TFT and so on. Refer to the hardware interfacing library of your screen to get more details. -The style and syntax of this library is inspired by [Processing 3](https://processing.org/) and we believe that learning Processing is very helpful to develop complex applications that combine the versatility of Arduino driven hardware with the power of a pc based graphical interface. \ No newline at end of file +The style and syntax of this library is inspired by [Processing 3](https://processing.org/) and we believe that learning Processing is very helpful to develop complex applications that combine the versatility of Arduino driven hardware with the power of a pc based graphical interface. + +## How-to generate bitmaps from the fonts + +```bash +cd extras +./generate_font.py 5x7.bdf Font_5x7.c Font_5x7 +``` \ No newline at end of file diff --git a/src/ArduinoGraphics.cpp b/src/ArduinoGraphics.cpp index 5469905..2a62a3a 100644 --- a/src/ArduinoGraphics.cpp +++ b/src/ArduinoGraphics.cpp @@ -1,20 +1,6 @@ /* This file is part of the ArduinoGraphics library. - Copyright (c) 2019 Arduino SA. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Copyright (c) 2025 Arduino SA. All rights reserved. */ #include "ArduinoGraphics.h" diff --git a/src/ArduinoGraphics.h b/src/ArduinoGraphics.h index 6776f86..c409796 100644 --- a/src/ArduinoGraphics.h +++ b/src/ArduinoGraphics.h @@ -1,20 +1,6 @@ /* This file is part of the ArduinoGraphics library. - Copyright (c) 2019 Arduino SA. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Copyright (c) 2025 Arduino SA. All rights reserved. */ #ifndef _ARDUINO_GRAPHICS_H diff --git a/src/Font.h b/src/Font.h index f44f9b5..c1d7f46 100644 --- a/src/Font.h +++ b/src/Font.h @@ -1,20 +1,6 @@ /* This file is part of the ArduinoGraphics library. - Copyright (c) 2019 Arduino SA. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Copyright (c) 2025 Arduino SA. All rights reserved. */ #ifndef _FONT_H diff --git a/src/Font_4x6.c b/src/Font_4x6.c index 257ef73..407527b 100644 --- a/src/Font_4x6.c +++ b/src/Font_4x6.c @@ -1,20 +1,6 @@ /* This file is part of the ArduinoGraphics library. - Copyright (c) 2019 Arduino SA. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Copyright (c) 2025 Arduino SA. All rights reserved. */ #include "Font.h" diff --git a/src/Font_5x7.c b/src/Font_5x7.c index 3c9a31b..a4ee951 100644 --- a/src/Font_5x7.c +++ b/src/Font_5x7.c @@ -1,20 +1,6 @@ /* This file is part of the ArduinoGraphics library. - Copyright (c) 2019 Arduino SA. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Copyright (c) 2025 Arduino SA. All rights reserved. */ #include "Font.h" diff --git a/src/Image.cpp b/src/Image.cpp index e7ad1a2..a010491 100644 --- a/src/Image.cpp +++ b/src/Image.cpp @@ -1,20 +1,6 @@ /* This file is part of the ArduinoGraphics library. - Copyright (c) 2019 Arduino SA. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Copyright (c) 2025 Arduino SA. All rights reserved. */ #include diff --git a/src/Image.h b/src/Image.h index 0483e8e..c8f478f 100644 --- a/src/Image.h +++ b/src/Image.h @@ -1,20 +1,6 @@ /* This file is part of the ArduinoGraphics library. - Copyright (c) 2019 Arduino SA. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Copyright (c) 2025 Arduino SA. All rights reserved. */ #ifndef _IMAGE_H From 389562f65b48519d3705e985a949a6b61a67ecd2 Mon Sep 17 00:00:00 2001 From: Leonardo Cavagnis <45899760+leonardocavagnis@users.noreply.github.com> Date: Thu, 24 Apr 2025 15:42:43 +0200 Subject: [PATCH 53/53] Update library version to 1.1.4 --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index 0495428..a6a1080 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=ArduinoGraphics -version=1.1.3 +version=1.1.4 author=Arduino maintainer=Arduino sentence=Core graphics library for Arduino.