Class TIFFImageReadParam
- java.lang.Object
-
- javax.imageio.IIOParam
-
- javax.imageio.ImageReadParam
-
- com.github.jaiimageio.plugins.tiff.TIFFImageReadParam
-
public class TIFFImageReadParam extends javax.imageio.ImageReadParam
A subclass ofImageReadParam
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. ATIFFTagSet
may be provided to the reader by means of theaddAllowedTagSet
method. By default, the tag setsBaselineTIFFTagSet
,FaxTIFFTagSet
,EXIFParentTIFFTagSet
, andGeoTIFFTagSet
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 suitableTIFFDecompressor
, instantiate it, and pass it to theImageReadParam
being used. The reader'sread
method may be called with theImageReadParam
set.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.List
allowedTagSets
(package private) TIFFColorConverter
colorConverter
(package private) TIFFDecompressor
decompressor
-
Constructor Summary
Constructors Constructor Description TIFFImageReadParam()
Constructs aTIFFImageReadParam
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAllowedTagSet(TIFFTagSet tagSet)
Adds aTIFFTagSet
object to the list of allowed tag sets.java.util.List
getAllowedTagSets()
Returns aList
containing the allowedTIFFTagSet
objects.TIFFColorConverter
getColorConverter()
Returns the currently setTIFFColorConverter
object, ornull
if none is set.TIFFDecompressor
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.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 Detail
-
allowedTagSets
java.util.List allowedTagSets
-
decompressor
TIFFDecompressor decompressor
-
colorConverter
TIFFColorConverter colorConverter
-
-
Constructor Detail
-
TIFFImageReadParam
public TIFFImageReadParam()
Constructs aTIFFImageReadParam
. Tags defined by theTIFFTagSet
sBaselineTIFFTagSet
,FaxTIFFTagSet
,EXIFParentTIFFTagSet
, andGeoTIFFTagSet
will be supported.- See Also:
BaselineTIFFTagSet
,FaxTIFFTagSet
,EXIFParentTIFFTagSet
,GeoTIFFTagSet
-
-
Method Detail
-
addAllowedTagSet
public void addAllowedTagSet(TIFFTagSet tagSet)
Adds aTIFFTagSet
object to the list of allowed tag sets.- Parameters:
tagSet
- aTIFFTagSet
.- Throws:
java.lang.IllegalArgumentException
- iftagSet
isnull
.
-
removeAllowedTagSet
public void removeAllowedTagSet(TIFFTagSet tagSet)
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:
java.lang.IllegalArgumentException
- iftagSet
isnull
.
-
getAllowedTagSets
public java.util.List getAllowedTagSets()
Returns aList
containing the allowedTIFFTagSet
objects.- Returns:
- a
List
ofTIFFTagSet
s.
-
setTIFFDecompressor
public void setTIFFDecompressor(TIFFDecompressor decompressor)
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()
-
getTIFFDecompressor
public TIFFDecompressor 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:
setTIFFDecompressor(TIFFDecompressor)
-
setColorConverter
public void setColorConverter(TIFFColorConverter colorConverter)
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()
-
getColorConverter
public TIFFColorConverter getColorConverter()
Returns the currently setTIFFColorConverter
object, ornull
if none is set.- Returns:
- the current
TIFFColorConverter
object. - See Also:
setColorConverter(TIFFColorConverter)
-
-