Class ImageDataReader
- java.lang.Object
-
- org.apache.commons.imaging.formats.tiff.datareaders.ImageDataReader
-
- Direct Known Subclasses:
DataReaderStrips
,DataReaderTiled
public abstract class ImageDataReader extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected int
bitsPerSampleLength
protected TiffDirectory
directory
protected int
height
protected PhotometricInterpreter
photometricInterpreter
protected int
predictor
protected int
samplesPerPixel
protected int
width
-
Constructor Summary
Constructors Constructor Description ImageDataReader(TiffDirectory directory, PhotometricInterpreter photometricInterpreter, int[] bitsPerSample, int predictor, int samplesPerPixel, int width, int height)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected int[]
applyPredictor(int[] samples)
protected byte[]
decompress(byte[] compressedInput, int compression, int expectedSize, int tileWidth, int tileHeight)
protected boolean
isHomogenous(int size)
Checks if all the bits per sample entries are the same sizeabstract BufferedImage
readImageData(Rectangle subImage)
abstract void
readImageData(ImageBuilder imageBuilder)
protected void
resetPredictor()
-
-
-
Field Detail
-
directory
protected final TiffDirectory directory
-
photometricInterpreter
protected final PhotometricInterpreter photometricInterpreter
-
bitsPerSampleLength
protected final int bitsPerSampleLength
-
predictor
protected final int predictor
-
samplesPerPixel
protected final int samplesPerPixel
-
width
protected final int width
-
height
protected final int height
-
-
Constructor Detail
-
ImageDataReader
public ImageDataReader(TiffDirectory directory, PhotometricInterpreter photometricInterpreter, int[] bitsPerSample, int predictor, int samplesPerPixel, int width, int height)
-
-
Method Detail
-
readImageData
public abstract void readImageData(ImageBuilder imageBuilder) throws ImageReadException, IOException
- Throws:
ImageReadException
IOException
-
readImageData
public abstract BufferedImage readImageData(Rectangle subImage) throws ImageReadException, IOException
- Throws:
ImageReadException
IOException
-
isHomogenous
protected boolean isHomogenous(int size)
Checks if all the bits per sample entries are the same size- Parameters:
size
- the size to check- Returns:
- true if all the bits per sample entries are the same
-
resetPredictor
protected void resetPredictor()
-
applyPredictor
protected int[] applyPredictor(int[] samples)
-
decompress
protected byte[] decompress(byte[] compressedInput, int compression, int expectedSize, int tileWidth, int tileHeight) throws ImageReadException, IOException
- Throws:
ImageReadException
IOException
-
-