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_ColorBalanceASCCDLOperation.cc')
-rw-r--r--source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cc b/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cc
index d1d3752e402..aee8c0d52e8 100644
--- a/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cc
+++ b/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cc
@@ -41,6 +41,7 @@ ColorBalanceASCCDLOperation::ColorBalanceASCCDLOperation()
this->m_inputValueOperation = nullptr;
this->m_inputColorOperation = nullptr;
this->setResolutionInputSocketIndex(1);
+ flags.can_be_constant = true;
}
void ColorBalanceASCCDLOperation::initExecution()
@@ -76,6 +77,23 @@ void ColorBalanceASCCDLOperation::executePixelSampled(float output[4],
output[3] = inputColor[3];
}
+void ColorBalanceASCCDLOperation::update_memory_buffer_row(PixelCursor &p)
+{
+ for (; p.out < p.row_end; p.next()) {
+ const float *in_factor = p.ins[0];
+ const float *in_color = p.ins[1];
+ const float fac = MIN2(1.0f, in_factor[0]);
+ const float fac_m = 1.0f - fac;
+ p.out[0] = fac_m * in_color[0] +
+ fac * colorbalance_cdl(in_color[0], m_offset[0], m_power[0], m_slope[0]);
+ p.out[1] = fac_m * in_color[1] +
+ fac * colorbalance_cdl(in_color[1], m_offset[1], m_power[1], m_slope[1]);
+ p.out[2] = fac_m * in_color[2] +
+ fac * colorbalance_cdl(in_color[2], m_offset[2], m_power[2], m_slope[2]);
+ p.out[3] = in_color[3];
+ }
+}
+
void ColorBalanceASCCDLOperation::deinitExecution()
{
this->m_inputValueOperation = nullptr;