code wiki / (root) / nx_image_index.nx

nx_image_index.nx

buildroot/runtime/nx_image_index.nx

4669 B96 linesdepth 11pulls 52 transitivereach 0 importersview sourcekind tooltopic image
docsdependenciesstructsconstsfunctions

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

nx_phash.nx nx_itoa_lib.nx nx_image_gray.nx nx_image_index.nx

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

main ii_puts nx_img_to_gray nx_jpeg_decode_luma sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ nx_jpeg_dec_ctx_init sys_mmap ↻ nx_jpeg_ctx_tables_reset nx_jpeg_ctx_htable_at nx_jpeg_ctx_htable_bind nx_jpeg_ctx_htable_at ↻ nx_jpeg_ctx_qtable_at _jpeg_ascii_probe_sof sys_mmap ↻ nx_jpeg_seg_init nx_jpeg_seg_next nx_jpeg_classify_marker nx_jpeg_marker_is_lengthle nx_jpeg_sof_parse nx_jpeg_is_progressive prog_be16 nx_jpeg_prog_decode sys_mmap ↻ nx_jpeg_ctx_tables_reset ↻ prog_be16 ↻ nx_jpeg_ctx_parse_dqt

structs

none

consts

none

functions

20func 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
25func ii_num(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
26func ii_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: main
29func ii_hexemit(fd: i64, v: i64) -> i64
called by 1: main
47func main(argc: i64, argv: *i64) -> i64