File: clutter-clutter-color.html

package info (click to toggle)
clutter 0.1.0-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,528 kB
  • ctags: 3,353
  • sloc: ansic: 12,634; sh: 8,777; xml: 4,655; makefile: 278
file content (460 lines) | stat: -rw-r--r-- 19,061 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>clutter-color</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
<link rel="start" href="index.html" title="Clutter 0.0
 Reference Manual">
<link rel="up" href="ch03.html" title="Clutter Tools">
<link rel="prev" href="clutter-clutter-event.html" title="clutter-event">
<link rel="next" href="clutter-clutter-util.html" title="clutter-util">
<meta name="generator" content="GTK-Doc V1.6 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="ch01.html" title="Clutter Overview">
<link rel="chapter" href="ch02.html" title="Clutter Actors And Objects">
<link rel="chapter" href="ch03.html" title="Clutter Tools">
<link rel="appendix" href="license.html" title="Appendix&#160;A.&#160;License">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="clutter-clutter-event.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch03.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">Clutter 0.0
 Reference Manual</th>
<td><a accesskey="n" href="clutter-clutter-util.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#top_of_page" class="shortcut">Top</a>
                  &#160;|&#160;
                  <a href="#desc" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="clutter-clutter-color"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="top_of_page"></a>clutter-color</span></h2>
<p>clutter-color &#8212; Color management and manipulation.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">



#define     <a href="clutter-clutter-color.html#CLUTTER-TYPE-COLOR:CAPS">CLUTTER_TYPE_COLOR</a>
            <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a>;
GType       <a href="clutter-clutter-color.html#clutter-color-get-type">clutter_color_get_type</a>          (void);
void        <a href="clutter-clutter-color.html#clutter-color-add">clutter_color_add</a>               (const <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *src1,
                                             const <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *src2,
                                             <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *dest);
void        <a href="clutter-clutter-color.html#clutter-color-subtract">clutter_color_subtract</a>          (const <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *src1,
                                             const <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *src2,
                                             <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *dest);
void        <a href="clutter-clutter-color.html#clutter-color-lighten">clutter_color_lighten</a>           (const <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *src,
                                             <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *dest);
void        <a href="clutter-clutter-color.html#clutter-color-darken">clutter_color_darken</a>            (const <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *src,
                                             <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *dest);
void        <a href="clutter-clutter-color.html#clutter-color-shade">clutter_color_shade</a>             (const <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *src,
                                             <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *dest,
                                             gdouble shade);
void        <a href="clutter-clutter-color.html#clutter-color-to-hls">clutter_color_to_hls</a>            (const <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *src,
                                             guint8 *hue,
                                             guint8 *luminance,
                                             guint8 *saturation);
void        <a href="clutter-clutter-color.html#clutter-color-from-hls">clutter_color_from_hls</a>          (<a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *dest,
                                             guint8 hue,
                                             guint8 luminance,
                                             guint8 saturation);
guint32     <a href="clutter-clutter-color.html#clutter-color-to-pixel">clutter_color_to_pixel</a>          (const <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *src);
void        <a href="clutter-clutter-color.html#clutter-color-from-pixel">clutter_color_from_pixel</a>        (<a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *dest,
                                             guint32 pixel);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="desc"></a><h2>Description</h2>
<p>
<a href="clutter-clutter-color.html#ClutterColor"><span class="type">ClutterColor</span></a> is a simple type for representing colors.</p>
<p>

</p>
</div>
<div class="refsect1" lang="en">
<a name="details"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2580820"></a><h3>
<a name="CLUTTER-TYPE-COLOR:CAPS"></a>CLUTTER_TYPE_COLOR</h3>
<a class="indexterm" name="id2580831"></a><pre class="programlisting">#define CLUTTER_TYPE_COLOR	(clutter_color_get_type ())
</pre>
<p>

</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2580847"></a><h3>
<a name="ClutterColor"></a>ClutterColor</h3>
<a class="indexterm" name="id2580860"></a><pre class="programlisting">typedef struct {
  guint8 red;
  guint8 green;
  guint8 blue;
  
  guint8 alpha;
} ClutterColor;
</pre>
<p>

