Returns the pixel data for the specified rectangle of pixels in a
primitive array of type TransferType.
For image data supported by the Java 2D API, this
will be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT,
DataBuffer.TYPE_INT, DataBuffer.TYPE_SHORT, DataBuffer.TYPE_FLOAT,
or DataBuffer.TYPE_DOUBLE. Data may be returned in a packed format,
thus increasing efficiency for data transfers.
An ArrayIndexOutOfBoundsException may be thrown
if the coordinates are not in bounds. However, explicit bounds
checking is not guaranteed.
A ClassCastException will be thrown if the input object is non null
and references anything other than an array of TransferType.
Returns:
An object reference to an array of type defined by
getTransferType() with the requested pixel data.
Parameters:
-
x - The X coordinate of the upper-left pixel location
-
y - The Y coordinate of the upper-left pixel location
-
w - Width of the pixel rectangle
-
h - Height of the pixel rectangle
-
outData - An object reference to an array of type defined by
getTransferType() and length w*h*getNumDataElements().
If null, an array of appropriate type and size will be
allocated.
Throws:
-
ArrayIndexOutOfBoundsException - if the coordinates are not
in bounds, or if outData is too small to hold the output.
See Also:
SampleModel.getDataElements(int, int, int, int, Object, DataBuffer)
,