code wiki / (root) / nx_colordesc.nx

nx_colordesc.nx

buildroot/runtime/nx_colordesc.nx

3082 B77 linesdepth 3pulls 3 transitivereach 6 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_colordesc.nx -- CHROMA color-layout descriptor (brightness-invariant), the color complement to nx_visdesc. dHash and the edge/tone descriptor both run on GRAYSCALE -- so two fields of equal luma but different hue (a red field vs a green field) collapse to the SAME representation and are indistinguishable. This descriptor carries the color axis grayscale throws away: a 4x4 spatial grid of average chroma (Cb,Cr) -> a 32-dim integer vector ranked by L1. Chroma is computed as (channel - luma), so a uniform additive brightness/exposure shift cancels EXACTLY -> brightness-invariant by construction. Integer + deterministic + zero-dep. Pairs with nx_visdesc (structure/tone) for a full visual signature; "Google-lite" color-layout, the MPEG-7 CLD lineage done sovereignly. genealogy_id: kasson_1992_ycc + manjunath_2001_mpeg7_cld (color-layout descriptor) license_tier: ORIGINAL

dependencies 1 imports · 3 importers

syscalls.nx nx_colordesc.nx nx_colordesc_gate.nx nx_img_to_rgb_gate.nx nx_imgsig.nx

imports: syscalls.nx

imported by: nx_colordesc_gate.nxnx_img_to_rgb_gate.nxnx_imgsig.nx

structs

none

consts

14const CD_GRID: i64 = 4
15const CD_DIM: i64 = 32 // CD_GRID*CD_GRID*2 (Cb,Cr per cell)

functions

17func nx_colordesc_dim() -> i64 { return CD_DIM }
19func cd_clamp255(v: i64) -> i64 { if v < 0 { return 0 } if v > 255 { return 255 } return v }
23func nx_colordesc_extract(rgb: *u8, w: i64, h: i64, out: *i64) -> i64
67func nx_colordesc_l1(a: *i64, b: *i64) -> i64
called by 3: mainmaing_l1mode