<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="gdk-GdkRGB">
<refmeta>
<refentrytitle role="top_of_page" id="gdk-GdkRGB.top_of_page">GdkRGB</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GDK Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GdkRGB</refname>
<refpurpose>Renders RGB, grayscale, or indexed image data to a GdkDrawable</refpurpose>
</refnamediv>

<refsynopsisdiv id="gdk-GdkRGB.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

#include &lt;gdk/gdk.h&gt;

<link linkend="void">void</link>                <link linkend="gdk-rgb-init">gdk_rgb_init</link>                        (void);

<link linkend="void">void</link>                <link linkend="gdk-draw-rgb-image">gdk_draw_rgb_image</link>                  (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                                         <link linkend="GdkGC">GdkGC</link> *gc,
                                                         <link linkend="gint">gint</link> x,
                                                         <link linkend="gint">gint</link> y,
                                                         <link linkend="gint">gint</link> width,
                                                         <link linkend="gint">gint</link> height,
                                                         <link linkend="GdkRgbDither">GdkRgbDither</link> dith,
                                                         const <link linkend="guchar">guchar</link> *rgb_buf,
                                                         <link linkend="gint">gint</link> rowstride);
<link linkend="void">void</link>                <link linkend="gdk-draw-rgb-image-dithalign">gdk_draw_rgb_image_dithalign</link>        (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                                         <link linkend="GdkGC">GdkGC</link> *gc,
                                                         <link linkend="gint">gint</link> x,
                                                         <link linkend="gint">gint</link> y,
                                                         <link linkend="gint">gint</link> width,
                                                         <link linkend="gint">gint</link> height,
                                                         <link linkend="GdkRgbDither">GdkRgbDither</link> dith,
                                                         const <link linkend="guchar">guchar</link> *rgb_buf,
                                                         <link linkend="gint">gint</link> rowstride,
                                                         <link linkend="gint">gint</link> xdith,
                                                         <link linkend="gint">gint</link> ydith);
<link linkend="void">void</link>                <link linkend="gdk-draw-indexed-image">gdk_draw_indexed_image</link>              (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                                         <link linkend="GdkGC">GdkGC</link> *gc,
                                                         <link linkend="gint">gint</link> x,
                                                         <link linkend="gint">gint</link> y,
                                                         <link linkend="gint">gint</link> width,
                                                         <link linkend="gint">gint</link> height,
                                                         <link linkend="GdkRgbDither">GdkRgbDither</link> dith,
                                                         const <link linkend="guchar">guchar</link> *buf,
                                                         <link linkend="gint">gint</link> rowstride,
                                                         <link linkend="GdkRgbCmap">GdkRgbCmap</link> *cmap);
<link linkend="void">void</link>                <link linkend="gdk-draw-gray-image">gdk_draw_gray_image</link>                 (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                                         <link linkend="GdkGC">GdkGC</link> *gc,
                                                         <link linkend="gint">gint</link> x,
                                                         <link linkend="gint">gint</link> y,
                                                         <link linkend="gint">gint</link> width,
                                                         <link linkend="gint">gint</link> height,
                                                         <link linkend="GdkRgbDither">GdkRgbDither</link> dith,
                                                         const <link linkend="guchar">guchar</link> *buf,
                                                         <link linkend="gint">gint</link> rowstride);
<link linkend="void">void</link>                <link linkend="gdk-draw-rgb-32-image">gdk_draw_rgb_32_image</link>               (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                                         <link linkend="GdkGC">GdkGC</link> *gc,
                                                         <link linkend="gint">gint</link> x,
                                                         <link linkend="gint">gint</link> y,
                                                         <link linkend="gint">gint</link> width,
                                                         <link linkend="gint">gint</link> height,
                                                         <link linkend="GdkRgbDither">GdkRgbDither</link> dith,
                                                         const <link linkend="guchar">guchar</link> *buf,
                                                         <link linkend="gint">gint</link> rowstride);
<link linkend="void">void</link>                <link linkend="gdk-draw-rgb-32-image-dithalign">gdk_draw_rgb_32_image_dithalign</link>     (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                                         <link linkend="GdkGC">GdkGC</link> *gc,
                                                         <link linkend="gint">gint</link> x,
                                                         <link linkend="gint">gint</link> y,
                                                         <link linkend="gint">gint</link> width,
                                                         <link linkend="gint">gint</link> height,
                                                         <link linkend="GdkRgbDither">GdkRgbDither</link> dith,
                                                         const <link linkend="guchar">guchar</link> *buf,
                                                         <link linkend="gint">gint</link> rowstride,
                                                         <link linkend="gint">gint</link> xdith,
                                                         <link linkend="gint">gint</link> ydith);
enum                <link linkend="GdkRgbDither">GdkRgbDither</link>;

<link linkend="GdkRgbCmap">GdkRgbCmap</link> *        <link linkend="gdk-rgb-cmap-new">gdk_rgb_cmap_new</link>                    (<link linkend="guint32">guint32</link> *colors,
                                                         <link linkend="gint">gint</link> n_colors);
<link linkend="void">void</link>                <link linkend="gdk-rgb-cmap-free">gdk_rgb_cmap_free</link>                   (<link linkend="GdkRgbCmap">GdkRgbCmap</link> *cmap);
                    <link linkend="GdkRgbCmap">GdkRgbCmap</link>;

