code wiki / (root) / nx_color_v2.nx

nx_color_v2.nx

buildroot/runtime/nx_color_v2.nx

13638 B376 linesdepth 5pulls 6 transitivereach 31 importersview sourcekind librarytopic color
docsdependenciesstructsconstsfunctions

about

nx_color_v2.nx -- full color-space transforms (V1 of vision rollout). Per VISION_FROM_BITS_UP doc, V1 (color) closes ~50% of the gap to classical scene understanding. Ships: - RGB -> HSV (Hue 0..360 degrees, Sat/Val 0..255) - RGB -> YCbCr (Rec.601 broadcast standard) - K-means palette extraction (3D RGB clustering) - Skin-mask via Kovac 2003 fixed-rule YCbCr classifier - Dominant-channel detection All i64. Q-format scaling for fractional intermediates. No f64. genealogy_id: smith_1978_hsv + itu_r_bt601_ycbcr + kovac_2003_skin + lloyd_1957_kmeans lineage_id: color_space_transform + fixed_point_arithmetic axioms: NX_AX_ALG_DISTRIBUTIVITY (linear transforms compose)

dependencies 4 imports · 10 importers

syscalls.nx nx_axioms.nx nx_i128.nx nx_image.nx nx_color_v2.nx nx_aesthetics.nx nx_arm_count.nx nx_charjudge_census.nx nx_color_v2_test.nx nx_garment_lib.nx nx_mise_en_scene.nx nx_multi_body.nx nx_outfit_coverage.nx nx_region.nx nx_vision_pipeline_test.nx

imports: syscalls.nxnx_axioms.nxnx_i128.nxnx_image.nx

imported by: nx_aesthetics.nxnx_arm_count.nxnx_charjudge_census.nxnx_color_v2_test.nxnx_garment_lib.nxnx_mise_en_scene.nxnx_multi_body.nxnx_outfit_coverage.nxnx_region.nxnx_vision_pipeline_test.nx

structs

45struct HSVColor
110struct YCbCrColor
260struct Palette

consts

155const NX_SKIN_Y_MIN: i64 = 80
156const NX_SKIN_CB_LO: i64 = 85
157const NX_SKIN_CB_HI: i64 = 135
158const NX_SKIN_CR_LO: i64 = 135
159const NX_SKIN_CR_HI: i64 = 180
192const NX_SKIN_LOCUS_CB_LO: i64 = 77
193const NX_SKIN_LOCUS_CB_HI: i64 = 127
194const NX_SKIN_LOCUS_CR_LO: i64 = 133
195const NX_SKIN_LOCUS_CR_HI: i64 = 173
258const NX_COLOR_KMEANS_MAX_K: i64 = 16
367const NX_COLOR_GRAY_THRESHOLD: i64 = 20

functions

51func nx_color_max3(a: i64, b: i64, c: i64) -> i64
58func nx_color_min3(a: i64, b: i64, c: i64) -> i64
65func nx_color_rgb_to_hsv(r: i64, g: i64, b: i64, out: *HSVColor) -> i64
116func nx_color_rgb_to_ycbcr(r: i64, g: i64, b: i64, out: *YCbCrColor) -> i64
171func nx_color_skin_chroma_ycc(cb: i64, cr: i64) -> i64
181func nx_color_skin_kovac_ycc(y: i64, cb: i64, cr: i64) -> i64
197func nx_color_skin_locus_ycc(cb: i64, cr: i64) -> i64
205func nx_color_kovac_skin_pixel(r: i64, g: i64, b: i64) -> i64
219func nx_color_skin_flags_at(r: i64, g: i64, b: i64, ycc: *YCbCrColor) -> i64
229func nx_color_skin_mask(rgb: *Image) -> *Image
268func nx_palette_alloc(k: i64) -> *Palette
280func nx_color_dist_sq(r1: i64, g1: i64, b1: i64,
288func nx_color_kmeans_palette(rgb: *Image, k: i64, max_iter: i64) -> *Palette
369func nx_color_dominant_channel(r: i64, g: i64, b: i64) -> i64
called by 2: mainmain calls 2: nx_color_max3nx_color_min3