pub struct TransformRegistry { /* private fields */ }Expand description
Registry for user-defined transforms.
Stores TransformDef objects that can be referenced by name in transform arrays. Supports parameterized transforms, keyframe animations, and transform cycling.
Implementations§
Source§impl TransformRegistry
impl TransformRegistry
Sourcepub fn register(&mut self, transform: TransformDef)
pub fn register(&mut self, transform: TransformDef)
Register a user-defined transform.
Sourcepub fn get(&self, name: &str) -> Option<&TransformDef>
pub fn get(&self, name: &str) -> Option<&TransformDef>
Get a transform definition by name.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&String, &TransformDef)>
pub fn iter(&self) -> impl Iterator<Item = (&String, &TransformDef)>
Iterate over all transforms in the registry.
Sourcepub fn expand(
&self,
name: &str,
params: &HashMap<String, f64>,
frame: u32,
total_frames: u32,
) -> Result<Vec<Transform>, TransformError>
pub fn expand( &self, name: &str, params: &HashMap<String, f64>, frame: u32, total_frames: u32, ) -> Result<Vec<Transform>, TransformError>
Expand a user-defined transform for a specific frame.
If the transform is a simple ops-only transform, returns the ops directly. For keyframe animations, generates the appropriate transforms for the given frame. For cycling transforms, returns the transforms for the current cycle position.
§Arguments
name- The name of the user-defined transformparams- Parameter values for parameterized transformsframe- Current frame number (for keyframe animations)total_frames- Total frames in the animation
Sourcepub fn expand_simple(
&self,
name: &str,
params: &HashMap<String, f64>,
) -> Result<Vec<Transform>, TransformError>
pub fn expand_simple( &self, name: &str, params: &HashMap<String, f64>, ) -> Result<Vec<Transform>, TransformError>
Expand a simple (non-animated) user-defined transform.
For simple ops-only transforms, returns the ops. For keyframe animations, returns transforms for frame 0.
Trait Implementations§
Source§impl Clone for TransformRegistry
impl Clone for TransformRegistry
Source§fn clone(&self) -> TransformRegistry
fn clone(&self) -> TransformRegistry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TransformRegistry
impl Debug for TransformRegistry
Source§impl Default for TransformRegistry
impl Default for TransformRegistry
Source§fn default() -> TransformRegistry
fn default() -> TransformRegistry
Auto Trait Implementations§
impl Freeze for TransformRegistry
impl RefUnwindSafe for TransformRegistry
impl Send for TransformRegistry
impl Sync for TransformRegistry
impl Unpin for TransformRegistry
impl UnsafeUnpin for TransformRegistry
impl UnwindSafe for TransformRegistry
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().