Trait libre_pvz_animation::curve::Curve

source ·
pub trait Curve: Send + Sync + 'static {
    type Component: 'static;

    // Required methods
    fn frame_count(&self) -> usize;
    fn apply_sampled(
        &self,
        segment: Segment,
        frame: f32,
        blending: Option<(BlendMethod, f32)>,
        output: impl AnyComponent<Self::Component>
    ) -> Result<(), String>;
}
Expand description

Animation curve.

Required Associated Types§

source

type Component: 'static

Target component.

Required Methods§

source

fn frame_count(&self) -> usize

Duration of this curve, in number of frames.

Note: This does not necessarily mean there are exactly this many frames stored in this animation. It merely serves to indicate the maximum frame index for sampling. See also Curve::apply_sampled and TypedCurve::sample.

source

fn apply_sampled( &self, segment: Segment, frame: f32, blending: Option<(BlendMethod, f32)>, output: impl AnyComponent<Self::Component> ) -> Result<(), String>

Apply the sampled value to the target component as the result.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<S, F, C> Curve for KeyframeCurve<S, F, C>
where S: 'static, C: CurveContent<Keyframe = F::View>, F::View: PartialEq + Animatable + Sized + Send + Sync + 'static, F: Send + Sync + 'static + for<'a> AffineFoldRef<'a, S, Error = String> + for<'a> AffineFoldMut<'a, S, Error = String>,

§

type Component = S