Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

alpha channel set problem in PrPro plugin

Contributor ,
Apr 09, 2021 Apr 09, 2021

Dear AE fellows,

I use cairo to draw a animated shape on the sequence.

The converting function works corrrectly in AE giving correct color and transparent background.

Used as is for PrPro it gives black background instead.

Could you explain why this is happening?

Here is my code:

 

struct cairoRefcon
{
PF_EffectWorld output;
unsigned char* data;
int stride;
};


PF_Pixel* sampleIntegral8(PF_EffectWorld& def, int x, int y) {
return (PF_Pixel*)((char*)def.data +
(y * def.rowbytes) +
(x * sizeof(PF_Pixel)));
}


PF_Err cairoCopy8(void* refcon, A_long threadInd, A_long iterNum, A_long iterTotal)
{
cairoRefcon* data = (cairoRefcon*)refcon;

int i = iterNum;

PF_Err err = PF_Err_NONE;

uint32_t* rowP;

PF_Pixel8* worldPtr = sampleIntegral8(data->output, 0, i);

rowP = (uint32_t*)(data->data + i * data->stride);

for (int x = 0; x < data->output.width; x++)// column
{



worldPtr->alpha = rowP[x] >> 24;
if (worldPtr->alpha)
{
float rf = A_u_char(rowP[x] >> 16) / (float)worldPtr->alpha;
float gf = A_u_char(rowP[x] >> 8) / (float)worldPtr->alpha;
float bf = A_u_char(rowP[x] >> 0) / (float)worldPtr->alpha;
worldPtr->red = A_u_char(rf * PF_MAX_CHAN8);
worldPtr->green = A_u_char(gf * PF_MAX_CHAN8);
worldPtr->blue = A_u_char(bf * PF_MAX_CHAN8);
}
else {
worldPtr->alpha = A_u_char(0. * PF_MAX_CHAN8);
float rf = A_u_char(rowP[x] >> 16);
float gf = A_u_char(rowP[x] >> 8);
float bf = A_u_char(rowP[x] >> 0);
worldPtr->red = A_u_char(1. * PF_MAX_CHAN8);
worldPtr->green = A_u_char(1. * PF_MAX_CHAN8);
worldPtr->blue = A_u_char(1. * PF_MAX_CHAN8);

}


worldPtr++;
}

return err;
}

 

TOPICS
SDK
306
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 09, 2021 Apr 09, 2021

How do you mean used in ppro? If it's ok in Ae why don't you render it with transparency then import to premiere? If in Premiere you don't see transparent checkerboard just set it in the wrench menu in the program monitot

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 13, 2021 Apr 13, 2021
LATEST

Dear Roei, thanks for the answer.

Eventually, I imported the canvas on which I draw with

 

PF_EffectWorld *inputP = &(params[MYPLUGIN_INPUT]->u.ld);

 

And then I blended it with my plugin animated shape.

Y.

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines