pub struct WebPContainer {
pub encoding: WebPEncoding,
pub features: Option<Vp8xFeatures>,
pub chunks: Vec<RiffChunk>,
}Expand description
A fully parsed WebP RIFF container.
Fields§
§encoding: WebPEncodingThe encoding type (lossy, lossless, or extended).
features: Option<Vp8xFeatures>VP8X feature flags, present only for extended format.
chunks: Vec<RiffChunk>All chunks in the container, in order.
Implementations§
Source§impl WebPContainer
impl WebPContainer
Sourcepub fn parse(data: &[u8]) -> CodecResult<Self>
pub fn parse(data: &[u8]) -> CodecResult<Self>
Parse a WebP file from a byte slice.
Validates the RIFF header and iterates through all chunks.
Sourcepub fn bitstream_chunk(&self) -> Option<&RiffChunk>
pub fn bitstream_chunk(&self) -> Option<&RiffChunk>
Find the VP8 or VP8L bitstream chunk.
For simple files, this is the first (and only) chunk. For extended files, this searches for the first VP8/VP8L chunk.
Sourcepub fn alpha_chunk(&self) -> Option<&RiffChunk>
pub fn alpha_chunk(&self) -> Option<&RiffChunk>
Find the alpha chunk (ALPH), if present.
Sourcepub fn exif_chunk(&self) -> Option<&RiffChunk>
pub fn exif_chunk(&self) -> Option<&RiffChunk>
Find the EXIF metadata chunk, if present.
Sourcepub fn anim_chunk(&self) -> Option<&RiffChunk>
pub fn anim_chunk(&self) -> Option<&RiffChunk>
Find the animation parameters chunk, if present.
Sourcepub fn animation_frames(&self) -> Vec<&RiffChunk>
pub fn animation_frames(&self) -> Vec<&RiffChunk>
Collect all animation frame chunks.
Sourcepub fn dimensions(&self) -> CodecResult<(u32, u32)>
pub fn dimensions(&self) -> CodecResult<(u32, u32)>
Get canvas dimensions.
For VP8X extended format, uses the canvas size from the header. For simple lossy, parses the VP8 frame header. For simple lossless, parses the VP8L signature header.
Trait Implementations§
Source§impl Clone for WebPContainer
impl Clone for WebPContainer
Source§fn clone(&self) -> WebPContainer
fn clone(&self) -> WebPContainer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for WebPContainer
impl RefUnwindSafe for WebPContainer
impl Send for WebPContainer
impl Sync for WebPContainer
impl Unpin for WebPContainer
impl UnsafeUnpin for WebPContainer
impl UnwindSafe for WebPContainer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more