bresenham 0.1.1

A fast, iterator-based integer-only implementation of Bresenham's line algorithm.
Documentation
  • Coverage
  • 100%
    4 out of 4 items documented1 out of 3 items with examples
  • Size
  • Source code size: 5.3 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.5 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Documentation
  • mbr/bresenham-rs
    19 7 3
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • mbr

bresenham-rs

Implements Bresenham's line drawing algorithm in Rust using an iterator over all points in the line. Most, if not all overhead should evaporate when inlined by the compiler.

Example use:

for (x, y) in Bresenham::new((0, 1), (6, 4)) {
    println!("{}, {}", x, y);
}

Will print:

(0, 1)
(1, 1)
(2, 2)
(3, 2)
(4, 3)
(5, 3)