[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Accessing individual pixels
- To: Andrew Newell Mickish <am2q+@andrew.cmu.edu>
- Subject: Re: Accessing individual pixels
- From: Michael Travers <mt@media.mit.edu>
- Date: Wed, 18 May 94 19:20:49 -0400
- Cc: info-mcl@ministry.cambridge.apple.com
- In-reply-to: Your message of "Wed, 18 May 94 15:31:45 EDT." <YhqaoVu00WB70DQEoW@andrew.cmu.edu>
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?
(with-rgb (rgb (aref pixarray h w)
(#_SetCPixel w h rgb))