javax.media.jai
Class UnpackedImageData

java.lang.Object
  extended byjavax.media.jai.UnpackedImageData

public final class UnpackedImageData
extends Object

This class is used by PixelAccessor to store unpacked image data and the information needed to access it. The data are stored in a two-dimensional primitive array.

Since:
JAI 1.1

Field Summary
 int[] bandOffsets
          The number of array elements from the beginning of the data array to the first pixel of the Rectangle for all bands.
 boolean convertToDest
          Indicates whether the PixelAccessor can and must set the data back into the Raster.
 Object data
          The data array supplied to store the unpacked data.
 int lineStride
          The number of array elements per scanline.
 int pixelStride
          The number of array elements to skip to get to the next pixel on the same scanline.
 Raster raster
          The Raster containing the pixel data.
 Rectangle rect
          The rectangular region within the Raster where the data are to be accessed.
 int type
          The type of the primitive array used to store the data.
 
Constructor Summary
UnpackedImageData(Raster raster, Rectangle rect, int type, Object data, int pixelStride, int lineStride, int[] bandOffsets, boolean convertToDest)
          Constructs a PackedImageRaster.
 
Method Summary
 byte[][] getByteData()
          Returns the two-dimensional byte data array, or null if the data are not stored in a byte array.
 byte[] getByteData(int b)
          Returns byte data array for a specific band, or null if the data are not stored in a byte array.
 double[][] getDoubleData()
          Returns the two-dimensional double data array, or null if the data are not stored in a double array.
 double[] getDoubleData(int b)
          Returns double data array for a specific band, or null if the data are not stored in a double array.
 float[][] getFloatData()
          Returns the two-dimensional float data array, or null if the data are not stored in a float array.
 float[] getFloatData(int b)
          Returns float data array for a specific band, or null if the data are not stored in a float array.
 int[][] getIntData()
          Returns the two-dimensional integer data array, or null if the data are not stored in an integer array.
 int[] getIntData(int b)
          Returns integer data array for a specific band, or null if the data are not stored in an integer array.
 int getMaxOffset()
          Returns the maximum offset of all bands.
 int getMinOffset()
          Returns the minimum offset of all bands.
 int getOffset(int b)
          Returns the offset for a band.
 short[][] getShortData()
          Returns the two-dimensional short data array, or null if the data are not stored in a short array.
 short[] getShortData(int b)
          Returns short data array for a specific band, or null if the data are not stored in a short array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

raster

public final Raster raster
The Raster containing the pixel data.


rect

public final Rectangle rect
The rectangular region within the Raster where the data are to be accessed.


type

public final int type
The type of the primitive array used to store the data.


data

public final Object data
The data array supplied to store the unpacked data.


pixelStride

public final int pixelStride
The number of array elements to skip to get to the next pixel on the same scanline.


lineStride

public final int lineStride
The number of array elements per scanline.


bandOffsets

public final int[] bandOffsets
The number of array elements from the beginning of the data array to the first pixel of the Rectangle for all bands.


convertToDest

public final boolean convertToDest
Indicates whether the PixelAccessor can and must set the data back into the Raster. If the data does not need to be copied back to the Raster, this variable should be set to false. Only destinations can be set.

Constructor Detail

UnpackedImageData

public UnpackedImageData(Raster raster,
                         Rectangle rect,
                         int type,
                         Object data,
                         int pixelStride,
                         int lineStride,
                         int[] bandOffsets,
                         boolean convertToDest)
Constructs a PackedImageRaster.

Parameters:
raster - The Raster containing the pixel data.
rect - The rectangular region containing the data.
type - The type of the primitive array supplied to store the data.
data - The data array supplied to store the data.
pixelStride - The data array increment needed to move from band x of pixel i to band x of pixel i+1 on the same scanline.
lineStride - The data array increment to move from the pixel x of line i to pixel x of line i+1.
bandOffsets - The number of bytes from the start of the data array to the location of the first pixel of the rectangle for all bands.
convertToDest - A boolean indicating whether the data can and must be set back into the Raster. This applies only to destinations.
Method Detail

getByteData

public byte[][] getByteData()
Returns the two-dimensional byte data array, or null if the data are not stored in a byte array. The array format is data[band][] where the second index is navigated using the pixel and line strides.

Returns:
The two-dimensional byte data array.

getByteData

public byte[] getByteData(int b)
Returns byte data array for a specific band, or null if the data are not stored in a byte array.

Parameters:
b - The band whose data array is to be retrieved.
Returns:
The one-dimensional byte data array for the requested band.

getShortData

public short[][] getShortData()
Returns the two-dimensional short data array, or null if the data are not stored in a short array. The array format is data[band][] where the second index is navigated using the pixel and line strides.

Returns:
The two-dimensional short data array.

getShortData

public short[] getShortData(int b)
Returns short data array for a specific band, or null if the data are not stored in a short array.

Parameters:
b - The band whose data array is to be retrieved.
Returns:
The one-dimensional short data array for the requested band.

getIntData

public int[][] getIntData()
Returns the two-dimensional integer data array, or null if the data are not stored in an integer array. The array format is data[band][] where the second index is navigated using the pixel and line strides.

Returns:
The two-dimensional int data array.

getIntData

public int[] getIntData(int b)
Returns integer data array for a specific band, or null if the data are not stored in an integer array.

Parameters:
b - The band whose data array is to be retrieved.
Returns:
The one-dimensional int data array for the requested band.

getFloatData

public float[][] getFloatData()
Returns the two-dimensional float data array, or null if the data are not stored in a float array. The array format is data[band][] where the second index is navigated using the pixel and line strides.

Returns:
The two-dimensional float data array.

getFloatData

public float[] getFloatData(int b)
Returns float data array for a specific band, or null if the data are not stored in a float array.

Parameters:
b - The band whose data array is to be retrieved.
Returns:
The one-dimensional float data array for the requested band.

getDoubleData

public double[][] getDoubleData()
Returns the two-dimensional double data array, or null if the data are not stored in a double array. The array format is data[band][] where the second index is navigated using the pixel and line strides.

Returns:
The two-dimensional double data array.

getDoubleData

public double[] getDoubleData(int b)
Returns double data array for a specific band, or null if the data are not stored in a double array.

Parameters:
b - The band whose data array is to be retrieved.
Returns:
The one-dimensional double data array for the requested band.

getOffset

public int getOffset(int b)
Returns the offset for a band.

Parameters:
b - The band whose offset is to be returned.
Returns:
The offset of the requested band.

getMinOffset

public int getMinOffset()
Returns the minimum offset of all bands.

Returns:
The minimum offset of all bands.

getMaxOffset

public int getMaxOffset()
Returns the maximum offset of all bands.

Returns:
The maximum offset of all the bands.