pub struct SpanInterpolatorLinear<T = TransAffine> { /* private fields */ }Expand description
Linear span interpolator.
Transforms span coordinates through a transformation using two DDA interpolators (one for X, one for Y). Transforms only the endpoints and linearly interpolates between them.
Port of C++ span_interpolator_linear<Transformer, SubpixelShift>.
Implementations§
Source§impl<T: Transformer> SpanInterpolatorLinear<T>
impl<T: Transformer> SpanInterpolatorLinear<T>
pub fn new(trans: T) -> Self
pub fn new_begin(trans: T, x: f64, y: f64, len: u32) -> Self
pub fn transformer(&self) -> &T
pub fn set_transformer(&mut self, trans: T)
Sourcepub fn begin(&mut self, x: f64, y: f64, len: u32)
pub fn begin(&mut self, x: f64, y: f64, len: u32)
Initialize interpolation for a span starting at (x, y) with len pixels.
Sourcepub fn resynchronize(&mut self, xe: f64, ye: f64, len: u32)
pub fn resynchronize(&mut self, xe: f64, ye: f64, len: u32)
Re-synchronize interpolation at a new endpoint.
Sourcepub fn coordinates(&self, x: &mut i32, y: &mut i32)
pub fn coordinates(&self, x: &mut i32, y: &mut i32)
Get the current transformed coordinates (in subpixel units).
Trait Implementations§
Source§impl<T: Transformer> SpanInterpolator for SpanInterpolatorLinear<T>
impl<T: Transformer> SpanInterpolator for SpanInterpolatorLinear<T>
Auto Trait Implementations§
impl<T> Freeze for SpanInterpolatorLinear<T>where
T: Freeze,
impl<T> RefUnwindSafe for SpanInterpolatorLinear<T>where
T: RefUnwindSafe,
impl<T> Send for SpanInterpolatorLinear<T>where
T: Send,
impl<T> Sync for SpanInterpolatorLinear<T>where
T: Sync,
impl<T> Unpin for SpanInterpolatorLinear<T>where
T: Unpin,
impl<T> UnsafeUnpin for SpanInterpolatorLinear<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for SpanInterpolatorLinear<T>where
T: UnwindSafe,
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