i took pol's advice and used QCView to bring the .qtz into xcode. i
then used the output image from a patch as an NSImage. i then read
out the pixel values using the NSImage, calculated the average
position of a color and fed it back into a published input in
the .qtz. the only thing i'm going to work on now is to build in some
sort of color tolerance, but i don't really know much about NSColor.
(does anybody know if there is a way of using isEqual: but somehow
building in a tolerance?)
anyway, it works as expected, but performance isn't the greatest. as
a sample i'm feeding a 400x300 quicktime movie @30fps, and it's
pretty jumpy, so i'm only sampling every 30 pixels in the x and y;
since i'm really going for a seemless realtime effect.
i'm assuming your solution will probably perform much better since
you're using the core image kernel. so how is the performance?
-tak.
On Jun 10, 2005, at 7:17 PM, Ralph Brunner wrote:
Actually, there is a sneaky way to make this work -- you can write
an Image Unit that does the color tracking (Quartz Composer
automatically hosts the installed Image Units), and the output of
that Image Unit is a single-pixel size image. That image contains
the found x coordinate in the red, and the y coordinate in the
green component, for example.
Then use that single pixel image and pipe it into a different
kernel that does something interesting with it .. for example
composite a crosshair image at the found location.
It's somewhat limiting, but I got it to work :)
- Ralph