Libraryless. Click here for Pure Java version (5212L/29K).
1 | srecord GrabbableIntPixels(int[] data, int w, int h, int offset, int scanlineStride) { |
2 | int[] asPackedArray() { |
3 | if (offset == 0 && data.length == w*h) ret data; |
4 | int[] pixels = new[w*h]; |
5 | for y to h: |
6 | arrayCopy(data, offset+y*scanlineStride, pixels, y*h, w); |
7 | ret pixels; |
8 | } |
9 | } |
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt
No comments. add comment
Snippet ID: | #1030543 |
Snippet name: | GrabbableIntPixels |
Eternal ID of this version: | #1030543/4 |
Text MD5: | edda0ea856062fc5de00096e72fe4d99 |
Transpilation MD5: | fc479fe4a3d97b9cefd36716c0884730 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-02-05 03:03:24 |
Source code size: | 304 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 264 / 516 |
Version history: | 3 change(s) |
Referenced in: | [show references] |