~ubuntu-branches/ubuntu/vivid/gdk-pixbuf/vivid

« back to all changes in this revision

Viewing changes to doc/sgml/gdk-pixbuf-xlib-rgb.sgml

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2004-10-06 22:10:04 UTC
  • Revision ID: james.westby@ubuntu.com-20041006221004-rma9deknj8qctu67
Tags: upstream-0.22.0
ImportĀ upstreamĀ versionĀ 0.22.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<refentry id="gdk-pixbuf-gdk-pixbuf-xlib-rgb">
 
2
<refmeta>
 
3
<refentrytitle>XlibRGB</refentrytitle>
 
4
<manvolnum>3</manvolnum>
 
5
<refmiscinfo>GDK-PIXBUF Library</refmiscinfo>
 
6
</refmeta>
 
7
 
 
8
<refnamediv>
 
9
<refname>XlibRGB</refname><refpurpose>Functions for rendering RGB buffers to X drawables.</refpurpose>
 
10
</refnamediv>
 
11
 
 
12
<refsynopsisdiv><title>Synopsis</title>
 
13
<synopsis>
 
14
 
 
15
#include &lt;gdk-pixbuf/gdk-pixbuf.h&gt;
 
16
 
 
17
 
 
18
struct      <link linkend="XlibRgbCmap">XlibRgbCmap</link>;
 
19
enum        <link linkend="XlibRgbDither">XlibRgbDither</link>;
 
20
void        <link linkend="xlib-rgb-init">xlib_rgb_init</link>                   (<link linkend="Display">Display</link> *display,
 
21
                                             <link linkend="Screen">Screen</link> *screen);
 
22
void        <link linkend="xlib-rgb-init-with-depth">xlib_rgb_init_with_depth</link>        (<link linkend="Display">Display</link> *display,
 
23
                                             <link linkend="Screen">Screen</link> *screen,
 
24
                                             int prefDepth);
 
25
void        <link linkend="xlib-rgb-gc-set-foreground">xlib_rgb_gc_set_foreground</link>      (<link linkend="GC-CAPS">GC</link> gc,
 
26
                                             <link linkend="guint32">guint32</link> rgb);
 
27
void        <link linkend="xlib-rgb-gc-set-background">xlib_rgb_gc_set_background</link>      (<link linkend="GC-CAPS">GC</link> gc,
 
28
                                             <link linkend="guint32">guint32</link> rgb);
 
29
void        <link linkend="xlib-draw-rgb-image">xlib_draw_rgb_image</link>             (<link linkend="Drawable">Drawable</link> drawable,
 
30
                                             <link linkend="GC-CAPS">GC</link> gc,
 
31
                                             int x,
 
32
                                             int y,
 
33
                                             int width,
 
34
                                             int height,
 
35
                                             <link linkend="XlibRgbDither">XlibRgbDither</link> dith,
 
36
                                             unsigned char *rgb_buf,
 
37
                                             int rowstride);
 
38
void        <link linkend="xlib-draw-rgb-image-dithalign">xlib_draw_rgb_image_dithalign</link>   (<link linkend="Drawable">Drawable</link> drawable,
 
39
                                             <link linkend="GC-CAPS">GC</link> gc,
 
40
                                             int x,
 
41
                                             int y,
 
42
                                             int width,
 
43
                                             int height,
 
44
                                             <link linkend="XlibRgbDither">XlibRgbDither</link> dith,
 
45
                                             unsigned char *rgb_buf,
 
46
                                             int rowstride,
 
47
                                             int xdith,
 
48
                                             int ydith);
 
49
void        <link linkend="xlib-draw-rgb-32-image">xlib_draw_rgb_32_image</link>          (<link linkend="Drawable">Drawable</link> drawable,
 
50
                                             <link linkend="GC-CAPS">GC</link> gc,
 
51
                                             int x,
 
52
                                             int y,
 
53
                                             int width,
 
54
                                             int height,
 
55
                                             <link linkend="XlibRgbDither">XlibRgbDither</link> dith,
 
56
                                             unsigned char *buf,
 
57
                                             int rowstride);
 
58
void        <link linkend="xlib-draw-gray-image">xlib_draw_gray_image</link>            (<link linkend="Drawable">Drawable</link> drawable,
 
59
                                             <link linkend="GC-CAPS">GC</link> gc,
 
60
                                             int x,
 
61
                                             int y,
 
62
                                             int width,
 
63
                                             int height,
 
64
                                             <link linkend="XlibRgbDither">XlibRgbDither</link> dith,
 
65
                                             unsigned char *buf,
 
66
                                             int rowstride);
 
67
<link linkend="XlibRgbCmap">XlibRgbCmap</link>* <link linkend="xlib-rgb-cmap-new">xlib_rgb_cmap_new</link>              (<link linkend="guint32">guint32</link> *colors,
 
68
                                             int n_colors);
 
69
void        <link linkend="xlib-rgb-cmap-free">xlib_rgb_cmap_free</link>              (<link linkend="XlibRgbCmap">XlibRgbCmap</link> *cmap);
 
