Package com.sun.jna.platform
Klasse RasterRangesUtils
java.lang.Object
com.sun.jna.platform.RasterRangesUtils
Methods that are useful to decompose a raster into a set of rectangles.
An occupied pixel has two possible meanings, depending on the raster :
- if the raster has an alpha layer, occupied means with alpha not null
- if the raster doesn't have any alpha layer, occupied means not completely black
- Autor:
- Olivier Chafik
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic interface
Abstraction of a sink for ranges. -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic 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.
-
Konstruktordetails
-
RasterRangesUtils
public RasterRangesUtils()
-
-
Methodendetails
-
outputOccupiedRanges
Outputs ranges of occupied pixels. In a raster that has an alpha layer, a pixel is occupied if its alpha value is not null. In a raster without alpha layer, a pixel is occupied if it is not completely black.- Parameter:
raster
- image to be segmented in non black or non-transparent rangesout
- destination of the non null ranges- Gibt zurück:
- true if the output succeeded, false otherwise
-
outputOccupiedRangesOfBinaryPixels
public 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.- Parameter:
binaryBits
- byte-packed binary bits of an imagew
- width of the image (in pixels)h
- height of the imageout
-- Gibt zurück:
- true if the output succeeded, false otherwise
-
outputOccupiedRanges
public 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. A pixel is considered occupied if the bitwise AND of its integer value with the provided occupationMask is not null.- Parameter:
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- Gibt zurück:
- true if the output succeeded, false otherwise
-