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

11
LINES

< > BotCompany Repo | #1010191 // pixelSetBoundsByColumn - effectively moves top-left corner to (0,0)

JavaX fragment (include) [tags: use-pretranspiled]

static L<IntRange> pixelSetBoundsByColumn(PixelSet set) {
  final Rect rect = pixelSetBounds(set);
  L<IntRange> l = repFunc(func -> IntRange { IntRange(rect.y+rect.h, rect.y) }, rect.w);
  for (Pixel p : set) {
    IntRange r = l.get(p.x-rect.x);
    int y = p.y-rect.y;
    r.start = min(y, r.start);
    r.end = max(y+1, r.end);
  }
  ret l;
}

Author comment

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: 374 / 414
Referenced in: [show references]