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

14
LINES

< > BotCompany Repo | #1033437 // grabbableBytePixels_fastOrSlow

JavaX fragment (include)

1  
static GrabbableBytePixels grabbableBytePixels_fastOrSlow(BufferedImage image) ctex {
2  
  pcall {
3  
    GrabbableBytePixels gp = grabbableBytePixels(image);
4  
    if (gp != null) ret gp;
5  
  }
6  
    
7  
  // Use pixelGrabber if quick method fails (TODO)
8  
  int w = image.getWidth(), h = image.getHeight();
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 GrabbableBytePixels((byte[]) pixelGrabber.getPixels(), 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): bhatertpkbcr, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033437
Snippet name: grabbableBytePixels_fastOrSlow
Eternal ID of this version: #1033437/1
Text MD5: aa2d6e125f3b148a4ddfd2b18095755b
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-27 14:44:19
Source code size: 522 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 158 / 188
Referenced in: [show references]