Class TIFFTag

java.lang.Object
org.monte.media.tiff.TIFFTag

public class TIFFTag extends 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.

Author:
Werner Randelshofer
  • Field Details

    • 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
      int32u
    • SHORT_MASK

      public static final int SHORT_MASK
      int16u
    • 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:
  • Constructor Details

    • TIFFTag

      public TIFFTag(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(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 Details

    • getNumber

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

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

      public boolean isSynthetic()
    • prettyFormat

      public Object prettyFormat(Object data)
    • format

      public Object format(Object data)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getDescription

      public String getDescription(Object data)