Struct Jiggler

Source
struct Jiggler<'a, C, D>
where C: PointCoord, D: PointCoord + From<C>,
{ points: &'a [Point<C>], out_points: &'a mut [Point<D>], }

Fields§

§points: &'a [Point<C>]§out_points: &'a mut [Point<D>]

Implementations§

Source§

impl<C, D> Jiggler<'_, C, D>
where C: PointCoord, D: PointCoord + From<C>,

Source

fn shift(&mut self, range: RangeInclusive<usize>, ref_ix: usize) -> Option<()>

Shift the coordinates of all points in the specified range using the difference given by the point at ref_ix.

Modeled after the FreeType implementation: https://github.com/freetype/freetype/blob/bbfcd79eacb4985d4b68783565f4b494aa64516b/src/truetype/ttgxvar.c#L3776

Source

fn interpolate( &mut self, range: RangeInclusive<usize>, ref_points: RefPoints, ) -> Option<()>

Interpolate the coordinates of all points in the specified range using ref1_ix and ref2_ix as the reference point indices.

Modeled after the FreeType implementation: https://github.com/freetype/freetype/blob/bbfcd79eacb4985d4b68783565f4b494aa64516b/src/truetype/ttgxvar.c#L3813

For details on the algorithm, see: https://learn.microsoft.com/en-us/typography/opentype/spec/gvar#inferred-deltas-for-un-referenced-point-numbers

Auto Trait Implementations§

§

impl<'a, C, D> Freeze for Jiggler<'a, C, D>

§

impl<'a, C, D> RefUnwindSafe for Jiggler<'a, C, D>

§

impl<'a, C, D> Send for Jiggler<'a, C, D>
where C: Sync, D: Send,

§

impl<'a, C, D> Sync for Jiggler<'a, C, D>
where C: Sync, D: Sync,

§

impl<'a, C, D> Unpin for Jiggler<'a, C, D>

§

impl<'a, C, D> !UnwindSafe for Jiggler<'a, C, D>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.