~inkscape.dev/inkscape-devlibs/devlibs-gtk3

« back to all changes in this revision

Viewing changes to share/gtk-doc/html/gdk2/gdk2-GdkRGB.html

  • Committer: JazzyNico
  • Date: 2013-01-21 10:11:05 UTC
  • Revision ID: nicoduf@yahoo.fr-20130121101105-i8d8slkq9ng4olx8
Adding gtk2 libraries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
2
<html>
 
3
<head>
 
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 
5
<title>GdkRGB</title>
 
6
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
 
7
<link rel="home" href="index.html" title="GDK 2 Reference Manual">
 
8
<link rel="up" href="reference.html" title="API Reference">
 
9
<link rel="prev" href="gdk2-Bitmaps-and-Pixmaps.html" title="Bitmaps and Pixmaps">
 
10
<link rel="next" href="gdk2-Images.html" title="Images">
 
11
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 
12
<link rel="stylesheet" href="style.css" type="text/css">
 
13
</head>
 
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 
15
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
 
16
<tr valign="middle">
 
17
<td><a accesskey="p" href="gdk2-Bitmaps-and-Pixmaps.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
 
18
<td><a accesskey="u" href="reference.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
 
19
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
 
20
<th width="100%" align="center">GDK 2 Reference Manual</th>
 
21
<td><a accesskey="n" href="gdk2-Images.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
 
22
</tr>
 
23
<tr><td colspan="5" class="shortcuts">
 
24
<a href="#gdk2-GdkRGB.synopsis" class="shortcut">Top</a>
 
25
                   | 
 
26
                  <a href="#gdk2-GdkRGB.description" class="shortcut">Description</a>
 
27
</td></tr>
 
28
</table>
 
29
<div class="refentry">
 
30
<a name="gdk2-GdkRGB"></a><div class="titlepage"></div>
 
31
<div class="refnamediv"><table width="100%"><tr>
 
32
<td valign="top">
 
33
<h2><span class="refentrytitle"><a name="gdk2-GdkRGB.top_of_page"></a>GdkRGB</span></h2>
 
34
<p>GdkRGB — Renders RGB, grayscale, or indexed image data to a GdkDrawable</p>
 
35
</td>
 
36
<td valign="top" align="right"></td>
 
37
</tr></table></div>
 
38
<div class="refsynopsisdiv">
 
39
<a name="gdk2-GdkRGB.synopsis"></a><h2>Synopsis</h2>
 
40
<pre class="synopsis">
 
41
#include &lt;gdk/gdk.h&gt;
 
42
 
 
43
<span class="returnvalue">void</span>                <a class="link" href="gdk2-GdkRGB.html#gdk-rgb-init" title="gdk_rgb_init ()">gdk_rgb_init</a>                        (<em class="parameter"><code><span class="type">void</span></code></em>);
 
44
 
 
45
<span class="returnvalue">void</span>                <a class="link" href="gdk2-GdkRGB.html#gdk-draw-rgb-image" title="gdk_draw_rgb_image ()">gdk_draw_rgb_image</a>                  (<em class="parameter"><code><a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> *drawable</code></em>,
 
46
                                                         <em class="parameter"><code><a class="link" href="gdk2-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> *gc</code></em>,
 
47
                                                         <em class="parameter"><code><span class="type">gint</span> x</code></em>,
 
48
                                                         <em class="parameter"><code><span class="type">gint</span> y</code></em>,
 
49
                                                         <em class="parameter"><code><span class="type">gint</span> width</code></em>,
 
50
                                                         <em class="parameter"><code><span class="type">gint</span> height</code></em>,
 
51
                                                         <em class="parameter"><code><a class="link" href="gdk2-GdkRGB.html#GdkRgbDither" title="enum GdkRgbDither"><span class="type">GdkRgbDither</span></a> dith</code></em>,
 
52
                                                         <em class="parameter"><code>const <span class="type">guchar</span> *rgb_buf</code></em>,
 
53
                                                         <em class="parameter"><code><span class="type">gint</span> rowstride</code></em>);
 
54
<span class="returnvalue">void</span>                <a class="link" href="gdk2-GdkRGB.html#gdk-draw-rgb-image-dithalign" title="gdk_draw_rgb_image_dithalign ()">gdk_draw_rgb_image_dithalign</a>        (<em class="parameter"><code><a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> *drawable</code></em>,
 
55
                                                         <em class="parameter"><code><a class="link" href="gdk2-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> *gc</code></em>,
 
56
                                                         <em class="parameter"><code><span class="type">gint</span> x</code></em>,
 
57
                                                         <em class="parameter"><code><span class="type">gint</span> y</code></em>,
 
58
                                                         <em class="parameter"><code><span class="type">gint</span> width</code></em>,
 
59
                                                         <em class="parameter"><code><span class="type">gint</span> height</code></em>,
 
60
                                                         <em class="parameter"><code><a class="link" href="gdk2-GdkRGB.html#GdkRgbDither" title="enum GdkRgbDither"><span class="type">GdkRgbDither</span></a> dith</code></em>,
 
61
                                                         <em class="parameter"><code>const <span class="type">guchar</span> *rgb_buf</code></em>,
 
62
                                                         <em class="parameter"><code><span class="type">gint</span> rowstride</code></em>,
 
63
                                                         <em class="parameter"><code><span class="type">gint</span> xdith</code></em>,
 
64
                                                         <em class="parameter"><code><span class="type">gint</span> ydith</code></em>);
 
65
<span class="returnvalue">void</span>                <a class="link" href="gdk2-GdkRGB.html#gdk-draw-indexed-image" title="gdk_draw_indexed_image ()">gdk_draw_indexed_image</a>              (<em class="parameter"><code><a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> *drawable</code></em>,
 
66
                                                         <em class="parameter"><code><a class="link" href="gdk2-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> *gc</code></em>,
 
67
                                                         <em class="parameter"><code><span class="type">gint</span> x</code></em>,
 
68
                                                         <em class="parameter"><code><span class="type">gint</span> y</code></em>,
 
69
                                                         <em class="parameter"><code><span class="type">gint</span> width</code></em>,
 
70
                                                         <em class="parameter"><code><span class="type">gint</span> height</code></em>,
 
71
                                                         <em class="parameter"><code><a class="link" href="gdk2-GdkRGB.html#GdkRgbDither" title="enum GdkRgbDither"><span class="type">GdkRgbDither</span></a> dith</code></em>,
 
72
                                                         <em class="parameter"><code>const <span class="type">guchar</span> *buf</code></em>,
 
73
                                                         <em class="parameter"><code><span class="type">gint</span> rowstride</code></em>,
 
74
                                                         <em class="parameter"><code><a class="link" href="gdk2-GdkRGB.html#GdkRgbCmap" title="struct GdkRgbCmap"><span class="type">GdkRgbCmap</span></a> *cmap</code></em>);
 
75
<span class="returnvalue">void</span>                <a class="link" href="gdk2-GdkRGB.html#gdk-draw-gray-image" title="gdk_draw_gray_image ()">gdk_draw_gray_image</a>                 (<em class="parameter"><code><a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> *drawable</code></em>,
 
76
                                                         <em class="parameter"><code><a class="link" href="gdk2-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> *gc</code></em>,
 
77
                                                         <em class="parameter"><code><span class="type">gint</span> x</code></em>,
 
78
                                                         <em class="parameter"><code><span class="type">gint</span> y</code></em>,
 
79
                                                         <em class="parameter"><code><span class="type">gint</span> width</code></em>,
 
80
                                                         <em class="parameter"><code><span class="type">gint</span> height</code></em>,
 
81
                                                         <em class="parameter"><code><a class="link" href="gdk2-GdkRGB.html#GdkRgbDither" title="enum GdkRgbDither"><span class="type">GdkRgbDither</span></a> dith</code></em>,
 
82
                                                         <em class="parameter"><code>const <span class="type">guchar</span> *buf</code></em>,
 
83
                                                         <em class="parameter"><code><span class="type">gint</span> rowstride</code></em>);
 
84
<span class="returnvalue">void</span>                <a class="link" href="gdk2-GdkRGB.html#gdk-draw-rgb-32-image" title="gdk_draw_rgb_32_image ()">gdk_draw_rgb_32_image</a>               (<em class="parameter"><code><a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> *drawable</code></em>,
 
85
                                                         <em class="parameter"><code><a class="link" href="gdk2-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> *gc</code></em>,
 
86
                                                         <em class="parameter"><code><span class="type">gint</span> x</code></em>,
 
87
                                                         <em class="parameter"><code><span class="type">gint</span> y</code></em>,
 
88
                                                         <em class="parameter"><code><span class="type">gint</span> width</code></em>,
 
89
                                                         <em class="parameter"><code><span class="type">gint</span> height</code></em>,
 
90
                                                         <em class="parameter"><code><a class="link" href="gdk2-GdkRGB.html#GdkRgbDither" title="enum GdkRgbDither"><span class="type">GdkRgbDither</span></a> dith</code></em>,
 
91
                                                         <em class="parameter"><code>const <span class="type">guchar</span> *buf</code></em>,
 
92
                                                         <em class="parameter"><code><span class="type">gint</span> rowstride</code></em>);
 
93
<span class="returnvalue">void</span>                <a class="link" href="gdk2-GdkRGB.html#gdk-draw-rgb-32-image-dithalign" title="gdk_draw_rgb_32_image_dithalign ()">gdk_draw_rgb_32_image_dithalign</a>     (<em class="parameter"><code><a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> *drawable</code></em>,
 
94
                                                         <em class="parameter"><code><a class="link" href="gdk2-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> *gc</code></em>,
 
95
                                                         <em class="parameter"><code><span class="type">gint</span> x</code></em>,
 
96
                                                         <em class="parameter"><code><span class="type">gint</span> y</code></em>,
 
97
                                                         <em class="parameter"><code><span class="type">gint</span> width</code></em>,
 
98
                                                         <em class="parameter"><code><span class="type">gint</span> height</code></em>,
 
99
                                                         <em class="parameter"><code><a class="link" href="gdk2-GdkRGB.html#GdkRgbDither" title="enum GdkRgbDither"><span class="type">GdkRgbDither</span></a> dith</code></em>,
 
100
                                                         <em class="parameter"><code>const <span class="type">guchar</span> *buf</code></em>,
 
101
                                                         <em class="parameter"><code><span class="type">gint</span> rowstride</code></em>,
 
102
                                                         <em class="parameter"><code><span class="type">gint</span> xdith</code></em>,
 
103
                                                         <em class="parameter"><code><span class="type">gint</span> ydith</code></em>);
 
