APIdia Launch Partner
Top Description Fields Constructors Methods
javax.imageio.plugins.tiff

public Class TIFFTag

extends Object
Class Inheritance
Known Direct Subclasses
javax.imageio.plugins.tiff.BaselineTIFFTagSet.Artist, javax.imageio.plugins.tiff.BaselineTIFFTagSet.BitsPerSample, javax.imageio.plugins.tiff.BaselineTIFFTagSet.CellLength, javax.imageio.plugins.tiff.BaselineTIFFTagSet.CellWidth, javax.imageio.plugins.tiff.BaselineTIFFTagSet.ColorMap, javax.imageio.plugins.tiff.BaselineTIFFTagSet.Compression, javax.imageio.plugins.tiff.BaselineTIFFTagSet.Copyright, javax.imageio.plugins.tiff.BaselineTIFFTagSet.DateTime, javax.imageio.plugins.tiff.BaselineTIFFTagSet.DocumentName, javax.imageio.plugins.tiff.BaselineTIFFTagSet.DotRange, javax.imageio.plugins.tiff.BaselineTIFFTagSet.ExtraSamples, javax.imageio.plugins.tiff.BaselineTIFFTagSet.FillOrder, javax.imageio.plugins.tiff.BaselineTIFFTagSet.FreeByteCounts, javax.imageio.plugins.tiff.BaselineTIFFTagSet.FreeOffsets, javax.imageio.plugins.tiff.BaselineTIFFTagSet.GrayResponseCurve, javax.imageio.plugins.tiff.BaselineTIFFTagSet.GrayResponseUnit, javax.imageio.plugins.tiff.BaselineTIFFTagSet.HalftoneHints, javax.imageio.plugins.tiff.BaselineTIFFTagSet.HostComputer, javax.imageio.plugins.tiff.BaselineTIFFTagSet.ImageDescription, javax.imageio.plugins.tiff.BaselineTIFFTagSet.ImageLength, javax.imageio.plugins.tiff.BaselineTIFFTagSet.ImageWidth, javax.imageio.plugins.tiff.BaselineTIFFTagSet.InkNames, javax.imageio.plugins.tiff.BaselineTIFFTagSet.InkSet, javax.imageio.plugins.tiff.BaselineTIFFTagSet.JPEGTables, javax.imageio.plugins.tiff.BaselineTIFFTagSet.JPEGACTables, javax.imageio.plugins.tiff.BaselineTIFFTagSet.JPEGDCTables, javax.imageio.plugins.tiff.BaselineTIFFTagSet.JPEGInterchangeFormat, javax.imageio.plugins.tiff.BaselineTIFFTagSet.JPEGInterchangeFormatLength, javax.imageio.plugins.tiff.BaselineTIFFTagSet.JPEGLosslessPredictors, javax.imageio.plugins.tiff.BaselineTIFFTagSet.JPEGPointTransforms, javax.imageio.plugins.tiff.BaselineTIFFTagSet.JPEGProc, javax.imageio.plugins.tiff.BaselineTIFFTagSet.JPEGQTables, javax.imageio.plugins.tiff.BaselineTIFFTagSet.JPEGRestartInterval, javax.imageio.plugins.tiff.BaselineTIFFTagSet.Make, javax.imageio.plugins.tiff.BaselineTIFFTagSet.MaxSampleValue, javax.imageio.plugins.tiff.BaselineTIFFTagSet.MinSampleValue, javax.imageio.plugins.tiff.BaselineTIFFTagSet.Model, javax.imageio.plugins.tiff.BaselineTIFFTagSet.NewSubfileType, javax.imageio.plugins.tiff.BaselineTIFFTagSet.NumberOfInks, javax.imageio.plugins.tiff.BaselineTIFFTagSet.Orientation, javax.imageio.plugins.tiff.BaselineTIFFTagSet.PageName, javax.imageio.plugins.tiff.BaselineTIFFTagSet.PageNumber, javax.imageio.plugins.tiff.BaselineTIFFTagSet.PhotometricInterpretation, javax.imageio.plugins.tiff.BaselineTIFFTagSet.PlanarConfiguration, javax.imageio.plugins.tiff.BaselineTIFFTagSet.Predictor, javax.imageio.plugins.tiff.BaselineTIFFTagSet.PrimaryChromaticities, javax.imageio.plugins.tiff.BaselineTIFFTagSet.ReferenceBlackWhite, javax.imageio.plugins.tiff.BaselineTIFFTagSet.ResolutionUnit, javax.imageio.plugins.tiff.BaselineTIFFTagSet.RowsPerStrip, javax.imageio.plugins.tiff.BaselineTIFFTagSet.SampleFormat, javax.imageio.plugins.tiff.BaselineTIFFTagSet.SamplesPerPixel, javax.imageio.plugins.tiff.BaselineTIFFTagSet.SMaxSampleValue, javax.imageio.plugins.tiff.BaselineTIFFTagSet.SMinSampleValue, javax.imageio.plugins.tiff.BaselineTIFFTagSet.Software, javax.imageio.plugins.tiff.BaselineTIFFTagSet.StripByteCounts, javax.imageio.plugins.tiff.BaselineTIFFTagSet.StripOffsets, javax.imageio.plugins.tiff.BaselineTIFFTagSet.SubfileType, javax.imageio.plugins.tiff.BaselineTIFFTagSet.T4Options, javax.imageio.plugins.tiff.BaselineTIFFTagSet.T6Options, javax.imageio.plugins.tiff.BaselineTIFFTagSet.TargetPrinter, javax.imageio.plugins.tiff.BaselineTIFFTagSet.Threshholding, javax.imageio.plugins.tiff.BaselineTIFFTagSet.TileByteCounts, javax.imageio.plugins.tiff.BaselineTIFFTagSet.TileOffsets, javax.imageio.plugins.tiff.BaselineTIFFTagSet.TileLength, javax.imageio.plugins.tiff.BaselineTIFFTagSet.TileWidth, javax.imageio.plugins.tiff.BaselineTIFFTagSet.TransferFunction, javax.imageio.plugins.tiff.BaselineTIFFTagSet.TransferRange, javax.imageio.plugins.tiff.BaselineTIFFTagSet.WhitePoint, javax.imageio.plugins.tiff.BaselineTIFFTagSet.XPosition, javax.imageio.plugins.tiff.BaselineTIFFTagSet.XResolution, javax.imageio.plugins.tiff.BaselineTIFFTagSet.YCbCrCoefficients, javax.imageio.plugins.tiff.BaselineTIFFTagSet.YCbCrPositioning, javax.imageio.plugins.tiff.BaselineTIFFTagSet.YCbCrSubSampling, javax.imageio.plugins.tiff.BaselineTIFFTagSet.YPosition, javax.imageio.plugins.tiff.BaselineTIFFTagSet.YResolution, javax.imageio.plugins.tiff.BaselineTIFFTagSet.ICCProfile, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSVersionID, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSLatitudeRef, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSLatitude, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSLongitudeRef, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSLongitude, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSAltitudeRef, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSAltitude, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSTimeStamp, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSSatellites, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSStatus, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSMeasureMode, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSDOP, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSSpeedRef, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSSpeed, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSTrackRef, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSTrack, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSImgDirectionRef, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSImgDirection, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSMapDatum, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSDestLatitudeRef, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSDestLatitude, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSDestLongitudeRef, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSDestLongitude, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSDestBearingRef, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSDestBearing, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSDestDistanceRef, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSDestDistance, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSProcessingMethod, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSAreaInformation, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSDateStamp, javax.imageio.plugins.tiff.ExifGPSTagSet.GPSDifferential, javax.imageio.plugins.tiff.ExifInteroperabilityTagSet.InteroperabilityIndex, javax.imageio.plugins.tiff.ExifParentTIFFTagSet.ExifIFDPointer, javax.imageio.plugins.tiff.ExifParentTIFFTagSet.GPSInfoIFDPointer, javax.imageio.plugins.tiff.ExifTIFFTagSet.ExifVersion, javax.imageio.plugins.tiff.ExifTIFFTagSet.FlashPixVersion, javax.imageio.plugins.tiff.ExifTIFFTagSet.ColorSpace, javax.imageio.plugins.tiff.ExifTIFFTagSet.ComponentsConfiguration, javax.imageio.plugins.tiff.ExifTIFFTagSet.CompressedBitsPerPixel, javax.imageio.plugins.tiff.ExifTIFFTagSet.PixelXDimension, javax.imageio.plugins.tiff.ExifTIFFTagSet.PixelYDimension, javax.imageio.plugins.tiff.ExifTIFFTagSet.MakerNote, javax.imageio.plugins.tiff.ExifTIFFTagSet.UserComment, javax.imageio.plugins.tiff.ExifTIFFTagSet.RelatedSoundFile, javax.imageio.plugins.tiff.ExifTIFFTagSet.DateTimeOriginal, javax.imageio.plugins.tiff.ExifTIFFTagSet.DateTimeDigitized, javax.imageio.plugins.tiff.ExifTIFFTagSet.SubSecTime, javax.imageio.plugins.tiff.ExifTIFFTagSet.SubSecTimeOriginal, javax.imageio.plugins.tiff.ExifTIFFTagSet.SubSecTimeDigitized, javax.imageio.plugins.tiff.ExifTIFFTagSet.ExposureTime, javax.imageio.plugins.tiff.ExifTIFFTagSet.FNumber, javax.imageio.plugins.tiff.ExifTIFFTagSet.ExposureProgram, javax.imageio.plugins.tiff.ExifTIFFTagSet.SpectralSensitivity, javax.imageio.plugins.tiff.ExifTIFFTagSet.ISOSpeedRatings, javax.imageio.plugins.tiff.ExifTIFFTagSet.OECF, javax.imageio.plugins.tiff.ExifTIFFTagSet.ShutterSpeedValue, javax.imageio.plugins.tiff.ExifTIFFTagSet.ApertureValue, javax.imageio.plugins.tiff.ExifTIFFTagSet.BrightnessValue, javax.imageio.plugins.tiff.ExifTIFFTagSet.ExposureBiasValue, javax.imageio.plugins.tiff.ExifTIFFTagSet.MaxApertureValue, javax.imageio.plugins.tiff.ExifTIFFTagSet.SubjectDistance, javax.imageio.plugins.tiff.ExifTIFFTagSet.MeteringMode, javax.imageio.plugins.tiff.ExifTIFFTagSet.LightSource, javax.imageio.plugins.tiff.ExifTIFFTagSet.Flash, javax.imageio.plugins.tiff.ExifTIFFTagSet.FocalLength, javax.imageio.plugins.tiff.ExifTIFFTagSet.SubjectArea, javax.imageio.plugins.tiff.ExifTIFFTagSet.FlashEnergy, javax.imageio.plugins.tiff.ExifTIFFTagSet.SpatialFrequencyResponse, javax.imageio.plugins.tiff.ExifTIFFTagSet.FocalPlaneXResolution, javax.imageio.plugins.tiff.ExifTIFFTagSet.FocalPlaneYResolution, javax.imageio.plugins.tiff.ExifTIFFTagSet.FocalPlaneResolutionUnit, javax.imageio.plugins.tiff.ExifTIFFTagSet.SubjectLocation, javax.imageio.plugins.tiff.ExifTIFFTagSet.ExposureIndex, javax.imageio.plugins.tiff.ExifTIFFTagSet.SensingMethod, javax.imageio.plugins.tiff.ExifTIFFTagSet.FileSource, javax.imageio.plugins.tiff.ExifTIFFTagSet.SceneType, javax.imageio.plugins.tiff.ExifTIFFTagSet.CFAPattern, javax.imageio.plugins.tiff.ExifTIFFTagSet.CustomRendered, javax.imageio.plugins.tiff.ExifTIFFTagSet.ExposureMode, javax.imageio.plugins.tiff.ExifTIFFTagSet.WhiteBalance, javax.imageio.plugins.tiff.ExifTIFFTagSet.DigitalZoomRatio, javax.imageio.plugins.tiff.ExifTIFFTagSet.FocalLengthIn35mmFilm, javax.imageio.plugins.tiff.ExifTIFFTagSet.SceneCaptureType, javax.imageio.plugins.tiff.ExifTIFFTagSet.GainControl, javax.imageio.plugins.tiff.ExifTIFFTagSet.Contrast, javax.imageio.plugins.tiff.ExifTIFFTagSet.Saturation, javax.imageio.plugins.tiff.ExifTIFFTagSet.Sharpness, javax.imageio.plugins.tiff.ExifTIFFTagSet.DeviceSettingDescription, javax.imageio.plugins.tiff.ExifTIFFTagSet.SubjectDistanceRange, javax.imageio.plugins.tiff.ExifTIFFTagSet.ImageUniqueID, javax.imageio.plugins.tiff.ExifTIFFTagSet.InteroperabilityIFD, javax.imageio.plugins.tiff.FaxTIFFTagSet.BadFaxLines, javax.imageio.plugins.tiff.FaxTIFFTagSet.CleanFaxData, javax.imageio.plugins.tiff.FaxTIFFTagSet.ConsecutiveBadFaxLines, javax.imageio.plugins.tiff.GeoTIFFTagSet.ModelPixelScale, javax.imageio.plugins.tiff.GeoTIFFTagSet.ModelTransformation, javax.imageio.plugins.tiff.GeoTIFFTagSet.ModelTiepoint, javax.imageio.plugins.tiff.GeoTIFFTagSet.GeoKeyDirectory, javax.imageio.plugins.tiff.GeoTIFFTagSet.GeoDoubleParams, javax.imageio.plugins.tiff.GeoTIFFTagSet.GeoAsciiParams
Imports
java.util.Set, .SortedMap, .TreeMap

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 BaselineTIFFTagSet class.

