pub struct Tiff<'a> {
pub data: &'a [u8],
pub order: ByteOrder,
pub ifds: Vec<Ifd<'a>>,
}Expand description
A parsed TIFF structure.
Fields§
§data: &'a [u8]The bytes offsets are relative to (file[base..]).
order: ByteOrder§ifds: Vec<Ifd<'a>>Top-level IFD chain.
Implementations§
Source§impl<'a> Tiff<'a>
impl<'a> Tiff<'a>
Sourcepub fn parse(data: &'a [u8]) -> Result<Self>
pub fn parse(data: &'a [u8]) -> Result<Self>
Parse a standard TIFF header (II*\0 / MM\0*, or vendor magics) at the start of data.
pub fn parse_with(data: &'a [u8], opts: TiffOptions) -> Result<Self>
Sourcepub fn parse_from(
data: &'a [u8],
order: ByteOrder,
first_ifd: u32,
opts: TiffOptions,
) -> Result<Self>
pub fn parse_from( data: &'a [u8], order: ByteOrder, first_ifd: u32, opts: TiffOptions, ) -> Result<Self>
Parse an IFD chain starting at first_ifd with an explicit byte order.
Sourcepub fn all_ifds(&self) -> Vec<&Ifd<'a>>
pub fn all_ifds(&self) -> Vec<&Ifd<'a>>
Every IFD in the file (chain, sub IFDs, EXIF, GPS), depth first.
Sourcepub fn find_ifd_with(&self, tag: u16) -> Option<&Ifd<'a>>
pub fn find_ifd_with(&self, tag: u16) -> Option<&Ifd<'a>>
First IFD (anywhere) that contains tag.
Sourcepub fn find_entry(&self, tag: u16) -> Option<&Entry<'a>>
pub fn find_entry(&self, tag: u16) -> Option<&Entry<'a>>
First entry for tag anywhere in the file.
Sourcepub fn sub_ifd_at(&self, offset: u32) -> Result<Ifd<'a>>
pub fn sub_ifd_at(&self, offset: u32) -> Result<Ifd<'a>>
Parse a nested IFD (e.g. a maker note directory) located at offset within self.data.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Tiff<'a>
impl<'a> RefUnwindSafe for Tiff<'a>
impl<'a> Send for Tiff<'a>
impl<'a> Sync for Tiff<'a>
impl<'a> Unpin for Tiff<'a>
impl<'a> UnsafeUnpin for Tiff<'a>
impl<'a> UnwindSafe for Tiff<'a>
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> 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 more