Polygon Filling (Scanline)
Fill a rectangle by computing span intersections per row.
Row 0 processed: .......... — every cell between the left and right boundary pixel is painted.
Scanline fill algorithm
- For each horizontal scanline, find intersections with polygon edges.
- Sort intersections left to right.
- Pair them up: fill between (0,1), skip (1,2), fill (2,3)...
Handles concave polygons too, once the even-odd rule is applied consistently.
Scanline trace:
..........