Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using QC Composition as Plugin



Title: Re: Using QC Composition as Plugin
OK -- so I'm trying to pass a CIImage through the Quartz Composer object I've created. The relevant code looks like this:

NOTE: _renderer is a QCRenderer

// if there is a frame available from a quicktime movie
if(QTVisualContextIsNewImageAvailable(_visualContext, NULL) && (QTVisualContextCopyImageForTime(_visualContext, NULL, NULL, &imageBuffer) == kCVReturnSuccess)) {
// convert frame to a CIImage
CIImage* inputImage = [CIImage imageWithCVImageBuffer:imageBuffer];
// send the new CIImage to the renderer input  
if(![_renderer setValue:inputImage forInputKey:kRendererImageInput])
        NSLog(@"Could not pass frames cache to composition");

// tell it to render
// ??? Can I pass 0 for the time ???
[_renderer renderAtTime:0 arguments:NULL];

// get the output image
NSImage* outImage = [_renderer valueForOutputKey:kRendererImageOutput];
if(!outImage)
        NSLog(@"Could not get output image to composition");

The problem is that the output image is always NULL. Any ideas?

Best,
Mar


I'm wondering if there is a way to use a Quartz Composer composition as a plugin inside another program.

For example, suppose that there is a node for an image input, then some modules that process that data, and then a node for image output. Could my program 'import' that plugin, send it an image, and then get the image result at the output?

The QCRenderer seems to be close to what I need, but the problem is that I don't want to display the output -- just have the composition do some processing and feed me the result.

Possible? Sample Code?

Yes, this is possible: you can load a composition on a QCRenderer that actually performs no graphics rendering.  In that case create a dummy OpenGL context for the QCRenderer that is not attached to a surface (i.e. NSView or screen) and it should work fine.

________________________________________________________
Pierre-Olivier Latour                            email@hidden
Quartz Composer Architect                Graphics & Imaging Team


-- 
=====================================================================
Mark Coniglio, Artistic Co-Director | email@hidden
Troika Ranch Dance Theater          | http://www.troikaranch.org
=====================================================================
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden

This email sent to email@hidden

References: 
 >Using QC Composition as Plugin (From: Mark Coniglio <email@hidden>)
 >Re: Using QC Composition as Plugin (From: Pierre-Olivier Latour <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.