Since
9
See Also
BaselineTIFFTagSet, TIFFField, TIFFTagSet

Field Summary

Modifier and TypeField and Description
private int
private int
private static final int
DISALLOWED_DATATYPES_MASK

Disallowed data type mask.

public static final int
MAX_DATATYPE

The numerically largest constant representing a TIFF data type.

public static final int
MIN_DATATYPE

The numerically smallest constant representing a TIFF data type.

private String
private int
private static final int[]
private TIFFTagSet
public static final int
TIFF_ASCII

Flag for null-terminated ASCII strings.

public static final int
TIFF_BYTE

Flag for 8 bit unsigned integers.

public static final int
TIFF_DOUBLE

Flag for 64 bit IEEE doubles.

public static final int
TIFF_FLOAT

Flag for 32 bit IEEE floats.

public static final int
TIFF_IFD_POINTER

Flag for IFD pointer defined in TIFF Tech Note 1 in TIFF Specification Supplement 1.

public static final int
TIFF_LONG

Flag for 32 bit unsigned integers.

public static final int
TIFF_RATIONAL

Flag for pairs of 32 bit unsigned integers.

public static final int
TIFF_SBYTE

Flag for 8 bit signed integers.

public static final int
TIFF_SHORT

Flag for 16 bit unsigned integers.