<link linkend="void">void</link>                <link linkend="gdk-rgb-gc-set-foreground">gdk_rgb_gc_set_foreground</link>           (<link linkend="GdkGC">GdkGC</link> *gc,
                                                         <link linkend="guint32">guint32</link> rgb);
<link linkend="void">void</link>                <link linkend="gdk-rgb-gc-set-background">gdk_rgb_gc_set_background</link>           (<link linkend="GdkGC">GdkGC</link> *gc,
                                                         <link linkend="guint32">guint32</link> rgb);
<link linkend="gulong">gulong</link>              <link linkend="gdk-rgb-xpixel-from-rgb">gdk_rgb_xpixel_from_rgb</link>             (<link linkend="guint32">guint32</link> rgb);
<link linkend="void">void</link>                <link linkend="gdk-rgb-find-color">gdk_rgb_find_color</link>                  (<link linkend="GdkColormap">GdkColormap</link> *colormap,
                                                         <link linkend="GdkColor">GdkColor</link> *color);

<link linkend="void">void</link>                <link linkend="gdk-rgb-set-install">gdk_rgb_set_install</link>                 (<link linkend="gboolean">gboolean</link> install);
<link linkend="void">void</link>                <link linkend="gdk-rgb-set-min-colors">gdk_rgb_set_min_colors</link>              (<link linkend="gint">gint</link> min_colors);
<link linkend="GdkVisual">GdkVisual</link> *         <link linkend="gdk-rgb-get-visual">gdk_rgb_get_visual</link>                  (void);
<link linkend="GdkColormap">GdkColormap</link> *       <link linkend="gdk-rgb-get-colormap">gdk_rgb_get_colormap</link>                (void);
#define             <link linkend="gdk-rgb-get-cmap">gdk_rgb_get_cmap</link>
<link linkend="gboolean">gboolean</link>            <link linkend="gdk-rgb-ditherable">gdk_rgb_ditherable</link>                  (void);
<link linkend="gboolean">gboolean</link>            <link linkend="gdk-rgb-colormap-ditherable">gdk_rgb_colormap_ditherable</link>         (<link linkend="GdkColormap">GdkColormap</link> *cmap);
<link linkend="void">void</link>                <link linkend="gdk-rgb-set-verbose">gdk_rgb_set_verbose</link>                 (<link linkend="gboolean">gboolean</link> verbose);
</synopsis>
</refsynopsisdiv>









<refsect1 id="gdk-GdkRGB.description" role="desc">
<title role="desc.title">Description</title>
<para>
GdkRGB is a low-level module which renders RGB, grayscale, and indexed
colormap images to a <link linkend="GdkDrawable"><type>GdkDrawable</type></link>. It does this as efficiently as
possible, handling issues such as colormaps, visuals, dithering,
temporary buffers, and so on. Most code should use the higher-level
<link linkend="GdkPixbuf"><type>GdkPixbuf</type></link> features in place of this module; for example,
<link linkend="gdk-draw-pixbuf"><function>gdk_draw_pixbuf()</function></link> uses GdkRGB in its implementation.
</para>
<para>
GdkRGB allocates a color cube to use when rendering images.  You can
set the threshold for installing colormaps with
<link linkend="gdk-rgb-set-min-colors"><function>gdk_rgb_set_min_colors()</function></link>. The default is 5x5x5 (125). If a colorcube
of this size or larger can be allocated in the default colormap, then
that's done. Otherwise, GdkRGB creates its own private colormap.
Setting it to 0 means that it always tries to use the default
colormap, and setting it to 216 means that it always creates a private
one if it cannot allocate the 6x6x6 colormap in the default. If you
always want a private colormap (to avoid consuming too many colormap
entries for other apps, say), you can use
<literal>gdk_rgb_set_install(TRUE)</literal>.
Setting the value greater than 216 exercises a bug in older versions
of GdkRGB. Note, however, that setting it to 0 doesn't let you get
away with ignoring the colormap and visual - a colormap is always
created in grayscale and direct color modes, and the visual is changed
in cases where a "better" visual than the default is available.
</para>
<para>
If GDK is built with the Sun mediaLib library, the GdkRGB functions are
accelerated using mediaLib, which provides hardware acceleration on Intel,
AMD, and Sparc chipsets.  If desired, mediaLib support can be turned off
by setting the GDK_DISABLE_MEDIALIB environment variable.
</para>
<example>
<title>A simple example program using GdkRGB</title>
<programlisting>
&num;include &lt;gtk/gtk.h&gt;
&num;define IMAGE_WIDTH	256
&num;define IMAGE_HEIGHT	256
guchar rgbbuf[IMAGE_WIDTH * IMAGE_HEIGHT * 3];
gboolean on_darea_expose (GtkWidget *widget,
			  GdkEventExpose *event,
			  gpointer user_data);
