Re: Use Core Image to filter an FxTexture in FxPlug
Re: Use Core Image to filter an FxTexture in FxPlug
- Subject: Re: Use Core Image to filter an FxTexture in FxPlug
- From: Darrin Cardani <email@hidden>
- Date: Fri, 22 Aug 2008 10:26:48 -0700
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];
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).
Darrin
--
Darrin Cardani
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden