code wiki / (root) / nx_skin_tone_ita.nx

nx_skin_tone_ita.nx

buildroot/runtime/nx_skin_tone_ita.nx

10000 B280 linesdepth 3pulls 3 transitivereach 7 importersview sourcekind tooltopic skin
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_runtime.nx nx_tier.nx nx_skin_tone_ita.nx nx_image_grade_v0.nx nx_image_grade_v1.nx nx_image_grade_v2.nx

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

main _ita_atan2_q10 _ita_cordic_angle_q10 nx_skin_tone_ita_compute sys_mmap _ita_atan2_q10 ↻ nx_ita_band_from_q10 nx_ita_band_from_q10 ↻

structs

68struct NxSkinToneIta

consts

39const NX_MAGIC_46080: i64 = 46080
40const NX_MAGIC_27203: i64 = 27203
41const NX_MAGIC_14373: i64 = 14373
42const NX_MAGIC_7296: i64 = 7296
43const NX_MAGIC_3662: i64 = 3662
44const NX_MAGIC_1833: i64 = 1833
45const NX_MAGIC_1024: i64 = 1024
47const NX_ITA_Q10: nx_int = 1024
48const NX_ITA_DEG_PER_RAD_Q10: nx_int = 58695 // 57.2958 * 1024
51const NX_ITA_BAND_VERY_LIGHT: nx_int = 0
52const NX_ITA_BAND_LIGHT: nx_int = 1
53const NX_ITA_BAND_INTERMEDIATE: nx_int = 2
54const NX_ITA_BAND_TAN: nx_int = 3
55const NX_ITA_BAND_BROWN: nx_int = 4
56const NX_ITA_BAND_DARK: nx_int = 5
57const NX_ITA_BAND_N: nx_int = 6
60const NX_ITA_THR_VERY_LIGHT_Q10: nx_int = 56320 // 55 * 1024
61const NX_ITA_THR_LIGHT_Q10: nx_int = 41984 // 41 * 1024
62const NX_ITA_THR_INTERMEDIATE_Q10: nx_int = 28672 // 28 * 1024
63const NX_ITA_THR_TAN_Q10: nx_int = 10240 // 10 * 1024
64const NX_ITA_THR_BROWN_Q10: nx_int = -30720 // -30 * 1024
77const NX_ITA_RESULT_BYTES: nx_size = 48
85const NX_ITA_CORDIC_ITERS: nx_int = 8

functions

97func _ita_cordic_angle_q10(i: nx_int) -> nx_int
called by 1: _ita_atan2_q10
116func _ita_atan2_q10(y_q10: nx_int, x_q10: nx_int) -> nx_int
175func nx_ita_band_from_q10(ita_deg_q10: nx_int) -> nx_int
186func nx_skin_tone_ita_compute(
208func main() -> nx_int