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

Re: Accessing individual pixels



    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))