diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-11-06 16:44:51 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-11-06 16:44:51 +0400 |
commit | b91e841f8fa1af0d378870c614880d1b06cc9143 (patch) | |
tree | aa6a26fcbb647bd94b1e0a533f0bffe90918d6bc /source/blender/compositor | |
parent | b9aa637b83e79d09781a351a956a60b545a7cec9 (diff) |
Fix #37333: Bad default value in Color Balance. Use independent offset/power/slope variables for the CDL mode in color balance node. This avoids stupid default values in particular for offset, which would be 1 when just using the lift value for it.
Diffstat (limited to 'source/blender/compositor')
3 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/compositor/nodes/COM_ColorBalanceNode.cpp b/source/blender/compositor/nodes/COM_ColorBalanceNode.cpp index 68829940da5..2b396fb9861 100644 --- a/source/blender/compositor/nodes/COM_ColorBalanceNode.cpp +++ b/source/blender/compositor/nodes/COM_ColorBalanceNode.cpp @@ -57,9 +57,9 @@ void ColorBalanceNode::convertToOperations(ExecutionSystem *graph, CompositorCon } else { ColorBalanceASCCDLOperation *operationCDL = new ColorBalanceASCCDLOperation(); - operationCDL->setGain(n->gain); - operationCDL->setLift(n->lift); - operationCDL->setGamma(n->gamma); + operationCDL->setOffset(n->offset); + operationCDL->setPower(n->power); + operationCDL->setSlope(n->slope); operation = operationCDL; } diff --git a/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cpp b/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cpp index aa4d0932c92..1456aaf6a55 100644 --- a/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cpp +++ b/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cpp @@ -61,9 +61,9 @@ void ColorBalanceASCCDLOperation::executePixel(float output[4], float x, float y fac = min(1.0f, fac); const float mfac = 1.0f - fac; - output[0] = mfac * inputColor[0] + fac * colorbalance_cdl(inputColor[0], this->m_lift[0], this->m_gamma[0], this->m_gain[0]); - output[1] = mfac * inputColor[1] + fac * colorbalance_cdl(inputColor[1], this->m_lift[1], this->m_gamma[1], this->m_gain[1]); - output[2] = mfac * inputColor[2] + fac * colorbalance_cdl(inputColor[2], this->m_lift[2], this->m_gamma[2], this->m_gain[2]); + output[0] = mfac * inputColor[0] + fac * colorbalance_cdl(inputColor[0], this->m_offset[0], this->m_power[0], this->m_slope[0]); + output[1] = mfac * inputColor[1] + fac * colorbalance_cdl(inputColor[1], this->m_offset[1], this->m_power[1], this->m_slope[1]); + output[2] = mfac * inputColor[2] + fac * colorbalance_cdl(inputColor[2], this->m_offset[2], this->m_power[2], this->m_slope[2]); output[3] = inputColor[3]; } diff --git a/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.h b/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.h index 17fb5f67be9..ee0b89f7f70 100644 --- a/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.h +++ b/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.h @@ -36,9 +36,9 @@ protected: SocketReader *m_inputValueOperation; SocketReader *m_inputColorOperation; - float m_gain[3]; - float m_lift[3]; - float m_gamma[3]; + float m_offset[3]; + float m_power[3]; + float m_slope[3]; public: /** @@ -61,8 +61,8 @@ public: */ void deinitExecution(); - void setGain(float gain[3]) { copy_v3_v3(this->m_gain, gain); } - void setLift(float lift[3]) { copy_v3_v3(this->m_lift, lift); } - void setGamma(float gamma[3]) { copy_v3_v3(this->m_gamma, gamma); } + void setOffset(float offset[3]) { copy_v3_v3(this->m_offset, offset); } + void setPower(float power[3]) { copy_v3_v3(this->m_power, power); } + void setSlope(float slope[3]) { copy_v3_v3(this->m_slope, slope); } }; #endif |