struct Contour<'a, C, D>{
points: &'a [Point<C>],
flags: &'a [PointFlags],
out_points: &'a mut [Point<D>],
}Expand description
One contour’s worth of points, as input coordinates and the moved coordinates being derived from them.
All three slices have the same length, so indices are interchangeable between them and are always in bounds.
Fields§
§points: &'a [Point<C>]§flags: &'a [PointFlags]§out_points: &'a mut [Point<D>]Implementations§
Source§impl<C, D> Contour<'_, C, D>
impl<C, D> Contour<'_, C, D>
Sourcefn interpolate_untouched(&mut self)
fn interpolate_untouched(&mut self)
Infers the deltas of every point in this contour that the current tuple did not reference.
Sourcefn shift(&mut self, reference: usize)
fn shift(&mut self, reference: usize)
Shifts the whole contour by the delta of its one referenced point.
Modeled after the FreeType implementation: https://github.com/freetype/freetype/blob/bbfcd79eacb4985d4b68783565f4b494aa64516b/src/truetype/ttgxvar.c#L3776
Sourcefn interpolate(&mut self, range: Range<usize>, ref1: usize, ref2: usize)
fn interpolate(&mut self, range: Range<usize>, ref1: usize, ref2: usize)
Interpolates the unreferenced points in range between the referenced
points at ref1 and ref2.
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