Skip to main content

FrameProvider

Trait FrameProvider 

Source
pub trait FrameProvider: Send + Sync {
    // Required method
    fn next_frame(&mut self) -> Option<FrameData>;

    // Provided method
    fn is_animating(&self) -> bool { ... }
}
Expand description

Trait for dynamic frame sources (video decoders, canvas renderers, procedural generators, etc.).

Implementations supply RGBA8 frames to a DynamicImageOverlayLayer. The engine polls next_frame once per frame while the layer is visible and is_animating returns true.

Required Methods§

Source

fn next_frame(&mut self) -> Option<FrameData>

Poll for the next frame.

Return Some(FrameData) when new pixel data is available, or None to keep the previous frame.

Provided Methods§

Source

fn is_animating(&self) -> bool

Whether this source is currently animating.

When false, the engine skips polling next_frame until the flag changes. Defaults to true.

Implementors§