public static final int
TIFF_SLONG

Flag for 32 bit signed integers.

public static final int
TIFF_SRATIONAL

Flag for pairs of 32 bit signed integers.

public static final int
TIFF_SSHORT

Flag for 16 bit signed integers.

public static final int
TIFF_UNDEFINED

Flag for 8 bit uninterpreted bytes.

public static final String
UNKNOWN_TAG_NAME

The name assigned to a tag with an unknown tag number.

private SortedMap<Integer, String>

Constructor Summary

AccessConstructor and Description
public
TIFFTag(String
the name of the tag.
name
,
int
the number used to represent the tag.
number
,
int
a bit mask indicating the set of legal data types for this tag.
dataTypes
,
int
the value count for this tag.
count
)

Constructs a TIFFTag with a given name, tag number, set of legal data types, and value count.

public
TIFFTag(String
the name of the tag.
name
,
int
the number used to represent the tag.
number
,
TIFFTagSet
the TIFFTagSet to which this tag belongs.
tagSet
)

Constructs a TIFFTag with a given name, tag number and TIFFTagSet to which it refers.

public
TIFFTag(String
the name of the tag.
name
,
int
the number used to represent the tag.
number
,
int
a bit mask indicating the set of legal data types for this tag.
dataTypes
)

Constructs a TIFFTag with a given name, tag number, and set of legal data types.

