Re: Question..
- From: raster redhat com
- To: blizzard appliedtheory com
- cc: michael metal iinet net au, gnome-list gnome org
- Subject: Re: Question..
- Date: Fri, 11 Sep 1998 15:14:58 -0400 (EDT)
On 11 Sep, Christopher Blizzard shouted:
-> Michael O'Reilly wrote:
-> >
-> > Some dumb questions:
-> >
-> > #1. What is a visual? I'm having trouble finding any documentation on
-> > the details of such things.
-> >
->
-> A visual is defined in the Xlib programming manual as:
->
-> "The specifications for color handling for a drawable, including visual
-> class, depth, RGB/Pixel, etc., are collectively referred to as a
-> visual..." Ok, so what this mess means is that a visual is the
-> representation of two really big things: a visual class and the color
-> depth.
->
-> The visual class is a description of the hardware. Basically, the
-> visual class answers two questions:
->
-> o Is the display grayscale, have a single index for color, or have a
-> decomposed index for color?
->
-> o Is the colormap read-only or is it read/write?
->
-> The color depth is something you're probably more familiar with; It's
-> how many colors are supported on a particular display expressed as
-> planes, from 1 to 24, I think.
->
-> A single display has at least one visual but can also support more than
-> one.
->
-> > #2. What exactly does the following code do?
-> >
-> > gnomefe_depth = gdk_visual_get_best_depth();
-> > gnomefe_visual = gdk_visual_get_best_with_depth(gnomefe_depth);
-> >
-> > gtk_widget_set_default_visual(gnomefe_visual);
-> >
->
-> This code basically says "get me the best available depth for my
-> display". Because displays can handle more than one depth, you want the
-> best one. Then it says "get the best visual class with said depth."
-> You want the best visual class for that depth as well. Remember that
-> you can have different visuals at different depths. Then it sets the
-> default visual for the toolkit with the information that it has gathered
-> from the previous calls.
->
-> > #3. Why is this code better/different/worse than the above?
-> >
-> > gtk_widget_push_visual(gdk_imlib_get_visual());
-> > gtk_widget_push_colormap(gdk_imlib_get_colormap());
-> >
->
-> Honestly, I don't know. Raster? Is there any difference? Does imlib
-> play any heuristical games to choose a better colormap/visual than the
-> best?
imlib tries to chose the best - but what it thinks the best is might
not be what gdk/gtk thinks... ie sometiems you have 2 visuals of the
same depth - same attributes - under accelerated X one can be hware
gamma corrected, the other, not. I made damn sure imlib does not go
picking these gamma corrected visual cause my god it can look ugly. I
dont knwo abotu gdk -but it may just pick them by accident.. basically
I dont trust anytone to do it for me - i do it myself.
-> --Chris
->
--
--------------- Codito, ergo sum - "I code, therefore I am" --------------------
raster@rasterman.com /\___ /\ ___/||\___ ____/|/\___ raster@redhat.com
Carsten Haitzler | _ //__\\ __||_ __\\ ___|| _ / Red Hat Advanced
218/21 Conner Drive || // __ \\_ \ | | \ _/_|| / Development Labs
Chapel Hill NC 27514 USA ||\\\/ \//__/ |_| /___/||\\ 919 547 0012 ext 282
+1 (919) 929 9443, 801 4392 For pure Enlightenment http://www.rasterman.com/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]