Skip to main content

SceneSampler

Trait SceneSampler 

Source
pub trait SceneSampler {
    // Required methods
    fn sample(&mut self, t: TimeStamp) -> Result<Option<SampleOutput>>;
    fn natural_size(&self) -> (f32, f32);
}
Expand description

Per-object sampler — one instance per SceneObject. Implementations hold the object’s decoder / glyph cache / bitmap handle and emit the concrete pixel contribution for a given timestamp. Plug into a SceneRenderer by registering a factory keyed on the object’s ObjectKind discriminant.

Required Methods§

Source

fn sample(&mut self, t: TimeStamp) -> Result<Option<SampleOutput>>

Sample at time t. Returns None if the object has nothing to emit at this timestamp (e.g. a Video object whose next keyframe is still in the future).

Source

fn natural_size(&self) -> (f32, f32)

Natural size of the object before Transform is applied. Used for aspect-ratio-preserving layout in groups.

Implementors§