static int colorCount332(BufferedImage img) { int w = img.getWidth(), h = img.getHeight(); new BitSet bs; for y to h: for x to w: setBit(bs, ubyteToInt(to332(img.getRGB(x, y)))); ret bitCount(bs); } static int colorCount332(RGBImage img) { int w = img.w(), h = img.h(); new BitSet bs; for y to h: for x to w: setBit(bs, ubyteToInt(to332(img.getInt(x, y)))); ret bitCount(bs); }
download show line numbers debug dex old transpilations
Travelled to 9 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1019830 |
| Snippet name: | colorCount332 - count different 3-3-2 colors in image |
| Eternal ID of this version: | #1019830/4 |
| Text MD5: | e7c4c1c110478f222833d43447b4083a |
| 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:15:02 |
| Source code size: | 416 bytes / 15 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 541 / 588 |
| Version history: | 3 change(s) |
| Referenced in: | [show references] |