70
void        <link linkend="xlib-draw-indexed-image">xlib_draw_indexed_image</link>         (<link linkend="Drawable">Drawable</link> drawable,
 
71
                                             <link linkend="GC-CAPS">GC</link> gc,
 
72
                                             int x,
 
73
                                             int y,
 
74
                                             int width,
 
75
                                             int height,
 
76
                                             <link linkend="XlibRgbDither">XlibRgbDither</link> dith,
 
77
                                             unsigned char *buf,
 
78
                                             int rowstride,
 
79
                                             <link linkend="XlibRgbCmap">XlibRgbCmap</link> *cmap);
 
80
<link linkend="Bool">Bool</link>        <link linkend="xlib-rgb-ditherable">xlib_rgb_ditherable</link>             (void);
 
81
void        <link linkend="xlib-rgb-set-verbose">xlib_rgb_set_verbose</link>            (<link linkend="Bool">Bool</link> verbose);
 
82
void        <link linkend="xlib-rgb-set-install">xlib_rgb_set_install</link>            (<link linkend="Bool">Bool</link> install);
 
83
void        <link linkend="xlib-rgb-set-min-colors">xlib_rgb_set_min_colors</link>         (int min_colors);
 
84
<link linkend="Colormap">Colormap</link>    <link linkend="xlib-rgb-get-cmap">xlib_rgb_get_cmap</link>               (void);
 
85
<link linkend="Visual">Visual</link>*     <link linkend="xlib-rgb-get-visual">xlib_rgb_get_visual</link>             (void);
 
86
<link linkend="XVisualInfo">XVisualInfo</link>* <link linkend="xlib-rgb-get-visual-info">xlib_rgb_get_visual_info</link>       (void);
 
87
int         <link linkend="xlib-rgb-get-depth">xlib_rgb_get_depth</link>              (void);
 
88
<link linkend="Display">Display</link>*    <link linkend="xlib-rgb-get-display">xlib_rgb_get_display</link>            (void);
 
89
<link linkend="Screen">Screen</link>*     <link linkend="xlib-rgb-get-screen">xlib_rgb_get_screen</link>             (void);
 
90
</synopsis>
 
91
</refsynopsisdiv>
 
92
 
 
93
 
 
94
 
 
95
 
 
96
 
 
97
<refsect1>
 
98
<title>Description</title>
 
99
  <para>
 
100
    The XlibRGB set of functions is a port of the GdkRGB library to
 
101
    use plain Xlib and X drawables.  You can use these functions to
 
102
    render RGB buffers into drawables very quickly with high-quality
 
103
    dithering.
 
104
  </para>
 
105
</refsect1>
 
106
 
 
107
<refsect1>
 
108
<title>Details</title>
 
109
<refsect2>
 
110
<title><anchor id="XlibRgbCmap">struct XlibRgbCmap</title>
 
111
<programlisting>struct XlibRgbCmap {
 
112
  unsigned int colors[256];
 
113
  unsigned char lut[256]; /* for 8-bit modes */
 
114
};
 
115
</programlisting>
 
116
  <para>
 
117
    FIXME: Describe this.
 
118
  </para><informaltable pgwide=1 frame="none" role="struct">
 
119
<tgroup cols="2">
 
120
<colspec colwidth="2*">
 
121
<colspec colwidth="8*">
 
122
<tbody>
 
123
<row>
 
124
<entry>unsigned int <structfield>colors</structfield>[256]</entry>
 
125
<entry>FIXME.
 
126
</entry>
 
127
</row>
 
128
<row>
 
129
<entry>unsigned char <structfield>lut</structfield>[256]</entry>
 
130
<entry>FIXME.
 
131
 
 
132
</entry>
 
133
</row>
 
134
</tbody></tgroup></informaltable></refsect2>
 
135
<refsect2>
 
136
<title><anchor id="XlibRgbDither">enum XlibRgbDither</title>
 
137
<programlisting>typedef enum
 
138
{
 
139
  XLIB_RGB_DITHER_NONE,
 
140
  XLIB_RGB_DITHER_NORMAL,
 
141
  XLIB_RGB_DITHER_MAX
 
142
} XlibRgbDither;
 
143
</programlisting>
 
144
  <para>
 
145
    These values are used to specify which dithering method should be
 
146
    used.  <symbol>XLIB_RGB_DITHER_NONE</symbol> will use no dithering
 
147
    and simply map the colors in an RGB buffer to the closest colors
 
148
    that the display can provide.
 
149
    <symbol>XLIB_RGB_DITHER_NORMAL</symbol> will provide dithering
 
150
    only on pseudocolor displays.
 
151
    <symbol>XLIB_RGB_DITHER_MAX</symbol> will provide dithering on
 
152
    pseudocolor and 16-bit truecolor or &ldquo;high color&rdquo;
 
153
    displays.
 
154
  </para><informaltable pgwide=1 frame="none" role="enum">
 
155
<tgroup cols="2">
 
156
<colspec colwidth="2*">
 
157
<colspec colwidth="8*">
 
158
<tbody>
 
159
<row>
 
160
<entry><literal>XLIB_RGB_DITHER_NONE</literal></entry>
 
161
<entry>Specifies no dithering.
 
162
</entry>
 
163
</row>
 