int
main (int argc, char *argv[])
{
  GtkWidget *window, *darea;
  gint x, y;
  guchar *pos;
  gtk_init (&amp;argc, &amp;argv);
  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  darea = gtk_drawing_area_new (<!-- -->);
  gtk_widget_set_size_request (darea, IMAGE_WIDTH, IMAGE_HEIGHT);
  gtk_container_add (GTK_CONTAINER (window), darea);
  gtk_signal_connect (GTK_OBJECT (darea), "expose-event",
                      GTK_SIGNAL_FUNC (on_darea_expose), NULL);
  gtk_widget_show_all (window);
  /* Set up the RGB buffer. */
  pos = rgbbuf;
  for (y = 0; y &lt; IMAGE_HEIGHT; y++)
    {
      for (x = 0; x &lt; IMAGE_WIDTH; x++)
	{
	  *pos++ = x - x % 32;			/* Red. */
	  *pos++ = (x / 32) * 4 + y - y % 32;	/* Green. */
	  *pos++ = y - y % 32;			/* Blue. */
	}
    }
  gtk_main (<!-- -->);
  return 0;
}
gboolean
on_darea_expose (GtkWidget *widget,
		 GdkEventExpose *event,
		 gpointer user_data)
{
  gdk_draw_rgb_image (widget->window, widget->style->fg_gc[GTK_STATE_NORMAL],
		      0, 0, IMAGE_WIDTH, IMAGE_HEIGHT,
		      GDK_RGB_DITHER_MAX, rgbbuf, IMAGE_WIDTH * 3);
  return TRUE;
}
</programlisting>
</example>
</refsect1>

<refsect1 id="gdk-GdkRGB.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="gdk-rgb-init" role="function" condition="deprecated:">
<title>gdk_rgb_init ()</title>
<indexterm zone="gdk-rgb-init" role="deprecated"><primary sortas="rgb_init">gdk_rgb_init</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_rgb_init                        (void);</programlisting>
<warning><para><literal>gdk_rgb_init</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
This function no longer does anything at all. It's completely useless
(and harmless).
</para></refsect2>
<refsect2 id="gdk-draw-rgb-image" role="function">
<title>gdk_draw_rgb_image ()</title>
<indexterm zone="gdk-draw-rgb-image"><primary sortas="draw_rgb_image">gdk_draw_rgb_image</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_draw_rgb_image                  (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                                         <link linkend="GdkGC">GdkGC</link> *gc,
                                                         <link linkend="gint">gint</link> x,
                                                         <link linkend="gint">gint</link> y,
                                                         <link linkend="gint">gint</link> width,
                                                         <link linkend="gint">gint</link> height,
                                                         <link linkend="GdkRgbDither">GdkRgbDither</link> dith,
                                                         const <link linkend="guchar">guchar</link> *rgb_buf,
                                                         <link linkend="gint">gint</link> rowstride);</programlisting>
<para>
Draws an RGB image in the drawable. This is the core GdkRGB
function, and likely the only one you will need to use.
</para>
<para>
The <parameter>rowstride</parameter> parameter allows for lines to be aligned more flexibly.
For example, lines may be allocated to begin on 32-bit boundaries,
even if the width of the rectangle is odd. Rowstride is also useful
when drawing a subrectangle of a larger image in memory. Finally, to
replicate the same line a number of times, the trick of setting
<parameter>rowstride</parameter> to 0 is allowed.
</para>
<para>
In general, for 0 &lt;= i &lt; <parameter>width</parameter> and 0 &lt;= j &lt; height,
the pixel (x + i, y + j) is colored with red value <parameter>rgb_buf</parameter>[<parameter>j</parameter> *
<parameter>rowstride</parameter> + <parameter>i</parameter> * 3], green value <parameter>rgb_buf</parameter>[<parameter>j</parameter> * <parameter>rowstride</parameter> + <parameter>i</parameter> * 3 +
1], and blue value <parameter>rgb_buf</parameter>[<parameter>j</parameter> * <parameter>rowstride</parameter> + <parameter>i</parameter> * 3 + 2].
</para><variablelist role="params">
<varlistentry><term><parameter>drawable</parameter>&#160;:</term>
<listitem><simpara>The <link linkend="GdkDrawable"><type>GdkDrawable</type></link> to draw in (usually a <link linkend="GdkWindow"><type>GdkWindow</type></link>).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara>The graphics context (all GDK drawing operations require one; its
contents are ignored).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter>&#160;:</term>
<listitem><simpara>The x coordinate of the top-left corner in the drawable.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter>&#160;:</term>
<listitem><simpara>The y coordinate of the top-left corner in the drawable.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&#160;:</term>
<listitem><simpara>The width of the rectangle to be drawn.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&#160;:</term>
<listitem><simpara>The height of the rectangle to be drawn.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dith</parameter>&#160;:</term>
<listitem><simpara>A <link linkend="GdkRgbDither"><type>GdkRgbDither</type></link> value, selecting the desired dither mode.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>rgb_buf</parameter>&#160;:</term>
<listitem><simpara>The pixel data, represented as packed 24-bit data.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>rowstride</parameter>&#160;:</term>
<listitem><simpara>The number of bytes from the start of one row in <parameter>rgb_buf</parameter> to the
start of the next.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-draw-rgb-image-dithalign" role="function">
<title>gdk_draw_rgb_image_dithalign ()</title>
<indexterm zone="gdk-draw-rgb-image-dithalign"><primary sortas="draw_rgb_image_dithalign">gdk_draw_rgb_image_dithalign</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_draw_rgb_image_dithalign        (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                                         <link linkend="GdkGC">GdkGC</link> *gc,
                                                         <link linkend="gint">gint</link> x,
                                                         <link linkend="gint">gint</link> y,
                                                         <link linkend="gint">gint</link> width,
                                                         <link linkend="gint">gint</link> height,
                                                         <link linkend="GdkRgbDither">GdkRgbDither</link> dith,
                                                         const <link linkend="guchar">guchar</link> *rgb_buf,
                                                         <link linkend="gint">gint</link> rowstride,
                                                         <link linkend="gint">gint</link> xdith,
                                                         <link linkend="gint">gint</link> ydith);</programlisting>
