Class TIFFTag
java.lang.Object
com.github.jaiimageio.plugins.tiff.TIFFTag
- Direct Known Subclasses:
BaselineTIFFTagSet.Artist
,BaselineTIFFTagSet.BitsPerSample
,BaselineTIFFTagSet.CellLength
,BaselineTIFFTagSet.CellWidth
,BaselineTIFFTagSet.ColorMap
,BaselineTIFFTagSet.Compression
,BaselineTIFFTagSet.Copyright
,BaselineTIFFTagSet.DateTime
,BaselineTIFFTagSet.DocumentName
,BaselineTIFFTagSet.DotRange
,BaselineTIFFTagSet.ExtraSamples
,BaselineTIFFTagSet.FillOrder
,BaselineTIFFTagSet.FreeByteCounts
,BaselineTIFFTagSet.FreeOffsets
,BaselineTIFFTagSet.GrayResponseCurve
,BaselineTIFFTagSet.GrayResponseUnit
,BaselineTIFFTagSet.HalftoneHints
,BaselineTIFFTagSet.HostComputer
,BaselineTIFFTagSet.ICCProfile
,BaselineTIFFTagSet.ImageDescription
,BaselineTIFFTagSet.ImageLength
,BaselineTIFFTagSet.ImageWidth
,BaselineTIFFTagSet.InkNames
,BaselineTIFFTagSet.InkSet
,BaselineTIFFTagSet.JPEGACTables
,BaselineTIFFTagSet.JPEGDCTables
,BaselineTIFFTagSet.JPEGInterchangeFormat
,BaselineTIFFTagSet.JPEGInterchangeFormatLength
,BaselineTIFFTagSet.JPEGLosslessPredictors
,BaselineTIFFTagSet.JPEGPointTransforms
,BaselineTIFFTagSet.JPEGProc
,BaselineTIFFTagSet.JPEGQTables
,BaselineTIFFTagSet.JPEGRestartInterval
,BaselineTIFFTagSet.JPEGTables
,BaselineTIFFTagSet.Make
,BaselineTIFFTagSet.MaxSampleValue
,BaselineTIFFTagSet.MinSampleValue
,BaselineTIFFTagSet.Model
,BaselineTIFFTagSet.NewSubfileType
,BaselineTIFFTagSet.NumberOfInks
,BaselineTIFFTagSet.Orientation
,BaselineTIFFTagSet.PageName
,BaselineTIFFTagSet.PageNumber
,BaselineTIFFTagSet.PhotometricInterpretation
,BaselineTIFFTagSet.PlanarConfiguration
,BaselineTIFFTagSet.Predictor
,BaselineTIFFTagSet.PrimaryChromaticities
,BaselineTIFFTagSet.ReferenceBlackWhite
,BaselineTIFFTagSet.ResolutionUnit
,BaselineTIFFTagSet.RowsPerStrip
,BaselineTIFFTagSet.SampleFormat
,BaselineTIFFTagSet.SamplesPerPixel
,BaselineTIFFTagSet.SMaxSampleValue
,BaselineTIFFTagSet.SMinSampleValue
,BaselineTIFFTagSet.Software
,BaselineTIFFTagSet.StripByteCounts
,BaselineTIFFTagSet.StripOffsets
,BaselineTIFFTagSet.SubfileType
,BaselineTIFFTagSet.T4Options
,BaselineTIFFTagSet.T6Options
,BaselineTIFFTagSet.TargetPrinter
,BaselineTIFFTagSet.Threshholding
,BaselineTIFFTagSet.TileByteCounts
,BaselineTIFFTagSet.TileLength
,BaselineTIFFTagSet.TileOffsets
,BaselineTIFFTagSet.TileWidth
,BaselineTIFFTagSet.TransferFunction
,BaselineTIFFTagSet.TransferRange
,BaselineTIFFTagSet.WhitePoint
,BaselineTIFFTagSet.XPosition
,BaselineTIFFTagSet.XResolution
,BaselineTIFFTagSet.YCbCrCoefficients
,BaselineTIFFTagSet.YCbCrPositioning
,BaselineTIFFTagSet.YCbCrSubSampling
,BaselineTIFFTagSet.YPosition
,BaselineTIFFTagSet.YResolution
,EXIFGPSTagSet.GPSAltitude
,EXIFGPSTagSet.GPSAltitudeRef
,EXIFGPSTagSet.GPSAreaInformation
,EXIFGPSTagSet.GPSDateStamp
,EXIFGPSTagSet.GPSDestBearing
,EXIFGPSTagSet.GPSDestBearingRef
,EXIFGPSTagSet.GPSDestDistance
,EXIFGPSTagSet.GPSDestDistanceRef
,EXIFGPSTagSet.GPSDestLatitude
,EXIFGPSTagSet.GPSDestLatitudeRef
,EXIFGPSTagSet.GPSDestLongitude
,EXIFGPSTagSet.GPSDestLongitudeRef
,EXIFGPSTagSet.GPSDifferential
,EXIFGPSTagSet.GPSDOP
,EXIFGPSTagSet.GPSImgDirection
,EXIFGPSTagSet.GPSImgDirectionRef
,EXIFGPSTagSet.GPSLatitude
,EXIFGPSTagSet.GPSLatitudeRef
,EXIFGPSTagSet.GPSLongitude
,EXIFGPSTagSet.GPSLongitudeRef
,EXIFGPSTagSet.GPSMapDatum
,EXIFGPSTagSet.GPSMeasureMode
,EXIFGPSTagSet.GPSProcessingMethod
,EXIFGPSTagSet.GPSSatellites
,EXIFGPSTagSet.GPSSpeed
,EXIFGPSTagSet.GPSSpeedRef
,EXIFGPSTagSet.GPSStatus
,EXIFGPSTagSet.GPSTimeStamp
,EXIFGPSTagSet.GPSTrack
,EXIFGPSTagSet.GPSTrackRef
,EXIFGPSTagSet.GPSVersionID
,EXIFInteroperabilityTagSet.InteroperabilityIndex
,EXIFParentTIFFTagSet.EXIFIFDPointer
,EXIFParentTIFFTagSet.GPSInfoIFDPointer
,EXIFTIFFTagSet.ApertureValue
,EXIFTIFFTagSet.BrightnessValue
,EXIFTIFFTagSet.CFAPattern
,EXIFTIFFTagSet.ColorSpace
,EXIFTIFFTagSet.ComponentsConfiguration
,EXIFTIFFTagSet.CompressedBitsPerPixel
,EXIFTIFFTagSet.Contrast
,EXIFTIFFTagSet.CustomRendered
,EXIFTIFFTagSet.DateTimeDigitized
,EXIFTIFFTagSet.DateTimeOriginal
,EXIFTIFFTagSet.DeviceSettingDescription
,EXIFTIFFTagSet.DigitalZoomRatio
,EXIFTIFFTagSet.EXIFVersion
,EXIFTIFFTagSet.ExposureBiasValue
,EXIFTIFFTagSet.ExposureIndex
,EXIFTIFFTagSet.ExposureMode
,EXIFTIFFTagSet.ExposureProgram
,EXIFTIFFTagSet.ExposureTime
,EXIFTIFFTagSet.FileSource
,EXIFTIFFTagSet.Flash
,EXIFTIFFTagSet.FlashEnergy
,EXIFTIFFTagSet.FlashPixVersion
,EXIFTIFFTagSet.FNumber
,EXIFTIFFTagSet.FocalLength
,EXIFTIFFTagSet.FocalLengthIn35mmFilm
,EXIFTIFFTagSet.FocalPlaneResolutionUnit
,EXIFTIFFTagSet.FocalPlaneXResolution
,EXIFTIFFTagSet.FocalPlaneYResolution
,EXIFTIFFTagSet.GainControl
,EXIFTIFFTagSet.ImageUniqueID
,EXIFTIFFTagSet.InteroperabilityIFD
,EXIFTIFFTagSet.ISOSpeedRatings
,EXIFTIFFTagSet.LightSource
,EXIFTIFFTagSet.MakerNote
,EXIFTIFFTagSet.MaxApertureValue
,EXIFTIFFTagSet.MeteringMode
,EXIFTIFFTagSet.OECF
,EXIFTIFFTagSet.PixelXDimension
,EXIFTIFFTagSet.PixelYDimension
,EXIFTIFFTagSet.RelatedSoundFile
,EXIFTIFFTagSet.Saturation
,EXIFTIFFTagSet.SceneCaptureType
,EXIFTIFFTagSet.SceneType
,EXIFTIFFTagSet.SensingMethod
,EXIFTIFFTagSet.Sharpness
,EXIFTIFFTagSet.ShutterSpeedValue
,EXIFTIFFTagSet.SpatialFrequencyResponse
,EXIFTIFFTagSet.SpectralSensitivity
,EXIFTIFFTagSet.SubjectArea
,EXIFTIFFTagSet.SubjectDistance
,EXIFTIFFTagSet.SubjectDistanceRange
,EXIFTIFFTagSet.SubjectLocation
,EXIFTIFFTagSet.SubSecTime
,EXIFTIFFTagSet.SubSecTimeDigitized
,EXIFTIFFTagSet.SubSecTimeOriginal
,EXIFTIFFTagSet.UserComment
,EXIFTIFFTagSet.WhiteBalance
,FaxTIFFTagSet.BadFaxLines
,FaxTIFFTagSet.CleanFaxData
,FaxTIFFTagSet.ConsecutiveBadFaxLines
,GeoTIFFTagSet.GeoAsciiParams
,GeoTIFFTagSet.GeoDoubleParams
,GeoTIFFTagSet.GeoKeyDirectory
,GeoTIFFTagSet.ModelPixelScale
,GeoTIFFTagSet.ModelTiePoint
,GeoTIFFTagSet.ModelTransformation
A class defining the notion of a TIFF tag. A TIFF tag is a key
that may appear in an Image File Directory (IFD). In the IFD
each tag has some data associated with it, which may consist of zero
or more values of a given data type. The combination of a tag and a
value is known as an IFD Entry or TIFF Field.
The actual tag values used in the root IFD of a standard ("baseline")
tiff stream are defined in the
class.BaselineTIFFTagSet
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) int
static final int
The numerically largest constant representing a TIFF data type.static final int
The numerically smallest constant representing a TIFF data type.(package private) String
(package private) int
private static final int[]
(package private) TIFFTagSet
static final int
Flag for null-terminated ASCII strings.static final int
Flag for 8 bit unsigned integers.static final int
Flag for 64 bit IEEE doubles.static final int
Flag for 32 bit IEEE floats.static final int
Flag for IFD pointer defined in TIFF Tech Note 1 in TIFF Specification Supplement 1.static final int
Flag for 32 bit unsigned integers.static final int
Flag for pairs of 32 bit unsigned integers.static final int
Flag for 8 bit signed integers.static final int
Flag for 16 bit unsigned integers.static final int
Flag for 32 bit signed integers.static final int
Flag for pairs of 32 bit signed integers.static final int
Flag for 16 bit signed integers.static final int
Flag for 8 bit uninterpreted bytes.(package private) Map
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs aTIFFTag
with a given name, tag number, and set of legal data types.TIFFTag
(String name, int number, int dataTypes, TIFFTagSet tagSet) Constructs aTIFFTag
with a given name, tag number, set of legal data types, andTIFFTagSet
to which it refers. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addValueName
(int value, String name) Adds a mnemonic name for a particular value that this tag's data may take on.int
Returns a bit mask indicating the set of data types that may be used to store the data associated with the tag.getName()
Returns the name of the tag, as it will appear in image metadata.int
Returns the integer used to represent the tag.static int
getSizeOfType
(int dataType) Returns the number of bytes used to store a value of the given data type.Returns theTIFFTagSet
of which this tag is a part.getValueName
(int value) Returns the mnemonic name associated with a particular value that this tag's data may take on, ornull
if no name is present.boolean
Returnstrue
if there are mnemonic names associated with the set of legal values for the data associated with this tag.boolean
isDataTypeOK
(int dataType) Returnstrue
if the given data type may be used for the data associated with this tag.boolean
Returnstrue
if this tag is used to point to an IFD structure containing additional tags.
-
Field Details
-
TIFF_BYTE
public static final int TIFF_BYTEFlag for 8 bit unsigned integers.- See Also:
-
TIFF_ASCII
public static final int TIFF_ASCIIFlag for null-terminated ASCII strings.- See Also:
-
TIFF_SHORT
public static final int TIFF_SHORTFlag for 16 bit unsigned integers.- See Also:
-
TIFF_LONG
public static final int TIFF_LONGFlag for 32 bit unsigned integers.- See Also:
-
TIFF_RATIONAL
public static final int TIFF_RATIONALFlag for pairs of 32 bit unsigned integers.- See Also:
-
TIFF_SBYTE
public static final int TIFF_SBYTEFlag for 8 bit signed integers.- See Also:
-
TIFF_UNDEFINED
public static final int TIFF_UNDEFINEDFlag for 8 bit uninterpreted bytes.- See Also:
-
TIFF_SSHORT
public static final int TIFF_SSHORTFlag for 16 bit signed integers.- See Also:
-
TIFF_SLONG
public static final int TIFF_SLONGFlag for 32 bit signed integers.- See Also:
-
TIFF_SRATIONAL
public static final int TIFF_SRATIONALFlag for pairs of 32 bit signed integers.- See Also:
-
TIFF_FLOAT
public static final int TIFF_FLOATFlag for 32 bit IEEE floats.- See Also:
-
TIFF_DOUBLE
public static final int TIFF_DOUBLEFlag for 64 bit IEEE doubles.- See Also:
-
TIFF_IFD_POINTER
public static final int TIFF_IFD_POINTERFlag for IFD pointer defined in TIFF Tech Note 1 in TIFF Specification Supplement 1.- See Also:
-
MIN_DATATYPE
public static final int MIN_DATATYPEThe numerically smallest constant representing a TIFF data type.- See Also:
-
MAX_DATATYPE
public static final int MAX_DATATYPEThe numerically largest constant representing a TIFF data type.- See Also:
-
sizeOfType
private static final int[] sizeOfType -
number
int number -
name
String name -
dataTypes
int dataTypes -
tagSet
TIFFTagSet tagSet -
valueNames
Map valueNames
-
-
Constructor Details
-
TIFFTag
Constructs aTIFFTag
with a given name, tag number, set of legal data types, andTIFFTagSet
to which it refers. ThetagSet
parameter will generally be non-null
only if thisTIFFTag
corresponds to a pointer to a TIFF IFD. In this casetagSet
will represent the set ofTIFFTag
s which appear in the IFD pointed to. ATIFFTag
represents an IFD pointer if and only iftagSet
is non-null
or the data typeTIFF_IFD_POINTER
is legal.If there are mnemonic names to be associated with the legal data values for the tag,
should be called on the new instance for each name.addValueName()
See the documentation for
for an explanation of how the set of data types is to be converted into a bit mask.getDataTypes()
- Parameters:
name
- the name of the tag; may benull
.number
- the number used to represent the tag.dataTypes
- a bit mask indicating the set of legal data types for this tag.tagSet
- theTIFFTagSet
to which this tag belongs; may benull
.
-
TIFFTag
Constructs aTIFFTag
with a given name, tag number, and set of legal data types. The tag will have no associatedTIFFTagSet
.- Parameters:
name
- the name of the tag; may benull
.number
- the number used to represent the tag.dataTypes
- a bit mask indicating the set of legal data types for this tag.- See Also:
-
-
Method Details
-
getSizeOfType
public static int getSizeOfType(int dataType) Returns the number of bytes used to store a value of the given data type.- Parameters:
dataType
- the data type to be queried.- Returns:
- the number of bytes used to store the given data type.
- Throws:
IllegalArgumentException
- ifdatatype
is less thanMIN_DATATYPE
or greater thanMAX_DATATYPE
.
-
getName
Returns the name of the tag, as it will appear in image metadata.- Returns:
- the tag name, as a
String
.
-
getNumber
public int getNumber()Returns the integer used to represent the tag.- Returns:
- the tag number, as an
int
.
-
getDataTypes
public int getDataTypes()Returns a bit mask indicating the set of data types that may be used to store the data associated with the tag. For example, a tag that can store both SHORT and LONG values would return a value of:(1 invalid input: '<'invalid input: '<' TIFFTag.TIFF_SHORT) | (1 invalid input: '<'invalid input: '<' TIFFTag.TIFF_LONG)
- Returns:
- an
int
containing a bitmask encoding the set of valid data types.
-
isDataTypeOK
public boolean isDataTypeOK(int dataType) Returnstrue
if the given data type may be used for the data associated with this tag.- Parameters:
dataType
- the data type to be queried, one ofTIFF_BYTE
,TIFF_SHORT
, etc.- Returns:
- a
boolean
indicating whether the given data type may be used with this tag. - Throws:
IllegalArgumentException
- ifdatatype
is less thanMIN_DATATYPE
or greater thanMAX_DATATYPE
.
-
getTagSet
Returns theTIFFTagSet
of which this tag is a part.- Returns:
- the containing
TIFFTagSet
.
-
isIFDPointer
public boolean isIFDPointer()Returnstrue
if this tag is used to point to an IFD structure containing additional tags. This condition will be satisfied if and only if eithergetTagSet() != null
orisDataTypeOK(TIFF_IFD_POINTER) == true
.Many TIFF extensions use this mechanism in order to limit the number of new tags that may appear in the root IFD.
- Returns:
true
if this tag points to an IFD.
-
hasValueNames
public boolean hasValueNames()Returnstrue
if there are mnemonic names associated with the set of legal values for the data associated with this tag.- Returns:
true
if mnemonic value names are available.
-
addValueName
Adds a mnemonic name for a particular value that this tag's data may take on.- Parameters:
value
- the data value.name
- the name to associate with the value.
-
getValueName
Returns the mnemonic name associated with a particular value that this tag's data may take on, ornull
if no name is present.- Parameters:
value
- the data value.- Returns:
- the mnemonic name associated with the value, as a
String
.
-