Class TIFFImageReadParam
ImageReadParam allowing control over
the TIFF reading process.
Because TIFF is an extensible format, the reader requires information about any tags used by TIFF extensions in order to emit meaningful metadata. Also, TIFF extensions may define new compression types. Both types of information about extensions may be provided by this interface.
Additional TIFF tags must be organized into
TIFFTagSets. A TIFFTagSet may be
provided to the reader by means of the
addAllowedTagSet method. By default, the tag sets
BaselineTIFFTagSet, FaxTIFFTagSet,
EXIFParentTIFFTagSet, and GeoTIFFTagSet
are included.
New TIFF decompressors are handled in a simple fashion. If a
non-null TIFFDecompressor is provided by
means of the setTIFFDecompressor method, it will override the
reader's usual choice of decompressor. Thus, to read an image with
a non-standard compression type, the application should first
attempt to read the image's metadata and extract the compression
type. The application may then use its own logic to choose a
suitable TIFFDecompressor, instantiate it, and pass it
to the ImageReadParam being used. The reader's
read method may be called with the
ImageReadParam set.
-
Field Summary
Fields inherited from class javax.imageio.ImageReadParam
canSetSourceRenderSize, destination, destinationBands, minProgressivePass, numProgressivePasses, sourceRenderSizeFields inherited from class javax.imageio.IIOParam
controller, defaultController, destinationOffset, destinationType, sourceBands, sourceRegion, sourceXSubsampling, sourceYSubsampling, subsamplingXOffset, subsamplingYOffset -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllowedTagSet(TIFFTagSet tagSet) Adds aTIFFTagSetobject to the list of allowed tag sets.Returns aListcontaining the allowedTIFFTagSetobjects.Returns the currently setTIFFColorConverterobject, ornullif none is set.Returns theTIFFDecompressorthat is currently set to be used by theImageReaderto decode each image strip or tile, ornullif none has been set.voidremoveAllowedTagSet(TIFFTagSet tagSet) Removes aTIFFTagSetobject from the list of allowed tag sets.voidsetColorConverter(TIFFColorConverter colorConverter) Sets theTIFFColorConverterobject for the pixel data being read.voidsetTIFFDecompressor(TIFFDecompressor decompressor) Sets theTIFFDecompressorobject to be used by theImageReaderto decode each image strip or tile.Methods inherited from class javax.imageio.ImageReadParam
canSetSourceRenderSize, getDestination, getDestinationBands, getSourceMaxProgressivePass, getSourceMinProgressivePass, getSourceNumProgressivePasses, getSourceRenderSize, setDestination, setDestinationBands, setDestinationType, setSourceProgressivePasses, setSourceRenderSizeMethods inherited from class javax.imageio.IIOParam
activateController, getController, getDefaultController, getDestinationOffset, getDestinationType, getSourceBands, getSourceRegion, getSourceXSubsampling, getSourceYSubsampling, getSubsamplingXOffset, getSubsamplingYOffset, hasController, setController, setDestinationOffset, setSourceBands, setSourceRegion, setSourceSubsampling
-
Constructor Details
-
TIFFImageReadParam
public TIFFImageReadParam()Constructs aTIFFImageReadParam. Tags defined by theTIFFTagSetsBaselineTIFFTagSet,FaxTIFFTagSet,EXIFParentTIFFTagSet, andGeoTIFFTagSetwill be supported.
-
-
Method Details
-
addAllowedTagSet
Adds aTIFFTagSetobject to the list of allowed tag sets.- Parameters:
tagSet- aTIFFTagSet.- Throws:
IllegalArgumentException- iftagSetisnull.
-
removeAllowedTagSet
Removes aTIFFTagSetobject from the list of allowed tag sets. Removal is based on theequalsmethod of theTIFFTagSet, which is normally defined as reference equality.- Parameters:
tagSet- aTIFFTagSet.- Throws:
IllegalArgumentException- iftagSetisnull.
-
getAllowedTagSets
Returns aListcontaining the allowedTIFFTagSetobjects.- Returns:
- a
ListofTIFFTagSets.
-
setTIFFDecompressor
Sets theTIFFDecompressorobject to be used by theImageReaderto decode each image strip or tile. A value ofnullallows the reader to choose its own TIFFDecompressor.- Parameters:
decompressor- theTIFFDecompressorto be used for decoding, ornullto allow the reader to choose its own.- See Also:
-
getTIFFDecompressor
Returns theTIFFDecompressorthat is currently set to be used by theImageReaderto decode each image strip or tile, ornullif none has been set.- Returns:
- decompressor the
TIFFDecompressorto be used for decoding, ornullif none has been set (allowing the reader to choose its own). - See Also:
-
setColorConverter
Sets theTIFFColorConverterobject for the pixel data being read. The data will be converted from the given color space to a standard RGB space as it is being read. A value ofnulldisables conversion.- Parameters:
colorConverter- aTIFFColorConverterobject to be used for final color conversion, ornull.- See Also:
-
getColorConverter
Returns the currently setTIFFColorConverterobject, ornullif none is set.- Returns:
- the current
TIFFColorConverterobject. - See Also:
-