Class TiffField<T>

java.lang.Object
pixy.image.tiff.TiffField<T>
All Implemented Interfaces:
java.lang.Comparable<TiffField<?>>
Direct Known Subclasses:
AbstractByteField, AbstractLongField, AbstractRationalField, AbstractShortField, ASCIIField, DoubleField, FloatField, UndefinedField

public abstract class TiffField<T>
extends java.lang.Object
implements java.lang.Comparable<TiffField<?>>
IFD (Image File Directory) field.

We could have used a TiffTag enum as the first parameter of the constructor, but this will not work with unknown tags of tag type TiffTag.UNKNOWN. In that case, we cannot use the tag values to sort the fields or as keys for a hash map as used by IFD.

Version:
1.0 01/04/2013
Author:
Wen Yu, yuwen_66@yahoo.com
  • Field Details

  • Constructor Details

  • Method Details

    • compareTo

      public int compareTo​(TiffField<?> that)
      Specified by:
      compareTo in interface java.lang.Comparable<T>
    • getData

      public T getData()
    • getDataAsLong

      public int[] getDataAsLong()
      Return an integer array representing TIFF long field
    • getDataAsString

      public abstract java.lang.String getDataAsString()
      Returns:
      a String representation of the field data
    • getLength

      public int getLength()
    • getDataOffset

      public int getDataOffset()
      Used to update field data when necessary.

      This method should be called only after the field has been written to the underlying RandomOutputStream.

      Returns:
      the stream position where actual data starts to write
    • getTag

      public short getTag()
    • getType

      public FieldType getType()
    • toString

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

      public final int write​(RandomAccessOutputStream os, int toOffset) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeData

      protected abstract int writeData​(RandomAccessOutputStream os, int toOffset) throws java.io.IOException
      Throws:
      java.io.IOException