</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2580877"></a><h3>
<a name="clutter-color-get-type"></a>clutter_color_get_type ()</h3>
<a class="indexterm" name="id2580888"></a><pre class="programlisting">GType       clutter_color_get_type          (void);</pre>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td>


</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2580924"></a><h3>
<a name="clutter-color-add"></a>clutter_color_add ()</h3>
<a class="indexterm" name="id2580936"></a><pre class="programlisting">void        clutter_color_add               (const <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *src1,
                                             const <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *src2,
                                             <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *dest);</pre>
<p>
Adds <em class="parameter"><code>src2</code></em> to <em class="parameter"><code>src1</code></em> and saves the resulting color
inside <em class="parameter"><code>dest</code></em>.
</p>
<p>
The alpha channel of <em class="parameter"><code>dest</code></em> is as the maximum value
between the alpha channels of <em class="parameter"><code>src1</code></em> and <em class="parameter"><code>src2</code></em>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>src1</code></em>&#160;:</span></td>
<td> a <a href="clutter-clutter-color.html#ClutterColor"><span class="type">ClutterColor</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>src2</code></em>&#160;:</span></td>
<td> a <a href="clutter-clutter-color.html#ClutterColor"><span class="type">ClutterColor</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>dest</code></em>&#160;:</span></td>
<td> return location for the result
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2577466"></a><h3>
<a name="clutter-color-subtract"></a>clutter_color_subtract ()</h3>
<a class="indexterm" name="id2577477"></a><pre class="programlisting">void        clutter_color_subtract          (const <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *src1,
                                             const <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *src2,
                                             <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *dest);</pre>
<p>
Subtracts <em class="parameter"><code>src2</code></em> from <em class="parameter"><code>src1</code></em> and saves the resulting
color inside <em class="parameter"><code>dest</code></em>.
</p>
<p>
The alpha channel of <em class="parameter"><code>dest</code></em> is set as the minimum value
between the alpha channels of <em class="parameter"><code>src1</code></em> and <em class="parameter"><code>src2</code></em>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>src1</code></em>&#160;:</span></td>
<td> a <a href="clutter-clutter-color.html#ClutterColor"><span class="type">ClutterColor</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>src2</code></em>&#160;:</span></td>
<td> a <a href="clutter-clutter-color.html#ClutterColor"><span class="type">ClutterColor</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>dest</code></em>&#160;:</span></td>
<td> return location for the result
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2577624"></a><h3>
<a name="clutter-color-lighten"></a>clutter_color_lighten ()</h3>
<a class="indexterm" name="id2577635"></a><pre class="programlisting">void        clutter_color_lighten           (const <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *src,
                                             <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *dest);</pre>
<p>
Lightens <em class="parameter"><code>src</code></em> by a fixed amount, and saves the changed
color in <em class="parameter"><code>dest</code></em>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>src</code></em>&#160;:</span></td>
<td> a <a href="clutter-clutter-color.html#ClutterColor"><span class="type">ClutterColor</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>dest</code></em>&#160;:</span></td>
<td> return location for the lighter color
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2577726"></a><h3>
<a name="clutter-color-darken"></a>clutter_color_darken ()</h3>
<a class="indexterm" name="id2577737"></a><pre class="programlisting">void        clutter_color_darken            (const <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *src,
                                             <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *dest);</pre>
<p>
Darkens <em class="parameter"><code>src</code></em> by a fixed amount, and saves the changed color
in <em class="parameter"><code>dest</code></em>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>src</code></em>&#160;:</span></td>
<td> a <a href="clutter-clutter-color.html#ClutterColor"><span class="type">ClutterColor</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>dest</code></em>&#160;:</span></td>
<td> return location for the darker color
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2577829"></a><h3>
<a name="clutter-color-shade"></a>clutter_color_shade ()</h3>
<a class="indexterm" name="id2577841"></a><pre class="programlisting">void        clutter_color_shade             (const <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *src,
                                             <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *dest,
                                             gdouble shade);</pre>
