pub enum AnimatedData {
Show 14 variants
Boolean(TimeDataMap<Boolean>),
Integer(TimeDataMap<Integer>),
Real(TimeDataMap<Real>),
String(TimeDataMap<String>),
Color(TimeDataMap<Color>),
Vector2(TimeDataMap<Vector2>),
Matrix3(TimeDataMap<Matrix3>),
BooleanVec(TimeDataMap<BooleanVec>),
IntegerVec(TimeDataMap<IntegerVec>),
RealVec(TimeDataMap<RealVec>),
ColorVec(TimeDataMap<ColorVec>),
StringVec(TimeDataMap<StringVec>),
Vector2Vec(TimeDataMap<Vector2Vec>),
Matrix3Vec(TimeDataMap<Matrix3Vec>),
}Expand description
Time-indexed data with interpolation support.
AnimatedData enum stores a collection of time-value pairs for a
specific data type and provides interpolation between keyframes. Each
variant contains a TimeDataMap for the corresponding data type.
Variants§
Boolean(TimeDataMap<Boolean>)
Animated boolean values.
Integer(TimeDataMap<Integer>)
Animated integer values.
Real(TimeDataMap<Real>)
Animated real values.
String(TimeDataMap<String>)
Animated string values.
Color(TimeDataMap<Color>)
Animated color values.
Vector2(TimeDataMap<Vector2>)
Animated 2D vectors.
Matrix3(TimeDataMap<Matrix3>)
Animated transformation matrices.
BooleanVec(TimeDataMap<BooleanVec>)
Animated boolean vectors.
IntegerVec(TimeDataMap<IntegerVec>)
Animated integer vectors.
RealVec(TimeDataMap<RealVec>)
Animated real vectors.
ColorVec(TimeDataMap<ColorVec>)
Animated color vectors.
StringVec(TimeDataMap<StringVec>)
Animated string vectors.
Vector2Vec(TimeDataMap<Vector2Vec>)
Animated 2D vector arrays.
Matrix3Vec(TimeDataMap<Matrix3Vec>)
Animated matrix arrays.
Implementations§
Source§impl AnimatedData
impl AnimatedData
Source§impl AnimatedData
impl AnimatedData
pub fn insert_boolean(&mut self, time: Time, value: Boolean) -> Result<()>
pub fn insert_integer(&mut self, time: Time, value: Integer) -> Result<()>
pub fn insert_real(&mut self, time: Time, value: Real) -> Result<()>
pub fn insert_string(&mut self, time: Time, value: String) -> Result<()>
pub fn insert_color(&mut self, time: Time, value: Color) -> Result<()>
Source§impl AnimatedData
impl AnimatedData
Source§impl AnimatedData
impl AnimatedData
Source§impl AnimatedData
impl AnimatedData
Sourcepub fn try_insert(&mut self, time: Time, value: Data) -> Result<()>
pub fn try_insert(&mut self, time: Time, value: Data) -> Result<()>
Generic insert method that takes Data and matches the type to the
AnimatedData variant.
Sourcepub fn remove_at(&mut self, time: &Time) -> Option<Data>
pub fn remove_at(&mut self, time: &Time) -> Option<Data>
Remove a sample at the given time.
Returns the removed value as Data if it existed.
pub fn sample_at(&self, time: Time) -> Option<Data>
pub fn interpolate(&self, time: Time) -> Data
Source§impl AnimatedData
impl AnimatedData
Sourcepub fn hash_with_shutter<H: Hasher>(&self, state: &mut H, shutter: &Shutter)
pub fn hash_with_shutter<H: Hasher>(&self, state: &mut H, shutter: &Shutter)
Hash the animated data with shutter context for better cache coherency.
Samples the animation at standardized points within the shutter range and hashes the interpolated values. If all samples are identical, only one value is hashed for efficiency.
Trait Implementations§
Source§impl AnimatedDataOps for AnimatedData
impl AnimatedDataOps for AnimatedData
Source§impl Clone for AnimatedData
impl Clone for AnimatedData
Source§fn clone(&self) -> AnimatedData
fn clone(&self) -> AnimatedData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl DataTypeOps for AnimatedData
impl DataTypeOps for AnimatedData
Source§impl Debug for AnimatedData
impl Debug for AnimatedData
Source§impl From<TimeDataMap<Boolean>> for AnimatedData
impl From<TimeDataMap<Boolean>> for AnimatedData
Source§fn from(v: TimeDataMap<Boolean>) -> AnimatedData
fn from(v: TimeDataMap<Boolean>) -> AnimatedData
Source§impl From<TimeDataMap<BooleanVec>> for AnimatedData
impl From<TimeDataMap<BooleanVec>> for AnimatedData
Source§fn from(v: TimeDataMap<BooleanVec>) -> AnimatedData
fn from(v: TimeDataMap<BooleanVec>) -> AnimatedData
Source§impl From<TimeDataMap<Color>> for AnimatedData
impl From<TimeDataMap<Color>> for AnimatedData
Source§fn from(v: TimeDataMap<Color>) -> AnimatedData
fn from(v: TimeDataMap<Color>) -> AnimatedData
Source§impl From<TimeDataMap<ColorVec>> for AnimatedData
impl From<TimeDataMap<ColorVec>> for AnimatedData
Source§fn from(v: TimeDataMap<ColorVec>) -> AnimatedData
fn from(v: TimeDataMap<ColorVec>) -> AnimatedData
Source§impl From<TimeDataMap<Integer>> for AnimatedData
impl From<TimeDataMap<Integer>> for AnimatedData
Source§fn from(v: TimeDataMap<Integer>) -> AnimatedData
fn from(v: TimeDataMap<Integer>) -> AnimatedData
Source§impl From<TimeDataMap<IntegerVec>> for AnimatedData
impl From<TimeDataMap<IntegerVec>> for AnimatedData
Source§fn from(v: TimeDataMap<IntegerVec>) -> AnimatedData
fn from(v: TimeDataMap<IntegerVec>) -> AnimatedData
Source§impl From<TimeDataMap<Matrix3>> for AnimatedData
Available on crate feature matrix3 only.
impl From<TimeDataMap<Matrix3>> for AnimatedData
matrix3 only.Source§fn from(v: TimeDataMap<Matrix3>) -> AnimatedData
fn from(v: TimeDataMap<Matrix3>) -> AnimatedData
Source§impl From<TimeDataMap<Matrix3Vec>> for AnimatedData
Available on crate features matrix3 and vec_variants only.
impl From<TimeDataMap<Matrix3Vec>> for AnimatedData
matrix3 and vec_variants only.Source§fn from(v: TimeDataMap<Matrix3Vec>) -> AnimatedData
fn from(v: TimeDataMap<Matrix3Vec>) -> AnimatedData
Source§impl From<TimeDataMap<Real>> for AnimatedData
impl From<TimeDataMap<Real>> for AnimatedData
Source§fn from(v: TimeDataMap<Real>) -> AnimatedData
fn from(v: TimeDataMap<Real>) -> AnimatedData
Source§impl From<TimeDataMap<RealVec>> for AnimatedData
impl From<TimeDataMap<RealVec>> for AnimatedData
Source§fn from(v: TimeDataMap<RealVec>) -> AnimatedData
fn from(v: TimeDataMap<RealVec>) -> AnimatedData
Source§impl From<TimeDataMap<String>> for AnimatedData
impl From<TimeDataMap<String>> for AnimatedData
Source§fn from(v: TimeDataMap<String>) -> AnimatedData
fn from(v: TimeDataMap<String>) -> AnimatedData
Source§impl From<TimeDataMap<StringVec>> for AnimatedData
impl From<TimeDataMap<StringVec>> for AnimatedData
Source§fn from(v: TimeDataMap<StringVec>) -> AnimatedData
fn from(v: TimeDataMap<StringVec>) -> AnimatedData
Source§impl From<TimeDataMap<Vector2>> for AnimatedData
Available on crate feature vector2 only.
impl From<TimeDataMap<Vector2>> for AnimatedData
vector2 only.Source§fn from(v: TimeDataMap<Vector2>) -> AnimatedData
fn from(v: TimeDataMap<Vector2>) -> AnimatedData
Source§impl From<TimeDataMap<Vector2Vec>> for AnimatedData
Available on crate features vector2 and vec_variants only.
impl From<TimeDataMap<Vector2Vec>> for AnimatedData
vector2 and vec_variants only.Source§fn from(v: TimeDataMap<Vector2Vec>) -> AnimatedData
fn from(v: TimeDataMap<Vector2Vec>) -> AnimatedData
Source§impl Hash for AnimatedData
impl Hash for AnimatedData
Source§impl PartialEq for AnimatedData
impl PartialEq for AnimatedData
Source§impl Sample<Color> for AnimatedData
impl Sample<Color> for AnimatedData
Source§fn sample(
&self,
shutter: &Shutter,
samples: NonZeroU16,
) -> Result<Vec<(Color, SampleWeight)>>
fn sample( &self, shutter: &Shutter, samples: NonZeroU16, ) -> Result<Vec<(Color, SampleWeight)>>
Source§impl Sample<Integer> for AnimatedData
impl Sample<Integer> for AnimatedData
Source§fn sample(
&self,
shutter: &Shutter,
samples: NonZeroU16,
) -> Result<Vec<(Integer, SampleWeight)>>
fn sample( &self, shutter: &Shutter, samples: NonZeroU16, ) -> Result<Vec<(Integer, SampleWeight)>>
Source§impl Sample<Matrix3> for AnimatedData
Available on crate feature matrix3 only.
impl Sample<Matrix3> for AnimatedData
matrix3 only.Source§fn sample(
&self,
shutter: &Shutter,
samples: NonZeroU16,
) -> Result<Vec<(Matrix3, SampleWeight)>>
fn sample( &self, shutter: &Shutter, samples: NonZeroU16, ) -> Result<Vec<(Matrix3, SampleWeight)>>
Source§impl Sample<Real> for AnimatedData
impl Sample<Real> for AnimatedData
Source§fn sample(
&self,
shutter: &Shutter,
samples: NonZeroU16,
) -> Result<Vec<(Real, SampleWeight)>>
fn sample( &self, shutter: &Shutter, samples: NonZeroU16, ) -> Result<Vec<(Real, SampleWeight)>>
Source§impl Sample<Vector2> for AnimatedData
Available on crate feature vector2 only.
impl Sample<Vector2> for AnimatedData
vector2 only.Source§fn sample(
&self,
shutter: &Shutter,
samples: NonZeroU16,
) -> Result<Vec<(Vector2, SampleWeight)>>
fn sample( &self, shutter: &Shutter, samples: NonZeroU16, ) -> Result<Vec<(Vector2, SampleWeight)>>
Source§impl TryInto<TimeDataMap<Boolean>> for AnimatedData
impl TryInto<TimeDataMap<Boolean>> for AnimatedData
Source§impl TryInto<TimeDataMap<BooleanVec>> for AnimatedData
impl TryInto<TimeDataMap<BooleanVec>> for AnimatedData
Source§fn try_into(
self,
) -> Result<TimeDataMap<BooleanVec>, <Self as TryInto<TimeDataMap<BooleanVec>>>::Error>
fn try_into( self, ) -> Result<TimeDataMap<BooleanVec>, <Self as TryInto<TimeDataMap<BooleanVec>>>::Error>
Source§impl TryInto<TimeDataMap<Color>> for AnimatedData
impl TryInto<TimeDataMap<Color>> for AnimatedData
Source§impl TryInto<TimeDataMap<ColorVec>> for AnimatedData
impl TryInto<TimeDataMap<ColorVec>> for AnimatedData
Source§impl TryInto<TimeDataMap<Integer>> for AnimatedData
impl TryInto<TimeDataMap<Integer>> for AnimatedData
Source§impl TryInto<TimeDataMap<IntegerVec>> for AnimatedData
impl TryInto<TimeDataMap<IntegerVec>> for AnimatedData
Source§fn try_into(
self,
) -> Result<TimeDataMap<IntegerVec>, <Self as TryInto<TimeDataMap<IntegerVec>>>::Error>
fn try_into( self, ) -> Result<TimeDataMap<IntegerVec>, <Self as TryInto<TimeDataMap<IntegerVec>>>::Error>
Source§impl TryInto<TimeDataMap<Matrix3>> for AnimatedData
Available on crate feature matrix3 only.
impl TryInto<TimeDataMap<Matrix3>> for AnimatedData
matrix3 only.Source§impl TryInto<TimeDataMap<Matrix3Vec>> for AnimatedData
Available on crate features matrix3 and vec_variants only.
impl TryInto<TimeDataMap<Matrix3Vec>> for AnimatedData
matrix3 and vec_variants only.Source§fn try_into(
self,
) -> Result<TimeDataMap<Matrix3Vec>, <Self as TryInto<TimeDataMap<Matrix3Vec>>>::Error>
fn try_into( self, ) -> Result<TimeDataMap<Matrix3Vec>, <Self as TryInto<TimeDataMap<Matrix3Vec>>>::Error>
Source§impl TryInto<TimeDataMap<Real>> for AnimatedData
impl TryInto<TimeDataMap<Real>> for AnimatedData
Source§impl TryInto<TimeDataMap<RealVec>> for AnimatedData
impl TryInto<TimeDataMap<RealVec>> for AnimatedData
Source§impl TryInto<TimeDataMap<String>> for AnimatedData
impl TryInto<TimeDataMap<String>> for AnimatedData
Source§impl TryInto<TimeDataMap<StringVec>> for AnimatedData
impl TryInto<TimeDataMap<StringVec>> for AnimatedData
Source§impl TryInto<TimeDataMap<Vector2>> for AnimatedData
Available on crate feature vector2 only.
impl TryInto<TimeDataMap<Vector2>> for AnimatedData
vector2 only.Source§impl TryInto<TimeDataMap<Vector2Vec>> for AnimatedData
Available on crate features vector2 and vec_variants only.
impl TryInto<TimeDataMap<Vector2Vec>> for AnimatedData
vector2 and vec_variants only.Source§fn try_into(
self,
) -> Result<TimeDataMap<Vector2Vec>, <Self as TryInto<TimeDataMap<Vector2Vec>>>::Error>
fn try_into( self, ) -> Result<TimeDataMap<Vector2Vec>, <Self as TryInto<TimeDataMap<Vector2Vec>>>::Error>
impl Eq for AnimatedData
impl StructuralPartialEq for AnimatedData
Auto Trait Implementations§
impl Freeze for AnimatedData
impl RefUnwindSafe for AnimatedData
impl Send for AnimatedData
impl Sync for AnimatedData
impl Unpin for AnimatedData
impl UnwindSafe for AnimatedData
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.