Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-05-18 02:55:28 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-05-18 02:55:28 +0400
commit7862b2fa13c0437d9c17eae78e7b79a421dacf05 (patch)
tree08f9c26af3e71795d0f65803a415b5612d6b53ab /source/blender/compositor/operations/COM_DifferenceMatteOperation.cpp
parent69b95e1a8a00c9ff146d803b8ec11183d7a68908 (diff)
style cleanup: compositor, pointer syntax, function brace placement, line length
Diffstat (limited to 'source/blender/compositor/operations/COM_DifferenceMatteOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_DifferenceMatteOperation.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/source/blender/compositor/operations/COM_DifferenceMatteOperation.cpp b/source/blender/compositor/operations/COM_DifferenceMatteOperation.cpp
index c64f2593318..628daa7c775 100644
--- a/source/blender/compositor/operations/COM_DifferenceMatteOperation.cpp
+++ b/source/blender/compositor/operations/COM_DifferenceMatteOperation.cpp
@@ -23,7 +23,8 @@
#include "COM_DifferenceMatteOperation.h"
#include "BLI_math.h"
-DifferenceMatteOperation::DifferenceMatteOperation(): NodeOperation() {
+DifferenceMatteOperation::DifferenceMatteOperation(): NodeOperation()
+{
addInputSocket(COM_DT_COLOR);
addInputSocket(COM_DT_COLOR);
addOutputSocket(COM_DT_VALUE);
@@ -32,16 +33,19 @@ DifferenceMatteOperation::DifferenceMatteOperation(): NodeOperation() {
inputImage2Program = NULL;
}
-void DifferenceMatteOperation::initExecution() {
+void DifferenceMatteOperation::initExecution()
+{
this->inputImage1Program = this->getInputSocketReader(0);
this->inputImage2Program = this->getInputSocketReader(1);
}
-void DifferenceMatteOperation::deinitExecution() {
- this->inputImage1Program= NULL;
- this->inputImage2Program= NULL;
+void DifferenceMatteOperation::deinitExecution()
+{
+ this->inputImage1Program = NULL;
+ this->inputImage2Program = NULL;
}
-void DifferenceMatteOperation::executePixel(float* outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]) {
+void DifferenceMatteOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
+{
float inColor1[4];
float inColor2[4];
@@ -53,9 +57,9 @@ void DifferenceMatteOperation::executePixel(float* outputValue, float x, float y
this->inputImage1Program->read(inColor1, x, y, sampler, inputBuffers);
this->inputImage2Program->read(inColor2, x, y, sampler, inputBuffers);
- difference= fabs(inColor2[0]-inColor1[0])+
- fabs(inColor2[1]-inColor1[1])+
- fabs(inColor2[2]-inColor1[2]);
+ difference = (fabs(inColor2[0] - inColor1[0]) +
+ fabs(inColor2[1] - inColor1[1]) +
+ fabs(inColor2[2] - inColor1[2]));
/*average together the distances*/
difference=difference/3.0;
@@ -78,7 +82,7 @@ void DifferenceMatteOperation::executePixel(float* outputValue, float x, float y
}
else {
/*foreground object*/
- outputValue[0]= inColor1[3];
+ outputValue[0] = inColor1[3];
}
}