Class TiffField
- java.lang.Object
-
- org.apache.commons.imaging.formats.tiff.TiffField
-
public class TiffField extends Object
A TIFF field in a TIFF directory. Immutable.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classTiffField.OversizeValueElement
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddump()voiddump(PrintWriter pw)voiddump(PrintWriter pw, String prefix)byte[]getByteArrayValue()Returns a copy of the raw value of the field.ByteOrdergetByteOrder()Returns the field's byte order.intgetBytesLength()The length of the field's value.longgetCount()Returns the field's count, derived from bytes 4-7.StringgetDescriptionWithoutValue()intgetDirectoryType()double[]getDoubleArrayValue()doublegetDoubleValue()FieldTypegetFieldType()Returns the field's type, derived from bytes 2-3.StringgetFieldTypeName()int[]getIntArrayValue()intgetIntValue()intgetIntValueOrArraySum()intgetOffset()Returns the TIFF field's offset/value field, derived from bytes 8-11.TiffElementgetOversizeValueElement()intgetSortHint()StringgetStringValue()intgetTag()Returns the field's tag, derived from bytes 0-1.TagInfogetTagInfo()StringgetTagName()ObjectgetValue()StringgetValueDescription()booleanisLocalValue()Indicates whether the field's value is inlined into the offset field.StringtoString()
-
-
-
Method Detail
-
getDirectoryType
public int getDirectoryType()
-
getTagInfo
public TagInfo getTagInfo()
-
getTag
public int getTag()
Returns the field's tag, derived from bytes 0-1.- Returns:
- the tag, as an
intin which only the lowest 2 bytes are set
-
getFieldType
public FieldType getFieldType()
Returns the field's type, derived from bytes 2-3.- Returns:
- the field's type, as a
FieldTypeobject.
-
getCount
public long getCount()
Returns the field's count, derived from bytes 4-7.- Returns:
- the count
-
getOffset
public int getOffset()
Returns the TIFF field's offset/value field, derived from bytes 8-11.- Returns:
- the field's offset in a
longof 4 packed bytes, or its inlined value <= 4 bytes long encoded in the field's byte order.
-
getByteOrder
public ByteOrder getByteOrder()
Returns the field's byte order.- Returns:
- the byte order
-
getSortHint
public int getSortHint()
-
isLocalValue
public boolean isLocalValue()
Indicates whether the field's value is inlined into the offset field.- Returns:
- true if the value is inlined
-
getBytesLength
public int getBytesLength()
The length of the field's value.- Returns:
- the length, in bytes.
-
getByteArrayValue
public byte[] getByteArrayValue()
Returns a copy of the raw value of the field.- Returns:
- the value of the field, in the byte order of the field.
-
getOversizeValueElement
public TiffElement getOversizeValueElement()
-
getValueDescription
public String getValueDescription()
-
dump
public void dump()
-
dump
public void dump(PrintWriter pw)
-
dump
public void dump(PrintWriter pw, String prefix)
-
getDescriptionWithoutValue
public String getDescriptionWithoutValue()
-
getTagName
public String getTagName()
-
getFieldTypeName
public String getFieldTypeName()
-
getValue
public Object getValue() throws ImageReadException
- Throws:
ImageReadException
-
getStringValue
public String getStringValue() throws ImageReadException
- Throws:
ImageReadException
-
getIntArrayValue
public int[] getIntArrayValue() throws ImageReadException- Throws:
ImageReadException
-
getDoubleArrayValue
public double[] getDoubleArrayValue() throws ImageReadException- Throws:
ImageReadException
-
getIntValueOrArraySum
public int getIntValueOrArraySum() throws ImageReadException- Throws:
ImageReadException
-
getIntValue
public int getIntValue() throws ImageReadException- Throws:
ImageReadException
-
getDoubleValue
public double getDoubleValue() throws ImageReadException- Throws:
ImageReadException
-
-