pub struct Dda2LineInterpolator { /* private fields */ }Expand description
Integer DDA line interpolator using Bresenham-style remainder tracking.
Port of C++ dda2_line_interpolator.
Distributes rounding error evenly across all steps.
Implementations§
Source§impl Dda2LineInterpolator
impl Dda2LineInterpolator
Sourcepub fn new_forward(y1: i32, y2: i32, count: i32) -> Self
pub fn new_forward(y1: i32, y2: i32, count: i32) -> Self
Forward-adjusted line from y1 to y2 over count steps.
Sourcepub fn new_backward(y1: i32, y2: i32, count: i32) -> Self
pub fn new_backward(y1: i32, y2: i32, count: i32) -> Self
Backward-adjusted line from y1 to y2 over count steps.
Sourcepub fn new_relative(y: i32, count: i32) -> Self
pub fn new_relative(y: i32, count: i32) -> Self
Relative delta over count steps (y starting at 0).
Sourcepub fn adjust_forward(&mut self)
pub fn adjust_forward(&mut self)
Adjust forward (shift phase).
Sourcepub fn adjust_backward(&mut self)
pub fn adjust_backward(&mut self)
Adjust backward (shift phase).
pub fn mod_val(&self) -> i32
pub fn rem(&self) -> i32
pub fn lft(&self) -> i32
pub fn y(&self) -> i32
Trait Implementations§
Source§impl Clone for Dda2LineInterpolator
impl Clone for Dda2LineInterpolator
Source§fn clone(&self) -> Dda2LineInterpolator
fn clone(&self) -> Dda2LineInterpolator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Dda2LineInterpolator
impl RefUnwindSafe for Dda2LineInterpolator
impl Send for Dda2LineInterpolator
impl Sync for Dda2LineInterpolator
impl Unpin for Dda2LineInterpolator
impl UnwindSafe for Dda2LineInterpolator
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