public class RasterRangesUtils extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
RasterRangesUtils.RangesOutput
Abstraction of a sink for ranges.
|
Constructor and Description |
---|
RasterRangesUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
outputOccupiedRanges(int[] pixels,
int w,
int h,
int occupationMask,
RasterRangesUtils.RangesOutput out)
Output the occupied values of an integer-pixels image as ranges of contiguous values.
|
static boolean |
outputOccupiedRanges(Raster raster,
RasterRangesUtils.RangesOutput out)
Outputs ranges of occupied pixels.
|
static boolean |
outputOccupiedRangesOfBinaryPixels(byte[] binaryBits,
int w,
int h,
RasterRangesUtils.RangesOutput out)
Output the non-null values of a binary image as ranges of contiguous values.
|
public static boolean outputOccupiedRanges(Raster raster, RasterRangesUtils.RangesOutput out)
raster
- image to be segmented in non black or non-transparent rangesout
- destination of the non null rangespublic static boolean outputOccupiedRangesOfBinaryPixels(byte[] binaryBits, int w, int h, RasterRangesUtils.RangesOutput out)
binaryBits
- byte-packed binary bits of an imagew
- width of the image (in pixels)h
- height of the imageout
- public static boolean outputOccupiedRanges(int[] pixels, int w, int h, int occupationMask, RasterRangesUtils.RangesOutput out)
pixels
- integer values of the pixels of an imagew
- width of the image (in pixels)h
- height of the imageoccupationMask
- mask used to select which bits are used in a pixel to check its occupied status. 0xff000000 would only take the alpha layer into account, for instance.out
- where to output all the contiguous ranges of non occupied pixels