PixelFormatSupported

Hey guys,
Trying to get into the pixelFormats here.
I'm adjusting the SDK's Cross Dissolve in order to find out if it's possible to write a transition that only supports PrPixelFormat_BGRA_4444_32f.
This way I can get into making quality plugins without having to write seperated code for different PixelFormats.
"Starting in CS4, plug-ins no longer need to support 8-bit BGRA at a minimum."
- I say: let PP handle the nessesary conversions. Let me focus on just the BGRA4444_32f
So I'm banishing some lines of code:
static prMALError GetPixelFormatsSupported(EffectHandle theData)
          prMALError result = esNoErr;
  switch((*theData)->pixelFormatIndex)
/*                    case 0:
                              (*theData)->pixelFormatSupported =  PrPixelFormat_BGRA_4444_8u;
                              break;
                    case 1:
                              (*theData)->pixelFormatSupported =  PrPixelFormat_VUYA_4444_8u;
                              break;
  // These pixel formats are only available in Premiere Pro 2.0 and later
                    case 2:
                              if ((*theData)->version >= 9)
                                        (*theData)->pixelFormatSupported =  PrPixelFormat_BGRA_4444_32f;
  else
                                        result = esBadFormatIndex;
  break;
/*                    case 3:
                              (*theData)->pixelFormatSupported =  PrPixelFormat_VUYA_4444_32f;
                              break;
  default:
                              result = esBadFormatIndex;
          return result;
So we are down to the one and only PrPixelFormat_BGRA_4444_32f
I wanted to see what happens.
But I didn't got the feeling it wasn't working, because it still showed the YUV sign in the effects tab.
So I messed around with this: Banished some other lines of code so it would only support 8u.
Well, at some point all the signs (32-bits and YUV) where gone in the Effects tab.
Now I want them back. But I can't...
I keep reloading the plug-in by restarting PP - nothing
I'm holding shift at the start of PP to refresh all the plugins. - nothing.
Redownloaded the fresh SDK pack, recompiled the cross dissolve with nothing changed - nothing.
started to get frustrated...
told the plugin not to cache itself, but to reload each time pp is started by adding:
        case esCacheOnLoad:
            result = esDoNotCacheOnLoad;
            break;
to the selector switch: PREMPLUGENTRY DllExport xEffect (short                               selector,   EffectHandle           theData)
looked at the ~/library/adobe/premiere pro/5.5/plugin loading.log   and found:
Loading /Library/Application Support/Adobe/Common/Plug-ins/CS5.5/MediaCore/Cross_Dissolve.bundle
The registry tells us not to cache so the plugin will be loaded from disk.
Loading from disk...
This plugin was recognized by loader 3dbe9220-aa71-4c9d-9342-4c239a83a825.
- So this is OK. - but then again it doesn't change anything with the recogition for being 32-bits enabled
So the SDK Cross Dissolve transition listed in the Effects tab still isn't showing me the 32bits sign, even with a freshly compiled original that should support both 32-bits color and YUV.
What am I missing here?
Cheers,
Jaap

Unfortunately plugin development isn’t as easy as we all would like but at least it is open for us to develop on.
I suspect that the Editing Mode you’re in has a Player that doesn’t support BGRA_4444_32f and does (because of legacy) support BGRA_4444_8u thus the preview window requires BGRA_8u support to work.
If you do want to support BGRA_4444_8u then you should be able to make common code by converting the 8u to 32f and then continuing your plugin as 32f. (Likewise you should do a YUV_32f to BGRA_32f –although if you don’t know a lot about rec601 and rec709 colorspaces I HIGHLY recommend that you DO NOT start doing this).
Here’s a quick mock up off the top of my head…
float The32fFrame = (float)TheFrame;
int do_32f_to_8u = 0;
switch((*theData)->pixelFormatSupported)
case PrPixelFormat_BGRA_4444_8u:
// Flag to un-convert at the end
do_32f_to_8u = 1;
The32fFrame= malloc(heightrowstride4);
// Convert 0..255 (_8u) buffer to 0.0…1.0 (_32f)
// Change this to SSE|2|3|4 intrinsics for a 4x or 8x speedup!
for(int h=0;h<height;h++)                     // Height
for(int w=0;w<width;w++)         // Width
for(int p=0;w<4;p++)    // Plane
                        The32fFrame[4hrowstride+ 4*w + p] =
(float)TheFrame[4h rowstride + 4*w + p]/(float)255.0);
// Now fall through and process as BGRA_32f
case PrPixelFormat_BGRA_4444_32f:
// IMPLEMENT YOUR FILTER/TRANSITION HERE
break;
            default:
                        return WHATEVER THE ERROR CODE IS FOR UNSUPPORTED;
//Run a loop that un-does the floating point conversion if necessary.
if(do_32f_to_8u)
// Change 32f back to 8u
for(int h=0;h<height;h++)
for(int w=0;w<width;w++)
for(int p=0;w<4;p++)
TheFrame[4h rowstride + 4*w + p] =
(unsigned int)((float)255.0 * The32fFrame[4h rowstride + 4*w + p]);
            free(The32fFrame);
return prNOERR;
·         Where “rowstride” is the actual stride of the row, not the frame width.

Similar Messages

Maybe you are looking for