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

13
LINES

< > BotCompany Repo | #1025174 - integralImageToBufferedImage

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

Libraryless. Click here for Pure Java version (3194L/20K).

static BufferedImage integralImageToBufferedImage(IntegralImage img) {
  if (img == null) null;
  int w = img.w, h = img.h;
  BufferedImage out = newBufferedImage(w, h);
  for y to h:
    for x to w: {
      int r = integralImage_sumRect(img, x, y, x+1, y+1, 0);
      int g = integralImage_sumRect(img, x, y, x+1, y+1, 1);
      int b = integralImage_sumRect(img, x, y, x+1, y+1, 2);
      out.setRGB(x, y, (r << 16) | (g << 8) | b);
    }
  ret out;
}

Author comment

Began life as a copy of #1019590

download  show line numbers  debug dex   

Travelled to 2 computer(s): mqqgnosmbjvj, tvejysmllsmz

No comments. add comment

Snippet ID: #1025174
Snippet name: integralImageToBufferedImage
Eternal ID of this version: #1025174/3
Text MD5: 840fe08028223e3b2669292153293be7
Transpilation MD5: 23dd44a8c55ca3983e130cc0e07ac96a
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-10 14:26:35
Source code size: 465 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 8 / 23
Version history: 2 change(s)
Referenced in: [show references]