Copyright 2011-01-06 Werner Randelshofer

ch.randelshofer.media.tiff
Class TIFFTag

java.lang.Object
  extended by ch.randelshofer.media.tiff.TIFFTag

public class TIFFTag
extends java.lang.Object

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

Version:
1.0 2010-07-24 Created.
Author:
Werner Randelshofer

Field Summary
static int ALL_MASK
           
static int ASCII_MASK
           
static int BYTE_MASK
           
static int DOUBLE_MASK
           
static int FLOAT_MASK
           
static int IFD_MASK
           
static int LONG_MASK
           
static int RATIONAL_MASK
           
static int SBYTE_MASK
           
static int SHORT_MASK
           
static int SLONG_MASK
           
static int SRATIONAL_MASK
           
static int SSHORT_MASK
           
static int UNDEFINED_MASK
           
 
Constructor Summary
TIFFTag(java.lang.String name, int number, int dataTypes)
          Constructs a TIFFTag with a given name, tag number, set of legal data types, and TagSet to which it refers.
TIFFTag(java.lang.String name, int number, int dataTypes, ValueFormatter formatter)
          Constructs a TIFFTag with a given name, tag number, set of legal data types, and TagSet to which it refers.
 
Method Summary
 java.lang.Object format(java.lang.Object data)
           
 java.lang.String getDescription(java.lang.Object data)
           
 java.lang.String getName()
          Returns the name of the tag, or null if the name is not known.
 int getNumber()
          Returns the integer used to represent the tag.
 IFDDataType getType(java.lang.Object data)
           
 boolean isSynthetic()
           
 java.lang.Object prettyFormat(java.lang.Object data)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ASCII_MASK

public static final int ASCII_MASK

BYTE_MASK

public static final int BYTE_MASK

DOUBLE_MASK

public static final int DOUBLE_MASK

FLOAT_MASK

public static final int FLOAT_MASK

IFD_MASK

public static final int IFD_MASK

LONG_MASK

public static final int LONG_MASK

SHORT_MASK

public static final int SHORT_MASK

RATIONAL_MASK

public static final int RATIONAL_MASK

SBYTE_MASK

public static final int SBYTE_MASK

SLONG_MASK

public static final int SLONG_MASK

SSHORT_MASK

public static final int SSHORT_MASK

SRATIONAL_MASK

public static final int SRATIONAL_MASK

UNDEFINED_MASK

public static final int UNDEFINED_MASK

ALL_MASK

public static final int ALL_MASK
See Also:
Constant Field Values
Constructor Detail

TIFFTag

public TIFFTag(java.lang.String name,
               int number,
               int dataTypes,
               ValueFormatter formatter)
Constructs a TIFFTag with a given name, tag number, set of legal data types, and TagSet to which it refers. The tagSet parameter will generally be non-null only if this TIFFTag corresponds to a pointer to a TIFF IFD. In this case tagSet 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.

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.

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 - the name of the tag; may be null.
number - the number used to represent the tag.
dataTypes - a bit mask indicating the set of legal data types for this tag.
formatter - a ValueFormatter for formatting data values.

TIFFTag

public TIFFTag(java.lang.String name,
               int number,
               int dataTypes)
Constructs a TIFFTag with a given name, tag number, set of legal data types, and TagSet to which it refers. The tagSet parameter will generally be non-null only if this TIFFTag corresponds to a pointer to a TIFF IFD. In this case tagSet 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.

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.

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 - the name of the tag; may be null.
number - the number used to represent the tag.
dataTypes - a bit mask indicating the set of legal data types for this tag.
Method Detail

getNumber

public int getNumber()
Returns the integer used to represent the tag.


getName

public java.lang.String getName()
Returns the name of the tag, or null if the name is not known.


isSynthetic

public boolean isSynthetic()

getType

public IFDDataType getType(java.lang.Object data)

prettyFormat

public java.lang.Object prettyFormat(java.lang.Object data)

format

public java.lang.Object format(java.lang.Object data)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getDescription

public java.lang.String getDescription(java.lang.Object data)

Copyright 2011-01-06 Werner Randelshofer