New upstream version 2.5.4
IOhannes m zmΓΆlnig (Debian/GNU)
4 months ago
| 0 | name: βοΈ Conventional Commits | |
| 1 | ||
| 2 | on: | |
| 3 | pull_request_target: | |
| 4 | paths-ignore: | |
| 5 | - 'doc/**' | |
| 6 | - '*.md' | |
| 7 | branches: | |
| 8 | - master | |
| 9 | - release/** | |
| 10 | ||
| 11 | permissions: | |
| 12 | contents: read | |
| 13 | pull-requests: write | |
| 14 | ||
| 15 | jobs: | |
| 16 | conventional-commits: | |
| 17 | name: π Parse PR commits | |
| 18 | runs-on: ubuntu-latest | |
| 19 | steps: | |
| 20 | - name: π Check PR commit messages follow Conventional Commits | |
| 21 | uses: actions/github-script@v8 | |
| 22 | with: | |
| 23 | script: | | |
| 24 | const owner = context.repo.owner; | |
| 25 | const repo = context.repo.repo; | |
| 26 | const pull_number = context.payload.pull_request.number; | |
| 27 | ||
| 28 | const marker = "<!-- conventional-commits-check -->"; | |
| 29 | ||
| 30 | // Conventional Commits v1.0.0 summary line regex | |
| 31 | const re = /^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\([^)]+\))?(!)?:\s\S.+/; | |
| 32 | ||
| 33 | const commits = await github.paginate( | |
| 34 | github.rest.pulls.listCommits, | |
| 35 | { owner, repo, pull_number, per_page: 100 } | |
| 36 | ); | |
| 37 | ||
| 38 | const invalid = []; | |
| 39 | for (const c of commits) { | |
| 40 | const summary = c.commit.message.split("\n")[0]; | |
| 41 | if (!re.test(summary)) { | |
| 42 | invalid.push({ | |
| 43 | sha: c.sha.substring(0, 7), | |
| 44 | message: summary, | |
| 45 | }); | |
| 46 | } | |
| 47 | } | |
| 48 | ||
| 49 | // Find existing bot comment (if any) | |
| 50 | const comments = await github.paginate( | |
| 51 | github.rest.issues.listComments, | |
| 52 | { owner, repo, issue_number: pull_number } | |
| 53 | ); | |
| 54 | ||
| 55 | const existing = comments.find( | |
| 56 | c => c.user?.type === "Bot" && c.body?.includes(marker) | |
| 57 | ); | |
| 58 | ||
| 59 | if (invalid.length > 0) { | |
| 60 | const body = | |
| 61 | `${marker} | |
| 62 | ### β Conventional Commits check failed | |
| 63 | ||
| 64 | One or more commit messages in this PR do **not** follow the | |
| 65 | [Conventional Commits v1.0.0](https://www.conventionalcommits.org/en/v1.0.0/) specification. | |
| 66 | ||
| 67 | **Invalid commits:** | |
| 68 | ${invalid.map(i => `- \`${i.sha}\` β ${i.message}`).join("\n")} | |
| 69 | ||
| 70 | **Expected format** | |
| 71 | \`\`\` | |
| 72 | type(scope?)!?: subject | |
| 73 | \`\`\` | |
| 74 | ||
| 75 | **Examples** | |
| 76 | - \`feat: add user login\` | |
| 77 | - \`fix(api): handle null response\` | |
| 78 | - \`chore!: drop node 16 support\` | |
| 79 | ||
| 80 | Please fix the commit messages (e.g. via \`git rebase -i\`) and push again.`; | |
| 81 | ||
| 82 | if (existing) { | |
| 83 | await github.rest.issues.updateComment({ | |
| 84 | owner, | |
| 85 | repo, | |
| 86 | comment_id: existing.id, | |
| 87 | body, | |
| 88 | }); | |
| 89 | } else { | |
| 90 | await github.rest.issues.createComment({ | |
| 91 | owner, | |
| 92 | repo, | |
| 93 | issue_number: pull_number, | |
| 94 | body, | |
| 95 | }); | |
| 96 | } | |
| 97 | ||
| 98 | core.setFailed( | |
| 99 | `${invalid.length} commit(s) do not follow Conventional Commits` | |
| 100 | ); | |
| 101 | } else { | |
| 102 | // If previously failed, clean up the comment | |
| 103 | if (existing) { | |
| 104 | await github.rest.issues.updateComment({ | |
| 105 | owner, | |
| 106 | repo, | |
| 107 | comment_id: existing.id, | |
| 108 | body: `${marker} | |
| 109 | ### β Conventional Commits check passed | |
| 110 | ||
| 111 | All commit messages in this PR now follow the Conventional Commits specification. π`, | |
| 112 | }); | |
| 113 | } | |
| 114 | ||
| 115 | core.info(`All ${commits.length} commit(s) follow Conventional Commits.`); | |
| 116 | } |
| 0 | name: 020-Release | |
| 0 | name: π’ Release | |
| 1 | 1 | |
| 2 | 2 | on: |
| 3 | 3 | workflow_run: |
| 4 | 4 | workflows: |
| 5 | - 010-Test | |
| 5 | - π§ͺ Test | |
| 6 | 6 | types: [completed] |
| 7 | 7 | branches: |
| 8 | 8 | - master |
| 17 | 17 | name: π€ Semantic release |
| 18 | 18 | runs-on: ubuntu-latest |
| 19 | 19 | if: "!contains(github.event.pull_request.labels.*.name, 'skip-release')" |
| 20 | # if: ${{ github.ref_name == 'master' && github.event_name == 'push' }} | |
| 21 | 20 | outputs: |
| 22 | 21 | release: ${{ steps.tag_release.outputs.release }} |
| 23 | 22 | version: ${{ steps.tag_release.outputs.version }} |
| 24 | 23 | steps: |
| 25 | - uses: actions/checkout@v4 | |
| 24 | - uses: actions/checkout@v6 | |
| 26 | 25 | - name: Setup Node.js |
| 27 | uses: actions/setup-node@v3 | |
| 26 | uses: actions/setup-node@v6 | |
| 28 | 27 | with: |
| 29 | 28 | node-version: latest |
| 30 | 29 | - name: Install semantic-release |
| 31 | 30 | run: | |
| 32 | npm i npx | |
| 33 | 31 | npm i semantic-release/changelog |
| 34 | 32 | - name: Tag release |
| 35 | 33 | id: tag_release |
| 50 | 48 | needs: [semantic-release] |
| 51 | 49 | if: ${{ needs.semantic-release.outputs.release == 'True' }} |
| 52 | 50 | steps: |
| 53 | - uses: actions/checkout@v4 | |
| 51 | - uses: actions/checkout@v6 | |
| 54 | 52 | - name: apt install deps |
| 55 | 53 | run: | |
| 56 | 54 | sudo apt-get update -y -q |
| 61 | 59 | cmake -G "Ninja" ../ |
| 62 | 60 | ninja |
| 63 | 61 | - name: Upload linux filter |
| 64 | uses: actions/upload-artifact@v4 | |
| 62 | uses: actions/upload-artifact@v6 | |
| 65 | 63 | with: |
| 66 | 64 | name: release-linux-filter |
| 67 | 65 | path: build/src/filter/**/*.so |
| 68 | 66 | - name: Upload linux mixer2 |
| 69 | uses: actions/upload-artifact@v4 | |
| 67 | uses: actions/upload-artifact@v6 | |
| 70 | 68 | with: |
| 71 | 69 | name: release-linux-mixer2 |
| 72 | 70 | path: build/src/mixer2/**/*.so |
| 73 | 71 | - name: Upload linux mixer3 |
| 74 | uses: actions/upload-artifact@v4 | |
| 72 | uses: actions/upload-artifact@v6 | |
| 75 | 73 | with: |
| 76 | 74 | name: release-linux-mixer3 |
| 77 | 75 | path: build/src/mixer3/**/*.so |
| 78 | 76 | - name: Upload linux generator |
| 79 | uses: actions/upload-artifact@v4 | |
| 77 | uses: actions/upload-artifact@v6 | |
| 80 | 78 | with: |
| 81 | 79 | name: release-linux-generator |
| 82 | 80 | path: build/src/generator/**/*.so |
| 87 | 85 | needs: [semantic-release] |
| 88 | 86 | if: ${{ needs.semantic-release.outputs.release == 'True' }} |
| 89 | 87 | steps: |
| 90 | - uses: actions/checkout@v4 | |
| 88 | - uses: actions/checkout@v6 | |
| 91 | 89 | - uses: ilammy/msvc-dev-cmd@v1 |
| 92 | 90 | - name: choco install deps |
| 93 | uses: crazy-max/ghaction-chocolatey@v2 | |
| 91 | uses: crazy-max/ghaction-chocolatey@v3 | |
| 94 | 92 | with: |
| 95 | 93 | args: install libopencv-dev |
| 96 | 94 | - name: Build using nmake |
| 97 | 95 | run: | |
| 98 | 96 | mkdir build && cd build |
| 99 | cmake -G "NMake Makefiles" ../ | |
| 97 | cmake -G "NMake Makefiles" -D WITHOUT_OPENCV=1 -D WITHOUT_CAIRO=1 -D WITHOUT_GAVL=1 ../ | |
| 100 | 98 | nmake |
| 101 | 99 | - name: Upload win64 filter |
| 102 | uses: actions/upload-artifact@v4 | |
| 100 | uses: actions/upload-artifact@v6 | |
| 103 | 101 | with: |
| 104 | 102 | name: release-win64-filter |
| 105 | 103 | path: build/src/filter/**/*.dll |
| 106 | 104 | - name: Upload win64 mixer2 |
| 107 | uses: actions/upload-artifact@v4 | |
| 105 | uses: actions/upload-artifact@v6 | |
| 108 | 106 | with: |
| 109 | 107 | name: release-win64-mixer2 |
| 110 | 108 | path: build/src/mixer2/**/*.dll |
| 111 | 109 | - name: Upload win64 mixer3 |
| 112 | uses: actions/upload-artifact@v4 | |
| 110 | uses: actions/upload-artifact@v6 | |
| 113 | 111 | with: |
| 114 | 112 | name: release-win64-mixer3 |
| 115 | 113 | path: build/src/mixer3/**/*.dll |
| 116 | 114 | - name: Upload win64 generator |
| 117 | uses: actions/upload-artifact@v4 | |
| 115 | uses: actions/upload-artifact@v6 | |
| 118 | 116 | with: |
| 119 | 117 | name: release-win64-generator |
| 120 | 118 | path: build/src/generator/**/*.dll |
| 125 | 123 | needs: [semantic-release] |
| 126 | 124 | if: ${{ needs.semantic-release.outputs.release == 'True' }} |
| 127 | 125 | steps: |
| 128 | - uses: actions/checkout@v4 | |
| 126 | - uses: actions/checkout@v6 | |
| 129 | 127 | - name: Update Homebrew |
| 130 | 128 | run: | |
| 131 | 129 | brew update |
| 136 | 134 | - name: Build using ninja |
| 137 | 135 | run: | |
| 138 | 136 | mkdir build && cd build |
| 139 | cmake -G "Ninja" ../ | |
| 137 | cmake -G "Ninja" -D WITHOUT_OPENCV=1 -D WITHOUT_GAVL=1 ../ | |
| 140 | 138 | ninja |
| 141 | 139 | - name: Upload osx filter |
| 142 | uses: actions/upload-artifact@v4 | |
| 140 | uses: actions/upload-artifact@v6 | |
| 143 | 141 | with: |
| 144 | 142 | name: release-osx-filter |
| 145 | 143 | path: build/src/filter/**/*.so |
| 146 | 144 | - name: Upload osx mixer2 |
| 147 | uses: actions/upload-artifact@v4 | |
| 145 | uses: actions/upload-artifact@v6 | |
| 148 | 146 | with: |
| 149 | 147 | name: release-osx-mixer2 |
| 150 | 148 | path: build/src/mixer2/**/*.so |
| 151 | 149 | - name: Upload osx mixer3 |
| 152 | uses: actions/upload-artifact@v4 | |
| 150 | uses: actions/upload-artifact@v6 | |
| 153 | 151 | with: |
| 154 | 152 | name: release-osx-mixer3 |
| 155 | 153 | path: build/src/mixer3/**/*.so |
| 156 | 154 | - name: Upload osx generator |
| 157 | uses: actions/upload-artifact@v4 | |
| 155 | uses: actions/upload-artifact@v6 | |
| 158 | 156 | with: |
| 159 | 157 | name: release-osx-generator |
| 160 | 158 | path: build/src/generator/**/*.so |
| 165 | 163 | if: ${{ needs.semantic-release.outputs.release == 'True' }} |
| 166 | 164 | runs-on: ubuntu-latest |
| 167 | 165 | steps: |
| 168 | - uses: actions/checkout@v4 | |
| 166 | - uses: actions/checkout@v6 | |
| 169 | 167 | - name: download binary artifacts |
| 170 | uses: actions/download-artifact@v4 | |
| 168 | uses: actions/download-artifact@v7 | |
| 171 | 169 | with: |
| 172 | 170 | path: | |
| 173 | 171 | frei0r-bin |
| 218 | 216 | sha256sum *.zip *.tar.gz > SHA256SUMS.txt |
| 219 | 217 | |
| 220 | 218 | - name: release all archives |
| 221 | uses: softprops/action-gh-release@v1 | |
| 219 | uses: softprops/action-gh-release@v2 | |
| 222 | 220 | with: |
| 223 | 221 | files: | |
| 224 | 222 | *.zip |
| 0 | name: 010-Test | |
| 0 | name: π§ͺ Test | |
| 1 | 1 | |
| 2 | 2 | on: |
| 3 | 3 | push: |
| 21 | 21 | cancel-in-progress: true |
| 22 | 22 | |
| 23 | 23 | jobs: |
| 24 | ||
| 25 | # reuse: | |
| 26 | # name: π¨ REUSE Compliance | |
| 27 | # runs-on: ubuntu-latest | |
| 28 | # steps: | |
| 29 | # - uses: actions/checkout@v4 | |
| 30 | # - uses: fsfe/reuse-action@v1 | |
| 31 | ||
| 32 | 24 | c-lint: |
| 33 | 25 | name: π¨ C lint |
| 34 | 26 | runs-on: ubuntu-latest |
| 35 | 27 | if: "!contains(github.event.pull_request.labels.*.name, 'skip-lint')" |
| 36 | 28 | steps: |
| 37 | - uses: actions/checkout@v4 | |
| 29 | - uses: actions/checkout@v6 | |
| 38 | 30 | - uses: reviewdog/action-cpplint@master |
| 39 | 31 | env: |
| 40 | 32 | REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 74 | 66 | fail-fast: false |
| 75 | 67 | runs-on: ubuntu-latest |
| 76 | 68 | steps: |
| 77 | - uses: actions/checkout@v4 | |
| 69 | - uses: actions/checkout@v6 | |
| 78 | 70 | - name: install dependencies |
| 79 | 71 | run: | |
| 80 | 72 | sudo apt-get update -qy |
| 90 | 82 | run: | |
| 91 | 83 | cd test && make |
| 92 | 84 | - name: ${{ matrix.compiler }} upload plugin analysis |
| 93 | uses: actions/upload-artifact@v4 | |
| 85 | uses: actions/upload-artifact@v6 | |
| 94 | 86 | with: |
| 95 | 87 | name: release-plugin-analysis |
| 96 | 88 | path: test/*.json |
| 10 | 10 | option (WITHOUT_FACERECOGNITION "Disable facedetect plugin to avoid protobuf conflicts" OFF) |
| 11 | 11 | |
| 12 | 12 | if (NOT WITHOUT_OPENCV) |
| 13 | find_package (OpenCV) | |
| 13 | find_package (OpenCV REQUIRED) | |
| 14 | 14 | endif () |
| 15 | 15 | |
| 16 | find_package (Cairo) | |
| 16 | option (WITHOUT_CAIRO "Disable plugins dependent upon gavl" OFF) | |
| 17 | if (NOT WITHOUT_CAIRO) | |
| 18 | find_package (Cairo REQUIRED) | |
| 19 | endif () | |
| 17 | 20 | |
| 18 | 21 | include(FindPkgConfig) |
| 19 | 22 | option (WITHOUT_GAVL "Disable plugins dependent upon gavl" OFF) |
| 20 | 23 | if (PKG_CONFIG_FOUND AND NOT WITHOUT_GAVL) |
| 21 | pkg_check_modules(GAVL gavl) | |
| 24 | pkg_check_modules(GAVL REQUIRED gavl) | |
| 22 | 25 | endif () |
| 23 | 26 | |
| 24 | 27 | include_directories (AFTER include) |
| 0 | [](https://frei0r.dyne.org) | |
| 0 | [](https://frei0r.dyne.org) | |
| 1 | 1 | |
| 2 | 2 | <img src="https://files.dyne.org/software_by_dyne.png" width="300"> |
| 3 | 3 |
| 25 | 25 | #include <assert.h> |
| 26 | 26 | #include <stdio.h> |
| 27 | 27 | #include <math.h> |
| 28 | #include <string.h> | |
| 28 | 29 | #include "frei0r.h" |
| 29 | 30 | #include "frei0r/math.h" |
| 30 | 31 | |
| 72 | 73 | |
| 73 | 74 | int width = inst->width; |
| 74 | 75 | int height = inst->height; |
| 76 | ||
| 77 | // Copy input to output to preserve alpha channel | |
| 78 | memcpy(outframe, inframe, width * height * sizeof(uint32_t)); | |
| 75 | 79 | |
| 76 | 80 | double dotRadius = inst->dot_radius * 9.99; |
| 77 | 81 | dotRadius = ceil(dotRadius); |
| 572 | 572 | int count = 0; |
| 573 | 573 | char *input = strdup(string); |
| 574 | 574 | char *result = NULL; |
| 575 | result = strtok_r(string, delimiter, &input); | |
| 575 | char *saveptr; | |
| 576 | result = strtok_r(input, delimiter, &saveptr); | |
| 576 | 577 | while (result != NULL) { |
| 577 | 578 | *tokens = realloc(*tokens, (count + 1) * sizeof(char *)); |
| 578 | 579 | (*tokens)[count++] = strdup(result); |
| 579 | result = strtok_r(NULL, delimiter, &input); | |
| 580 | result = strtok_r(NULL, delimiter, &saveptr); | |
| 580 | 581 | } |
| 581 | 582 | free(input); |
| 582 | 583 | return count; |
| 16 | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | 17 | */ |
| 18 | 18 | |
| 19 | #define _USE_MATH_DEFINES | |
| 19 | 20 | #include "frei0r.hpp" |
| 20 | 21 | #include <cairo.h> |
| 21 | #define _USE_MATH_DEFINES | |
| 22 | 22 | #include <cmath> |
| 23 | 23 | |
| 24 | 24 | class Mirr0r : public frei0r::filter { |
| 132 | 132 | "Johann JEG", |
| 133 | 133 | 1, 0, |
| 134 | 134 | F0R_COLOR_MODEL_RGBA8888); |
| 135 | β | |
| 135 | ||
| 206 | 206 | |
| 207 | 207 | // First make a blue layer shifted back |
| 208 | 208 | if (((int)x >= (int)inst->shiftX) && |
| 209 | ((int)y >= (int)inst->shiftY)) | |
| 209 | ((int)y >= (int)inst->shiftY) && | |
| 210 | ((x - inst->shiftX) < inst->width) && | |
| 211 | ((y - inst->shiftY) < inst->height)) | |
| 210 | 212 | { |
| 211 | 213 | rgbsplit0r_extract_color((uint32_t *)(src + |
| 212 | 214 | (x - inst->shiftX) + |