Документ взят из кэша поисковой машины. Адрес оригинального документа : http://hea-www.harvard.edu/RD/saotng/colormap.html
Дата изменения: Unknown
Дата индексирования: Mon Oct 1 23:56:15 2012
Кодировка:

Поисковые слова: южная атлантическая аопнбмйс
SAOtng Colormap Considerations

SAOtng Colormap Considerations

Colormaps ... the final frontier ... in the good old days SAOimage was the only program that actually used the colormap and everyone was happy. Now every program on the desktop -- and even the CDE desktop itself -- tries to allocate as many colors as possible from the central colormap. The result is either that:

Prior to 1.7, SAOtng took the latter route. Our assumption was that you could bring down Netscape before running SAOtng and be happy. But we found that too many people wanted to leave Netscape running under CDE and were unhappy with the performance of SAOtng.

So we implemented the ability to specify pretty precisely how to choose which colormap to use (public or private and if private, which one). And, by default, we use the public colormap. This means that if other processes such as Netscape or even CDE behave reasonably, SAOtng will work well with them.

The scheme is controlled using the -cmapname command line switch (or the SAOTNG_CMAPNAME environment variable) to specify the colormap. If a name other than "default" is specified, then a private colormap is allocated. When allocating a private colormap, one instance of SAOtng will look to see if another SAOtng has allocated the same colormap (i.e., used the same name) and, if so, will share that private colormap.

If the cmapname specification begins with "default", then the default public colormap will be used. In this case, a full specification of how to use the default colormap can be made by means of a bracket syntax:

  
  default[n:m,name]
where "n" is the minimum number of colors that must be allocated or else a private map called "name" is used. The value "m" is the maximum number of colors to allocate. Either or both can be omitted.

With this scheme, you can specify use of the public colormap if a minimum number of colors can be allocated; otherwise a private map will be used. You also can place a limit on the number of colors for SAOtng to use from the public map (making it easier to have multiple instances of SAOtng on the same screen).

The default colormap scheme has been designed so that the public map will be used if 20 colors can be allocated. Otherwise a private map whose name is the same as the title (default: SAOtng) will be used.

If you want to use SAOtng with Netscape and not have colormap flash, then use of the default map is essential. But it also is necessary to limit the number of colors that Netscape uses from the public map. By default, Netscape will take all of the colors, and SAOtng will have to use a private map. But you can set a limit on the number of colors used by Netscape (3.0) with the -ncols command switch or the maxImageColors resource. This resource is described in the Netscape application default file as follows:

! The maximum number of color cells to allocate per image; this is only
! relevant when using the default colormap of a PseudoColor visual.
! If it is 0, we allocate as many colors as we can get.  (The more colors
! that we can allocate, the better images will look.)  This controls only
! the number of colors allocated for internal images - a few more colors
! will be allocated for the fluff and chrome that comes with Motif.
!
*maxImageColors:		0
For use with SAOtng, we have had good results setting this resource to 100:
  netscape -ncols 100
or
  netscape -xrm "*maxImageColors:100"
This will allow SAOtng also to allocate approximately 100 colors for its own use (assuming you have no other color hogs running at the same time).

However, if you are running CDE, then the desktop itself also will use a lot of colors. In this case, try setting Netscape's maxImageColors to 50 or 60 (which is about the minimum number of colors that Netscape will allocate before complaining about the need to dither images). Or, look in the CDE desktop color editor for the place where CDE lets you limit the number of colors that the desktop uses; we heartily recommend that you limits CDE's use of colors.


Last Updated June 14, 1997