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: Saving the result of processing an image to another image



I'm trying out this technique, but I've hit a snag.  I get this exception thrown as it tries to create the QCRenderer.

+[QCOpenGLContext checkTextureWidth:height:forTarget:outPixelRatio:]: Argument "height" does not verify "(*height > 0) && ((target == GL_TEXTURE_RECTANGLE_ARB) || QCUtils_Math_IsPowerOfTwo(*height))"

So there's supposed to be a height specified, but how and where?  (This also leads me to the question as to how do we specify how big the "canvas" to paint upon will be -- when you render to a QCView, it has a known width/height dimensions that the composition can use...)

Thanks,

Dan




On May 6, 2005, at 1:22 PM, Pierre-Olivier Latour wrote:

What's you describe here works, although it could be a lot more optimized: using a QCRenderer instead of a QCView and not do start / render / stop for every frame as it prevents any caching of resources.

In your current implementation, you might not even need to create a background window, just the QCView. Or even better, something like this might work:

NSString*                        compositionPath = @"?"; //Set to composition path
NSOpenGLPixelFormatAttribute    attributes[] = {NSOpenGLPFAAccelerated, NSOpenGLPFANoRecovery, (NSOpenGLPixelFormatAttribute)0};
NSAutoreleasePool*                pool = [NSAutoreleasePool new];
NSOpenGLPixelFormat*            format = [[NSOpenGLPixelFormat alloc] initWithAttributes:attributes];
NSOpenGLContext*                context = [[NSOpenGLContext alloc] initWithFormat:format shareContext:nil];
QCRenderer*                        renderer = [[QCRenderer alloc] initWithOpenGLContext:context pixelFormat:format file:compositionPath];

//Do the following for each image to be processed by the composition
{
    //Set composition input parameters here - like numerical values, images...
    //[renderer setValue:? forInputKey:@"Image"];
    
    //Run composition
    [renderer renderAtTime:0.0 arguments:nil];
    
    //Retrieve composition output results here
    //image = [renderer valueForOutputKey:@"Image"];
}

[renderer release];
[context release];
[format release];
[pool release];

 _______________________________________________
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: 
 >Saving the result of processing an image to another image (From: Benoit Marchant <email@hidden>)
 >Re: Saving the result of processing an image to another image (From: Dan Wood - Discussion Lists <email@hidden>)
 >Re: Saving the result of processing an image to another image (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.