164
<row>
 
165
<entry><literal>XLIB_RGB_DITHER_NORMAL</literal></entry>
 
166
<entry>Specifies dithering only on pseudocolor
 
167
displays.
 
168
</entry>
 
169
</row>
 
170
<row>
 
171
<entry><literal>XLIB_RGB_DITHER_MAX</literal></entry>
 
172
<entry>Specifies dithering on high color displays.
 
173
 
 
174
</entry>
 
175
</row>
 
176
</tbody></tgroup></informaltable></refsect2>
 
177
<refsect2>
 
178
<title><anchor id="xlib-rgb-init">xlib_rgb_init ()</title>
 
179
<programlisting>void        xlib_rgb_init                   (<link linkend="Display">Display</link> *display,
 
180
                                             <link linkend="Screen">Screen</link> *screen);</programlisting>
 
181
<para>
 
182
Initializes the XlibRGB machinery with the default depth.  If you use this
 
183
function XlibRGB will automatically pick the best visual available on your
 
184
display.  This function or <link linkend="xlib-rgb-init-with-depth">xlib_rgb_init_with_depth</link>() must be called before
 
185
using any of the other functions in XlibRGB.</para>
 
186
<para>
 
187
 
 
188
</para><informaltable pgwide=1 frame="none" role="params">
 
189
<tgroup cols="2">
 
190
<colspec colwidth="2*">
 
191
<colspec colwidth="8*">
 
192
<tbody>
 
193
<row><entry align="right"><parameter>display</parameter>&nbsp;:</entry>
 
194
<entry> X Display to use.
 
195
</entry></row>
 
196
<row><entry align="right"><parameter>screen</parameter>&nbsp;:</entry>
 
197
<entry> Screen to use.
 
198
</entry></row>
 
199
</tbody></tgroup></informaltable></refsect2>
 
200
<refsect2>
 
201
<title><anchor id="xlib-rgb-init-with-depth">xlib_rgb_init_with_depth ()</title>
 
202
<programlisting>void        xlib_rgb_init_with_depth        (<link linkend="Display">Display</link> *display,
 
203
                                             <link linkend="Screen">Screen</link> *screen,
 
204
                                             int prefDepth);</programlisting>
 
205
<para>
 
206
Initializes the XlibRGB machinery with a particular depth you specify,
 
207
instead of automatically picking the best depth in the display.  This
 
208
function or <link linkend="xlib-rgb-init">xlib_rgb_init</link>() must be called before using any of the other
 
209
functions in XlibRGB.</para>
 
210
<para>
 
211
 
 
212
</para><informaltable pgwide=1 frame="none" role="params">
 
213
<tgroup cols="2">
 
214
<colspec colwidth="2*">
 
215
<colspec colwidth="8*">
 
216
<tbody>
 
217
<row><entry align="right"><parameter>display</parameter>&nbsp;:</entry>
 
218
<entry> X display to use.
 
219
</entry></row>
 
220
<row><entry align="right"><parameter>screen</parameter>&nbsp;:</entry>
 
221
<entry> Screen to use.
 
222
</entry></row>
 
223
<row><entry align="right"><parameter>prefDepth</parameter>&nbsp;:</entry>
 
224
<entry> Visual depth to use for color substitution tables.  This must
 
225
be one of the supported visual depths in the specified <parameter>display</parameter>.
 
226
</entry></row>
 
227
</tbody></tgroup></informaltable></refsect2>
 
228
<refsect2>
 
229
<title><anchor id="xlib-rgb-gc-set-foreground">xlib_rgb_gc_set_foreground ()</title>
 
230
<programlisting>void        xlib_rgb_gc_set_foreground      (<link linkend="GC-CAPS">GC</link> gc,
 
231
                                             <link linkend="guint32">guint32</link> rgb);</programlisting>
 
232
<para>
 
233
This is a convenience function to set the foreground of a GC from an RGB
 
234
triplet.  It calls <link linkend="xlib-rgb-xpixel-from-rgb">xlib_rgb_xpixel_from_rgb</link>() internally and uses the
 
235
returned pixel value to set the GC's foreground.</para>
 
236
<para>
 
237
 
 
238
</para><informaltable pgwide=1 frame="none" role="params">
 
239
<tgroup cols="2">
 
240
<colspec colwidth="2*">
 
241
<colspec colwidth="8*">
 
242
<tbody>
 
243
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
 
244
<entry> A graphic context.
 
245
</entry></row>
 
246
<row><entry align="right"><parameter>rgb</parameter>&nbsp;:</entry>
 
247
<entry> 32-bit representation of an RGB value, specified as 0x00RRGGBB.
 
248
</entry></row>
 
249
</tbody></tgroup></informaltable></refsect2>
 
250
<refsect2>
 
251
<title><anchor id="xlib-rgb-gc-set-background">xlib_rgb_gc_set_background ()</title>
 
252
<programlisting>void        xlib_rgb_gc_set_background      (<link linkend="GC-CAPS">GC</link> gc,
 
253
                                             <link linkend="guint32">guint32</link> rgb);</programlisting>
 
254
<para>
 
255
This is a convenience function to set the background of a GC from an RGB
 
