Package org.apache.sis.image
Class PixelIterator.IntWindow
- Enclosing class:
- PixelIterator
PixelIterator.Window implementation backed by an array of int[]. This is the most efficient
Window because Java2D has many optimizations for images backed by integer values:
Raster.getPixels(int, int, int, int, int[])overridden in private subclasses.SampleModel.getPixels(int, int, int, int, int[], DataBuffer)overridden in public subclasses.
int[] array ourselves
because it may cause Java2D to disable GPU accelerations on that raster.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int[]Sample values in the window (data) and a temporary array (transfer).private final int[]Sample values in the window (data) and a temporary array (transfer).Fields inherited from class org.apache.sis.image.PixelIterator.Window
DIRECT, TRANSFER, TRANSFER_FROM_OTHER, values -
Constructor Summary
ConstructorsConstructorDescriptionIntWindow(int[] data, int[] transfer) Creates a new window which will store the sample values in the givendataarray. -
Method Summary
Modifier and TypeMethodDescription(package private) ObjectPerforms the transfer between the underlying raster and this window.(package private) final PixelIteratorowner()Returns the iterator that created this window.voidupdate()Updates this window with the sample values in the region starting at current iterator position.Methods inherited from class org.apache.sis.image.PixelIterator.Window
getSize
-
Field Details
-
data
private final int[] dataSample values in the window (data) and a temporary array (transfer). Those arrays are overwritten whenupdate()is invoked. -
transfer
private final int[] transferSample values in the window (data) and a temporary array (transfer). Those arrays are overwritten whenupdate()is invoked.
-
-
Constructor Details
-
IntWindow
IntWindow(int[] data, int[] transfer) Creates a new window which will store the sample values in the givendataarray.
-
-
Method Details
-
owner
Returns the iterator that created this window.- Specified by:
ownerin classPixelIterator.Window<IntBuffer>
-
getPixels
Performs the transfer between the underlying raster and this window.- Specified by:
getPixelsin classPixelIterator.Window<IntBuffer>- Parameters:
raster- the raster from which to get the pixel values.subX- the X coordinate of the upper-left pixel location.subY- the Y coordinate of the upper-left pixel location.subWidth- width of the pixel rectangle.subHeight- height of the pixel rectangle.mode- one ofPixelIterator.Window.DIRECT,PixelIterator.Window.TRANSFERorPixelIterator.Window.TRANSFER_FROM_OTHER.- Returns:
- the array in which sample values have been stored.
-
update
public void update()Updates this window with the sample values in the region starting at current iterator position. This method assumes thatPixelIterator.next()orPixelIterator.moveTo(int,int)has been invoked.- Specified by:
updatein classPixelIterator.Window<IntBuffer>
-