code wiki / _hdl_build / nx_look_compose.nx

nx_look_compose.nx

buildroot/runtime/_hdl_build/nx_look_compose.nx

5856 B118 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_look_compose.nx -- SOVEREIGN composer for the LOOK gate (2026-07-29; retires compose.py per the sovereign-no-python law: 3rd-party code is benchmark/oracle ONLY, never a lane instrument). Reads THREE 8-bit grayscale BMPs (the nx_vcodec_look_dump output: SOURCE, arm A, arm B), writes ONE composite grayscale BMP: the three panes side by side with a 4px white gutter, optionally a CROP of each pane scaled 2x (nearest -- pixel truth, no resampling opinions). Browsers render BMP natively, so the published review strip needs no PNG and no external encoder. usage: nx_look_compose <src.bmp> <a.bmp> <b.bmp> <out.bmp> [x0 y0 cw ch] no crop args -> full-frame strip; with crop args -> 2x-scaled crop strip. CIF-class only (dimensions read from the BMP header; all three must match; width*panes padded to 4). license: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_look_compose.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gw sys_write sys_mmap bmp_read sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close rd32le gw ↻ atoi bmp_write sys_mmap ↻ wr32le wr16le sys_openat_wr gw ↻ sys_write ↻ sys_close ↻ gn sys_mmap ↻ sys_write ↻

structs

none

consts

12const LC_MAGIC_2835: i64 = 2835
14const LC_GUT: i64 = 4 // gutter px between panes (white)
15const LC_HDR: i64 = 1078 // 14 + 40 + 256*4 grayscale palette

functions

17func gw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 3: bmp_readbmp_writemain calls 1: sys_write
18func gn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
22func atoi(a: *u8) -> i64 { var v: i64=0; var i: i64=0
called by 1: main
24func rd32le(b: *u8, off: i64) -> i64
called by 1: bmp_read
26func wr32le(b: *u8, off: i64, v: i64) -> i64
called by 1: bmp_write
29func wr16le(b: *u8, off: i64, v: i64) -> i64
called by 1: bmp_write
33func bmp_read(path: *u8, wh: *i64) -> *u8
called by 1: main calls 4: sys_mmapsys_read_filerd32legw
53func bmp_write(path: *u8, luma: *u8, w: i64, h: i64) -> i64
76func main(argc: i64, argv: *i64) -> i64