code wiki / (root) / nx_lash_transition.nx

nx_lash_transition.nx

buildroot/runtime/nx_lash_transition.nx

3966 B108 linesdepth 5pulls 6 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_lash_transition.nx -- eyelid-to-lash edge gradient softness. Mannequin face marker: lashes meet eyelid as a hard sharp line (rendered as a discrete edge). Real lashes fade softly into the eyelid skin tone over 2-3 pixels of micro-blur. Math: Within the eyelid band (3-5 px ABOVE the iris top), measure per-column vertical luminance gradient |Y(y) - Y(y-1)| and accumulate. High mean gradient = sharp line = MANNEQUIN. Low mean gradient = soft fade = NATURAL. Output flat-array: result[0] = pixel_count result[1] = mean_gradient result[2] = max_gradient result[3] = hard_transitions (count of gradients > HARD_THRESH) result[4] = verdict (0=MANNEQUIN, 1=AMBIGUOUS, 2=NATURAL)

dependencies 2 imports · 1 importers

nx_syscalls.nx nx_image.nx nx_lash_transition.nx nx_lash_transition_test.nx

imports: nx_syscalls.nxnx_image.nx

imported by: nx_lash_transition_test.nx

structs

none

consts

29const NX_LASH_RES_PIXELS: i64 = 0
30const NX_LASH_RES_MEAN_GRAD: i64 = 1
31const NX_LASH_RES_MAX_GRAD: i64 = 2
32const NX_LASH_RES_HARD_TRANS: i64 = 3
33const NX_LASH_RES_VERDICT: i64 = 4
34const NX_LASH_RES_FIELDS: i64 = 5
36const NX_LASH_VERDICT_MANNEQUIN: i64 = 0
37const NX_LASH_VERDICT_AMBIGUOUS: i64 = 1
38const NX_LASH_VERDICT_NATURAL: i64 = 2
41const NX_LASH_HARD_THRESH: i64 = 60
42const NX_LASH_MEAN_NATURAL_MAX: i64 = 25 // mean gradient ≤ 25 = soft NATURAL
43const NX_LASH_MEAN_MANNEQUIN_MIN: i64 = 45 // mean gradient ≥ 45 = sharp MANNEQUIN

functions

46func nx_lash_lum(rgb: *Image, x: i64, y: i64) -> i64
called by 1: nx_lash_transition calls 1: nx_image_get
60func nx_lash_transition(rgb: *Image, bbox: *i64, band_height: i64,
called by 1: main calls 1: nx_lash_lum