pub trait SceneSource {
// Required methods
fn format(&self) -> SourceFormat;
fn pull(&mut self) -> Result<Option<RenderedFrame>>;
}Expand description
Pull-based source of rendered frames.
Implementors typically wrap a Scene + SceneRenderer and
advance an internal frame counter per pull(). The first call
after prepare emits frame 0 at timestamp 0; each subsequent
call advances by 1 / framerate.
Sources are not required to be seekable — a streaming compositor source is forward-only. Sources that can seek should expose it via an inherent method, not this trait.
Required Methods§
Sourcefn format(&self) -> SourceFormat
fn format(&self) -> SourceFormat
Declared format. Constant across a session.
Sourcefn pull(&mut self) -> Result<Option<RenderedFrame>>
fn pull(&mut self) -> Result<Option<RenderedFrame>>
Produce the next rendered tick. Returns Ok(None) when the
source is exhausted (finite scene reached its end). For
indefinite sources, this never returns None.