Skip to main content

PreviewEngine

Trait PreviewEngine 

Source
pub trait PreviewEngine {
Show 13 methods // Required methods fn engine_version(&self) -> String; fn fps(&self) -> u32; fn size(&self) -> (u32, u32); fn total_frames(&self) -> u32; fn scenes(&self) -> Vec<SceneInfo>; fn markers(&self) -> Vec<MarkerInfo>; fn metas(&self) -> Vec<(String, Meta)>; fn render(&mut self, frame: u32, size: (u32, u32)) -> Image; fn edit(&mut self, edit: MetaEdit) -> Result<Vec<(String, Meta)>, String>; fn pick(&mut self, frame: u32, x: f64, y: f64) -> Option<u32>; fn tree(&mut self, frame: u32) -> Vec<NodeInfo>; fn inspect( &mut self, frame: u32, node: u32, ) -> Option<(Vec<SignalValue>, [f64; 8])>; fn waveform(&mut self, buckets: usize) -> Option<Vec<f32>>;
}
Expand description

What the preview needs from an engine. Implemented by oxframe::Engine.

Required Methods§

Source

fn engine_version(&self) -> String

Version string sent in Ready.

Source

fn fps(&self) -> u32

Frames per second.

Source

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

Project size in pixels.

Source

fn total_frames(&self) -> u32

Project length in frames.

Source

fn scenes(&self) -> Vec<SceneInfo>

Scenes with their first frame and length.

Source

fn markers(&self) -> Vec<MarkerInfo>

Markers of all scenes.

Source

fn metas(&self) -> Vec<(String, Meta)>

Meta of every scene (sent on Ready so the editor knows eases and tunables).

Source

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

Draws frame at size pixels.

Source

fn edit(&mut self, edit: MetaEdit) -> Result<Vec<(String, Meta)>, String>

Applies an edit, re-simulates, persists the meta; returns changed metas as (scene, meta).

§Errors

A message for the editor if the edit is invalid or saving failed.

Source

fn pick(&mut self, frame: u32, x: f64, y: f64) -> Option<u32>

Hit-test at frame pixels (top-left origin, project size).

Source

fn tree(&mut self, frame: u32) -> Vec<NodeInfo>

Node tree of the scene at frame.

Source

fn inspect( &mut self, frame: u32, node: u32, ) -> Option<(Vec<SignalValue>, [f64; 8])>

Signal values and selection box (frame pixels) of a node.

Source

fn waveform(&mut self, buckets: usize) -> Option<Vec<f32>>

Audio peak envelope for the timeline, if the project has audio.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§