[comp.graphics] Fwd: How to get RGB values from XImage Data

who@portia.Stanford.EDU (Doiknow Liu) (08/31/89)

Newsgroups: comp.graphics
Subject: Fwd:How to get RGB values from XImage data?
Expires: 
References: 
Sender: 
Reply-To: luj@delta.ecn.purdue.edu
Followup-To: 
Distribution: world
Organization: Stanford University
Keywords: XImage, RGB values, color map

I'm helping a friend to post the following article. Please reply to 
his account:    
	ARPAnet:	luj@delta.ecn.purdue.edu
	UUCP:		pur-ee!luj
	
------------------------------------------------------------------
 
Hello, netters,

I'm a X-novice and I'm also new to graphics.   I need to know how
to  get  RGB  values  from the XImage data created by "xwd". This
might be an old question having been discussed before. Sorry   if
this is a repetition.

To let you understand better where the problem lies, I'll briefly
describe what I'm doing.

Recently we got a Titan from Ardent Computer  Co.   Titan  is   a
supermini  graphics  computer  running  under  AT&T System V.  It
supports X11(R2) window system  and a 24-plane DirectColor visual
display  ,   and  has  a  graphics library Dore' built on the top
of X.  We have  built  ,  using  Dore',  a  dynamic  renderer  to
simulate  a  simple  battlefield   scene  consisting of a tank, a
tree, a house and flat "terrain".  What we need to do next is  to
pass  the   image   to   an  image    processor  to  extract  the
information about the target and track the target.

Ideally I'd like to have the image processor to directly   access
the  image  data stored in the frame buffer(or some other device?
-- I don't quite understand the tigr( Titan graphics  hardware  )
yet)   in  order  to  avoid  the  overhead  incurred  in  sending
requests(XGetImage)to X server or writing/reading data to/from  a
disk  file.   But  accessing frame buffer directly requires quite
lot of understanding  of the graphics hardware  and   I'm  hoping
that  someday  in  the  near future Ardent will come up with some
solutions.( Can someone on  the  net  shed  some  light  on  this
problem ?)

As a first step to pass the pixel data to the image processor,  I
used  the  command   level utility -- xclient "xwd" -- to dump an
image to a disk file.  Now the problem is how to  get  pixel  RGB
values  from  the  XImage data in the file.  Could someone please
tell me  how the  "((XImage)image)-> data " is REPRESENTED ?  Are
there  any routines in the public domain that enable me to do the
conversion from the XImage data  to RGB values ?

Any suggestions and help would be appreciated.

        Stanley J. Lu
        School of Aeronautics and Astronautics
        Purdue University
        West Lafayette, IN 47907
        Phone:(317)494-7864
        ARPAnet: luj@ecn.purdue.edu
        UUCP:	pur-ee!luj
        #include <stddisclaimer.h>