<para>
Draws an RGB image in the drawable, with an adjustment for dither alignment.
</para>
<para>
This function is useful when drawing dithered images into a window
that may be scrolled. Pixel (x, y) will be drawn dithered as if its
actual location is (x + <parameter>xdith</parameter>, y + <parameter>ydith</parameter>). Thus, if you draw an
image into a window using zero dither alignment, then scroll up one
pixel, subsequent draws to the window should have <parameter>ydith</parameter> = 1.
</para>
<para>
Setting the dither alignment correctly allows updating of small parts
of the screen while avoiding visible "seams" between the different
dither textures.
</para><variablelist role="params">
<varlistentry><term><parameter>drawable</parameter>&#160;:</term>
<listitem><simpara>The <link linkend="GdkDrawable"><type>GdkDrawable</type></link> to draw in (usually a <link linkend="GdkWindow"><type>GdkWindow</type></link>).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara>The graphics context.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter>&#160;:</term>
<listitem><simpara>The x coordinate of the top-left corner in the drawable.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter>&#160;:</term>
<listitem><simpara>The y coordinate of the top-left corner in the drawable.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&#160;:</term>
<listitem><simpara>The width of the rectangle to be drawn.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&#160;:</term>
<listitem><simpara>The height of the rectangle to be drawn.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dith</parameter>&#160;:</term>
<listitem><simpara>A <link linkend="GdkRgbDither"><type>GdkRgbDither</type></link> value, selecting the desired dither mode.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>rgb_buf</parameter>&#160;:</term>
<listitem><simpara>The pixel data, represented as packed 24-bit data.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>rowstride</parameter>&#160;:</term>
<listitem><simpara>The number of bytes from the start of one row in <parameter>rgb_buf</parameter> to the
start of the next.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>xdith</parameter>&#160;:</term>
<listitem><simpara>An x offset for dither alignment.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ydith</parameter>&#160;:</term>
<listitem><simpara>A y offset for dither alignment.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-draw-indexed-image" role="function">
<title>gdk_draw_indexed_image ()</title>
<indexterm zone="gdk-draw-indexed-image"><primary sortas="draw_indexed_image">gdk_draw_indexed_image</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_draw_indexed_image              (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                                         <link linkend="GdkGC">GdkGC</link> *gc,
                                                         <link linkend="gint">gint</link> x,
                                                         <link linkend="gint">gint</link> y,
                                                         <link linkend="gint">gint</link> width,
                                                         <link linkend="gint">gint</link> height,
                                                         <link linkend="GdkRgbDither">GdkRgbDither</link> dith,
                                                         const <link linkend="guchar">guchar</link> *buf,
                                                         <link linkend="gint">gint</link> rowstride,
                                                         <link linkend="GdkRgbCmap">GdkRgbCmap</link> *cmap);</programlisting>
<para>
Draws an indexed image in the drawable, using a <link linkend="GdkRgbCmap"><type>GdkRgbCmap</type></link> to assign
actual colors to the color indices.
</para><variablelist role="params">
<varlistentry><term><parameter>drawable</parameter>&#160;:</term>
<listitem><simpara>The <link linkend="GdkDrawable"><type>GdkDrawable</type></link> to draw in (usually a <link linkend="GdkWindow"><type>GdkWindow</type></link>).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara>The graphics context.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter>&#160;:</term>
<listitem><simpara>The x coordinate of the top-left corner in the drawable.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter>&#160;:</term>
<listitem><simpara>The y coordinate of the top-left corner in the drawable.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&#160;:</term>
<listitem><simpara>The width of the rectangle to be drawn.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&#160;:</term>
<listitem><simpara>The height of the rectangle to be drawn.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dith</parameter>&#160;:</term>
<listitem><simpara>A <link linkend="GdkRgbDither"><type>GdkRgbDither</type></link> value, selecting the desired dither mode.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buf</parameter>&#160;:</term>
<listitem><simpara>The pixel data, represented as 8-bit color indices.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>rowstride</parameter>&#160;:</term>
<listitem><simpara>The number of bytes from the start of one row in <parameter>buf</parameter> to the
start of the next.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cmap</parameter>&#160;:</term>
<listitem><simpara>The <link linkend="GdkRgbCmap"><type>GdkRgbCmap</type></link> used to assign colors to the color indices.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-draw-gray-image" role="function">
<title>gdk_draw_gray_image ()</title>
<indexterm zone="gdk-draw-gray-image"><primary sortas="draw_gray_image">gdk_draw_gray_image</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_draw_gray_image                 (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                                         <link linkend="GdkGC">GdkGC</link> *gc,
                                                         <link linkend="gint">gint</link> x,
                                                         <link linkend="gint">gint</link> y,
                                                         <link linkend="gint">gint</link> width,
                                                         <link linkend="gint">gint</link> height,
                                                         <link linkend="GdkRgbDither">GdkRgbDither</link> dith,
                                                         const <link linkend="guchar">guchar</link> *buf,
                                                         <link linkend="gint">gint</link> rowstride);</programlisting>
