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

8
LINES

< > BotCompany Repo | #1020189 // rgbImageToFixedSizeTiles (drops tiles that are too small)

JavaX fragment (include)

static L<RGBImage> rgbImageToFixedSizeTiles(RGBImage img, int tileW, int tileH) {
  new L<RGBImage> tiles;
  int w = img.getWidth(), h = img.getHeight();
  for (int y = 0; y + tileH <= h; y += tileH)
    for (int x = 0; x + tileW <= w; x += tileW)
      tiles.add(rgbClip(img, Rect(x, y, tileW, tileH)));
  ret tiles;
}

Author comment

Began life as a copy of #1016032

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1020189
Snippet name: rgbImageToFixedSizeTiles (drops tiles that are too small)
Eternal ID of this version: #1020189/1
Text MD5: 04b4a8cfc480e968ecc312f9eb17dc80
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-09 21:49:47
Source code size: 326 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 295 / 331
Referenced in: [show references]