Re: FxPlug adding color cast.
site_archiver@lists.apple.com Delivered-To: pro-apps-dev@lists.apple.com Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=boBEvF80ZqMDOJ0F/rdlycsYtYmFasQSKK52C2vzF3utoxFVZnj+ds+/RuQ8W55iNLyPGR0lgadoDCVgxaqy3oR4oDvBXyTUuzNpaWQIyFGLaTblH2YlojkZ6NJGXNxvipeVdY69djCXieTjTqGfm+98Wt75bxOOwd20jdoF2ug= Gabe, I do see a different color shift when rendering to RGB, it affects the highlights mostly, pulling down the red channel giving me a blueish cast in the whites, this only happens when my plugin is run, Paul's works fine. I'm guessing that the preview is always 8-bit here, and I now think the Xcode template filter must hand back an improper pixel buffer somehow. Ok, I'm seeing something very strange here, it appears that the problem may lie in the Xcode template code. Paul, the plugin code you sent me, it utilizes memcpy, this plugin does not case a shift in values when rendered as YUV 8-bit. Perhaps my code is returning a messed up pixel buffer some how, but I fail to see the difference between Paul's code and mine, so I'm going to post it here, please have a look over the two and tell me if there is something wrong with mine. Xcode template code (the problem code) FxBitmap *inMap = (FxBitmap *)inputImage; FxBitmap *outMap = (FxBitmap *)outputImage; UInt8 *inData = (UInt8 *)[inMap dataPtr]; UInt8 *outData = (UInt8 *)[outMap dataPtr]; UInt32 inMod = [inMap rowBytes] - [inMap width] * [inMap depth] / 8 * [inMap numActiveChannels]; UInt32 outMod = [outMap rowBytes] - [outMap width] * [outMap depth] / 8 * [outMap numActiveChannels]; UInt32 y; UInt32 x; for ( y = 0; y < [outMap height]; ++y ) { for ( x = 0; x < [outMap width]; ++x ) { *outData++ = *inData++; *outData++ = *inData++; *outData++ = *inData++; *outData++ = *inData++; } inData += inMod; outData += outMod; } Paul's code (works perfectly) FxBitmap *inMap = (FxBitmap *)inputImage; FxBitmap *outMap = (FxBitmap *)outputImage; const char *src = [inMap dataPtr]; char *dst = [outMap dataPtr]; int y = 0; for (y = 0; y < [inputImage height]; ++y) { memcpy (dst, src, [inMap width] * [inMap depth] / 8 * [inMap numActiveChannels]); src += [inMap rowBytes]; dst += [outMap rowBytes]; } I can see no real difference, both roll through the pixel buffer the same. He uses char and I use UInt8 (unsigned char should work the same) in order to access the specific values. Also there is a difference in what Final Cut does to images after received, for Paul's it truncates the values simply clipping anything over white producing a more broadcast safe image. For mine it does nothing except decrease all values by one. Anyone can test this out, my plugin comes straight out of the Xcode template, as you can see simply assigning in values to out values. Thanks again, Trevor _______________________________________________ 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)
-
Trevor Anderson