Libraryless. Click here for Pure Java version (12967L/75K).
1 | static ItIt<Pt> pixelsInImageIterator(BufferedImage image) { |
2 | ret pixelsInImageIterator(image.getWidth(), image.getHeight()); |
3 | } |
4 | |
5 | static ItIt<Pt> pixelsInImageIterator(WidthAndHeight etc size) { |
6 | int h = size.h(), w = size.w(); |
7 | ret new ItIt<Pt> { |
8 | int x, y; |
9 | |
10 | public bool hasNext() { |
11 | ret y < h && x < w; |
12 | } |
13 | |
14 | public Pt next() { |
15 | Pt p = pt(x, y); |
16 | if (++x >= w) { x = 0; ++y; } |
17 | ret p; |
18 | } |
19 | }; |
20 | } |
download show line numbers debug dex old transpilations
Travelled to 2 computer(s): elmgxqgtpvxh, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1035716 |
Snippet name: | pixelsInImageIterator |
Eternal ID of this version: | #1035716/2 |
Text MD5: | 31da95cc40f2da380b77881834c6d86c |
Transpilation MD5: | dd0455ba643d6c6dab4808d0d869eb24 |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-07-11 21:04:32 |
Source code size: | 460 bytes / 20 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 151 / 198 |
Version history: | 1 change(s) |
Referenced in: | [show references] |