pub struct WebpImage {
pub width: u32,
pub height: u32,
pub frames: Vec<WebpFrame>,
pub metadata: WebpFileMetadata,
pub anim_background_rgba: Option<[u8; 4]>,
pub anim_loop_count: Option<u16>,
}Expand description
A fully decoded WebP file: one frame for a still image, N frames for an animation, plus the file-level metadata and animation parameters.
This is the published-API decode result. The single most important
consumer property is the flat-buffer shape of each WebpFrame::rgba:
width * height * 4 tightly packed [R, G, B, A] bytes, no per-row
stride padding, so it drops straight into
image::ImageBuffer::from_raw(width, height, rgba).
Fields§
§width: u32Canvas width in pixels (the §2.7.1 VP8X canvas width for an
extended file, or the §3.4 / RFC 6386 §9.1 image-header width
for a simple-lossless / simple-lossy file). Matches the first
frame’s width for a single-frame image.
height: u32Canvas height in pixels — see Self::width for the spec
citation.
frames: Vec<WebpFrame>Decoded frames. A still image yields exactly one frame; an
animation yields one per ANMF chunk (animation decode is not
rebuilt yet — see decode_webp).
metadata: WebpFileMetadataFile-level metadata (ICC / Exif / XMP), each None when absent.
anim_background_rgba: Option<[u8; 4]>The §2.7.1.1 ANIM background colour as [R, G, B, A], or None
for a non-animated file.
anim_loop_count: Option<u16>The §2.7.1.1 ANIM loop count (0 = loop forever), or None for
a non-animated file.