Lisp HUG Maillist Archive

color and pixel types + loop optimization

Folks,

I would like to optimize the loop below and use the for .. <type> =
form to retrieve color and pixel. This seems to require me to specify
the type for color and pixel, etc. I figure that the color type is
color::rgb (:rgb) but what is the type returned by
gp:image-access-pixel?

    Thanks, Joel

P.S.
		  (loop for x fixnum from 0 below width
		     for tx fixnum from ty by 4 
		     for tr fixnum = tx 
		     for tg fixnum = (1+ tr)
		     for tb fixnum = (1+ tg)
		     for ta fixnum = (1+ tb) do
		       (let* ((pixel (gp:image-access-pixel image-access x y))
			      (color (color:unconvert-color port pixel))
			      (mask-pixel (gp:image-access-pixel mask-access x y))
			      (mask-color (color:unconvert-color port mask-pixel))
			      )

-- 
http://wagerlabs.com/ 
New generation of poker room software


Re: color and pixel types + loop optimization

This is what I get on Mac OSX. 

(setf v (make-instance 'capi:output-pane))
(setf external-image (gp:read-external-image "~/temp/Lobby.jpg"))
(setf access (gp:make-image-access v image))
(gp:image-access-transfer-from-image access)

(setf pixel (gp:image-access-pixel access 0 0))
#S(COLOR::COCOA-COLOR :RGBA #(0.015686275 0.45882353 0.70980394 1.0)
:PIXEL32 74823167)

On Windows XP the returned value is something else entirely. What is
the type of a S-EXP?

    Thanks, Joel

-- 
http://wagerlabs.com/ 
New generation of poker room software


Updated at: 2020-12-10 08:53 UTC