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:
Diffstat (limited to 'source/blender/compositor/operations/COM_ColorSpillOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_ColorSpillOperation.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/source/blender/compositor/operations/COM_ColorSpillOperation.cpp b/source/blender/compositor/operations/COM_ColorSpillOperation.cpp
index 56f45c0fdeb..56141efe681 100644
--- a/source/blender/compositor/operations/COM_ColorSpillOperation.cpp
+++ b/source/blender/compositor/operations/COM_ColorSpillOperation.cpp
@@ -24,7 +24,8 @@
#include "BLI_math.h"
#define avg(a,b) ((a+b)/2)
-ColorSpillOperation::ColorSpillOperation(): NodeOperation() {
+ColorSpillOperation::ColorSpillOperation(): NodeOperation()
+{
addInputSocket(COM_DT_COLOR);
addInputSocket(COM_DT_VALUE);
addOutputSocket(COM_DT_COLOR);
@@ -34,7 +35,8 @@ ColorSpillOperation::ColorSpillOperation(): NodeOperation() {
this->spillChannel = 1; // GREEN
}
-void ColorSpillOperation::initExecution() {
+void ColorSpillOperation::initExecution()
+{
this->inputImageReader = this->getInputSocketReader(0);
this->inputFacReader = this->getInputSocketReader(1);
if (spillChannel == 0) {
@@ -76,12 +78,14 @@ void ColorSpillOperation::initExecution() {
}
}
-void ColorSpillOperation::deinitExecution() {
- this->inputImageReader= NULL;
+void ColorSpillOperation::deinitExecution()
+{
+ this->inputImageReader = NULL;
this->inputFacReader = NULL;
}
-void ColorSpillOperation::executePixel(float* outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]) {
+void ColorSpillOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
+{
float fac[4];
float input[4];
float map;
@@ -102,11 +106,13 @@ void ColorSpillOperation::executePixel(float* outputValue, float x, float y, Pix
outputValue[3]=input[3];
}
}
-float ColorSpillOperation::calculateMapValue(float fac, float *input) {
+float ColorSpillOperation::calculateMapValue(float fac, float *input)
+{
return fac * (input[this->spillChannel]-(this->settings->limscale*input[settings->limchan]));
}
-float ColorSpillAverageOperation::calculateMapValue(float fac, float *input) {
+float ColorSpillAverageOperation::calculateMapValue(float fac, float *input)
+{
return fac * (input[this->spillChannel]-(this->settings->limscale*avg(input[this->channel2], input[this->channel3])));
}