Re: Use Core Image to filter an FxTexture in FxPlug
site_archiver@lists.apple.com Delivered-To: pro-apps-dev@lists.apple.com On Aug 19, 2008, at 7:37 PM, Jim George wrote: I'm fairly new to FxPlug and Core Image and am confused by what I think should be something simple I want to render simply create a core image with the FxTexture, filer it, and then draw the contents back onto the output image. For my example, I've removed the filter so I'd just like to understand how to render the core image back onto the output texture. I could be way off, but here goes: CIContext *myCIContext; NSOpenGLPixelFormatAttribute attr[] = { NSOpenGLPFAAccelerated, NSOpenGLPFANoRecovery, NSOpenGLPFAColorSize, 32, (NSOpenGLPixelFormatAttribute) 0 }; NSOpenGLPixelFormat* pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attr] autorelease]; myCIContext = [CIContext contextWithCGLContext:renderInfo.sharedContext pixelFormat:[pixelFormat CGLPixelFormatObj] options:nil]; CGRect rect; rect.origin.x = 0; rect.origin.y = 0; rect.size.width = [inTex width]; rect.size.height = [inTex height]; CIImage *imageBuffer = [[CIImage alloc] initWithTexture:[inTex textureId] size:rect.size flipped:NO colorSpace:nil]; Darrin -- Darrin Cardani dcardani@apple.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/pro-apps-dev/site_archiver%40lists.ap... Jim, I don't see anything obviously wrong with what you're doing. One thing you might try is setting the rect.origin and size based on the texture coordinates of the input texture. I don't remember off the top of my head if they're usually centered at the origin, or if the origin is lower left (in Motion) or upper left (in FCP). This email sent to site_archiver@lists.apple.com
participants (1)
-
Darrin Cardani