FxPlug using CIImage with CIFilter behave differently between Motion and Final Cut
site_archiver@lists.apple.com Delivered-To: pro-apps-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=kGK14cKvUE2vYE0jwjnaEMdP6HS2k8NifbktyDnEty8=; b=s8gbgICHTxSxX4/9N1qfcfOqFa43W2qbS55gmLFUeSgrQ5gu2NU6Rxduv3kK2FT8gw +BMRo7unE0N48cTUkMNTb6uCCursZ/ezsQwpdG7lSbzEeZohjv4rwVg/pjTg7/mDA1bU NX0gWfNcTY95XrL9HG4fqPfSdgIove/y5yVL4= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=bazRZtGtccuSB0t2HXrWfCKhkf7KiLWgIueyUGBpIjxBryyh6HJbKEQGBaQ00z8PDf i/w/qYqZnJ1IcRVG3a6USknbFAf7rlN/4744TI4cRVPvIIMbCfiEB+RJ50S3Kr4vo2SL WEMDS1atfIPdcQ+lpcGEZifCFyktM8dI3V6o8= Hello, I've run into a discrepancy between the behavior of using Core Image filters between Final Cut and Motion in an FxPlug and wonder if anyone would have any insight into the problem. I have a filter that takes a number of contiguous frames and runs some processing over them. I am using the temporalImageAPI to get the frames as FxTextures. In Final Cut the filter comes out correctly, but in Motion only the *last* frame gets drawn. I'm thinking somehow that Motion uses a shared context or texture where final cut allocates new ones, but my understanding of these under the hood is a bit of guesswork. Below is the basics of what I'm doing in the Render method for FxPlug. glPushAttrib(GL_CURRENT_BIT); CIContext *ciContext = [CIContext contextWithCGLContext:CGLGetCurrentContext() pixelFormat:CGLGetPixelFormat(CGLGetCurrentContext()) options:NULL]; CGColorSpaceRef cspace = CGColorSpaceCreateDeviceRGB(); FxTexture* inputTex; [temporalImageAPI getInputTexture:&inputTex withInfo: renderInfo atTime: renderInfo.frame - width/2]; CIImage* imageBase = [CIImage imageWithTexture:[inputTex textureId] size:CGSizeMake([inputTex width],[inputTex height]) flipped:NO colorSpace:cspace]; UInt32 frameStep = 0; double i; for(i = renderInfo.frame - width/2; i <= renderInfo.frame + width/2; i++){ [_filter setValue:imageBase forKey: @"inputBase"]; [temporalImageAPI getInputTexture:&inputTex withInfo: renderInfo atTime:i]; CIImage* inputImage = [CIImage imageWithTexture:[inputTex textureId] size:CGSizeMake([inputTex width],[inputTex height]) flipped:NO colorSpace:cspace]; [_filter setValue:inputImage forKey:@"inputImage"]; imageBase = [_filter valueForKey:@"outputImage"]; } [ciContext drawImage:imageBase inRect:CGRectMake(left,bottom,right-left,top-bottom) fromRect:CGRectMake(tLeft,tBottom,tRight-tLeft,tTop-tBottom)]; glPopAttrib(); Thanks!! _______________________________________________ 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... This email sent to site_archiver@lists.apple.com
participants (1)
-
Jim George