Class TIFFImageReadParam
- java.lang.Object
-
- javax.imageio.IIOParam
-
- javax.imageio.ImageReadParam
-
- com.github.jaiimageio.plugins.tiff.TIFFImageReadParam
-
public class TIFFImageReadParam extends javax.imageio.ImageReadParamA subclass ofImageReadParamallowing 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. ATIFFTagSetmay be provided to the reader by means of theaddAllowedTagSetmethod. By default, the tag setsBaselineTIFFTagSet,FaxTIFFTagSet,EXIFParentTIFFTagSet, andGeoTIFFTagSetare included.New TIFF decompressors are handled in a simple fashion. If a non-
nullTIFFDecompressoris 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 theImageReadParambeing used. The reader'sreadmethod may be called with theImageReadParamset.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.ListallowedTagSets(package private) TIFFColorConvertercolorConverter(package private) TIFFDecompressordecompressor
-
Constructor Summary
Constructors Constructor Description TIFFImageReadParam()Constructs aTIFFImageReadParam.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAllowedTagSet(TIFFTagSet tagSet)Adds aTIFFTagSetobject to the list of allowed tag sets.java.util.ListgetAllowedTagSets()Returns aListcontaining the allowedTIFFTagSetobjects.TIFFColorConvertergetColorConverter()Returns the currently setTIFFColorConverterobject, ornullif none is set.TIFFDecompressorgetTIFFDecompressor()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, 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 theTIFFTagSetsBaselineTIFFTagSet,FaxTIFFTagSet,EXIFParentTIFFTagSet, andGeoTIFFTagSetwill be supported.- See Also:
BaselineTIFFTagSet,FaxTIFFTagSet,EXIFParentTIFFTagSet,GeoTIFFTagSet
-
-
Method Detail
-
addAllowedTagSet
public void addAllowedTagSet(TIFFTagSet tagSet)
Adds aTIFFTagSetobject to the list of allowed tag sets.- Parameters:
tagSet- aTIFFTagSet.- Throws:
java.lang.IllegalArgumentException- iftagSetisnull.
-
removeAllowedTagSet
public void removeAllowedTagSet(TIFFTagSet tagSet)
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:
java.lang.IllegalArgumentException- iftagSetisnull.
-
getAllowedTagSets
public java.util.List getAllowedTagSets()
Returns aListcontaining the allowedTIFFTagSetobjects.- Returns:
- a
ListofTIFFTagSets.
-
setTIFFDecompressor
public void setTIFFDecompressor(TIFFDecompressor decompressor)
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()
-
getTIFFDecompressor
public TIFFDecompressor 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:
setTIFFDecompressor(TIFFDecompressor)
-
setColorConverter
public void setColorConverter(TIFFColorConverter colorConverter)
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()
-
getColorConverter
public TIFFColorConverter getColorConverter()
Returns the currently setTIFFColorConverterobject, ornullif none is set.- Returns:
- the current
TIFFColorConverterobject. - See Also:
setColorConverter(TIFFColorConverter)
-
-