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...)

That's right, the dimensions of the canvas are undefined in that example, therefor the exception. Canvas dimensions are retrieved from the OpenGL context viewport (which in the case of a QCView matches its dimensions).

Just add this line of code before creating the QCRenderer:

#include <OpenGL/CGLMacro.h>

CGLContextObj cgl_ctx = [context CGLContextObj];
if(cgl_ctx)
glViewport(0, 0, width, height);

This will configure the viewport of the OpenGL context to the request width & height


________________________________________________________

Pierre-Olivier Latour                            email@hidden

Quartz Composer Architect                Graphic & Imaging Team


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