<para>
Draws a grayscale image in the drawable.
</para><variablelist role="params">
<varlistentry><term><parameter>drawable</parameter>&#160;:</term>
<listitem><simpara>The <link linkend="GdkDrawable"><type>GdkDrawable</type></link> to draw in (usually a <link linkend="GdkWindow"><type>GdkWindow</type></link>).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara>The graphics context.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter>&#160;:</term>
<listitem><simpara>The x coordinate of the top-left corner in the drawable.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter>&#160;:</term>
<listitem><simpara>The y coordinate of the top-left corner in the drawable.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&#160;:</term>
<listitem><simpara>The width of the rectangle to be drawn.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&#160;:</term>
<listitem><simpara>The height of the rectangle to be drawn.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dith</parameter>&#160;:</term>
<listitem><simpara>A <link linkend="GdkRgbDither"><type>GdkRgbDither</type></link> value, selecting the desired dither mode.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buf</parameter>&#160;:</term>
<listitem><simpara>The pixel data, represented as 8-bit gray values.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>rowstride</parameter>&#160;:</term>
<listitem><simpara>The number of bytes from the start of one row in <parameter>buf</parameter> to the
start of the next.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-draw-rgb-32-image" role="function">
<title>gdk_draw_rgb_32_image ()</title>
<indexterm zone="gdk-draw-rgb-32-image"><primary sortas="draw_rgb_32_image">gdk_draw_rgb_32_image</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_draw_rgb_32_image               (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                                         <link linkend="GdkGC">GdkGC</link> *gc,
                                                         <link linkend="gint">gint</link> x,
                                                         <link linkend="gint">gint</link> y,
                                                         <link linkend="gint">gint</link> width,
                                                         <link linkend="gint">gint</link> height,
                                                         <link linkend="GdkRgbDither">GdkRgbDither</link> dith,
                                                         const <link linkend="guchar">guchar</link> *buf,
                                                         <link linkend="gint">gint</link> rowstride);</programlisting>
<para>
Draws a padded RGB image in the drawable. The image is stored as one
pixel per 32-bit word. It is laid out as a red byte, a green byte, a
blue byte, and a padding byte.
</para>
<para>
It's unlikely that this function will give significant performance
gains in practice. In my experience, the performance gain from having
pixels aligned to 32-bit boundaries is cancelled out by the increased
memory bandwidth.
</para><variablelist role="params">
<varlistentry><term><parameter>drawable</parameter>&#160;:</term>
<listitem><simpara>The <link linkend="GdkDrawable"><type>GdkDrawable</type></link> to draw in (usually a <link linkend="GdkWindow"><type>GdkWindow</type></link>).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara>The graphics context.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter>&#160;:</term>
<listitem><simpara>The x coordinate of the top-left corner in the drawable.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter>&#160;:</term>
<listitem><simpara>The y coordinate of the top-left corner in the drawable.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&#160;:</term>
<listitem><simpara>The width of the rectangle to be drawn.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&#160;:</term>
<listitem><simpara>The height of the rectangle to be drawn.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dith</parameter>&#160;:</term>
<listitem><simpara>A <link linkend="GdkRgbDither"><type>GdkRgbDither</type></link> value, selecting the desired dither mode.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buf</parameter>&#160;:</term>
<listitem><simpara>The pixel data, represented as padded 32-bit data.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>rowstride</parameter>&#160;:</term>
<listitem><simpara>The number of bytes from the start of one row in <parameter>buf</parameter> to the
start of the next.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-draw-rgb-32-image-dithalign" role="function">
<title>gdk_draw_rgb_32_image_dithalign ()</title>
<indexterm zone="gdk-draw-rgb-32-image-dithalign"><primary sortas="draw_rgb_32_image_dithalign">gdk_draw_rgb_32_image_dithalign</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_draw_rgb_32_image_dithalign     (<link linkend="GdkDrawable">GdkDrawable</link> *drawable,
                                                         <link linkend="GdkGC">GdkGC</link> *gc,
                                                         <link linkend="gint">gint</link> x,
                                                         <link linkend="gint">gint</link> y,
                                                         <link linkend="gint">gint</link> width,
                                                         <link linkend="gint">gint</link> height,
                                                         <link linkend="GdkRgbDither">GdkRgbDither</link> dith,
                                                         const <link linkend="guchar">guchar</link> *buf,
                                                         <link linkend="gint">gint</link> rowstride,
                                                         <link linkend="gint">gint</link> xdith,
                                                         <link linkend="gint">gint</link> ydith);</programlisting>
