pub struct IncrementalDecoder { /* private fields */ }Expand description
A push-based decoder for any still WebP or animation.
Dispatches on the container kind: lossless stills and all animations stream
through [crate::lossless], a bare lossy VP8 still row-streams through [crate::lossy],
and an extended lossy still (which may carry ALPH alpha) is buffered and
finished with a one-shot decode. The pixels and error semantics match
decode exactly; the only new streaming capability over the
lossless/animation paths is the bare lossy still. Read-free, so it works on
no_std + alloc.
Implementations§
Source§impl IncrementalDecoder
impl IncrementalDecoder
Sourcepub const fn with_options(options: DecodeOptions) -> Self
pub const fn with_options(options: DecodeOptions) -> Self
A new decoder with the given options (output layout, per-image pixel limit).
Sourcepub fn frame_image(&self) -> Option<&Image>
pub fn frame_image(&self) -> Option<&Image>
The most-recently composited animation frame, or None for a still image.
Mirrors the underlying decoder’s frame_image.
Sourcepub fn drain_rows(&mut self) -> Option<RowDrain<'_>>
pub fn drain_rows(&mut self) -> Option<RowDrain<'_>>
Borrow the finalized-but-not-yet-viewed rows of a streamed still image (a
non-consuming early view). None unless a row-streaming back end is active
(a lossless or bare-lossy still); the deferred and animation paths yield no
rows.
Sourcepub fn into_image(self) -> Result<Image>
pub fn into_image(self) -> Result<Image>
Retrieve the complete decoded image (an animation’s first composited frame)
once Progress::Finished has been reported.
§Errors
The same errors as decode when the buffer is not a fully-decoded image.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IncrementalDecoder
impl RefUnwindSafe for IncrementalDecoder
impl Send for IncrementalDecoder
impl Sync for IncrementalDecoder
impl Unpin for IncrementalDecoder
impl UnsafeUnpin for IncrementalDecoder
impl UnwindSafe for IncrementalDecoder
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> 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