Class TiffField
java.lang.Object
org.apache.commons.imaging.formats.tiff.TiffField
A TIFF field in a TIFF directory. Immutable.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
dump()
void
dump
(PrintWriter pw) void
dump
(PrintWriter pw, String prefix) byte[]
Returns a copy of the raw value of the field.Returns the field's byte order.int
The length of the field's value.long
getCount()
Returns the field's count, derived from bytes 4-7.int
double[]
double
Returns the field's type, derived from bytes 2-3.int[]
int
int
int
Returns the TIFF field's offset/value field, derived from bytes 8-11.int
int
getTag()
Returns the field's tag, derived from bytes 0-1.getValue()
private String
boolean
Indicates whether the field's value is inlined into the offset field.toString()
-
Field Details
-
LOGGER
-
tagInfo
-
tag
private final int tag -
directoryType
private final int directoryType -
fieldType
-
count
private final long count -
offset
private final long offset -
value
private final byte[] value -
byteOrder
-
sortHint
private final int sortHint
-
-
Constructor Details
-
TiffField
-
-
Method Details
-
getDirectoryType
public int getDirectoryType() -
getTagInfo
-
getTag
public int getTag()Returns the field's tag, derived from bytes 0-1.- Returns:
- the tag, as an
int
in which only the lowest 2 bytes are set
-
getFieldType
Returns the field's type, derived from bytes 2-3.- Returns:
- the field's type, as a
FieldType
object.
-
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
long
of 4 packed bytes, or its inlined value <= 4 bytes long encoded in the field's byte order.
-
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
-
getValueDescription
-
getValueDescription
-
dump
public void dump() -
dump
-
dump
-
getDescriptionWithoutValue
-
toString
-
getTagName
-
getFieldTypeName
-
getValue
- Throws:
ImageReadException
-
getStringValue
- Throws:
ImageReadException
-
getIntArrayValue
- Throws:
ImageReadException
-
getDoubleArrayValue
- Throws:
ImageReadException
-
getIntValueOrArraySum
- Throws:
ImageReadException
-
getIntValue
- Throws:
ImageReadException
-
getDoubleValue
- Throws:
ImageReadException
-