public class ExifTagInfo
extends java.lang.Object
Exify.buildTag(ly.img.android.pesdk.backend.exif.Exify.TAG, java.lang.Object)
.Exify
Modifier and Type | Field and Description |
---|---|
static short |
TYPE_ASCII
The ASCII type in the EXIF standard.
|
static short |
TYPE_LONG
The SLONG type in the EXIF standard.
|
static short |
TYPE_RATIONAL
The SRATIONAL type of EXIF standard.
|
static short |
TYPE_UNDEFINED
The UNDEFINED type in the EXIF standard.
|
static short |
TYPE_UNSIGNED_BYTE
The BYTE type in the EXIF standard.
|
static short |
TYPE_UNSIGNED_LONG
The LONG type in the EXIF standard.
|
static short |
TYPE_UNSIGNED_RATIONAL
The RATIONAL type of EXIF standard.
|
static short |
TYPE_UNSIGNED_SHORT
The SHORT type in the EXIF standard.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
long |
forceGetValueAsLong(long defaultValue)
Gets a long representation of the value.
|
java.lang.String |
forceGetValueAsString()
Gets a string representation of the value.
|
protected void |
forceSetComponentCount(int count)
Sets the component count of this tag.
|
protected void |
getBytes(byte[] buf)
Equivalent to getBytes(buffer, 0, buffer.length).
|
protected void |
getBytes(byte[] buf,
int offset,
int length)
Gets the
TYPE_UNDEFINED or TYPE_UNSIGNED_BYTE data. |
int |
getComponentCount()
Gets the component count of this tag.
|
int |
getDataSize()
Gets the total data size in bytes of the value of this tag.
|
short |
getDataType()
Gets the data type of this tag
|
static int |
getElementSize(short type)
Gets the element size of the given data type in bytes.
|
int |
getIfd()
Returns the ID of the IFD this tag belongs to.
|
protected int |
getOffset()
Gets the offset of this tag.
|
protected Rational |
getRational(int index)
Gets the
TYPE_RATIONAL or TYPE_UNSIGNED_RATIONAL data. |
protected java.lang.String |
getString()
Gets the
TYPE_ASCII data. |
protected byte[] |
getStringByte() |
short |
getTagId()
Gets the TID of this tag.
|
java.lang.Object |
getValue()
Gets the tag's value or null if none exists.
|
byte |
getValueAsByte(byte defaultValue)
Gets the value as a byte.
|
byte[] |
getValueAsBytes()
Gets the value as a byte array.
|
int |
getValueAsInt(int defaultValue)
Gets the value as an int.
|
int[] |
getValueAsInts()
Gets the value as an array of ints.
|
long |
getValueAsLong(long defaultValue)
Gets the value or null if none exists.
|
long[] |
getValueAsLongs()
Gets the value as an array of longs.
|
Rational |
getValueAsRational(long defaultValue)
Gets the value as a Rational.
|
Rational |
getValueAsRational(Rational defaultValue)
Gets the value as a Rational.
|
Rational[] |
getValueAsRationals()
Gets the value as an array of Rationals.
|
java.lang.String |
getValueAsString()
Gets the value as a String.
|
java.lang.String |
getValueAsString(java.lang.String defaultValue)
Gets the value as a String.
|
protected long |
getValueAt(int index)
Gets the value for type
TYPE_ASCII , TYPE_LONG ,
TYPE_UNDEFINED , TYPE_UNSIGNED_BYTE ,
TYPE_UNSIGNED_LONG , or TYPE_UNSIGNED_SHORT . |
protected boolean |
hasDefinedCount() |
boolean |
hasValue()
Returns true if this ExifTag contains value; otherwise, this tag will
contain an offset value that is determined when the tag is written.
|
static boolean |
isValidIfd(int ifdId)
Returns true if the given IFD is a valid IFD.
|
static boolean |
isValidType(short type)
Returns true if a given type is a valid tag type.
|
protected void |
setHasDefinedCount(boolean d) |
protected void |
setIfd(int ifdId) |
protected void |
setOffset(int offset)
Sets the offset of this tag.
|
boolean |
setTimeValue(long time)
Sets a timestamp to this tag.
|
boolean |
setValue(byte value)
Sets byte value into this tag.
|
boolean |
setValue(byte[] value)
Equivalent to setValue(value, 0, value.length).
|
boolean |
setValue(byte[] value,
int offset,
int length)
Sets byte values into this tag.
|
boolean |
setValue(int value)
Sets integer value into this tag.
|
boolean |
setValue(int[] value)
Sets integer values into this tag.
|
boolean |
setValue(long value)
Sets long values into this tag.
|
boolean |
setValue(long[] value)
Sets long values into this tag.
|
boolean |
setValue(java.lang.Object obj)
Sets the value for this tag using an appropriate setValue method for the
given object.
|
boolean |
setValue(Rational value)
Sets a Rational value into this tag.
|
boolean |
setValue(Rational[] value)
Sets Rational values into this tag.
|
boolean |
setValue(java.lang.String value)
Sets a string value into this tag.
|
java.lang.String |
toString() |
public static final short TYPE_UNSIGNED_BYTE
public static final short TYPE_ASCII
public static final short TYPE_UNSIGNED_SHORT
public static final short TYPE_UNSIGNED_LONG
public static final short TYPE_UNSIGNED_RATIONAL
public static final short TYPE_UNDEFINED
public static final short TYPE_LONG
public static final short TYPE_RATIONAL
public static boolean isValidIfd(int ifdId)
public static boolean isValidType(short type)
public int getIfd()
protected void setIfd(int ifdId)
public short getTagId()
public int getDataSize()
public int getComponentCount()
public static int getElementSize(short type)
public short getDataType()
protected void forceSetComponentCount(int count)
public boolean hasValue()
public boolean setValue(int[] value)
TYPE_UNSIGNED_SHORT
. This method will fail if:
TYPE_UNSIGNED_SHORT
,
TYPE_UNSIGNED_LONG
, or TYPE_LONG
.public boolean setValue(int value)
TYPE_UNSIGNED_SHORT
, or TYPE_LONG
. This method
will fail if:
TYPE_UNSIGNED_SHORT
,
TYPE_UNSIGNED_LONG
, or TYPE_LONG
.public boolean setValue(long[] value)
TYPE_UNSIGNED_LONG
. This method will fail if:
TYPE_UNSIGNED_LONG
.public boolean setValue(long value)
TYPE_UNSIGNED_LONG
. This method will fail if:
TYPE_UNSIGNED_LONG
.public boolean setValue(Rational[] value)
TYPE_UNSIGNED_RATIONAL
, or TYPE_RATIONAL
. This
method will fail if:
TYPE_UNSIGNED_RATIONAL
or TYPE_RATIONAL
.Rational
public boolean setValue(Rational value)
TYPE_UNSIGNED_RATIONAL
, or TYPE_RATIONAL
. This
method will fail if:
TYPE_UNSIGNED_RATIONAL
or TYPE_RATIONAL
.Rational
public boolean setValue(byte[] value, int offset, int length)
TYPE_UNSIGNED_BYTE
or TYPE_UNDEFINED
. This method
will fail if:
TYPE_UNSIGNED_BYTE
or
TYPE_UNDEFINED
.public boolean setValue(byte[] value)
public boolean setValue(byte value)
TYPE_UNSIGNED_BYTE
or TYPE_UNDEFINED
. This method
will fail if:
TYPE_UNSIGNED_BYTE
or
TYPE_UNDEFINED
.public boolean setValue(java.lang.Object obj)
public boolean setTimeValue(long time)
setValue(String)
. This
method will fail if the data type is not TYPE_ASCII
or the
component count of this tag is not 20 or undefined.time
- the number of milliseconds since Jan. 1, 1970 GMTpublic boolean setValue(java.lang.String value)
TYPE_ASCII
. The string is converted to an ASCII string.
Characters that cannot be converted are replaced with '?'. The length of
the string must be equal to either (component count -1) or (component
count). The final byte will be set to the string null terminator '\0',
overwriting the last character in the string if the value.length is equal
to the component count. This method will fail if:
TYPE_ASCII
or TYPE_UNDEFINED
.public java.lang.String getValueAsString(java.lang.String defaultValue)
TYPE_ASCII
.defaultValue
- the String to return if the tag's value does not
exist or cannot be converted to a String.public java.lang.String getValueAsString()
TYPE_ASCII
.public byte getValueAsByte(byte defaultValue)
TYPE_UNDEFINED
or TYPE_UNSIGNED_BYTE
.defaultValue
- the byte to return if tag's value does not exist or
cannot be converted to a byte.public byte[] getValueAsBytes()
TYPE_UNDEFINED
or TYPE_UNSIGNED_BYTE
.public Rational getValueAsRational(long defaultValue)
TYPE_RATIONAL
or TYPE_UNSIGNED_RATIONAL
.defaultValue
- the numerator of the Rational to return if tag's
value does not exist or cannot be converted to a Rational (the
denominator will be 1).public Rational getValueAsRational(Rational defaultValue)
TYPE_RATIONAL
or TYPE_UNSIGNED_RATIONAL
.defaultValue
- the Rational to return if tag's value does not exist
or cannot be converted to a Rational.public Rational[] getValueAsRationals()
TYPE_RATIONAL
or TYPE_UNSIGNED_RATIONAL
.public int getValueAsInt(int defaultValue)
TYPE_UNSIGNED_SHORT
, TYPE_UNSIGNED_LONG
.defaultValue
- the int to return if tag's value does not exist or
cannot be converted to an int.public int[] getValueAsInts()
TYPE_UNSIGNED_SHORT
, TYPE_UNSIGNED_LONG
.public long getValueAsLong(long defaultValue)
TYPE_UNSIGNED_LONG
.defaultValue
- the long to return if tag's value does not exist or
cannot be converted to a long.public long[] getValueAsLongs()
TYPE_UNSIGNED_LONG
.public java.lang.Object getValue()
public long forceGetValueAsLong(long defaultValue)
defaultValue
- value to return if there is no value or value is a
rational with a denominator of 0.protected long getValueAt(int index)
TYPE_ASCII
, TYPE_LONG
,
TYPE_UNDEFINED
, TYPE_UNSIGNED_BYTE
,
TYPE_UNSIGNED_LONG
, or TYPE_UNSIGNED_SHORT
. For
TYPE_RATIONAL
or TYPE_UNSIGNED_RATIONAL
, call
getRational(int)
instead.java.lang.IllegalArgumentException
- if the data type is
TYPE_RATIONAL
or TYPE_UNSIGNED_RATIONAL
.protected java.lang.String getString()
TYPE_ASCII
data.java.lang.IllegalArgumentException
- If the type is NOT
TYPE_ASCII
.protected byte[] getStringByte()
protected Rational getRational(int index)
TYPE_RATIONAL
or TYPE_UNSIGNED_RATIONAL
data.java.lang.IllegalArgumentException
- If the type is NOT
TYPE_RATIONAL
or TYPE_UNSIGNED_RATIONAL
.protected void getBytes(byte[] buf)
protected void getBytes(byte[] buf, int offset, int length)
TYPE_UNDEFINED
or TYPE_UNSIGNED_BYTE
data.buf
- the byte array in which to store the bytes read.offset
- the initial position in buffer to store the bytes.length
- the maximum number of bytes to store in buffer. If length >
component count, only the valid bytes will be stored.java.lang.IllegalArgumentException
- If the type is NOT
TYPE_UNDEFINED
or TYPE_UNSIGNED_BYTE
.protected int getOffset()
protected void setOffset(int offset)
protected void setHasDefinedCount(boolean d)
protected boolean hasDefinedCount()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String forceGetValueAsString()