Skip to main content

AvifFile

Struct AvifFile 

Source
#[non_exhaustive]
pub struct AvifFile<'a> {
Show 16 fields pub major_brand: BoxType, pub minor_version: u32, pub compatible_brands: Vec<BoxType>, pub meta: Meta, pub primary_item_id: u32, pub primary_item: ItemInfo, pub primary_item_data: Cow<'a, [u8]>, pub av1c: Option<Vec<u8>>, pub ispe: Option<Ispe>, pub colr: Option<Colr>, pub pixi: Option<Pixi>, pub pasp: Option<Pasp>, pub mdcv: Option<Mdcv>, pub clli: Option<Clli>, pub cclv: Option<Cclv>, pub amve: Option<Amve>,
}
Expand description

The parsed AVIF container (the file, not its pixels): brands, the meta model, the primary av01 item with its coded payload and properties — ready for hand-off to an AV1 OBU decoder.

Was AvifImage before 0.0.13; that name is now the decoded picture (crate::AvifImage), as the image-crate API contract requires.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§major_brand: BoxType§minor_version: u32§compatible_brands: Vec<BoxType>§meta: Meta§primary_item_id: u32§primary_item: ItemInfo§primary_item_data: Cow<'a, [u8]>

AV1 OBU bitstream for the primary item.

For the common case — a single-extent construction_method == 0 (file-offset) item — this borrows directly into file with no allocation (Cow::Borrowed). When the primary item’s bytes live in the meta box’s idat (construction_method == 1, HEIF §8.11.3 / ISO/IEC 14496-12 §8.11.3) or span multiple extents, the extents are concatenated into an owned buffer (Cow::Owned). Deref-coerces to &[u8] for all reads.

§av1c: Option<Vec<u8>>

av1C configuration record body (the 4-byte AV1CodecConfigurationRecord prefix + embedded config OBUs). None if the property store doesn’t ship one — a malformed file.

§ispe: Option<Ispe>§colr: Option<Colr>§pixi: Option<Pixi>§pasp: Option<Pasp>§mdcv: Option<Mdcv>

Mastering display colour volume (SMPTE ST 2086 / CTA-861-G HDR).

§clli: Option<Clli>

Content light level info (MaxCLL / MaxFALL in cd/m²).

§cclv: Option<Cclv>

Colour volume luminance (cclv draft extension, same semantics as clli).

§amve: Option<Amve>

Ambient viewing environment HDR metadata (amve, AVIF §6.5.36).

Implementations§

Source§

impl<'a> AvifFile<'a>

Source

pub fn new( major_brand: BoxType, minor_version: u32, compatible_brands: Vec<BoxType>, meta: Meta, primary_item_id: u32, primary_item: ItemInfo, primary_item_data: Cow<'a, [u8]>, av1c: Option<Vec<u8>>, ispe: Option<Ispe>, colr: Option<Colr>, pixi: Option<Pixi>, pasp: Option<Pasp>, mdcv: Option<Mdcv>, clli: Option<Clli>, cclv: Option<Cclv>, amve: Option<Amve>, ) -> Self

Every field as a positional argument, in declaration order (the record is #[non_exhaustive]: build it here, or from Default where one exists, then read / assign the public fields).

Trait Implementations§

Source§

impl<'a> Clone for AvifFile<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for AvifFile<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for AvifFile<'a>

§

impl<'a> RefUnwindSafe for AvifFile<'a>

§

impl<'a> Send for AvifFile<'a>

§

impl<'a> Sync for AvifFile<'a>

§

impl<'a> Unpin for AvifFile<'a>

§

impl<'a> UnsafeUnpin for AvifFile<'a>

§

impl<'a> UnwindSafe for AvifFile<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.