1 | static BWImage colorPredicateToBWImage(F1<Int, Bool> predicate, RGBImage img) { |
2 | int w = img.getWidth(), h = img.getHeight(); |
3 | BWImage bw = new(w, h); |
4 | for y to h: |
5 | for x to w: |
6 | if (callF(predicate, img.getInt(x, y))) |
7 | bw.setPixel(x, y, 1f); |
8 | ret bw; |
9 | } |
Began life as a copy of #1022943
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1022949 |
Snippet name: | colorPredicateToBWImage |
Eternal ID of this version: | #1022949/3 |
Text MD5: | 9f353b2e5dbd70f2b60257331cfcaa4f |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-04-15 03:48:39 |
Source code size: | 279 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 268 / 301 |
Version history: | 2 change(s) |
Referenced in: | [show references] |