Method Summary

Modifier and TypeMethod and Description
protected void
addValueName(int
the data value.
value
,
String
the name to associate with the value.
name
)

Adds a mnemonic name for a particular value that this tag's data may take on.

public int

Returns:

the value count of this tag.
getCount
()

Returns the value count of this tag.

public int

Returns:

an int containing a bitmask encoding the set of valid data types.
getDataTypes
()

Returns a bit mask indicating the set of data types that may be used to store the data associated with the tag.

public String

Returns:

the tag name, as a String.
getName
()

Returns the name of the tag, as it will appear in image metadata.

public int[]

Returns:

the values for which there is a mnemonic name.
getNamedValues
()

Returns an array of values for which mnemonic names are defined.

public int

Returns:

the tag number, as an int.
getNumber
()

Returns the integer used to represent the tag.

public static int

Returns:

the number of bytes used to store the given data type.
getSizeOfType
(int
the data type to be queried.
dataType
)

Returns the number of bytes used to store a value of the given data type.

public TIFFTagSet

Returns:

the containing TIFFTagSet.
getTagSet
()

Returns the TIFFTagSet of which this tag is a part.

public String

Returns:

the mnemonic name associated with the value, as a String.
getValueName
(int
the data value.
value
)

Returns the mnemonic name associated with a particular value that this tag's data may take on, or null if no name is present.

public boolean

