Graphics / Reference / Uses of a line algorithm
Uses of a line algorithm
Incremental line algorithms are reusable building blocks for drawing line segments, approximating curves with line sequences, and advancing along polygon edges during filling, although the same Bresenham line form is not ideal for circles.
A line-drawing algorithm is directly used to rasterise individual line segments.
Curves can also be represented or approximated as sequences of line segments, so the same line-rasterisation machinery can be applied repeatedly along a polyline approximation.
Polygon-filling algorithms reuse a related incremental structure to advance along polygon edges. Instead of selecting one displayed line pixel per step, the edge walker supplies the changing intersection position needed by each scanline of the fill.
Circle drawing can also use an incremental decision structure, but the specific Bresenham line formulation is not well suited directly to the geometry of a circle; circle rasterisation requires a corresponding circle-specific formulation.
The associated overview diagram groups line segments, polylines, polygons, curves and circles as related rasterisation applications while distinguishing the exact algorithm used for each case.
Builds on
Read
- Read the chapter: Uses of a line algorithm