<para>
Like <link linkend="gdk-draw-rgb-32-image"><function>gdk_draw_rgb_32_image()</function></link>, but allows you to specify the dither
offsets. See <link linkend="gdk-draw-rgb-image-dithalign"><function>gdk_draw_rgb_image_dithalign()</function></link> for more details.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>drawable</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkDrawable"><type>GdkDrawable</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkGC"><type>GdkGC</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter>&#160;:</term>
<listitem><simpara> X coordinate on <parameter>drawable</parameter> where image should go
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter>&#160;:</term>
<listitem><simpara> Y coordinate on <parameter>drawable</parameter> where image should go
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&#160;:</term>
<listitem><simpara> width of area of image to draw
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&#160;:</term>
<listitem><simpara> height of area of image to draw
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dith</parameter>&#160;:</term>
<listitem><simpara> dithering mode
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buf</parameter>&#160;:</term>
<listitem><simpara> RGB image data
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>rowstride</parameter>&#160;:</term>
<listitem><simpara> rowstride of RGB image data
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>xdith</parameter>&#160;:</term>
<listitem><simpara> X dither offset
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ydith</parameter>&#160;:</term>
<listitem><simpara> Y dither offset
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GdkRgbDither" role="enum">
<title>enum GdkRgbDither</title>
<indexterm zone="GdkRgbDither"><primary sortas="RgbDither">GdkRgbDither</primary></indexterm><programlisting>typedef enum
{
  GDK_RGB_DITHER_NONE,
  GDK_RGB_DITHER_NORMAL,
  GDK_RGB_DITHER_MAX
} GdkRgbDither;
</programlisting>
<para>
Selects whether or not GdkRGB applies dithering
to the image on display.
</para>
<para>
Since GdkRGB currently only handles images with 8 bits per component,
dithering on 24 bit per pixel displays is a moot point.
</para><variablelist role="enum">
<varlistentry id="GDK-RGB-DITHER-NONE--CAPS" role="constant">
<term><literal>GDK_RGB_DITHER_NONE</literal></term>
<listitem><simpara>Never use dithering.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-RGB-DITHER-NORMAL--CAPS" role="constant">
<term><literal>GDK_RGB_DITHER_NORMAL</literal></term>
<listitem><simpara>Use dithering in 8 bits per pixel (and below)
only.
</simpara></listitem>
</varlistentry>
<varlistentry id="GDK-RGB-DITHER-MAX--CAPS" role="constant">
<term><literal>GDK_RGB_DITHER_MAX</literal></term>
<listitem><simpara>Use dithering in 16 bits per pixel and below.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-rgb-cmap-new" role="function">
<title>gdk_rgb_cmap_new ()</title>
<indexterm zone="gdk-rgb-cmap-new"><primary sortas="rgb_cmap_new">gdk_rgb_cmap_new</primary></indexterm><programlisting><link linkend="GdkRgbCmap">GdkRgbCmap</link> *        gdk_rgb_cmap_new                    (<link linkend="guint32">guint32</link> *colors,
                                                         <link linkend="gint">gint</link> n_colors);</programlisting>
<para>
Creates a new <link linkend="GdkRgbCmap"><type>GdkRgbCmap</type></link> structure. The cmap maps color indexes to
RGB colors. If <parameter>n_colors</parameter> is less than 256, then images containing
color values greater than or equal to <parameter>n_colors</parameter> will produce undefined
results, including possibly segfaults.
</para><variablelist role="params">
<varlistentry><term><parameter>colors</parameter>&#160;:</term>
<listitem><simpara>The colors, represented as 0xRRGGBB integer values.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_colors</parameter>&#160;:</term>
<listitem><simpara>The number of colors in the cmap.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>The newly created <link linkend="GdkRgbCmap"><type>GdkRgbCmap</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-rgb-cmap-free" role="function">
<title>gdk_rgb_cmap_free ()</title>
<indexterm zone="gdk-rgb-cmap-free"><primary sortas="rgb_cmap_free">gdk_rgb_cmap_free</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_rgb_cmap_free                   (<link linkend="GdkRgbCmap">GdkRgbCmap</link> *cmap);</programlisting>
<para>
Frees the memory associated with a <link linkend="GdkRgbCmap"><type>GdkRgbCmap</type></link> created by <link linkend="gdk-rgb-cmap-new"><function>gdk_rgb_cmap_new()</function></link>.
</para><variablelist role="params">
<varlistentry><term><parameter>cmap</parameter>&#160;:</term>
<listitem><simpara>The <link linkend="GdkRgbCmap"><type>GdkRgbCmap</type></link> to free.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GdkRgbCmap" role="struct">
<title>GdkRgbCmap</title>
<indexterm zone="GdkRgbCmap"><primary sortas="RgbCmap">GdkRgbCmap</primary></indexterm><programlisting>typedef struct {
  guint32 colors[256];
  gint n_colors;
} GdkRgbCmap;
</programlisting>
<para>
A private data structure which maps color indices to actual RGB
colors. This is used only for <link linkend="gdk-draw-indexed-image"><function>gdk_draw_indexed_image()</function></link>.
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="guint32">guint32</link>&#160;<structfield>colors</structfield>[256];</term>
<listitem><simpara>The colors, represented as 0xRRGGBB integer values.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="gint">gint</link>&#160;<structfield>n_colors</structfield>;</term>
<listitem><simpara>The number of colors in the cmap.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-rgb-gc-set-foreground" role="function" condition="deprecated:">
<title>gdk_rgb_gc_set_foreground ()</title>
<indexterm zone="gdk-rgb-gc-set-foreground" role="deprecated"><primary sortas="rgb_gc_set_foreground">gdk_rgb_gc_set_foreground</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_rgb_gc_set_foreground           (<link linkend="GdkGC">GdkGC</link> *gc,
                                                         <link linkend="guint32">guint32</link> rgb);</programlisting>
