Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!bloom-beacon!EXPO.LCS.MIT.EDU!converse From: converse@EXPO.LCS.MIT.EDU (Donna Converse) Newsgroups: comp.windows.x Subject: Re: How to define a default colour map at initialization? Message-ID: <8906301829.AA19726@expo.lcs.mit.edu> Date: 30 Jun 89 18:06:53 GMT References: <505@focsys.UUCP> Sender: daemon@bloom-beacon.MIT.EDU Organization: X Consortium, MIT Laboratory for Computer Science Lines: 43 > I would like X to startup with a different colour map. Specifically, I > want each pixel from 0 - n to be a shade of gray that ranges from > black at 0 to white at n. X will always start up with the same colormap, the default colormap of the screen. You can't change that, and you can't cause the default colormap to come up with some other initial values. But you can change the values of the colormap cells in the default map after you begin your X session, obviously [under visual types which allow read/write allocations] -- you've already done that -- and you can create other colormaps, and direct that they be used by particular applications instead of [or in addition to, on a few machines] the default map. You are describing a standard colormap, the RGB_GRAY_MAP. > It is easy to do this once X is started, my application changes the > colour map. The problem is that all processes that started before I > change the colour map (xterm, uwm, etc) get screwed up. The pixel > that they were using for white (1) is now, very, very dark. So, all > text windows suddenly go black. If you must use the default colormap of the screen for gray scale image processing, insure that the colormap definition takes place before any other clients begin. Create a separate application for colormap definition, and run it in the foreground before any other client runs. Because you only have 16 colormap cells, I recommend that your application create a new colormap, define the values for the color cells, and, because you are running under R2, install it when your application gets the input focus, and uninstall it when you loose the input focus. R3 based applications should not attempt to install or uninstall colormaps. When your image processing application has the input focus, your xterms and other clients will not be displayed in their proper colors. When the mouse pointer moves out of your image processing windows, the xterms and other clients will be displayed in their correct colors, and the image windows will look weird. If I've been too terse please let me know. Donna Converse converse@expo.lcs.mit.edu