| Top |
| void | cdk_query_depths () |
| void | cdk_query_visual_types () |
| GList * | cdk_list_visuals () |
| gint | cdk_visual_get_bits_per_rgb () |
| void | cdk_visual_get_blue_pixel_details () |
| CdkByteOrder | cdk_visual_get_byte_order () |
| gint | cdk_visual_get_colormap_size () |
| gint | cdk_visual_get_depth () |
| void | cdk_visual_get_green_pixel_details () |
| void | cdk_visual_get_red_pixel_details () |
| CdkVisualType | cdk_visual_get_visual_type () |
| gint | cdk_visual_get_best_depth () |
| CdkVisualType | cdk_visual_get_best_type () |
| CdkVisual * | cdk_visual_get_system () |
| CdkVisual * | cdk_visual_get_best () |
| CdkVisual * | cdk_visual_get_best_with_depth () |
| CdkVisual * | cdk_visual_get_best_with_type () |
| CdkVisual * | cdk_visual_get_best_with_both () |
| CdkScreen * | cdk_visual_get_screen () |
A CdkVisual 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.
There are several standard visuals. The visual returned by
cdk_screen_get_system_visual() is the system’s default visual, and
the visual returned by cdk_screen_get_rgba_visual() should be used for
creating windows with an alpha channel.
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,
CDK_VISUAL_PSEUDO_COLOR is preferred at 8bpp, otherwise, the visual
types are ranked in the order of(highest to lowest)
CDK_VISUAL_DIRECT_COLOR, CDK_VISUAL_TRUE_COLOR,
CDK_VISUAL_PSEUDO_COLOR, CDK_VISUAL_STATIC_COLOR,
CDK_VISUAL_GRAYSCALE, then CDK_VISUAL_STATIC_GRAY.
void cdk_query_depths (gint **depths,gint *count);
cdk_query_depths has been deprecated since version 3.22 and should not be used in newly-written code.
Visual selection should be done using
cdk_screen_get_system_visual() and cdk_screen_get_rgba_visual()
This function returns the available bit depths for the default
screen. It’s equivalent to listing the visuals
(cdk_list_visuals()) and then looking at the depth field in each
visual, removing duplicates.
The array returned by this function should not be freed.
void cdk_query_visual_types (CdkVisualType **visual_types,gint *count);
cdk_query_visual_types has been deprecated since version 3.22 and should not be used in newly-written code.
Visual selection should be done using
cdk_screen_get_system_visual() and cdk_screen_get_rgba_visual()
This function returns the available visual types for the default
screen. It’s equivalent to listing the visuals
(cdk_list_visuals()) and then looking at the type field in each
visual, removing duplicates.
The array returned by this function should not be freed.
GList *
cdk_list_visuals (void);
cdk_list_visuals has been deprecated since version 3.22 and should not be used in newly-written code.
Use cdk_screen_list_visuals (cdk_screen_get_default()).
Lists the available visuals for the default screen.
(See cdk_screen_list_visuals())
A visual describes a hardware image data format.
For example, a visual might support 24-bit color, or 8-bit color,
and might expect pixels to be in a certain format.
Call g_list_free() on the return value when you’re finished with it.
gint
cdk_visual_get_bits_per_rgb (CdkVisual *visual);
cdk_visual_get_bits_per_rgb has been deprecated since version 3.22. and should not be used in newly-written code.
Use cdk_visual_get_red_pixel_details() and its variants to
learn about the pixel layout of TrueColor and DirectColor visuals
Returns the number of significant bits per red, green and blue value.
Not all CDK backend provide a meaningful value for this function.
Since: 2.22
void cdk_visual_get_blue_pixel_details (CdkVisual *visual,guint32 *mask,gint *shift,gint *precision);
Obtains values that are needed to calculate blue pixel values in TrueColor and DirectColor. The “mask” is the significant bits within the pixel. The “shift” is the number of bits left we must shift a primary for it to be in position (according to the "mask"). Finally, "precision" refers to how much precision the pixel value contains for a particular primary.
visual |
||
mask |
A pointer to a guint32 to be filled in, or |
[out][allow-none] |
shift |
A pointer to a gint to be filled in, or |
[out][allow-none] |
precision |
A pointer to a gint to be filled in, or |
[out][allow-none] |
Since: 2.22
CdkByteOrder
cdk_visual_get_byte_order (CdkVisual *visual);
cdk_visual_get_byte_order has been deprecated since version 3.22 and should not be used in newly-written code.
This information is not useful
Returns the byte order of this visual.
The information returned by this function is only relevant when working with XImages, and not all backends return meaningful information for this.
Since: 2.22
gint
cdk_visual_get_colormap_size (CdkVisual *visual);
cdk_visual_get_colormap_size has been deprecated since version 3.22 and should not be used in newly-written code.
This information is not useful, since CDK does not provide APIs to operate on colormaps.
Returns the size of a colormap for this visual.
You have to use platform-specific APIs to manipulate colormaps.
Since: 2.22
gint
cdk_visual_get_depth (CdkVisual *visual);
Returns the bit depth of this visual.
Since: 2.22
void cdk_visual_get_green_pixel_details (CdkVisual *visual,guint32 *mask,gint *shift,gint *precision);
Obtains values that are needed to calculate green pixel values in TrueColor and DirectColor. The “mask” is the significant bits within the pixel. The “shift” is the number of bits left we must shift a primary for it to be in position (according to the "mask"). Finally, "precision" refers to how much precision the pixel value contains for a particular primary.
visual |
||
mask |
A pointer to a guint32 to be filled in, or |
[out][allow-none] |
shift |
A pointer to a gint to be filled in, or |
[out][allow-none] |
precision |
A pointer to a gint to be filled in, or |
[out][allow-none] |
Since: 2.22
void cdk_visual_get_red_pixel_details (CdkVisual *visual,guint32 *mask,gint *shift,gint *precision);
Obtains values that are needed to calculate red pixel values in TrueColor and DirectColor. The “mask” is the significant bits within the pixel. The “shift” is the number of bits left we must shift a primary for it to be in position (according to the "mask"). Finally, "precision" refers to how much precision the pixel value contains for a particular primary.
visual |
||
mask |
A pointer to a guint32 to be filled in, or |
[out][allow-none] |
shift |
A pointer to a gint to be filled in, or |
[out][allow-none] |
precision |
A pointer to a gint to be filled in, or |
[out][allow-none] |
Since: 2.22
CdkVisualType
cdk_visual_get_visual_type (CdkVisual *visual);
Returns the type of visual this is (PseudoColor, TrueColor, etc).
Since: 2.22
gint
cdk_visual_get_best_depth (void);
cdk_visual_get_best_depth has been deprecated since version 3.22 and should not be used in newly-written code.
Visual selection should be done using
cdk_screen_get_system_visual() and cdk_screen_get_rgba_visual()
Get the best available depth for the default CDK screen. “Best” means “largest,” i.e. 32 preferred over 24 preferred over 8 bits per pixel.
CdkVisualType
cdk_visual_get_best_type (void);
cdk_visual_get_best_type has been deprecated since version 3.22 and should not be used in newly-written code.
Visual selection should be done using
cdk_screen_get_system_visual() and cdk_screen_get_rgba_visual()
Return the best available visual type for the default CDK screen.
CdkVisual *
cdk_visual_get_system (void);
cdk_visual_get_system has been deprecated since version 3.22 and should not be used in newly-written code.
Use cdk_screen_get_system_visual (cdk_screen_get_default()).
Get the system’s default visual for the default CDK screen. This is the visual for the root window of the display. The return value should not be freed.
CdkVisual *
cdk_visual_get_best (void);
cdk_visual_get_best has been deprecated since version 3.22 and should not be used in newly-written code.
Visual selection should be done using
cdk_screen_get_system_visual() and cdk_screen_get_rgba_visual()
Get the visual with the most available colors for the default CDK screen. The return value should not be freed.
CdkVisual *
cdk_visual_get_best_with_depth (gint depth);
cdk_visual_get_best_with_depth has been deprecated since version 3.22 and should not be used in newly-written code.
Visual selection should be done using
cdk_screen_get_system_visual() and cdk_screen_get_rgba_visual()
Get the best visual with depth depth
for the default CDK screen.
Color visuals and visuals with mutable colormaps are preferred
over grayscale or fixed-colormap visuals. The return value should
not be freed. NULL may be returned if no visual supports depth
.
CdkVisual *
cdk_visual_get_best_with_type (CdkVisualType visual_type);
cdk_visual_get_best_with_type has been deprecated since version 3.22 and should not be used in newly-written code.
Visual selection should be done using
cdk_screen_get_system_visual() and cdk_screen_get_rgba_visual()
Get the best visual of the given visual_type
for the default CDK screen.
Visuals with higher color depths are considered better. The return value
should not be freed. NULL may be returned if no visual has type
visual_type
.
CdkVisual * cdk_visual_get_best_with_both (gint depth,CdkVisualType visual_type);
cdk_visual_get_best_with_both has been deprecated since version 3.22 and should not be used in newly-written code.
Visual selection should be done using
cdk_screen_get_system_visual() and cdk_screen_get_rgba_visual()
Combines cdk_visual_get_best_with_depth() and
cdk_visual_get_best_with_type().
typedef struct _CdkVisual CdkVisual;
A CdkVisual contains information about a particular visual.
A set of values that describe the manner in which the pixel values for a visual are converted into RGB values for display.
|
Each pixel value indexes a grayscale value directly. |
||
|
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. |
||
|
Each pixel value is an index into a predefined, unmodifiable color map that maps pixel values into RGB values. |
||
|
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. |
||
|
Each pixel value directly contains red, green,
and blue components. Use |
||
|
Each pixel value contains red, green, and blue
components as for |
A set of values describing the possible byte-orders for storing pixel values in memory.
|
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. |
||
|
The values are stored with the most-significant byte first. For instance, the 32-bit value 0xffeecc would be stored in memory as 0x00, 0xff, 0xee, 0xcc. |