code wiki / _hdl_build / nx_look_compose.nx
nx_look_compose.nx
buildroot/runtime/_hdl_build/nx_look_compose.nx
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
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
structs
| none |
consts
| 12 | const LC_MAGIC_2835: i64 = 2835 |
| 14 | const LC_GUT: i64 = 4 // gutter px between panes (white) |
| 15 | const LC_HDR: i64 = 1078 // 14 + 40 + 256*4 grayscale palette |
functions
| 17 | func gw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 18 | func gn(v: i64) -> i64 |
| 22 | func atoi(a: *u8) -> i64 { var v: i64=0; var i: i64=0 called by 1: main |
| 24 | func rd32le(b: *u8, off: i64) -> i64 called by 1: bmp_read |
| 26 | func wr32le(b: *u8, off: i64, v: i64) -> i64 called by 1: bmp_write |
| 29 | func wr16le(b: *u8, off: i64, v: i64) -> i64 called by 1: bmp_write |
| 33 | func bmp_read(path: *u8, wh: *i64) -> *u8 |
| 53 | func bmp_write(path: *u8, luma: *u8, w: i64, h: i64) -> i64 |
| 76 | func main(argc: i64, argv: *i64) -> i64 |