diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-15 22:42:03 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-15 22:42:03 +0400 |
commit | 570cc70772d78703053956ce57b20c6c4ed74c95 (patch) | |
tree | b4c5db0392384251f1b1ccefc17c959d3e742977 /source/blender/compositor/operations/COM_ChromaMatteOperation.cpp | |
parent | 8fd2267e56d3d0b6bb860800eb8059bcbfa0b501 (diff) |
style cleanup: compositor operations
Diffstat (limited to 'source/blender/compositor/operations/COM_ChromaMatteOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_ChromaMatteOperation.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/compositor/operations/COM_ChromaMatteOperation.cpp b/source/blender/compositor/operations/COM_ChromaMatteOperation.cpp index e082ffed2b6..0ce1a585598 100644 --- a/source/blender/compositor/operations/COM_ChromaMatteOperation.cpp +++ b/source/blender/compositor/operations/COM_ChromaMatteOperation.cpp @@ -22,7 +22,7 @@ #include "COM_ChromaMatteOperation.h" #include "BLI_math.h" -ChromaMatteOperation::ChromaMatteOperation(): NodeOperation() +ChromaMatteOperation::ChromaMatteOperation() : NodeOperation() { addInputSocket(COM_DT_COLOR); addInputSocket(COM_DT_COLOR); @@ -66,36 +66,36 @@ void ChromaMatteOperation::executePixel(float *outputValue, float x, float y, Pi /* 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*/ - theta=atan2(inKey[2], inKey[1]); + theta = atan2(inKey[2], inKey[1]); /*rotate the cb and cr into x/z space */ - x_angle=inImage[1]*cosf(theta)+inImage[2]*sinf(theta); - z_angle=inImage[2]*cosf(theta)-inImage[1]*sinf(theta); + x_angle = inImage[1] * cosf(theta) + inImage[2] * sinf(theta); + z_angle = inImage[2] * cosf(theta) - inImage[1] * sinf(theta); /*if within the acceptance angle */ /* if kfg is <0 then the pixel is outside of the key color */ - kfg = x_angle-(fabsf(z_angle)/tanf(acceptance/2.f)); + 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); + if (kfg > 0.f) { /* found a pixel that is within key color */ + alpha = (1.f - kfg) * (gain); - beta=atan2(z_angle,x_angle); + beta = atan2(z_angle, x_angle); /* if beta is within the cutoff angle */ - if (fabsf(beta) < (cutoff/2.f)) { - alpha=0.f; + if (fabsf(beta) < (cutoff / 2.f)) { + alpha = 0.f; } /* don't make something that was more transparent less transparent */ - if (alpha<inImage[3]) { - outputValue[0]=alpha; + if (alpha < inImage[3]) { + outputValue[0] = alpha; } else { - outputValue[0]=inImage[3]; + outputValue[0] = inImage[3]; } } else { /*pixel is outside key color */ - outputValue[0]=inImage[3]; /* make pixel just as transparent as it was before */ + outputValue[0] = inImage[3]; /* make pixel just as transparent as it was before */ } } |