nx_color_v2.nx
buildroot/runtime/nx_color_v2.nx
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
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
| 45 | struct HSVColor |
| 110 | struct YCbCrColor |
| 195 | struct Palette |
consts
| 193 | const NX_COLOR_KMEANS_MAX_K: i64 = 16 |
| 302 | const NX_COLOR_GRAY_THRESHOLD: i64 = 20 |
functions
| 51 | func nx_color_max3(a: i64, b: i64, c: i64) -> i64 |
| 58 | func nx_color_min3(a: i64, b: i64, c: i64) -> i64 |
| 65 | func nx_color_rgb_to_hsv(r: i64, g: i64, b: i64, out: *HSVColor) -> i64 |
| 116 | func nx_color_rgb_to_ycbcr(r: i64, g: i64, b: i64, out: *YCbCrColor) -> i64 |
| 152 | func nx_color_kovac_skin_pixel(r: i64, g: i64, b: i64) -> i64 |
| 164 | func nx_color_skin_mask(rgb: *Image) -> *Image |
| 203 | func nx_palette_alloc(k: i64) -> *Palette called by 1: nx_color_kmeans_palette |
| 215 | func nx_color_dist_sq(r1: i64, g1: i64, b1: i64, called by 1: nx_color_kmeans_palette |
| 223 | func nx_color_kmeans_palette(rgb: *Image, k: i64, max_iter: i64) -> *Palette |
| 304 | func nx_color_dominant_channel(r: i64, g: i64, b: i64) -> i64 |