<warning><para><literal>gdk_rgb_gc_set_foreground</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Sets the foreground color in <parameter>gc</parameter> to the specified color (or the
closest approximation, in the case of limited visuals).
</para><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara>The <link linkend="GdkGC"><type>GdkGC</type></link> to modify.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>rgb</parameter>&#160;:</term>
<listitem><simpara>The color, represented as a 0xRRGGBB integer value.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-rgb-gc-set-background" role="function" condition="deprecated:">
<title>gdk_rgb_gc_set_background ()</title>
<indexterm zone="gdk-rgb-gc-set-background" role="deprecated"><primary sortas="rgb_gc_set_background">gdk_rgb_gc_set_background</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_rgb_gc_set_background           (<link linkend="GdkGC">GdkGC</link> *gc,
                                                         <link linkend="guint32">guint32</link> rgb);</programlisting>
<warning><para><literal>gdk_rgb_gc_set_background</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Sets the background color in <parameter>gc</parameter> to the specified color (or the
closest approximation, in the case of limited visuals).
</para><variablelist role="params">
<varlistentry><term><parameter>gc</parameter>&#160;:</term>
<listitem><simpara>The <link linkend="GdkGC"><type>GdkGC</type></link> to modify.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>rgb</parameter>&#160;:</term>
<listitem><simpara>The color, represented as a 0xRRGGBB integer value.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-rgb-xpixel-from-rgb" role="function" condition="deprecated:">
<title>gdk_rgb_xpixel_from_rgb ()</title>
<indexterm zone="gdk-rgb-xpixel-from-rgb" role="deprecated"><primary sortas="rgb_xpixel_from_rgb">gdk_rgb_xpixel_from_rgb</primary></indexterm><programlisting><link linkend="gulong">gulong</link>              gdk_rgb_xpixel_from_rgb             (<link linkend="guint32">guint32</link> rgb);</programlisting>
<warning><para><literal>gdk_rgb_xpixel_from_rgb</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Finds the X pixel closest in color to the <parameter>rgb</parameter> color specified. This
value may be used to set the <structfield>pixel</structfield> field of
a <link linkend="GdkColor"><type>GdkColor</type></link> struct.
</para><variablelist role="params">
<varlistentry><term><parameter>rgb</parameter>&#160;:</term>
<listitem><simpara>The color, represented as a 0xRRGGBB integer value.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>The X pixel value.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-rgb-find-color" role="function">
<title>gdk_rgb_find_color ()</title>
<indexterm zone="gdk-rgb-find-color"><primary sortas="rgb_find_color">gdk_rgb_find_color</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_rgb_find_color                  (<link linkend="GdkColormap">GdkColormap</link> *colormap,
                                                         <link linkend="GdkColor">GdkColor</link> *color);</programlisting>
