Transpiled version (11127L) is out of date.
1 | static Image2B binaryImageOutline(IImage2B image) { |
2 | int w = image.w(), h = image.h(); |
3 | ret image == null ?: binaryImageFromFunction(w+2, h+2, |
4 | (x, y) -> |
5 | !( |
6 | // white if pixel was black before |
7 | getBoolPixelDefaultTrue(image, x, y) ? false |
8 | // otherwise, black if surrounded by at least one black pixel |
9 | : ( |
10 | getBoolPixelDefaultTrue(image, x-1, y-1) |
11 | || getBoolPixelDefaultTrue(image, x, y-1) |
12 | || getBoolPixelDefaultTrue(image, x+1, y-1) |
13 | || getBoolPixelDefaultTrue(image, x-1, y) |
14 | || getBoolPixelDefaultTrue(image, x+1, y) |
15 | || getBoolPixelDefaultTrue(image, x-1, y+1) |
16 | || getBoolPixelDefaultTrue(image, x, y+1) |
17 | || getBoolPixelDefaultTrue(image, x+1, y+1)))); |
18 | } |
download show line numbers debug dex old transpilations
Travelled to 2 computer(s): elmgxqgtpvxh, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1036077 |
Snippet name: | binaryImageOutline |
Eternal ID of this version: | #1036077/3 |
Text MD5: | 0262d3e8c328010cf4a20ec20f8c3c43 |
Author: | stefan |
Category: | javax / gazelle 22 |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-09-05 03:57:49 |
Source code size: | 757 bytes / 18 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 121 / 185 |
Version history: | 2 change(s) |
Referenced in: | [show references] |