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
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.
Forcing reading of fields corresponding to TIFFTag
s
not in any of the allowed TIFFTagSet
s may be effected via
setReadUnknownTags
.
- Since:
- 9
-
Field Summary
Fields declared in class ImageReadParam
canSetSourceRenderSize, destination, destinationBands, minProgressivePass, numProgressivePasses, sourceRenderSize
Modifier and TypeFieldDescriptionprotected boolean
true
if thisImageReadParam
allows the source rendering dimensions to be set.protected BufferedImage
The current destinationBufferedImage
, ornull
if none has been set.protected int[]
The set of destination bands to be used, as an array ofint
s.protected int
The minimum index of a progressive pass to read from the source.protected int
The maximum number of progressive passes to read from the source.protected Dimension
The desired rendering width and height of the source, ifcanSetSourceRenderSize
istrue
, ornull
.Fields declared in class IIOParam
controller, defaultController, destinationOffset, destinationType, sourceBands, sourceRegion, sourceXSubsampling, sourceYSubsampling, subsamplingXOffset, subsamplingYOffset
Modifier and TypeFieldDescriptionprotected IIOParamController
TheIIOParamController
that will be used to provide settings for thisIIOParam
object when theactivateController
method is called.protected IIOParamController
The defaultIIOParamController
that will be used to provide settings for thisIIOParam
object when theactivateController
method is called.protected Point
The offset in the destination where the upper-left decoded pixel should be placed.protected ImageTypeSpecifier
AnImageTypeSpecifier
to be used to generate a destination image when reading, or to set the output color type when writing.protected int[]
An array ofint
s indicating which source bands will be used, ornull
.protected Rectangle
The source region, onnull
if none is set.protected int
The decimation subsampling to be applied in the horizontal direction.protected int
The decimation subsampling to be applied in the vertical direction.protected int
A horizontal offset to be applied to the subsampling grid before subsampling.protected int
A vertical offset to be applied to the subsampling grid before subsampling. -
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.boolean
Retrieve the setting of whether to read fields corresponding to unknownTIFFTag
s.void
removeAllowedTagSet
(TIFFTagSet tagSet) Removes aTIFFTagSet
object from the list of allowed tag sets.void
setReadUnknownTags
(boolean readUnknownTags) Set whether to read fields corresponding toTIFFTag
s not in the allowedTIFFTagSet
s.Methods declared in class ImageReadParam
canSetSourceRenderSize, getDestination, getDestinationBands, getSourceMaxProgressivePass, getSourceMinProgressivePass, getSourceNumProgressivePasses, getSourceRenderSize, setDestination, setDestinationBands, setSourceProgressivePasses, setSourceRenderSize
Modifier and TypeMethodDescriptionboolean
Returnstrue
if this reader allows the source image to be rendered at an arbitrary size as part of the decoding process, by means of thesetSourceRenderSize
method.Returns theBufferedImage
currently set by thesetDestination
method, ornull
if none is set.int[]
Returns the set of band indices where data will be placed.int
IfgetSourceNumProgressivePasses
is equal toInteger.MAX_VALUE
, returnsInteger.MAX_VALUE
.int
Returns the index of the first progressive pass that will be decoded.int
Returns 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 thesetSourceRenderSize
method.void
setDestination
(BufferedImage destination) Supplies aBufferedImage
to be used as the destination for decoded pixel data.void
setDestinationBands
(int[] destinationBands) Sets the indices of the destination bands where data will be placed.void
setSourceProgressivePasses
(int minPass, int numPasses) Sets the range of progressive passes that will be decoded.void
setSourceRenderSize
(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, setSourceSubsampling
Modifier and TypeMethodDescriptionboolean
Activates the installedIIOParamController
for thisIIOParam
object and returns the resulting value.Returns whateverIIOParamController
is 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.int
Returns the number of source columns to advance for each pixel.int
Returns the number of rows to advance for each pixel.int
Returns the horizontal offset of the subsampling grid.int
Returns the vertical offset of the subsampling grid.boolean
Returnstrue
if there is a controller installed for thisIIOParam
object.void
setController
(IIOParamController controller) Sets theIIOParamController
to be used to provide settings for thisIIOParam
object when theactivateController
method is called, overriding any default controller.void
setDestinationOffset
(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.void
setDestinationType
(ImageTypeSpecifier destinationType) Sets the desired image type for the destination image, using anImageTypeSpecifier
.void
setSourceBands
(int[] sourceBands) Sets the indices of the source bands to be used.void
setSourceRegion
(Rectangle sourceRegion) Sets the source region of interest.void
setSourceSubsampling
(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, wait
Modifier and TypeMethodDescriptionprotected Object
clone()
Creates and returns a copy of this object.boolean
Indicates whether some other object is "equal to" this one.protected void
finalize()
Deprecated, for removal: This API element is subject to removal in a future version.Finalization is deprecated and subject to removal in a future release.final Class
<?> getClass()
Returns the runtime class of thisObject
.int
hashCode()
Returns a hash code value for this object.final void
notify()
Wakes up a single thread that is waiting on this object's monitor.final void
Wakes up all threads that are waiting on this object's monitor.toString()
Returns a string representation of the object.final void
wait()
Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final void
wait
(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.final void
wait
(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
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. Attempting to add a duplicate object to the list has no effect.- 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.
-
setReadUnknownTags
public void setReadUnknownTags(boolean readUnknownTags) Set whether to read fields corresponding toTIFFTag
s not in the allowedTIFFTagSet
s. The default setting isfalse
. If the TIFFImageReader
is ignoring metadata, then a setting oftrue
is 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 unknownTIFFTag
s.- Returns:
- Whether to read fields of unrecognized tags
-