Skip to main content
Inspiring
November 20, 2012
Answered

Creating a New World at 32-bit Depth

  • November 20, 2012
  • 1 reply
  • 1571 views

Hi all.

Probably a silly question but how do you create a new 32-bit float world using suites.WorldSuite1()->new_world() ?

My plugin is successfully creating worlds at 8-bit and 16-bit depth, by or-ing the PF_NewWorldFlags as so: flags |=    PF_NewWorldFlag_DEEP_PIXELS  when switching AE to 16-bit or 32-bit (I wonder if this is where I'm going wrong...).

But how do you tell new_world() that the new world should be 32-bit? When I switch AE to 32-bit I get the error

After Effects error: internal verification failure, sorry! {PF_Iterate requires source and dst worlds to be same depth}

( 37 :: 14 )

The new world creates ok (but presumably with deep pixels) but when I invoke suites.IterateFloatSuite1()->iterate() to iterate across the input world and process the new dst world the effect causes an exception and AE displays the (37 ::14) error (about 15 times!). My iterate functions are all set up to process the correct bit depths.

My plugin is SmartFX, with the PF_OutFlag2_SUPPORTS_SMART_RENDER and PF_OutFlag2_FLOAT_COLOR_AWARE flags set.

I have another weird issue but I'll post that in another topic.

Many thanks for any assistance.

Christian

Correct answer Mike_Basil

you need to use PF_WorldSuite2, have a look at this entry http://forums.adobe.com/message/4566766

greets

1 reply

Mike_BasilCorrect answer
Inspiring
November 20, 2012

you need to use PF_WorldSuite2, have a look at this entry http://forums.adobe.com/message/4566766

greets

Inspiring
November 20, 2012

Thank you Mike! It works great now.

For reference, in case anyone searches for this solution in future my code is:

static PF_Err MyFunc(

          PF_InData                    *in_data,

          PF_OutData                    *out_data,

          PF_EffectWorld          *input,

          PF_EffectWorld          *output)

{

          PF_Err                                        err            = PF_Err_NONE,

             err2           = PF_Err_NONE;

          PF_WorldSuite2                    *wsP          =          NULL;

          PF_PixelFormat                    format          =          PF_PixelFormat_INVALID;

          ERR(AEFX_AcquireSuite(          in_data,

                                                                           out_data,

        kPFWorldSuite,

                                                                           kPFWorldSuiteVersion2,

                                                                           "Couldn't load suite.",

                                                                           (void**)&wsP));

          ERR(wsP->PF_GetPixelFormat(input, &format));

 

          switch (format) {

                         case PF_PixelFormat_ARGB128:

                                        ERR(wsP->PF_NewWorld(in_data->effect_ref, (A_long)input->width, (A_long)input->height, true, PF_PixelFormat_ARGB128, output));

 

                                        // Float stuff here

 

                                        break;

 

                         case PF_PixelFormat_ARGB64:

                                        ERR(wsP->PF_NewWorld(in_data->effect_ref, (A_long)input->width, (A_long)input->height, true, PF_PixelFormat_ARGB64, output));

 

                                        // 16-bit stuff here

 

                                        break;

 

                         case PF_PixelFormat_ARGB32:

                              

                                        ERR(wsP->PF_NewWorld(in_data->effect_ref, (A_long)input->width, (A_long)input->height, true, PF_PixelFormat_ARGB32, output));

 

                                        // 8-bit stuff here

 

                                        break;

                         default:

                                        err = PF_Err_BAD_CALLBACK_PARAM;

                                        break;

               }

               return err;

}