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 · 10 importers
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
| 45 | struct HSVColor |
| 110 | struct YCbCrColor |
| 260 | struct Palette |
consts
| 155 | const NX_SKIN_Y_MIN: i64 = 80 |
| 156 | const NX_SKIN_CB_LO: i64 = 85 |
| 157 | const NX_SKIN_CB_HI: i64 = 135 |
| 158 | const NX_SKIN_CR_LO: i64 = 135 |
| 159 | const NX_SKIN_CR_HI: i64 = 180 |
| 192 | const NX_SKIN_LOCUS_CB_LO: i64 = 77 |
| 193 | const NX_SKIN_LOCUS_CB_HI: i64 = 127 |
| 194 | const NX_SKIN_LOCUS_CR_LO: i64 = 133 |
| 195 | const NX_SKIN_LOCUS_CR_HI: i64 = 173 |
| 258 | const NX_COLOR_KMEANS_MAX_K: i64 = 16 |
| 367 | 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 |
| 171 | func nx_color_skin_chroma_ycc(cb: i64, cr: i64) -> i64 |
| 181 | func nx_color_skin_kovac_ycc(y: i64, cb: i64, cr: i64) -> i64 |
| 197 | func nx_color_skin_locus_ycc(cb: i64, cr: i64) -> i64 called by 1: nx_color_skin_flags_at |
| 205 | func nx_color_kovac_skin_pixel(r: i64, g: i64, b: i64) -> i64 |
| 219 | func nx_color_skin_flags_at(r: i64, g: i64, b: i64, ycc: *YCbCrColor) -> i64 |
| 229 | func nx_color_skin_mask(rgb: *Image) -> *Image |
| 268 | func nx_palette_alloc(k: i64) -> *Palette called by 1: nx_color_kmeans_palette |
| 280 | func nx_color_dist_sq(r1: i64, g1: i64, b1: i64, called by 1: nx_color_kmeans_palette |
| 288 | func nx_color_kmeans_palette(rgb: *Image, k: i64, max_iter: i64) -> *Palette |
| 369 | func nx_color_dominant_channel(r: i64, g: i64, b: i64) -> i64 |