Copy link to clipboard
Copied
Hi gang;
To date, I have been iterating over every pixel for most of my functions. This has been fine but I think it's a lot slower for certain functions such as just filling the screen with a solid color and alpha.
I understand PF_FILL and PF_COPY are ideal for this but again, the documentation lacks any and all instructions on usage.
Could anyone kindly show how to use those to fill the screen quickly with a solid and alpha? I tried searching but the new forum makes it a lot tougher to find any relevant information now.
I should mention I am using an old SDK so before I assign blame, perhaps the newer ones have more info on these functions.
Thanks in advance!
-Rich
Copy link to clipboard
Copied
Make a black solid the same size as your comp.
Copy link to clipboard
Copied
Hi Dave;
Thanks for your reply but I'm speaking about the SDK - specifically plugin development.
Unfortunately, this seems to be the flaw with the new forum they implemented, where they just stuck all categories in one and added tags. Now users are confused between questions pertaining to After Effects usage vs the SDK. I tagged my post SDK, as I did in the headline as well but clearly it's still confusing.
I really hope the admins see these flaws and try to fix it. The old forum worked just fine - especially with regards to the SDK so it's really frustrating they had to go ahead and break it. Insert eye-roll here.
-Rich
Copy link to clipboard
Copied
Yeah, this new concept for user forums pretty much sucks. Wait, I take that back -- it DEFINITELY sucks. Big, green ones.
Copy link to clipboard
Copied
when supporting multiple colro depths it gets a bit messy, becuase PF_FILL is 8bit only.
the simplest approach for clearing a buffer would be:
memset(world->data, 0, world->rowBytes * world->height);
you can further optimize it using "iterate generic" to do multiple lines simultaniously.
this method applies for all color depths.
here's how to fill with a color other than black:
PF_FillMatteSuite2 *fms2P;
switch (worldType)
{
case AEGP_WorldType_32:
PF_Pixel32 color32;
color32.alpha = 1;
color32.blue = 1;
color32.green= 1;
color32.red= 1;
ERR(suites.Pica()->AcquireSuite( kPFFillMatteSuite,
kPFFillMatteSuiteVersion2,
(const void**)&fms2P));
ERR(fms2P->fill_float(in_data->effect_ref, color32, NULL, &effectWorld));
ERR(suites.Pica()->ReleaseSuite( kPFFillMatteSuite,
kPFFillMatteSuiteVersion2));
break;
case AEGP_WorldType_16:
PF_Pixel16 color16;
color16.alpha = (A_u_short)32768;
color16.blue = (A_u_short)32768;
color16.green = (A_u_short)32768;
color16.red = (A_u_short)32768;
ERR(suites.Pica()->AcquireSuite( kPFFillMatteSuite,
kPFFillMatteSuiteVersion2,
(const void**)&fms2P));
ERR(fms2P->fill16(in_data->effect_ref, &color16, NULL, &effectWorld));
ERR(suites.Pica()->ReleaseSuite( kPFFillMatteSuite,
kPFFillMatteSuiteVersion2));
break;
case AEGP_WorldType_8:
PF_Pixel8 color8;
color8.alpha = (A_u_char)255;
color8.blue = (A_u_char)255;
color8.green = (A_u_char)255;
color8.red = (A_u_char)255;
ERR(PF_FILL(&color8,
NULL,
&effectWorld));
break;
}