1 | static BWImage bwImageTo2Bit_inner(BWImage img, float threshold1, float threshold2) { |
2 | int w = img.w(), h = img.h(); |
3 | BWImage img2 = new BWImage(w, h); |
4 | for y to h: for x to w: { |
5 | float f = img.getPixel(x, y); |
6 | img2.setPixel(x, y, f < threshold1 || f > threshold2 ? 0f : 1f); |
7 | } |
8 | ret img2; |
9 | } |
Began life as a copy of #1006551
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1006553 |
Snippet name: | bwImageTo2Bit_inner |
Eternal ID of this version: | #1006553/1 |
Text MD5: | bd7d9935ef6873ef7e48fe79572b62f8 |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-01-16 05:04:17 |
Source code size: | 310 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 542 / 546 |
Referenced in: | [show references] |