In Cocoa, how do you apply a QuartzComposer patch effect to an NSImage?

324 Views Asked by At

I'm not trying to create a series of QC effects, I just want to use the Tracer effect. Do I have to create the QC thing and then apply that, or can I call it directly in Cocoa?

2

There are 2 best solutions below

0
On BEST ANSWER

There are several ways to do this, depending on what you want to do with the resulting image. The simplest thing is to just include a QCView into your UI, and run whatever composition you want inside of it. If you want to operate on images and save the results, then you probably want to use CoreImage filters.

There's a handy list of CoreImage filters here:

http://developer.apple.com/macosx/coreimage.html

0
On

This web page gives some instructions on how to convert from NSImage to CIImage and do the scaling:

http://gigliwood.com/weblog//Cocoa/Core_Image__Practic.html