pub struct MorphPath { /* private fields */ }Expand description
Shape morphing between two point lists.
Implementations§
Source§impl MorphPath
impl MorphPath
Sourcepub fn new(
from: &Float32Array,
to: &Float32Array,
resolution: usize,
) -> Result<Self, JsValue>
pub fn new( from: &Float32Array, to: &Float32Array, resolution: usize, ) -> Result<Self, JsValue>
Create a morph from flat [x0, y0, x1, y1, ...] point arrays.
Sourcepub fn evaluate(&self, progress: f32) -> Float32Array
pub fn evaluate(&self, progress: f32) -> Float32Array
Evaluate points at normalized progress.
Sourcepub fn bounds_at(&self, progress: f32) -> Float32Array
pub fn bounds_at(&self, progress: f32) -> Float32Array
Bounds at progress as [minX, minY, maxX, maxY].
Sourcepub fn point_count(&self) -> usize
pub fn point_count(&self) -> usize
Point count after resampling.
Trait Implementations§
Source§impl FromWasmAbi for MorphPath
impl FromWasmAbi for MorphPath
Source§impl IntoWasmAbi for MorphPath
impl IntoWasmAbi for MorphPath
Source§impl LongRefFromWasmAbi for MorphPath
impl LongRefFromWasmAbi for MorphPath
Source§impl OptionFromWasmAbi for MorphPath
impl OptionFromWasmAbi for MorphPath
Source§impl OptionIntoWasmAbi for MorphPath
impl OptionIntoWasmAbi for MorphPath
Source§impl RefFromWasmAbi for MorphPath
impl RefFromWasmAbi for MorphPath
Source§type Abi = WasmPtr<WasmRefCell<MorphPath>>
type Abi = WasmPtr<WasmRefCell<MorphPath>>
The Wasm ABI type references to
Self are recovered from.Source§impl RefMutFromWasmAbi for MorphPath
impl RefMutFromWasmAbi for MorphPath
Source§impl TryFromJsValue for MorphPath
impl TryFromJsValue for MorphPath
Source§impl VectorFromWasmAbi for MorphPath
impl VectorFromWasmAbi for MorphPath
Source§impl VectorIntoWasmAbi for MorphPath
impl VectorIntoWasmAbi for MorphPath
impl SupportsConstructor for MorphPath
impl SupportsInstanceProperty for MorphPath
impl SupportsStaticProperty for MorphPath
Auto Trait Implementations§
impl Freeze for MorphPath
impl RefUnwindSafe for MorphPath
impl Send for MorphPath
impl Sync for MorphPath
impl Unpin for MorphPath
impl UnsafeUnpin for MorphPath
impl UnwindSafe for MorphPath
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.