Class DataReaderTiled
- java.lang.Object
-
- org.apache.commons.imaging.formats.tiff.datareaders.AbstractImageDataReader
-
- org.apache.commons.imaging.formats.tiff.datareaders.DataReaderTiled
-
public final class DataReaderTiled extends AbstractImageDataReader
Provides a data reader for TIFF file images organized by tiles.
-
-
Field Summary
Fields Modifier and Type Field Description private intbitsPerPixelprivate java.nio.ByteOrderbyteOrderprivate intcompressionprivate AbstractTiffImageData.TilesimageDataprivate inttileLengthprivate inttileWidth-
Fields inherited from class org.apache.commons.imaging.formats.tiff.datareaders.AbstractImageDataReader
bitsPerSampleLength, directory, height, photometricInterpreter, planarConfiguration, predictor, sampleFormat, samplesPerPixel, width
-
-
Constructor Summary
Constructors Constructor Description DataReaderTiled(TiffDirectory directory, AbstractPhotometricInterpreter photometricInterpreter, int tileWidth, int tileLength, int bitsPerPixel, int[] bitsPerSample, int predictor, int samplesPerPixel, int sampleFormat, int width, int height, int compression, TiffPlanarConfiguration planarConfiguration, java.nio.ByteOrder byteOrder, AbstractTiffImageData.Tiles imageData)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidinterpretTile(ImageBuilder imageBuilder, byte[] bytes, int startX, int startY, int xLimit, int yLimit)ImageBuilderreadImageData(java.awt.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.AbstractTiffRasterDatareadRasterData(java.awt.Rectangle subImage)Defines a method for accessing the floating-point raster data in a TIFF image.private AbstractTiffRasterDatareadRasterDataFloat(java.awt.Rectangle subImage)private AbstractTiffRasterDatareadRasterDataInt(java.awt.Rectangle subImage)-
Methods inherited from class org.apache.commons.imaging.formats.tiff.datareaders.AbstractImageDataReader
applyPredictor, applyPredictorToBlock, decompress, getSamplesAsBytes, isHomogenous, resetPredictor, transferBlockToRaster, transferBlockToRaster, unpackFloatingPointSamples, unpackIntSamples
-
-
-
-
Field Detail
-
tileWidth
private final int tileWidth
-
tileLength
private final int tileLength
-
bitsPerPixel
private final int bitsPerPixel
-
compression
private final int compression
-
byteOrder
private final java.nio.ByteOrder byteOrder
-
imageData
private final AbstractTiffImageData.Tiles imageData
-
-
Constructor Detail
-
DataReaderTiled
public DataReaderTiled(TiffDirectory directory, AbstractPhotometricInterpreter photometricInterpreter, int tileWidth, int tileLength, int bitsPerPixel, int[] bitsPerSample, int predictor, int samplesPerPixel, int sampleFormat, int width, int height, int compression, TiffPlanarConfiguration planarConfiguration, java.nio.ByteOrder byteOrder, AbstractTiffImageData.Tiles imageData)
-
-
Method Detail
-
interpretTile
private void interpretTile(ImageBuilder imageBuilder, byte[] bytes, int startX, int startY, int xLimit, int yLimit) throws ImagingException, java.io.IOException
- Throws:
ImagingExceptionjava.io.IOException
-
readImageData
public ImageBuilder readImageData(java.awt.Rectangle subImageSpecification, boolean hasAlpha, boolean isAlphaPreMultiplied) throws java.io.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:
java.io.IOException- in the event of an unrecoverable I/O error.ImagingException- TODO
-
readRasterData
public AbstractTiffRasterData readRasterData(java.awt.Rectangle subImage) throws ImagingException, java.io.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.java.io.IOException- in the event of I/O error.
-
readRasterDataFloat
private AbstractTiffRasterData readRasterDataFloat(java.awt.Rectangle subImage) throws ImagingException, java.io.IOException
- Throws:
ImagingExceptionjava.io.IOException
-
readRasterDataInt
private AbstractTiffRasterData readRasterDataInt(java.awt.Rectangle subImage) throws ImagingException, java.io.IOException
- Throws:
ImagingExceptionjava.io.IOException
-
-