Skip to main content

FrameReader

Trait FrameReader 

Source
pub trait FrameReader {
    // Required methods
    fn info(&self) -> ImageInfo;
    fn next_frame(&mut self) -> Decoding<'_, Result<DecodedFrame, DecodeError>>;
}
Expand description

FrameReader is one opened image, yielding complete composited frames in order.

Animation composition — disposal, blending, partial frames — is the reader’s job; every frame it returns is a full picture. Readers are used from one thread and dropped there.

Required Methods§

Source

fn info(&self) -> ImageInfo

info is the output size after DecodeOptions::max_size, the frame count and how the animation repeats. It is fixed at open and every frame must match it.

Source

fn next_frame(&mut self) -> Decoding<'_, Result<DecodedFrame, DecodeError>>

next_frame decodes the next frame, wrapping to the first after the last.

One frame is decoded at a time: a reader is asked again only once the answer it gave has been waited for.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§