<p>
Shades <em class="parameter"><code>src</code></em> by the factor of <em class="parameter"><code>shade</code></em> and saves the modified
color into <em class="parameter"><code>dest</code></em>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>src</code></em>&#160;:</span></td>
<td> a <a href="clutter-clutter-color.html#ClutterColor"><span class="type">ClutterColor</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>dest</code></em>&#160;:</span></td>
<td> return location for the shaded color
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>shade</code></em>&#160;:</span></td>
<td> the shade factor to apply
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2577958"></a><h3>
<a name="clutter-color-to-hls"></a>clutter_color_to_hls ()</h3>
<a class="indexterm" name="id2577970"></a><pre class="programlisting">void        clutter_color_to_hls            (const <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *src,
                                             guint8 *hue,
                                             guint8 *luminance,
                                             guint8 *saturation);</pre>
<p>
Converts <em class="parameter"><code>src</code></em> to the HLS format.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>src</code></em>&#160;:</span></td>
<td> a <a href="clutter-clutter-color.html#ClutterColor"><span class="type">ClutterColor</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>hue</code></em>&#160;:</span></td>
<td> return location for the hue value or <code class="literal">NULL</code>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>luminance</code></em>&#160;:</span></td>
<td> return location for the luminance value or <code class="literal">NULL</code>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>saturation</code></em>&#160;:</span></td>
<td> return location for the saturation value or <code class="literal">NULL</code>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2583594"></a><h3>
<a name="clutter-color-from-hls"></a>clutter_color_from_hls ()</h3>
<a class="indexterm" name="id2583605"></a><pre class="programlisting">void        clutter_color_from_hls          (<a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *dest,
                                             guint8 hue,
                                             guint8 luminance,
                                             guint8 saturation);</pre>
<p>
Converts a color expressed in HLS (hue, luminance and saturation)
values into a <a href="clutter-clutter-color.html#ClutterColor"><span class="type">ClutterColor</span></a>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>dest</code></em>&#160;:</span></td>
<td> return location for a <a href="clutter-clutter-color.html#ClutterColor"><span class="type">ClutterColor</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>hue</code></em>&#160;:</span></td>
<td> hue value (0 .. 255)
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>luminance</code></em>&#160;:</span></td>
<td> luminance value (0 .. 255)
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>saturation</code></em>&#160;:</span></td>
<td> saturation value (0 .. 255)
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2583731"></a><h3>
<a name="clutter-color-to-pixel"></a>clutter_color_to_pixel ()</h3>
<a class="indexterm" name="id2583742"></a><pre class="programlisting">guint32     clutter_color_to_pixel          (const <a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *src);</pre>
<p>
Converts <em class="parameter"><code>src</code></em> into a packed 32 bit integer, containing
all the four 8 bit channels used by <a href="clutter-clutter-color.html#ClutterColor"><span class="type">ClutterColor</span></a>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>src</code></em>&#160;:</span></td>
<td> a <a href="clutter-clutter-color.html#ClutterColor"><span class="type">ClutterColor</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> a packed color
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2583824"></a><h3>
<a name="clutter-color-from-pixel"></a>clutter_color_from_pixel ()</h3>
<a class="indexterm" name="id2583835"></a><pre class="programlisting">void        clutter_color_from_pixel        (<a href="clutter-clutter-color.html#ClutterColor">ClutterColor</a> *dest,
                                             guint32 pixel);</pre>
<p>
Converts <em class="parameter"><code>pixel</code></em> from the packed representation of a four 8 bit channel
color to a <a href="clutter-clutter-color.html#ClutterColor"><span class="type">ClutterColor</span></a>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>dest</code></em>&#160;:</span></td>
<td> return location for a <a href="clutter-clutter-color.html#ClutterColor"><span class="type">ClutterColor</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>pixel</code></em>&#160;:</span></td>
<td> a 32 bit packed integer containing a color
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</body>
</html>