[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Accessing individual pixels



I'm using Gworlds to render pixmap images in MCL (that is, pixmaps in the
sense of XPM files generated from X windows that describe all the pixels in
a given rectangle).  After I've set all the individual pixels in my offscreen
Gworld, I use CopyBits to copy them into a window.

I can't find any documentation about direct access to individual pixels in
my Gworld (or its "pixmap").  Currently, I am using the following kluge which
sets all the right pixels, but is probably quite wasteful because of its
repeated calls to PaintRectangle, when all I want to do is set one pixel:

    (ccl:without-interrupts
     (ccl::with-focused-gworld (new-image)
       (dotimes (h height)
         (dotimes (w width)
           (ccl:with-fore-color (aref pixarray h w)
             (ccl::with-rectangle-arg (r w h (1+ w) (1+ h))
               (#_PaintRect r)))))))

Is there a better way to set individual pixels?

Thanks,

--Andrew Mickish