nx_garment_twin_gate.nx
buildroot/runtime/nx_garment_twin_gate.nx
about
nx_garment_twin_gate.nx -- THE GATE FOR THE FLAT-FRONT GARMENT PREVIEW (nx_garment_twin forked for real), 2026-08-24.
FIXTURES AT RUNTIME in /tmp/nx_garment_twin_gate/: a 32x32 P6 print (left half pure red, right half pure white) and
two confs derived from the estate conf's shape -- one with relief, one with relief_permil=0 (the neg-control: no
knit modulation may appear when the relief is zero). Teeth read the DECODED output: canvas dimensions, the fabric
outside the chest box reads as (shaded) fabric albedo, the print region is redder than the fabric, ink only darkens
(print-region luma below fabric luma), the knit modulation is PRESENT with relief and ABSENT without it (bite).
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_tool_run.nxnx_img_to_rgb.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
| 14 | const GG_SUBJECT_DEFAULT: *u8 = "nx_garment_twin.elf" |
| 15 | const GG_DIR: *u8 = "/tmp/nx_garment_twin_gate" |
| 16 | const GG_PRINT: *u8 = "/tmp/nx_garment_twin_gate/print.ppm" |
| 17 | const GG_CONF: *u8 = "/tmp/nx_garment_twin_gate/relief.conf" |
| 18 | const GG_CONF_FLAT: *u8 = "/tmp/nx_garment_twin_gate/flat.conf" |
| 19 | const GG_OUT: *u8 = "/tmp/nx_garment_twin_gate/out.png" |
| 20 | const GG_OUT_FLAT: *u8 = "/tmp/nx_garment_twin_gate/outflat.png" |
| 21 | const GG_MODE_DIR: i64 = 493 |
| 22 | const GG_MODE_0644: i64 = 420 |
| 23 | const GG_CAPTURE_CAP: i64 = 65536 |
| 24 | const GG_ARGV_SLOTS: i64 = 8 |
| 25 | const GG_SLOT: i64 = 8 |
| 26 | const GG_CHANNELS: i64 = 3 |
| 27 | const GG_PW: i64 = 32 |
| 28 | const GG_PH: i64 = 32 |
| 29 | const GG_CODE_MAX: i64 = 255 |
| 30 | const GG_PPM_HDR: *u8 = "P6\n32 32\n255\n" |
| 31 | const GG_W: i64 = 256 // fixture canvas (the conf rows below) |
| 32 | const GG_H: i64 = 320 |
| 33 | const GG_FAB: i64 = 246 // fixture fabric albedo (one value for all three channels: a neutral) |
| 34 | const GG_BOX_X: i64 = 51 // 200 permil of 256 |
| 35 | const GG_BOX_Y: i64 = 80 // 250 permil of 320 |
| 36 | const GG_BOX_W: i64 = 153 // 600 permil of 256 |
| 37 | const GG_PROBE_X: i64 = 8 // a fabric pixel well outside the box |
| 38 | const GG_PROBE_Y: i64 = 8 |
| 39 | const GG_RUN_LEN: i64 = 24 // a run of fabric pixels: the knit must vary along it when relief is on |
| 40 | const GG_RED_X_OFF: i64 = 10 // inside the red half of the placed print |
| 41 | const GG_RED_Y_OFF: i64 = 10 |
| 42 | const GG_SHADE_FLOOR: i64 = 700 // ambient_permil of the fixture conf: fabric never darker than this permil of albedo |
| 43 | const GG_PERMIL: i64 = 1000 |
| 44 | const GG_EXIT_OK: i64 = 0 |
functions
| 46 | func gg_write_bytes(path: *u8, b: *u8, n: i64) -> i64 |
| 54 | func gg_write_text(path: *u8, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return gg_write_bytes(path, s, n) } |
| 55 | func gg_write_print(path: *u8) -> i64 |
| 75 | func gg_run(subject: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, out: *u8, outlen: *i64) -> i64 |
| 86 | func gg_decode(path: *u8, wh: *i64) -> *u8 |
| 91 | func gg_px(rgb: *u8, w: i64, x: i64, y: i64, c: i64) -> i64 { return rgb[(y * w + x) * GG_CHANNELS + c] as i64 } |
| 93 | func gg_run_spread(rgb: *u8, w: i64, x0: i64, y: i64, n: i64) -> i64 |
| 101 | func main(argc: i64, argv: *i64) -> i64 |