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
TIFFTagSet
s. 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
FieldsModifier and TypeFieldDescription(package private) List
(package private) TIFFColorConverter
(package private) TIFFDecompressor
Fields inherited from class javax.imageio.ImageReadParam
canSetSourceRenderSize, destination, destinationBands, minProgressivePass, numProgressivePasses, sourceRenderSize
Fields inherited from class javax.imageio.IIOParam
controller, defaultController, destinationOffset, destinationType, sourceBands, sourceRegion, sourceXSubsampling, sourceYSubsampling, subsamplingXOffset, subsamplingYOffset
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAllowedTagSet
(TIFFTagSet tagSet) Adds aTIFFTagSet
object to the list of allowed tag sets.Returns aList
containing the allowedTIFFTagSet
objects.Returns the currently setTIFFColorConverter
object, ornull
if none is set.Returns theTIFFDecompressor
that is currently set to be used by theImageReader
to decode each image strip or tile, ornull
if none has been set.void
removeAllowedTagSet
(TIFFTagSet tagSet) Removes aTIFFTagSet
object from the list of allowed tag sets.void
setColorConverter
(TIFFColorConverter colorConverter) Sets theTIFFColorConverter
object for the pixel data being read.void
setTIFFDecompressor
(TIFFDecompressor decompressor) Sets theTIFFDecompressor
object to be used by theImageReader
to decode each image strip or tile.Methods inherited from class javax.imageio.ImageReadParam
canSetSourceRenderSize, getDestination, getDestinationBands, getSourceMaxProgressivePass, getSourceMinProgressivePass, getSourceNumProgressivePasses, getSourceRenderSize, setDestination, setDestinationBands, setDestinationType, setSourceProgressivePasses, setSourceRenderSize
Methods inherited from class javax.imageio.IIOParam
activateController, getController, getDefaultController, getDestinationOffset, getDestinationType, getSourceBands, getSourceRegion, getSourceXSubsampling, getSourceYSubsampling, getSubsamplingXOffset, getSubsamplingYOffset, hasController, setController, setDestinationOffset, setSourceBands, setSourceRegion, setSourceSubsampling
-
Field Details
-
allowedTagSets
List allowedTagSets -
decompressor
TIFFDecompressor decompressor -
colorConverter
TIFFColorConverter colorConverter
-
-
Constructor Details
-
TIFFImageReadParam
public TIFFImageReadParam()Constructs aTIFFImageReadParam
. Tags defined by theTIFFTagSet
sBaselineTIFFTagSet
,FaxTIFFTagSet
,EXIFParentTIFFTagSet
, andGeoTIFFTagSet
will be supported.- See Also:
-
-
Method Details
-
addAllowedTagSet
Adds aTIFFTagSet
object to the list of allowed tag sets.- Parameters:
tagSet
- aTIFFTagSet
.- Throws:
IllegalArgumentException
- iftagSet
isnull
.
-
removeAllowedTagSet
Removes aTIFFTagSet
object from the list of allowed tag sets. Removal is based on theequals
method of theTIFFTagSet
, which is normally defined as reference equality.- Parameters:
tagSet
- aTIFFTagSet
.- Throws:
IllegalArgumentException
- iftagSet
isnull
.
-
getAllowedTagSets
Returns aList
containing the allowedTIFFTagSet
objects.- Returns:
- a
List
ofTIFFTagSet
s.
-
setTIFFDecompressor
Sets theTIFFDecompressor
object to be used by theImageReader
to decode each image strip or tile. A value ofnull
allows the reader to choose its own TIFFDecompressor.- Parameters:
decompressor
- theTIFFDecompressor
to be used for decoding, ornull
to allow the reader to choose its own.- See Also:
-
getTIFFDecompressor
Returns theTIFFDecompressor
that is currently set to be used by theImageReader
to decode each image strip or tile, ornull
if none has been set.- Returns:
- decompressor the
TIFFDecompressor
to be used for decoding, ornull
if none has been set (allowing the reader to choose its own). - See Also:
-
setColorConverter
Sets theTIFFColorConverter
object 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 ofnull
disables conversion.- Parameters:
colorConverter
- aTIFFColorConverter
object to be used for final color conversion, ornull
.- See Also:
-
getColorConverter
Returns the currently setTIFFColorConverter
object, ornull
if none is set.- Returns:
- the current
TIFFColorConverter
object. - See Also:
-