[comp.windows.x] DirectColor from xwd?

rob@redcloud.ucar.edu (Robert P. Montgomery) (05/24/89)

Would someone please describe the DirectColor/TrueColor data format from
an xwd dump.  (I wish to convert output from an Ardent Titan to another
format.)

Thanks,

Rob Montgomery		(rob@ncar.ucar.edu)


By the way, here is an example table of header values from a 3308850 byte-
long file:

 window_name      :     Dore Window 
 header_size      :       114     file_version     :         7
 pixmap_format    :   ZPixmap     pixmap_depth     :        24
 pixmap_width     :       907     pixmap_height    :       912
 xoffset          :         0     byte_order       :  MSBFirst
 bitmap_unit      :        32     bitmap_bit_order :  MSBFirst
 bitmap_pad       :        32     bits_per_pixel   :        32
 bytes_per_line   :      3628     visual_class     :         5
 red_mask         :  16711680     green_mask       :     65280
 blue_mask        :       255     bits_per_rgb     :        24
 colormap_entries :       256     ncolors          :         0
 window_width     :       910     window_height    :       910
 window_x         :         0     window_y         :         0
 window_bdrwidth  :         1

National Center for Atmospheric Research         /    \ /  \   /\
P.O. Box 3000    Boulder, CO  80307-3000        /      \    \ /  \
Machine: (303) 494-5142                        /        \    \    \ ___
Office: (303) 497-1832   rob@ncar.ucar.edu    /      N  C  A  R    \| |

rws@EXPO.LCS.MIT.EDU (05/24/89)

    Would someone please describe the DirectColor/TrueColor data format from
    an xwd dump.  (I wish to convert output from an Ardent Titan to another
    format.)

The data values in the image are pixels, just like for any other format.
You can use the red/green/blue_mask values in the header to decompose
the pixels into separate primaries.  In the case of DirectColor, the R3
xwd doesn't provide you with the colormap contents, so you just have to
assume that it's a direct ramp the same as TrueColor, that only gamma
correction was involved.  The R4 xwd will provide you the colormap contents.