1 | // color = 0 to 255 |
2 | static int pixelsWith332Color(RGBImage img, int color) { |
3 | int count = 0; |
4 | for (int rgb : img.pixels) |
5 | if (to332(rgb) == (byte) color) |
6 | ++count; |
7 | ret count; |
8 | } |
9 | |
10 | // color = e.g. "053" |
11 | static int pixelsWith332Color(RGBImage img, S color) { |
12 | ret pixelsWith332Color(img, color332toByte(color)); |
13 | } |
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: | #1022907 |
Snippet name: | pixelsWith332Color |
Eternal ID of this version: | #1022907/2 |
Text MD5: | 9ed6d2aeed9b487d12fa08939394bca7 |
Author: | stefan |
Category: | javax / image analysis |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-04-14 20:34:47 |
Source code size: | 334 bytes / 13 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 239 / 280 |
Version history: | 1 change(s) |
Referenced in: | [show references] |