pub struct IfdEntry {
pub tag_id: u16,
pub field_type: Option<FieldType>,
pub field_type_raw: u16,
pub count: u64,
pub value_offset_bytes: Vec<u8>,
pub is_inline: bool,
}Expand description
A single entry in an IFD (Image File Directory).
Each entry describes one piece of metadata about the image. The value may be
stored inline (in the value_offset field) or at a separate offset in the file.
§Classic TIFF Entry Layout (12 bytes)
Bytes 0-1: Tag ID (u16)
Bytes 2-3: Field type (u16)
Bytes 4-7: Count (u32)
Bytes 8-11: Value or offset (u32)§BigTIFF Entry Layout (20 bytes)
Bytes 0-1: Tag ID (u16)
Bytes 2-3: Field type (u16)
Bytes 4-11: Count (u64)
Bytes 12-19: Value or offset (u64)Fields§
§tag_id: u16The tag ID (may be a known TiffTag or unknown)
field_type: Option<FieldType>The field type (None if unknown type)
field_type_raw: u16Raw field type value (for error reporting)
count: u64Number of values (not bytes!)
value_offset_bytes: Vec<u8>Raw bytes of the value/offset field. For classic TIFF: 4 bytes, for BigTIFF: 8 bytes. Contains either the actual value (if inline) or an offset to the value.
is_inline: boolWhether the value is stored inline (true) or at an offset (false)
Implementations§
Source§impl IfdEntry
impl IfdEntry
Sourcepub fn value_offset(&self, byte_order: ByteOrder) -> u64
pub fn value_offset(&self, byte_order: ByteOrder) -> u64
Sourcepub fn inline_u16(&self, byte_order: ByteOrder) -> Option<u16>
pub fn inline_u16(&self, byte_order: ByteOrder) -> Option<u16>
Sourcepub fn inline_u32(&self, byte_order: ByteOrder) -> Option<u32>
pub fn inline_u32(&self, byte_order: ByteOrder) -> Option<u32>
Sourcepub fn inline_u64(&self, byte_order: ByteOrder) -> Option<u64>
pub fn inline_u64(&self, byte_order: ByteOrder) -> Option<u64>
Sourcepub fn value_byte_size(&self) -> Option<u64>
pub fn value_byte_size(&self) -> Option<u64>
Calculate total byte size of the value data.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IfdEntry
impl RefUnwindSafe for IfdEntry
impl Send for IfdEntry
impl Sync for IfdEntry
impl Unpin for IfdEntry
impl UnwindSafe for IfdEntry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.