Trait nannou_timeline::track::automation::toggle::EnvelopeTrait [−][src]
pub trait EnvelopeTrait<'a> {
type X: PartialEq<Self::X> + PartialOrd<Self::X> + Clone;
type Y: PartialEq<Self::Y> + Spatial;
type Point: 'a + Point;
type Points: 'a + Iterator + ExactSizeIterator + DoubleEndedIterator + Clone;
Show 19 methods
fn points(&'a self) -> Self::Points;
fn point_idx_before(&'a self, x: Self::X) -> Option<usize> { ... }
fn point_idx_on_or_before(&'a self, x: Self::X) -> Option<usize> { ... }
fn point_idx_after(&'a self, x: Self::X) -> Option<usize> { ... }
fn point_idx_on_or_after(&'a self, x: Self::X) -> Option<usize> { ... }
fn point_before(&'a self, x: Self::X) -> Option<&'a Self::Point> { ... }
fn point_on_or_before(&'a self, x: Self::X) -> Option<&'a Self::Point> { ... }
fn point_before_with_idx(
&'a self,
x: Self::X
) -> Option<(usize, &'a Self::Point)> { ... }
fn point_on_or_before_with_idx(
&'a self,
x: Self::X
) -> Option<(usize, &'a Self::Point)> { ... }
fn point_after(&'a self, x: Self::X) -> Option<&'a Self::Point> { ... }
fn point_on_or_after(&'a self, x: Self::X) -> Option<&'a Self::Point> { ... }
fn point_after_with_idx(
&'a self,
x: Self::X
) -> Option<(usize, &'a Self::Point)> { ... }
fn point_on_or_after_with_idx(
&'a self,
x: Self::X
) -> Option<(usize, &'a Self::Point)> { ... }
fn point_at(&'a self, x: Self::X) -> Option<&'a Self::Point> { ... }
fn point_at_with_idx(
&'a self,
x: Self::X
) -> Option<(usize, &'a Self::Point)> { ... }
fn surrounding_points(
&'a self,
x: Self::X
) -> (Option<&'a Self::Point>, Option<&'a Self::Point>) { ... }
fn closest_point(&'a self, x: Self::X) -> Option<&'a Self::Point>
where
Self::X: Sub<Self::X>,
<Self::X as Sub<Self::X>>::Output == Self::X,
{ ... }
fn y(&'a self, x: Self::X) -> Option<Self::Y>
where
<Self::Y as Spatial>::Scalar: Scalar,
{ ... }
fn steps(&'a self, start: Self::X, step: Self::X) -> Option<Steps<'a, Self>> { ... }
}
Expand description
Types that are representable as an Envelope.
Associated Types
type Points: 'a + Iterator + ExactSizeIterator + DoubleEndedIterator + Clone
type Points: 'a + Iterator + ExactSizeIterator + DoubleEndedIterator + Clone
An iterator yielding references to Self::Point
s.
Required methods
Provided methods
fn point_idx_before(&'a self, x: Self::X) -> Option<usize>
fn point_idx_before(&'a self, x: Self::X) -> Option<usize>
The index of the Point
that comes directly before the given x
.
fn point_idx_on_or_before(&'a self, x: Self::X) -> Option<usize>
fn point_idx_on_or_before(&'a self, x: Self::X) -> Option<usize>
The index of the Point
that either lands on or comes directly before the given x
.
fn point_idx_after(&'a self, x: Self::X) -> Option<usize>
fn point_idx_after(&'a self, x: Self::X) -> Option<usize>
The index of the Point
that comes directly after the given x
.
fn point_idx_on_or_after(&'a self, x: Self::X) -> Option<usize>
fn point_idx_on_or_after(&'a self, x: Self::X) -> Option<usize>
The index of the Point
that comes directly after the given x
.
fn point_before(&'a self, x: Self::X) -> Option<&'a Self::Point>
fn point_before(&'a self, x: Self::X) -> Option<&'a Self::Point>
A reference to the first point that comes before the given x
.
fn point_on_or_before(&'a self, x: Self::X) -> Option<&'a Self::Point>
fn point_on_or_before(&'a self, x: Self::X) -> Option<&'a Self::Point>
A reference to the first point that is equal to or comes before the given x
.
A reference to the first point that comes before the given x
along with its index.
A reference to the first point that is equal to or comes before the given x
along with
its index.
fn point_after(&'a self, x: Self::X) -> Option<&'a Self::Point>
fn point_after(&'a self, x: Self::X) -> Option<&'a Self::Point>
A reference to the first point that comes after the given x
.
fn point_on_or_after(&'a self, x: Self::X) -> Option<&'a Self::Point>
fn point_on_or_after(&'a self, x: Self::X) -> Option<&'a Self::Point>
A reference to the first point that is equal to or comes after the given x
.
A reference to the first point that comes after the given x
along with its index.
A reference to the first point that is equal to or comes after the given x
along with
its index.
A reference to the first point lying directly on the given x
if there is one.
A reference to the first point (along with it’s index) lying directly on the given x
if
there is one.
The points that lie on either side of the given x
.
FIXME: This could be much faster.
A reference point that is closest to the given x
if there is one.
FIXME: This could be much faster.
Return y
for the given x
.
If there is less than two points interpolation is not meaningful, thus we should just return None.
Note: It is assumed that the points owned by the Envelope are sorted by x
.
Sample the Envelope
’s y
value for every given positive x
step starting from the first
point’s X
value.
The envelope will yield Some(Y)
until the first step is out of range of all points on the
y axis.
Returns None
if start
is outside the bounds of all points.
Note: This method assumes that the envelope points are ordered.