NSCFType imageBounds : unrecognized selector...

benoitlahoz's picture

Hello !

I have this trouble I had once, but I can't remember how I managed to resolve it.

In the Official API, now I'm working with a dynamic image input port. I want to pass my image to a custom class as a CGImageRef.

If I only cast the image as CGImageRef it works quite well, but as I want to make ome treatment on the CGImageRef (crop) I need to build a clean image. So I'm passing by a

[qcImage lockBufferRepresentationWithPixelFormat:pixelFormat colorSpace:colorSpace forBounds:[qcImage imageBounds]];

And then, it crashes with this error :

*** OpenGL error 0x0503 (stack overflow) in function "-[QCOpenGLContext willPushRenderState:]"
2012-09-05 12:43:14.177 Quartz Composer[663:60b] -[__NSCFType imageBounds]: unrecognized selector sent to instance 0x105ae2a50
2012-09-05 12:43:14.178 Quartz Composer[663:60b] *** EXCEPTION IGNORED: -[__NSCFType imageBounds]: unrecognized selector sent to instance 0x105ae2a50

Does anybody of you have an idea on what's happening ?

Thanks !

Ben

benoitlahoz's picture
Re: NSCFType imageBounds : unrecognized selector...

Well... Shame on me...

The trouble wasn't in the CGImageRef creation, but in my rendering function that I didn't changed.

In fact,

[myImage bindTextureRepresentationToCGLContext:cgl_ctx textureUnit:GL_TEXTURE0 normalizeCoordinates:YES];

doesn't work with "real" CGImageRef.

I found a way to generate a texture from a CGImageRef at this address : http://iphonesdksnippets.com/post/2009/05/13/Create-openGL-texture.aspx

But it's really heavy for the moment...