Skip to main content

IfdDecoder

Struct IfdDecoder 

Source
pub struct IfdDecoder<'lt> { /* private fields */ }
Expand description

Reads a directory’s tag values from an underlying stream.

Implementations§

Source§

impl IfdDecoder<'_>

Source

pub fn find_entry(&self, tag: Tag) -> Option<Entry>

Retrieve the IFD entry for a given tag, if it exists.

The entry contains the metadata of the value, that is its type and count from which we can calculate a total byte size.

Source

pub fn find_tag(&mut self, tag: Tag) -> TiffResult<Option<Value>>

Tries to retrieve a tag. Return Ok(None) if the tag is not present.

Source

pub fn find_tag_buf( &mut self, tag: Tag, buf: &mut ValueBuffer, ) -> TiffResult<Option<Entry>>

Retrieve a tag and reproduce its bytes into the provided buffer.

The buffer is unmodified if the tag is not present.

Source

pub fn find_tag_bytes( &mut self, tag: Tag, buf: &mut [u8], offset: u64, ) -> TiffResult<Option<usize>>

Read bytes of a tag’s value into a byte buffer.

Source

pub fn find_tag_unsigned<T: TryFrom<u64>>( &mut self, tag: Tag, ) -> TiffResult<Option<T>>

Tries to retrieve a tag and convert it to the desired unsigned type.

Source

pub fn find_tag_unsigned_vec<T: TryFrom<u64>>( &mut self, tag: Tag, ) -> TiffResult<Option<Vec<T>>>

Tries to retrieve a vector of all a tag’s values and convert them to the desired unsigned type.

Source

pub fn get_tag_unsigned<T: TryFrom<u64>>(&mut self, tag: Tag) -> TiffResult<T>

Tries to retrieve a tag and convert it to the desired unsigned type. Returns an error if the tag is not present.

Source

pub fn get_tag(&mut self, tag: Tag) -> TiffResult<Value>

Tries to retrieve a tag. Returns an error if the tag is not present

Source

pub fn get_tag_u32(&mut self, tag: Tag) -> TiffResult<u32>

Tries to retrieve a tag and convert it to the desired type.

Source

pub fn get_tag_u64(&mut self, tag: Tag) -> TiffResult<u64>

Source

pub fn get_tag_f32(&mut self, tag: Tag) -> TiffResult<f32>

Tries to retrieve a tag and convert it to the desired type.

Source

pub fn get_tag_f64(&mut self, tag: Tag) -> TiffResult<f64>

Tries to retrieve a tag and convert it to the desired type.

Source

pub fn get_tag_u32_vec(&mut self, tag: Tag) -> TiffResult<Vec<u32>>

Tries to retrieve a tag and convert it to the desired type.

Source

pub fn get_tag_u16_vec(&mut self, tag: Tag) -> TiffResult<Vec<u16>>

Source

pub fn get_tag_u64_vec(&mut self, tag: Tag) -> TiffResult<Vec<u64>>

Source

pub fn get_tag_f32_vec(&mut self, tag: Tag) -> TiffResult<Vec<f32>>

Tries to retrieve a tag and convert it to the desired type.

Source

pub fn get_tag_f64_vec(&mut self, tag: Tag) -> TiffResult<Vec<f64>>

Tries to retrieve a tag and convert it to the desired type.

Source

pub fn get_tag_u8_vec(&mut self, tag: Tag) -> TiffResult<Vec<u8>>

Tries to retrieve a tag and convert it to a 8bit vector.

Source

pub fn get_tag_ascii_string(&mut self, tag: Tag) -> TiffResult<String>

Tries to retrieve a tag and convert it to a ascii vector.

Source

pub fn directory(&self) -> &Directory

Inspect the raw underlying directory.

Source§

impl<'l> IfdDecoder<'l>

Source

pub fn tag_iter(self) -> impl Iterator<Item = TiffResult<(Tag, Value)>> + 'l

Returns an iterator over all tags in the current image, along with their values.

Auto Trait Implementations§

§

impl<'lt> Freeze for IfdDecoder<'lt>

§

impl<'lt> !RefUnwindSafe for IfdDecoder<'lt>

§

impl<'lt> !Send for IfdDecoder<'lt>

§

impl<'lt> !Sync for IfdDecoder<'lt>

§

impl<'lt> Unpin for IfdDecoder<'lt>

§

impl<'lt> !UnwindSafe for IfdDecoder<'lt>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.