A convenience class for simplifying interaction with TIFF native
image metadata. A TIFF image metadata tree represents an Image File
Directory (IFD) from a TIFF 6.0 stream. An IFD consists of a number of
IFD Entries each of which associates an identifying tag number with
a compatible value. A TIFFDirectory instance corresponds
to an IFD and contains a set of
TIFFField s each of which
corresponds to an IFD Entry in the IFD.
When reading, a TIFFDirectory may be created by passing
the value returned by
javax.imageio.ImageReader.getImageMetadataImageReader.getImageMetadata() to
TIFFDirectory.createFromMetadatacreateFromMetadata() . The
TIFFField s in the directory may then
be obtained using the accessor methods provided in this class.
When writing, an
IIOMetadata object for use by one of the
write() methods of
javax.imageio.ImageWriter may be
created from a TIFFDirectory by
TIFFDirectory.getAsMetadata() .
The TIFFDirectory itself may be created by construction or
from the IIOMetadata object returned by
javax.imageio.ImageWriter.getDefaultImageMetadataImageWriter.getDefaultImageMetadata() . The TIFFField s in the
directory may be set using the mutator methods provided in this class.
A TIFFDirectory is aware of the tag numbers in the
group of
TIFFTagSet s associated with it. When
a TIFFDirectory is created from a native image metadata
object, these tag sets are derived from the tagSets attribute
of the TIFFIFD node.
A TIFFDirectory might also have a parent
TIFFTag .
This will occur if the directory represents an IFD other than the root
IFD of the image. The parent tag is the tag of the IFD Entry which is a
pointer to the IFD represented by this TIFFDirectory . The
TIFFTag.isIFDPointer method of this parent TIFFTag
must return true . When a TIFFDirectory is
created from a native image metadata object, the parent tag set is set
from the parentTagName attribute of the corresponding
TIFFIFD node. Note that a TIFFDirectory instance
which has a non-null parent tag will be contained in the
data field of a TIFFField instance which has a tag field
equal to the contained directory's parent tag.
As an example consider an EXIF image. The TIFFDirectory
instance corresponding to the EXIF IFD in the EXIF stream would have parent
tag
EXIFParentTIFFTagSet.TAG_EXIF_IFD_POINTER TAG_EXIF_IFD_POINTER and would include
EXIFTIFFTagSet in its group of known tag sets.
The TIFFDirectory corresponding to this EXIF IFD will be
contained in the data field of a TIFFField which will in turn
be contained in the TIFFDirectory corresponding to the primary
IFD of the EXIF image which will itself have a null -valued
parent tag.
Note that this implementation is not synchronized. If multiple
threads use a TIFFDirectory instance concurrently, and at
least one of the threads modifies the directory, for example, by adding
or removing TIFFField s or TIFFTagSet s, it
must be synchronized externally.
See Also: IIOMetadata See Also: TIFFField See Also: TIFFTag See Also: TIFFTagSet since: 1.1-beta |