]> Pileus Git - ~andy/gtk/blobdiff - docs/reference/gdk/tmpl/rgb.sgml
Make 3.0 parallel-installable to 2.x
[~andy/gtk] / docs / reference / gdk / tmpl / rgb.sgml
index ed9dc697e44a4847f4fa1f7c61b203caaf84c9bc..a60e73980c00ffa32c6bc518c3c857853e37cf96 100644 (file)
@@ -2,7 +2,7 @@
 GdkRGB
 
 <!-- ##### SECTION Short_Description ##### -->
-renders RGB, grayscale, or indexed image data to a #GdkDrawable
+Renders RGB, grayscale, or indexed image data to a GdkDrawable
 
 <!-- ##### SECTION Long_Description ##### -->
 
@@ -12,7 +12,7 @@ colormap images to a #GdkDrawable. 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
 #GdkPixbuf features in place of this module; for example,
-gdk_pixbuf_render_to_drawable() uses GdkRGB in its implementation.
+gdk_draw_pixbuf() uses GdkRGB in its implementation.
 </para>
 
 <para>
@@ -34,13 +34,20 @@ 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>
+<title>A simple example program using GdkRGB</title>
 <programlisting>
-#include &lt;gtk/gtk.h&gt;
+&num;include &lt;gtk/gtk.h&gt;
 
-#define IMAGE_WIDTH    256
-#define IMAGE_HEIGHT   256
+&num;define IMAGE_WIDTH        256
+&num;define IMAGE_HEIGHT       256
 
 guchar rgbbuf[IMAGE_WIDTH * IMAGE_HEIGHT * 3];
 
@@ -67,9 +74,9 @@ main (int argc, char *argv[])
 
   /* Set up the RGB buffer. */
   pos = rgbbuf;
-  for (y = 0; y < IMAGE_HEIGHT; y++)
+  for (y = 0; y &lt; IMAGE_HEIGHT; y++)
     {
-      for (x = 0; x < IMAGE_WIDTH; x++)
+      for (x = 0; x &lt; IMAGE_WIDTH; x++)
        {
          *pos++ = x - x % 32;                  /* Red. */
          *pos++ = (x / 32) * 4 + y - y % 32;   /* Green. */
@@ -90,6 +97,8 @@ on_darea_expose (GtkWidget *widget,
   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>
@@ -105,7 +114,7 @@ colors.</para></listitem>
 </varlistentry>
 
 <varlistentry>
-<term>#GdkPixbuf and gdk_pixbuf_render_to_drawable()</term>
+<term>#GdkPixbuf and gdk_draw_pixbuf()</term>
 <listitem><para>Higher-level image handling.</para></listitem>
 </varlistentry>
 
@@ -113,13 +122,11 @@ colors.</para></listitem>
 
 </para>
 
-<!-- ##### FUNCTION gdk_rgb_init ##### -->
-<para>
-This function no longer does anything at all. It's completely useless
-(and harmless).
-</para>
+<!-- ##### SECTION Stability_Level ##### -->
 
 
+<!-- ##### SECTION Image ##### -->
+
 
 <!-- ##### FUNCTION gdk_draw_rgb_image ##### -->
 <para>
@@ -273,40 +280,18 @@ start of the next.
 <!-- ##### ENUM GdkRgbDither ##### -->
 <para>
 Selects whether or not GdkRGB applies dithering
-to the image on display. There are three values:
-</para>
-
-<itemizedlist>
-
-<listitem>
-<para>
-%GDK_RGB_DITHER_NONE: Never use dithering.
+to the image on display. 
 </para>
-</listitem>
-
-<listitem>
-<para>
-%GDK_RGB_DITHER_NORMAL: Use dithering in 8 bits per pixel (and below)
-only.
-</para>
-</listitem>
-
-<listitem>
-<para>
-%GDK_RGB_DITHER_MAX: Use dithering in 16 bits per pixel and below.
-</para>
-</listitem>
-
-</itemizedlist>
 
 <para>
 Since GdkRGB currently only handles images with 8 bits per component,
 dithering on 24 bit per pixel displays is a moot point.
 </para>
 
-@GDK_RGB_DITHER_NONE: 
-@GDK_RGB_DITHER_NORMAL: 
-@GDK_RGB_DITHER_MAX: 
+@GDK_RGB_DITHER_NONE: Never use dithering.
+@GDK_RGB_DITHER_NORMAL: Use dithering in 8 bits per pixel (and below)
+only.
+@GDK_RGB_DITHER_MAX: Use dithering in 16 bits per pixel and below.
 
 <!-- ##### FUNCTION gdk_rgb_cmap_new ##### -->
 <para>
@@ -335,39 +320,8 @@ A private data structure which maps color indices to actual RGB
 colors. This is used only for gdk_draw_indexed_image().
 </para>
 
-@colors: 
-@n_colors: 
-
-<!-- ##### FUNCTION gdk_rgb_gc_set_foreground ##### -->
-<para>
-Sets the foreground color in @gc to the specified color (or the
-closest approximation, in the case of limited visuals).
-</para>
-
-@gc: The #GdkGC to modify.
-@rgb: The color, represented as a 0xRRGGBB integer value.
-
-
-<!-- ##### FUNCTION gdk_rgb_gc_set_background ##### -->
-<para>
-Sets the background color in @gc to the specified color (or the
-closest approximation, in the case of limited visuals).
-</para>
-
-@gc: The #GdkGC to modify.
-@rgb: The color, represented as a 0xRRGGBB integer value.
-
-
-<!-- ##### FUNCTION gdk_rgb_xpixel_from_rgb ##### -->
-<para>
-Finds the X pixel closest in color to the @rgb color specified. This
-value may be used to set the <structfield>pixel</structfield> field of
-a #GdkColor struct.
-</para>
-
-@rgb: The color, represented as a 0xRRGGBB integer value.
-@Returns: The X pixel value.
-
+@colors: The colors, represented as 0xRRGGBB integer values.
+@n_colors: The number of colors in the cmap.
 
 <!-- ##### FUNCTION gdk_rgb_find_color ##### -->
 <para>
@@ -409,6 +363,7 @@ private colormap.
 <para>
 </para>
 
+@void: 
 @Returns: 
 
 
@@ -417,27 +372,32 @@ private colormap.
 
 </para>
 
+@void: 
 @Returns: 
 
 
-<!-- ##### MACRO gdk_rgb_get_cmap ##### -->
+<!-- ##### FUNCTION gdk_rgb_ditherable ##### -->
 <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.
+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>
 
-@Returns: The #GdkColormap set by GdkRGB.
+@void: 
+@Returns: %TRUE if the preferred visual is ditherable.
 
 
-<!-- ##### FUNCTION gdk_rgb_ditherable ##### -->
+<!-- ##### FUNCTION gdk_rgb_colormap_ditherable ##### -->
 <para>
-Determines whether the 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.
+Determines whether the visual associated with @cmap 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>
 
-@Returns: %TRUE if the visual is ditherable.
+@cmap: a #GdkColormap
+@Returns: %TRUE if the visual associated with @cmap is ditherable.
 
 
 <!-- ##### FUNCTION gdk_rgb_set_verbose ##### -->