gtkmm 2.24.2
|
A Gdk::Visual describes a particular video hardware display format. More...
Public Member Functions | |
virtual | ~Visual () |
GdkVisual* | gobj () |
Provides access to the underlying C GObject. | |
const GdkVisual* | gobj () const |
Provides access to the underlying C GObject. | |
GdkVisual* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
Glib::RefPtr< Screen > | get_screen () |
Gets the screen to which this visual belongs. | |
Glib::RefPtr< const Screen > | get_screen () const |
Gets the screen to which this visual belongs. | |
VisualType | get_visual_type () const |
Returns the type of visual this is (PseudoColor, TrueColor, etc). | |
int | get_depth () const |
Returns the bit depth of this visual. | |
ByteOrder | get_byte_order () |
Returns the byte order of this visual. | |
int | get_colormap_size () const |
Returns the size of a colormap for this visual. | |
int | get_bits_per_rgb () const |
Returns the number of significant bits per red, green and blue value. | |
void | get_red_pixel_details (guint32& mask, int&shift, int& precision) const |
Obtains values that are needed to calculate red pixel values in TrueColor and DirectColor. | |
void | get_green_pixel_details (guint32& mask, int&shift, int& precision) const |
Obtains values that are needed to calculate green pixel values in TrueColor and DirectColor. | |
void | get_blue_pixel_details (guint32& mask, int&shift, int& precision) const |
Obtains values that are needed to calculate blue pixel values in TrueColor and DirectColor. | |
Static Public Member Functions | |
static Glib::RefPtr< Visual > | get_system () |
Get the system's default visual for the default GDK screen. | |
static Glib::RefPtr< Visual > | get_best () |
Get the visual with the most available colors for the default GDK screen. | |
static Glib::RefPtr< Visual > | get_best (int depth) |
Get the best visual with depth depth for the default GDK screen. | |
static Glib::RefPtr< Visual > | get_best (VisualType visual_type) |
Get the best visual of the given visual_type for the default GDK screen. | |
static Glib::RefPtr< Visual > | get_best (int depth, VisualType visual_type) |
Combines get_best_with_depth() and get_best_with_type(). | |
static int | get_best_depth () |
Get the best available depth for the default GDK screen. | |
static VisualType | get_best_type () |
Return the best available visual type for the default GDK screen. | |
Protected Member Functions | |
Visual () | |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr< Gdk::Visual > | wrap (GdkVisual* object, bool take_copy=false) |
A Glib::wrap() method for this object. |
A Gdk::Visual 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.
Usually you can avoid thinking about visuals in GTK+. Visuals are useful to interpret the contents of a GdkImage, but you should avoid Gdk::Image precisely because its contents depend on the display hardware; use Gdk::Pixbuf instead, for all but the most low-level purposes. Also, anytime you provide a Gdk::Colormap, the visual is implied as part of the colormap (Gdk::Colormap::get_visual()), so you won't have to provide a visual in addition.
There are several standard visuals. The visual returned by get_system() is the system's default visual. get_visual() returns the visual most suited to displaying full-color image data. If you use the calls in Gdk::RGB, you should create your windows using this visual (and the colormap returned by Gdk::Rgb::get_colormap()).
A number of methods 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.
virtual Gdk::Visual::~Visual | ( | ) | [virtual] |
Gdk::Visual::Visual | ( | ) | [protected] |
static Glib::RefPtr<Visual> Gdk::Visual::get_best | ( | ) | [static] |
Get the visual with the most available colors for the default GDK screen.
The return value should not be freed.
static Glib::RefPtr<Visual> Gdk::Visual::get_best | ( | int | depth, |
VisualType | visual_type | ||
) | [static] |
Combines get_best_with_depth() and get_best_with_type().
depth | A bit depth. |
visual_type | A visual type. |
0
if none. static Glib::RefPtr<Visual> Gdk::Visual::get_best | ( | int | depth | ) | [static] |
Get the best visual with depth depth for the default GDK screen.
Color visuals and visuals with mutable colormaps are preferred over grayscale or fixed-colormap visuals. The return value should not be freed. 0
may be returned if no visual supports depth.
depth | A bit depth. |
static Glib::RefPtr<Visual> Gdk::Visual::get_best | ( | VisualType | visual_type | ) | [static] |
Get the best visual of the given visual_type for the default GDK screen.
Visuals with higher color depths are considered better. The return value should not be freed. 0
may be returned if no visual has type visual_type.
visual_type | A visual type. |
static int Gdk::Visual::get_best_depth | ( | ) | [static] |
Get the best available depth for the default GDK screen.
"Best" means "largest," i.e. 32 preferred over 24 preferred over 8 bits per pixel.
static VisualType Gdk::Visual::get_best_type | ( | ) | [static] |
Return the best available visual type for the default GDK screen.
int Gdk::Visual::get_bits_per_rgb | ( | ) | const |
Returns the number of significant bits per red, green and blue value.
void Gdk::Visual::get_blue_pixel_details | ( | guint32 & | mask, |
int & | shift, | ||
int & | precision | ||
) | const |
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.
mask | A pointer to a #guint32 to be filled in, or 0 . |
shift | A pointer to a int to be filled in, or 0 . |
precision | A pointer to a int to be filled in, or 0 . |
ByteOrder Gdk::Visual::get_byte_order | ( | ) |
Returns the byte order of this visual.
int Gdk::Visual::get_colormap_size | ( | ) | const |
Returns the size of a colormap for this visual.
int Gdk::Visual::get_depth | ( | ) | const |
void Gdk::Visual::get_green_pixel_details | ( | guint32 & | mask, |
int & | shift, | ||
int & | precision | ||
) | const |
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.
mask | A pointer to a #guint32 to be filled in, or 0 . |
shift | A pointer to a int to be filled in, or 0 . |
precision | A pointer to a int to be filled in, or 0 . |
void Gdk::Visual::get_red_pixel_details | ( | guint32 & | mask, |
int & | shift, | ||
int & | precision | ||
) | const |
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.
mask | A pointer to a #guint32 to be filled in, or 0 . |
shift | A pointer to a int to be filled in, or 0 . |
precision | A pointer to a int to be filled in, or 0 . |
Glib::RefPtr<Screen> Gdk::Visual::get_screen | ( | ) |
Gets the screen to which this visual belongs.
Glib::RefPtr<const Screen> Gdk::Visual::get_screen | ( | ) | const |
Gets the screen to which this visual belongs.
static Glib::RefPtr<Visual> Gdk::Visual::get_system | ( | ) | [static] |
Get the system's default visual for the default GDK screen.
This is the visual for the root window of the display. The return value should not be freed.
VisualType Gdk::Visual::get_visual_type | ( | ) | const |
Returns the type of visual this is (PseudoColor, TrueColor, etc).
const GdkVisual* Gdk::Visual::gobj | ( | ) | const [inline] |
Provides access to the underlying C GObject.
Reimplemented from Glib::ObjectBase.
GdkVisual* Gdk::Visual::gobj | ( | ) | [inline] |
Provides access to the underlying C GObject.
Reimplemented from Glib::ObjectBase.
GdkVisual* Gdk::Visual::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Glib::RefPtr< Gdk::Visual > wrap | ( | GdkVisual * | object, |
bool | take_copy = false |
||
) | [related] |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |