code wiki / _hdl_build / nx_pcb_render.nx
nx_pcb_render.nx
buildroot/runtime/_hdl_build/nx_pcb_render.nx
about
nx_pcb_render.nx -- LIB: mechanistically-ACCURATE PCB visual. Renders the routed board to an RGB raster at TRUE
dimensions: 1 mil = `scale` pixels, so a trace of width Wt mils draws at EXACTLY Wt*scale pixels and a grid pitch
of P mils at P*scale pixels. It is a scale drawing of the real board (the visual twin), not a stylized cartoon --
deterministic, integer, sovereign. Driven by the ACTUAL routed geometry (usedby[] from nx_pcb_autoroute). This is
the EXACT engineering visual; the loosened/stylized render for games is a later derivative of it. (R2 = route this
through the shared nx_gfx/nx_game_raster kernel + nx_png so PCB/CAD/games/metahumans share one viz engine.)
never-brick #26: pure memory, bounded, deterministic, zero hardware writes. license_tier: ORIGINAL
dependencies 1 imports · 1 importers
imports: nx_syscalls.nx
imported by: nx_pcb_render_gate.nx
structs
| none |
consts
| none |
functions
| 10 | func pr_putpx(img: *u8, IMGW: i64, IMGH: i64, x: i64, y: i64, r: i64, g: i64, b: i64) -> i64 called by 1: pr_rect |
| 22 | func pr_fill(img: *u8, IMGW: i64, IMGH: i64, r: i64, g: i64, b: i64) -> i64 called by 1: pr_render_board |
| 29 | func pr_rect(img: *u8, IMGW: i64, IMGH: i64, x0: i64, y0: i64, ww: i64, hh: i64, r: i64, g: i64, b: i64) -> i64 |
| 40 | func pr_is_copper(img: *u8, IMGW: i64, x: i64, y: i64) -> i64 |
| 46 | func pr_count_copper(img: *u8, IMGW: i64, IMGH: i64) -> i64 |
| 59 | func pr_render_board(img: *u8, IMGW: i64, IMGH: i64, usedby: *i64, W: i64, H: i64, pitch: i64, tw: i64) -> i64 |
| 82 | func pr_putdec(buf: *u8, pos: i64, val: i64) -> i64 |
| 94 | func pr_write_ppm(path: *u8, img: *u8, IMGW: i64, IMGH: i64) -> i64 |