[comp.windows.x] Querying pixels

kasdan@cunixb.cc.columbia.edu (John Kasdan) (12/28/89)

I have been trying to implement the fast Mandelbrot algorithm on
a VAX 3100 running DECwindows, which I believe to be a version of
X-windows. What I need to do is draw various filled-in circles and
keep track of what points have been filled in. Since the XFillArc
command draws and fills these circles much faster than any algorithm I
have been able to write, I thought I would use the pixels to keep
track of what I have already filled in. The problem is, I can't figure
out how to query a pixel. The only relevant function I've found in
the DEC CD-rom documentation is XGetPixel, which works on images.
Apparently I'm not doing the right thing to get an image from my
display using XGetImage, or something. Can anyone help me with this? I
would appreciate code fragments which I could copy, but suggestions or 
references would also be appreciated.

If this is the wrong forum on which to ask such a question, I
apologize but there are no local gurus known to me and I have no one
else to ask.

_________________
/KAS            
                
John Kasdan             internet: kasdan@cunixd.cc.columbia.edu
Columbia University,    bitnet: kasdan@cunixC.cc.columbia.edu
  School of Law         uucp: 
435 West 116th St.        {rutgers,seismo,topaz}!columbia!cunixd!kasdan
New York, NY 10027
_________________
"Life is like an analogy",  anonymous project leader.

rws@EXPO.LCS.MIT.EDU (Bob Scheifler) (12/29/89)

    I thought I would use the pixels to keep
    track of what I have already filled in. The problem is, I can't figure
    out how to query a pixel.

Any algorithm which depends on reading pixel data back from the server
is a bad algorithm.  It is horribly expensive to do round-trips to the
server like this, particularly for individual pixels.  Also, if you
are trying to read from a window, you have no guarantee of getting
correct data (due to being obscured by other windows, with no guarantee
of backing store).  So, although I could tell you how to query a pixel,
you're better off not knowing. :-)

    If this is the wrong forum on which to ask such a question,

It's exactly the right place to ask such a question.

kasdan@cunixb.cc.columbia.edu (John Kasdan) (12/29/89)

I am truly amazed! I posted my question late this morning and by now
(5:45 P.M.) have had two mail and one posted response which not only
told me how to query my pixels but also, and more importantly, told me 
why NOT to query my pixels. I have tried out the first and found the
truth of the second. This is a remarkably efficient group.
Thanks to all of you!

_________________
/KAS            
                
John Kasdan             internet: kasdan@cunixd.cc.columbia.edu
Columbia University,    bitnet: kasdan@cunixC.cc.columbia.edu
  School of Law         uucp: 
435 West 116th St.        {rutgers,seismo,topaz}!columbia!cunixd!kasdan
New York, NY 10027
_________________
"Life is like an analogy",  anonymous project leader.
_________________
/KAS            
                
John Kasdan             internet: kasdan@cunixd.cc.columbia.edu
Columbia University,    bitnet: kasdan@cunixC.cc.columbia.edu
  School of Law         uucp: 
435 West 116th St.        {rutgers,seismo,topaz}!columbia!cunixd!kasdan
New York, NY 10027
_________________
"Life is like an analogy",  anonymous project leader.