[comp.windows.x] colour table of an xy image by xwd

gyp@maadfa.ma.adfa.oz.au (Patrick Tang Guan Yaw) (06/13/90)

I am running X11R3 on an apollo DN580 8-bit plane machines.
At the moment, I am trying to get a colour dump using

	% xwd -xy -out pic.xy

so that I can translate that to Encasuplated Colour PostScript.
(Using cxpr, a modified verison of xpr). However, my effort is
not successful on the DN580.  I found out the following,

- xwud of pic.xy give me the correct colours.
- octal dump of pic.xy  using

	% od -hv pic.xy

tell me that there are only two colours on the dump image, namely
red and white, though xwud shows me that there are 256 colours, the
rest of the colours are (0,0,0)??

The following is the first few lines of the octal dump.
0000000  0000 006b 0000 0007 0000 0001 0000 0008
0000020  0000 0259 0000 0259 0000 0000 0000 0001
0000040  0000 0020 0000 0001 0000 0020 0000 0001
0000060  0000 004c 0000 0003 0000 0000 0000 0000
0000100  0000 0000 0000 0008 0000 00fe 0000 00fe
0000120  0000 0259 0000 0259 0000 0000 0000 0000
0000140  0000 0000 7877 6475 6d70 0000 0000 0000
0000160  0000 0000 0007 0000 0000 01ff 0000 0000
0000200  0007 0000 0000 0200 0000 0000 0007 0000
0000220  0000 0300 0000 0000 0007 0000 0000 0400
0000240  0000 0000 0007 0000 0000 0500 0000 0000
0000260  0007 0000 0000 0600 0000 0000 0007 0000
0000300  0000 07ff 00ff 00ff 0007 0000 0000 0800
0000320  0000 0000 0007 0000 0000 0900 0000 0000
0000340  0007 0000 0000 0a00 0000 0000 0007 0000
0000360  0000 0b00 0000 0000 0007 0000 0000 0c00
0000400  0000 0000 0007 0000 0000 0d00 0000 0000
0000420  0007 0000 0000 0e00 0000 0000 0007 0000
0000440  0000 0f00 0000 0000 0007 0000 0000 1000
0000460  0000 0000 0007 0000 0000 1100 0000 0000

Can anyone give me any pointers??
-------
Patrick Tang Guan Yaw,		Phone	 :	+61 6 268 8882
Dept. of Mathematics,	EMAIL-ARPA/CSNET :	gyp@maadfa.ma.adfa.oz.au
ADFA, Canberra, 2600.		UUCP	 :	..!uunet!munnari!maadfa.ma.adfa.oz!gyp
AUSTRALIA			ACSnet   :	gyp@maadfa.ma.adfa.oz

rlr@apollo.HP.COM (Robert Raymond) (06/14/90)

In article <1629@ccadfa.adfa.oz.au>, gyp@maadfa.ma.adfa.oz.au (Patrick
Tang Guan Yaw) writes:
|> 
|> I am running X11R3 on an apollo DN580 8-bit plane machines.
|> At the moment, I am trying to get a colour dump using
|> 
|> 	% xwd -xy -out pic.xy
|> 
|> so that I can translate that to Encasuplated Colour PostScript.
|> (Using cxpr, a modified verison of xpr). However, my effort is
|> not successful on the DN580.  I found out the following,
|> 
|> - xwud of pic.xy give me the correct colours.
|> - octal dump of pic.xy  using
|> 
|> 	% od -hv pic.xy
|> 
|> tell me that there are only two colours on the dump image, namely
|> red and white, though xwud shows me that there are 256 colours, the
|> rest of the colours are (0,0,0)??

If you are running the share mode server, the problem is that X in not
aware of DM colors (or any colors allocated via gpr,ctm).  xwd calls
XQueryColors to get the colors that are used. For colors not allocated
0,0,0 (black) is returned and recorded in the dump file.
xwud displays the correct colors because it ignores the colors
and just dumps the pixel values into the image when the default visual
is the same as the visual when the window was dumped.

Bottom line:  XQueryColor has been changed so that colors not
allocated by X are read from the physical color table.  This fix
will be in the next system release.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Rob Raymond                       Internet: rlr@apollo.hp.com
 Hewlett-Packard GTD East          UUCP:    
{mit-eddie,yale,uw-beaver}!apollo!rlr
 Chelmsford, MA 01824              Phone:    (508) 256-6600