pub enum Interpolation {
Hold,
Linear,
CubicBezier(CubicBezier),
ValueBezier(ValueBezier),
Steps(Steps),
Points {
points: Vec<EasingPoint>,
},
}Expand description
Interpolation from one keyframe to the next.
Values interpolate numerically: a rotation from 0 to 720 degrees turns twice. A host that wants the shortest path normalizes its keyframe values.
Variants§
Hold
Keep this keyframe’s value until the next keyframe.
Linear
Move to the next value at a constant rate.
CubicBezier(CubicBezier)
Move to the next value along a CSS cubic-bezier() timing curve.
ValueBezier(ValueBezier)
Move to the next value along a value curve, which can move between equal values. Numbers
only: an animated number, or an effect parameter between float keyframes.
Steps(Steps)
Move to the next value in equal steps, as CSS steps(). A step starts on the first tick
at or after its exact time.
Points
Move to the next value along straight lines through a table of points, as CSS
linear(): from (0, 0) through each point to (1, 1).
Fields
points: Vec<EasingPoint>The points between the two ends, rising strictly in x; at most
crate::MAX_EASING_POINTS.
Implementations§
Source§impl Interpolation
impl Interpolation
Sourcepub fn shape(&self, progress: f64) -> SegmentShape
pub fn shape(&self, progress: f64) -> SegmentShape
What the segment does at linear progress (clamped to 0..=1 for an amount). The
keyframe sampler places steps by whole ticks instead (Steps::index).