pub enum Curve {
Builtin(BuiltinEasing),
Keyframe(KeyframeCurve),
}Expand description
The public curve type used inside every crate::IconAnimationSpec.
It combines the two variants under one enum so specs can be cloned and stored without dynamic dispatch on the hot path.
Variants§
Builtin(BuiltinEasing)
Keyframe(KeyframeCurve)
Implementations§
Source§impl Curve
impl Curve
pub fn linear() -> Self
pub fn ease_in() -> Self
pub fn ease_out() -> Self
pub fn ease_in_out() -> Self
pub fn quad_in() -> Self
pub fn quad_out() -> Self
pub fn quad_in_out() -> Self
pub fn cubic_in() -> Self
pub fn cubic_out() -> Self
pub fn cubic_in_out() -> Self
pub fn sine_in() -> Self
pub fn sine_out() -> Self
pub fn sine_in_out() -> Self
Sourcepub fn cubic_bezier(
c1x: f32,
c1y: f32,
c2x: f32,
c2y: f32,
) -> Result<Self, CurveError>
pub fn cubic_bezier( c1x: f32, c1y: f32, c2x: f32, c2y: f32, ) -> Result<Self, CurveError>
Parametric cubic Bézier easing. c1x and c2x must lie in [0, 1].
pub fn keyframes( keys: Vec<Keyframe>, interp: KeyframeInterp, ) -> Result<Self, CurveError>
pub fn from_curve_fn<F>( f: F, samples: u32, interp: KeyframeInterp, ) -> Result<Self, CurveError>
pub fn from_motion_fn<F>( f: F, ctx: &MotionContext, samples: u32, interp: KeyframeInterp, ) -> Result<Self, CurveError>
Trait Implementations§
impl StructuralPartialEq for Curve
Auto Trait Implementations§
impl Freeze for Curve
impl RefUnwindSafe for Curve
impl Send for Curve
impl Sync for Curve
impl Unpin for Curve
impl UnsafeUnpin for Curve
impl UnwindSafe for Curve
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more