BlindWanderer
4th November 2006, 04:12
In the docs it says
in RGB32 the alpha-channel of the overlay_clip is multiplied with level, so the resulting alpha = (alpha_mask * level) / 256. This means for full strength of operation BOTH alpha and level have to be 255.
But it seems to me that doesn't mathematically work.
if we substitute in values, "alpha = (alpha_mask * level) / 256" becomes "alpha = (255 * 255) / 256" to which alpha would equal "254.00390625" which would be truncated at 254. Considering that 254 is not equal to 255; then it could be said that where it previously states that using a value of 255 for the level will return the overlay, is in fact incorrect. For the math to work, level would have to be 256.
I think what the documentation should say:
in RGB32 the alpha-channel of the overlay_clip is multiplied with level, so the resulting alpha = (alpha_mask * level) / 256. This means for full strength of operation alpha has to be 255 and level has to be 256.
Of course I cannot verify that this is infact how the code works as I do not fully grok mmx assembly.
in RGB32 the alpha-channel of the overlay_clip is multiplied with level, so the resulting alpha = (alpha_mask * level) / 256. This means for full strength of operation BOTH alpha and level have to be 255.
But it seems to me that doesn't mathematically work.
if we substitute in values, "alpha = (alpha_mask * level) / 256" becomes "alpha = (255 * 255) / 256" to which alpha would equal "254.00390625" which would be truncated at 254. Considering that 254 is not equal to 255; then it could be said that where it previously states that using a value of 255 for the level will return the overlay, is in fact incorrect. For the math to work, level would have to be 256.
I think what the documentation should say:
in RGB32 the alpha-channel of the overlay_clip is multiplied with level, so the resulting alpha = (alpha_mask * level) / 256. This means for full strength of operation alpha has to be 255 and level has to be 256.
Of course I cannot verify that this is infact how the code works as I do not fully grok mmx assembly.