1 | static int from332(int x) {
|
2 | ret from332((byte) x); |
3 | } |
4 | |
5 | static int from332(byte x) {
|
6 | int r = iround(((x >> 5) & 7)*255.0/7); |
7 | int g = iround(((x >> 2) & 7)*255.0/7); |
8 | int b = iround((x & 3)*255.0/3); |
9 | ret (r << 16) | (g << 8) | b; |
10 | } |
11 | |
12 | static int from332(int r, int g, int b) {
|
13 | r = iround(r*255.0/7); |
14 | g = iround(g*255.0/7); |
15 | b = iround(b*255.0/3); |
16 | ret (r << 16) | (g << 8) | b; |
17 | } |
18 | |
19 | static int from332(S s) {
|
20 | ret from332(parseInt(s.charAt(0)), parseInt(s.charAt(1)), parseInt(s.charAt(2))); |
21 | } |
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1005376 |
| Snippet name: | from332 - convert pixel from 332 format (byte) to int (24 bit RGB) |
| Eternal ID of this version: | #1005376/7 |
| Text MD5: | 99250c044283fc06b998e0aaba91c16a |
| Author: | stefan |
| Category: | javax / imaging |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-04-23 13:21:05 |
| Source code size: | 522 bytes / 21 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 835 / 855 |
| Version history: | 6 change(s) |
| Referenced in: | [show references] |