Hi. I've been writing a few fxscript plugins and I'd like to clarify some issues I have with alpha premultiplication. I think I understand the theory of it and my question is basically if and how I have to deal with alpha premultiplication when writing fxscript plugins.
Take an example: the fxscript command Matte (overImage, baseImage, destImage, amount, type) is described in UsingFXScript.pdf as "Composites the image buffer specified as overImage onto the buffer specified as baseImage and places the result in the destination image buffer. “Type” can be one of the predeclared variables kAlpha, kWhite, or kBlack. These allow alpha channel compositing or black or white matte alpha channel compositing". Since there are 3 buffers in the function and “Type” is just one, my questions are:
1) is “Type” applied to all 3 of them ? or 2) is “Type” applied only to overImage (as it seems from some Apple plugin examples) ?
If 1) is the answer, then I must make sure all 3 buffers are of the same alpha type (None, Straight, Black or White) before applying Matte; I guess I may use Multiply, ChannellMultiply or UnMultiply commands for this.
If 2) is the answer, then next question is:
3) what is the native alpha type which FCP applies by default to the remaining 2 buffers ? Indeed, in case 3), I should make sure that the buffer images are converted to that native alpha type before using the Matte function... Fortunately... for each input clip.i fxscript runtime returns a predefined variable srcType.i containing its "Alpha" property so I can test the input alpha types. Just I'm not sure what to do with it...
Can anybody help me here ? Thanks a lot in advance
Piero
|