ComponentSampleModel format and binary image data in a zero-offset byte array format even when the original data are not so stored. RasterAccessor is meant to make the common (ComponentSampleModel) case fast and other formats possible without forcing the OpImage writer to cover more than one case per non-binary data type. When constructing a RasterAccessor with a source(s) that has an IndexColorModel and a destination that has a non-IndexColorModel, RasterAccessor will perform expansion of the source pixels. If the source(s) and the destination have an IndexColorModel, then RasterAccessor will assume that the operation can correctly process an IndexColorModel source and will not expand the source pixels (colormap indices) into color components. Refer to {@link JAI#KEY_REPLACE_INDEX_COLOR_MODEL} for a mechanism by which the destination image's ColorModel is set to a non-IndexColorModel to cause RasterAccessor to expand the source's IndexColorModel.
Binary data are handled as a special case. In general image data are considered to be binary when the image has a single-banded MultiPixelPackedSampleModel with one bit per pixel. This may be verified by invoking the isBinary() method. For this case the methods getBinaryDataArray() and copyBinaryDataToRaster() should be used to access and set, respectively, the binary data in packed form. If the binary data are to be accessed in expanded form, i.e., as bytes, then the usual byte methods getByteDataArray(), getByteDataArrays(), and copyDataToRaster() should be used.
ComponentSampleModel format and binary image data in a zero-offset byte array format even when the original data are not so stored. RasterAccessor is meant to make the common (ComponentSampleModel) case fast and other formats possible without forcing the OpImage writer to cover more than one case per non-binary data type. When constructing a RasterAccessor with a source(s) that has an IndexColorModel and a destination that has a non-IndexColorModel, RasterAccessor will perform expansion of the source pixels. If the source(s) and the destination have an IndexColorModel, then RasterAccessor will assume that the operation can correctly process an IndexColorModel source and will not expand the source pixels (colormap indices) into color components. Refer to {@link JAI#KEY_REPLACE_INDEX_COLOR_MODEL} for a mechanism by which the destination image's ColorModel is set to a non-IndexColorModel to cause RasterAccessor to expand the source's IndexColorModel.
Binary data are handled as a special case. In general image data are considered to be binary when the image has a single-banded MultiPixelPackedSampleModel with one bit per pixel. This may be verified by invoking the isBinary() method. For this case the methods getBinaryDataArray() and copyBinaryDataToRaster() should be used to access and set, respectively, the binary data in packed form. If the binary data are to be accessed in expanded form, i.e., as bytes, then the usual byte methods getByteDataArray(), getByteDataArrays(), and copyDataToRaster() should be used.
| |
| |