pub struct AvifDepthMap {
pub data: Vec<u8>,
pub width: u32,
pub height: u32,
pub av1_config: Option<AV1Config>,
pub color_info: Option<ColorInformation>,
}Expand description
Depth auxiliary image extracted from an AVIF container.
AVIF supports auxiliary images via auxl item references with auxC type
properties, following the HEIF (ISO 23008-12) auxiliary image mechanism.
Depth maps use the auxiliary type URN
urn:mpeg:mpegB:cicp:systems:auxiliary:depth (MPEG-B Part 23) or the
legacy HEVC-style urn:mpeg:hevc:2015:auxid:2.
The data field contains a raw AV1 bitstream that can be decoded with
any AV1 decoder to obtain the depth image pixel values (typically
monochrome 8-bit or 10-bit).
§Example
let bytes = std::fs::read("portrait.avif").unwrap();
let parser = zenavif_parse::AvifParser::from_bytes(&bytes).unwrap();
if let Some(Ok(dm)) = parser.depth_map() {
println!("Depth map: {}x{}, {} bytes AV1 data", dm.width, dm.height, dm.data.len());
}Fields§
§data: Vec<u8>Raw AV1 bitstream of the depth auxiliary image. Decode with an AV1 decoder to obtain grayscale depth pixel values.
width: u32Width of the depth image in pixels (from ispe property).
height: u32Height of the depth image in pixels (from ispe property).
av1_config: Option<AV1Config>AV1 codec configuration for the depth item (from av1C property).
color_info: Option<ColorInformation>Color information for the depth item (from colr property), if present.
Trait Implementations§
Source§impl Clone for AvifDepthMap
impl Clone for AvifDepthMap
Source§fn clone(&self) -> AvifDepthMap
fn clone(&self) -> AvifDepthMap
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more