comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: How do you specify a private colormap in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: How do you specify a private colormap in IDL [message #262] Fri, 13 March 1992 10:33
snoopy is currently offline  snoopy
Messages: 6
Registered: March 1992
Junior Member
In article <3757@ucsbcsl.ucsb.edu> terry@esrg.ucsb.edu (Terry Figel) writes:
>
> --
> I read the Manual, I saw the section on private vs shared colormaps,
> how do you specify private....?

I use PV Wave version 3.10 on a SPARC 1 under OpenLook, and the following
information is what I have gathered from use. Since Wave and IDL are
functionally similar (as far as I know) I hope this helps:

Wave chooses the shared colormap whenever possible (Wave User's Guide
p. C-66, Ver.3). All availabe colors (256) are allocated - which can
be verified by doing a print, !d.n_colors or print, !d.table_size.
However, when you open a window, either directly, or through a plot,
contour, or tv command, Wave will not allocate all these colors, because
it reserves 18 colors (on my platform) for other X applications running
simultaneously so that when these applications use the color table for
background, foreground, border coloring, it won't cause conflicts with
Wave while displaying color graphics in its windows.

On the other hand, if you want all the colors possible (256 in my case)
then you would have to specify this explicitly with "window, colors=256"
command. This method will work only if this window is the first one
created in Wave, otherwise you would need to issue a "device,/close"
command and then use the "window,colors=256" command. Incidentally, all
subsequent windows will also be allocated all the available 256 colors.

In any case, the result of this process will be that Wave attempts to
load the requested colors from the shared colormap. But if there are
not enough colors available, it will create a private colormap with the
requested number of colors. In the above illustration, "window,colors=
256" will most certainly cause Wave to load a private colormap.

The result of this operation will be that if you want to see your graphics
with the requested number of colors you will have to move the cursor
into this window. Otherwise, their colors will appear unusual because the
X-11 server (or the windowing system/GUI you use) will have swapped the
hardware color lookup table with its own colormap so that it can go about
with its text, graphics, and other display operations or serve other X
applications. The windowing system in general uses colors from the lower
end of the shared colormap (p. C-65) for border colors, text, foreground,
and background.

Likewise, when you move the cursor into the display window, the rest of
the screen (including text/graphics windows of other applications) may
go black or revert to some other color. This results from the color LUT
being swapped again, this time with Wave's private colormap. Since Wave
assigns darker colors to the lower end of the colormap, the other portions
of the screen will generally tend to appear darker or just plain black.

But the Wave window pointed to by the cursor will appear correctly with
all 256 colors being displayed (depending upon the pixel values/color
values of your image/graph). So as you move the cursor from the Wave text
window to the display window and vice-versa, the color LUT will be swapped
back and forth resulting in a very irritable flashing of the screen. To
avoid this, version 3, and later, of Wave will automatically default to
237 colors (and use the shared colormap, unless the private colormap is
necessitated with the "window,colors=256" command) whenever a window is
opened thus resulting in a wide availability of colors and avoiding the
colormap swapping process.

Mind you, that the colormap does not determine what specific color will
appear for each color value. To explicitly set the colormap values to a
specific color you will have to load a color table using the "tvlct,r,g,b"
command, where r, g, and b specify the red, green, and blue component
of each color (see p.14-8 to 14-11 for a complete discussion). Alter-
natively, Wave has 3 interactive tools for creating/adjusting color tables
(see p. 14-12). Wave also has 16 pre-defined color tables which may be
loaded using the "loadct,table#" command.

> I have another aplication that used 200 color entries, IDL with 39
> color entries looked BAD

In most applications, 256 colors is an overkill since the HVS (Human
Visual System) is incapable of distinguishing all these colors at once.
In general, 32 to 64 well chosen coloring schemes (or color table elements)
will serve even the most demanding (in terms of color/contrast distin-
guishability) problem.

Dissenting or consenting opinions, corrections, and inquiries are welcome.
Send email responses to the following address: ercrav@vegas1.las.epa.gov


Ramesh Viswanathan
Harry Ried Center for Environmental Studies
University of Nevada - Las Vegas
4505 Maryland Parkway
Las Vegas, Nevada 89154


P.S.

All opinions stated are mine (I think) and neither my employer nor I will
assume responsibility for any problems that may arise as a result of my
opinions. Also, the opinions contained in this posting in no way endorses
or suggests the purchase or use of Precision Visual's PV Wave.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: streamline plots in IDL
Next Topic: Moving from PV-Wave to IDL

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:33:27 PDT 2025

Total time taken to generate the page: 0.00409 seconds