Skip to main content

FrameSource

Trait FrameSource 

Source
pub trait FrameSource {
    // Required methods
    fn fps(&self) -> u32;
    fn size(&self) -> (u32, u32);
    fn total_frames(&self) -> u32;
    fn render(&mut self, frame: u32, size: (u32, u32)) -> Image;
}
Expand description

A timeline that can draw any of its frames: “give me frame n”.

Frames are addressed by index (time n / fps) so that every caller gets exactly the same pixels for the same frame, in any order.

Required Methods§

Source

fn fps(&self) -> u32

Frames per second.

Source

fn size(&self) -> (u32, u32)

Native size in pixels.

Source

fn total_frames(&self) -> u32

Length in frames.

Source

fn render(&mut self, frame: u32, size: (u32, u32)) -> Image

Draws frame at size pixels (scaled to fit and centered).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§