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

17
LINES

< > BotCompany Repo | #1025276 // ii_clip - returns BufferedImage

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

Libraryless. Click here for Pure Java version (5314L/34K).

// doesn't clean the coordinates
static BufferedImage ii_clip(IntegralImage img, int x1, int y1, int w, int h) {
  if (img == null) null;
  BufferedImage out = newBufferedImage(w, h);
  for y to h:
    for x to w:
      out.setRGB(x, y, ii_getPixel(img, x1+x, y1+y));
  ret out;
}

static BufferedImage ii_clip(IntegralImage ii, DoubleRect r) {
  ret ii_clip(ii, toRect(r));
}

static BufferedImage ii_clip(IntegralImage ii, Rect r) {
  ret r == null ? null : ii_clip(ii, r.x, r.y, r.w, r.h);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1025276
Snippet name: ii_clip - returns BufferedImage
Eternal ID of this version: #1025276/3
Text MD5: f6354182d379104c40ecd0901a1493cb
Transpilation MD5: 261fc8ca670508de0b3ac536fd83cca3
Author: stefan
Category: javax / image analysis
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-17 02:12:16
Source code size: 510 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 147 / 225
Version history: 2 change(s)
Referenced in: [show references]