Libraryless. Click here for Pure Java version (9343L/52K).
1 | static GrabbableIntPixels grabbableIntPixels_fastOrSlow(BufferedImage image) ctex { |
2 | pcall { |
3 | GrabbableIntPixels gp = grabbableIntPixels(image); |
4 | if (gp != null) ret gp; |
5 | } |
6 | |
7 | // TODO: use GrabbableRGBBytePixels and convert manually |
8 | // - should be way faster than PixelGrabber |
9 | |
10 | int w = image.getWidth(), h = image.getHeight(); |
11 | int[] data = new[w*h]; |
12 | PixelGrabber pixelGrabber = new(image, 0, 0, w, h, data, 0, w); |
13 | if (!pixelGrabber.grabPixels()) |
14 | fail("Could not grab pixels"); |
15 | |
16 | ret GrabbableIntPixels(data, w, h, 0, w); |
17 | } |
Began life as a copy of #1030544
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1033307 |
Snippet name: | grabbableIntPixels_fastOrSlow |
Eternal ID of this version: | #1033307/6 |
Text MD5: | 44a512397bcf910e778548ed17272667 |
Transpilation MD5: | 027890dd222aebbe54a0452c25416a73 |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-08-07 21:13:29 |
Source code size: | 573 bytes / 17 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 221 / 288 |
Version history: | 5 change(s) |
Referenced in: | [show references] |