FA-51689 / Raster clipping / Member archive
Scanline polygon span clip: row sample top · case 04
Rows are sampled at their top edge instead of their pixel-center line.
Case contract
Each command is [polygon,scissor]. Rows y in the scissor rows [top,bottom) intersected with [0,size) are sampled at y+1/2. Each polygon edge is oriented bottom to top and contributes a crossing when top<=yc<bottom (half-open in y), interpolated exactly. Crossings are sorted and paired even-odd. A pair covers pixels whose centers x+1/2 satisfy xa<=x+1/2<xb, i.e. [ceil(xa-1/2),ceil(xb-1/2)), then clipped to the scissor columns [left,right) intersected with [0,size). Non-empty spans are returned as [row,start,end].
Why this case matters
Raster clipping decides which pixels a primitive may touch; a single wrong clip decision writes outside the target or scissor, or silently drops visible coverage.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| explicit case 1 | [[[1, 1, 2], [1, 4, 5], [2, 1, 3], [2, 3, 5], [3, 1, 5], [4, 1, 5]]] | [[[1, 1, 2], [1, 4, 5], [2, 1, 5], [3, 1, 5], [4, 1, 5]]] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