Ansel
0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
color_vocabulary.h
Go to the documentation of this file.
1
/*
2
This file is part of the Ansel project.
3
Copyright (C) 2022, 2024 Aurélien PIERRE.
4
Copyright (C) 2022 Martin Bařinka.
5
Copyright (C) 2022 Pascal Obry.
6
7
Ansel is free software: you can redistribute it and/or modify
8
it under the terms of the GNU General Public License as published by
9
the Free Software Foundation, either version 3 of the License, or
10
(at your option) any later version.
11
12
Ansel is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
16
17
You should have received a copy of the GNU General Public License
18
along with Ansel. If not, see <http://www.gnu.org/licenses/>.
19
*/
20
21
#ifndef DT_COMMON_COLOR_VOCABULARY_H
22
#define DT_COMMON_COLOR_VOCABULARY_H
23
24
#include "
common/colorspaces_inline_conversions.h
"
25
26
#include <glib.h>
27
28
29
// declare a model average ± standard deviation
30
typedef
struct
gaussian_stats_t
31
{
32
float
avg
;
33
float
std
;
34
}
gaussian_stats_t
;
35
36
37
// bounds of the range
38
typedef
struct
range_t
39
{
40
float
bottom
;
41
float
top
;
42
}
range_t
;
43
44
45
// ID keys for the ethnicities database
46
typedef
enum
ethnicities_t
47
{
48
ETHNIE_CHINESE
= 0,
49
ETHNIE_THAI
= 1,
50
ETHNIE_KURDISH
= 2,
51
ETHNIE_CAUCASIAN
= 3,
52
ETHNIE_AFRICAN_AM
= 4,
53
ETHNIE_MEXICAN
= 5,
54
ETHNIE_END
= 6
55
}
ethnicities_t
;
56
57
58
// Translatable names for ethnicities
59
typedef
struct
ethnicity_t
60
{
61
char
*
name
;
62
ethnicities_t
ethnicity
;
63
}
ethnicity_t
;
64
65
66
// Database entry for skin parts color of an ethnicity
67
typedef
struct
skin_color_t
68
{
69
char
*
name
;
70
ethnicities_t
ethnicity
;
71
gaussian_stats_t
L
;
72
gaussian_stats_t
a
;
73
gaussian_stats_t
b
;
74
}
skin_color_t
;
75
76
77
#define SKINS 16
78
79
// returns a color name for color
101
char
*
Lch_to_color_name
(
dt_aligned_pixel_t
color
);
102
103
// Parametric sweeping of Lch boundaries (in CIE Luv 1976) for all known skin tones +/- 2 std
104
void
get_skin_tones_range
();
105
106
#endif
// DT_COMMON_COLOR_VOCABULARY_H
107
108
// clang-format off
109
// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
110
// vim: shiftwidth=2 expandtab tabstop=2 cindent
111
// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
112
// clang-format on
Lch_to_color_name
char * Lch_to_color_name(dt_aligned_pixel_t color)
Name the colour at color in plain language, e.g. "salmon" or "olive drab".
Definition
color_vocabulary.c:224
get_skin_tones_range
void get_skin_tones_range()
Definition
color_vocabulary.c:273
ethnicities_t
ethnicities_t
Definition
color_vocabulary.h:47
ETHNIE_CAUCASIAN
@ ETHNIE_CAUCASIAN
Definition
color_vocabulary.h:51
ETHNIE_KURDISH
@ ETHNIE_KURDISH
Definition
color_vocabulary.h:50
ETHNIE_END
@ ETHNIE_END
Definition
color_vocabulary.h:54
ETHNIE_CHINESE
@ ETHNIE_CHINESE
Definition
color_vocabulary.h:48
ETHNIE_MEXICAN
@ ETHNIE_MEXICAN
Definition
color_vocabulary.h:53
ETHNIE_THAI
@ ETHNIE_THAI
Definition
color_vocabulary.h:49
ETHNIE_AFRICAN_AM
@ ETHNIE_AFRICAN_AM
Definition
color_vocabulary.h:52
colorspaces_inline_conversions.h
color
GdkRGBA color[]
Definition
geotagging.c:541
dt_aligned_pixel_t
DT_ALIGNED_PIXEL float dt_aligned_pixel_t[4]
Definition
simd.h:53
ethnicity_t
Definition
color_vocabulary.h:60
ethnicity_t::name
char * name
Definition
color_vocabulary.h:61
ethnicity_t::ethnicity
ethnicities_t ethnicity
Definition
color_vocabulary.h:62
gaussian_stats_t
Definition
color_vocabulary.h:31
gaussian_stats_t::std
float std
Definition
color_vocabulary.h:33
gaussian_stats_t::avg
float avg
Definition
color_vocabulary.h:32
range_t
Definition
color_vocabulary.h:39
range_t::top
float top
Definition
color_vocabulary.h:41
range_t::bottom
float bottom
Definition
color_vocabulary.h:40
skin_color_t
Definition
color_vocabulary.h:68
skin_color_t::ethnicity
ethnicities_t ethnicity
Definition
color_vocabulary.h:70
skin_color_t::b
gaussian_stats_t b
Definition
color_vocabulary.h:73
skin_color_t::L
gaussian_stats_t L
Definition
color_vocabulary.h:71
skin_color_t::name
char * name
Definition
color_vocabulary.h:69
skin_color_t::a
gaussian_stats_t a
Definition
color_vocabulary.h:72
src
common
color_vocabulary.h
Generated by
1.9.8