Class TIFFImage

java.lang.Object
org.apache.xmlgraphics.image.rendered.AbstractRed
org.apache.xmlgraphics.image.codec.tiff.TIFFImage
All Implemented Interfaces:
RenderedImage, CachableRed

public class TIFFImage extends AbstractRed
  • 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

    • 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

      private TIFFFaxDecoder decoder
    • lzwDecoder

      private TIFFLZWDecoder lzwDecoder
  • Constructor Details

    • TIFFImage

      public TIFFImage(SeekableStream stream, TIFFDecodeParam param, int directory) throws IOException
      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)
      Inflates deflated into inflated using the Inflater constructed during class instantiation.
    • createPixelInterleavedSampleModel

      private static SampleModel createPixelInterleavedSampleModel(int dataType, int tileWidth, int tileHeight, int bands)
    • getFieldAsLongs

      private long[] getFieldAsLongs(TIFFField field)
      Return as a long[] the value of a TIFF_LONG or TIFF_SHORT field.
    • getPrivateIFD

      public TIFFDirectory getPrivateIFD(long offset) throws IOException
      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

      public WritableRaster copyData(WritableRaster wr)
    • getTile

      public Raster getTile(int tileX, int tileY)
      Returns tile (tileX, tileY) as a Raster.
      Specified by:
      getTile in interface RenderedImage
      Overrides:
      getTile in class AbstractRed
    • 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)