![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "common/color_vocabulary.h"#include "common/utility.h"#include "system/macros.h"#include <glib/gi18n.h>
Include dependency graph for color_vocabulary.c:Go to the source code of this file.
Macros | |
| #define | LCH_HUE_SECTORS 15 |
| #define | LCH_LIGHTNESS_SECTORS 5 |
Functions | |
| static range_t | _compute_range (const gaussian_stats_t stats, const float factor) |
| char * | _get_ethnicity_name (const ethnicities_t index) |
| skin_color_t | get_skin_color (const size_t index) |
| char * | Lch_to_color_name (dt_aligned_pixel_t color) |
Name the colour at color in plain language, e.g. "salmon" or "olive drab". | |
| void | get_skin_tones_range () |
Variables | |
| static const char *const | _lch_color_names [15][5] |
| #define LCH_HUE_SECTORS 15 |
Hue sectors of 24 degrees, read at chroma 80-100.
Definition at line 189 of file color_vocabulary.c.
| #define LCH_LIGHTNESS_SECTORS 5 |
Lightness sectors of 20 %.
Definition at line 192 of file color_vocabulary.c.
|
static |
Definition at line 32 of file color_vocabulary.c.
References gaussian_stats_t::avg, range_t::bottom, factor, out, and gaussian_stats_t::std.
Referenced by get_skin_tones_range(), and Lch_to_color_name().
| char * _get_ethnicity_name | ( | const ethnicities_t | index | ) |
Definition at line 87 of file color_vocabulary.c.
References ETHNIE_AFRICAN_AM, ETHNIE_CAUCASIAN, ETHNIE_CHINESE, ETHNIE_END, ETHNIE_KURDISH, ETHNIE_MEXICAN, ETHNIE_THAI, and ethnicity_t::name.
Referenced by Lch_to_color_name().
| skin_color_t get_skin_color | ( | const size_t | index | ) |
Definition at line 101 of file color_vocabulary.c.
References ETHNIE_AFRICAN_AM, ETHNIE_CAUCASIAN, ETHNIE_CHINESE, ETHNIE_KURDISH, ETHNIE_MEXICAN, ETHNIE_THAI, skin_color_t::name, and SKINS.
Referenced by get_skin_tones_range(), and Lch_to_color_name().
| void get_skin_tones_range | ( | ) |
Definition at line 273 of file color_vocabulary.c.
References _compute_range(), skin_color_t::a, skin_color_t::b, range_t::bottom, dt_Lab_to_XYZ(), dt_XYZ_to_xyY(), get_skin_color(), i, k, skin_color_t::L, L, Lab, Lch, M_PI_F, SKINS, range_t::top, xyY, and XYZ.
| char * Lch_to_color_name | ( | dt_aligned_pixel_t | color | ) |
Name the colour at color in plain language, e.g. "salmon" or "olive drab".
Classifies by hue and lightness against a 15 x 5 grid of names, after two special cases: a chroma below 2.0 is "gray", and a colour falling inside the measured spread of any reference skin tone is named as such instead ("average Thai skin tone"), listing every ethnicity whose range it matches, one per line.
| color | CIE Lab 1976 turned into polar coordinates (Lch), as produced by dt_Lab_2_LCH(): L in percent, chroma, and hue NORMALIZED to [0, 1] – not degrees. Passing degrees puts every lookup out of the table's domain. |
const char * that told the caller neither. The one call site leaked whenever a skin tone matched. Allocating on every path is what makes the contract statable. Definition at line 224 of file color_vocabulary.c.
References _compute_range(), _get_ethnicity_name(), _lch_color_names, skin_color_t::a, skin_color_t::b, color, dt_util_dstrcat(), skin_color_t::ethnicity, ETHNIE_END, FALSE, get_skin_color(), IS_NULL_PTR, skin_color_t::L, L, Lab, LCH_HUE_SECTORS, LCH_LIGHTNESS_SECTORS, out, SKINS, and TRUE.
Referenced by _sample_tooltip_callback().
|
static |
Definition at line 206 of file color_vocabulary.c.
Referenced by Lch_to_color_name().