41
70
} GimpRGBCompositeMode;
44
void gimp_rgb_set (GimpRGB *rgb,
48
void gimp_rgb_set_alpha (GimpRGB *rgb,
51
void gimp_rgb_set_uchar (GimpRGB *rgb,
55
void gimp_rgb_get_uchar (const GimpRGB *rgb,
60
gboolean gimp_rgb_parse_name (GimpRGB *rgb,
63
gboolean gimp_rgb_parse_hex (GimpRGB *rgb,
66
gboolean gimp_rgb_parse_css (GimpRGB *rgb,
70
void gimp_rgb_add (GimpRGB *rgb1,
72
void gimp_rgb_subtract (GimpRGB *rgb1,
74
void gimp_rgb_multiply (GimpRGB *rgb1,
76
gdouble gimp_rgb_distance (const GimpRGB *rgb1,
79
gdouble gimp_rgb_max (const GimpRGB *rgb);
80
gdouble gimp_rgb_min (const GimpRGB *rgb);
81
void gimp_rgb_clamp (GimpRGB *rgb);
83
void gimp_rgb_gamma (GimpRGB *rgb,
86
gdouble gimp_rgb_intensity (const GimpRGB *rgb);
87
guchar gimp_rgb_intensity_uchar (const GimpRGB *rgb);
89
void gimp_rgb_composite (GimpRGB *color1,
90
const GimpRGB *color2,
91
GimpRGBCompositeMode mode);
73
void gimp_rgb_set (GimpRGB *rgb,
77
void gimp_rgb_set_alpha (GimpRGB *rgb,
80
void gimp_rgb_set_uchar (GimpRGB *rgb,
84
void gimp_rgb_get_uchar (const GimpRGB *rgb,
89
gboolean gimp_rgb_parse_name (GimpRGB *rgb,
92
gboolean gimp_rgb_parse_hex (GimpRGB *rgb,
95
gboolean gimp_rgb_parse_css (GimpRGB *rgb,
99
void gimp_rgb_add (GimpRGB *rgb1,
100
const GimpRGB *rgb2);
101
void gimp_rgb_subtract (GimpRGB *rgb1,
102
const GimpRGB *rgb2);
103
void gimp_rgb_multiply (GimpRGB *rgb1,
105
gdouble gimp_rgb_distance (const GimpRGB *rgb1,
106
const GimpRGB *rgb2);
108
gdouble gimp_rgb_max (const GimpRGB *rgb);
109
gdouble gimp_rgb_min (const GimpRGB *rgb);
110
void gimp_rgb_clamp (GimpRGB *rgb);
112
void gimp_rgb_gamma (GimpRGB *rgb,
115
gdouble gimp_rgb_luminance (const GimpRGB *rgb);
116
guchar gimp_rgb_luminance_uchar (const GimpRGB *rgb);
118
#ifndef GIMP_DISABLE_DEPRECATED
119
gdouble gimp_rgb_intensity (const GimpRGB *rgb);
120
guchar gimp_rgb_intensity_uchar (const GimpRGB *rgb);
123
void gimp_rgb_composite (GimpRGB *color1,
124
const GimpRGB *color2,
125
GimpRGBCompositeMode mode);
93
127
/* access to the list of color names */
94
gint gimp_rgb_list_names (const gchar ***names,
98
void gimp_rgba_set (GimpRGB *rgba,
104
void gimp_rgba_set_uchar (GimpRGB *rgba,
109
void gimp_rgba_get_uchar (const GimpRGB *rgba,
115
gboolean gimp_rgba_parse_css (GimpRGB *rgba,
119
void gimp_rgba_add (GimpRGB *rgba1,
120
const GimpRGB *rgba2);
121
void gimp_rgba_subtract (GimpRGB *rgba1,
122
const GimpRGB *rgba2);
123
void gimp_rgba_multiply (GimpRGB *rgba,
126
gdouble gimp_rgba_distance (const GimpRGB *rgba1,
127
const GimpRGB *rgba2);
128
gint gimp_rgb_list_names (const gchar ***names,
132
void gimp_rgba_set (GimpRGB *rgba,
138
void gimp_rgba_set_uchar (GimpRGB *rgba,
143
void gimp_rgba_get_uchar (const GimpRGB *rgba,
149
gboolean gimp_rgba_parse_css (GimpRGB *rgba,
153
void gimp_rgba_add (GimpRGB *rgba1,
154
const GimpRGB *rgba2);
155
void gimp_rgba_subtract (GimpRGB *rgba1,
156
const GimpRGB *rgba2);
157
void gimp_rgba_multiply (GimpRGB *rgba,
160
gdouble gimp_rgba_distance (const GimpRGB *rgba1,
161
const GimpRGB *rgba2);
131
165
/* Map RGB to intensity */
133
#define GIMP_RGB_INTENSITY_RED 0.30
134
#define GIMP_RGB_INTENSITY_GREEN 0.59
135
#define GIMP_RGB_INTENSITY_BLUE 0.11
168
* The weights to compute true CIE luminance from linear red, green
169
* and blue, as defined by the ITU-R Recommendation BT.709, "Basic
170
* Parameter Values for the HDTV Standard for the Studio and for
171
* International Programme Exchange" (1990). Also suggested in the
172
* sRGB colorspace specification by the W3C.
175
#define GIMP_RGB_LUMINANCE_RED (0.2126)
176
#define GIMP_RGB_LUMINANCE_GREEN (0.7152)
177
#define GIMP_RGB_LUMINANCE_BLUE (0.0722)
179
#define GIMP_RGB_LUMINANCE(r,g,b) ((r) * GIMP_RGB_LUMINANCE_RED + \
180
(g) * GIMP_RGB_LUMINANCE_GREEN + \
181
(b) * GIMP_RGB_LUMINANCE_BLUE)
184
#ifndef GIMP_DISABLE_DEPRECATED
187
* The coefficients below properly computed luminance for monitors
188
* having phosphors that were contemporary at the introduction of NTSC
189
* television in 1953. They are still appropriate for computing video
190
* luma. However, these coefficients do not accurately compute
191
* luminance for contemporary monitors. The use of these definitions
195
#define GIMP_RGB_INTENSITY_RED (0.30)
196
#define GIMP_RGB_INTENSITY_GREEN (0.59)
197
#define GIMP_RGB_INTENSITY_BLUE (0.11)
136
199
#define GIMP_RGB_INTENSITY(r,g,b) ((r) * GIMP_RGB_INTENSITY_RED + \
137
(g) * GIMP_RGB_INTENSITY_GREEN + \
138
(b) * GIMP_RGB_INTENSITY_BLUE)
200
(g) * GIMP_RGB_INTENSITY_GREEN + \
201
(b) * GIMP_RGB_INTENSITY_BLUE)