256
triplet.  It calls <link linkend="xlib-rgb-xpixel-from-rgb">xlib_rgb_xpixel_from_rgb</link>() internally and uses the
 
257
returned pixel value to set the GC's background.</para>
 
258
<para>
 
259
 
 
260
</para><informaltable pgwide=1 frame="none" role="params">
 
261
<tgroup cols="2">
 
262
<colspec colwidth="2*">
 
263
<colspec colwidth="8*">
 
264
<tbody>
 
265
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
 
266
<entry> A graphic context.
 
267
</entry></row>
 
268
<row><entry align="right"><parameter>rgb</parameter>&nbsp;:</entry>
 
269
<entry> 32-bit representation of an RGB value, specified as 0x00RRGGBB.
 
270
</entry></row>
 
271
</tbody></tgroup></informaltable></refsect2>
 
272
<refsect2>
 
273
<title><anchor id="xlib-draw-rgb-image">xlib_draw_rgb_image ()</title>
 
274
<programlisting>void        xlib_draw_rgb_image             (<link linkend="Drawable">Drawable</link> drawable,
 
275
                                             <link linkend="GC-CAPS">GC</link> gc,
 
276
                                             int x,
 
277
                                             int y,
 
278
                                             int width,
 
279
                                             int height,
 
280
                                             <link linkend="XlibRgbDither">XlibRgbDither</link> dith,
 
281
                                             unsigned char *rgb_buf,
 
282
                                             int rowstride);</programlisting>
 
283
<para>
 
284
Renders an RGB buffer to a drawable.  Pixels are specified as RGB triplets
 
285
with 8 bits per channel.  An image will thus look like an RGBRGBRGBRGB
 
286
sequence of 8-bit values.  This function does not let you specify dither
 
287
offsets; applications that need to render partial regions of a buffer to
 
288
build the final image should use <link linkend="xlib-draw-rgb-image-dithalign">xlib_draw_rgb_image_dithalign</link>() instead.</para>
 
289
<para>
 
290
 
 
291
</para><informaltable pgwide=1 frame="none" role="params">
 
292
<tgroup cols="2">
 
293
<colspec colwidth="2*">
 
294
<colspec colwidth="8*">
 
295
<tbody>
 
296
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
 
297
<entry> Destination drawable.
 
298
</entry></row>
 
299
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
 
300
<entry> A graphic context.
 
301
</entry></row>
 
302
<row><entry align="right"><parameter>x</parameter>&nbsp;:</entry>
 
303
<entry> Leftmost coordinate of the destination rectangle.
 
304
</entry></row>
 
305
<row><entry align="right"><parameter>y</parameter>&nbsp;:</entry>
 
306
<entry> Upper coordinate of the destination rectangle.
 
307
</entry></row>
 
308
<row><entry align="right"><parameter>width</parameter>&nbsp;:</entry>
 
309
<entry> Width of the destination rectangle, in pixels.
 
310
</entry></row>
 
311
<row><entry align="right"><parameter>height</parameter>&nbsp;:</entry>
 
312
<entry> Height of the destination rectangle, in pixels.
 
313
</entry></row>
 
314
<row><entry align="right"><parameter>dith</parameter>&nbsp;:</entry>
 
315
<entry> Dithering method to use.
 
316
</entry></row>
 
317
<row><entry align="right"><parameter>rgb_buf</parameter>&nbsp;:</entry>
 
318
<entry> Pointer to the pixel in the RGB buffer that corresponds to the
 
319
upper-left corner of the rectangular region to render.
 
320
</entry></row>
 
321
<row><entry align="right"><parameter>rowstride</parameter>&nbsp;:</entry>
 
322
<entry> Offset between pixel rows in the RGB buffer, in bytes.
 
323
</entry></row>
 
324
</tbody></tgroup></informaltable></refsect2>
 
325
<refsect2>
 
326
<title><anchor id="xlib-draw-rgb-image-dithalign">xlib_draw_rgb_image_dithalign ()</title>
 
327
<programlisting>void        xlib_draw_rgb_image_dithalign   (<link linkend="Drawable">Drawable</link> drawable,
 
328
                                             <link linkend="GC-CAPS">GC</link> gc,
 
329
                                             int x,
 
330
                                             int y,
 
331
                                             int width,
 
332
                                             int height,
 
333
                                             <link linkend="XlibRgbDither">XlibRgbDither</link> dith,
 
334
                                             unsigned char *rgb_buf,
 
335
                                             int rowstride,
 
336
                                             int xdith,
 
337
                                             int ydith);</programlisting>
 
338
<para>
 
339
Renders an RGB buffer to a drawable.  Pixels are specified as RGB triplets
 
340
with 8 bits per channel.  An image will thus look like an RGBRGBRGBRGB
 
341
sequence of 8-bit values.  This function lets you specify a pair of dither
 
342
offsets.  It should be used when you need to render regions of an RGB buffer
 
343
separately to form the final image; the dither offsets let you align the
 
344
dither mask appropriately.</para>
 
345
<para>
 
346
 
 
347
</para><informaltable pgwide=1 frame="none" role="params">
 
348
<tgroup cols="2">
 
349
<colspec colwidth="2*">
 
