code wiki / _hdl_build / nx_pcb_render.nx

nx_pcb_render.nx

buildroot/runtime/_hdl_build/nx_pcb_render.nx

4504 B112 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind librarytopic pcb
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_pcb_render.nx nx_pcb_render_gate.nx

imports: nx_syscalls.nx

imported by: nx_pcb_render_gate.nx

structs

none

consts

none

functions

10func pr_putpx(img: *u8, IMGW: i64, IMGH: i64, x: i64, y: i64, r: i64, g: i64, b: i64) -> i64
called by 1: pr_rect
22func pr_fill(img: *u8, IMGW: i64, IMGH: i64, r: i64, g: i64, b: i64) -> i64
called by 1: pr_render_board
29func pr_rect(img: *u8, IMGW: i64, IMGH: i64, x0: i64, y0: i64, ww: i64, hh: i64, r: i64, g: i64, b: i64) -> i64
called by 1: pr_render_board calls 1: pr_putpx
40func pr_is_copper(img: *u8, IMGW: i64, x: i64, y: i64) -> i64
called by 2: pr_count_coppermain
46func pr_count_copper(img: *u8, IMGW: i64, IMGH: i64) -> i64
called by 1: main calls 1: pr_is_copper
59func pr_render_board(img: *u8, IMGW: i64, IMGH: i64, usedby: *i64, W: i64, H: i64, pitch: i64, tw: i64) -> i64
called by 1: main calls 2: pr_fillpr_rect
82func pr_putdec(buf: *u8, pos: i64, val: i64) -> i64
called by 1: pr_write_ppm calls 1: sys_mmap
94func pr_write_ppm(path: *u8, img: *u8, IMGW: i64, IMGH: i64) -> i64