code wiki / _hdl_build / nx_geo_raster.nx
nx_geo_raster.nx
buildroot/runtime/_hdl_build/nx_geo_raster.nx
about
nx_geo_raster.nx -- LIB: GEO-020 RASTER RENDER (integer scanline polygon fill, even-odd rule).
THE EXCEED ANGLE (measured): coverage is decided by INTEGER scanline crossings -- for each pixel row
we find the polygon-edge x-crossings, sort them, and fill the spans between crossing pairs. ZERO
floating point, half-open [lo,hi) edge rule -> a deterministic, gap-free, no-double-fill rasterization
(the classic float rasterizer's seam/overlap artifacts at shared edges cannot occur). The same
integer cross-style interpolation as the rest of nx_geo. Pixel (row,col) at grid[row*w + col].
Convention (matches nx_geo): poly = flat [y0,x0, y1,x1, ...] in PIXEL coords (y=row, x=col).
Writes 1 to filled pixels of grid (a w*h byte buffer), returns the filled pixel count. license_tier: ORIGINAL
dependencies 1 imports · 1 importers
imports: nx_syscalls.nx
imported by: nx_geo_raster_gate.nx
structs
| none |
consts
| none |
functions
| 13 | func geo_raster_fill(poly: *i64, npts: i64, w: i64, h: i64, grid: *u8) -> i64 |
| 74 | func geo_raster_get(grid: *u8, w: i64, row: i64, col: i64) -> i64 called by 1: main |