350
<colspec colwidth="8*">
 
351
<tbody>
 
352
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
 
353
<entry> Destination drawable.
 
354
</entry></row>
 
355
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
 
356
<entry> A graphic context.
 
357
</entry></row>
 
358
<row><entry align="right"><parameter>x</parameter>&nbsp;:</entry>
 
359
<entry> Leftmost coordinate of the destination rectangle.
 
360
</entry></row>
 
361
<row><entry align="right"><parameter>y</parameter>&nbsp;:</entry>
 
362
<entry> Upper coordinate of the destination rectangle.
 
363
</entry></row>
 
364
<row><entry align="right"><parameter>width</parameter>&nbsp;:</entry>
 
365
<entry> Width of the destination rectangle, in pixels.
 
366
</entry></row>
 
367
<row><entry align="right"><parameter>height</parameter>&nbsp;:</entry>
 
368
<entry> Height of the destination rectangle, in pixels.
 
369
</entry></row>
 
370
<row><entry align="right"><parameter>dith</parameter>&nbsp;:</entry>
 
371
<entry> Dithering method to use.
 
372
</entry></row>
 
373
<row><entry align="right"><parameter>rgb_buf</parameter>&nbsp;:</entry>
 
374
<entry> Pointer to the pixel in the RGB buffer that corresponds to the
 
375
upper-left corner of the rectangular region to render.
 
376
</entry></row>
 
377
<row><entry align="right"><parameter>rowstride</parameter>&nbsp;:</entry>
 
378
<entry> Offset between pixel rows in the RGB buffer, in bytes.
 
379
</entry></row>
 
380
<row><entry align="right"><parameter>xdith</parameter>&nbsp;:</entry>
 
381
<entry> X offset for the dither mask.
 
382
</entry></row>
 
383
<row><entry align="right"><parameter>ydith</parameter>&nbsp;:</entry>
 
384
<entry> Y offset for the dither mask.
 
385
</entry></row>
 
386
</tbody></tgroup></informaltable></refsect2>
 
387
<refsect2>
 
388
<title><anchor id="xlib-draw-rgb-32-image">xlib_draw_rgb_32_image ()</title>
 
389
<programlisting>void        xlib_draw_rgb_32_image          (<link linkend="Drawable">Drawable</link> drawable,
 
390
                                             <link linkend="GC-CAPS">GC</link> gc,
 
391
                                             int x,
 
392
                                             int y,
 
393
                                             int width,
 
394
                                             int height,
 
395
                                             <link linkend="XlibRgbDither">XlibRgbDither</link> dith,
 
396
                                             unsigned char *buf,
 
397
                                             int rowstride);</programlisting>
 
398
<para>
 
399
This function is analogous to <link linkend="xlib-draw-rgb-image">xlib_draw_rgb_image</link>(), but it lets you use
 
400
32-bit RGB buffers with pixels specified as 0xRRGGBB00.  The
 
401
least-significant 8 bits are actually discarded.  This function can lead to
 
402
faster results than <link linkend="xlib-draw-rgb-image">xlib_draw_rgb_image</link>() since the pixels are aligned on
 
403
32-bit boundaries.</para>
 
404
<para>
 
405
 
 
406
</para><informaltable pgwide=1 frame="none" role="params">
 
407
<tgroup cols="2">
 
408
<colspec colwidth="2*">
 
409
<colspec colwidth="8*">
 
410
<tbody>
 
411
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
 
412
<entry> Destination drawable.
 
413
</entry></row>
 
414
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
 
415
<entry> A graphic context.
 
416
</entry></row>
 
417
<row><entry align="right"><parameter>x</parameter>&nbsp;:</entry>
 
418
<entry> Leftmost coordinate of the destination rectangle.
 
419
</entry></row>
 
420
<row><entry align="right"><parameter>y</parameter>&nbsp;:</entry>
 
421
<entry> Upper coordinate of the destination rectangle.
 
422
</entry></row>
 
423
<row><entry align="right"><parameter>width</parameter>&nbsp;:</entry>
 
424
<entry> Width of the destination rectangle, in pixels.
 
425
</entry></row>
 
426
<row><entry align="right"><parameter>height</parameter>&nbsp;:</entry>
 
427
<entry> Height of the destination rectangle, in pixels.
 
428
</entry></row>
 
429
<row><entry align="right"><parameter>dith</parameter>&nbsp;:</entry>
 
430
<entry> Dithering method to use.
 
431
</entry></row>
 
432
<row><entry align="right"><parameter>buf</parameter>&nbsp;:</entry>
 
433
<entry> Pointer to the pixel in the RGB buffer that corresponds to the
 
434
upper-left corner of the rectangular region to render.
 
435
</entry></row>
 
436
<row><entry align="right"><parameter>rowstride</parameter>&nbsp;:</entry>
 
437
<entry> Offset between pixel rows in the RGB buffer, in bytes.
 
438
</entry></row>
 
439
</tbody></tgroup></informaltable></refsect2>
 
440
<refsect2>
 
441
<title><anchor id="xlib-draw-gray-image">xlib_draw_gray_image ()</title>
 
