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

Fastest way to fill screen with black - SDK?

Engaged ,
Oct 17, 2019 Oct 17, 2019

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

 

TOPICS
SDK

Views

846

Translate

Translate

Report

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 ,
Oct 18, 2019 Oct 18, 2019

Copy link to clipboard

Copied

Make a black solid the same size as your comp.

Votes

Translate

Translate

Report

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
Engaged ,
Oct 18, 2019 Oct 18, 2019

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

Votes

Translate

Translate

Report

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 ,
Oct 27, 2019 Oct 27, 2019

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.

Votes

Translate

Translate

Report

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
Community Expert ,
Jan 11, 2020 Jan 11, 2020

Copy link to clipboard

Copied

LATEST

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;
}

Votes

Translate

Translate

Report

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