Crate line_drawing [] [src]

A collection of line-drawing algorithms for use in graphics and video games.

Currently implemented:

Structs

Midpoint

An implementation of the mid-point line drawing algorithm.

Supercover

Like WalkGrid but takes diagonal steps if the line passes directly over a corner.

WalkGrid

Walk along a grid, taking only orthagonal steps.

Functions

bresenham

A simple wrapper around bresenham-rs that includes the end point.

midpoint

A convenience function to collect the points from Midpoint into a Vec.

sorted_bresenham

Like bresenham but sorts the points before hand to ensure that the line is symmetrical.

sorted_midpoint

Like midpoint but sorts the points before hand to ensure that the line is symmetrical.

sorted_walk_grid

Like walk_grid but sorts the points before hand to ensure that the line is symmetrical.

sorted_xiaolin_wu

Like xiaolin_wu but reverses the resulting line if the start and end points get reordered.

supercover

A convenience function to collect the points from Supercover into a Vec.

walk_grid

A convenience function to collect the points from WalkGrid into a Vec.

xiaolin_wu

An implementation of Xiaolin Wu's line algorithm.