nx_skin_tone_ita.nx
buildroot/runtime/nx_skin_tone_ita.nx
about
nx_skin_tone_ita.nx -- Individual Typology Angle skin classifier.
Tier 1 of nxc2/docs/IMAGE_VALIDATION_AMBIGUITY_LADDER.md. Maps
mean skin-pixel CIELab triple to a SCALAR (ITA in degrees Q10)
and a sealed 6-band classification approximating Fitzpatrick
types I-VI.
Reference: del Bino & Bernerd 2013, "Variations in skin colour
and the biological consequences of ultraviolet radiation
exposure" (Brit J Dermatol). ITA definition:
ITA = arctan( (L* - 50) / b* ) * (180/pi) degrees
Bands per del Bino 2013 + Chardon 1991:
ITA > 55 -- Very Light (Fitzpatrick I)
41 to 55 -- Light (Fitzpatrick II)
28 to 41 -- Intermediate (Fitzpatrick III)
10 to 28 -- Tan (Fitzpatrick IV)
-30 to 10 -- Brown (Fitzpatrick V)
< -30 -- Dark (Fitzpatrick VI)
Inputs are pre-computed mean CIELab values in Q10 (multiply by
1024). Substrate's discipline is to keep this primitive
SINGLE-RESPONSIBILITY: classify a given Lab triple. Caller
composes with nx_color_skin_mask + future nx_lab_from_rgb.
genealogy_id: del_bino_2013_chardon_1991
lineage_id: substrate_skin_chroma_v1
dependencies 3 imports · 3 importers
imports: nx_syscalls.nxnx_runtime.nxnx_tier.nx
imported by: nx_image_grade_v0.nxnx_image_grade_v1.nxnx_image_grade_v2.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| 68 | struct NxSkinToneIta |
consts
| 39 | const NX_MAGIC_46080: i64 = 46080 |
| 40 | const NX_MAGIC_27203: i64 = 27203 |
| 41 | const NX_MAGIC_14373: i64 = 14373 |
| 42 | const NX_MAGIC_7296: i64 = 7296 |
| 43 | const NX_MAGIC_3662: i64 = 3662 |
| 44 | const NX_MAGIC_1833: i64 = 1833 |
| 45 | const NX_MAGIC_1024: i64 = 1024 |
| 47 | const NX_ITA_Q10: nx_int = 1024 |
| 48 | const NX_ITA_DEG_PER_RAD_Q10: nx_int = 58695 // 57.2958 * 1024 |
| 51 | const NX_ITA_BAND_VERY_LIGHT: nx_int = 0 |
| 52 | const NX_ITA_BAND_LIGHT: nx_int = 1 |
| 53 | const NX_ITA_BAND_INTERMEDIATE: nx_int = 2 |
| 54 | const NX_ITA_BAND_TAN: nx_int = 3 |
| 55 | const NX_ITA_BAND_BROWN: nx_int = 4 |
| 56 | const NX_ITA_BAND_DARK: nx_int = 5 |
| 57 | const NX_ITA_BAND_N: nx_int = 6 |
| 60 | const NX_ITA_THR_VERY_LIGHT_Q10: nx_int = 56320 // 55 * 1024 |
| 61 | const NX_ITA_THR_LIGHT_Q10: nx_int = 41984 // 41 * 1024 |
| 62 | const NX_ITA_THR_INTERMEDIATE_Q10: nx_int = 28672 // 28 * 1024 |
| 63 | const NX_ITA_THR_TAN_Q10: nx_int = 10240 // 10 * 1024 |
| 64 | const NX_ITA_THR_BROWN_Q10: nx_int = -30720 // -30 * 1024 |
| 77 | const NX_ITA_RESULT_BYTES: nx_size = 48 |
| 85 | const NX_ITA_CORDIC_ITERS: nx_int = 8 |
functions
| 97 | func _ita_cordic_angle_q10(i: nx_int) -> nx_int called by 1: _ita_atan2_q10 |
| 116 | func _ita_atan2_q10(y_q10: nx_int, x_q10: nx_int) -> nx_int |
| 175 | func nx_ita_band_from_q10(ita_deg_q10: nx_int) -> nx_int |
| 186 | func nx_skin_tone_ita_compute( |
| 208 | func main() -> nx_int |