Class DataReaderStrips
java.lang.Object
org.apache.commons.imaging.formats.tiff.datareaders.AbstractImageDataReader
org.apache.commons.imaging.formats.tiff.datareaders.DataReaderStrips
Provides a data reader for TIFF file images organized by tiles.
See AbstractImageDataReader for notes discussing design and development with particular emphasis on run-time performance.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final ByteOrderprivate final intprivate final AbstractTiffImageData.Stripsprivate final TiffPlanarConfigurationprivate final intprivate intprivate intFields inherited from class AbstractImageDataReader
bitsPerSampleLength, directory, height, photometricInterpreter, predictor, sampleFormat, samplesPerPixel, width -
Constructor Summary
ConstructorsConstructorDescriptionDataReaderStrips(TiffDirectory directory, AbstractPhotometricInterpreter photometricInterpreter, int bitsPerPixel, int[] bitsPerSample, int predictor, int samplesPerPixel, int sampleFormat, int width, int height, int compression, TiffPlanarConfiguration planarConfiguration, ByteOrder byteOrder, int rowsPerStrip, AbstractTiffImageData.Strips imageData) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidinterpretStrip(ImageBuilder imageBuilder, byte[] bytes, int pixelsPerStrip, int yLimit) readImageData(Rectangle subImageSpecification, boolean hasAlpha, boolean isAlphaPreMultiplied) Reads the image data from the IFD associated with this instance of ImageDataReader using the optional sub-image specification if desired.readRasterData(Rectangle subImage) Defines a method for accessing the floating-point raster data in a TIFF image.private AbstractTiffRasterDatareadRasterDataFloat(Rectangle subImage) private AbstractTiffRasterDatareadRasterDataInt(Rectangle subImage)
-
Field Details
-
bitsPerPixel
private final int bitsPerPixel -
compression
private final int compression -
rowsPerStrip
private final int rowsPerStrip -
planarConfiguration
-
byteOrder
-
x
private int x -
y
private int y -
imageData
-
-
Constructor Details
-
DataReaderStrips
public DataReaderStrips(TiffDirectory directory, AbstractPhotometricInterpreter photometricInterpreter, int bitsPerPixel, int[] bitsPerSample, int predictor, int samplesPerPixel, int sampleFormat, int width, int height, int compression, TiffPlanarConfiguration planarConfiguration, ByteOrder byteOrder, int rowsPerStrip, AbstractTiffImageData.Strips imageData)
-
-
Method Details
-
interpretStrip
private void interpretStrip(ImageBuilder imageBuilder, byte[] bytes, int pixelsPerStrip, int yLimit) throws ImagingException, IOException - Throws:
ImagingExceptionIOException
-
readImageData
public ImageBuilder readImageData(Rectangle subImageSpecification, boolean hasAlpha, boolean isAlphaPreMultiplied) throws IOException, ImagingException Description copied from class:AbstractImageDataReaderReads the image data from the IFD associated with this instance of ImageDataReader using the optional sub-image specification if desired.- Specified by:
readImageDatain classAbstractImageDataReader- Parameters:
subImageSpecification- a rectangle describing a sub-region of the image for reading, or a null if the whole image is to be read.hasAlpha- indicates that the image has an alpha (transparency) channel (RGB color model only).isAlphaPreMultiplied- indicates that the image uses the associated alpha channel format (pre-multiplied alpha).- Returns:
- a valid instance containing the pixel data from the image.
- Throws:
IOException- in the event of an unrecoverable I/O error.ImagingException- TODO
-
readRasterData
public AbstractTiffRasterData readRasterData(Rectangle subImage) throws ImagingException, IOException Description copied from class:AbstractImageDataReaderDefines a method for accessing the floating-point raster data in a TIFF image. These implementations of this method in DataReaderStrips and DataReaderTiled assume that this instance is of a compatible data type (floating-point) and that all access checks have already been performed.- Specified by:
readRasterDatain classAbstractImageDataReader- Parameters:
subImage- if non-null, instructs the access method to retrieve only a sub-section of the image data.- Returns:
- a valid instance
- Throws:
ImagingException- in the event of an incompatible data form.IOException- in the event of I/O error.
-
readRasterDataFloat
private AbstractTiffRasterData readRasterDataFloat(Rectangle subImage) throws ImagingException, IOException - Throws:
ImagingExceptionIOException
-
readRasterDataInt
private AbstractTiffRasterData readRasterDataInt(Rectangle subImage) throws ImagingException, IOException - Throws:
ImagingExceptionIOException
-