code wiki / (root) / nx_image_gray.nx

nx_image_gray.nx

buildroot/runtime/nx_image_gray.nx

3432 B74 linesdepth 10pulls 45 transitivereach 8 importersview sourcekind librarytopic image
docsdependenciesstructsconstsfunctions

about

nx_image_gray.nx -- SHARED: decode an encoded image file -> row-major u8 Rec.709 grayscale. ONE source of truth so the INDEXER (nx_image_index) and the QUERY client (nx_image_search) fingerprint pixels IDENTICALLY -- any divergence here would silently break image<->image matching. ARCHITECTURE (2026-08-05): this is a PROJECTION of the single decode chokepoint, not a second decoder. Two fast paths keep their native planes (JPEG -> luma without chroma work; GIF -> the LZW decoder's own Rec.709 gray, de-interlaced in gif_decode_core); EVERYTHING ELSE routes through nx_img_bytes_to_rgb -- so PNG (palette/Adam7/sub-byte included), BMP, TIFF, WebP-lossless and every FUTURE decoder added at the chokepoint become fingerprintable here in the same act, permanently. Returns gray buffer + sets out_wh[0]=w, out_wh[1]=h; 0 on failure/unsupported. license_tier: ORIGINAL

dependencies 3 imports · 7 importers

nx_jpeg_ascii.nx nx_gif_decode.nx nx_img_bytes_to_rgb.nx nx_image_gray.nx nx_archive_media_recovery.nx nx_image_index.nx nx_image_search.nx nx_img_decode_gate.nx nx_imgsearch.nx nx_revimg_crawl.nx nx_revimg_crawl_run.nx

imports: nx_jpeg_ascii.nxnx_gif_decode.nxnx_img_bytes_to_rgb.nx

imported by: nx_archive_media_recovery.nxnx_image_index.nxnx_image_search.nxnx_img_decode_gate.nxnx_imgsearch.nxnx_revimg_crawl.nxnx_revimg_crawl_run.nx

structs

none

consts

none

functions

15func nx_img_to_gray(path: *u8, out_wh: *i64) -> *u8