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 sys_read_file sys_openat_rd sys_lseek sys_mmap sys_read sys_close sys_openat_wr nx_img_to_gray sys_read_file ↻ nx_jpeg_decode_luma sys_mmap ↻ nx_jpeg_dec_ctx_init sys_mmap ↻ _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 ↻ prog_be16 ↻ nx_jpeg_dqt_parse nx_jpeg_dht_parse nx_jpeg_dht_build_decode_t nx_jpeg_sos_parse prog_next_marker prog_scan sys_mmap ↻ nx_jpeg_huff_decode_symbol nx_jpeg_ent_extend nx_jpeg_ent_receive prog_refine_nz nx_jpeg_mcu_scratch_init sys_mmap ↻

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