442
<programlisting>void        xlib_draw_gray_image            (<link linkend="Drawable">Drawable</link> drawable,
 
443
                                             <link linkend="GC-CAPS">GC</link> gc,
 
444
                                             int x,
 
445
                                             int y,
 
446
                                             int width,
 
447
                                             int height,
 
448
                                             <link linkend="XlibRgbDither">XlibRgbDither</link> dith,
 
449
                                             unsigned char *buf,
 
450
                                             int rowstride);</programlisting>
 
451
<para>
 
452
Renders a grayscale buffer to a drawable.  Pixels are specified as 8-bit
 
453
intensity values.  An image will thus look as a GGGGGG sequence of 8-bit
 
454
values.</para>
 
455
<para>
 
456
 
 
457
</para><informaltable pgwide=1 frame="none" role="params">
 
458
<tgroup cols="2">
 
459
<colspec colwidth="2*">
 
460
<colspec colwidth="8*">
 
461
<tbody>
 
462
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
 
463
<entry> Destination drawable.
 
464
</entry></row>
 
465
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
 
466
<entry> A graphic context.
 
467
</entry></row>
 
468
<row><entry align="right"><parameter>x</parameter>&nbsp;:</entry>
 
469
<entry> Leftmost coordinate of the destination rectangle.
 
470
</entry></row>
 
471
<row><entry align="right"><parameter>y</parameter>&nbsp;:</entry>
 
472
<entry> Upper coordinate of the destination rectangle.
 
473
</entry></row>
 
474
<row><entry align="right"><parameter>width</parameter>&nbsp;:</entry>
 
475
<entry> Width of the destination rectangle, in pixels.
 
476
</entry></row>
 
477
<row><entry align="right"><parameter>height</parameter>&nbsp;:</entry>
 
478
<entry> Height of thd destination rectangle, in pixels.
 
479
</entry></row>
 
480
<row><entry align="right"><parameter>dith</parameter>&nbsp;:</entry>
 
481
<entry> Dithering method to use.
 
482
</entry></row>
 
483
<row><entry align="right"><parameter>buf</parameter>&nbsp;:</entry>
 
484
<entry> Pointer to the pixel in the grayscale buffer that corresponds to the
 
485
upper-left corner of the rectangular region to render.
 
486
</entry></row>
 
487
<row><entry align="right"><parameter>rowstride</parameter>&nbsp;:</entry>
 
488
<entry> Offset between pixel rows in the grayscale buffer, in pixels.
 
489
</entry></row>
 
490
</tbody></tgroup></informaltable></refsect2>
 
491
<refsect2>
 
492
<title><anchor id="xlib-rgb-cmap-new">xlib_rgb_cmap_new ()</title>
 
493
<programlisting><link linkend="XlibRgbCmap">XlibRgbCmap</link>* xlib_rgb_cmap_new              (<link linkend="guint32">guint32</link> *colors,
 
494
                                             int n_colors);</programlisting>
 
495
<para>
 
496
FIXME</para>
 
497
<para>
 
498
 
 
499
</para><informaltable pgwide=1 frame="none" role="params">
 
500
<tgroup cols="2">
 
501
<colspec colwidth="2*">
 
502
<colspec colwidth="8*">
 
503
<tbody>
 
504
<row><entry align="right"><parameter>colors</parameter>&nbsp;:</entry>
 
505
<entry> FIXME
 
506
</entry></row>
 
507
<row><entry align="right"><parameter>n_colors</parameter>&nbsp;:</entry>
 
508
<entry> FIXME
 
509
</entry></row>
 
510
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> FIXME
 
511
</entry></row>
 
512
</tbody></tgroup></informaltable></refsect2>
 
513
<refsect2>
 
514
<title><anchor id="xlib-rgb-cmap-free">xlib_rgb_cmap_free ()</title>
 
515
<programlisting>void        xlib_rgb_cmap_free              (<link linkend="XlibRgbCmap">XlibRgbCmap</link> *cmap);</programlisting>
 
516
<para>
 
517
Frees an XlibRGB colormap.</para>
 
518
<para>
 
519
 
 
520
</para><informaltable pgwide=1 frame="none" role="params">
 
521
<tgroup cols="2">
 
522
<colspec colwidth="2*">
 
523
<colspec colwidth="8*">
 
524
<tbody>
 
525
<row><entry align="right"><parameter>cmap</parameter>&nbsp;:</entry>
 
526
<entry> An XlibRGB colormap.
 
527
</entry></row>
 
528
</tbody></tgroup></informaltable></refsect2>
 
529
<refsect2>
 
530
<title><anchor id="xlib-draw-indexed-image">xlib_draw_indexed_image ()</title>
 
531
<programlisting>void        xlib_draw_indexed_image         (<link linkend="Drawable">Drawable</link> drawable,
 
532
                                             <link linkend="GC-CAPS">GC</link> gc,
 
533
                                             int x,
 
534
                                             int y,
 
535
                                             int width,
 
536
                                             int height,
 
537
                                             <link linkend="XlibRgbDither">XlibRgbDither</link> dith,
 
538
                                             unsigned char *buf,
 
539
                                             int rowstride,
 
540
                                             <link linkend="XlibRgbCmap">XlibRgbCmap</link> *cmap);</programlisting>
 
