Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

14
LINES

< > BotCompany Repo | #1035897 // grabbableRGBBytePixels_fastOrSlow [doesn't work, use grabbableIntPixels_fastOrSlow instead]

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (9314L) is out of date.

1  
static GrabbableRGBBytePixels grabbableRGBBytePixels_fastOrSlow(BufferedImage image) ctex {
2  
  pcall {
3  
    GrabbableRGBBytePixels gp = grabbableRGBBytePixels(image);
4  
    if (gp != null) ret gp;
5  
  }
6  
    
7  
  int w = image.getWidth(), h = image.getHeight();
8  
  byte[] data = new[w*h*3];
9  
  PixelGrabber pixelGrabber = new(image, 0, 0, w, h, data, 0, w);
10  
  if (!pixelGrabber.grabPixels())
11  
    fail("Could not grab pixels");
12  
      
13  
  ret GrabbableRGBBytePixels(data, w, h, 0, w);
14  
}

Author comment

Began life as a copy of #1033307

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mqqgnosmbjvj, wnsclhtenguj

No comments. add comment

Snippet ID: #1035897
Snippet name: grabbableRGBBytePixels_fastOrSlow [doesn't work, use grabbableIntPixels_fastOrSlow instead]
Eternal ID of this version: #1035897/3
Text MD5: 7bcb800fdae517750faf5536d5606269
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-08-08 19:11:58
Source code size: 485 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 64 / 86
Version history: 2 change(s)
Referenced in: [show references]