Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.batik.ext.awt.image.codec.tiff
Class TIFFImage  view TIFFImage download TIFFImage.java

java.lang.Object
  extended byorg.apache.batik.ext.awt.image.rendered.AbstractRed
      extended byorg.apache.batik.ext.awt.image.codec.tiff.TIFFImage
All Implemented Interfaces:
org.apache.batik.ext.awt.image.rendered.CachableRed, java.awt.image.RenderedImage

public class TIFFImage
extends org.apache.batik.ext.awt.image.rendered.AbstractRed


Field Summary
(package private)  int chromaSubH
           
(package private)  int chromaSubV
           
(package private)  boolean colorConvertJPEG
           
(package private)  char[] colormap
           
static int COMP_DEFLATE
           
static int COMP_FAX_G3_1D
           
static int COMP_FAX_G3_2D
           
static int COMP_FAX_G4_2D
           
static int COMP_JPEG_OLD
           
static int COMP_JPEG_TTN2
           
static int COMP_LZW
           
static int COMP_NONE
           
static int COMP_PACKBITS
           
(package private)  int compression
           
(package private)  int dataType
           
(package private)  boolean decodePaletteAsShorts
           
(package private)  com.sun.image.codec.jpeg.JPEGDecodeParam decodeParam
           
private  TIFFFaxDecoder decoder
           
(package private)  int fillOrder
           
(package private)  int imageType
           
(package private)  java.util.zip.Inflater inflater
           
(package private)  boolean isBigEndian
           
(package private)  boolean isWhiteZero
           
private  TIFFLZWDecoder lzwDecoder
           
(package private)  int numBands
           
(package private)  byte[] palette
           
(package private)  int predictor
           
(package private)  int sampleSize
           
(package private)  org.apache.batik.ext.awt.image.codec.SeekableStream stream
           
private static int TIFF_JPEG_TABLES
           
private static int TIFF_YCBCR_SUBSAMPLING
           
(package private)  long tiffT4Options
           
(package private)  long tiffT6Options
           
(package private)  long[] tileByteCounts
           
(package private)  boolean tiled
           
(package private)  long[] tileOffsets
           
(package private)  int tileSize
           
(package private)  int tilesX
           
(package private)  int tilesY
           
private static int TYPE_BILEVEL
           
private static int TYPE_GENERIC
           
private static int TYPE_GRAY
           
private static int TYPE_GRAY_4BIT
           
private static int TYPE_GRAY_ALPHA
           
private static int TYPE_PALETTE
           
private static int TYPE_RGB
           
private static int TYPE_RGB_ALPHA
           
private static int TYPE_UNSUPPORTED
           
private static int TYPE_YCBCR_SUB
           
 
Fields inherited from class org.apache.batik.ext.awt.image.rendered.AbstractRed
bounds, cm, minTileX, minTileY, numXTiles, numYTiles, props, sm, srcs, tileGridXOff, tileGridYOff, tileHeight, tileWidth
 
