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

10
LINES

< > BotCompany Repo | #1024672 // bufferedImageHorizontalSlices

JavaX fragment (include)

1  
static L<BufferedImage> bufferedImageHorizontalSlices(double sliceWidth, BufferedImage img) {
2  
  new L<BufferedImage> out;
3  
  int w = img.getWidth(), h = img.getHeight();
4  
  for (double x = 0; iround(x) < w; x += sliceWidth) {
5  
    int actualX = iround(x), nextX = min(w, iround(x+sliceWidth));
6  
    if (nextX > actualX)
7  
      out.add(clipBufferedImage(img, rectFromPoints(actualX, 0, nextX, h)));
8  
  }
9  
  ret out;
10  
}

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: 227 / 269
Version history: 2 change(s)
Referenced in: [show references]