nx_gen_content.nx
buildroot/runtime/nx_gen_content.nx
about
nx_gen.nx -- ★R5 of the Infinigen ladder: the UNIFIED SOVEREIGN GENERATOR (their V2 bet = ProcFunc, a
function-oriented abstraction over ALL asset generators). One data-driven request envelope + a self-describing
registry dispatches to every heterogeneous organ, so a caller asks for any asset by KIND + SEED + PARAMS through
a single surface and gets back a standard result. This is the abstraction the eventual public generate-UI (R10)
and the world compositor both sit on. Adding a generator = one registry row + a thin adapter, never touching a
caller (composition over configuration). license_tier: ORIGINAL
dependencies 6 imports · 1 importers
imports: nx_worldgen.nxnx_treegen.nxnx_creaturegen.nxnx_figuregen.nxnx_persongen.nxnx_sdfrender.nx
imported by: nx_gen_gate.nx
structs
| none |
consts
| 14 | const GEN_WORLD: i64 = 0 |
| 15 | const GEN_TREE: i64 = 1 |
| 16 | const GEN_CREATURE: i64 = 2 |
| 17 | const GEN_FIGURE: i64 = 3 |
| 18 | const GEN_FACE: i64 = 4 |
| 19 | const GEN_NKIND: i64 = 5 |
| 20 | const GEN_TREEBG: i64 = 13763290 // 210 + 224*256 + 238*65536 |
| 21 | const GEN_ANATBG: i64 = 2890778 // 26 + 28*256 + 44*65536 |
functions
| 24 | func gen_kind_count() -> i64 { return GEN_NKIND } called by 1: main |
| 25 | func gen_kind_name(k: i64) -> *u8 called by 1: main |
| 33 | func gen_param_schema(k: i64) -> *u8 called by 1: main |
| 42 | func gen_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 43 | func gen_lum(px: i64) -> i64 { return (px&255)+((px>>8)&255)+((px>>16)&255) } called by 1: gen_content_lum |
| 44 | func gen_content_bg(fb: *i64, npx: i64, bg: i64) -> i64 { var c: i64=0; var i: i64=0; while i<npx { if fb[i]!=bg { c=c+1 } i=i+1 } return c } called by 1: nx_gen |
| 45 | func gen_content_lum(fb: *i64, npx: i64, thr: i64) -> i64 { var c: i64=0; var i: i64=0; while i<npx { if gen_lum(fb[i])>thr { c=c+1 } i=i+1 } return c } |
| 50 | func nx_gen(spec: *i64, res: *i64) -> i64 |