Constructor Summary
TIFFImage(org.apache.batik.ext.awt.image.codec.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
 java.awt.image.WritableRaster copyData(java.awt.image.WritableRaster wr)
           
private  java.awt.image.ComponentColorModel createAlphaComponentColorModel(int dataType, int numBands, boolean isAlphaPremultiplied, int transparency)
           
private static java.awt.image.SampleModel createPixelInterleavedSampleModel(int dataType, int tileWidth, int tileHeight, int bands)
           
private static java.awt.image.Raster decodeJPEG(byte[] data, com.sun.image.codec.jpeg.JPEGDecodeParam decodeParam, boolean colorConvert, int minX, int minY)
          Decode a buffer of data into a Raster with the specified location.
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.
 TIFFDirectory getPrivateIFD(long offset)
          Reads a private IFD from a given offset in the stream.
 java.awt.image.Raster getTile(int tileX, int tileY)
          Returns tile (tileX, tileY) as a Raster.
private  void inflate(byte[] deflated, byte[] inflated)
          Inflates deflated into inflated using the Inflater 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.batik.ext.awt.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMP_NONE

public static final int COMP_NONE
See Also:
Constant Field Values

COMP_FAX_G3_1D

public static final int COMP_FAX_G3_1D
See Also:
Constant Field Values

COMP_FAX_G3_2D

public static final int COMP_FAX_G3_2D
See Also:
Constant Field Values

COMP_FAX_G4_2D

public static final int COMP_FAX_G4_2D
See Also:
Constant Field Values

COMP_LZW

public static final int COMP_LZW
See Also:
Constant Field Values

COMP_JPEG_OLD

public static final int COMP_JPEG_OLD
See Also:
Constant Field Values

COMP_JPEG_TTN2

public static final int COMP_JPEG_TTN2
See Also:
Constant Field Values

COMP_PACKBITS

public static final int COMP_PACKBITS
See Also:
Constant Field Values

COMP_DEFLATE

public static final int COMP_DEFLATE
See Also:
Constant Field Values

TYPE_UNSUPPORTED

private static final int TYPE_UNSUPPORTED
See Also:
Constant Field Values

TYPE_BILEVEL

private static final int TYPE_BILEVEL
See Also:
Constant Field Values

TYPE_GRAY_4BIT

private static final int TYPE_GRAY_4BIT
See Also:
Constant Field Values

TYPE_GRAY

private static final int TYPE_GRAY
See Also:
Constant Field Values

TYPE_GRAY_ALPHA

private static final int TYPE_GRAY_ALPHA
See Also:
Constant Field Values

TYPE_PALETTE

private static final int TYPE_PALETTE
See Also:
Constant Field Values

TYPE_RGB

private static final int TYPE_RGB
See Also:
Constant Field Values

TYPE_RGB_ALPHA

private static final int TYPE_RGB_ALPHA
See Also:
Constant Field Values

TYPE_YCBCR_SUB

private static final int TYPE_YCBCR_SUB
See Also:
Constant Field Values

TYPE_GENERIC

private static final int TYPE_GENERIC
See Also:
Constant Field Values

TIFF_JPEG_TABLES

private static final int TIFF_JPEG_TABLES
See Also:
Constant Field Values

TIFF_YCBCR_SUBSAMPLING

private static final int TIFF_YCBCR_SUBSAMPLING
See Also:
Constant Field Values

stream

org.apache.batik.ext.awt.image.codec.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

decodeParam

com.sun.image.codec.jpeg.JPEGDecodeParam decodeParam

colorConvertJPEG

boolean colorConvertJPEG

inflater

java.util.zip.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 Detail

TIFFImage

public TIFFImage(org.apache.batik.ext.awt.image.codec.SeekableStream stream,
                 TIFFDecodeParam param,
                 int directory)
          throws java.io.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.

Method Detail

decodeJPEG

private static final java.awt.image.Raster decodeJPEG(byte[] data,
                                                      com.sun.image.codec.jpeg.JPEGDecodeParam decodeParam,
                                                      boolean colorConvert,
                                                      int minX,
                                                      int minY)
Decode a buffer of data into a Raster with the specified location.


inflate

private final void inflate(byte[] deflated,
                           byte[] inflated)
Inflates deflated into inflated using the Inflater constructed during class instantiation.


createPixelInterleavedSampleModel

private static java.awt.image.SampleModel createPixelInterleavedSampleModel(int dataType,
                                                                            int tileWidth,
                                                                            int tileHeight,
                                                                            int bands)

getFieldAsLongs

private final 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 java.io.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.


copyData

public java.awt.image.WritableRaster copyData(java.awt.image.WritableRaster wr)

getTile

public java.awt.image.Raster getTile(int tileX,
                                     int tileY)
Returns tile (tileX, tileY) as a Raster.


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 java.awt.image.ComponentColorModel createAlphaComponentColorModel(int dataType,
                                                                          int numBands,
                                                                          boolean isAlphaPremultiplied,
                                                                          int transparency)