104
enum                <a class="link" href="gdk2-GdkRGB.html#GdkRgbDither" title="enum GdkRgbDither">GdkRgbDither</a>;
 
105
 
 
106
<a class="link" href="gdk2-GdkRGB.html#GdkRgbCmap" title="struct GdkRgbCmap"><span class="returnvalue">GdkRgbCmap</span></a> *        <a class="link" href="gdk2-GdkRGB.html#gdk-rgb-cmap-new" title="gdk_rgb_cmap_new ()">gdk_rgb_cmap_new</a>                    (<em class="parameter"><code><span class="type">guint32</span> *colors</code></em>,
 
107
                                                         <em class="parameter"><code><span class="type">gint</span> n_colors</code></em>);
 
108
<span class="returnvalue">void</span>                <a class="link" href="gdk2-GdkRGB.html#gdk-rgb-cmap-free" title="gdk_rgb_cmap_free ()">gdk_rgb_cmap_free</a>                   (<em class="parameter"><code><a class="link" href="gdk2-GdkRGB.html#GdkRgbCmap" title="struct GdkRgbCmap"><span class="type">GdkRgbCmap</span></a> *cmap</code></em>);
 
109
struct              <a class="link" href="gdk2-GdkRGB.html#GdkRgbCmap" title="struct GdkRgbCmap">GdkRgbCmap</a>;
 
110
 
 
111
<span class="returnvalue">void</span>                <a class="link" href="gdk2-GdkRGB.html#gdk-rgb-gc-set-foreground" title="gdk_rgb_gc_set_foreground ()">gdk_rgb_gc_set_foreground</a>           (<em class="parameter"><code><a class="link" href="gdk2-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> *gc</code></em>,
 
112
                                                         <em class="parameter"><code><span class="type">guint32</span> rgb</code></em>);
 
113
<span class="returnvalue">void</span>                <a class="link" href="gdk2-GdkRGB.html#gdk-rgb-gc-set-background" title="gdk_rgb_gc_set_background ()">gdk_rgb_gc_set_background</a>           (<em class="parameter"><code><a class="link" href="gdk2-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> *gc</code></em>,
 
114
                                                         <em class="parameter"><code><span class="type">guint32</span> rgb</code></em>);
 
115
<span class="returnvalue">gulong</span>              <a class="link" href="gdk2-GdkRGB.html#gdk-rgb-xpixel-from-rgb" title="gdk_rgb_xpixel_from_rgb ()">gdk_rgb_xpixel_from_rgb</a>             (<em class="parameter"><code><span class="type">guint32</span> rgb</code></em>);
 
116
<span class="returnvalue">void</span>                <a class="link" href="gdk2-GdkRGB.html#gdk-rgb-find-color" title="gdk_rgb_find_color ()">gdk_rgb_find_color</a>                  (<em class="parameter"><code><a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a> *colormap</code></em>,
 
117
                                                         <em class="parameter"><code><a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *color</code></em>);
 
118
 
 
119
<span class="returnvalue">void</span>                <a class="link" href="gdk2-GdkRGB.html#gdk-rgb-set-install" title="gdk_rgb_set_install ()">gdk_rgb_set_install</a>                 (<em class="parameter"><code><span class="type">gboolean</span> install</code></em>);
 
120
<span class="returnvalue">void</span>                <a class="link" href="gdk2-GdkRGB.html#gdk-rgb-set-min-colors" title="gdk_rgb_set_min_colors ()">gdk_rgb_set_min_colors</a>              (<em class="parameter"><code><span class="type">gint</span> min_colors</code></em>);
 
121
<a class="link" href="gdk2-Visuals.html#GdkVisual" title="GdkVisual"><span class="returnvalue">GdkVisual</span></a> *         <a class="link" href="gdk2-GdkRGB.html#gdk-rgb-get-visual" title="gdk_rgb_get_visual ()">gdk_rgb_get_visual</a>                  (<em class="parameter"><code><span class="type">void</span></code></em>);
 
122
<a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="returnvalue">GdkColormap</span></a> *       <a class="link" href="gdk2-GdkRGB.html#gdk-rgb-get-colormap" title="gdk_rgb_get_colormap ()">gdk_rgb_get_colormap</a>                (<em class="parameter"><code><span class="type">void</span></code></em>);
 
123
#define             <a class="link" href="gdk2-GdkRGB.html#gdk-rgb-get-cmap" title="gdk_rgb_get_cmap">gdk_rgb_get_cmap</a>
 
124
<span class="returnvalue">gboolean</span>            <a class="link" href="gdk2-GdkRGB.html#gdk-rgb-ditherable" title="gdk_rgb_ditherable ()">gdk_rgb_ditherable</a>                  (<em class="parameter"><code><span class="type">void</span></code></em>);
 
125
<span class="returnvalue">gboolean</span>            <a class="link" href="gdk2-GdkRGB.html#gdk-rgb-colormap-ditherable" title="gdk_rgb_colormap_ditherable ()">gdk_rgb_colormap_ditherable</a>         (<em class="parameter"><code><a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a> *cmap</code></em>);
 
126
<span class="returnvalue">void</span>                <a class="link" href="gdk2-GdkRGB.html#gdk-rgb-set-verbose" title="gdk_rgb_set_verbose ()">gdk_rgb_set_verbose</a>                 (<em class="parameter"><code><span class="type">gboolean</span> verbose</code></em>);
 
127
</pre>
 
128
</div>
 
129
<div class="refsect1">
 
130
<a name="gdk2-GdkRGB.description"></a><h2>Description</h2>
 
131
<p>
 
132
GdkRGB is a low-level module which renders RGB, grayscale, and indexed
 
133
colormap images to a <a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a>. It does this as efficiently as
 
134
possible, handling issues such as colormaps, visuals, dithering,
 
135
temporary buffers, and so on. Most code should use the higher-level
 
136
<a href="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> features in place of this module; for example,
 
137
<a class="link" href="gdk2-Drawing-Primitives.html#gdk-draw-pixbuf" title="gdk_draw_pixbuf ()"><code class="function">gdk_draw_pixbuf()</code></a> uses GdkRGB in its implementation.
 
138
</p>
 
139
<p>
 
140
GdkRGB allocates a color cube to use when rendering images.  You can
 
141
set the threshold for installing colormaps with
 
142
<a class="link" href="gdk2-GdkRGB.html#gdk-rgb-set-min-colors" title="gdk_rgb_set_min_colors ()"><code class="function">gdk_rgb_set_min_colors()</code></a>. The default is 5x5x5 (125). If a colorcube
 
143
of this size or larger can be allocated in the default colormap, then
 
144
that's done. Otherwise, GdkRGB creates its own private colormap.
 
145
Setting it to 0 means that it always tries to use the default
 
146
colormap, and setting it to 216 means that it always creates a private
 
147
one if it cannot allocate the 6x6x6 colormap in the default. If you
 
148
always want a private colormap (to avoid consuming too many colormap
 
149
entries for other apps, say), you can use
 
150
<code class="literal">gdk_rgb_set_install(TRUE)</code>.
 
151
Setting the value greater than 216 exercises a bug in older versions
 
152
of GdkRGB. Note, however, that setting it to 0 doesn't let you get
 
153
away with ignoring the colormap and visual - a colormap is always
 
154
created in grayscale and direct color modes, and the visual is changed
 
155
in cases where a "better" visual than the default is available.
 
156
</p>
 
157
<p>
 
158
If GDK is built with the Sun mediaLib library, the GdkRGB functions are
 
159
accelerated using mediaLib, which provides hardware acceleration on Intel,
 
160
AMD, and Sparc chipsets.  If desired, mediaLib support can be turned off
 
161
by setting the GDK_DISABLE_MEDIALIB environment variable.
 
162
</p>
 
163
<div class="example">
 
164
<a name="idp16118400"></a><p class="title"><b>Example 4. A simple example program using GdkRGB</b></p>
 
165
<div class="example-contents">
 
166
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
 
167
    <tbody>
 
168
      <tr>
 
169
        <td class="listing_lines" align="right"><pre>1
 
170
2
 
171
3
 
172
4
 
173
5
 
174
6
 
175
7
 
176
8
 
177
9
 
178
10
 
179
11
 
180
12
 
181
13
 
182
14
 
183
15
 
184
16
 
185
17
 
186
18
 
187
19
 
188
20
 
189
21
 
190
22
 
191
23
 
192
24
 
193
25
 
194
26
 
195
27
 
196
28
 
197
29
 
198
30
 
199
31
 
200
32
 
201
33
 
202
34
 
203
35
 
204
36
 
205
37
 
206
38
 
207
39
 
208
40
 
209
41
 
210
42
 
211
43
 
212
44
 
213
45</pre></td>
 
214
        <td class="listing_code"><pre class="programlisting"><span class="preproc">#include</span><span class="normal"> </span><span class="string">&lt;gtk/gtk.h&gt;</span>
 
215
<span class="preproc">#define</span><span class="normal"> IMAGE_WIDTH </span><span class="number">256</span>
 
216
<span class="preproc">#define</span><span class="normal"> IMAGE_HEIGHT    </span><span class="number">256</span>
 
217
<span class="usertype">guchar</span><span class="normal"> rgbbuf</span><span class="symbol">[</span><span class="normal">IMAGE_WIDTH </span><span class="symbol">*</span><span class="normal"> IMAGE_HEIGHT </span><span class="symbol">*</span><span class="normal"> </span><span class="number">3</span><span class="symbol">];</span>
 
218
<span class="usertype">gboolean</span><span class="normal"> </span><span class="function">on_darea_expose</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">GtkWidget</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">widget</span><span class="symbol">,</span>
 
219
<span class="normal">              </span><span class="usertype">GdkEventExpose</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">event</span><span class="symbol">,</span>
 
220
<span class="normal">              </span><span class="usertype">gpointer</span><span class="normal"> user_data</span><span class="symbol">);</span>
 
221
<span class="type">int</span>
 
