code wiki / _hdl_build / nx_uiq_visual_lib.nx
nx_uiq_visual_lib.nx
buildroot/runtime/_hdl_build/nx_uiq_visual_lib.nx
about
nx_uiq_visual_lib.nx -- SOVEREIGN visual-render metrics: the deterministic-pixel half of the
perceptual axis, computed on a REAL rendered PNG. Attacks the marker-vs-rendered gap no other
sovereign UI tool can (none execute CSS): a page that passes every structural/console check yet
renders BLANK (the banked "google scored 97% while rendering nothing" failure). DRY (rule 15):
reuses the shipped sovereign PNG decoder via nx_visual_diff's vd_load (VdImg{px,w,h,nc}) + its
vd_content_extent (rendered height / layout parity) -- ZERO new decode code. nx_png_write for KAT fixtures.
HONEST ENVELOPE (declared in output): measures the pixels of WHATEVER png it is given; render
FIDELITY is the input's property (a Chrome screenshot = real CSS/JS; the sovereign br_shot_png = no-JS).
Deterministic GUARDRAILS half; perceptual "premium" judging stays partnership-gated (VLM, will-not-fake).
license_tier: ORIGINAL genealogy: experiential visual; composes nx_visual_diff + nx_png_decoder + nx_png_write
dependencies 3 imports · 2 importers
imports: nx_visual_diff.nxnx_itoa_lib.nxnx_png_write.nx
imported by: nx_uiq_visual.nxnx_uiq_visual_gate.nx
structs
| none |
consts
| 14 | const UV_MAGIC_1024: i64 = 1024 |
| 16 | const UV_BLANK_PERMILLE: i64 = 20 |
| 17 | const UV_SPARSE_PERMILLE: i64 = 50 |
| 18 | const UV_INK_DELTA: i64 = 24 |
| 19 | const UV_STEP: i64 = 6 |
functions
| 21 | func uv_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 22 | func uv_abs(v: i64) -> i64 { if v<0 { return 0-v } return v } called by 1: uv_metrics |
| 23 | func uv_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: main |
| 24 | func uv_streq(s: *u8, sl: i64, lit: *u8) -> i64 { var i: i64=0; while lit[i]!=(0 as u8){ if i>=sl { return 0 } if s[i]!=lit[i] { return 0 } i=i+1 } if i!=sl { return 0 } return 1 } called by 1: main |
| 29 | func uv_pn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 30 | func uv_catn(d: *u8, off: i64, v: i64) -> i64 called by 1: uv_analyze |
| 35 | func uv_cat(d: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; var o: i64=off; while s[i]!=(0 as u8){d[o]=s[i]; o=o+1; i=i+1} return o } |
| 38 | func uv_metrics(im: *VdImg, out: *i64) -> i64 |
| 83 | func uv_verdict(d: *u8, off: i64, ink: i64) -> i64 |
| 90 | func uv_analyze(path: *u8, emit: i64) -> i64 |
| 127 | func uv_mk_solid(path: *u8, w: i64, h: i64, r: i64, g: i64, b: i64) -> i64 |
| 134 | func uv_mk_rich(path: *u8, w: i64, h: i64) -> i64 |
| 143 | func uv_mk_band(path: *u8, w: i64, h: i64, y0: i64, y1: i64) -> i64 |
| 151 | func uv_selftest() -> i64 |