~ubuntu-branches/ubuntu/hoary/gimp/hoary

« back to all changes in this revision

Viewing changes to devel-docs/libgimpcolor/html/libgimpcolor-GimpColorSpace.html

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2005-04-04 14:51:23 UTC
  • Revision ID: james.westby@ubuntu.com-20050404145123-9py049eeelfymur8
Tags: upstream-2.2.2
Import upstream version 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 {
 
3
            background: #eeeeee;
 
4
            border: solid 1px #aaaaaa;
 
5
            padding: 0.5em;
 
6
        }
 
7
        .programlisting {
 
8
            background: #eeeeff;
 
9
            border: solid 1px #aaaaff;
 
10
            padding: 0.5em;
 
11
        }
 
12
        .variablelist {
 
13
            padding: 4px;
 
14
            margin-left: 3em;
 
15
        }
 
16
        .navigation {
 
17
            background: #ffeeee;
 
18
            border: solid 1px #ffaaaa;
 
19
            margin-top: 0.5em;
 
20
            margin-bottom: 0.5em;
 
21
        }
 
22
        .navigation a {
 
23
            color: #770000;
 
24
        }
 
25
        .navigation a:visited {
 
26
            color: #550000;
 
27
        }
 
28
        .navigation .title {
 
29
            font-size: 200%;
 
30
        }
 
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 &#8212; Utility functions which convert colors between different color models.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
 
32
 
 
33
 
 
34
 
 
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,
 
41
                                             <a
 
42
href="../glib/glib-Basic-Types.html#gdouble"
 
43
>gdouble</a> pullout,
 
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,
 
52
                                             <a
 
53
href="../glib/glib-Basic-Types.html#gdouble"
 
54
>gdouble</a> *hue,
 
55
                                             <a
 
56
href="../glib/glib-Basic-Types.html#gdouble"
 
57
>gdouble</a> *whiteness,
 
58
                                             <a
 
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"
 
63
>gdouble</a> hue,
 
64
                                             <a
 
65
href="../glib/glib-Basic-Types.html#gdouble"
 
66
>gdouble</a> whiteness,
 
67
                                             <a
 
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"
 
73
>gint</a> *red,
 
74
                                             <a
 
75
href="../glib/glib-Basic-Types.html#gint"
 
76
>gint</a> *green,
 
77
                                             <a
 
78
href="../glib/glib-Basic-Types.html#gint"
 
79
>gint</a> *blue);
 
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"
 
82
>gint</a> *hue,
 
83
                                             <a
 
84
href="../glib/glib-Basic-Types.html#gint"
 
85
>gint</a> *saturation,
 
86
                                             <a
 
87
href="../glib/glib-Basic-Types.html#gint"
 
88
>gint</a> *value);
 
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"
 
91
>gint</a> *red,
 
92
                                             <a
 
93
href="../glib/glib-Basic-Types.html#gint"
 
94
>gint</a> *green,
 
95
                                             <a
 
96
href="../glib/glib-Basic-Types.html#gint"
 
97
>gint</a> *blue);
 
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"
 
100
>gint</a> *red,
 
101
                                             <a
 
102
href="../glib/glib-Basic-Types.html#gint"
 
103
>gint</a> *green,
 
104
                                             <a
 
105
href="../glib/glib-Basic-Types.html#gint"
 
106
>gint</a> *blue,
 
107
                                             <a
 
108
href="../glib/glib-Basic-Types.html#gint"
 
109
>gint</a> *pullout);
 
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"
 
112
>gint</a> *cyan,
 
113
                                             <a
 
114
href="../glib/glib-Basic-Types.html#gint"
 
115
>gint</a> *magenta,
 
116
                                             <a
 
117
href="../glib/glib-Basic-Types.html#gint"
 
118
>gint</a> *yellow,
 
119
                                             <a
 
120
href="../glib/glib-Basic-Types.html#gint"
 
121
>gint</a> *black);
 
122
<a
 
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"
 
126
>gint</a> red,
 
127
                                             <a
 
128
href="../glib/glib-Basic-Types.html#gint"
 
129
>gint</a> green,
 
130
                                             <a
 
131
href="../glib/glib-Basic-Types.html#gint"
 
132
>gint</a> blue);
 
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"
 
135
>gint</a> *hue,
 
136
                                             <a
 
137
href="../glib/glib-Basic-Types.html#gint"
 
138
>gint</a> *saturation,
 
139
                                             <a
 
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"
 
144
>guchar</a> *rgb,
 
145
                                             <a
 
146
href="../glib/glib-Basic-Types.html#gdouble"
 
147
>gdouble</a> *hue,
 
148
                                             <a
 
149
href="../glib/glib-Basic-Types.html#gdouble"
 
150
>gdouble</a> *saturation,
 
151
                                             <a
 
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"
 
156
>guchar</a> *rgb,
 
