Libraryless. Click here for Pure Java version (1939L/13K).
1 | static L<BufferedImage> bufferedImageVerticalSlices(double sliceHeight, BufferedImage img) { |
2 | new L<BufferedImage> out; |
3 | int w = img.getWidth(), h = img.getHeight(); |
4 | for (double y = 0; iround(y) < h; y += sliceHeight) { |
5 | int actualY = iround(y), nextY = min(h, iround(y+sliceHeight)); |
6 | if (nextY > actualY) |
7 | out.add(clipBufferedImage(img, rectFromPoints(0, actualY, w, nextY))); |
8 | } |
9 | ret out; |
10 | } |
Began life as a copy of #1023027
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: | #1024668 |
Snippet name: | bufferedImageVerticalSlices |
Eternal ID of this version: | #1024668/2 |
Text MD5: | 7a018d5bae6d271753f961540b4b6695 |
Transpilation MD5: | f3908aa5bd159c038561e37089a1482a |
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:42:29 |
Source code size: | 419 bytes / 10 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 226 / 315 |
Version history: | 1 change(s) |
Referenced in: | [show references] |