Fix T45793: ChromaMatte incorrect output

Port to new node system missed important step.
This commit is contained in:
Campbell Barton 2015-08-26 16:45:37 +10:00
parent 1d34f0feed
commit 207c360900

@ -66,6 +66,16 @@ void ChromaMatteOperation::executePixelSampled(float output[4], float x, float y
/* Algorithm from book "Video Demistified," does not include the spill reduction part */
/* find theta, the angle that the color space should be rotated based on key */
/* rescale to -1.0..1.0 */
// inImage[0] = (inImage[0] * 2.0f) - 1.0f; // UNUSED
inImage[1] = (inImage[1] * 2.0f) - 1.0f;
inImage[2] = (inImage[2] * 2.0f) - 1.0f;
// inKey[0] = (inKey[0] * 2.0f) - 1.0f; // UNUSED
inKey[1] = (inKey[1] * 2.0f) - 1.0f;
inKey[2] = (inKey[2] * 2.0f) - 1.0f;
theta = atan2(inKey[2], inKey[1]);
/*rotate the cb and cr into x/z space */
@ -77,7 +87,7 @@ void ChromaMatteOperation::executePixelSampled(float output[4], float x, float y
kfg = x_angle - (fabsf(z_angle) / tanf(acceptance / 2.f));
if (kfg > 0.f) { /* found a pixel that is within key color */
alpha = (1.f - kfg) * (gain);
alpha = 1.0f - (kfg / gain);
beta = atan2(z_angle, x_angle);