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

10
LINES

< > BotCompany Repo | #1024672 // bufferedImageHorizontalSlices

JavaX fragment (include)

static L<BufferedImage> bufferedImageHorizontalSlices(double sliceWidth, BufferedImage img) {
  new L<BufferedImage> out;
  int w = img.getWidth(), h = img.getHeight();
  for (double x = 0; iround(x) < w; x += sliceWidth) {
    int actualX = iround(x), nextX = min(w, iround(x+sliceWidth));
    if (nextX > actualX)
      out.add(clipBufferedImage(img, rectFromPoints(actualX, 0, nextX, h)));
  }
  ret out;
}

Author comment

Began life as a copy of #1024668

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: #1024672
Snippet name: bufferedImageHorizontalSlices
Eternal ID of this version: #1024672/3
Text MD5: e0619f08f15c281cdb91a5bc5f9c15a1
Author: stefan
Category: javax / image analysis
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-22 23:48:36
Source code size: 418 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 108 / 149
Version history: 2 change(s)
Referenced in: [show references]