Class TIFFImageReadParam
java.lang.Object
javax.imageio.IIOParam
javax.imageio.ImageReadParam
javax.imageio.plugins.tiff.TIFFImageReadParam
A subclass of
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.
Forcing reading of fields corresponding to TIFFTags
not in any of the allowed TIFFTagSets may be effected via
setReadUnknownTags.
- Since:
- 9
-
Field Summary
Fields declared in class ImageReadParam
canSetSourceRenderSize, destination, destinationBands, minProgressivePass, numProgressivePasses, sourceRenderSizeModifier and TypeFieldDescriptionprotected booleantrueif thisImageReadParamallows the source rendering dimensions to be set.protected BufferedImageThe current destinationBufferedImage, ornullif none has been set.protected int[]The set of destination bands to be used, as an array ofints.protected intThe minimum index of a progressive pass to read from the source.protected intThe maximum number of progressive passes to read from the source.protected DimensionThe desired rendering width and height of the source, ifcanSetSourceRenderSizeistrue, ornull.Fields declared in class IIOParam
controller, defaultController, destinationOffset, destinationType, sourceBands, sourceRegion, sourceXSubsampling, sourceYSubsampling, subsamplingXOffset, subsamplingYOffsetModifier and TypeFieldDescriptionprotected IIOParamControllerTheIIOParamControllerthat will be used to provide settings for thisIIOParamobject when theactivateControllermethod is called.protected IIOParamControllerThe defaultIIOParamControllerthat will be used to provide settings for thisIIOParamobject when theactivateControllermethod is called.protected PointThe offset in the destination where the upper-left decoded pixel should be placed.protected ImageTypeSpecifierAnImageTypeSpecifierto be used to generate a destination image when reading, or to set the output color type when writing.protected int[]An array ofints indicating which source bands will be used, ornull.protected RectangleThe source region, onnullif none is set.protected intThe decimation subsampling to be applied in the horizontal direction.protected intThe decimation subsampling to be applied in the vertical direction.protected intA horizontal offset to be applied to the subsampling grid before subsampling.protected intA vertical offset to be applied to the subsampling grid before subsampling. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllowedTagSet(TIFFTagSet tagSet) Adds aTIFFTagSetobject to the list of allowed tag sets.Returns aListcontaining the allowedTIFFTagSetobjects.booleanRetrieve the setting of whether to read fields corresponding to unknownTIFFTags.voidremoveAllowedTagSet(TIFFTagSet tagSet) Removes aTIFFTagSetobject from the list of allowed tag sets.voidsetReadUnknownTags(boolean readUnknownTags) Set whether to read fields corresponding toTIFFTags not in the allowedTIFFTagSets.Methods declared in class ImageReadParam
canSetSourceRenderSize, getDestination, getDestinationBands, getSourceMaxProgressivePass, getSourceMinProgressivePass, getSourceNumProgressivePasses, getSourceRenderSize, setDestination, setDestinationBands, setSourceProgressivePasses, setSourceRenderSizeModifier and TypeMethodDescriptionbooleanReturnstrueif this reader allows the source image to be rendered at an arbitrary size as part of the decoding process, by means of thesetSourceRenderSizemethod.Returns theBufferedImagecurrently set by thesetDestinationmethod, ornullif none is set.int[]Returns the set of band indices where data will be placed.intIfgetSourceNumProgressivePassesis equal toInteger.MAX_VALUE, returnsInteger.MAX_VALUE.intReturns the index of the first progressive pass that will be decoded.intReturns the number of the progressive passes that will be decoded.Returns the width and height of the source image as it will be rendered during decoding, if they have been set via thesetSourceRenderSizemethod.voidsetDestination(BufferedImage destination) Supplies aBufferedImageto be used as the destination for decoded pixel data.voidsetDestinationBands(int[] destinationBands) Sets the indices of the destination bands where data will be placed.voidsetSourceProgressivePasses(int minPass, int numPasses) Sets the range of progressive passes that will be decoded.voidsetSourceRenderSize(Dimension size) If the image is able to be rendered at an arbitrary size, sets the source width and height to the supplied values.Methods declared in class IIOParam
activateController, getController, getDefaultController, getDestinationOffset, getDestinationType, getSourceBands, getSourceRegion, getSourceXSubsampling, getSourceYSubsampling, getSubsamplingXOffset, getSubsamplingYOffset, hasController, setController, setDestinationOffset, setDestinationType, setSourceBands, setSourceRegion, setSourceSubsamplingModifier and TypeMethodDescriptionbooleanActivates the installedIIOParamControllerfor thisIIOParamobject and returns the resulting value.Returns whateverIIOParamControlleris currently installed.Returns the defaultIIOParamController, if there is one, regardless of the currently installed controller.Returns the offset in the destination image at which pixels are to be placed.Returns the type of image to be returned by the read, if one was set by a call tosetDestination(ImageTypeSpecifier), as anImageTypeSpecifier.int[]Returns the set of source bands to be used.Returns the source region to be used.intReturns the number of source columns to advance for each pixel.intReturns the number of rows to advance for each pixel.intReturns the horizontal offset of the subsampling grid.intReturns the vertical offset of the subsampling grid.booleanReturnstrueif there is a controller installed for thisIIOParamobject.voidsetController(IIOParamController controller) Sets theIIOParamControllerto be used to provide settings for thisIIOParamobject when theactivateControllermethod is called, overriding any default controller.voidsetDestinationOffset(Point destinationOffset) Specifies the offset in the destination image at which future decoded pixels are to be placed, when reading, or where a region will be written, when writing.voidsetDestinationType(ImageTypeSpecifier destinationType) Sets the desired image type for the destination image, using anImageTypeSpecifier.voidsetSourceBands(int[] sourceBands) Sets the indices of the source bands to be used.voidsetSourceRegion(Rectangle sourceRegion) Sets the source region of interest.voidsetSourceSubsampling(int sourceXSubsampling, int sourceYSubsampling, int subsamplingXOffset, int subsamplingYOffset) Specifies a decimation subsampling to apply on I/O.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.booleanCompares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.inthashCode()Answers an integer hash code for the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.toString()Answers a string containing a concise, human-readable description of the receiver.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
Constructor Details
-
TIFFImageReadParam
public TIFFImageReadParam()Constructs aTIFFImageReadParam. Tags defined by theTIFFTagSetsBaselineTIFFTagSet,FaxTIFFTagSet,ExifParentTIFFTagSet, andGeoTIFFTagSetwill be supported.- See Also:
-
-
Method Details
-
addAllowedTagSet
Adds aTIFFTagSetobject to the list of allowed tag sets. Attempting to add a duplicate object to the list has no effect.- 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.
-
setReadUnknownTags
public void setReadUnknownTags(boolean readUnknownTags) Set whether to read fields corresponding toTIFFTags not in the allowedTIFFTagSets. The default setting isfalse. If the TIFFImageReaderis ignoring metadata, then a setting oftrueis overridden as all metadata are ignored except those essential to reading the image itself.- Parameters:
readUnknownTags- Whether to read fields of unrecognized tags
-
getReadUnknownTags
public boolean getReadUnknownTags()Retrieve the setting of whether to read fields corresponding to unknownTIFFTags.- Returns:
- Whether to read fields of unrecognized tags
-