1 | static L<IntRange> pixelSetBoundsByColumn(PixelSet set) { |
2 | final Rect rect = pixelSetBounds(set); |
3 | L<IntRange> l = repFunc(func -> IntRange { IntRange(rect.y+rect.h, rect.y) }, rect.w); |
4 | for (Pixel p : set) { |
5 | IntRange r = l.get(p.x-rect.x); |
6 | int y = p.y-rect.y; |
7 | r.start = min(y, r.start); |
8 | r.end = max(y+1, r.end); |
9 | } |
10 | ret l; |
11 | } |
Began life as a copy of #1010152
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1010191 |
Snippet name: | pixelSetBoundsByColumn - effectively moves top-left corner to (0,0) |
Eternal ID of this version: | #1010191/1 |
Text MD5: | 8dcd9ce03acdf161ed2544e0a908b4fd |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-09-06 00:50:02 |
Source code size: | 356 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 450 / 494 |
Referenced in: | [show references] |