[][src]Struct rexif::IfdEntry

pub struct IfdEntry {
    pub namespace: Namespace,
    pub tag: u16,
    pub format: IfdFormat,
    pub count: u32,
    pub data: Vec<u8>,
    pub ifd_data: Vec<u8>,
    pub ext_data: Vec<u8>,
    pub le: bool,
}

Structure that represents a parsed IFD entry of a TIFF image

Fields

namespace: Namespace

Namespace of the entry. Standard is a tag found in normal TIFF IFD structure, other namespaces are entries found e.g. within MarkerNote blobs that are manufacturer-specific.

tag: u16

IFD tag value, may or not be an EXIF tag

format: IfdFormat

IFD data format

count: u32

Number of items, each one in the data format specified by format

data: Vec<u8>

Raw data as a vector of bytes. Length is sizeof(format) * count. Depending on its size, it came from different parts of the image file.

ifd_data: Vec<u8>

Raw data contained within the IFD structure. If count * sizeof(format) >= 4, this item contains the offset where the actual data can be found

ext_data: Vec<u8>

Raw data contained outside of the IFD structure and pointed by ifd_data, if data would not fit within the IFD structure

le: bool

If true, integer and offset formats must be parsed from raw data as little-endian. If false, integer and offset formats must be parsed from raw data as big-endian.

It is important to have 'endianess' per IFD entry, because some manufacturer-specific entries may have fixed endianess (regardeless of TIFF container's general endianess).

Methods

impl IfdEntry[src]

pub fn data_as_offset(&self) -> usize[src]

Casts IFD entry data into an offset. Not very useful for the crate client. The call can't fail, but the caller must be sure that the IFD entry uses the IFD data area as an offset (i.e. when the tag is a Sub-IFD tag, or when there are more than 4 bytes of data and it would not fit within IFD).

pub fn size(&self) -> u8[src]

Returns the size of an individual element (e.g. U8=1, U16=2...). Every IFD entry contains an array of elements, so this is NOT the size of the whole entry!

pub fn length(&self) -> usize[src]

Total length of the whole IFD entry (element count x element size)

pub fn in_ifd(&self) -> bool[src]

Returns true if data is contained within the IFD structure, false when data can be found elsewhere in the image (and IFD structure contains the data offset, instead of data).

pub fn copy_data(&mut self, contents: &[u8]) -> bool[src]

Copies data from IFD entry section reserved for data (up to 4 bytes), or from another part of the image file (when data wouldn't fit in IFD structure). In either case, the data member will contain the data of interest after this call.

Trait Implementations

impl Clone for IfdEntry[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for IfdEntry[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]