<para>
<parameter>colormap</parameter> should be the colormap for the graphics context and
drawable you're using to draw. If you're drawing to a <link linkend="GtkWidget"><type>GtkWidget</type></link>,
call <link linkend="gtk-widget-get-colormap"><function>gtk_widget_get_colormap()</function></link>.
</para>
<para>
<parameter>color</parameter> should have its <link linkend="red"><literal>red</literal></link>, <link linkend="green"><literal>green</literal></link>, and <link linkend="blue"><literal>blue</literal></link> fields initialized;
<link linkend="gdk-rgb-find-color"><function>gdk_rgb_find_color()</function></link> will fill in the <link linkend="pixel"><literal>pixel</literal></link> field with the best
matching pixel from a color cube. The color is then ready to be
used for drawing, e.g. you can call <link linkend="gdk-gc-set-foreground"><function>gdk_gc_set_foreground()</function></link> which
expects <link linkend="pixel"><literal>pixel</literal></link> to be initialized.
</para>
<para>
In many cases, you can avoid this whole issue by calling
<link linkend="gdk-gc-set-rgb-fg-color"><function>gdk_gc_set_rgb_fg_color()</function></link> or <link linkend="gdk-gc-set-rgb-bg-color"><function>gdk_gc_set_rgb_bg_color()</function></link>, which
do not expect <link linkend="pixel"><literal>pixel</literal></link> to be initialized in advance. If you use those
functions, there's no need for <link linkend="gdk-rgb-find-color"><function>gdk_rgb_find_color()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>colormap</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkColormap"><type>GdkColormap</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>color</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GdkColor"><type>GdkColor</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-rgb-set-install" role="function">
<title>gdk_rgb_set_install ()</title>
<indexterm zone="gdk-rgb-set-install"><primary sortas="rgb_set_install">gdk_rgb_set_install</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_rgb_set_install                 (<link linkend="gboolean">gboolean</link> install);</programlisting>
<para>
If <parameter>install</parameter> is <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>, directs GdkRGB to always install a new "private"
colormap rather than trying to find a best fit with the colors already
allocated. Ordinarily, GdkRGB will install a colormap only if a
sufficient cube cannot be allocated.
</para>
<para>
A private colormap has more colors, leading to better quality display,
but also leads to the dreaded "colormap flashing" effect.
</para><variablelist role="params">
<varlistentry><term><parameter>install</parameter>&#160;:</term>
<listitem><simpara>%TRUE to set install mode.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-rgb-set-min-colors" role="function">
<title>gdk_rgb_set_min_colors ()</title>
<indexterm zone="gdk-rgb-set-min-colors"><primary sortas="rgb_set_min_colors">gdk_rgb_set_min_colors</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_rgb_set_min_colors              (<link linkend="gint">gint</link> min_colors);</programlisting>
<para>
Sets the minimum number of colors for the color cube. Generally,
GdkRGB tries to allocate the largest color cube it can. If it can't
allocate a color cube at least as large as <parameter>min_colors</parameter>, it installs a
private colormap.
</para><variablelist role="params">
<varlistentry><term><parameter>min_colors</parameter>&#160;:</term>
<listitem><simpara>The minimum number of colors accepted.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-rgb-get-visual" role="function">
<title>gdk_rgb_get_visual ()</title>
<indexterm zone="gdk-rgb-get-visual"><primary sortas="rgb_get_visual">gdk_rgb_get_visual</primary></indexterm><programlisting><link linkend="GdkVisual">GdkVisual</link> *         gdk_rgb_get_visual                  (void);</programlisting>
<para>
Gets a "preferred visual" chosen by GdkRGB for rendering image data
on the default screen. In previous versions of GDK, this was the
only visual GdkRGB could use for rendering. In current versions,
it's simply the visual GdkRGB would have chosen as the optimal one
in those previous versions. GdkRGB can now render to drawables with
any visual.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The <link linkend="GdkVisual"><type>GdkVisual</type></link> chosen by GdkRGB.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-rgb-get-colormap" role="function">
<title>gdk_rgb_get_colormap ()</title>
<indexterm zone="gdk-rgb-get-colormap"><primary sortas="rgb_get_colormap">gdk_rgb_get_colormap</primary></indexterm><programlisting><link linkend="GdkColormap">GdkColormap</link> *       gdk_rgb_get_colormap                (void);</programlisting>
<para>
Get the preferred colormap for rendering image data.  Not a
very useful function; historically, GDK could only render RGB image
data to one colormap and visual, but in the current version it can
render to any colormap and visual. So there's no need to call this
function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the preferred colormap
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-rgb-get-cmap" role="macro" condition="deprecated:">
<title>gdk_rgb_get_cmap</title>
<indexterm zone="gdk-rgb-get-cmap" role="deprecated"><primary sortas="rgb_get_cmap">gdk_rgb_get_cmap</primary></indexterm><programlisting>#define gdk_rgb_get_cmap               gdk_rgb_get_colormap
</programlisting>
<warning><para><literal>gdk_rgb_get_cmap</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Gets the colormap set by GdkRGB. This colormap and the corresponding
visual should be used when creating windows that will be drawn in by GdkRGB.
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>The <link linkend="GdkColormap"><type>GdkColormap</type></link> set by GdkRGB.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-rgb-ditherable" role="function">
<title>gdk_rgb_ditherable ()</title>
<indexterm zone="gdk-rgb-ditherable"><primary sortas="rgb_ditherable">gdk_rgb_ditherable</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gdk_rgb_ditherable                  (void);</programlisting>
<para>
Determines whether the preferred visual is ditherable. This function may be
useful for presenting a user interface choice to the user about which
dither mode is desired; if the display is not ditherable, it may make
sense to gray out or hide the corresponding UI widget.
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>%TRUE if the preferred visual is ditherable.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-rgb-colormap-ditherable" role="function">
<title>gdk_rgb_colormap_ditherable ()</title>
<indexterm zone="gdk-rgb-colormap-ditherable"><primary sortas="rgb_colormap_ditherable">gdk_rgb_colormap_ditherable</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gdk_rgb_colormap_ditherable         (<link linkend="GdkColormap">GdkColormap</link> *cmap);</programlisting>
<para>
Determines whether the visual associated with <parameter>cmap</parameter> is ditherable. This
function may be useful for presenting a user interface choice to the user
about which dither mode is desired; if the display is not ditherable, it may
make sense to gray out or hide the corresponding UI widget.
</para><variablelist role="params">
<varlistentry><term><parameter>cmap</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GdkColormap"><type>GdkColormap</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>%TRUE if the visual associated with <parameter>cmap</parameter> is ditherable.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gdk-rgb-set-verbose" role="function">
<title>gdk_rgb_set_verbose ()</title>
<indexterm zone="gdk-rgb-set-verbose"><primary sortas="rgb_set_verbose">gdk_rgb_set_verbose</primary></indexterm><programlisting><link linkend="void">void</link>                gdk_rgb_set_verbose                 (<link linkend="gboolean">gboolean</link> verbose);</programlisting>
<para>
Sets the "verbose" flag. This is generally only useful for debugging.
</para><variablelist role="params">
<varlistentry><term><parameter>verbose</parameter>&#160;:</term>
<listitem><simpara>%TRUE if verbose messages are desired.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>



<refsect1 id="gdk-GdkRGB.see-also">
<title>See Also</title>
<para>
<variablelist>
<varlistentry>
<term><link linkend="GdkColor"><type>GdkColor</type></link></term>
<listitem><para>The underlying GDK mechanism for allocating
colors.</para></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GdkPixbuf"><type>GdkPixbuf</type></link> and <link linkend="gdk-draw-pixbuf"><function>gdk_draw_pixbuf()</function></link></term>
<listitem><para>Higher-level image handling.</para></listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>

</refentry>
