1 | static L<RGBImage> rgbImageToFixedSizeTiles(RGBImage img, int tileW, int tileH) { |
2 | new L<RGBImage> tiles; |
3 | int w = img.getWidth(), h = img.getHeight(); |
4 | for (int y = 0; y + tileH <= h; y += tileH) |
5 | for (int x = 0; x + tileW <= w; x += tileW) |
6 | tiles.add(rgbClip(img, Rect(x, y, tileW, tileH))); |
7 | ret tiles; |
8 | } |
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: | 297 / 334 |
Referenced in: | [show references] |