Returns:

true if mnemonic value names are available.
hasValueNames
()

Returns true if there are mnemonic names associated with the set of legal values for the data associated with this tag.

public boolean

Returns:

a boolean indicating whether the given data type may be used with this tag.
isDataTypeOK
(int
the data type to be queried, one of TIFF_BYTE, TIFF_SHORT, etc.
dataType
)

Returns true if the given data type may be used for the data associated with this tag.

public boolean

Returns:

true if this tag points to an IFD.
isIFDPointer
()

Returns true if this tag is used to point to an IFD structure containing additional tags.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

countback to summary
private int count
dataTypesback to summary
private int dataTypes
DISALLOWED_DATATYPES_MASKback to summary
private static final int DISALLOWED_DATATYPES_MASK

Disallowed data type mask.

MAX_DATATYPEback to summary
public static final int MAX_DATATYPE

The numerically largest constant representing a TIFF data type.

MIN_DATATYPEback to summary
public static final int MIN_DATATYPE

The numerically smallest constant representing a TIFF data type.

nameback to summary
private String name
numberback to summary
private int number
SIZE_OF_TYPEback to summary
private static final int[] SIZE_OF_TYPE
tagSetback to summary
private TIFFTagSet tagSet
TIFF_ASCIIback to summary
public static final int TIFF_ASCII

Flag for null-terminated ASCII strings.

TIFF_BYTEback to summary
public static final int TIFF_BYTE

Flag for 8 bit unsigned integers.

TIFF_DOUBLEback to summary
public static final int TIFF_DOUBLE

Flag for 64 bit IEEE doubles.

TIFF_FLOATback to summary
public static final int TIFF_FLOAT

Flag for 32 bit IEEE floats.

TIFF_IFD_POINTERback to summary
public static final int TIFF_IFD_POINTER

Flag for IFD pointer defined in TIFF Tech Note 1 in TIFF Specification Supplement 1.

TIFF_LONGback to summary
public static final int TIFF_LONG

Flag for 32 bit unsigned integers.

TIFF_RATIONALback to summary
public static final int TIFF_RATIONAL

Flag for pairs of 32 bit unsigned integers.

TIFF_SBYTEback to summary
public static final int TIFF_SBYTE

Flag for 8 bit signed integers.

TIFF_SHORTback to summary
public static final int TIFF_SHORT

Flag for 16 bit unsigned integers.

TIFF_SLONGback to summary
public static final int TIFF_SLONG

Flag for 32 bit signed integers.

TIFF_SRATIONALback to summary
public static final int TIFF_SRATIONAL

Flag for pairs of 32 bit signed integers.

TIFF_SSHORTback to summary
public static final int TIFF_SSHORT

Flag for 16 bit signed integers.

TIFF_UNDEFINEDback to summary
public static final int TIFF_UNDEFINED

Flag for 8 bit uninterpreted bytes.

UNKNOWN_TAG_NAMEback to summary
public static final String UNKNOWN_TAG_NAME

The name assigned to a tag with an unknown tag number. Such a tag may be created for example when reading an IFD and a tag number is encountered which is not in any of the TIFFTagSets known to the reader.

valueNamesback to summary
private SortedMap<Integer, String> valueNames

Constructor Detail

TIFFTagback to summary
public TIFFTag(String name, int number, int dataTypes, int count)

Constructs a TIFFTag with a given name, tag number, set of legal data types, and value count. A negative value count signifies that either an arbitrary number of values is legal or the required count is determined by the values of other fields in the IFD. A non-negative count specifies the number of values which an associated field must contain. The tag will have no associated TIFFTagSet.

If there are mnemonic names to be associated with the legal data values for the tag, addValueName() should be called on the new instance for each name. Mnemonic names apply only to tags which have integral data type.

See the documentation for getDataTypes() for an explanation of how the set of data types is to be converted into a bit mask.

Parameters
name:String

the name of the tag.

number:int

the number used to represent the tag.

dataTypes:int

a bit mask indicating the set of legal data types for this tag.

count:int

the value count for this tag.

Exceptions
NullPointerException:
if name is null.
IllegalArgumentException:
if number is negative or dataTypes is negative or specifies an out of range type.
TIFFTagback to summary
public TIFFTag(String name, int number, TIFFTagSet tagSet)

Constructs a TIFFTag with a given name, tag number and TIFFTagSet to which it refers. The legal data types are set to include TIFF_LONG and TIFF_IFD_POINTER and the value count is unity. The TIFFTagSet will represent the set of TIFFTags which appear in the IFD pointed to. A TIFFTag represents an IFD pointer if and only if tagSet is non-null or the data type TIFF_IFD_POINTER is legal.

