1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
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">
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">
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>
23
<tr><td colspan="5" class="shortcuts">
24
<a href="#gdk2-GdkRGB.synopsis" class="shortcut">Top</a>
26
<a href="#gdk2-GdkRGB.description" class="shortcut">Description</a>
29
<div class="refentry">
30
<a name="gdk2-GdkRGB"></a><div class="titlepage"></div>
31
<div class="refnamediv"><table width="100%"><tr>
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>
36
<td valign="top" align="right"></td>
38
<div class="refsynopsisdiv">
39
<a name="gdk2-GdkRGB.synopsis"></a><h2>Synopsis</h2>
40
<pre class="synopsis">
41
#include <gdk/gdk.h>
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>);
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>;
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>;
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>);
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>);
129
<div class="refsect1">
130
<a name="gdk2-GdkRGB.description"></a><h2>Description</h2>
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.
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.
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.
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">
169
<td class="listing_lines" align="right"><pre>1
214
<td class="listing_code"><pre class="programlisting"><span class="preproc">#include</span><span class="normal"> </span><span class="string"><gtk/gtk.h></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">(&</span><span class="normal">argc</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</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"><</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"><</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">-></span><span class="normal">window</span><span class="symbol">,</span><span class="normal"> widget</span><span class="symbol">-></span><span class="normal">style</span><span class="symbol">-></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>
265
<br class="example-break">
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>
277
This function no longer does anything at all. It's completely useless
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>
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.
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.
310
In general, for 0 <= i < <em class="parameter"><code>width</code></em> and 0 <= j < 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].
315
<div class="variablelist"><table border="0" class="variablelist">
317
<col align="left" valign="top">
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
381
Draws an RGB image in the drawable, with an adjustment for dither alignment.
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.
391
Setting the dither alignment correctly allows updating of small parts
392
of the screen while avoiding visible "seams" between the different
395
<div class="variablelist"><table border="0" class="variablelist">
397
<col align="left" valign="top">
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>
406
<td><p><span class="term"><em class="parameter"><code>gc</code></em> :</span></p></td>
407
<td>The graphics context.</td>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
470
<div class="variablelist"><table border="0" class="variablelist">
472
<col align="left" valign="top">
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>
481
<td><p><span class="term"><em class="parameter"><code>gc</code></em> :</span></p></td>
482
<td>The graphics context.</td>
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>
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>
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>
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>
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>
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>
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>
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>
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>
537
Draws a grayscale image in the drawable.
539
<div class="variablelist"><table border="0" class="variablelist">
541
<col align="left" valign="top">
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>
550
<td><p><span class="term"><em class="parameter"><code>gc</code></em> :</span></p></td>
551
<td>The graphics context.</td>
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>
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>
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>
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>
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>
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>
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>
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>
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.
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
612
<div class="variablelist"><table border="0" class="variablelist">
614
<col align="left" valign="top">
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>
623
<td><p><span class="term"><em class="parameter"><code>gc</code></em> :</span></p></td>
624
<td>The graphics context.</td>
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>
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>
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>
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>
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>
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>
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>
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>
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.
680
<div class="variablelist"><table border="0" class="variablelist">
682
<col align="left" valign="top">
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>
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>
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>
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>
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>
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>
713
<td><p><span class="term"><em class="parameter"><code>dith</code></em> :</span></p></td>
714
<td>dithering mode</td>
717
<td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
718
<td>RGB image data</td>
721
<td><p><span class="term"><em class="parameter"><code>rowstride</code></em> :</span></p></td>
722
<td>rowstride of RGB image data</td>
725
<td><p><span class="term"><em class="parameter"><code>xdith</code></em> :</span></p></td>
726
<td>X dither offset</td>
729
<td><p><span class="term"><em class="parameter"><code>ydith</code></em> :</span></p></td>
730
<td>Y dither offset</td>
736
<div class="refsect2">
737
<a name="GdkRgbDither"></a><h3>enum GdkRgbDither</h3>
738
<pre class="programlisting">typedef enum {
740
GDK_RGB_DITHER_NORMAL,
745
Selects whether or not GdkRGB applies dithering
746
to the image on display.
749
Since GdkRGB currently only handles images with 8 bits per component,
750
dithering on 24 bit per pixel displays is a moot point.
752
<div class="variablelist"><table border="0" class="variablelist">
754
<col align="left" valign="top">
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.
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)
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.
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>
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.
792
<div class="variablelist"><table border="0" class="variablelist">
794
<col align="left" valign="top">
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>
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>
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>
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>
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>.
825
<div class="variablelist"><table border="0" class="variablelist">
827
<col align="left" valign="top">
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>
837
<div class="refsect2">
838
<a name="GdkRgbCmap"></a><h3>struct GdkRgbCmap</h3>
839
<pre class="programlisting">struct GdkRgbCmap {
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>
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>.
852
<div class="variablelist"><table border="0" class="variablelist">
854
<col align="left" valign="top">
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>
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>
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>
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).
882
<div class="variablelist"><table border="0" class="variablelist">
884
<col align="left" valign="top">
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>
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>
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>
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).
912
<div class="variablelist"><table border="0" class="variablelist">
914
<col align="left" valign="top">
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>
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>
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>
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.
942
<div class="variablelist"><table border="0" class="variablelist">
944
<col align="left" valign="top">
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>
953
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
954
<td>The X pixel value.</td>
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>
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>.
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.
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>.
986
<div class="variablelist"><table border="0" class="variablelist">
988
<col align="left" valign="top">
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>
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>
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>
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.
1020
A private colormap has more colors, leading to better quality display,
1021
but also leads to the dreaded "colormap flashing" effect.
1023
<div class="variablelist"><table border="0" class="variablelist">
1025
<col align="left" valign="top">
1029
<td><p><span class="term"><em class="parameter"><code>install</code></em> :</span></p></td>
1031
<code class="literal">TRUE</code> to set install mode.</td>
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>
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
1049
<div class="variablelist"><table border="0" class="variablelist">
1051
<col align="left" valign="top">
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>
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>
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
1076
<div class="variablelist"><table border="0" class="variablelist">
1078
<col align="left" valign="top">
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>
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>
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
1103
<div class="variablelist"><table border="0" class="variablelist">
1105
<col align="left" valign="top">
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>
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
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>
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.
1128
<div class="variablelist"><table border="0" class="variablelist">
1130
<col align="left" valign="top">
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>
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>
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.
1153
<div class="variablelist"><table border="0" class="variablelist">
1155
<col align="left" valign="top">
1159
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1161
<code class="literal">TRUE</code> if the preferred visual is ditherable.</td>
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>
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.
1179
<div class="variablelist"><table border="0" class="variablelist">
1181
<col align="left" valign="top">
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>
1191
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1193
<code class="literal">TRUE</code> if the visual associated with <em class="parameter"><code>cmap</code></em> is ditherable.</td>
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>
1207
Sets the "verbose" flag. This is generally only useful for debugging.
1209
<div class="variablelist"><table border="0" class="variablelist">
1211
<col align="left" valign="top">
1215
<td><p><span class="term"><em class="parameter"><code>verbose</code></em> :</span></p></td>
1217
<code class="literal">TRUE</code> if verbose messages are desired.</td>
1222
<div class="refsect1">
1223
<a name="gdk2-GdkRGB.see-also"></a><h2>See Also</h2>
1226
<div class="variablelist"><table border="0" class="variablelist">
1228
<col align="left" valign="top">
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
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>
1247
<div class="footer">
1249
Generated by GTK-Doc V1.18</div>
b'\\ No newline at end of file'