Re: FxPlug adding color cast.
Re: FxPlug adding color cast.
- Subject: Re: FxPlug adding color cast.
- From: "Trevor Anderson" <email@hidden>
- Date: Wed, 14 Feb 2007 11:38:08 -0800
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden