Skip to main content

PreviewAdapter

Struct PreviewAdapter 

Source
pub struct PreviewAdapter { /* private fields */ }
Expand description

An Engine plus a renderer, as seen by the preview session.

Implementations§

Source§

impl PreviewAdapter

Source

pub fn new(engine: Engine, renderer: Box<dyn Renderer>) -> Self

Wraps an engine; frames are drawn with renderer.

Trait Implementations§

Source§

impl FrameSource for PreviewAdapter

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).
Source§

impl PreviewEngine for PreviewAdapter

Source§

fn engine_version(&self) -> String

Version string sent in Ready.
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 edit(&mut self, edit: MetaEdit) -> Result<Vec<(String, Meta)>, String>

Applies an edit, re-simulates, persists the meta; returns changed metas as (scene, meta). Read more
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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V