home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x
- Path: sparky!uunet!das.wang.com!wang!news
- From: izeek@techunix.technion.ac.il (Ilan Aisic)
- Subject: Re: 256 grayscale levels with standard colormap
- Reply-To: izeek@techunix.technion.ac.il (Ilan Aisic)
- Organization: Technion, Israel Inst. of Technology
- Date: Thu, 3 Sep 1992 19:54:18 GMT
- Message-ID: <1992Sep3.195418.6065@discus.technion.ac.il>
- References: <1992Sep2.040959.16164@walter.cray.com>
- Sender: news@wang.com
- Lines: 51
-
- In article <1992Sep2.040959.16164@walter.cray.com> vincent@cadillac.cray.com (Vincent LE BARAZER) writes:
- >
- > Hi everybodyx,
- >
- > I'd like to create an X application that draw lines of pixels, with
- >color level from 0 to 255 in a Grayscale visual.
- > This application has to work either on 8 planes grayscale servers or
- >on 24 planes color server.
- >
- > My first step was to Create a new colormap, allocate 256 levels of gray
- >pixels ( red = green = blue ), and install this colormap .
- >
- > ... but other X clients running on the same server do not like this new
- >colormap !
- >
- > So , how can I handle 256 gray levels without changing the color map ?
- >I suppose that the Visual type has something to do with this ??....
- > ...
-
- If you want to use a virtual colormap for your window, you will
- get the "colormap flashing" whenever you move your pointer into and out of
- your window (in an 8 planes server). To avoid the "flashing" (when other
- windows appear in false colors), it is recommended that you allocate
- from the default colormap. But then, you will not get 256 colors because
- some (or many) of the cells are already in use.
- If you still cannot get all the colors you need, that is, enough slots,
- and you want to minimize the flashing, I suggest the following approach:
- 1. Create your own virtual colormap.
- 2. If your application only needs grays, assign all the grays
- you need to the upper portion of your colormap.
- 3. Leave as many unused colorcells (in your virtual colormap)
- as possible in the beginning of the colormap.
- 4. If your application also needs other colors, you may want
- to consider copying the content of the first colorcells
- (as many as possible) from the default colormap into your colormap.
- The window manager will continue to switch colormaps,
- but the colormap flashing will be reduced or not visible unless you have
- some other color demanding applications on the screen.
- This is so because the window manager (at least OpenWin), tend
- to use the colors at the beginning of the colormap.
-
- ____
- / / __
- / / /_/ /| /
- __/_ /__ / / / |/ o o o
-
- Ilan Aisic
- Israel USA
- Voice: 972-4-344474 1-914-644-7710
- Fax: 972-4-342492 1-914-644-7763
- E-mail: izeek@techunix.technion.ac.il ilan@allink.com
-