Libraryless. Click here for Pure Java version (2682L/16K).
1 | static BWImage transformBufferedImageToBWImage(IF1<Int, Float> f, BufferedImage img) { |
2 | if (img == null) null; |
3 | int w = img.getWidth(), h = img.getHeight(); |
4 | BWImage img2 = new(w, h); |
5 | for y to h: for x to w: |
6 | img2.setPixel(x, y, f.get(img.getRGB(x, y))); |
7 | ret img2; |
8 | } |
Began life as a copy of #1020184
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1024727 |
Snippet name: | transformBufferedImageToBWImage |
Eternal ID of this version: | #1024727/5 |
Text MD5: | 3e3ec3e30218c8f987ab09c592f625c3 |
Transpilation MD5: | 5142d53d1ffe1c04274e2fa6bce0cd57 |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-08-24 14:53:21 |
Source code size: | 283 bytes / 8 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 199 / 276 |
Version history: | 4 change(s) |
Referenced in: | [show references] |