[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: device,decomposed=0



David Fanning wrote:
> 
> But, of course, what you *really* want to know is the
> type of color visual, the depth of the display, and
> whether color decomposition is turned on or off at this
> particular moment. All of this information is now available
> in IDL 5.2 via keywords to the DEVICE command. If everyone
> would just upgrade to IDL 5.2, we would have the color
> situation licked. :-)

I have not installed 5.2 yet but the only new keyword I can see in 
the "What's New" guide is GET_DECOMPOSED, are there others?. 

I'm presuming DEVICE still works in the same way and connects to the X 
server if no connection is already open? IDL uses its default visual and
returns info on this - if the visual you ask for is not available IDL
will
silently choose another.

With X it is possible to determine what visuals are available, the
colour 
depths and all sorts of other information in exactly the same way that 
xdpyinfo does. It can be done independently of the IDL graphics window, 
so no connection is made by IDL to the X server. It's really just a 
question of querying the X server and asking it what visuals it
supports. 
What is required is to make this information available within IDL so you 
can then decide what visual you want in a request to DEVICE. 

What I have done is to develop a DLM which returns the list of matching 
available visuals  e.g. to find all the 8 bit visuals I can ask:

result=XVISUAL(depth=8)

or to get the list of 24 bit TrueColor visuals:

result=XVISUAL(depth=24,class='truecolor')

and it will return an array of structures, one per matching visual 
with the details of that visual - id, class, depth colormap_size etc.

So, you can tailor your code according to the visual, and use a
DirectColor
or PseudoColor visual if one is available, otherwise use a TrueColor
and a non-decomposed colour table, if that's how you want to use colour.

Of course, this only works for IDL 5.1 and above because that's when
DLMs
were introduced, but the DSO can easily be used by LINKIMAGE (and it
goes
without saying it requires X and UNIX).

-- 
-----------------------------------------------------------
Nigel Wade, System Administrator, Space Plasma Physics Group,
            University of Leicester, Leicester, LE1 7RH, UK 
E-mail :    nmw@ion.le.ac.uk 
Phone :     +44 (0)116 2523568, Fax : +44 (0)116 2523555