222
<span class="function">main</span><span class="normal"> </span><span class="symbol">(</span><span class="type">int</span><span class="normal"> argc</span><span class="symbol">,</span><span class="normal"> </span><span class="type">char</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">argv</span><span class="symbol">[])</span>
 
223
<span class="cbracket">{</span>
 
224
<span class="normal">  </span><span class="usertype">GtkWidget</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">window</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">darea</span><span class="symbol">;</span>
 
225
<span class="normal">  </span><span class="usertype">gint</span><span class="normal"> x</span><span class="symbol">,</span><span class="normal"> y</span><span class="symbol">;</span>
 
226
<span class="normal">  </span><span class="usertype">guchar</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">pos</span><span class="symbol">;</span>
 
227
<span class="normal">  </span><span class="function"><a href="http://developer.gnome.org/gtk2/gtk3-General.html#gtk-init">gtk_init</a></span><span class="normal"> </span><span class="symbol">(&amp;</span><span class="normal">argc</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&amp;</span><span class="normal">argv</span><span class="symbol">);</span>
 
228
<span class="normal">  window </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="http://developer.gnome.org/gtk2/GtkWindow.html#gtk-window-new">gtk_window_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="http://developer.gnome.org/gtk2/gtk3-Standard-Enumerations.html#GTK-WINDOW-TOPLEVEL:CAPS">GTK_WINDOW_TOPLEVEL</a></span><span class="symbol">);</span>
 
229
<span class="normal">  darea </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="http://developer.gnome.org/gtk2/GtkDrawingArea.html#gtk-drawing-area-new">gtk_drawing_area_new</a></span><span class="normal"> </span><span class="symbol">();</span>
 
230
<span class="normal">  </span><span class="function"><a href="http://developer.gnome.org/gtk2/GtkWidget.html#gtk-widget-set-size-request">gtk_widget_set_size_request</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">darea</span><span class="symbol">,</span><span class="normal"> IMAGE_WIDTH</span><span class="symbol">,</span><span class="normal"> IMAGE_HEIGHT</span><span class="symbol">);</span>
 
231
<span class="normal">  </span><span class="function"><a href="http://developer.gnome.org/gtk2/GtkContainer.html#gtk-container-add">gtk_container_add</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_CONTAINER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">window</span><span class="symbol">),</span><span class="normal"> darea</span><span class="symbol">);</span>
 
232
<span class="normal">  </span><span class="function">gtk_signal_connect</span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_OBJECT</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">darea</span><span class="symbol">),</span><span class="normal"> </span><span class="string">"expose-event"</span><span class="symbol">,</span>
 
233
<span class="normal">                      </span><span class="function">GTK_SIGNAL_FUNC</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">on_darea_expose</span><span class="symbol">),</span><span class="normal"> <a href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
 
234
<span class="normal">  </span><span class="function"><a href="http://developer.gnome.org/gtk2/GtkWidget.html#gtk-widget-show-all">gtk_widget_show_all</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">window</span><span class="symbol">);</span>
 
235
<span class="normal">  </span><span class="comment">/* Set up the RGB buffer. */</span>
 
236
<span class="normal">  pos </span><span class="symbol">=</span><span class="normal"> rgbbuf</span><span class="symbol">;</span>
 
237
<span class="normal">  </span><span class="keyword">for</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">y </span><span class="symbol">=</span><span class="normal"> </span><span class="number">0</span><span class="symbol">;</span><span class="normal"> y </span><span class="symbol">&lt;</span><span class="normal"> IMAGE_HEIGHT</span><span class="symbol">;</span><span class="normal"> y</span><span class="symbol">++)</span>
 
238
<span class="normal">    </span><span class="cbracket">{</span>
 
239
<span class="normal">      </span><span class="keyword">for</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">x </span><span class="symbol">=</span><span class="normal"> </span><span class="number">0</span><span class="symbol">;</span><span class="normal"> x </span><span class="symbol">&lt;</span><span class="normal"> IMAGE_WIDTH</span><span class="symbol">;</span><span class="normal"> x</span><span class="symbol">++)</span>
 
240
<span class="normal">    </span><span class="cbracket">{</span>
 
241
<span class="normal">      </span><span class="symbol">*</span><span class="normal">pos</span><span class="symbol">++</span><span class="normal"> </span><span class="symbol">=</span><span class="normal"> x </span><span class="symbol">-</span><span class="normal"> x </span><span class="symbol">%</span><span class="normal"> </span><span class="number">32</span><span class="symbol">;</span><span class="normal">          </span><span class="comment">/* Red. */</span>
 
242
<span class="normal">      </span><span class="symbol">*</span><span class="normal">pos</span><span class="symbol">++</span><span class="normal"> </span><span class="symbol">=</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">x </span><span class="symbol">/</span><span class="normal"> </span><span class="number">32</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">*</span><span class="normal"> </span><span class="number">4</span><span class="normal"> </span><span class="symbol">+</span><span class="normal"> y </span><span class="symbol">-</span><span class="normal"> y </span><span class="symbol">%</span><span class="normal"> </span><span class="number">32</span><span class="symbol">;</span><span class="normal">   </span><span class="comment">/* Green. */</span>
 
243
<span class="normal">      </span><span class="symbol">*</span><span class="normal">pos</span><span class="symbol">++</span><span class="normal"> </span><span class="symbol">=</span><span class="normal"> y </span><span class="symbol">-</span><span class="normal"> y </span><span class="symbol">%</span><span class="normal"> </span><span class="number">32</span><span class="symbol">;</span><span class="normal">          </span><span class="comment">/* Blue. */</span>
 
244
<span class="normal">    </span><span class="cbracket">}</span>
 
245
<span class="normal">    </span><span class="cbracket">}</span>
 
246
<span class="normal">  </span><span class="function"><a href="http://developer.gnome.org/gtk2/gtk3-General.html#gtk-main">gtk_main</a></span><span class="normal"> </span><span class="symbol">();</span>
 
247
<span class="normal">  </span><span class="keyword">return</span><span class="normal"> </span><span class="number">0</span><span class="symbol">;</span>
 
248
<span class="cbracket">}</span>
 
249
<span class="normal">gboolean</span>
 
250
<span class="function">on_darea_expose</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">GtkWidget</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">widget</span><span class="symbol">,</span>
 
251
<span class="normal">         </span><span class="usertype">GdkEventExpose</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">event</span><span class="symbol">,</span>
 
252
<span class="normal">         </span><span class="usertype">gpointer</span><span class="normal"> user_data</span><span class="symbol">)</span>
 
253
<span class="cbracket">{</span>
 
254
<span class="normal">  </span><span class="function"><a href="gdk2-GdkRGB.html#gdk-draw-rgb-image">gdk_draw_rgb_image</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">widget</span><span class="symbol">-&gt;</span><span class="normal">window</span><span class="symbol">,</span><span class="normal"> widget</span><span class="symbol">-&gt;</span><span class="normal">style</span><span class="symbol">-&gt;</span><span class="normal">fg_gc</span><span class="symbol">[</span><span class="normal"><a href="http://developer.gnome.org/gtk2/gtk3-Standard-Enumerations.html#GTK-STATE-NORMAL:CAPS">GTK_STATE_NORMAL</a></span><span class="symbol">],</span>
 
255
<span class="normal">              </span><span class="number">0</span><span class="symbol">,</span><span class="normal"> </span><span class="number">0</span><span class="symbol">,</span><span class="normal"> IMAGE_WIDTH</span><span class="symbol">,</span><span class="normal"> IMAGE_HEIGHT</span><span class="symbol">,</span>
 
256
<span class="normal">              <a href="gdk2-GdkRGB.html#GDK-RGB-DITHER-MAX:CAPS">GDK_RGB_DITHER_MAX</a></span><span class="symbol">,</span><span class="normal"> rgbbuf</span><span class="symbol">,</span><span class="normal"> IMAGE_WIDTH </span><span class="symbol">*</span><span class="normal"> </span><span class="number">3</span><span class="symbol">);</span>
 
257
<span class="normal">  </span><span class="keyword">return</span><span class="normal"> TRUE</span><span class="symbol">;</span>
 
258
<span class="cbracket">}</span></pre></td>
 
259
      </tr>
 
260
    </tbody>
 
261
  </table>
 
262
</div>
 
263
 
 
264
</div>
 
265
<br class="example-break">
 
266
</div>
 
267
<div class="refsect1">
 
268
<a name="gdk2-GdkRGB.details"></a><h2>Details</h2>
 
269
<div class="refsect2">
 
270
<a name="gdk-rgb-init"></a><h3>gdk_rgb_init ()</h3>
 
