Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!jarthur!usc!snorkelwacker!bloom-beacon!kelly.UUCP!marvin From: marvin@kelly.UUCP (Kyle Marvin) Newsgroups: comp.windows.x Subject: Re: Colormap Size of DirectColor Visual Message-ID: <9005291438.AA16727@kelly.com> Date: 29 May 90 14:38:47 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 28 > Xdpyinfo reports that the DirectColor visual on a Sun has 8 colormap > entries. Yet I can store 256 colors with XStoreColors. Can someone > explain this "apparent" discrepency? Xlib documentation says the following about the Visual structure: "The map_entries member defines the number of available colormap entries in a newly created colormap. For DirectColor or TrueColor, this is the size of an individual pixel subfield." In other words, a 3/3/2 DirectColor visual (as on the Sun server) will advertise 8 (2^^3) entries since that is the number of discrete values for a given color channel. A common application bug I've seen is to use the XDisplayCells (which uses the map_entries member) function to determine the total number of colormap entries. If the default visual on the server is TrueColor or DirectColor, the application thinks that the number of colormap entries is much smaller than the actual number that exist. Try running "xmag" or "xshowcmap" with a server started with the "-cc 5" option and see what happens. A better approach might be to use 2 raised to the XDisplayPlanes() power to determine the total colormap size, although there are no guarantees that this many cells are actually *writable* by the application. Kyle W. Marvin Visual Information Technologies, Inc. (VITec) UUCP: uunet!convex!vitsun!marvin