#[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
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>
impl<'a> AvifFile<'a>
Sourcepub 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
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).