541
<para>
 
542
FIXME</para>
 
543
<para>
 
544
 
 
545
</para><informaltable pgwide=1 frame="none" role="params">
 
546
<tgroup cols="2">
 
547
<colspec colwidth="2*">
 
548
<colspec colwidth="8*">
 
549
<tbody>
 
550
<row><entry align="right"><parameter>drawable</parameter>&nbsp;:</entry>
 
551
<entry> FIXME
 
552
</entry></row>
 
553
<row><entry align="right"><parameter>gc</parameter>&nbsp;:</entry>
 
554
<entry> FIXME
 
555
</entry></row>
 
556
<row><entry align="right"><parameter>x</parameter>&nbsp;:</entry>
 
557
<entry> FIXME
 
558
</entry></row>
 
559
<row><entry align="right"><parameter>y</parameter>&nbsp;:</entry>
 
560
<entry> FIXME
 
561
</entry></row>
 
562
<row><entry align="right"><parameter>width</parameter>&nbsp;:</entry>
 
563
<entry> FIXME
 
564
</entry></row>
 
565
<row><entry align="right"><parameter>height</parameter>&nbsp;:</entry>
 
566
<entry> FIXME
 
567
</entry></row>
 
568
<row><entry align="right"><parameter>dith</parameter>&nbsp;:</entry>
 
569
<entry> FIXME
 
570
</entry></row>
 
571
<row><entry align="right"><parameter>buf</parameter>&nbsp;:</entry>
 
572
<entry> FIXME
 
573
</entry></row>
 
574
<row><entry align="right"><parameter>rowstride</parameter>&nbsp;:</entry>
 
575
<entry> FIXME
 
576
</entry></row>
 
577
<row><entry align="right"><parameter>cmap</parameter>&nbsp;:</entry>
 
578
<entry> FIXME
 
579
</entry></row>
 
580
</tbody></tgroup></informaltable></refsect2>
 
581
<refsect2>
 
582
<title><anchor id="xlib-rgb-ditherable">xlib_rgb_ditherable ()</title>
 
583
<programlisting><link linkend="Bool">Bool</link>        xlib_rgb_ditherable             (void);</programlisting>
 
584
<para>
 
585
Queries whether XlibRGB supports dithering for its chosen visual.</para>
 
586
<para>
 
587
 
 
588
</para><informaltable pgwide=1 frame="none" role="params">
 
589
<tgroup cols="2">
 
590
<colspec colwidth="2*">
 
591
<colspec colwidth="8*">
 
592
<tbody>
 
593
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE if dithering can be performed for the visual that XlibRGB
 
594
is using, FALSE otherwise.
 
595
</entry></row>
 
596
</tbody></tgroup></informaltable></refsect2>
 
597
<refsect2>
 
598
<title><anchor id="xlib-rgb-set-verbose">xlib_rgb_set_verbose ()</title>
 
599
<programlisting>void        xlib_rgb_set_verbose            (<link linkend="Bool">Bool</link> verbose);</programlisting>
 
600
<para>
 
601
This is primarily a debugging function.  Sets whether you want XlibRGB to
 
602
print information about the visual and colormap it chooses.  You normally do
 
603
not need to use this function.</para>
 
604
<para>
 
605
 
 
606
</para><informaltable pgwide=1 frame="none" role="params">
 
607
<tgroup cols="2">
 
608
<colspec colwidth="2*">
 
609
<colspec colwidth="8*">
 
610
<tbody>
 
611
<row><entry align="right"><parameter>verbose</parameter>&nbsp;:</entry>
 
612
<entry> Whether to print visual/colormap debugging information.
 
613
</entry></row>
 
614
</tbody></tgroup></informaltable></refsect2>
 
615
<refsect2>
 
616
<title><anchor id="xlib-rgb-set-install">xlib_rgb_set_install ()</title>
 
617
<programlisting>void        xlib_rgb_set_install            (<link linkend="Bool">Bool</link> install);</programlisting>
 
618
<para>
 
619
Sets whether XlibRGB should install its own private colormap instead of
 
620
trying to allocate color cells from the system colormap.  This should be
 
621
called before initializing XlibRGB.</para>
 
622
<para>
 
623
 
 
624
</para><informaltable pgwide=1 frame="none" role="params">
 
625
<tgroup cols="2">
 
626
<colspec colwidth="2*">
 
627
<colspec colwidth="8*">
 
628
<tbody>
 
629
<row><entry align="right"><parameter>install</parameter>&nbsp;:</entry>
 
630
<entry> Whether to install a private colormap.
 
631
</entry></row>
 
632
</tbody></tgroup></informaltable></refsect2>
 
633
<refsect2>
 
634
<title><anchor id="xlib-rgb-set-min-colors">xlib_rgb_set_min_colors ()</title>
 
635
<programlisting>void        xlib_rgb_set_min_colors         (int min_colors);</programlisting>
 
636
<para>
 
637
Sets the minimum number of free color cells that must be available in the
 
638
system color map for XlibRGB to use it.  If the specified number of colors is
 
639
not available, XlibRGB will install its own private colormap.</para>
 
