Clipline – fast line clipping and rasterization (0.1.2 release)

clipline is a crate for line segment rasterization with pixel-perfect (integer arithmetic only) clipping to a rectangular window. It eliminates the need for bounds checking when indexing into your frame buffer (see: pixels , minifb , softbuffer, and others), outperforming existing Bresenham's algorithm crates (benchmarked with line_drawing and bresenham).

Small animation of clipline in action (made with the pixels crate)


I'd be happy to learn and improve this crate with your feedback!