pub struct HeifFile<'a> {
pub major_brand: [u8; 4],
pub compatible_brands: Vec<[u8; 4]>,
pub handler: [u8; 4],
pub primary: Option<u32>,
pub items: Vec<Item>,
pub properties: Vec<Property<'a>>,
pub references: Vec<Reference>,
pub limits: Limits,
/* private fields */
}Expand description
A parsed HEIF file: brands, items, properties and references, borrowing the file buffer.
Fields§
§major_brand: [u8; 4]§compatible_brands: Vec<[u8; 4]>§handler: [u8; 4]§primary: Option<u32>§items: Vec<Item>§properties: Vec<Property<'a>>§references: Vec<Reference>§limits: LimitsImplementations§
Source§impl<'a> HeifFile<'a>
impl<'a> HeifFile<'a>
Sourcepub fn parse(data: &'a [u8], limits: Limits) -> Result<HeifFile<'a>>
pub fn parse(data: &'a [u8], limits: Limits) -> Result<HeifFile<'a>>
Parse the ftyp and top-level meta of a HEIF file held in memory.
Sourcepub fn primary_item(&self) -> Option<&Item>
pub fn primary_item(&self) -> Option<&Item>
The primary item, if pitm names one that iinf declares.
Sourcepub fn properties_of(
&self,
id: u32,
) -> impl Iterator<Item = (&Property<'a>, bool)> + '_
pub fn properties_of( &self, id: u32, ) -> impl Iterator<Item = (&Property<'a>, bool)> + '_
Item id’s properties in ipma order, with their essential flag.
Sourcepub fn aux_type(&self, id: u32) -> Option<&str>
pub fn aux_type(&self, id: u32) -> Option<&str>
The auxC type URN of item id, if it is an auxiliary image.
Sourcepub fn refs_from(&self, id: u32, kind: &[u8; 4]) -> Vec<u32>
pub fn refs_from(&self, id: u32, kind: &[u8; 4]) -> Vec<u32>
Items id refers to with kind, in reference order.
Sourcepub fn refs_to(&self, id: u32, kind: &[u8; 4]) -> Vec<u32>
pub fn refs_to(&self, id: u32, kind: &[u8; 4]) -> Vec<u32>
Items that refer to id with kind (e.g. the thumbnails of id
are the items with a thmb reference to it).
Sourcepub fn item_data(&self, id: u32) -> Result<Cow<'a, [u8]>>
pub fn item_data(&self, id: u32) -> Result<Cow<'a, [u8]>>
Item id’s bytes: a borrow of the file (or idat) when it is one
extent, a concatenation when it is several.
Sourcepub fn grid(&self, id: u32) -> Result<Grid>
pub fn grid(&self, id: u32) -> Result<Grid>
Parse item id as a grid descriptor, checked against Limits.
Sourcepub fn overlay(&self, id: u32) -> Result<Overlay>
pub fn overlay(&self, id: u32) -> Result<Overlay>
Parse item id as an iovl descriptor, checked against Limits.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Forget for HeifFile<'a>
impl<'a> Freeze for HeifFile<'a>
impl<'a> Move for HeifFile<'a>
impl<'a> RefUnwindSafe for HeifFile<'a>
impl<'a> Send for HeifFile<'a>
impl<'a> Sync for HeifFile<'a>
impl<'a> Unpin for HeifFile<'a>
impl<'a> UnsafeUnpin for HeifFile<'a>
impl<'a> UnwindSafe for HeifFile<'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