A field in a TIFF Image File Directory (IFD) is defined as a
tag number accompanied by a sequence of values of identical data type.
TIFF 6.0 defines 12 data types; a 13th type IFD is
defined in TIFF Tech Note 1 of TIFF Specification Supplement 1. These
TIFF data types are referred to by Java constants and mapped internally
onto Java language data types and type names as follows:
| TIFF Data Type | Java Constant | Java Data Type | Java Type Name |
|---|---|---|---|
BYTE
| TIFFTag#TIFF_BYTE
| byte
| "Byte"
|
ASCII
| TIFFTag#TIFF_ASCII
| String
| "Ascii"
|
SHORT
| TIFFTag#TIFF_SHORT
| char
| "Short"
|
LONG
| TIFFTag#TIFF_LONG
| long
| "Long"
|
RATIONAL
| TIFFTag#TIFF_RATIONAL
| long[2] {numerator, denominator}
| "Rational"
|
SBYTE
| TIFFTag#TIFF_SBYTE
| byte
| "SByte"
|
UNDEFINED
| TIFFTag#TIFF_UNDEFINED
| byte
| "Undefined"
|
SSHORT
| TIFFTag#TIFF_SSHORT
| short
| "SShort"
|
SLONG
| TIFFTag#TIFF_SLONG
| int
| "SLong"
|
SRATIONAL
| TIFFTag#TIFF_SRATIONAL
| int[2] {numerator, denominator}
| "SRational"
|
FLOAT
| TIFFTag#TIFF_FLOAT
| float
| "Float"
|
DOUBLE
| TIFFTag#TIFF_DOUBLE
| double
| "Double"
|
IFD
| TIFFTag#TIFF_IFD_POINTER
| long
| "IFDPointer"
|
TIFFDirectory, TIFFTag
| Modifier and Type | Field and Description |
|---|---|
| private int | count
The number of data items present in the field. |
| private Object | data
The field data. |
| private TIFFDirectory | dir
The IFD contents if available. |
| private static final boolean[] | |
| private static final long | |
| private TIFFTag | tag
The tag. |
| private int | tagNumber
The tag number. |
| private int | type
The tag type. |
| private static final String[] |
| Access | Constructor and Description |
|---|---|
| private | |
| public | TIFFField(TIFFTag
The tag to associated with this field. tag, int One of the type, int TIFFTag.TIFF_* constants
indicating the data type of the field as written to the TIFF stream.The number of data values. count, Object The actual data content of the field. data)Constructs a |
| public | TIFFField(TIFFTag
The tag to associated with this field. tag, int One of the type, int TIFFTag.TIFF_* constants
indicating the data type of the field as written to the TIFF stream.The number of data values. count)Constructs a data array using |
| public | |
| public | TIFFField(TIFFTag
The tag to associated with this field. tag, int One of the constants type, long TIFFTag.TIFF_LONG or
TIFFTag.TIFF_IFD_POINTER.The IFD offset. offset, TIFFDirectory The directory. dir)Constructs a |
| Modifier and Type | Method and Description |
|---|---|
| public TIFFField | Returns: A clone of thisTIFFField.Overrides java. Clones the field and all the information contained therein. |
| public static Object | Returns: An array appropriate for the specified data type.One of the dataType, int TIFFTag.TIFF_* data type
constants.The number of values in the array. count)Creates an array appropriate for the indicated data type. |
| public static TIFFField | Returns: A newTIFFField.The tagSet, Node TIFFTagSet to which the
TIFFTag of the field belongs.A native TIFF image metadata node)TIFFField node.Creates a |
| public byte[] | Returns: The data as an uninterpreted array of bytes.Returns the data as an uninterpreted array of
|
| public char[] | Returns: The data as an array ofchars.Returns |
| public double | Returns: The data at the given index as adouble.The index of the data. index)Returns data in any format as a |
| public double[] | Returns: The data as an array ofdoubles.Returns |
| public float | Returns: The data at the given index as afloat.The index of the data. index)Returns data in any format as a |
| public float[] | Returns: The data as an array offloats.Returns |
| public int | Returns: The data at the given index as anint.The index of the data. index)Returns data in any format as an |
| public int[] | Returns: The data as an array ofints.Returns |
| public long | Returns: The data at the given index as along.The index of the data. index)Returns data in any format as a |
| public long[] | Returns: The data as an array oflongs.Returns |
| public Node | Returns: aNode named "TIFFField" or
"TIFFIFD".Returns the |
| public long[] | Returns: The data at the given index as an unsigned rational.The index of the data. index)Returns a TIFFTag.TIFF_RATIONAL data item as a two-element array of ints. |
| public long[][] | Returns: The data as an array of unsigned rationals.Returns |
| public short[] | Returns: The data as an array ofshorts.Returns |
| public int[] | Returns: The data at the given index as a signed rational.The index of the data. index)Returns a |
| public int[][] | Returns: The data as an array of signed rationals.Returns |
| public String | Returns: The data at the given index as aString.The index of the data. index)Returns a |
| private static String | |
| public int | Returns: The number of data items present in the field.Returns the number of data items present in the field. |
| public Object | Returns: The data object of the field.Returns a reference to the data object associated with the field. |
| public TIFFDirectory | Returns: the TIFFDirectory instance or null.Returns the associated |
| public TIFFTag | |
| public int | |
| public int | Returns: The data type of the field value.Returns the type of the data stored in the field. |
| public static int | Returns: One of theTIFFTag.TIFF_* constants or
-1 if the name is not recognized.The type name. typeName)Returns the data type constant corresponding to the supplied data type name. |
| public static String | Returns: The type name corresponding to the supplied type constant.One of the dataType)TIFFTag.TIFF_* constants
indicating the data type of the field as written to the TIFF stream.Returns the name of the supplied data type constant. |
| public String | Returns: The data at the given index as aString.The index of the data. index)Returns a |
| public boolean | Returns: true if and only if getDirectory() returns non-null.Returns whether the field has a |
| private static void | |
| public boolean | Returns: Whether the field type is integral.Indicates whether the value associated with the field is of integral data type. |
| count | back to summary |
|---|---|
| private int count The number of data items present in the field. | |
| data | back to summary |
|---|---|
| private Object data The field data. | |
| dir | back to summary |
|---|---|
| private TIFFDirectory dir The IFD contents if available. This will usually be a TIFFIFD. | |
| IS_INTEGRAL | back to summary |
|---|---|
| private static final boolean[] IS_INTEGRAL | |
| MAX_UINT32 | back to summary |
|---|---|
| private static final long MAX_UINT32 | |
| tag | back to summary |
|---|---|
| private TIFFTag tag The tag. | |
| tagNumber | back to summary |
|---|---|
| private int tagNumber The tag number. | |
| type | back to summary |
|---|---|
| private int type The tag type. | |
| TYPE_NAMES | back to summary |
|---|---|
| private static final String[] TYPE_NAMES | |
| TIFFField | back to summary |
|---|---|
| private TIFFField() The default constructor. | |
| TIFFField | back to summary |
|---|---|
| public TIFFField(TIFFTag tag, int type, int count, Object data) Constructs a Note that the value (data) of the
| |
| TIFFField | back to summary |
|---|---|
| public TIFFField(TIFFTag tag, int type, int count) Constructs a data array using
| |
| TIFFField | back to summary |
|---|---|
| public TIFFField(TIFFTag tag, long value) Constructs a
| |
| TIFFField | back to summary |
|---|---|
| public TIFFField(TIFFTag tag, int type, long offset, TIFFDirectory dir) Constructs a
| |
| clone | back to summary |
|---|---|
| public TIFFField clone() throws CloneNotSupportedException Overrides java. Clones the field and all the information contained therein.
| |
| createArrayForType | back to summary |
|---|---|
| public static Object createArrayForType(int dataType, int count) Creates an array appropriate for the indicated data type.
| |
| createFromMetadataNode | back to summary |
|---|---|
| public static TIFFField createFromMetadataNode(TIFFTagSet tagSet, Node node) Creates a
| |
| getAsBytes | back to summary |
|---|---|
| public byte[] getAsBytes() Returns the data as an uninterpreted array of
For data in
| |
| getAsChars | back to summary |
|---|---|
| public char[] getAsChars() Returns
| |
| getAsDouble | back to summary |
|---|---|
| public double getAsDouble(int index) Returns data in any format as a Data in Data in
| |
| getAsDoubles | back to summary |
|---|---|
| public double[] getAsDoubles() Returns
| |
| getAsFloat | back to summary |
|---|---|
| public float getAsFloat(int index) Returns data in any format as a Data in Data in Data in
| |
| getAsFloats | back to summary |
|---|---|
| public float[] getAsFloats() Returns
| |
| getAsInt | back to summary |
|---|---|
| public int getAsInt(int index) Returns data in any format as an A Data in Data in Data in
| |
| getAsInts | back to summary |
|---|---|
| public int[] getAsInts() Returns
| |
| getAsLong | back to summary |
|---|---|
| public long getAsLong(int index) Returns data in any format as a Data in Data in Data in
| |
| getAsLongs | back to summary |
|---|---|
| public long[] getAsLongs() Returns
| |
| getAsNativeNode | back to summary |
|---|---|
| public Node getAsNativeNode() Returns the
| |
| getAsRational | back to summary |
|---|---|
| public long[] getAsRational(int index) Returns a TIFFTag.TIFF_RATIONAL data item as a two-element array of ints.
| |
| getAsRationals | back to summary |
|---|---|
| public long[][] getAsRationals() Returns
| |
| getAsShorts | back to summary |
|---|---|
| public short[] getAsShorts() Returns
| |
| getAsSRational | back to summary |
|---|---|
| public int[] getAsSRational(int index) Returns a
| |
| getAsSRationals | back to summary |
|---|---|
| public int[][] getAsSRationals() Returns
| |
| getAsString | back to summary |
|---|---|
| public String getAsString(int index) Returns a
| |
| getAttribute | back to summary |
|---|---|
| private static String getAttribute(Node node, String attrName) | |
| getCount | back to summary |
|---|---|
| public int getCount() Returns the number of data items present in the field. For
| |
| getData | back to summary |
|---|---|
| public Object getData() Returns a reference to the data object associated with the field.
| |
| getDirectory | back to summary |
|---|---|
| public TIFFDirectory getDirectory() Returns the associated
| |
| getTag | back to summary |
|---|---|
| public TIFFTag getTag() Retrieves the tag associated with this field.
| |
| getTagNumber | back to summary |
|---|---|
| public int getTagNumber() Retrieves the tag number in the range
| |
| getType | back to summary |
|---|---|
| public int getType() Returns the type of the data stored in the field. For a TIFF 6.0
stream, the value will equal one of the
| |
| getTypeByName | back to summary |
|---|---|
| public static int getTypeByName(String typeName) Returns the data type constant corresponding to the supplied data
type name. If the name is unknown
| |
| getTypeName | back to summary |
|---|---|
| public static String getTypeName(int dataType) Returns the name of the supplied data type constant.
| |
| getValueAsString | back to summary |
|---|---|
| public String getValueAsString(int index) Returns a
| |
| hasDirectory | back to summary |
|---|---|
| public boolean hasDirectory() Returns whether the field has a
| |
| initData | back to summary |
|---|---|
| private static void initData(Node node, int[] otype, int[] ocount, Object[] odata) | |
| isIntegral | back to summary |
|---|---|
| public boolean isIntegral() Indicates whether the value associated with the field is of integral data type.
| |