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-06-15 22:42:03 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-06-15 22:42:03 +0400
commit570cc70772d78703053956ce57b20c6c4ed74c95 (patch)
treeb4c5db0392384251f1b1ccefc17c959d3e742977 /source/blender/compositor/operations/COM_BoxMaskOperation.cpp
parent8fd2267e56d3d0b6bb860800eb8059bcbfa0b501 (diff)
style cleanup: compositor operations
Diffstat (limited to 'source/blender/compositor/operations/COM_BoxMaskOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_BoxMaskOperation.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/source/blender/compositor/operations/COM_BoxMaskOperation.cpp b/source/blender/compositor/operations/COM_BoxMaskOperation.cpp
index ae83115ff69..3b99fc9a2a0 100644
--- a/source/blender/compositor/operations/COM_BoxMaskOperation.cpp
+++ b/source/blender/compositor/operations/COM_BoxMaskOperation.cpp
@@ -24,7 +24,7 @@
#include "BLI_math.h"
#include "DNA_node_types.h"
-BoxMaskOperation::BoxMaskOperation(): NodeOperation()
+BoxMaskOperation::BoxMaskOperation() : NodeOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
@@ -41,7 +41,7 @@ void BoxMaskOperation::initExecution()
const double rad = DEG2RAD((double)this->data->rotation);
this->cosine = cos(rad);
this->sine = sin(rad);
- this->aspectRatio = ((float)this->getWidth())/this->getHeight();
+ this->aspectRatio = ((float)this->getWidth()) / this->getHeight();
}
void BoxMaskOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
@@ -49,13 +49,13 @@ void BoxMaskOperation::executePixel(float *color, float x, float y, PixelSampler
float inputMask[4];
float inputValue[4];
- float rx = x/this->getWidth();
- float ry = y/this->getHeight();
+ float rx = x / this->getWidth();
+ float ry = y / this->getHeight();
- const float dy = (ry - this->data->y)/this->aspectRatio;
+ const float dy = (ry - this->data->y) / this->aspectRatio;
const float dx = rx - this->data->x;
- rx = this->data->x+(this->cosine*dx + this->sine*dy);
- ry = this->data->y+(-this->sine*dx + this->cosine*dy);
+ rx = this->data->x + (this->cosine * dx + this->sine * dy);
+ ry = this->data->y + (-this->sine * dx + this->cosine * dy);
this->inputMask->read(inputMask, x, y, sampler, inputBuffers);
this->inputValue->read(inputValue, x, y, sampler, inputBuffers);
@@ -70,7 +70,7 @@ void BoxMaskOperation::executePixel(float *color, float x, float y, PixelSampler
switch (this->maskType) {
case CMP_NODE_MASKTYPE_ADD:
if (inside) {
- color[0] = max(inputMask[0],inputValue[0]);
+ color[0] = max(inputMask[0], inputValue[0]);
}
else {
color[0] = inputMask[0];
@@ -78,7 +78,7 @@ void BoxMaskOperation::executePixel(float *color, float x, float y, PixelSampler
break;
case CMP_NODE_MASKTYPE_SUBTRACT:
if (inside) {
- color[0] = inputMask[0]-inputValue[0];
+ color[0] = inputMask[0] - inputValue[0];
CLAMP(color[0], 0, 1);
}
else {
@@ -87,24 +87,24 @@ void BoxMaskOperation::executePixel(float *color, float x, float y, PixelSampler
break;
case CMP_NODE_MASKTYPE_MULTIPLY:
if (inside) {
- color[0] = inputMask[0]*inputValue[0];
+ color[0] = inputMask[0] * inputValue[0];
}
else {
color[0] = 0;
}
break;
case CMP_NODE_MASKTYPE_NOT:
- if (inside) {
- if (inputMask[0]>0.0f) {
- color[0] = 0;
+ if (inside) {
+ if (inputMask[0] > 0.0f) {
+ color[0] = 0;
+ }
+ else {
+ color[0] = inputValue[0];
+ }
}
else {
- color[0] = inputValue[0];
+ color[0] = inputMask[0];
}
- }
- else {
- color[0] = inputMask[0];
- }
break;
}