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

14
LINES

< > BotCompany Repo | #1033437 // grabbableBytePixels_fastOrSlow

JavaX fragment (include)

static GrabbableBytePixels grabbableBytePixels_fastOrSlow(BufferedImage image) ctex {
  pcall {
    GrabbableBytePixels gp = grabbableBytePixels(image);
    if (gp != null) ret gp;
  }
    
  // Use pixelGrabber if quick method fails (TODO)
  int w = image.getWidth(), h = image.getHeight();
  PixelGrabber pixelGrabber = new(image, 0, 0, w, h, data, 0, w);
  if (!pixelGrabber.grabPixels())
    fail("Could not grab pixels");
      
  ret GrabbableBytePixels((byte[]) pixelGrabber.getPixels(), w, h, 0, w);
}

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: 159 / 188
Referenced in: