Class TIFFImage
java.lang.Object
org.apache.xmlgraphics.image.rendered.AbstractRed
org.apache.xmlgraphics.image.codec.tiff.TIFFImage
- All Implemented Interfaces:
RenderedImage
,CachableRed
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) int
(package private) int
(package private) char[]
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
(package private) int
(package private) int
(package private) boolean
private TIFFFaxDecoder
(package private) int
(package private) int
(package private) Inflater
(package private) boolean
(package private) boolean
private TIFFLZWDecoder
(package private) int
(package private) byte[]
(package private) int
(package private) int
(package private) SeekableStream
private static final int
private static final int
(package private) long
(package private) long
(package private) long[]
(package private) boolean
(package private) long[]
(package private) int
(package private) int
(package private) int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
Fields inherited from class org.apache.xmlgraphics.image.rendered.AbstractRed
bounds, cm, minTileX, minTileY, numXTiles, numYTiles, props, sm, srcs, tileGridXOff, tileGridYOff, tileHeight, tileWidth
-
Constructor Summary
ConstructorsConstructorDescriptionTIFFImage
(SeekableStream stream, TIFFDecodeParam param, int directory) Constructs a TIFFImage that acquires its data from a given SeekableStream and reads from a particular IFD of the stream. -
Method Summary
Modifier and TypeMethodDescriptionprivate ComponentColorModel
createAlphaComponentColorModel
(int dataType, int numBands, boolean isAlphaPremultiplied, int transparency) private static SampleModel
createPixelInterleavedSampleModel
(int dataType, int tileWidth, int tileHeight, int bands) private byte[]
decodePackbits
(byte[] data, int arraySize, byte[] dst) private long[]
getFieldAsLongs
(TIFFField field) Return as a long[] the value of a TIFF_LONG or TIFF_SHORT field.getPrivateIFD
(long offset) Reads a private IFD from a given offset in the stream.getTile
(int tileX, int tileY) Returns tile (tileX, tileY) as a Raster.private void
inflate
(byte[] deflated, byte[] inflated) Inflatesdeflated
intoinflated
using theInflater
constructed during class instantiation.private void
interpretBytesAsInts
(byte[] byteArray, int[] intArray, int intCount) private void
interpretBytesAsShorts
(byte[] byteArray, short[] shortArray, int shortCount) private void
readInts
(int intCount, int[] intArray) private void
readShorts
(int shortCount, short[] shortArray) Methods inherited from class org.apache.xmlgraphics.image.rendered.AbstractRed
copyBand, copyToRaster, getBounds, getColorModel, getData, getData, getDependencyRegion, getDirtyRegion, getHeight, getMinTileX, getMinTileY, getMinX, getMinY, getNumXTiles, getNumYTiles, getProperty, getPropertyNames, getSampleModel, getSources, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, getWidth, getXTile, getYTile, init, init, makeTile, updateTileGridInfo
-
Field Details
-
COMP_NONE
public static final int COMP_NONE- See Also:
-
COMP_FAX_G3_1D
public static final int COMP_FAX_G3_1D- See Also:
-
COMP_FAX_G3_2D
public static final int COMP_FAX_G3_2D- See Also:
-
COMP_FAX_G4_2D
public static final int COMP_FAX_G4_2D- See Also:
-
COMP_LZW
public static final int COMP_LZW- See Also:
-
COMP_JPEG_OLD
public static final int COMP_JPEG_OLD- See Also:
-
COMP_JPEG_TTN2
public static final int COMP_JPEG_TTN2- See Also:
-
COMP_PACKBITS
public static final int COMP_PACKBITS- See Also:
-
COMP_DEFLATE
public static final int COMP_DEFLATE- See Also:
-
TYPE_UNSUPPORTED
private static final int TYPE_UNSUPPORTED- See Also:
-
TYPE_BILEVEL
private static final int TYPE_BILEVEL- See Also:
-
TYPE_GRAY_4BIT
private static final int TYPE_GRAY_4BIT- See Also:
-
TYPE_GRAY
private static final int TYPE_GRAY- See Also:
-
TYPE_GRAY_ALPHA
private static final int TYPE_GRAY_ALPHA- See Also:
-
TYPE_PALETTE
private static final int TYPE_PALETTE- See Also:
-
TYPE_RGB
private static final int TYPE_RGB- See Also:
-
TYPE_RGB_ALPHA
private static final int TYPE_RGB_ALPHA- See Also:
-
TYPE_YCBCR_SUB
private static final int TYPE_YCBCR_SUB- See Also:
-
TYPE_GENERIC
private static final int TYPE_GENERIC- See Also:
-
TIFF_JPEG_TABLES
private static final int TIFF_JPEG_TABLES- See Also:
-
TIFF_YCBCR_SUBSAMPLING
private static final int TIFF_YCBCR_SUBSAMPLING- See Also:
-
stream
SeekableStream stream -
tileSize
int tileSize -
tilesX
int tilesX -
tilesY
int tilesY -
tileOffsets
long[] tileOffsets -
tileByteCounts
long[] tileByteCounts -
colormap
char[] colormap -
sampleSize
int sampleSize -
compression
int compression -
palette
byte[] palette -
numBands
int numBands -
chromaSubH
int chromaSubH -
chromaSubV
int chromaSubV -
tiffT4Options
long tiffT4Options -
tiffT6Options
long tiffT6Options -
fillOrder
int fillOrder -
predictor
int predictor -
inflater
Inflater inflater -
isBigEndian
boolean isBigEndian -
imageType
int imageType -
isWhiteZero
boolean isWhiteZero -
dataType
int dataType -
decodePaletteAsShorts
boolean decodePaletteAsShorts -
tiled
boolean tiled -
decoder
-
lzwDecoder
-
-
Constructor Details
-
TIFFImage
Constructs a TIFFImage that acquires its data from a given SeekableStream and reads from a particular IFD of the stream. The index of the first IFD is 0.- Parameters:
stream
- the SeekableStream to read from.param
- an instance of TIFFDecodeParam, or null.directory
- the index of the IFD to read from.- Throws:
IOException
-
-
Method Details
-
inflate
private void inflate(byte[] deflated, byte[] inflated) Inflatesdeflated
intoinflated
using theInflater
constructed during class instantiation. -
createPixelInterleavedSampleModel
private static SampleModel createPixelInterleavedSampleModel(int dataType, int tileWidth, int tileHeight, int bands) -
getFieldAsLongs
Return as a long[] the value of a TIFF_LONG or TIFF_SHORT field. -
getPrivateIFD
Reads a private IFD from a given offset in the stream. This method may be used to obtain IFDs that are referenced only by private tag values.- Throws:
IOException
-
copyData
-
getTile
Returns tile (tileX, tileY) as a Raster.- Specified by:
getTile
in interfaceRenderedImage
- Overrides:
getTile
in classAbstractRed
-
readShorts
private void readShorts(int shortCount, short[] shortArray) -
readInts
private void readInts(int intCount, int[] intArray) -
interpretBytesAsShorts
private void interpretBytesAsShorts(byte[] byteArray, short[] shortArray, int shortCount) -
interpretBytesAsInts
private void interpretBytesAsInts(byte[] byteArray, int[] intArray, int intCount) -
decodePackbits
private byte[] decodePackbits(byte[] data, int arraySize, byte[] dst) -
createAlphaComponentColorModel
private ComponentColorModel createAlphaComponentColorModel(int dataType, int numBands, boolean isAlphaPremultiplied, int transparency)
-