271
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_rgb_init                        (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
 
272
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
273
<h3 class="title">Warning</h3>
 
274
<p><code class="literal">gdk_rgb_init</code> is deprecated and should not be used in newly-written code.</p>
 
275
</div>
 
276
<p>
 
277
This function no longer does anything at all. It's completely useless
 
278
(and harmless).
 
279
</p>
 
280
</div>
 
281
<hr>
 
282
<div class="refsect2">
 
283
<a name="gdk-draw-rgb-image"></a><h3>gdk_draw_rgb_image ()</h3>
 
284
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_draw_rgb_image                  (<em class="parameter"><code><a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> *drawable</code></em>,
 
285
                                                         <em class="parameter"><code><a class="link" href="gdk2-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> *gc</code></em>,
 
286
                                                         <em class="parameter"><code><span class="type">gint</span> x</code></em>,
 
287
                                                         <em class="parameter"><code><span class="type">gint</span> y</code></em>,
 
288
                                                         <em class="parameter"><code><span class="type">gint</span> width</code></em>,
 
289
                                                         <em class="parameter"><code><span class="type">gint</span> height</code></em>,
 
290
                                                         <em class="parameter"><code><a class="link" href="gdk2-GdkRGB.html#GdkRgbDither" title="enum GdkRgbDither"><span class="type">GdkRgbDither</span></a> dith</code></em>,
 
291
                                                         <em class="parameter"><code>const <span class="type">guchar</span> *rgb_buf</code></em>,
 
292
                                                         <em class="parameter"><code><span class="type">gint</span> rowstride</code></em>);</pre>
 
293
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
294
<h3 class="title">Warning</h3>
 
295
<p><code class="literal">gdk_draw_rgb_image</code> is deprecated and should not be used in newly-written code.</p>
 
296
</div>
 
297
<p>
 
298
Draws an RGB image in the drawable. This is the core GdkRGB
 
299
function, and likely the only one you will need to use.
 
300
</p>
 
301
<p>
 
302
The <em class="parameter"><code>rowstride</code></em> parameter allows for lines to be aligned more flexibly.
 
303
For example, lines may be allocated to begin on 32-bit boundaries,
 
304
even if the width of the rectangle is odd. Rowstride is also useful
 
305
when drawing a subrectangle of a larger image in memory. Finally, to
 
306
replicate the same line a number of times, the trick of setting
 
307
<em class="parameter"><code>rowstride</code></em> to 0 is allowed.
 
308
</p>
 
309
<p>
 
310
In general, for 0 &lt;= i &lt; <em class="parameter"><code>width</code></em> and 0 &lt;= j &lt; height,
 
311
the pixel (x + i, y + j) is colored with red value <em class="parameter"><code>rgb_buf</code></em>[<em class="parameter"><code>j</code></em> *
 
312
<em class="parameter"><code>rowstride</code></em> + <em class="parameter"><code>i</code></em> * 3], green value <em class="parameter"><code>rgb_buf</code></em>[<em class="parameter"><code>j</code></em> * <em class="parameter"><code>rowstride</code></em> + <em class="parameter"><code>i</code></em> * 3 +
 
313
1], and blue value <em class="parameter"><code>rgb_buf</code></em>[<em class="parameter"><code>j</code></em> * <em class="parameter"><code>rowstride</code></em> + <em class="parameter"><code>i</code></em> * 3 + 2].
 
314
</p>
 
315
<div class="variablelist"><table border="0" class="variablelist">
 
316
<colgroup>
 
317
<col align="left" valign="top">
 
318
<col>
 
319
</colgroup>
 
320
<tbody>
 
321
<tr>
 
322
<td><p><span class="term"><em class="parameter"><code>drawable</code></em> :</span></p></td>
 
323
<td>The <a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> to draw in (usually a <a class="link" href="gdk2-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a>).</td>
 
324
</tr>
 
325
<tr>
 
326
<td><p><span class="term"><em class="parameter"><code>gc</code></em> :</span></p></td>
 
327
<td>The graphics context (all GDK drawing operations require one; its
 
328
contents are ignored).</td>
 
329
</tr>
 
330
<tr>
 
331
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
 
332
<td>The x coordinate of the top-left corner in the drawable.</td>
 
333
</tr>
 
334
<tr>
 
335
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
 
336
<td>The y coordinate of the top-left corner in the drawable.</td>
 
337
</tr>
 
338
<tr>
 
339
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
 
340
<td>The width of the rectangle to be drawn.</td>
 
341
</tr>
 
342
<tr>
 
343
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
 
344
<td>The height of the rectangle to be drawn.</td>
 
345
</tr>
 
346
<tr>
 
347
<td><p><span class="term"><em class="parameter"><code>dith</code></em> :</span></p></td>
 
348
<td>A <a class="link" href="gdk2-GdkRGB.html#GdkRgbDither" title="enum GdkRgbDither"><span class="type">GdkRgbDither</span></a> value, selecting the desired dither mode.</td>
 
349
</tr>
 
350
<tr>
 
351
<td><p><span class="term"><em class="parameter"><code>rgb_buf</code></em> :</span></p></td>
 
352
<td>The pixel data, represented as packed 24-bit data.</td>
 
353
</tr>
 
354
<tr>
 
355
<td><p><span class="term"><em class="parameter"><code>rowstride</code></em> :</span></p></td>
 
356
<td>The number of bytes from the start of one row in <em class="parameter"><code>rgb_buf</code></em> to the
 
357
start of the next.</td>
 
358
</tr>
 
359
</tbody>
 
360
</table></div>
 
361
</div>
 
362
<hr>
 
363
<div class="refsect2">
 
364
<a name="gdk-draw-rgb-image-dithalign"></a><h3>gdk_draw_rgb_image_dithalign ()</h3>
 
365
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_draw_rgb_image_dithalign        (<em class="parameter"><code><a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> *drawable</code></em>,
 
366
                                                         <em class="parameter"><code><a class="link" href="gdk2-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> *gc</code></em>,
 
367
                                                         <em class="parameter"><code><span class="type">gint</span> x</code></em>,
 
368
                                                         <em class="parameter"><code><span class="type">gint</span> y</code></em>,
 
369
                                                         <em class="parameter"><code><span class="type">gint</span> width</code></em>,
 
370
                                                         <em class="parameter"><code><span class="type">gint</span> height</code></em>,
 
371
                                                         <em class="parameter"><code><a class="link" href="gdk2-GdkRGB.html#GdkRgbDither" title="enum GdkRgbDither"><span class="type">GdkRgbDither</span></a> dith</code></em>,
 
372
                                                         <em class="parameter"><code>const <span class="type">guchar</span> *rgb_buf</code></em>,
 
373
                                                         <em class="parameter"><code><span class="type">gint</span> rowstride</code></em>,
 
374
                                                         <em class="parameter"><code><span class="type">gint</span> xdith</code></em>,
 
375
                                                         <em class="parameter"><code><span class="type">gint</span> ydith</code></em>);</pre>
 
376
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
377
<h3 class="title">Warning</h3>
 
378
<p><code class="literal">gdk_draw_rgb_image_dithalign</code> is deprecated and should not be used in newly-written code.</p>
 
379
</div>
 
380
<p>
 
381
Draws an RGB image in the drawable, with an adjustment for dither alignment.
 
382
</p>
 
383
<p>
 
384
This function is useful when drawing dithered images into a window
 
385
that may be scrolled. Pixel (x, y) will be drawn dithered as if its
 
386
actual location is (x + <em class="parameter"><code>xdith</code></em>, y + <em class="parameter"><code>ydith</code></em>). Thus, if you draw an
 
387
image into a window using zero dither alignment, then scroll up one
 
388
pixel, subsequent draws to the window should have <em class="parameter"><code>ydith</code></em> = 1.
 
389
</p>
 
390
<p>
 
391
Setting the dither alignment correctly allows updating of small parts
 
392
of the screen while avoiding visible "seams" between the different
 
393
dither textures.
 
394
</p>
 
395
<div class="variablelist"><table border="0" class="variablelist">
 
396
<colgroup>
 
397
<col align="left" valign="top">
 
398
<col>
 
399
</colgroup>
 
400
<tbody>
 
401
<tr>
 
402
<td><p><span class="term"><em class="parameter"><code>drawable</code></em> :</span></p></td>
 
403
<td>The <a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> to draw in (usually a <a class="link" href="gdk2-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a>).</td>
 
404
</tr>
 
405
<tr>
 
406
<td><p><span class="term"><em class="parameter"><code>gc</code></em> :</span></p></td>
 
407
<td>The graphics context.</td>
 
408
</tr>
 
409
<tr>
 
410
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
 
411
<td>The x coordinate of the top-left corner in the drawable.</td>
 
412
</tr>
 
413
<tr>
 
414
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
 
415
<td>The y coordinate of the top-left corner in the drawable.</td>
 
416
</tr>
 
417
<tr>
 
418
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
 
419
<td>The width of the rectangle to be drawn.</td>
 
420
</tr>
 
421
<tr>
 
422
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
 
423
<td>The height of the rectangle to be drawn.</td>
 
424
</tr>
 
425
<tr>
 
426
<td><p><span class="term"><em class="parameter"><code>dith</code></em> :</span></p></td>
 
427
<td>A <a class="link" href="gdk2-GdkRGB.html#GdkRgbDither" title="enum GdkRgbDither"><span class="type">GdkRgbDither</span></a> value, selecting the desired dither mode.</td>
 
428
</tr>
 
429
<tr>
 
430
<td><p><span class="term"><em class="parameter"><code>rgb_buf</code></em> :</span></p></td>
 
431
<td>The pixel data, represented as packed 24-bit data.</td>
 
432
</tr>
 
433
<tr>
 
434
<td><p><span class="term"><em class="parameter"><code>rowstride</code></em> :</span></p></td>
 
435
<td>The number of bytes from the start of one row in <em class="parameter"><code>rgb_buf</code></em> to the
 
436
start of the next.</td>
 
437
</tr>
 
438
<tr>
 
439
<td><p><span class="term"><em class="parameter"><code>xdith</code></em> :</span></p></td>
 
440
<td>An x offset for dither alignment.</td>
 
441
</tr>
 
442
<tr>
 
443
<td><p><span class="term"><em class="parameter"><code>ydith</code></em> :</span></p></td>
 
444
<td>A y offset for dither alignment.</td>
 
445
</tr>
 
446
</tbody>
 
447
</table></div>
 
448
</div>
 
449
<hr>
 
450
<div class="refsect2">
 
451
<a name="gdk-draw-indexed-image"></a><h3>gdk_draw_indexed_image ()</h3>
 
452
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_draw_indexed_image              (<em class="parameter"><code><a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> *drawable</code></em>,
 
453
                                                         <em class="parameter"><code><a class="link" href="gdk2-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> *gc</code></em>,
 
454
                                                         <em class="parameter"><code><span class="type">gint</span> x</code></em>,
 
455
                                                         <em class="parameter"><code><span class="type">gint</span> y</code></em>,
 
456
                                                         <em class="parameter"><code><span class="type">gint</span> width</code></em>,
 
457
                                                         <em class="parameter"><code><span class="type">gint</span> height</code></em>,
 
458
                                                         <em class="parameter"><code><a class="link" href="gdk2-GdkRGB.html#GdkRgbDither" title="enum GdkRgbDither"><span class="type">GdkRgbDither</span></a> dith</code></em>,
 
459
                                                         <em class="parameter"><code>const <span class="type">guchar</span> *buf</code></em>,
 
460
                                                         <em class="parameter"><code><span class="type">gint</span> rowstride</code></em>,
 
461
                                                         <em class="parameter"><code><a class="link" href="gdk2-GdkRGB.html#GdkRgbCmap" title="struct GdkRgbCmap"><span class="type">GdkRgbCmap</span></a> *cmap</code></em>);</pre>
 
462
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
463
<h3 class="title">Warning</h3>
 
464
<p><code class="literal">gdk_draw_indexed_image</code> is deprecated and should not be used in newly-written code.</p>
 
465
</div>
 
466
<p>
 
467
Draws an indexed image in the drawable, using a <a class="link" href="gdk2-GdkRGB.html#GdkRgbCmap" title="struct GdkRgbCmap"><span class="type">GdkRgbCmap</span></a> to assign
 
468
actual colors to the color indices.
 
469
</p>
 
470
<div class="variablelist"><table border="0" class="variablelist">
 
471
<colgroup>
 
472
<col align="left" valign="top">
 
473
<col>
 
474
</colgroup>
 
475
<tbody>
 
476
<tr>
 
477
<td><p><span class="term"><em class="parameter"><code>drawable</code></em> :</span></p></td>
 
478
<td>The <a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> to draw in (usually a <a class="link" href="gdk2-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a>).</td>
 
479
</tr>
 
480
<tr>
 
481
<td><p><span class="term"><em class="parameter"><code>gc</code></em> :</span></p></td>
 
482
<td>The graphics context.</td>
 
483
</tr>
 
484
<tr>
 
485
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
 
486
<td>The x coordinate of the top-left corner in the drawable.</td>
 
487
</tr>
 
488
<tr>
 
489
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
 
490
<td>The y coordinate of the top-left corner in the drawable.</td>
 
491
</tr>
 
492
<tr>
 
493
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
 
494
<td>The width of the rectangle to be drawn.</td>
 
495
</tr>
 
496
<tr>
 
497
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
 
498
<td>The height of the rectangle to be drawn.</td>
 
499
</tr>
 
500
<tr>
 
501
<td><p><span class="term"><em class="parameter"><code>dith</code></em> :</span></p></td>
 
502
<td>A <a class="link" href="gdk2-GdkRGB.html#GdkRgbDither" title="enum GdkRgbDither"><span class="type">GdkRgbDither</span></a> value, selecting the desired dither mode.</td>
 
503
</tr>
 
504
<tr>
 
505
<td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
 
506
<td>The pixel data, represented as 8-bit color indices.</td>
 
507
</tr>
 
508
<tr>
 
509
<td><p><span class="term"><em class="parameter"><code>rowstride</code></em> :</span></p></td>
 
510
<td>The number of bytes from the start of one row in <em class="parameter"><code>buf</code></em> to the
 
511
start of the next.</td>
 
512
</tr>
 
513
<tr>
 
514
<td><p><span class="term"><em class="parameter"><code>cmap</code></em> :</span></p></td>
 
515
<td>The <a class="link" href="gdk2-GdkRGB.html#GdkRgbCmap" title="struct GdkRgbCmap"><span class="type">GdkRgbCmap</span></a> used to assign colors to the color indices.</td>
 
516
</tr>
 
517
</tbody>
 
518
</table></div>
 
519
</div>
 
520
<hr>
 
521
<div class="refsect2">
 
522
<a name="gdk-draw-gray-image"></a><h3>gdk_draw_gray_image ()</h3>
 
523
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_draw_gray_image                 (<em class="parameter"><code><a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> *drawable</code></em>,
 
524
                                                         <em class="parameter"><code><a class="link" href="gdk2-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> *gc</code></em>,
 
525
                                                         <em class="parameter"><code><span class="type">gint</span> x</code></em>,
 
526
                                                         <em class="parameter"><code><span class="type">gint</span> y</code></em>,
 
527
                                                         <em class="parameter"><code><span class="type">gint</span> width</code></em>,
 
528
                                                         <em class="parameter"><code><span class="type">gint</span> height</code></em>,
 
529
                                                         <em class="parameter"><code><a class="link" href="gdk2-GdkRGB.html#GdkRgbDither" title="enum GdkRgbDither"><span class="type">GdkRgbDither</span></a> dith</code></em>,
 
530
                                                         <em class="parameter"><code>const <span class="type">guchar</span> *buf</code></em>,
 
531
                                                         <em class="parameter"><code><span class="type">gint</span> rowstride</code></em>);</pre>
 
532
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
533
<h3 class="title">Warning</h3>
 
534
<p><code class="literal">gdk_draw_gray_image</code> is deprecated and should not be used in newly-written code.</p>
 
535
</div>
 
536
<p>
 
537
Draws a grayscale image in the drawable.
 
538
</p>
 
539
<div class="variablelist"><table border="0" class="variablelist">
 
540
<colgroup>
 
541
<col align="left" valign="top">
 
542
<col>
 
543
</colgroup>
 
544
<tbody>
 
545
<tr>
 
546
<td><p><span class="term"><em class="parameter"><code>drawable</code></em> :</span></p></td>
 
547
<td>The <a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> to draw in (usually a <a class="link" href="gdk2-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a>).</td>
 
548
</tr>
 
549
<tr>
 
550
<td><p><span class="term"><em class="parameter"><code>gc</code></em> :</span></p></td>
 
551
<td>The graphics context.</td>
 
552
</tr>
 
553
<tr>
 
554
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
 
555
<td>The x coordinate of the top-left corner in the drawable.</td>
 
556
</tr>
 
557
<tr>
 
558
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
 
559
<td>The y coordinate of the top-left corner in the drawable.</td>
 
560
</tr>
 
561
<tr>
 
562
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
 
563
<td>The width of the rectangle to be drawn.</td>
 
564
</tr>
 
565
<tr>
 
566
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
 
567
<td>The height of the rectangle to be drawn.</td>
 
568
</tr>
 
569
<tr>
 
570
<td><p><span class="term"><em class="parameter"><code>dith</code></em> :</span></p></td>
 
571
<td>A <a class="link" href="gdk2-GdkRGB.html#GdkRgbDither" title="enum GdkRgbDither"><span class="type">GdkRgbDither</span></a> value, selecting the desired dither mode.</td>
 
572
</tr>
 
573
<tr>
 
574
<td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
 
575
<td>The pixel data, represented as 8-bit gray values.</td>
 
576
</tr>
 
577
<tr>
 
578
<td><p><span class="term"><em class="parameter"><code>rowstride</code></em> :</span></p></td>
 
579
<td>The number of bytes from the start of one row in <em class="parameter"><code>buf</code></em> to the
 
580
start of the next.</td>
 
581
</tr>
 
582
</tbody>
 
583
</table></div>
 
584
</div>
 
585
<hr>
 
586
<div class="refsect2">
 
587
<a name="gdk-draw-rgb-32-image"></a><h3>gdk_draw_rgb_32_image ()</h3>
 
588
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_draw_rgb_32_image               (<em class="parameter"><code><a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> *drawable</code></em>,
 
589
                                                         <em class="parameter"><code><a class="link" href="gdk2-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> *gc</code></em>,
 
590
                                                         <em class="parameter"><code><span class="type">gint</span> x</code></em>,
 
591
                                                         <em class="parameter"><code><span class="type">gint</span> y</code></em>,
 
592
                                                         <em class="parameter"><code><span class="type">gint</span> width</code></em>,
 
593
                                                         <em class="parameter"><code><span class="type">gint</span> height</code></em>,
 
594
                                                         <em class="parameter"><code><a class="link" href="gdk2-GdkRGB.html#GdkRgbDither" title="enum GdkRgbDither"><span class="type">GdkRgbDither</span></a> dith</code></em>,
 
595
                                                         <em class="parameter"><code>const <span class="type">guchar</span> *buf</code></em>,
 
596
                                                         <em class="parameter"><code><span class="type">gint</span> rowstride</code></em>);</pre>
 
597
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
598
<h3 class="title">Warning</h3>
 
599
<p><code class="literal">gdk_draw_rgb_32_image</code> is deprecated and should not be used in newly-written code.</p>
 
600
</div>
 
601
<p>
 
602
Draws a padded RGB image in the drawable. The image is stored as one
 
603
pixel per 32-bit word. It is laid out as a red byte, a green byte, a
 
604
blue byte, and a padding byte.
 
605
</p>
 
606
<p>
 
607
It's unlikely that this function will give significant performance
 
608
gains in practice. In my experience, the performance gain from having
 
609
pixels aligned to 32-bit boundaries is cancelled out by the increased
 
610
memory bandwidth.
 
611
</p>
 
612
<div class="variablelist"><table border="0" class="variablelist">
 
613
<colgroup>
 
614
<col align="left" valign="top">
 
615
<col>
 
616
</colgroup>
 
617
<tbody>
 
618
<tr>
 
619
<td><p><span class="term"><em class="parameter"><code>drawable</code></em> :</span></p></td>
 
620
<td>The <a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> to draw in (usually a <a class="link" href="gdk2-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a>).</td>
 
621
</tr>
 
622
<tr>
 
623
<td><p><span class="term"><em class="parameter"><code>gc</code></em> :</span></p></td>
 
624
<td>The graphics context.</td>
 
625
</tr>
 
626
<tr>
 
627
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
 
628
<td>The x coordinate of the top-left corner in the drawable.</td>
 
629
</tr>
 
630
<tr>
 
631
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
 
632
<td>The y coordinate of the top-left corner in the drawable.</td>
 
633
</tr>
 
634
<tr>
 
635
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
 
636
<td>The width of the rectangle to be drawn.</td>
 
637
</tr>
 
638
<tr>
 
639
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
 
640
<td>The height of the rectangle to be drawn.</td>
 
641
</tr>
 
642
<tr>
 
643
<td><p><span class="term"><em class="parameter"><code>dith</code></em> :</span></p></td>
 
644
<td>A <a class="link" href="gdk2-GdkRGB.html#GdkRgbDither" title="enum GdkRgbDither"><span class="type">GdkRgbDither</span></a> value, selecting the desired dither mode.</td>
 
645
</tr>
 
646
<tr>
 
647
<td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
 
648
<td>The pixel data, represented as padded 32-bit data.</td>
 
649
</tr>
 
650
<tr>
 
651
<td><p><span class="term"><em class="parameter"><code>rowstride</code></em> :</span></p></td>
 
652
<td>The number of bytes from the start of one row in <em class="parameter"><code>buf</code></em> to the
 
653
start of the next.</td>
 
654
</tr>
 
655
</tbody>
 
656
</table></div>
 
657
</div>
 
658
<hr>
 
659
<div class="refsect2">
 
660
<a name="gdk-draw-rgb-32-image-dithalign"></a><h3>gdk_draw_rgb_32_image_dithalign ()</h3>
 
661
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_draw_rgb_32_image_dithalign     (<em class="parameter"><code><a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> *drawable</code></em>,
 
662
                                                         <em class="parameter"><code><a class="link" href="gdk2-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> *gc</code></em>,
 
663
                                                         <em class="parameter"><code><span class="type">gint</span> x</code></em>,
 
664
                                                         <em class="parameter"><code><span class="type">gint</span> y</code></em>,
 
665
                                                         <em class="parameter"><code><span class="type">gint</span> width</code></em>,
 
666
                                                         <em class="parameter"><code><span class="type">gint</span> height</code></em>,
 
667
                                                         <em class="parameter"><code><a class="link" href="gdk2-GdkRGB.html#GdkRgbDither" title="enum GdkRgbDither"><span class="type">GdkRgbDither</span></a> dith</code></em>,
 
668
                                                         <em class="parameter"><code>const <span class="type">guchar</span> *buf</code></em>,
 
669
                                                         <em class="parameter"><code><span class="type">gint</span> rowstride</code></em>,
 
670
                                                         <em class="parameter"><code><span class="type">gint</span> xdith</code></em>,
 
671
                                                         <em class="parameter"><code><span class="type">gint</span> ydith</code></em>);</pre>
 
672
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
673
<h3 class="title">Warning</h3>
 
674
<p><code class="literal">gdk_draw_rgb_32_image_dithalign</code> has been deprecated since version 2.22 and should not be used in newly-written code. Cairo handles colors automatically.</p>
 
675
</div>
 
676
<p>
 
677
Like <a class="link" href="gdk2-GdkRGB.html#gdk-draw-rgb-32-image" title="gdk_draw_rgb_32_image ()"><code class="function">gdk_draw_rgb_32_image()</code></a>, but allows you to specify the dither
 
678
offsets. See <a class="link" href="gdk2-GdkRGB.html#gdk-draw-rgb-image-dithalign" title="gdk_draw_rgb_image_dithalign ()"><code class="function">gdk_draw_rgb_image_dithalign()</code></a> for more details.
 
679
</p>
 
680
<div class="variablelist"><table border="0" class="variablelist">
 
681
<colgroup>
 
682
<col align="left" valign="top">
 
683
<col>
 
684
</colgroup>
 
685
<tbody>
 
686
<tr>
 
687
<td><p><span class="term"><em class="parameter"><code>drawable</code></em> :</span></p></td>
 
688
<td>a <a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a>
 
689
</td>
 
690
</tr>
 
691
<tr>
 
692
<td><p><span class="term"><em class="parameter"><code>gc</code></em> :</span></p></td>
 
693
<td>a <a class="link" href="gdk2-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a>
 
694
</td>
 
695
</tr>
 
696
<tr>
 
697
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
 
698
<td>X coordinate on <em class="parameter"><code>drawable</code></em> where image should go</td>
 
699
</tr>
 
700
<tr>
 
701
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
 
702
<td>Y coordinate on <em class="parameter"><code>drawable</code></em> where image should go</td>
 
703
</tr>
 
704
<tr>
 
705
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
 
706
<td>width of area of image to draw</td>
 
707
</tr>
 
708
<tr>
 
709
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
 
710
<td>height of area of image to draw</td>
 
711
</tr>
 
712
<tr>
 
713
<td><p><span class="term"><em class="parameter"><code>dith</code></em> :</span></p></td>
 
714
<td>dithering mode</td>
 
715
</tr>
 
716
<tr>
 
717
<td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
 
718
<td>RGB image data</td>
 
719
</tr>
 
720
<tr>
 
721
<td><p><span class="term"><em class="parameter"><code>rowstride</code></em> :</span></p></td>
 
722
<td>rowstride of RGB image data</td>
 
723
</tr>
 
724
<tr>
 
725
<td><p><span class="term"><em class="parameter"><code>xdith</code></em> :</span></p></td>
 
726
<td>X dither offset</td>
 
727
</tr>
 
728
<tr>
 
729
<td><p><span class="term"><em class="parameter"><code>ydith</code></em> :</span></p></td>
 
730
<td>Y dither offset</td>
 
731
</tr>
 
732
</tbody>
 
733
</table></div>
 
734
</div>
 
735
<hr>
 
736
<div class="refsect2">
 
737
<a name="GdkRgbDither"></a><h3>enum GdkRgbDither</h3>
 
738
<pre class="programlisting">typedef enum {
 
739
  GDK_RGB_DITHER_NONE,
 
740
  GDK_RGB_DITHER_NORMAL,
 
741
  GDK_RGB_DITHER_MAX
 
742
} GdkRgbDither;
 
743
</pre>
 
744
<p>
 
745
Selects whether or not GdkRGB applies dithering
 
746
to the image on display.
 
747
</p>
 
748
<p>
 
749
Since GdkRGB currently only handles images with 8 bits per component,
 
750
dithering on 24 bit per pixel displays is a moot point.
 
751
</p>
 
752
<div class="variablelist"><table border="0" class="variablelist">
 
753
<colgroup>
 
754
<col align="left" valign="top">
 
755
<col>
 
756
</colgroup>
 
757
<tbody>
 
758
<tr>
 
759
<td><p><a name="GDK-RGB-DITHER-NONE:CAPS"></a><span class="term"><code class="literal">GDK_RGB_DITHER_NONE</code></span></p></td>
 
760
<td>Never use dithering.
 
761
</td>
 
762
</tr>
 
763
<tr>
 
764
<td><p><a name="GDK-RGB-DITHER-NORMAL:CAPS"></a><span class="term"><code class="literal">GDK_RGB_DITHER_NORMAL</code></span></p></td>
 
765
<td>Use dithering in 8 bits per pixel (and below)
 
766
only.
 
767
</td>
 
768
</tr>
 
769
<tr>
 
770
<td><p><a name="GDK-RGB-DITHER-MAX:CAPS"></a><span class="term"><code class="literal">GDK_RGB_DITHER_MAX</code></span></p></td>
 
771
<td>Use dithering in 16 bits per pixel and below.
 
772
</td>
 
773
</tr>
 
774
</tbody>
 
775
</table></div>
 
776
</div>
 
777
<hr>
 
778
<div class="refsect2">
 
779
<a name="gdk-rgb-cmap-new"></a><h3>gdk_rgb_cmap_new ()</h3>
 
780
<pre class="programlisting"><a class="link" href="gdk2-GdkRGB.html#GdkRgbCmap" title="struct GdkRgbCmap"><span class="returnvalue">GdkRgbCmap</span></a> *        gdk_rgb_cmap_new                    (<em class="parameter"><code><span class="type">guint32</span> *colors</code></em>,
 
781
                                                         <em class="parameter"><code><span class="type">gint</span> n_colors</code></em>);</pre>
 
782
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
783
<h3 class="title">Warning</h3>
 
784
<p><code class="literal">gdk_rgb_cmap_new</code> is deprecated and should not be used in newly-written code.</p>
 
785
</div>
 
786
<p>
 
787
Creates a new <a class="link" href="gdk2-GdkRGB.html#GdkRgbCmap" title="struct GdkRgbCmap"><span class="type">GdkRgbCmap</span></a> structure. The cmap maps color indexes to
 
788
RGB colors. If <em class="parameter"><code>n_colors</code></em> is less than 256, then images containing
 
789
color values greater than or equal to <em class="parameter"><code>n_colors</code></em> will produce undefined
 
790
results, including possibly segfaults.
 
791
</p>
 
792
<div class="variablelist"><table border="0" class="variablelist">
 
793
<colgroup>
 
794
<col align="left" valign="top">
 
795
<col>
 
796
</colgroup>
 
797
<tbody>
 
798
<tr>
 
799
<td><p><span class="term"><em class="parameter"><code>colors</code></em> :</span></p></td>
 
800
<td>The colors, represented as 0xRRGGBB integer values.</td>
 
801
</tr>
 
802
<tr>
 
803
<td><p><span class="term"><em class="parameter"><code>n_colors</code></em> :</span></p></td>
 
804
<td>The number of colors in the cmap.</td>
 
805
</tr>
 
806
<tr>
 
807
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
808
<td>The newly created <a class="link" href="gdk2-GdkRGB.html#GdkRgbCmap" title="struct GdkRgbCmap"><span class="type">GdkRgbCmap</span></a>
 
809
</td>
 
810
</tr>
 
811
</tbody>
 
812
</table></div>
 
813
</div>
 
814
<hr>
 
815
<div class="refsect2">
 
816
<a name="gdk-rgb-cmap-free"></a><h3>gdk_rgb_cmap_free ()</h3>
 
817
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_rgb_cmap_free                   (<em class="parameter"><code><a class="link" href="gdk2-GdkRGB.html#GdkRgbCmap" title="struct GdkRgbCmap"><span class="type">GdkRgbCmap</span></a> *cmap</code></em>);</pre>
 
818
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
819
<h3 class="title">Warning</h3>
 
820
<p><code class="literal">gdk_rgb_cmap_free</code> is deprecated and should not be used in newly-written code.</p>
 
821
</div>
 
822
<p>
 
823
Frees the memory associated with a <a class="link" href="gdk2-GdkRGB.html#GdkRgbCmap" title="struct GdkRgbCmap"><span class="type">GdkRgbCmap</span></a> created by <a class="link" href="gdk2-GdkRGB.html#gdk-rgb-cmap-new" title="gdk_rgb_cmap_new ()"><code class="function">gdk_rgb_cmap_new()</code></a>.
 
824
</p>
 
825
<div class="variablelist"><table border="0" class="variablelist">
 
826
<colgroup>
 
827
<col align="left" valign="top">
 
828
<col>
 
829
</colgroup>
 
830
<tbody><tr>
 
831
<td><p><span class="term"><em class="parameter"><code>cmap</code></em> :</span></p></td>
 
832
<td>The <a class="link" href="gdk2-GdkRGB.html#GdkRgbCmap" title="struct GdkRgbCmap"><span class="type">GdkRgbCmap</span></a> to free.</td>
 
833
</tr></tbody>
 
834
</table></div>
 
835
</div>
 
836
<hr>
 
837
<div class="refsect2">
 
838
<a name="GdkRgbCmap"></a><h3>struct GdkRgbCmap</h3>
 
839
<pre class="programlisting">struct GdkRgbCmap {
 
840
  guint32 colors[256];
 
841
  gint n_colors;
 
842
};
 
843
</pre>
 
844
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
845
<h3 class="title">Warning</h3>
 
846
<p><code class="literal">GdkRgbCmap</code> is deprecated and should not be used in newly-written code.</p>
 
847
</div>
 
848
<p>
 
849
A private data structure which maps color indices to actual RGB
 
850
colors. This is used only for <a class="link" href="gdk2-GdkRGB.html#gdk-draw-indexed-image" title="gdk_draw_indexed_image ()"><code class="function">gdk_draw_indexed_image()</code></a>.
 
851
</p>
 
852
<div class="variablelist"><table border="0" class="variablelist">
 
853
<colgroup>
 
854
<col align="left" valign="top">
 
855
<col>
 
856
</colgroup>
 
857
<tbody>
 
858
<tr>
 
859
<td><p><span class="term"><span class="type">guint32</span> <em class="structfield"><code><a name="GdkRgbCmap.colors"></a>colors</code></em>[256];</span></p></td>
 
860
<td>The colors, represented as 0xRRGGBB integer values.</td>
 
861
</tr>
 
862
<tr>
 
863
<td><p><span class="term"><span class="type">gint</span> <em class="structfield"><code><a name="GdkRgbCmap.n-colors"></a>n_colors</code></em>;</span></p></td>
 
864
<td>The number of colors in the cmap.</td>
 
865
</tr>
 
866
</tbody>
 
867
</table></div>
 
868
</div>
 
869
<hr>
 
870
<div class="refsect2">
 
871
<a name="gdk-rgb-gc-set-foreground"></a><h3>gdk_rgb_gc_set_foreground ()</h3>
 
872
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_rgb_gc_set_foreground           (<em class="parameter"><code><a class="link" href="gdk2-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> *gc</code></em>,
 
873
                                                         <em class="parameter"><code><span class="type">guint32</span> rgb</code></em>);</pre>
 
874
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
875
<h3 class="title">Warning</h3>
 
876
<p><code class="literal">gdk_rgb_gc_set_foreground</code> is deprecated and should not be used in newly-written code.</p>
 
877
</div>
 
878
<p>
 
879
Sets the foreground color in <em class="parameter"><code>gc</code></em> to the specified color (or the
 
880
closest approximation, in the case of limited visuals).
 
881
</p>
 
882
<div class="variablelist"><table border="0" class="variablelist">
 
883
<colgroup>
 
884
<col align="left" valign="top">
 
885
<col>
 
886
</colgroup>
 
887
<tbody>
 
888
<tr>
 
889
<td><p><span class="term"><em class="parameter"><code>gc</code></em> :</span></p></td>
 
890
<td>The <a class="link" href="gdk2-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> to modify.</td>
 
891
</tr>
 
892
<tr>
 
893
<td><p><span class="term"><em class="parameter"><code>rgb</code></em> :</span></p></td>
 
894
<td>The color, represented as a 0xRRGGBB integer value.</td>
 
895
</tr>
 
896
</tbody>
 
897
</table></div>
 
898
</div>
 
899
<hr>
 
900
<div class="refsect2">
 
901
<a name="gdk-rgb-gc-set-background"></a><h3>gdk_rgb_gc_set_background ()</h3>
 
902
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_rgb_gc_set_background           (<em class="parameter"><code><a class="link" href="gdk2-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> *gc</code></em>,
 
903
                                                         <em class="parameter"><code><span class="type">guint32</span> rgb</code></em>);</pre>
 
904
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
905
<h3 class="title">Warning</h3>
 
906
<p><code class="literal">gdk_rgb_gc_set_background</code> is deprecated and should not be used in newly-written code.</p>
 
907
</div>
 
908
<p>
 
909
Sets the background color in <em class="parameter"><code>gc</code></em> to the specified color (or the
 
910
closest approximation, in the case of limited visuals).
 
911
</p>
 
912
<div class="variablelist"><table border="0" class="variablelist">
 
913
<colgroup>
 
914
<col align="left" valign="top">
 
915
<col>
 
916
</colgroup>
 
917
<tbody>
 
918
<tr>
 
919
<td><p><span class="term"><em class="parameter"><code>gc</code></em> :</span></p></td>
 
920
<td>The <a class="link" href="gdk2-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> to modify.</td>
 
921
</tr>
 
922
<tr>
 
923
<td><p><span class="term"><em class="parameter"><code>rgb</code></em> :</span></p></td>
 
924
<td>The color, represented as a 0xRRGGBB integer value.</td>
 
925
</tr>
 
926
</tbody>
 
927
</table></div>
 
928
</div>
 
929
<hr>
 
930
<div class="refsect2">
 
931
<a name="gdk-rgb-xpixel-from-rgb"></a><h3>gdk_rgb_xpixel_from_rgb ()</h3>
 
932
<pre class="programlisting"><span class="returnvalue">gulong</span>              gdk_rgb_xpixel_from_rgb             (<em class="parameter"><code><span class="type">guint32</span> rgb</code></em>);</pre>
 
933
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
934
<h3 class="title">Warning</h3>
 
935
<p><code class="literal">gdk_rgb_xpixel_from_rgb</code> is deprecated and should not be used in newly-written code.</p>
 
936
</div>
 
937
<p>
 
938
Finds the X pixel closest in color to the <em class="parameter"><code>rgb</code></em> color specified. This
 
939
value may be used to set the <em class="structfield"><code>pixel</code></em> field of
 
940
a <a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> struct.
 
941
</p>
 
942
<div class="variablelist"><table border="0" class="variablelist">
 
943
<colgroup>
 
944
<col align="left" valign="top">
 
945
<col>
 
946
</colgroup>
 
947
<tbody>
 
948
<tr>
 
949
<td><p><span class="term"><em class="parameter"><code>rgb</code></em> :</span></p></td>
 
950
<td>The color, represented as a 0xRRGGBB integer value.</td>
 
951
</tr>
 
952
<tr>
 
953
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
954
<td>The X pixel value.</td>
 
955
</tr>
 
956
</tbody>
 
957
</table></div>
 
958
</div>
 
959
<hr>
 
960
<div class="refsect2">
 
961
<a name="gdk-rgb-find-color"></a><h3>gdk_rgb_find_color ()</h3>
 
962
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_rgb_find_color                  (<em class="parameter"><code><a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a> *colormap</code></em>,
 
963
                                                         <em class="parameter"><code><a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *color</code></em>);</pre>
 
964
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
965
<h3 class="title">Warning</h3>
 
966
<p><code class="literal">gdk_rgb_find_color</code> has been deprecated since version 2.22 and should not be used in newly-written code. Cairo handles colors automatically.</p>
 
967
</div>
 
968
<p>
 
969
<em class="parameter"><code>colormap</code></em> should be the colormap for the graphics context and
 
970
drawable you're using to draw. If you're drawing to a <a href="http://developer.gnome.org/gtk2/GtkWidget.html"><span class="type">GtkWidget</span></a>,
 
971
call <code class="function">gtk_widget_get_colormap()</code>.
 
972
</p>
 
973
<p>
 
974
<em class="parameter"><code>color</code></em> should have its <code class="literal">red</code>, <code class="literal">green</code>, and <code class="literal">blue</code> fields initialized;
 
975
<a class="link" href="gdk2-GdkRGB.html#gdk-rgb-find-color" title="gdk_rgb_find_color ()"><code class="function">gdk_rgb_find_color()</code></a> will fill in the <code class="literal">pixel</code> field with the best
 
976
matching pixel from a color cube. The color is then ready to be
 
977
used for drawing, e.g. you can call <a class="link" href="gdk2-Graphics-Contexts.html#gdk-gc-set-foreground" title="gdk_gc_set_foreground ()"><code class="function">gdk_gc_set_foreground()</code></a> which
 
978
expects <code class="literal">pixel</code> to be initialized.
 
979
</p>
 
980
<p>
 
981
In many cases, you can avoid this whole issue by calling
 
982
<a class="link" href="gdk2-Graphics-Contexts.html#gdk-gc-set-rgb-fg-color" title="gdk_gc_set_rgb_fg_color ()"><code class="function">gdk_gc_set_rgb_fg_color()</code></a> or <a class="link" href="gdk2-Graphics-Contexts.html#gdk-gc-set-rgb-bg-color" title="gdk_gc_set_rgb_bg_color ()"><code class="function">gdk_gc_set_rgb_bg_color()</code></a>, which
 
983
do not expect <code class="literal">pixel</code> to be initialized in advance. If you use those
 
984
functions, there's no need for <a class="link" href="gdk2-GdkRGB.html#gdk-rgb-find-color" title="gdk_rgb_find_color ()"><code class="function">gdk_rgb_find_color()</code></a>.
 
985
</p>
 
986
<div class="variablelist"><table border="0" class="variablelist">
 
987
<colgroup>
 
988
<col align="left" valign="top">
 
989
<col>
 
990
</colgroup>
 
991
<tbody>
 
992
<tr>
 
993
<td><p><span class="term"><em class="parameter"><code>colormap</code></em> :</span></p></td>
 
994
<td>a <a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a>
 
995
</td>
 
996
</tr>
 
997
<tr>
 
998
<td><p><span class="term"><em class="parameter"><code>color</code></em> :</span></p></td>
 
999
<td>a <a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a>
 
1000
</td>
 
1001
</tr>
 
1002
</tbody>
 
1003
</table></div>
 
1004
</div>
 
1005
<hr>
 
1006
<div class="refsect2">
 
1007
<a name="gdk-rgb-set-install"></a><h3>gdk_rgb_set_install ()</h3>
 
1008
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_rgb_set_install                 (<em class="parameter"><code><span class="type">gboolean</span> install</code></em>);</pre>
 
1009
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1010
<h3 class="title">Warning</h3>
 
1011
<p><code class="literal">gdk_rgb_set_install</code> is deprecated and should not be used in newly-written code.</p>
 
1012
</div>
 
1013
<p>
 
1014
If <em class="parameter"><code>install</code></em> is <code class="literal">TRUE</code>, directs GdkRGB to always install a new "private"
 
1015
colormap rather than trying to find a best fit with the colors already
 
1016
allocated. Ordinarily, GdkRGB will install a colormap only if a
 
1017
sufficient cube cannot be allocated.
 
1018
</p>
 
1019
<p>
 
1020
A private colormap has more colors, leading to better quality display,
 
1021
but also leads to the dreaded "colormap flashing" effect.
 
1022
</p>
 
1023
<div class="variablelist"><table border="0" class="variablelist">
 
1024
<colgroup>
 
1025
<col align="left" valign="top">
 
1026
<col>
 
1027
</colgroup>
 
1028
<tbody><tr>
 
1029
<td><p><span class="term"><em class="parameter"><code>install</code></em> :</span></p></td>
 
1030
<td>
 
1031
<code class="literal">TRUE</code> to set install mode.</td>
 
1032
</tr></tbody>
 
1033
</table></div>
 
1034
</div>
 
1035
<hr>
 
1036
<div class="refsect2">
 
1037
<a name="gdk-rgb-set-min-colors"></a><h3>gdk_rgb_set_min_colors ()</h3>
 
1038
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_rgb_set_min_colors              (<em class="parameter"><code><span class="type">gint</span> min_colors</code></em>);</pre>
 
1039
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1040
<h3 class="title">Warning</h3>
 
1041
<p><code class="literal">gdk_rgb_set_min_colors</code> is deprecated and should not be used in newly-written code.</p>
 
1042
</div>
 
1043
<p>
 
1044
Sets the minimum number of colors for the color cube. Generally,
 
1045
GdkRGB tries to allocate the largest color cube it can. If it can't
 
1046
allocate a color cube at least as large as <em class="parameter"><code>min_colors</code></em>, it installs a
 
1047
private colormap.
 
1048
</p>
 
1049
<div class="variablelist"><table border="0" class="variablelist">
 
1050
<colgroup>
 
1051
<col align="left" valign="top">
 
1052
<col>
 
1053
</colgroup>
 
1054
<tbody><tr>
 
1055
<td><p><span class="term"><em class="parameter"><code>min_colors</code></em> :</span></p></td>
 
1056
<td>The minimum number of colors accepted.</td>
 
1057
</tr></tbody>
 
1058
</table></div>
 
1059
</div>
 
1060
<hr>
 
1061
<div class="refsect2">
 
1062
<a name="gdk-rgb-get-visual"></a><h3>gdk_rgb_get_visual ()</h3>
 
1063
<pre class="programlisting"><a class="link" href="gdk2-Visuals.html#GdkVisual" title="GdkVisual"><span class="returnvalue">GdkVisual</span></a> *         gdk_rgb_get_visual                  (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
 
1064
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1065
<h3 class="title">Warning</h3>
 
1066
<p><code class="literal">gdk_rgb_get_visual</code> has been deprecated since version 2.22 and should not be used in newly-written code. Use gdk_visual_get_system_visual (<a class="link" href="GdkScreen.html#gdk-screen-get-default" title="gdk_screen_get_default ()"><code class="function">gdk_screen_get_default()</code></a>) instead.</p>
 
1067
</div>
 
1068
<p>
 
1069
Gets a "preferred visual" chosen by GdkRGB for rendering image data
 
1070
on the default screen. In previous versions of GDK, this was the
 
1071
only visual GdkRGB could use for rendering. In current versions,
 
1072
it's simply the visual GdkRGB would have chosen as the optimal one
 
1073
in those previous versions. GdkRGB can now render to drawables with
 
1074
any visual.
 
1075
</p>
 
1076
<div class="variablelist"><table border="0" class="variablelist">
 
1077
<colgroup>
 
1078
<col align="left" valign="top">
 
1079
<col>
 
1080
</colgroup>
 
1081
<tbody><tr>
 
1082
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
1083
<td>The <a class="link" href="gdk2-Visuals.html#GdkVisual" title="GdkVisual"><span class="type">GdkVisual</span></a> chosen by GdkRGB. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
 
1084
</td>
 
1085
</tr></tbody>
 
1086
</table></div>
 
1087
</div>
 
1088
<hr>
 
1089
<div class="refsect2">
 
1090
<a name="gdk-rgb-get-colormap"></a><h3>gdk_rgb_get_colormap ()</h3>
 
1091
<pre class="programlisting"><a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="returnvalue">GdkColormap</span></a> *       gdk_rgb_get_colormap                (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
 
1092
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1093
<h3 class="title">Warning</h3>
 
1094
<p><code class="literal">gdk_rgb_get_colormap</code> has been deprecated since version 2.22 and should not be used in newly-written code. Use gdk_screen_get_system_colormap (<a class="link" href="GdkScreen.html#gdk-screen-get-default" title="gdk_screen_get_default ()"><code class="function">gdk_screen_get_default()</code></a>) instead.</p>
 
1095
</div>
 
1096
<p>
 
1097
Get the preferred colormap for rendering image data.  Not a
 
1098
very useful function; historically, GDK could only render RGB image
 
1099
data to one colormap and visual, but in the current version it can
 
1100
render to any colormap and visual. So there's no need to call this
 
1101
function.
 
1102
</p>
 
1103
<div class="variablelist"><table border="0" class="variablelist">
 
1104
<colgroup>
 
1105
<col align="left" valign="top">
 
1106
<col>
 
1107
</colgroup>
 
1108
<tbody><tr>
 
1109
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
1110
<td>the preferred colormap. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
 
1111
</td>
 
1112
</tr></tbody>
 
1113
</table></div>
 
1114
</div>
 
1115
<hr>
 
1116
<div class="refsect2">
 
1117
<a name="gdk-rgb-get-cmap"></a><h3>gdk_rgb_get_cmap</h3>
 
1118
<pre class="programlisting">#define gdk_rgb_get_cmap               gdk_rgb_get_colormap
 
1119
</pre>
 
1120
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1121
<h3 class="title">Warning</h3>
 
1122
<p><code class="literal">gdk_rgb_get_cmap</code> is deprecated and should not be used in newly-written code.</p>
 
1123
</div>
 
1124
<p>
 
1125
Gets the colormap set by GdkRGB. This colormap and the corresponding
 
1126
visual should be used when creating windows that will be drawn in by GdkRGB.
 
1127
</p>
 
1128
<div class="variablelist"><table border="0" class="variablelist">
 
1129
<colgroup>
 
1130
<col align="left" valign="top">
 
1131
<col>
 
1132
</colgroup>
 
1133
<tbody><tr>
 
1134
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
1135
<td>The <a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a> set by GdkRGB.</td>
 
1136
</tr></tbody>
 
1137
</table></div>
 
1138
</div>
 
1139
<hr>
 
1140
<div class="refsect2">
 
1141
<a name="gdk-rgb-ditherable"></a><h3>gdk_rgb_ditherable ()</h3>
 
1142
<pre class="programlisting"><span class="returnvalue">gboolean</span>            gdk_rgb_ditherable                  (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
 
1143
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1144
<h3 class="title">Warning</h3>
 
1145
<p><code class="literal">gdk_rgb_ditherable</code> is deprecated and should not be used in newly-written code.</p>
 
1146
</div>
 
1147
<p>
 
1148
Determines whether the preferred visual is ditherable. This function may be
 
1149
useful for presenting a user interface choice to the user about which
 
1150
dither mode is desired; if the display is not ditherable, it may make
 
1151
sense to gray out or hide the corresponding UI widget.
 
1152
</p>
 
1153
<div class="variablelist"><table border="0" class="variablelist">
 
1154
<colgroup>
 
1155
<col align="left" valign="top">
 
1156
<col>
 
1157
</colgroup>
 
1158
<tbody><tr>
 
1159
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
1160
<td>
 
1161
<code class="literal">TRUE</code> if the preferred visual is ditherable.</td>
 
1162
</tr></tbody>
 
1163
</table></div>
 
1164
</div>
 
1165
<hr>
 
1166
<div class="refsect2">
 
1167
<a name="gdk-rgb-colormap-ditherable"></a><h3>gdk_rgb_colormap_ditherable ()</h3>
 
1168
<pre class="programlisting"><span class="returnvalue">gboolean</span>            gdk_rgb_colormap_ditherable         (<em class="parameter"><code><a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a> *cmap</code></em>);</pre>
 
1169
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1170
<h3 class="title">Warning</h3>
 
1171
<p><code class="literal">gdk_rgb_colormap_ditherable</code> is deprecated and should not be used in newly-written code.</p>
 
1172
</div>
 
1173
<p>
 
1174
Determines whether the visual associated with <em class="parameter"><code>cmap</code></em> is ditherable. This
 
1175
function may be useful for presenting a user interface choice to the user
 
1176
about which dither mode is desired; if the display is not ditherable, it may
 
1177
make sense to gray out or hide the corresponding UI widget.
 
1178
</p>
 
1179
<div class="variablelist"><table border="0" class="variablelist">
 
1180
<colgroup>
 
1181
<col align="left" valign="top">
 
1182
<col>
 
1183
</colgroup>
 
1184
<tbody>
 
1185
<tr>
 
1186
<td><p><span class="term"><em class="parameter"><code>cmap</code></em> :</span></p></td>
 
1187
<td>a <a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a>
 
1188
</td>
 
1189
</tr>
 
1190
<tr>
 
1191
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
1192
<td>
 
1193
<code class="literal">TRUE</code> if the visual associated with <em class="parameter"><code>cmap</code></em> is ditherable.</td>
 
1194
</tr>
 
1195
</tbody>
 
1196
</table></div>
 
1197
</div>
 
1198
<hr>
 
1199
<div class="refsect2">
 
1200
<a name="gdk-rgb-set-verbose"></a><h3>gdk_rgb_set_verbose ()</h3>
 
1201
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_rgb_set_verbose                 (<em class="parameter"><code><span class="type">gboolean</span> verbose</code></em>);</pre>
 
1202
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1203
<h3 class="title">Warning</h3>
 
1204
<p><code class="literal">gdk_rgb_set_verbose</code> is deprecated and should not be used in newly-written code.</p>
 
1205
</div>
 
1206
<p>
 
1207
Sets the "verbose" flag. This is generally only useful for debugging.
 
1208
</p>
 
1209
<div class="variablelist"><table border="0" class="variablelist">
 
1210
<colgroup>
 
1211
<col align="left" valign="top">
 
1212
<col>
 
1213
</colgroup>
 
1214
<tbody><tr>
 
1215
<td><p><span class="term"><em class="parameter"><code>verbose</code></em> :</span></p></td>
 
1216
<td>
 
1217
<code class="literal">TRUE</code> if verbose messages are desired.</td>
 
1218
</tr></tbody>
 
1219
</table></div>
 
1220
</div>
 
1221
</div>
 
1222
<div class="refsect1">
 
1223
<a name="gdk2-GdkRGB.see-also"></a><h2>See Also</h2>
 
1224
<p>
 
1225
</p>
 
1226
<div class="variablelist"><table border="0" class="variablelist">
 
1227
<colgroup>
 
1228
<col align="left" valign="top">
 
1229
<col>
 
1230
</colgroup>
 
1231
<tbody>
 
1232
<tr>
 
1233
<td><p><span class="term"><a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a></span></p></td>
 
1234
<td><p>The underlying GDK mechanism for allocating
 
1235
colors.</p></td>
 
1236
</tr>
 
1237
<tr>
 
1238
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> and <a class="link" href="gdk2-Drawing-Primitives.html#gdk-draw-pixbuf" title="gdk_draw_pixbuf ()"><code class="function">gdk_draw_pixbuf()</code></a></span></p></td>
 
1239
<td><p>Higher-level image handling.</p></td>
 
1240
</tr>
 
1241
</tbody>
 
1242
</table></div>
 
1243
<p>
 
1244
</p>
 
1245
</div>
 
1246
</div>
 
1247
<div class="footer">
 
1248
<hr>
 
1249
          Generated by GTK-Doc V1.18</div>
 
1250
</body>
 
1251
</html>
 
 
b'\\ No newline at end of file'