Skip to main content

DynAnimationFrameDecoder

Trait DynAnimationFrameDecoder 

Source
pub trait DynAnimationFrameDecoder: Send {
    // Required methods
    fn as_any(&self) -> &dyn Any;
    fn as_any_mut(&mut self) -> &mut dyn Any;
    fn into_any(self: Box<Self>) -> Box<dyn Any>;
    fn info(&self) -> &ImageInfo;
    fn frame_count(&self) -> Option<u32>;
    fn loop_count(&self) -> Option<u32>;
    fn render_next_frame_owned(
        &mut self,
        stop: Option<&dyn Stop>,
    ) -> Result<Option<OwnedAnimationFrame>, BoxedError>;
    fn render_next_frame_to_sink(
        &mut self,
        stop: Option<&dyn Stop>,
        sink: &mut dyn DecodeRowSink,
    ) -> Result<Option<OutputInfo>, BoxedError>;
}
Expand description

Object-safe full-frame animation decoder.

Wraps AnimationFrameDecoder for dyn dispatch. Produced by DynDecodeJob::into_animation_frame_decoder.

§Downcasting

Use as_any() to downcast back to the concrete codec type for format-specific animation controls.

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Downcast to the concrete frame decoder type.

Source

fn as_any_mut(&mut self) -> &mut dyn Any

Downcast to the concrete frame decoder type (mutable).

Source

fn into_any(self: Box<Self>) -> Box<dyn Any>

Consume and downcast to the concrete frame decoder type.

Source

fn info(&self) -> &ImageInfo

Image metadata, available after construction.

Source

fn frame_count(&self) -> Option<u32>

Number of frames, if known without decoding.

Source

fn loop_count(&self) -> Option<u32>

Animation loop count from the container.

Source

fn render_next_frame_owned( &mut self, stop: Option<&dyn Stop>, ) -> Result<Option<OwnedAnimationFrame>, BoxedError>

Render the next frame as an owned copy.

Source

fn render_next_frame_to_sink( &mut self, stop: Option<&dyn Stop>, sink: &mut dyn DecodeRowSink, ) -> Result<Option<OutputInfo>, BoxedError>

Render the next frame directly into a caller-owned sink.

Trait Implementations§

Source§

impl Debug for dyn DynAnimationFrameDecoder + '_

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Implementors§