[][src]Struct line_drawing::Midpoint

pub struct Midpoint<I, O> { /* fields omitted */ }

An implementation of the mid-point line drawing algorithm.

The biggest difference between this algorithm and Bresenham is that it uses floating-point points.

Example:

extern crate line_drawing;
use line_drawing::Midpoint;

fn main() {
    for (x, y) in Midpoint::<f32, i8>::new((0.2, 0.02), (2.8, 7.7)) {
        print!("({}, {}), ", x, y);
    }
}
(0, 0), (1, 1), (1, 2), (1, 3), (2, 4), (2, 5), (2, 6), (3, 7), (3, 8),

Methods

impl<I: FloatNum, O: SignedNum> Midpoint<I, O>[src]

pub fn new(start: Point<I>, end: Point<I>) -> Self[src]

Important traits for Steps<T, I>
pub fn steps(self) -> Steps<Point<O>, Self>[src]

Trait Implementations

impl<I: FloatNum, O: SignedNum> Iterator for Midpoint<I, O>[src]

type Item = Point<O>

The type of the elements being iterated over.

Auto Trait Implementations

impl<I, O> Send for Midpoint<I, O> where
    I: Send,
    O: Send

impl<I, O> Unpin for Midpoint<I, O> where
    I: Unpin,
    O: Unpin

impl<I, O> Sync for Midpoint<I, O> where
    I: Sync,
    O: Sync

impl<I, O> UnwindSafe for Midpoint<I, O> where
    I: UnwindSafe,
    O: UnwindSafe

impl<I, O> RefUnwindSafe for Midpoint<I, O> where
    I: RefUnwindSafe,
    O: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]