code wiki / (root) / nx_skin_pore_detail.nx

nx_skin_pore_detail.nx

buildroot/runtime/nx_skin_pore_detail.nx

4118 B115 linesdepth 5pulls 6 transitivereach 1 importersview sourcekind librarytopic skin
docsdependenciesstructsconstsfunctions

about

nx_skin_pore_detail.nx -- high-frequency pore-scale texture detector. At 8k+ render quality real skin shows individual pores: tiny dark micro-spots of pore-scale (1-2 px at full res) creating high- frequency texture. Mannequin / SDXL-smooth renders suppress this: skin is uniform within local 3x3 neighborhoods. The substrate measures MEAN |Y(x,y) - mean(Y, 3x3)| over skin-mask pixels — the classic high-pass-vs-flat metric. Math: For each skin-mask pixel: local_mean = sum of 3x3 luminance / 9 residual = |luminance - local_mean| detail_score = sum(residual) / count(skin_pixels) < 3 → SMOOTH_MANNEQUIN (no pores) 3..8 → MODERATE_TEXTURE (acceptable) ≥ 8 → DETAILED_NATURAL (visible pore-scale detail) Output flat-array: result[0] = pixel_count result[1] = mean_residual result[2] = max_residual result[3] = pore_candidate_count (pixels with residual > 12) result[4] = verdict

dependencies 2 imports · 1 importers

nx_syscalls.nx nx_image.nx nx_skin_pore_detail.nx nx_arousal_detail_test.nx

imports: nx_syscalls.nxnx_image.nx

imported by: nx_arousal_detail_test.nx

structs

none

consts

36const NX_PORE_RES_PIXELS: i64 = 0
37const NX_PORE_RES_MEAN_RES: i64 = 1
38const NX_PORE_RES_MAX_RES: i64 = 2
39const NX_PORE_RES_CANDIDATES: i64 = 3
40const NX_PORE_RES_VERDICT: i64 = 4
41const NX_PORE_RES_FIELDS: i64 = 5
43const NX_PORE_VERDICT_SMOOTH_MANNEQUIN: i64 = 0
44const NX_PORE_VERDICT_MODERATE_TEXTURE: i64 = 1
45const NX_PORE_VERDICT_DETAILED_NATURAL: i64 = 2
47const NX_PORE_THRESH_SMOOTH: i64 = 3
48const NX_PORE_THRESH_DETAILED: i64 = 8
49const NX_PORE_CANDIDATE_THRESH: i64 = 12

functions

52func nx_pore_local_mean(rgb: *Image, x: i64, y: i64) -> i64
called by 1: nx_skin_pore_detail calls 1: nx_image_get
70func nx_skin_pore_detail(rgb: *Image, skin_mask: *Image, result: *i64) -> i64
called by 1: main calls 2: nx_image_getnx_pore_local_mean