code wiki / (root) / nx_color_v2.nx

nx_color_v2.nx

buildroot/runtime/nx_color_v2.nx

9920 B311 linesdepth 5pulls 6 transitivereach 30 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 · 9 importers

syscalls.nx nx_axioms.nx nx_i128.nx nx_image.nx nx_color_v2.nx nx_aesthetics.nx nx_arm_count.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_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
195struct Palette

consts

193const NX_COLOR_KMEANS_MAX_K: i64 = 16
302const 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
152func nx_color_kovac_skin_pixel(r: i64, g: i64, b: i64) -> i64
164func nx_color_skin_mask(rgb: *Image) -> *Image
203func nx_palette_alloc(k: i64) -> *Palette
215func nx_color_dist_sq(r1: i64, g1: i64, b1: i64,
223func nx_color_kmeans_palette(rgb: *Image, k: i64, max_iter: i64) -> *Palette
304func nx_color_dominant_channel(r: i64, g: i64, b: i64) -> i64
called by 2: mainmain calls 2: nx_color_max3nx_color_min3