pub struct ApngDecoder;Expand description
APNG decoder — parses an APNG byte stream and reconstructs ApngFrames.
Implementations§
Source§impl ApngDecoder
impl ApngDecoder
Sourcepub fn decode(data: &[u8]) -> Result<(Vec<ApngFrame>, ApngConfig), CodecError>
pub fn decode(data: &[u8]) -> Result<(Vec<ApngFrame>, ApngConfig), CodecError>
Decode a raw APNG byte stream.
Returns the list of frames (with decompressed RGBA pixels) and the
global ApngConfig.
§Errors
Returns CodecError if the PNG signature is missing, any chunk is
truncated, or pixel decompression fails.
Sourcepub fn frame_count(data: &[u8]) -> Result<u32, CodecError>
pub fn frame_count(data: &[u8]) -> Result<u32, CodecError>
Quick probe: returns the number of frames declared in the acTL chunk.
Does not decompress pixel data.
§Errors
Returns CodecError if the PNG signature is invalid or the file is
truncated.
Auto Trait Implementations§
impl Freeze for ApngDecoder
impl RefUnwindSafe for ApngDecoder
impl Send for ApngDecoder
impl Sync for ApngDecoder
impl Unpin for ApngDecoder
impl UnsafeUnpin for ApngDecoder
impl UnwindSafe for ApngDecoder
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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