pub struct Meta {
pub primary: Option<u32>,
pub items: Vec<Item>,
pub references: Vec<Reference>,
pub properties: Properties,
/* private fields */
}Expand description
The parsed meta box.
Fields§
§primary: Option<u32>The primary item, from pitm.
items: Vec<Item>Every item in the file, in iinf order.
references: Vec<Reference>Every iref entry.
properties: PropertiesThe item properties, from iprp.
Implementations§
Source§impl Meta
impl Meta
Sourcepub fn parse(meta: Reader<'_>) -> Result<Self>
pub fn parse(meta: Reader<'_>) -> Result<Self>
Parse a meta box payload.
§Errors
Returns PixelsError::Malformed if any child box is structurally
invalid.
Sourcepub fn primary_item(&self) -> Option<&Item>
pub fn primary_item(&self) -> Option<&Item>
The primary item, resolved.
Falls back to the first coded image or grid when pitm is absent.
A file without pitm is malformed, but the intent is unambiguous when
there is exactly one image, and rejecting it buys nothing.
Sourcepub fn referenced(&self, from: u32, kind: &[u8; 4]) -> &[u32]
pub fn referenced(&self, from: u32, kind: &[u8; 4]) -> &[u32]
The items from points to with a reference of this type.
Sourcepub fn alpha_item(&self, id: u32) -> Option<&Item>
pub fn alpha_item(&self, id: u32) -> Option<&Item>
The alpha plane item for id, if the file carries one.
An alpha item is an auxiliary item whose auxl reference points at
id and whose auxC property carries the alpha URN. Both halves are
checked: an auxl item with some other auxiliary type is a depth map
or a gain map, not transparency, and treating it as alpha would produce
a confidently wrong image.
Sourcepub fn item_data<'a>(
&self,
file: &'a [u8],
item: &Item,
) -> Result<Cow<'a, [u8]>>
pub fn item_data<'a>( &self, file: &'a [u8], item: &Item, ) -> Result<Cow<'a, [u8]>>
The bytes of item, resolved from file.
Borrows when the item is one contiguous extent, which is the common case, and concatenates otherwise.
§Errors
Returns PixelsError::Unsupported for item-relative construction,
or PixelsError::Malformed if an extent falls outside the file or
outside idat.