1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>GimpColorSpace</title><meta name="generator" content="DocBook XSL Stylesheets V1.66.1"><link rel="start" href="index.html" title="GIMP Color Library Reference Manual"><link rel="up" href="libgimpcolor.html" title="Part�I.�GIMP Color Library"><link rel="prev" href="libgimpcolor-GimpCMYK.html" title="GimpCMYK"><link rel="next" href="libgimpcolor-GimpAdaptiveSupersample.html" title="GimpAdaptiveSupersample"><meta name="generator" content="GTK-Doc V1.2 (XML mode)"><style type="text/css">
2
.synopsis, .classsynopsis {
4
border: solid 1px #aaaaaa;
9
border: solid 1px #aaaaff;
18
border: solid 1px #ffaaaa;
25
.navigation a:visited {
31
</style></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libgimpcolor-GimpCMYK.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="libgimpcolor.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">GIMP Color Library Reference Manual</th><td><a accesskey="n" href="libgimpcolor-GimpAdaptiveSupersample.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr></table><div class="refentry" lang="en"><a name="libgimpcolor-GimpColorSpace"></a><div class="titlepage"></div><div class="refnamediv"><h2><span class="refentrytitle">GimpColorSpace</span></h2><p>GimpColorSpace — Utility functions which convert colors between different color models.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
35
struct <a href="libgimpcolor-GimpColorSpace.html#GimpHSL">GimpHSL</a>;
36
void <a href="libgimpcolor-GimpColorSpace.html#gimp-rgb-to-hsv">gimp_rgb_to_hsv</a> (const <a href="libgimpcolor-GimpRGB.html#GimpRGB">GimpRGB</a> *rgb,
37
<a href="libgimpcolor-GimpHSV.html#GimpHSV">GimpHSV</a> *hsv);
38
void <a href="libgimpcolor-GimpColorSpace.html#gimp-rgb-to-hsl">gimp_rgb_to_hsl</a> (const <a href="libgimpcolor-GimpRGB.html#GimpRGB">GimpRGB</a> *rgb,
39
<a href="libgimpcolor-GimpColorSpace.html#GimpHSL">GimpHSL</a> *hsl);
40
void <a href="libgimpcolor-GimpColorSpace.html#gimp-rgb-to-cmyk">gimp_rgb_to_cmyk</a> (const <a href="libgimpcolor-GimpRGB.html#GimpRGB">GimpRGB</a> *rgb,
42
href="../glib/glib-Basic-Types.html#gdouble"
44
<a href="libgimpcolor-GimpCMYK.html#GimpCMYK">GimpCMYK</a> *cmyk);
45
void <a href="libgimpcolor-GimpColorSpace.html#gimp-hsv-to-rgb">gimp_hsv_to_rgb</a> (const <a href="libgimpcolor-GimpHSV.html#GimpHSV">GimpHSV</a> *hsv,
46
<a href="libgimpcolor-GimpRGB.html#GimpRGB">GimpRGB</a> *rgb);
47
void <a href="libgimpcolor-GimpColorSpace.html#gimp-hsl-to-rgb">gimp_hsl_to_rgb</a> (const <a href="libgimpcolor-GimpColorSpace.html#GimpHSL">GimpHSL</a> *hsl,
48
<a href="libgimpcolor-GimpRGB.html#GimpRGB">GimpRGB</a> *rgb);
49
void <a href="libgimpcolor-GimpColorSpace.html#gimp-cmyk-to-rgb">gimp_cmyk_to_rgb</a> (const <a href="libgimpcolor-GimpCMYK.html#GimpCMYK">GimpCMYK</a> *cmyk,
50
<a href="libgimpcolor-GimpRGB.html#GimpRGB">GimpRGB</a> *rgb);
51
void <a href="libgimpcolor-GimpColorSpace.html#gimp-rgb-to-hwb">gimp_rgb_to_hwb</a> (const <a href="libgimpcolor-GimpRGB.html#GimpRGB">GimpRGB</a> *rgb,
53
href="../glib/glib-Basic-Types.html#gdouble"
56
href="../glib/glib-Basic-Types.html#gdouble"
57
>gdouble</a> *whiteness,
59
href="../glib/glib-Basic-Types.html#gdouble"
60
>gdouble</a> *blackness);
61
void <a href="libgimpcolor-GimpColorSpace.html#gimp-hwb-to-rgb">gimp_hwb_to_rgb</a> (<a
62
href="../glib/glib-Basic-Types.html#gdouble"
65
href="../glib/glib-Basic-Types.html#gdouble"
66
>gdouble</a> whiteness,
68
href="../glib/glib-Basic-Types.html#gdouble"
69
>gdouble</a> blackness,
70
<a href="libgimpcolor-GimpRGB.html#GimpRGB">GimpRGB</a> *rgb);
71
void <a href="libgimpcolor-GimpColorSpace.html#gimp-rgb-to-hsv-int">gimp_rgb_to_hsv_int</a> (<a
72
href="../glib/glib-Basic-Types.html#gint"
75
href="../glib/glib-Basic-Types.html#gint"
78
href="../glib/glib-Basic-Types.html#gint"
80
void <a href="libgimpcolor-GimpColorSpace.html#gimp-hsv-to-rgb-int">gimp_hsv_to_rgb_int</a> (<a
81
href="../glib/glib-Basic-Types.html#gint"
84
href="../glib/glib-Basic-Types.html#gint"
85
>gint</a> *saturation,
87
href="../glib/glib-Basic-Types.html#gint"
89
void <a href="libgimpcolor-GimpColorSpace.html#gimp-rgb-to-hsl-int">gimp_rgb_to_hsl_int</a> (<a
90
href="../glib/glib-Basic-Types.html#gint"
93
href="../glib/glib-Basic-Types.html#gint"
96
href="../glib/glib-Basic-Types.html#gint"
98
void <a href="libgimpcolor-GimpColorSpace.html#gimp-rgb-to-cmyk-int">gimp_rgb_to_cmyk_int</a> (<a
99
href="../glib/glib-Basic-Types.html#gint"
102
href="../glib/glib-Basic-Types.html#gint"
105
href="../glib/glib-Basic-Types.html#gint"
108
href="../glib/glib-Basic-Types.html#gint"
110
void <a href="libgimpcolor-GimpColorSpace.html#gimp-cmyk-to-rgb-int">gimp_cmyk_to_rgb_int</a> (<a
111
href="../glib/glib-Basic-Types.html#gint"
114
href="../glib/glib-Basic-Types.html#gint"
117
href="../glib/glib-Basic-Types.html#gint"
120
href="../glib/glib-Basic-Types.html#gint"
123
href="../glib/glib-Basic-Types.html#gint"
124
>gint</a> <a href="libgimpcolor-GimpColorSpace.html#gimp-rgb-to-l-int">gimp_rgb_to_l_int</a> (<a
125
href="../glib/glib-Basic-Types.html#gint"
128
href="../glib/glib-Basic-Types.html#gint"
131
href="../glib/glib-Basic-Types.html#gint"
133
void <a href="libgimpcolor-GimpColorSpace.html#gimp-hsl-to-rgb-int">gimp_hsl_to_rgb_int</a> (<a
134
href="../glib/glib-Basic-Types.html#gint"
137
href="../glib/glib-Basic-Types.html#gint"
138
>gint</a> *saturation,
140
href="../glib/glib-Basic-Types.html#gint"
141
>gint</a> *lightness);
142
void <a href="libgimpcolor-GimpColorSpace.html#gimp-rgb-to-hsv4">gimp_rgb_to_hsv4</a> (<a
143
href="../glib/glib-Basic-Types.html#guchar"
146
href="../glib/glib-Basic-Types.html#gdouble"
149
href="../glib/glib-Basic-Types.html#gdouble"
150
>gdouble</a> *saturation,
152
href="../glib/glib-Basic-Types.html#gdouble"
153
>gdouble</a> *value);
154
void <a href="libgimpcolor-GimpColorSpace.html#gimp-hsv-to-rgb4">gimp_hsv_to_rgb4</a> (<a
155
href="../glib/glib-Basic-Types.html#guchar"
158
href="../glib/glib-Basic-Types.html#gdouble"
161
href="../glib/glib-Basic-Types.html#gdouble"
162
>gdouble</a> saturation,
164
href="../glib/glib-Basic-Types.html#gdouble"
166
</pre></div><div class="refsect1" lang="en"><a name="id2582420"></a><h2>Description</h2><p>
167
When programming pixel data manipulation functions you will often use
168
algorithms operating on a color model different from the one GIMP
169
uses. This file provides utility functions to convert colors between
170
different color spaces.
171
</p></div><div class="refsect1" lang="en"><a name="id2582434"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id2582439"></a><h3><a name="GimpHSL"></a>struct GimpHSL</h3><a class="indexterm" name="id2582448"></a><pre class="programlisting">struct GimpHSL {
177
</p></div><hr><div class="refsect2" lang="en"><a name="id2582457"></a><h3><a name="gimp-rgb-to-hsv"></a>gimp_rgb_to_hsv ()</h3><a class="indexterm" name="id2582466"></a><pre class="programlisting">void gimp_rgb_to_hsv (const <a href="libgimpcolor-GimpRGB.html#GimpRGB">GimpRGB</a> *rgb,
178
<a href="libgimpcolor-GimpHSV.html#GimpHSV">GimpHSV</a> *hsv);</pre><p>
179
Does a conversion from RGB to HSV (Hue, Saturation,
180
Value) colorspace.</p><p>
182
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>rgb</tt></i>�:</span></td><td> A color value in the RGB colorspace
183
</td></tr><tr><td><span class="term"><i class="parameter"><tt>hsv</tt></i>�:</span></td><td> The value converted to the HSV colorspace
184
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2529232"></a><h3><a name="gimp-rgb-to-hsl"></a>gimp_rgb_to_hsl ()</h3><a class="indexterm" name="id2529241"></a><pre class="programlisting">void gimp_rgb_to_hsl (const <a href="libgimpcolor-GimpRGB.html#GimpRGB">GimpRGB</a> *rgb,
185
<a href="libgimpcolor-GimpColorSpace.html#GimpHSL">GimpHSL</a> *hsl);</pre><p>
186
Convert an RGB color value to a HSL (Hue, Saturation, Lightness)
189
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>rgb</tt></i>�:</span></td><td> A color value in the RGB colorspace
190
</td></tr><tr><td><span class="term"><i class="parameter"><tt>hsl</tt></i>�:</span></td><td> The value converted to HSL
191
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2529297"></a><h3><a name="gimp-rgb-to-cmyk"></a>gimp_rgb_to_cmyk ()</h3><a class="indexterm" name="id2529305"></a><pre class="programlisting">void gimp_rgb_to_cmyk (const <a href="libgimpcolor-GimpRGB.html#GimpRGB">GimpRGB</a> *rgb,
193
href="../glib/glib-Basic-Types.html#gdouble"
194
>gdouble</a> pullout,
195
<a href="libgimpcolor-GimpCMYK.html#GimpCMYK">GimpCMYK</a> *cmyk);</pre><p>
196
Does a naive conversion from RGB to CMYK colorspace. A simple
197
formula that doesn't take any color-profiles into account is used.
198
The amount of black pullout how can be controlled via the <i class="parameter"><tt>pullout</tt></i>
199
parameter. A <i class="parameter"><tt>pullout</tt></i> value of 0 makes this a conversion to CMY.
200
A value of 1 causes the maximum amount of black to be pulled out.</p><p>
202
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>rgb</tt></i>�:</span></td><td> A value in the RGB colorspace
203
</td></tr><tr><td><span class="term"><i class="parameter"><tt>pullout</tt></i>�:</span></td><td> A scaling value (0-1) indicating how much black should be
205
</td></tr><tr><td><span class="term"><i class="parameter"><tt>cmyk</tt></i>�:</span></td><td> The input value naively converted to the CMYK colorspace
206
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2529391"></a><h3><a name="gimp-hsv-to-rgb"></a>gimp_hsv_to_rgb ()</h3><a class="indexterm" name="id2529400"></a><pre class="programlisting">void gimp_hsv_to_rgb (const <a href="libgimpcolor-GimpHSV.html#GimpHSV">GimpHSV</a> *hsv,
207
<a href="libgimpcolor-GimpRGB.html#GimpRGB">GimpRGB</a> *rgb);</pre><p>
208
Converts a color value from HSV to RGB colorspace</p><p>
210
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>hsv</tt></i>�:</span></td><td> A color value in the HSV colorspace
211
</td></tr><tr><td><span class="term"><i class="parameter"><tt>rgb</tt></i>�:</span></td><td> The returned RGB value.
212
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2529455"></a><h3><a name="gimp-hsl-to-rgb"></a>gimp_hsl_to_rgb ()</h3><a class="indexterm" name="id2529464"></a><pre class="programlisting">void gimp_hsl_to_rgb (const <a href="libgimpcolor-GimpColorSpace.html#GimpHSL">GimpHSL</a> *hsl,
213
<a href="libgimpcolor-GimpRGB.html#GimpRGB">GimpRGB</a> *rgb);</pre><p>
214
Convert a HSL color value to an RGB color value.</p><p>
216
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>hsl</tt></i>�:</span></td><td> A color value in the HSL colorspace
217
</td></tr><tr><td><span class="term"><i class="parameter"><tt>rgb</tt></i>�:</span></td><td> The value converted to a value in the RGB colorspace
218
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2587457"></a><h3><a name="gimp-cmyk-to-rgb"></a>gimp_cmyk_to_rgb ()</h3><a class="indexterm" name="id2587466"></a><pre class="programlisting">void gimp_cmyk_to_rgb (const <a href="libgimpcolor-GimpCMYK.html#GimpCMYK">GimpCMYK</a> *cmyk,
219
<a href="libgimpcolor-GimpRGB.html#GimpRGB">GimpRGB</a> *rgb);</pre><p>
220
Does a simple transformation from the CMYK colorspace to the RGB
221
colorspace, without taking color profiles into account.</p><p>
223
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>cmyk</tt></i>�:</span></td><td> A color value in the CMYK colorspace
224
</td></tr><tr><td><span class="term"><i class="parameter"><tt>rgb</tt></i>�:</span></td><td> The value converted to the RGB colorspace
225
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2587524"></a><h3><a name="gimp-rgb-to-hwb"></a>gimp_rgb_to_hwb ()</h3><a class="indexterm" name="id2587532"></a><pre class="programlisting">void gimp_rgb_to_hwb (const <a href="libgimpcolor-GimpRGB.html#GimpRGB">GimpRGB</a> *rgb,
227
href="../glib/glib-Basic-Types.html#gdouble"
230
href="../glib/glib-Basic-Types.html#gdouble"
231
>gdouble</a> *whiteness,
233
href="../glib/glib-Basic-Types.html#gdouble"
234
>gdouble</a> *blackness);</pre><p>
235
Theoretically, hue 0 (pure red) is identical to hue 6 in these transforms.
236
Pure red always maps to 6 in this implementation. Therefore UNDEFINED can
237
be defined as 0 in situations where only unsigned numbers are desired.
239
RGB are each on [0, 1]. Whiteness and Blackness are returned in the
240
range [0, 1] and H is returned in the range [0, 6]. If W == 1 - B, H is
243
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>rgb</tt></i>�:</span></td><td> A color value in the RGB colorspace
244
</td></tr><tr><td><span class="term"><i class="parameter"><tt>hue</tt></i>�:</span></td><td> The hue value of the above color, in the range 0 to 6
245
</td></tr><tr><td><span class="term"><i class="parameter"><tt>whiteness</tt></i>�:</span></td><td> The whiteness value of the above color, in the range 0 to 1
246
</td></tr><tr><td><span class="term"><i class="parameter"><tt>blackness</tt></i>�:</span></td><td> The blackness value of the above color, in the range 0 to 1
247
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2587635"></a><h3><a name="gimp-hwb-to-rgb"></a>gimp_hwb_to_rgb ()</h3><a class="indexterm" name="id2587644"></a><pre class="programlisting">void gimp_hwb_to_rgb (<a
248
href="../glib/glib-Basic-Types.html#gdouble"
251
href="../glib/glib-Basic-Types.html#gdouble"
252
>gdouble</a> whiteness,
254
href="../glib/glib-Basic-Types.html#gdouble"
255
>gdouble</a> blackness,
256
<a href="libgimpcolor-GimpRGB.html#GimpRGB">GimpRGB</a> *rgb);</pre><p>
257
H is defined in the range [0, 6] or UNDEFINED, B and W are both in the
258
range [0, 1]. The returned RGB values are all in the range [0, 1].</p><p>
260
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>hue</tt></i>�:</span></td><td> A hue value, in the range 0 to 6
261
</td></tr><tr><td><span class="term"><i class="parameter"><tt>whiteness</tt></i>�:</span></td><td> A whiteness value, in the range 0 to 1
262
</td></tr><tr><td><span class="term"><i class="parameter"><tt>blackness</tt></i>�:</span></td><td> A blackness value, in the range 0 to 1
263
</td></tr><tr><td><span class="term"><i class="parameter"><tt>rgb</tt></i>�:</span></td><td> The above color converted to the RGB colorspace
264
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2587737"></a><h3><a name="gimp-rgb-to-hsv-int"></a>gimp_rgb_to_hsv_int ()</h3><a class="indexterm" name="id2587745"></a><pre class="programlisting">void gimp_rgb_to_hsv_int (<a
265
href="../glib/glib-Basic-Types.html#gint"
268
href="../glib/glib-Basic-Types.html#gint"
271
href="../glib/glib-Basic-Types.html#gint"
272
>gint</a> *blue);</pre><p>
273
The arguments are pointers to int representing channel values in
274
the RGB colorspace, and the values pointed to are all in the range
277
The function changes the arguments to point to the HSV value
278
corresponding, with the returned values in the following
279
ranges: H [0, 360], S [0, 255], V [0, 255].</p><p>
281
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>red</tt></i>�:</span></td><td> The red channel value, returns the Hue channel
282
</td></tr><tr><td><span class="term"><i class="parameter"><tt>green</tt></i>�:</span></td><td> The green channel value, returns the Saturation channel
283
</td></tr><tr><td><span class="term"><i class="parameter"><tt>blue</tt></i>�:</span></td><td> The blue channel value, returns the Value channel
284
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2587828"></a><h3><a name="gimp-hsv-to-rgb-int"></a>gimp_hsv_to_rgb_int ()</h3><a class="indexterm" name="id2587837"></a><pre class="programlisting">void gimp_hsv_to_rgb_int (<a
285
href="../glib/glib-Basic-Types.html#gint"
288
href="../glib/glib-Basic-Types.html#gint"
289
>gint</a> *saturation,
291
href="../glib/glib-Basic-Types.html#gint"
292
>gint</a> *value);</pre><p>
293
The arguments are pointers to int, with the values pointed to in the
294
following ranges: H [0, 360], S [0, 255], V [0, 255].
296
The function changes the arguments to point to the RGB value
297
corresponding, with the returned values all in the range [0, 255].</p><p>
299
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>hue</tt></i>�:</span></td><td> The hue channel, returns the red channel
300
</td></tr><tr><td><span class="term"><i class="parameter"><tt>saturation</tt></i>�:</span></td><td> The saturation channel, returns the green channel
301
</td></tr><tr><td><span class="term"><i class="parameter"><tt>value</tt></i>�:</span></td><td> The value channel, returns the blue channel
302
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2587874"></a><h3><a name="gimp-rgb-to-hsl-int"></a>gimp_rgb_to_hsl_int ()</h3><a class="indexterm" name="id2587881"></a><pre class="programlisting">void gimp_rgb_to_hsl_int (<a
303
href="../glib/glib-Basic-Types.html#gint"
306
href="../glib/glib-Basic-Types.html#gint"
309
href="../glib/glib-Basic-Types.html#gint"
310
>gint</a> *blue);</pre><p>
311
The arguments are pointers to int representing channel values in the
312
RGB colorspace, and the values pointed to are all in the range [0, 255].
314
The function changes the arguments to point to the corresponding HLS
315
value with the values pointed to in the following ranges: H [0, 360],
316
L [0, 255], S [0, 255].</p><p>
318
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>red</tt></i>�:</span></td><td> Red channel, returns Hue channel
319
</td></tr><tr><td><span class="term"><i class="parameter"><tt>green</tt></i>�:</span></td><td> Green channel, returns Lightness channel
320
</td></tr><tr><td><span class="term"><i class="parameter"><tt>blue</tt></i>�:</span></td><td> Blue channel, returns Saturation channel
321
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2587956"></a><h3><a name="gimp-rgb-to-cmyk-int"></a>gimp_rgb_to_cmyk_int ()</h3><a class="indexterm" name="id2587964"></a><pre class="programlisting">void gimp_rgb_to_cmyk_int (<a
322
href="../glib/glib-Basic-Types.html#gint"
325
href="../glib/glib-Basic-Types.html#gint"
328
href="../glib/glib-Basic-Types.html#gint"
331
href="../glib/glib-Basic-Types.html#gint"
332
>gint</a> *pullout);</pre><p>
333
Does a naive conversion from RGB to CMYK colorspace. A simple
334
formula that doesn't take any color-profiles into account is used.
335
The amount of black pullout how can be controlled via the <i class="parameter"><tt>pullout</tt></i>
336
parameter. A <i class="parameter"><tt>pullout</tt></i> value of 0 makes this a conversion to CMY.
337
A value of 100 causes the maximum amount of black to be pulled out.</p><p>
339
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>red</tt></i>�:</span></td><td> the red channel; returns the cyan value (0-255)
340
</td></tr><tr><td><span class="term"><i class="parameter"><tt>green</tt></i>�:</span></td><td> the green channel; returns the magenta value (0-255)
341
</td></tr><tr><td><span class="term"><i class="parameter"><tt>blue</tt></i>�:</span></td><td> the blue channel; returns the yellow value (0-255)
342
</td></tr><tr><td><span class="term"><i class="parameter"><tt>pullout</tt></i>�:</span></td><td> the percentage of black to pull out (0-100); returns
343
the black value (0-255)
344
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2588062"></a><h3><a name="gimp-cmyk-to-rgb-int"></a>gimp_cmyk_to_rgb_int ()</h3><a class="indexterm" name="id2588070"></a><pre class="programlisting">void gimp_cmyk_to_rgb_int (<a
345
href="../glib/glib-Basic-Types.html#gint"
348
href="../glib/glib-Basic-Types.html#gint"
351
href="../glib/glib-Basic-Types.html#gint"
354
href="../glib/glib-Basic-Types.html#gint"
355
>gint</a> *black);</pre><p>
356
Does a naive conversion from CMYK to RGB colorspace. A simple
357
formula that doesn't take any color-profiles into account is used.</p><p>
359
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>cyan</tt></i>�:</span></td><td> the cyan channel; returns the red value (0-255)
360
</td></tr><tr><td><span class="term"><i class="parameter"><tt>magenta</tt></i>�:</span></td><td> the magenta channel; returns the green value (0-255)
361
</td></tr><tr><td><span class="term"><i class="parameter"><tt>yellow</tt></i>�:</span></td><td> the yellow channel; returns the blue value (0-255)
362
</td></tr><tr><td><span class="term"><i class="parameter"><tt>black</tt></i>�:</span></td><td> the black channel (0-255); doesn't change
363
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2588160"></a><h3><a name="gimp-rgb-to-l-int"></a>gimp_rgb_to_l_int ()</h3><a class="indexterm" name="id2588168"></a><pre class="programlisting"><a
364
href="../glib/glib-Basic-Types.html#gint"
365
>gint</a> gimp_rgb_to_l_int (<a
366
href="../glib/glib-Basic-Types.html#gint"
369
href="../glib/glib-Basic-Types.html#gint"
372
href="../glib/glib-Basic-Types.html#gint"
373
>gint</a> blue);</pre><p>
374
Calculates the lightness value of an RGB triplet with the formula
375
L = (max(R, G, B) + min (R, G, B)) / 2</p><p>
377
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>red</tt></i>�:</span></td><td> Red channel
378
</td></tr><tr><td><span class="term"><i class="parameter"><tt>green</tt></i>�:</span></td><td> Green channel
379
</td></tr><tr><td><span class="term"><i class="parameter"><tt>blue</tt></i>�:</span></td><td> Blue channel
380
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> Luminance vaue corresponding to the input RGB value
381
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2588252"></a><h3><a name="gimp-hsl-to-rgb-int"></a>gimp_hsl_to_rgb_int ()</h3><a class="indexterm" name="id2588260"></a><pre class="programlisting">void gimp_hsl_to_rgb_int (<a
382
href="../glib/glib-Basic-Types.html#gint"
385
href="../glib/glib-Basic-Types.html#gint"
386
>gint</a> *saturation,
388
href="../glib/glib-Basic-Types.html#gint"
389
>gint</a> *lightness);</pre><p>
390
The arguments are pointers to int, with the values pointed to in the
391
following ranges: H [0, 360], L [0, 255], S [0, 255].
393
The function changes the arguments to point to the RGB value
394
corresponding, with the returned values all in the range [0, 255].</p><p>
396
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>hue</tt></i>�:</span></td><td> Hue channel, returns Red channel
397
</td></tr><tr><td><span class="term"><i class="parameter"><tt>saturation</tt></i>�:</span></td><td> Saturation channel, returns Green channel
398
</td></tr><tr><td><span class="term"><i class="parameter"><tt>lightness</tt></i>�:</span></td><td> Lightness channel, returns Blue channel
399
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2588339"></a><h3><a name="gimp-rgb-to-hsv4"></a>gimp_rgb_to_hsv4 ()</h3><a class="indexterm" name="id2588347"></a><pre class="programlisting">void gimp_rgb_to_hsv4 (<a
400
href="../glib/glib-Basic-Types.html#guchar"
403
href="../glib/glib-Basic-Types.html#gdouble"
406
href="../glib/glib-Basic-Types.html#gdouble"
407
>gdouble</a> *saturation,
409
href="../glib/glib-Basic-Types.html#gdouble"
410
>gdouble</a> *value);</pre><p>
413
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>rgb</tt></i>�:</span></td><td> RGB triplet, rgb[0] is red channel, rgb[1] is green,
414
rgb[2] is blue (0..255)
415
</td></tr><tr><td><span class="term"><i class="parameter"><tt>hue</tt></i>�:</span></td><td> Pointer to hue channel (0..1)
416
</td></tr><tr><td><span class="term"><i class="parameter"><tt>saturation</tt></i>�:</span></td><td> Pointer to saturation channel (0..1)
417
</td></tr><tr><td><span class="term"><i class="parameter"><tt>value</tt></i>�:</span></td><td> Pointer to value channel (0..1)
418
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2588436"></a><h3><a name="gimp-hsv-to-rgb4"></a>gimp_hsv_to_rgb4 ()</h3><a class="indexterm" name="id2588445"></a><pre class="programlisting">void gimp_hsv_to_rgb4 (<a
419
href="../glib/glib-Basic-Types.html#guchar"
422
href="../glib/glib-Basic-Types.html#gdouble"
425
href="../glib/glib-Basic-Types.html#gdouble"
426
>gdouble</a> saturation,
428
href="../glib/glib-Basic-Types.html#gdouble"
429
>gdouble</a> value);</pre><p>
432
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>rgb</tt></i>�:</span></td><td> RGB triplet, rgb[0] is red channel, rgb[1] is green,
433
rgb[2] is blue (0..255)
434
</td></tr><tr><td><span class="term"><i class="parameter"><tt>hue</tt></i>�:</span></td><td> Hue channel (0..1)
435
</td></tr><tr><td><span class="term"><i class="parameter"><tt>saturation</tt></i>�:</span></td><td> Saturation channel (0..1)
436
</td></tr><tr><td><span class="term"><i class="parameter"><tt>value</tt></i>�:</span></td><td> Value channel (0..1)
437
</td></tr></tbody></table></div></div></div></div><table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="libgimpcolor-GimpCMYK.html"><b><<�GimpCMYK</b></a></td><td align="right"><a accesskey="n" href="libgimpcolor-GimpAdaptiveSupersample.html"><b>GimpAdaptiveSupersample�>></b></a></td></tr></table></body></html>