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