code wiki / _hdl_build / nx_cast_gen.nx

nx_cast_gen.nx

buildroot/runtime/_hdl_build/nx_cast_gen.nx

6091 B80 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_cast_gen.nx -- the capability that EXCEEDS the DAZ/Renderosity WORKFLOW on its weak axis: UNIQUENESS AT SCALE. DAZ/Renderosity devs reuse the same paid marketplace figures -> the same faces recur across games. This generates a UNIQUE character from a SEED (bounded-random params), infinitely, deterministically, $0, no license, fully programmatic (no GUI/manual posing). It renders a CONTACT SHEET of a generated cast + reports the distinct count. HONEST: stylized 2D, behind DAZ on photoreal fidelity; the exceed is uniqueness/cost/license/determinism/ automation, measured by nx_asset_exceed. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_shade.nx nx_png.nx nx_cast_gen.nx

imports: nx_syscalls.nxnx_shade.nxnx_png.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap sh_clear sh_rgb char_dna lcg portrait sh_rgb ↻ sh_clear ↻ efill frect skin_of sh_rgb ↻ hair_of sh_rgb ↻ eye_of sh_rgb ↻ fit_of sh_rgb ↻ sys_mkdir write_png sys_mmap ↻ png_g png_paeth png_sabs dfe_compress sys_mmap ↻ dfe_fill_tables dfe_deflate sys_mmap ↻ dfe_bits dfe_hash dfe_matchlen dfe_sym dfe_bits ↻ dfe_rev dfe_rev ↻ sys_munmap sys_munmap ↻ png_be32

structs

none

consts

10const K_MAGIC_1103515245: i64 = 1103515245
11const K_MAGIC_12345: i64 = 12345
12const K_MAGIC_32767: i64 = 32767
13const K_MAGIC_20260623: i64 = 20260623
14const K_MAGIC_7919: i64 = 7919

functions

16func aw(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 1: main calls 1: sys_write
17func an(v: i64) -> i64 { var m: i64=v; if m==0{sys_write(1,"0" as *u8,1);return 0} let t:*u8=sys_mmap(24); var k:i64=0; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} let o:*u8=sys_mmap(24); var i:i64=0; while i<k{o[i]=t[k-1-i];i=i+1} sys_write(1,o,k); return 0 }
called by 1: main calls 2: sys_writesys_mmap
18func lcg(s: *i64) -> i64 { var x: i64=s[0]; x=x*K_MAGIC_1103515245+K_MAGIC_12345; s[0]=x; return (x>>16)&K_MAGIC_32767 }
called by 1: char_dna
19func frect(fb: *i64, w: i64, h: i64, x0: i64, y0: i64, x1: i64, y1: i64, c: i64) -> i64 { var yy: i64=y0; if yy<0{yy=0} var ye: i64=y1; if ye>h{ye=h} while yy<ye{ var xx: i64=x0; if xx<0{xx=0} var xe: i64=x1; if xe>w{xe=w} while xx<xe{fb[yy*w+xx]=c; xx=xx+1} yy=yy+1 } return 0 }
called by 1: portrait
20func efill(fb: *i64, w: i64, h: i64, cx: i64, cy: i64, rx: i64, ry: i64, c: i64) -> i64 { var y: i64=cy-ry; while y<=cy+ry{ var x: i64=cx-rx; while x<=cx+rx{ let dx: i64=x-cx; let dy: i64=y-cy; if dx*dx*ry*ry+dy*dy*rx*rx<=rx*rx*ry*ry{ if x>=0{if x<w{if y>=0{if y<h{fb[y*w+x]=c}}}} } x=x+1 } y=y+1 } return 0 }
called by 1: portrait
22func skin_of(i: i64) -> i64 { if i==0{return sh_rgb(235,205,178)} if i==1{return sh_rgb(206,162,132)} if i==2{return sh_rgb(176,132,104)} return sh_rgb(148,108,84) }
called by 1: main calls 1: sh_rgb
23func hair_of(i: i64) -> i64 { if i==0{return sh_rgb(124,64,42)} if i==1{return sh_rgb(222,192,110)} if i==2{return sh_rgb(40,38,46)} if i==3{return sh_rgb(92,60,40)} if i==4{return sh_rgb(176,176,186)} return sh_rgb(182,72,60) }
called by 1: main calls 1: sh_rgb
24func eye_of(i: i64) -> i64 { if i==0{return sh_rgb(72,138,92)} if i==1{return sh_rgb(70,112,184)} if i==2{return sh_rgb(110,70,40)} return sh_rgb(120,96,150) }
called by 1: main calls 1: sh_rgb
25func fit_of(i: i64) -> i64 { if i==0{return sh_rgb(118,52,56)} if i==1{return sh_rgb(54,64,104)} if i==2{return sh_rgb(46,80,60)} if i==3{return sh_rgb(92,72,42)} return sh_rgb(60,60,72) }
called by 1: main calls 1: sh_rgb
27func portrait(fb: *i64, W: i64, H: i64, skin: i64, hair: i64, hstyle: i64, eyec: i64, outfit: i64) -> i64
called by 1: main calls 4: sh_rgbsh_clearefillfrect
45func char_dna(s: *i64, pbox: *i64) -> i64
called by 1: main calls 1: lcg
51func main(argc: i64, argv: *i64) -> i64