Home »
Public Forums »
archive »
More on color sharing
More on color sharing [message #9190] |
Mon, 09 June 1997 00:00 |
Daniel Lang
Messages: 2 Registered: May 1997
|
Junior Member |
|
|
Hello (again).
Question:
Can I control the size IDL thinks the its color table is? (!D.N_COLORS
variable)
Background:
About 2 weeks ago I posted a message about sharing colors in IDL. Going
by the lack of response I guess nobody else has been silly enough to
believe that it is possible.
I have since figured out a way of doing it, using X lib functions to
allocate some read only colors. X lib has a concept of shared (read
only) colors. If the same read only color is requested by more than one
application, X will only use 1 color cell. (the color will not be freed
until all the applications using it finish)
So my basic method is:
- start IDL
- Call a c function to allocate colors
- Create my own translation table using those colors
- Happily use those colors
This is all find and wonderful, until I would like to have a translation
table which contains read only AND read write (Normal IDL colors).
If I run WINDOW, COLORS=16 (which normally would allocate 16 colors),
it does precisely nothing, because it has decided that I am running a
static color map (IDL's approximation of read only colors)
If I first allocate the 16 read write colors, and then allocate 4 read
only colors - it will only work if I set the translation table for the
read only colors to less than 15. (Which is pointless since it we loose
some of the read-write colors)
I *think* the problem could be solved if I could change the system
variable which says what the size of the color table is (!D.N_COLORS or
!D.TABLE_SIZE). Does anybody have any ideas?
Daniel.
|
|
|
Current Time: Wed Oct 08 17:26:23 PDT 2025
Total time taken to generate the page: 0.00422 seconds