nx_color_palette.nx
buildroot/runtime/nx_color_palette.nx
about
nx_color_palette.nx -- Best Art Direction axis: color palette classifier.
Sealed palette family enum + per-image classifier from RGB image.
Classifies into one of 8 canonical cinema palettes:
WARM_AMBER golden hour / tungsten interior
COOL_BLUE moonlight / overcast / clinical
TEAL_ORANGE cinematic standard split-complement
MONOCHROME grayscale / single-hue
PASTEL_SOFT muted feminine
SATURATED_BOLD editorial fashion / pop
EARTH_NEUTRAL documentary natural
NIGHT_NEON cyberpunk / club
Each measurement scores how strongly the image fits each palette.
Top match wins. Confidence = top - second.
Output flat-array:
result[0] mean_R
result[1] mean_G
result[2] mean_B
result[3] saturation_q10
result[4] warmth_q10 (R-B normalized)
result[5] hue_spread_q10 (palette breadth)
result[6] classified_palette
result[7] confidence_q10
dependencies 2 imports · 2 importers
imports: nx_syscalls.nxnx_image.nx
imported by: nx_oscar_batch_test.nxnx_quality_driver.nx
structs
| none |
consts
| 36 | const NX_MAGIC_1024: i64 = 1024 |
| 38 | const NX_PALETTE_UNKNOWN: i64 = 0 |
| 39 | const NX_PALETTE_WARM_AMBER: i64 = 1 |
| 40 | const NX_PALETTE_COOL_BLUE: i64 = 2 |
| 41 | const NX_PALETTE_TEAL_ORANGE: i64 = 3 |
| 42 | const NX_PALETTE_MONOCHROME: i64 = 4 |
| 43 | const NX_PALETTE_PASTEL_SOFT: i64 = 5 |
| 44 | const NX_PALETTE_SATURATED_BOLD: i64 = 6 |
| 45 | const NX_PALETTE_EARTH_NEUTRAL: i64 = 7 |
| 46 | const NX_PALETTE_NIGHT_NEON: i64 = 8 |
| 48 | const NX_PAL_RES_MEAN_R: i64 = 0 |
| 49 | const NX_PAL_RES_MEAN_G: i64 = 1 |
| 50 | const NX_PAL_RES_MEAN_B: i64 = 2 |
| 51 | const NX_PAL_RES_SAT_Q10: i64 = 3 |
| 52 | const NX_PAL_RES_WARM_Q10: i64 = 4 |
| 53 | const NX_PAL_RES_SPREAD_Q10: i64 = 5 |
| 54 | const NX_PAL_RES_KIND: i64 = 6 |
| 55 | const NX_PAL_RES_CONF_Q10: i64 = 7 |
| 56 | const NX_PAL_RES_FIELDS: i64 = 8 |
functions
| 59 | func nx_color_palette(rgb: *Image, result: *i64) -> i64 |