gtk/docs/reference/gdk/tmpl/visuals.sgml

284 lines
5.7 KiB
Plaintext
Raw Normal View History

1999-08-16 18:51:52 +00:00
<!-- ##### SECTION Title ##### -->
Visuals
<!-- ##### SECTION Short_Description ##### -->
Low-level display hardware information
1999-08-16 18:51:52 +00:00
<!-- ##### SECTION Long_Description ##### -->
<para>
A #GdkVisual describes a particular video hardware display format. It includes
information about the number of bits used for each color, the way the bits are
translated into an RGB value for display, and the way the bits are stored in
memory. For example, a piece of display hardware might support 24-bit color,
16-bit color, or 8-bit color; meaning 24/16/8-bit pixel sizes. For a given
pixel size, pixels can be in different formats; for example the "red" element
of an RGB pixel may be in the top 8 bits of the pixel, or may be in the lower
4 bits.
</para>
<para>
There are several standard visuals. The visual returned
by gdk_screen_get_system_visual() is the system's default
visual.
</para>
<para>
A number of functions are provided for determining
the "best" available visual. For the purposes of
making this determination, higher bit depths are
considered better, and for visuals of the same
bit depth, %GDK_VISUAL_PSEUDO_COLOR is preferred at
8bpp, otherwise, the visual types are ranked in the
order of (highest to lowest) %GDK_VISUAL_DIRECT_COLOR,
%GDK_VISUAL_TRUE_COLOR, %GDK_VISUAL_PSEUDO_COLOR,
%GDK_VISUAL_STATIC_COLOR, %GDK_VISUAL_GRAYSCALE,
then %GDK_VISUAL_STATIC_GRAY.
</para>
1999-08-16 18:51:52 +00:00
<!-- ##### SECTION See_Also ##### -->
<para>
2010-10-12 13:45:11 +00:00
1999-08-16 18:51:52 +00:00
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### SECTION Image ##### -->
1999-08-16 18:51:52 +00:00
<!-- ##### STRUCT GdkVisual ##### -->
<para>
The <type>GdkVisual</type> structure contains information about
a particular visual.
</para>
1999-08-16 18:51:52 +00:00
<example id="rgbmask">
<title>Constructing a pixel value from components</title>
<programlisting>
guint
pixel_from_rgb (GdkVisual *visual,
guchar r, guchar b, guchar g)
{
return ((r &gt;&gt; (16 - visual-&gt;red_prec)) &lt;&lt; visual-&gt;red_shift) |
((g &gt;&gt; (16 - visual-&gt;green_prec)) &lt;&lt; visual-&gt;green_shift) |
((r &gt;&gt; (16 - visual-&gt;blue_prec)) &lt;&lt; visual-&gt;blue_shift);
}
</programlisting>
</example>
1999-08-16 18:51:52 +00:00
@parent_instance: inherited portion from #GObject
1999-08-16 18:51:52 +00:00
<!-- ##### ENUM GdkVisualType ##### -->
<para>
A set of values that describe the manner in which the
pixel values for a visual are converted into RGB
values for display.
</para>
@GDK_VISUAL_STATIC_GRAY: Each pixel value indexes a grayscale value directly.
@GDK_VISUAL_GRAYSCALE: Each pixel is an index into a color map that maps pixel
values into grayscale values. The color map can be changed by an application.
@GDK_VISUAL_STATIC_COLOR: Each pixel value is an index into a predefined,
unmodifiable color map that maps pixel values into RGB values.
@GDK_VISUAL_PSEUDO_COLOR: Each pixel is an index into a color map that maps
pixel values into rgb values. The color map can be changed by an application.
@GDK_VISUAL_TRUE_COLOR: Each pixel value directly contains red, green,
and blue components. The <structfield>red_mask</structfield>,
<structfield>green_mask</structfield>, and
<structfield>blue_mask</structfield> fields of the #GdkVisual
structure describe how the components are assembled into a pixel value.
@GDK_VISUAL_DIRECT_COLOR: Each pixel value contains red, green, and blue
components as for %GDK_VISUAL_TRUE_COLOR, but the components are mapped via a
color table into the final output table instead of being converted directly.
1999-08-16 18:51:52 +00:00
<!-- ##### ENUM GdkByteOrder ##### -->
<para>
A set of values describing the possible byte-orders
for storing pixel values in memory.
1999-08-16 18:51:52 +00:00
</para>
@GDK_LSB_FIRST: The values are stored with the least-significant byte
first. For instance, the 32-bit value 0xffeecc would be stored
in memory as 0xcc, 0xee, 0xff, 0x00.
@GDK_MSB_FIRST: The values are stored with the most-significant byte
first. For instance, the 32-bit value 0xffeecc would be stored
in memory as 0x00, 0xcc, 0xee, 0xff.
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_query_depths ##### -->
<para>
1999-08-16 18:51:52 +00:00
</para>
@depths:
@count:
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_query_visual_types ##### -->
<para>
1999-08-16 18:51:52 +00:00
</para>
@visual_types:
@count:
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_list_visuals ##### -->
<para>
1999-08-16 18:51:52 +00:00
</para>
@void:
@Returns:
1999-08-16 18:51:52 +00:00
2010-05-26 02:57:46 +00:00
<!-- ##### FUNCTION gdk_visual_get_bits_per_rgb ##### -->
<para>
</para>
@visual:
@Returns:
<!-- ##### FUNCTION gdk_visual_get_blue_pixel_details ##### -->
<para>
</para>
@visual:
@mask:
@shift:
@precision:
<!-- ##### FUNCTION gdk_visual_get_byte_order ##### -->
<para>
</para>
@visual:
@Returns:
<!-- ##### FUNCTION gdk_visual_get_colormap_size ##### -->
<para>
</para>
@visual:
@Returns:
<!-- ##### FUNCTION gdk_visual_get_depth ##### -->
<para>
</para>
@visual:
@Returns:
<!-- ##### FUNCTION gdk_visual_get_green_pixel_details ##### -->
<para>
</para>
@visual:
@mask:
@shift:
@precision:
<!-- ##### FUNCTION gdk_visual_get_red_pixel_details ##### -->
<para>
</para>
@visual:
@mask:
@shift:
@precision:
<!-- ##### FUNCTION gdk_visual_get_visual_type ##### -->
<para>
</para>
@visual:
@Returns:
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_visual_get_best_depth ##### -->
<para>
1999-08-16 18:51:52 +00:00
</para>
@void:
@Returns:
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_visual_get_best_type ##### -->
<para>
1999-08-16 18:51:52 +00:00
</para>
@void:
@Returns:
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_visual_get_system ##### -->
<para>
1999-08-16 18:51:52 +00:00
</para>
@void:
@Returns:
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_visual_get_best ##### -->
<para>
1999-08-16 18:51:52 +00:00
</para>
@void:
@Returns:
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_visual_get_best_with_depth ##### -->
<para>
1999-08-16 18:51:52 +00:00
</para>
@depth:
@Returns:
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_visual_get_best_with_type ##### -->
<para>
1999-08-16 18:51:52 +00:00
</para>
@visual_type:
@Returns:
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_visual_get_best_with_both ##### -->
<para>
1999-08-16 18:51:52 +00:00
</para>
@depth:
@visual_type:
@Returns:
1999-08-16 18:51:52 +00:00
<!-- ##### FUNCTION gdk_visual_get_screen ##### -->
<para>
</para>
@visual:
@Returns: