T.R | Title | User | Personal Name | Date | Lines |
---|
1052.1 | | PSW::WINALSKI | Careful with that VAX, Eugene | Tue Jul 04 1989 22:52 | 9 |
| Colors are done on a per-application basis. Applications that don't use private
colormaps allocate color entries out of the default color map and then set them
to the RGB values that they want. For applications that read their color
information out of resource files, one could override the resources in
DECW$XDEFAULTS.DAT. If you look through this conference, you'll find notes
showing how to do that for various widgets and applications.
--PSW
|
1052.2 | | VWSENG::KLEINSORGE | Toys 'R' Us | Wed Jul 05 1989 15:07 | 9 |
|
It sounds like .0 is asking how to cause the default colormap to be
initialized to some default state. So that when applications come
along the colormap has already had some specific allocations and setups
done on it.
Sounds reasonable, have'nt got a clue how to do it :-)
|
1052.3 | | PSW::WINALSKI | Careful with that VAX, Eugene | Wed Jul 05 1989 20:44 | 8 |
| You can do that by creating a small program that allocates entries from the
default color map using XAllocColorCells, sets the desired colors using
XStoreColors, then exits. Have this program run as the first thing in
DECW$LOGIN.COM. The colors that the program sets will stay behind, as long as
no other application allocates the color cells and bashes them.
--PSW
|
1052.4 | | VWSENG::KLEINSORGE | Toys 'R' Us | Wed Jul 05 1989 22:26 | 12 |
|
**NOT** if you want allocate *specific* entries in the colormap. This
might be useful if (say) you were doing a number of applications that
required some specific alignment of the entries for operation without
reformatting the pixel data. Like image operations (for instance) where
say only a small number of colors are used - like 32 or 64.
I have not found a way using the default colormap to do this all the
time.
|
1052.5 | thanks for the responses | CSC32::B_BRADACH | | Thu Jul 06 1989 17:29 | 10 |
| Thanks for all of the responses, I will pass the information onto my
customer. He is indeed attempting to "replace" the default colormap
with his own entries. This will give him some things to try.
thanks again,
bernie
csc/cs
|
1052.6 | Longwinded explanation of standard colormaps | DECWIN::FISHER | Burns Fisher 381-1466, ZKO3-4/W23 | Fri Jul 07 1989 02:11 | 30 |
| Sounds like your customer is after what we call "standard" colormaps.
There is minimal support for this in xlib now. See
XSetStandardColormap. Essentially, the idea is to load a color cube or
a gray ramp into a colormap and then leave some data around on a
property telling which colormap you used, the base, multiplier, and
number of entries for each primary, etc. The application can then
calculate what color index it wants to use rather than having to Alloc
it. Currently the only code that exists to support this is the
routines in XLIB which write and read the property. R4 of MIT's X
will have the session manager set up at least one standard colormap.
So will Display PostScript on VMS and Ultrix.
Just as a hint: There are at least two ways to allocate the colors
for a standard colormap: First, use AllocColorCells with the
contiguous option. Then Store into them what you want in the order you
want them. The second way, a hack but with nicer results, is to use
AllocColor one at a time on the colors you want, and check to see if
they come back contiguous. If so, you are golden. If not, well...
fall back to the old method. MIT is using the latter method. I
suspect it only works well if they get in early before clients have
started running.
However you do it, you need to use a separate connection (i.e.
XOpenDisplay). Create the colors over that connection, then set
shutdown mode to RetainPermanent. Then XCloseDisplay. Voila! Your
colors are still allocated, and other clients can use them.
Burns
|