javax.media.jai
Class PackedImageData

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

public final class PackedImageData
extends Object

This class is used by PixelAccessor to store packed image data along with access information. The data must be single banded and one bit in depth, and are stored in a one-dimensional byte array, with eight pixels packed into one byte. To insure that each scanline has an integral number of bytes the last byte may be padded with zeros.

Since:
JAI 1.1

Field Summary
 int bitOffset
          The number of bits into the byte that contains the first pixel of each scanline.
 boolean coercedZeroOffset
          Whether the data have been coerced to have zero offsets.
 boolean convertToDest
          Indicates whether the PixelAccessor can and must set the data back into the Raster.
 byte[] data
          The data array supplied to store the converted data.
 int lineStride
          The number of array elements in each scanline.
 int offset
          The number of array elements from the beginning of the data array to the first pixel of the Rectangle.
 Raster raster
          The Raster containing the pixel data.
 Rectangle rect
          The rectangular region within the Raster from which the data are to be retrieved.
 
Constructor Summary
PackedImageData(Raster raster, Rectangle rect, byte[] data, int lineStride, int offset, int bitOffset, boolean coercedZeroOffset, boolean convertToDest)
          Constructs a PackedImageRaster.
 
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 from which the data are to be retrieved.


data

public final byte[] data
The data array supplied to store the converted data.


lineStride

public final int lineStride
The number of array elements in each scanline.


offset

public final int offset
The number of array elements from the beginning of the data array to the first pixel of the Rectangle. Since there is only one sample per pixel, there is only one offset value.


bitOffset

public final int bitOffset
The number of bits into the byte that contains the first pixel of each scanline. This is the same for every scanline. Note that the bit offset is counted from left to right in a byte. That is, the most significant bit (bit 7) has an offset of 0.


coercedZeroOffset

public final boolean coercedZeroOffset
Whether the data have been coerced to have zero offsets.


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

PackedImageData

public PackedImageData(Raster raster,
                       Rectangle rect,
                       byte[] data,
                       int lineStride,
                       int offset,
                       int bitOffset,
                       boolean coercedZeroOffset,
                       boolean convertToDest)
Constructs a PackedImageRaster.

Parameters:
raster - The Raster containing the pixel data.
rect - The rectangular region from which the data are extracted.
data - The byte data array supplied to store the data.
lineStride - The data array increment to move from the coordinate x of line i to coordinate x of line i+1.
offset - The number of bytes from the start of the data array at which to store the first pixel of the rectangle.
bitOffset - The number of bits into the byte that contains the first pixel of each scanline. This is the same for every scanline. Note that the bit offset is counted from left to right in a byte. That is, the most significant bit of a byte (bit 7) has an offset of 0.
coercedZeroOffset - Whether the data have been coerced to have zero offsets.
convertToDest - A boolean indicating whether the data can and must be set back into the Raster. This applies only to destinations.