code wiki / _hdl_build / nx_headcrop.nx
nx_headcrop.nx
buildroot/runtime/_hdl_build/nx_headcrop.nx
about
nx_headcrop.nx -- P1 FACE rung 1, THE INSTRUMENT (beyond-metahuman program).
The face is the measured WORST region (head judge 227) but every judge so far scores it inside a
WHOLE-BODY frame, where a head is a few percent of the pixels -- GX-48 proved a head-sized change
moves a body-average by exactly zero. This organ crops an NXMSH2 to its own TOP y-band, so ours and
the oracle can be benched HEAD-TO-HEAD at full render resolution by the existing nx_bodybench
(its height-fit framing then normalises on the CROP's height = the head fills the frame).
Band is per-mille of the mesh's OWN height => scale-invariant, works on any mesh, any species.
A tri is kept only if ALL 3 verts are in the band (clean boundary); every count is DECLARED.
nx_headcrop <in.nxmesh> <out.nxmesh> [lo_permil=870] [hi_permil=1000]
nx_headcrop selftest
license_tier: ORIGINAL expect_exit: 0 No hw writes (Rule 26).
dependencies 2 imports · 0 importers
imports: nx_gate_verdict.nxnx_itoa_lib.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
| 15 | const HC_MAGIC_8388607: i64 = 8388607 |
| 16 | const HC_MAGIC_8388608: i64 = 8388608 |
| 17 | const HC_HDR: i64 = 16 |
| 18 | const HC_LAYENT: i64 = 24 |
| 19 | const HC_TRI: i64 = 84 |
| 20 | const HC_LID: i64 = 4 |
| 21 | const HC_MAXLAY: i64 = 64 |
| 22 | const HC_PERMIL: i64 = 1000 |
| 23 | const HC_DEF_LO: i64 = 870 |
| 24 | const HC_DEF_HI: i64 = 1000 |
| 25 | const HC_MM: i64 = 1000 |
| 26 | const HC_MODE: i64 = 420 |
| 27 | const HC_SELFN: i64 = 12 |
| 28 | const HC_JBUF: i64 = 8192 |
| 29 | const HC_MAXBYTES: i64 = 268435456 |
functions
| 31 | func hc_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1, s, n); return 0 } |
| 36 | func hc_pn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 37 | func hc_rd32(b: *u8, o: i64) -> i64 |
| 40 | func hc_wr32(b: *u8, o: i64, v: i64) -> i64 |
| 45 | func hc_f32mul(b: *u8, o: i64, mul: i64) -> i64 |
| 58 | func hc_streq(a: *u8, b: *u8) -> i64 called by 1: main |
| 65 | func hc_atoi(s: *u8) -> i64 called by 1: main |
| 72 | func hc_crop(inp: *u8, outp: *u8, lo: i64, hi: i64, outcnt: *i64) -> i64 |
| 192 | func hc_emit(inp: *u8, outp: *u8, lo: i64, hi: i64, c: *i64, rc: i64) -> i64 |
| 212 | func hc_f32of(v: i64) -> i64 called by 1: hc_mktest |
| 221 | func hc_mktest(path: *u8) -> i64 |
| 256 | func hc_gate() -> i64 |
| 304 | func main(argc: i64, argv: *i64) -> i64 |