|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.jai.RasterFormatTag
This class encapsulates the information needed for RasterAccessor to understand how a Raster is laid out. It's designed so that one RasterFormatTag can be constructed per source and that RasterFormatTag can cache information that the RasterAccessor would otherwise have to extract from the Raster each time it's constructed (generally each time OpImage.computeRect() is called.) Additionally, it can cache various arrays (i.e. bankIndices[] and bandOffsets[]) that would otherwise be cloned everytime they were requested. Because of the way SampleModel.createCompatibleSampleModel() is designed not all fields of a particular SampleModel will match those of the SampleModel returned by SampleModel.createCompatibleSampleModel(). Values like pixelStride and numBands won't change, but values like bankIndicies[] and bandOffsets[] might if the underlying Raster is not pixelSequential. Rasters which are pixelSequential meet the following conditions 1) The SampleModel is a ComponentSampleModel. 2) The pixelStride is equal to the number of bands. 3) All the bankIndices[] are equal. 4) All the bandOffsets[] values are less than pixelStride 5) No two bandOffsets[] values are equal. For that reason, RasterFormatTags representing non pixelSequential rasters don't attempt to cache the bandOffsets[] or bankIndices[]. For such rasters, this information should be taken directly from the raster itself. Note that any RasterFormatTag that will cause data to be copied from the Raster will be pixelSequential as that is the format in which data is returned from Raster.getPixels() returns.
Constructor Summary | |
RasterFormatTag(SampleModel sampleModel,
int formatTagID)
Constructs a RasterFormatTag given a sampleModel and a formatTagID. |
Method Summary | |
int[] |
getBandOffsets()
Returns the bandOffsets for the Raster if isPixelSequential() is true. |
int[] |
getBankIndices()
Returns the bankIndices for the Raster if isPixelSequential() is true. |
int |
getFormatTagID()
Returns the FormatTagID used to construct this RasterFormatTag. |
int |
getNumBands()
Returns the number of bands in the underlying Raster |
int |
getPixelStride()
Returns the pixelStride of the underlying Raster |
boolean |
isPixelSequential()
Returns whether or not the SampleModel represented by the RasterFormatTag is PixelSequential. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RasterFormatTag(SampleModel sampleModel, int formatTagID)
SampleModel
for the RasterFormagTag
param formatTagID An int
to indicate format tag idMethod Detail |
public final boolean isPixelSequential()
public final int getFormatTagID()
public final int[] getBankIndices()
public final int getNumBands()
public final int[] getBandOffsets()
public final int getPixelStride()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |