Struct rexif::IfdEntry[][src]

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,
}
Expand description

Structure that represents a parsed IFD entry of a TIFF image

Fields

namespace: Namespace
Expand description

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
Expand description

IFD tag value, may or not be an EXIF tag

format: IfdFormat
Expand description

IFD data format

count: u32
Expand description

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

data: Vec<u8>
Expand description

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>
Expand description

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>
Expand description

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

le: bool
Expand description

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).

Implementations

impl IfdEntry[src]

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

👎 Deprecated

pub fn try_data_as_offset(&self) -> Option<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(&self) -> IfdEntry[src]

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl Debug for IfdEntry[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl PartialEq<IfdEntry> for IfdEntry[src]

fn eq(&self, other: &IfdEntry) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.