Package pixy.image.tiff
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 Summary
Fields Modifier and Type Field Description protected T
data
protected int
dataOffset
protected static int
MAX_STRING_REPR_LEN
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description int
compareTo(TiffField<?> that)
T
getData()
int[]
getDataAsLong()
Return an integer array representing TIFF long fieldabstract java.lang.String
getDataAsString()
int
getDataOffset()
Used to update field data when necessary.int
getLength()
short
getTag()
FieldType
getType()
java.lang.String
toString()
int
write(RandomAccessOutputStream os, int toOffset)
protected abstract int
writeData(RandomAccessOutputStream os, int toOffset)
-
Field Details
-
data
-
MAX_STRING_REPR_LEN
protected static final int MAX_STRING_REPR_LEN- See Also:
- Constant Field Values
-
dataOffset
protected int dataOffset
-
-
Constructor Details
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfacejava.lang.Comparable<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
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
write
- Throws:
java.io.IOException
-
writeData
protected abstract int writeData(RandomAccessOutputStream os, int toOffset) throws java.io.IOException- Throws:
java.io.IOException
-