code wiki / (root) / nx_color_palette.nx

nx_color_palette.nx

buildroot/runtime/nx_color_palette.nx

4972 B138 linesdepth 5pulls 6 transitivereach 2 importersview sourcekind librarytopic color
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_image.nx nx_color_palette.nx nx_oscar_batch_test.nx nx_quality_driver.nx

imports: nx_syscalls.nxnx_image.nx

imported by: nx_oscar_batch_test.nxnx_quality_driver.nx

structs

none

consts

36const NX_MAGIC_1024: i64 = 1024
38const NX_PALETTE_UNKNOWN: i64 = 0
39const NX_PALETTE_WARM_AMBER: i64 = 1
40const NX_PALETTE_COOL_BLUE: i64 = 2
41const NX_PALETTE_TEAL_ORANGE: i64 = 3
42const NX_PALETTE_MONOCHROME: i64 = 4
43const NX_PALETTE_PASTEL_SOFT: i64 = 5
44const NX_PALETTE_SATURATED_BOLD: i64 = 6
45const NX_PALETTE_EARTH_NEUTRAL: i64 = 7
46const NX_PALETTE_NIGHT_NEON: i64 = 8
48const NX_PAL_RES_MEAN_R: i64 = 0
49const NX_PAL_RES_MEAN_G: i64 = 1
50const NX_PAL_RES_MEAN_B: i64 = 2
51const NX_PAL_RES_SAT_Q10: i64 = 3
52const NX_PAL_RES_WARM_Q10: i64 = 4
53const NX_PAL_RES_SPREAD_Q10: i64 = 5
54const NX_PAL_RES_KIND: i64 = 6
55const NX_PAL_RES_CONF_Q10: i64 = 7
56const NX_PAL_RES_FIELDS: i64 = 8

functions

59func nx_color_palette(rgb: *Image, result: *i64) -> i64
called by 2: mainmain calls 1: nx_image_get