Libraryless. Click here for Pure Java version (4216L/24K).
static L<Int> imagePixelsToRGBAWithSize_virtualIntList(BufferedImage etc img) { if (img == null) null; int w = img.getWidth(), h = img.getHeight(), n = w*h+2; ret new RandomAccessAbstractList<Int>() { public int size() { ret n; } public Int get(int i) { if (i == 0) ret w; if (i == 1) ret h; i -= 2; ret img.getRGB(i % w, i / w); } public Int set(int i, Int val) { if (i < 2) fail(); i -= 2; int old = img.getRGB(i % w, i / w); if (old != (int) val) img.setRGB(i % w, i / w, val); ret old; } }; }
Began life as a copy of #1033069
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, ekrmjmnbrukm, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1033124 |
Snippet name: | imagePixelsToRGBAWithSize_virtualIntList |
Eternal ID of this version: | #1033124/3 |
Text MD5: | 77a6e8a56b0aea839023927758c7900d |
Transpilation MD5: | ce6b3bb51eb2432800f34f40b9746685 |
Author: | stefan |
Category: | javax / compression /pattern recognition |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-10-15 16:47:13 |
Source code size: | 620 bytes / 24 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 166 / 222 |
Version history: | 2 change(s) |
Referenced in: | [show references] |