I'm at the start of creating a simple plugin. My aim is to put everything from input to output but pixel by pixel. I'm using a CCU example for that, but this causes problems.
Here's my code:
PF_EffectWorld *inputP = ¶ms[0]->u.ld;
PF_Pixel8 *inputPix = (PF_Pixel8 *)inputP->data;
PF_Pixel8 *outPix = (PF_Pixel8 *)output->data;
for (int i=0; i<output->height; i++)
{
for (int j=0; j<output->width; j++)
{
*outPix++ = *inputPix++;
}
}
My original footage looks like this:
And after using my code it looks like this:
After adding the bold line everything works (why do I have to use that line?):
for (int i=0; i<output->height; i++)
{
for (int j=0; j<output->width; j++)
{
*outPix++ = *inputPix++;
}
for(int k=0;k<4;k++) inputPix++;
}
But when I'm trying to use the plugin again on the same footage it looks like this:
Am I missing something? What causes that? When I use the callback funcion everything works fine, but I have to do that using the above way 'cause I have to have access to every pixel of the footage.
Thanks in advance, David
It is called gutter or row padding, each row may contain more pixel than the actual width. You can check for this with the rowBytes value of inputP.
The CCU example already compensates for this, so look there for more information:
in_gutterL = (inputP->rowbytes / sizeof(PF_Pixel8)) - inputP->width,
out_gutterL = (outputP->rowbytes / sizeof(PF_Pixel8)) - outputP->width;
...
// At the end of each row, account for the gutter
// (this number can vary by platform and for other reasons)
if (yL >= 0 && yL < inputP->height){
bop_inP += in_gutterL;
}
bop_outP += out_gutterL;
North America
Europe, Middle East and Africa
Asia Pacific