diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-18 02:55:28 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-18 02:55:28 +0400 |
commit | 7862b2fa13c0437d9c17eae78e7b79a421dacf05 (patch) | |
tree | 08f9c26af3e71795d0f65803a415b5612d6b53ab /source/blender/compositor/operations/COM_ColorMatteOperation.cpp | |
parent | 69b95e1a8a00c9ff146d803b8ec11183d7a68908 (diff) |
style cleanup: compositor, pointer syntax, function brace placement, line length
Diffstat (limited to 'source/blender/compositor/operations/COM_ColorMatteOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_ColorMatteOperation.cpp | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/source/blender/compositor/operations/COM_ColorMatteOperation.cpp b/source/blender/compositor/operations/COM_ColorMatteOperation.cpp index 6e9c1b0d48a..7706559be00 100644 --- a/source/blender/compositor/operations/COM_ColorMatteOperation.cpp +++ b/source/blender/compositor/operations/COM_ColorMatteOperation.cpp @@ -22,7 +22,8 @@ #include "COM_ColorMatteOperation.h" #include "BLI_math.h" -ColorMatteOperation::ColorMatteOperation(): NodeOperation() { +ColorMatteOperation::ColorMatteOperation(): NodeOperation() +{ addInputSocket(COM_DT_COLOR); addInputSocket(COM_DT_COLOR); addOutputSocket(COM_DT_VALUE); @@ -31,23 +32,26 @@ ColorMatteOperation::ColorMatteOperation(): NodeOperation() { inputKeyProgram = NULL; } -void ColorMatteOperation::initExecution() { +void ColorMatteOperation::initExecution() +{ this->inputImageProgram = this->getInputSocketReader(0); this->inputKeyProgram = this->getInputSocketReader(1); } -void ColorMatteOperation::deinitExecution() { - this->inputImageProgram= NULL; - this->inputKeyProgram= NULL; +void ColorMatteOperation::deinitExecution() +{ + this->inputImageProgram = NULL; + this->inputKeyProgram = NULL; } -void ColorMatteOperation::executePixel(float* outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]) { +void ColorMatteOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]) +{ float inColor[4]; float inKey[4]; - const float hue=this->settings->t1; - const float sat=this->settings->t2; - const float val=this->settings->t3; + const float hue = this->settings->t1; + const float sat = this->settings->t2; + const float val = this->settings->t3; float h_wrap; @@ -62,19 +66,19 @@ void ColorMatteOperation::executePixel(float* outputValue, float x, float y, Pix if ( /* do hue last because it needs to wrap, and does some more checks */ - /* sat */ (fabsf(inColor[1]-inKey[1]) < sat) && - /* val */ (fabsf(inColor[2]-inKey[2]) < val) && + /* sat */ (fabsf(inColor[1] - inKey[1]) < sat) && + /* val */ (fabsf(inColor[2] - inKey[2]) < val) && /* multiply by 2 because it wraps on both sides of the hue, * otherwise 0.5 would key all hue's */ - /* hue */ ((h_wrap= 2.f * fabsf(inColor[0]-inKey[0])) < hue || (2.f - h_wrap) < hue) + /* hue */ ((h_wrap = 2.f * fabsf(inColor[0]-inKey[0])) < hue || (2.f - h_wrap) < hue) ) { - outputValue[0]=0.f; /*make transparent*/ + outputValue[0] = 0.0f; /*make transparent*/ } else { /*pixel is outside key color */ - outputValue[0]=inColor[3]; /* make pixel just as transparent as it was before */ + outputValue[0] = inColor[3]; /* make pixel just as transparent as it was before */ } } |