nx_image_index.nx
buildroot/runtime/nx_image_index.nx
about
nx_image_index.nx -- REAL-CORPUS reverse-image INGESTOR.
Turns a corpus of real encoded images into the per-site fingerprint index that nx_image_search
queries. For each manifest row "cid<TAB>image_path": decode the image (PNG today via nx_png_decode;
JPEG queued -- the JPEG decoder pipeline already exists), convert to Rec.709 grayscale, compute
dHash+aHash (nx_phash -- ZERO new hashing math), and append "cid<TAB>dhash_hex16<TAB>ahash_hex16".
The resulting index is byte-identical in format to the one nx_image_search_gate builds inline, so
the SAME client serves a synthetic test corpus and a real gallery corpus.
GRACEFUL DEGRADATION (Cardinal 14): an undecodable / unsupported / truncated image is SKIPPED
(counted in `skipped`, never fatal) so one bad file cannot abort a 366k-image crawl. Honest:
nx_png_decoder is PARTIAL (no palette / no Adam7 / no sub-byte depth) -> those images skip cleanly
and are reported, not silently dropped.
Usage: nx_image_index <corpus.tsv> <out_fp_index> (corpus rows: cid<TAB>image_path, NL-terminated)
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_phash.nxnx_itoa_lib.nxnx_image_gray.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
| none |
functions
| 20 | func ii_puts(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 |
| 25 | func ii_num(v: i64) -> i64 { nxi_out(v); return 0 } |
| 26 | func ii_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: main |
| 29 | func ii_hexemit(fd: i64, v: i64) -> i64 called by 1: main |
| 47 | func main(argc: i64, argv: *i64) -> i64 |