Parameters
name:String

the name of the tag.

number:int

the number used to represent the tag.

tagSet:TIFFTagSet

the TIFFTagSet to which this tag belongs.

Exceptions
NullPointerException:
if name or tagSet is null.
IllegalArgumentException:
if number is negative.
See Also
TIFFTag(String, int, int, int)
TIFFTagback to summary
public TIFFTag(String name, int number, int dataTypes)

Constructs a TIFFTag with a given name, tag number, and set of legal data types. The value count of the tag will be undefined and it will have no associated TIFFTagSet.

Parameters
name:String

the name of the tag.

number:int

the number used to represent the tag.

dataTypes:int

a bit mask indicating the set of legal data types for this tag.

Exceptions
NullPointerException:
if name is null.
IllegalArgumentException:
if number is negative or dataTypes is negative or specifies an out of range type.
See Also
TIFFTag(String, int, int, int)

Method Detail

addValueNameback to summary
protected void addValueName(int value, String name)

Adds a mnemonic name for a particular value that this tag's data may take on. Mnemonic names apply only to tags which have integral data type.

Parameters
value:int

the data value.

name:String

the name to associate with the value.

getCountback to summary
public int getCount()

Returns the value count of this tag. If this value is positive, it represents the required number of values for a TIFFField which has this tag. If the value is negative, the count is undefined. In the latter case the count may be derived, e.g., the number of values of the BitsPerSample field is SamplesPerPixel, or it may be variable as in the case of most US-ASCII fields.

Returns:int

the value count of this tag.

getDataTypesback to summary
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 << TIFFTag.TIFF_SHORT) | (1 << TIFFTag.TIFF_LONG)
Returns:int

an int containing a bitmask encoding the set of valid data types.

getNameback to summary
public String getName()

Returns the name of the tag, as it will appear in image metadata.

Returns:String

the tag name, as a String.

getNamedValuesback to summary
public int[] getNamedValues()

Returns an array of values for which mnemonic names are defined. The method getValueName() will return non-null only for values contained in the returned array. Mnemonic names apply only to tags which have integral data type.

Returns:int[]

the values for which there is a mnemonic name.

getNumberback to summary
public int getNumber()

Returns the integer used to represent the tag.

Returns:int

the tag number, as an int.

getSizeOfTypeback to summary
public static int getSizeOfType(int dataType)

Returns the number of bytes used to store a value of the given data type.

Parameters
dataType:int

the data type to be queried.

Returns:int

the number of bytes used to store the given data type.

Exceptions
IllegalArgumentException:
if datatype is less than MIN_DATATYPE or greater than MAX_DATATYPE.
getTagSetback to summary
public TIFFTagSet getTagSet()

Returns the TIFFTagSet of which this tag is a part.

Returns:TIFFTagSet

the containing TIFFTagSet.

getValueNameback to summary
public String getValueName(int value)

Returns the mnemonic name associated with a particular value that this tag's data may take on, or null if no name is present. Mnemonic names apply only to tags which have integral data type.

Parameters
value:int

the data value.

Returns:String

the mnemonic name associated with the value, as a String.

hasValueNamesback to summary
public boolean hasValueNames()

Returns true if there are mnemonic names associated with the set of legal values for the data associated with this tag. Mnemonic names apply only to tags which have integral data type.

Returns:boolean

true if mnemonic value names are available.

isDataTypeOKback to summary
public boolean isDataTypeOK(int dataType)

Returns true if the given data type may be used for the data associated with this tag.

Parameters
dataType:int

the data type to be queried, one of TIFF_BYTE, TIFF_SHORT, etc.

Returns:boolean

a boolean indicating whether the given data type may be used with this tag.

Exceptions
IllegalArgumentException:
if datatype is less than MIN_DATATYPE or greater than MAX_DATATYPE.
isIFDPointerback to summary
public boolean isIFDPointer()

Returns true if this tag is used to point to an IFD structure containing additional tags. A TIFFTag represents an IFD pointer if and only if its TIFFTagSet is non-null or the data type TIFF_IFD_POINTER is legal. This condition will be satisfied if and only if either getTagSet() != null or isDataTypeOK(TIFF_IFD_POINTER) == true.

Many TIFF extensions use the IFD mechanism in order to limit the number of new tags that may appear in the root IFD.

Returns:boolean

true if this tag points to an IFD.