code wiki / (root) / nx_image_grade_v1.nx

nx_image_grade_v1.nx

buildroot/runtime/nx_image_grade_v1.nx

17233 B488 linesdepth 8pulls 19 transitivereach 0 importersview sourcekind tooltopic image
docsdependenciesstructsconstsfunctions

about

nx_image_grade_v1.nx -- skin-localized image grading composer. CAPABILITY_COMPLETENESS: PARTIAL MISSING_CAPABILITIES: - face landmark detection (eye / mouth / nose / wrist / inside-elbow keypoints): queued; needed for the still- PENDING per-landmark axes (vein-signal at wrist, subsurface at fingertips, micro-expression at face, etc.) - VLM grader (the second triangulation source) - hand-specific segmentation: skin blob detection is generic; hand vs face vs torso disambiguation queued COVERED (PROMOTED FROM v0): - Skin-localized mean R/G/B via inline Kovac skin mask - Lab + ITA + undertone computed on SKIN PIXELS ONLY (no longer biased by clothing / background) - Skin coverage fraction (skin_pixels / total_pixels Q10) - Connected-component segmentation of skin region - Largest skin blob bbox -> caller can invoke per-region graders against it Composes: - nx_png_decoder + nx_jpeg_decoder (auto-detect by magic) - inline Kovac skin-pixel test (per Kovac 2003) - nx_segmenter_classical (connected-component labeling) - nx_lab_from_rgb (CIELab Q10) - nx_skin_tone_ita + nx_undertone_classify - nx_verdict_phrase genealogy_id: substrate_image_grade_v1_skin_localized_2026_05_16 lineage_id: nx_image_grade_v1

dependencies 10 imports · 0 importers

nx_syscalls.nx nx_runtime.nx nx_tier.nx nx_png_decoder.nx nx_jpeg_decoder.nx nx_verdict_phrase.nx nx_lab_from_rgb.nx nx_skin_tone_ita.nx nx_undertone_class.nx nx_segmenter_classical.nx nx_image_grade_v1.nx

imports: nx_syscalls.nxnx_runtime.nxnx_tier.nxnx_png_decoder.nxnx_jpeg_decoder.nxnx_verdict_phrase.nxnx_lab_from_rgb.nxnx_skin_tone_ita.nxnx_undertone_class.nxnx_segmenter_classical.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main _igv1_is_skin_pixel sys_mmap _igv1_detect_format nx_image_grade_v1 sys_mmap ↻ _igv1_detect_format ↻ nx_png_decode sys_mmap ↻ _png_check_signature _png_read_u32_be nx_crc32 nx_crc32_update nx_crc32_init nx_crc32_table_at _png_n_channels _png_bytes_per_pixel _png_n_channels ↻ _png_a7_expected _png_a7_col0 _png_a7_coli _png_a7_row0 _png_a7_rowi nx_zlib_inflate sys_mmap ↻ nx_deflate_inflate sys_mmap ↻ nx_bitstream_alloc sys_mmap ↻ _deflate_inflate_block nx_bitstream_read_lsb nx_bitstream_byte_align nx_bitstream_read_byte_ali _deflate_build_static_litl _deflate_build_static_dist _deflate_decode_huffman_bl sys_mmap ↻ _deflate_build_dynamic_tre _deflate_bytes_consumed adler32

structs

74struct NxIgv1AxisVerdict
87struct NxIgv1Report

consts

49const NX_MAGIC_1024: i64 = 1024
53const NX_IGV1_FORMAT_UNKNOWN: nx_int = 0
54const NX_IGV1_FORMAT_PNG: nx_int = 1
55const NX_IGV1_FORMAT_JPEG: nx_int = 2
57const NX_IGV1_OK: nx_int = 0
58const NX_IGV1_ERR_TOO_SHORT: nx_int = 1
59const NX_IGV1_ERR_UNKNOWN_FORMAT: nx_int = 2
60const NX_IGV1_ERR_DECODER: nx_int = 3
61const NX_IGV1_ERR_NULL_PIXELS: nx_int = 4
65const NX_IGV1_AXIS_OK: nx_int = 0
66const NX_IGV1_AXIS_PENDING_SEGMENTATION: nx_int = 1
67const NX_IGV1_AXIS_PENDING_LANDMARK: nx_int = 2
68const NX_IGV1_AXIS_PENDING_VLM: nx_int = 3
69const NX_IGV1_AXIS_NOT_APPLICABLE: nx_int = 4
70const NX_IGV1_AXIS_NO_SKIN_DETECTED: nx_int = 5
83const NX_IGV1_AXIS_VERDICT_BYTES: nx_size = 48
113const NX_IGV1_REPORT_BYTES: nx_size = 144
116const NX_IGV1_AX_DIMENSIONS: nx_int = 0
117const NX_IGV1_AX_LUMINANCE: nx_int = 1
118const NX_IGV1_AX_SKIN_TONE_ITA: nx_int = 4
119const NX_IGV1_AX_GLCM_TEXTURE: nx_int = 5
120const NX_IGV1_AX_PORE_DETAIL: nx_int = 7
121const NX_IGV1_AX_UNDERTONE: nx_int = 12
122const NX_IGV1_AX_VEIN_SIGNAL: nx_int = 16
123const NX_IGV1_AX_SUBSURFACE_SIGNAL: nx_int = 17
124const NX_IGV1_AX_MICRO_EXPRESSION: nx_int = 22
125const NX_IGV1_AX_SHADOW_DIRECTION: nx_int = 23
126const NX_IGV1_AX_FINGER_COUNT: nx_int = 24
127const NX_IGV1_AX_SURFACE_PLANE: nx_int = 27
128const NX_IGV1_AX_SKIN_COVERAGE: nx_int = 100 // v1 addition
130const NX_IGV1_N_AXES: nx_int = 13

functions

134func _igv1_detect_format(buf: *u8, n: nx_int) -> nx_int
166func _igv1_is_skin_pixel(r: nx_int, g: nx_int, b: nx_int) -> nx_int
187func _igv1_set_axis(axes: *NxIgv1AxisVerdict, idx: nx_int,
247func nx_image_grade_v1(input: *u8, input_size: nx_int) -> *NxIgv1Report
444func main() -> nx_int