Clipline 0.3.0 released (rewrite)

clipline is a library for fast line rasterization with pixel-perfect clipping.

The 0.3.0 release is a complete rewrite.

Highlights

  • Introduces iterators for raw and clipped axis-aligned, diagonal, and arbitrary line segments.
    • Provides specialized iterators for signed-axis-aligned, (diagonal) quadrant-covered, and octant-covered line segments.
  • Introduces a new clipping algorithm, synthesizing the works of Sobkow-Pospisil-Yang (1987), Dörr (1990), and Kuzmin (1995).
  • Removes integer overflow and division by zero (forbids arithmetic_side_effects).
    • Ensures iterators are defined on the entire underlying numeric domain.
  • Adds support for unsigned coordinates.
  • Makes the API usable in const contexts (except iteration itself, for now).
  • Adds property tests (via proptest) checking that clipped iterators produce the same points as raw iterators clipped naively.
Demo animation

clip.gif

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.