pub struct SpanSubdivAdaptor<T: Transformer> { /* private fields */ }Expand description
Span subdivision adaptor.
Breaks long spans into sub-spans of subdiv_size pixels, calling
resynchronize() on the inner interpolator at each break point.
This corrects accumulated error for non-linear transforms used with
linear interpolation.
Port of C++ span_subdiv_adaptor<Interpolator, SubpixelShift>.
Implementations§
Source§impl<T: Transformer> SpanSubdivAdaptor<T>
impl<T: Transformer> SpanSubdivAdaptor<T>
Sourcepub fn new(interpolator: SpanInterpolatorLinear<T>) -> Self
pub fn new(interpolator: SpanInterpolatorLinear<T>) -> Self
Create a new subdivision adaptor with default subdivision shift of 4 (16 pixels).
Sourcepub fn new_with_shift(
interpolator: SpanInterpolatorLinear<T>,
subdiv_shift: u32,
) -> Self
pub fn new_with_shift( interpolator: SpanInterpolatorLinear<T>, subdiv_shift: u32, ) -> Self
Create with a custom subdivision shift.
pub fn interpolator(&self) -> &SpanInterpolatorLinear<T>
pub fn interpolator_mut(&mut self) -> &mut SpanInterpolatorLinear<T>
pub fn transformer(&self) -> &T
pub fn subdiv_shift(&self) -> u32
pub fn set_subdiv_shift(&mut self, shift: u32)
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 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).
Auto Trait Implementations§
impl<T> Freeze for SpanSubdivAdaptor<T>where
T: Freeze,
impl<T> RefUnwindSafe for SpanSubdivAdaptor<T>where
T: RefUnwindSafe,
impl<T> Send for SpanSubdivAdaptor<T>where
T: Send,
impl<T> Sync for SpanSubdivAdaptor<T>where
T: Sync,
impl<T> Unpin for SpanSubdivAdaptor<T>where
T: Unpin,
impl<T> UnwindSafe for SpanSubdivAdaptor<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