1 | static int colorCount332_max(int max, BufferedImage img) {
|
2 | if (max == 0) ret 0; |
3 | int w = img.getWidth(), h = img.getHeight(), n = 0; |
4 | new BitSet bs; |
5 | for y to h: for x to w: {
|
6 | int idx = ubyteToInt(to332(img.getRGB(x, y))); |
7 | if (!bs.get(idx)) {
|
8 | if (++n >= max) ret n; |
9 | setBit(bs, idx); |
10 | } |
11 | } |
12 | ret n; |
13 | } |
Began life as a copy of #1019830
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1020686 |
| Snippet name: | colorCount332_max - count different 3-3-2 colors in image with max value |
| Eternal ID of this version: | #1020686/2 |
| Text MD5: | 687acb41660c49f0c8883d8f38ea971d |
| Author: | stefan |
| Category: | javax / image analysis |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2018-12-30 21:58:19 |
| Source code size: | 340 bytes / 13 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 487 / 552 |
| Version history: | 1 change(s) |
| Referenced in: | [show references] |