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_ColorCurveOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_ColorCurveOperation.cpp30
1 files changed, 17 insertions, 13 deletions
diff --git a/source/blender/compositor/operations/COM_ColorCurveOperation.cpp b/source/blender/compositor/operations/COM_ColorCurveOperation.cpp
index 375d7269124..8aee54013b1 100644
--- a/source/blender/compositor/operations/COM_ColorCurveOperation.cpp
+++ b/source/blender/compositor/operations/COM_ColorCurveOperation.cpp
@@ -30,7 +30,8 @@ extern "C" {
}
#endif
-ColorCurveOperation::ColorCurveOperation(): CurveBaseOperation() {
+ColorCurveOperation::ColorCurveOperation(): CurveBaseOperation()
+{
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_COLOR);
@@ -44,7 +45,8 @@ ColorCurveOperation::ColorCurveOperation(): CurveBaseOperation() {
this->setResolutionInputSocketIndex(1);
}
-void ColorCurveOperation::initExecution() {
+void ColorCurveOperation::initExecution()
+{
CurveBaseOperation::initExecution();
this->inputFacProgram = this->getInputSocketReader(0);
this->inputImageProgram = this->getInputSocketReader(1);
@@ -55,7 +57,8 @@ void ColorCurveOperation::initExecution() {
}
-void ColorCurveOperation::executePixel(float* color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]) {
+void ColorCurveOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
+{
float black[4];
float white[4];
float fac[4];
@@ -69,24 +72,25 @@ void ColorCurveOperation::executePixel(float* color, float x, float y, PixelSamp
this->inputFacProgram->read(fac, x, y, sampler, inputBuffers);
this->inputImageProgram->read(image, x, y, sampler, inputBuffers);
- if (fac[0]>=1.0)
+ if (fac[0] >= 1.0)
curvemapping_evaluate_premulRGBF(this->curveMapping, color, image);
else if (*fac<=0.0) {
- color[0]= image[0];
- color[1]= image[1];
- color[2]= image[2];
+ color[0] = image[0];
+ color[1] = image[1];
+ color[2] = image[2];
}
else {
- float col[4], mfac= 1.0f-*fac;
+ float col[4], mfac = 1.0f-*fac;
curvemapping_evaluate_premulRGBF(this->curveMapping, col, image);
- color[0]= mfac*image[0] + *fac*col[0];
- color[1]= mfac*image[1] + *fac*col[1];
- color[2]= mfac*image[2] + *fac*col[2];
+ color[0] = mfac*image[0] + *fac*col[0];
+ color[1] = mfac*image[1] + *fac*col[1];
+ color[2] = mfac*image[2] + *fac*col[2];
}
- color[3]= image[3];
+ color[3] = image[3];
}
-void ColorCurveOperation::deinitExecution() {
+void ColorCurveOperation::deinitExecution()
+{
this->inputFacProgram = NULL;
this->inputImageProgram = NULL;
this->inputBlackProgram = NULL;