157
                                             <a
 
158
href="../glib/glib-Basic-Types.html#gdouble"
 
159
>gdouble</a> hue,
 
160
                                             <a
 
161
href="../glib/glib-Basic-Types.html#gdouble"
 
162
>gdouble</a> saturation,
 
163
                                             <a
 
164
href="../glib/glib-Basic-Types.html#gdouble"
 
165
>gdouble</a> value);
 
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 {
 
172
 
 
173
  gdouble h, s, l, a;
 
174
};
 
175
</pre><p>
 
176
 
 
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>
 
181
 
 
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)
 
187
color value.</p><p>
 
188
 
 
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,
 
192
                                             <a
 
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>
 
201
 
 
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
 
204
          pulled out
 
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>
 
209
 
 
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>
 
215
 
 
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>
 
222
 
 
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,
 
226
                                             <a
 
227
href="../glib/glib-Basic-Types.html#gdouble"
 
228
>gdouble</a> *hue,
 
229
                                             <a
 
230
href="../glib/glib-Basic-Types.html#gdouble"
 
231
>gdouble</a> *whiteness,
 
232
                                             <a
 
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.
 
238
</p><p>
 
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
 
241
undefined.</p><p>
 
242
 
 
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"
 
249
>gdouble</a> hue,
 
250
                                             <a
 
251
href="../glib/glib-Basic-Types.html#gdouble"
 
252
>gdouble</a> whiteness,
 
253
                                             <a
 
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>
 
259
 
 
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"
 
266
>gint</a> *red,
 
267
                                             <a
 
268
href="../glib/glib-Basic-Types.html#gint"
 
269
>gint</a> *green,
 
270
                                             <a
 
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
 
275
[0, 255].
 
276
</p><p>
 
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>
 
280
 
 
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"
 
286
>gint</a> *hue,
 
287
                                             <a
 
288
href="../glib/glib-Basic-Types.html#gint"
 
289
>gint</a> *saturation,
 
290
                                             <a
 
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].
 
295
</p><p>
 
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>
 
298
 
 
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"
 
304
>gint</a> *red,
 
305
                                             <a
 
306
href="../glib/glib-Basic-Types.html#gint"
 
307
>gint</a> *green,
 
308
                                             <a
 
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].
 
313
</p><p>
 
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>
 
317
 
 
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"
 
323
>gint</a> *red,
 
324
                                             <a
 
325
href="../glib/glib-Basic-Types.html#gint"
 
326
>gint</a> *green,
 
327
                                             <a
 
328
href="../glib/glib-Basic-Types.html#gint"
 
329
>gint</a> *blue,
 
330
                                             <a
 
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>
 
338
 
 
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"
 
346
>gint</a> *cyan,
 
347
                                             <a
 
348
href="../glib/glib-Basic-Types.html#gint"
 
349
>gint</a> *magenta,
 
350
                                             <a
 
351
href="../glib/glib-Basic-Types.html#gint"
 
352
>gint</a> *yellow,
 
353
                                             <a
 
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>
 
358
 
 
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"
 
367
>gint</a> red,
 
368
                                             <a
 
369
href="../glib/glib-Basic-Types.html#gint"
 
370
>gint</a> green,
 
371
                                             <a
 
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>
 
376
 
 
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"
 
383
>gint</a> *hue,
 
384
                                             <a
 
385
href="../glib/glib-Basic-Types.html#gint"
 
386
>gint</a> *saturation,
 
387
                                             <a
 
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].
 
392
</p><p>
 
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>
 
395
 
 
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"
 
401
>guchar</a> *rgb,
 
402
                                             <a
 
403
href="../glib/glib-Basic-Types.html#gdouble"
 
404
>gdouble</a> *hue,
 
405
                                             <a
 
406
href="../glib/glib-Basic-Types.html#gdouble"
 
407
>gdouble</a> *saturation,
 
408
                                             <a
 
409
href="../glib/glib-Basic-Types.html#gdouble"
 
410
>gdouble</a> *value);</pre><p>
 
411
</p><p>
 
412
 
 
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"
 
420
>guchar</a> *rgb,
 
421
                                             <a
 
422
href="../glib/glib-Basic-Types.html#gdouble"
 
423
>gdouble</a> hue,
 
424
                                             <a
 
425
href="../glib/glib-Basic-Types.html#gdouble"
 
426
>gdouble</a> saturation,
 
427
                                             <a
 
428
href="../glib/glib-Basic-Types.html#gdouble"
 
429
>gdouble</a> value);</pre><p>
 
430
</p><p>
 
431
 
 
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>&lt;&lt;�GimpCMYK</b></a></td><td align="right"><a accesskey="n" href="libgimpcolor-GimpAdaptiveSupersample.html"><b>GimpAdaptiveSupersample�&gt;&gt;</b></a></td></tr></table></body></html>