640
<para>
 
641
 
 
642
</para><informaltable pgwide=1 frame="none" role="params">
 
643
<tgroup cols="2">
 
644
<colspec colwidth="2*">
 
645
<colspec colwidth="8*">
 
646
<tbody>
 
647
<row><entry align="right"><parameter>min_colors</parameter>&nbsp;:</entry>
 
648
<entry> Minimum number of colors to look for in the system colormap.
 
649
</entry></row>
 
650
</tbody></tgroup></informaltable></refsect2>
 
651
<refsect2>
 
652
<title><anchor id="xlib-rgb-get-cmap">xlib_rgb_get_cmap ()</title>
 
653
<programlisting><link linkend="Colormap">Colormap</link>    xlib_rgb_get_cmap               (void);</programlisting>
 
654
<para>
 
655
Queries the X colormap that XlibRGB is using.</para>
 
656
<para>
 
657
 
 
658
</para><informaltable pgwide=1 frame="none" role="params">
 
659
<tgroup cols="2">
 
660
<colspec colwidth="2*">
 
661
<colspec colwidth="8*">
 
662
<tbody>
 
663
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> An X colormap.
 
664
</entry></row>
 
665
</tbody></tgroup></informaltable></refsect2>
 
666
<refsect2>
 
667
<title><anchor id="xlib-rgb-get-visual">xlib_rgb_get_visual ()</title>
 
668
<programlisting><link linkend="Visual">Visual</link>*     xlib_rgb_get_visual             (void);</programlisting>
 
669
<para>
 
670
Queries the visual that XlibRGB is using.</para>
 
671
<para>
 
672
 
 
673
</para><informaltable pgwide=1 frame="none" role="params">
 
674
<tgroup cols="2">
 
675
<colspec colwidth="2*">
 
676
<colspec colwidth="8*">
 
677
<tbody>
 
678
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> An X visual.
 
679
</entry></row>
 
680
</tbody></tgroup></informaltable></refsect2>
 
681
<refsect2>
 
682
<title><anchor id="xlib-rgb-get-visual-info">xlib_rgb_get_visual_info ()</title>
 
683
<programlisting><link linkend="XVisualInfo">XVisualInfo</link>* xlib_rgb_get_visual_info       (void);</programlisting>
 
684
<para>
 
685
Queries the visual info structure for the visual that XlibRGB is using.</para>
 
686
<para>
 
687
 
 
688
</para><informaltable pgwide=1 frame="none" role="params">
 
689
<tgroup cols="2">
 
690
<colspec colwidth="2*">
 
691
<colspec colwidth="8*">
 
692
<tbody>
 
693
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> An XVisualInfo structure.
 
694
</entry></row>
 
695
</tbody></tgroup></informaltable></refsect2>
 
696
<refsect2>
 
697
<title><anchor id="xlib-rgb-get-depth">xlib_rgb_get_depth ()</title>
 
698
<programlisting>int         xlib_rgb_get_depth              (void);</programlisting>
 
699
<para>
 
700
Queries the depth of the visual that XlibRGB is using.</para>
 
701
<para>
 
702
 
 
703
</para><informaltable pgwide=1 frame="none" role="params">
 
704
<tgroup cols="2">
 
705
<colspec colwidth="2*">
 
706
<colspec colwidth="8*">
 
707
<tbody>
 
708
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> Bit depth.
 
709
</entry></row>
 
710
</tbody></tgroup></informaltable></refsect2>
 
711
<refsect2>
 
712
<title><anchor id="xlib-rgb-get-display">xlib_rgb_get_display ()</title>
 
713
<programlisting><link linkend="Display">Display</link>*    xlib_rgb_get_display            (void);</programlisting>
 
714
<para>
 
715
Queries the X display that XlibRGB is using.</para>
 
716
<para>
 
717
 
 
718
</para><informaltable pgwide=1 frame="none" role="params">
 
719
<tgroup cols="2">
 
720
<colspec colwidth="2*">
 
721
<colspec colwidth="8*">
 
722
<tbody>
 
723
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> An X display.
 
724
</entry></row>
 
725
</tbody></tgroup></informaltable></refsect2>
 
726
<refsect2>
 
727
<title><anchor id="xlib-rgb-get-screen">xlib_rgb_get_screen ()</title>
 
728
<programlisting><link linkend="Screen">Screen</link>*     xlib_rgb_get_screen             (void);</programlisting>
 
729
<para>
 
730
Queries the screen that XlibRGB is using.</para>
 
731
<para>
 
732
 
 
733
</para><informaltable pgwide=1 frame="none" role="params">
 
734
<tgroup cols="2">
 
735
<colspec colwidth="2*">
 
736
<colspec colwidth="8*">
 
737
<tbody>
 
738
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> An X screen.
 
739
</entry></row>
 
740
</tbody></tgroup></informaltable></refsect2>
 
741
 
 
742
</refsect1>
 
743
 
 
744
 
 
745
 
 
746
<refsect1>
 
747
<title>See Also</title>
 
748
  <para>
 
749
    GdkRGB
 
750
  </para>
 
751
</refsect1>
 
752
 
 
753
</refentry>