Class TIFFImageReader
- java.lang.Object
-
- javax.imageio.ImageReader
-
- com.twelvemonkeys.imageio.ImageReaderBase
-
- com.twelvemonkeys.imageio.plugins.tiff.TIFFImageReader
-
public final class TIFFImageReader extends com.twelvemonkeys.imageio.ImageReaderBase
ImageReader implementation for Aldus/Adobe Tagged Image File Format (TIFF).The reader is supposed to be fully "Baseline TIFF" compliant, and supports the following image types:
- Class B (Bi-level), all relevant compression types, 1 bit per sample
- Class G (Gray), all relevant compression types, 2, 4, 8, 16 or 32 bits per sample, unsigned integer
- Class P (Palette/indexed color), all relevant compression types, 1, 2, 4, 8 or 16 bits per sample, unsigned integer
- Class R (RGB), all relevant compression types, 8 or 16 bits per sample, unsigned integer
- Tiling
- Class F (Facsimile), CCITT T.4 and T.6 compression (types 3 and 4), 1 bit per sample
- LZW Compression (type 5)
- "Old-style" JPEG Compression (type 6), as a best effort, as the spec is not well-defined
- JPEG Compression (type 7)
- ZLib (aka Adobe-style Deflate) Compression (type 8)
- Deflate Compression (type 32946)
- Horizontal differencing Predictor (type 2) for LZW, ZLib, Deflate and PackBits compression
- Alpha channel (ExtraSamples types 1/Associated Alpha and 2/Unassociated Alpha)
- Class S, CMYK data (PhotometricInterpretation type 5/Separated)
- Class Y, YCbCr data (PhotometricInterpretation type 6/YCbCr for both JPEG and other compressions
- Planar data (PlanarConfiguration type 2/Planar)
- ICC profiles (ICCProfile)
- BitsPerSample values up to 16 for most PhotometricInterpretations
- Multiple images (pages) in one file
- Version:
- $Id: TIFFImageReader.java,v 1.0 08.05.12 15:14 haraldk Exp$
- Author:
- Harald Kuhr, last modified by $Author: haraldk$
- See Also:
- Adobe TIFF developer resources, TIFF 6.0 specification, Wikipedia TIFF, AWare Systems TIFF pages
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canReadRaster()
int
getHeight(int imageIndex)
javax.imageio.metadata.IIOMetadata
getImageMetadata(int imageIndex)
java.util.Iterator<javax.imageio.ImageTypeSpecifier>
getImageTypes(int imageIndex)
int
getNumImages(boolean allowSearch)
javax.imageio.ImageTypeSpecifier
getRawImageType(int imageIndex)
javax.imageio.metadata.IIOMetadata
getStreamMetadata()
int
getWidth(int imageIndex)
static void
main(java.lang.String[] args)
java.awt.image.BufferedImage
read(int imageIndex, javax.imageio.ImageReadParam param)
java.awt.image.Raster
readRaster(int imageIndex, javax.imageio.ImageReadParam param)
protected void
resetMembers()
protected static void
showIt(java.awt.image.BufferedImage image, java.lang.String title)
-
Methods inherited from class com.twelvemonkeys.imageio.ImageReaderBase
assertInput, checkBounds, dispose, fakeAOI, fakeSubsampling, getDestination, hasExplicitDestination, reset, setInput
-
Methods inherited from class javax.imageio.ImageReader
abort, abortRequested, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, checkReadParamBandSettings, clearAbortRequest, computeRegions, getAspectRatio, getAvailableLocales, getDefaultReadParam, getFormatName, getImageMetadata, getInput, getLocale, getMinIndex, getNumThumbnails, getOriginatingProvider, getSourceRegion, getStreamMetadata, getThumbnailHeight, getThumbnailWidth, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, hasThumbnails, isIgnoringMetadata, isImageTiled, isRandomAccessEasy, isSeekForwardOnly, processImageComplete, processImageProgress, processImageStarted, processImageUpdate, processPassComplete, processPassStarted, processReadAborted, processSequenceComplete, processSequenceStarted, processThumbnailComplete, processThumbnailPassComplete, processThumbnailPassStarted, processThumbnailProgress, processThumbnailStarted, processThumbnailUpdate, processWarningOccurred, processWarningOccurred, read, readAll, readAll, readAsRenderedImage, readerSupportsThumbnails, readThumbnail, readTile, readTileRaster, removeAllIIOReadProgressListeners, removeAllIIOReadUpdateListeners, removeAllIIOReadWarningListeners, removeIIOReadProgressListener, removeIIOReadUpdateListener, removeIIOReadWarningListener, setInput, setInput, setLocale
-
-
-
-
Method Detail
-
resetMembers
protected void resetMembers()
- Specified by:
resetMembers
in classcom.twelvemonkeys.imageio.ImageReaderBase
-
getNumImages
public int getNumImages(boolean allowSearch) throws java.io.IOException
- Overrides:
getNumImages
in classcom.twelvemonkeys.imageio.ImageReaderBase
- Throws:
java.io.IOException
-
getWidth
public int getWidth(int imageIndex) throws java.io.IOException
- Specified by:
getWidth
in classjavax.imageio.ImageReader
- Throws:
java.io.IOException
-
getHeight
public int getHeight(int imageIndex) throws java.io.IOException
- Specified by:
getHeight
in classjavax.imageio.ImageReader
- Throws:
java.io.IOException
-
getRawImageType
public javax.imageio.ImageTypeSpecifier getRawImageType(int imageIndex) throws java.io.IOException
- Overrides:
getRawImageType
in classjavax.imageio.ImageReader
- Throws:
java.io.IOException
-
getImageTypes
public java.util.Iterator<javax.imageio.ImageTypeSpecifier> getImageTypes(int imageIndex) throws java.io.IOException
- Specified by:
getImageTypes
in classjavax.imageio.ImageReader
- Throws:
java.io.IOException
-
read
public java.awt.image.BufferedImage read(int imageIndex, javax.imageio.ImageReadParam param) throws java.io.IOException
- Specified by:
read
in classjavax.imageio.ImageReader
- Throws:
java.io.IOException
-
canReadRaster
public boolean canReadRaster()
- Overrides:
canReadRaster
in classjavax.imageio.ImageReader
-
readRaster
public java.awt.image.Raster readRaster(int imageIndex, javax.imageio.ImageReadParam param) throws java.io.IOException
- Overrides:
readRaster
in classjavax.imageio.ImageReader
- Throws:
java.io.IOException
-
getImageMetadata
public javax.imageio.metadata.IIOMetadata getImageMetadata(int imageIndex) throws java.io.IOException
- Overrides:
getImageMetadata
in classcom.twelvemonkeys.imageio.ImageReaderBase
- Throws:
java.io.IOException
-
getStreamMetadata
public javax.imageio.metadata.IIOMetadata getStreamMetadata() throws java.io.IOException
- Overrides:
getStreamMetadata
in classcom.twelvemonkeys.imageio.ImageReaderBase
- Throws:
java.io.IOException
-
main
public static void main(java.lang.String[] args) throws java.io.IOException
- Throws:
java.io.IOException
-
showIt
protected static void showIt(java.awt.image.BufferedImage image, java.lang.String title)
-
-