diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:17:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:21:24 +0300 |
commit | e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch) | |
tree | 8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/compositor/operations/COM_ColorSpillOperation.cpp | |
parent | b3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff) |
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/compositor/operations/COM_ColorSpillOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_ColorSpillOperation.cpp | 148 |
1 files changed, 77 insertions, 71 deletions
diff --git a/source/blender/compositor/operations/COM_ColorSpillOperation.cpp b/source/blender/compositor/operations/COM_ColorSpillOperation.cpp index 656ec1a7439..99ab6105934 100644 --- a/source/blender/compositor/operations/COM_ColorSpillOperation.cpp +++ b/source/blender/compositor/operations/COM_ColorSpillOperation.cpp @@ -22,90 +22,96 @@ ColorSpillOperation::ColorSpillOperation() : NodeOperation() { - addInputSocket(COM_DT_COLOR); - addInputSocket(COM_DT_VALUE); - addOutputSocket(COM_DT_COLOR); + addInputSocket(COM_DT_COLOR); + addInputSocket(COM_DT_VALUE); + addOutputSocket(COM_DT_COLOR); - this->m_inputImageReader = NULL; - this->m_inputFacReader = NULL; - this->m_spillChannel = 1; // GREEN - this->m_spillMethod = 0; + this->m_inputImageReader = NULL; + this->m_inputFacReader = NULL; + this->m_spillChannel = 1; // GREEN + this->m_spillMethod = 0; } void ColorSpillOperation::initExecution() { - this->m_inputImageReader = this->getInputSocketReader(0); - this->m_inputFacReader = this->getInputSocketReader(1); - if (this->m_spillChannel == 0) { - this->m_rmut = -1.0f; - this->m_gmut = 1.0f; - this->m_bmut = 1.0f; - this->m_channel2 = 1; - this->m_channel3 = 2; - if (this->m_settings->unspill == 0) { - this->m_settings->uspillr = 1.0f; - this->m_settings->uspillg = 0.0f; - this->m_settings->uspillb = 0.0f; - } - } - else if (this->m_spillChannel == 1) { - this->m_rmut = 1.0f; - this->m_gmut = -1.0f; - this->m_bmut = 1.0f; - this->m_channel2 = 0; - this->m_channel3 = 2; - if (this->m_settings->unspill == 0) { - this->m_settings->uspillr = 0.0f; - this->m_settings->uspillg = 1.0f; - this->m_settings->uspillb = 0.0f; - } - } - else { - this->m_rmut = 1.0f; - this->m_gmut = 1.0f; - this->m_bmut = -1.0f; + this->m_inputImageReader = this->getInputSocketReader(0); + this->m_inputFacReader = this->getInputSocketReader(1); + if (this->m_spillChannel == 0) { + this->m_rmut = -1.0f; + this->m_gmut = 1.0f; + this->m_bmut = 1.0f; + this->m_channel2 = 1; + this->m_channel3 = 2; + if (this->m_settings->unspill == 0) { + this->m_settings->uspillr = 1.0f; + this->m_settings->uspillg = 0.0f; + this->m_settings->uspillb = 0.0f; + } + } + else if (this->m_spillChannel == 1) { + this->m_rmut = 1.0f; + this->m_gmut = -1.0f; + this->m_bmut = 1.0f; + this->m_channel2 = 0; + this->m_channel3 = 2; + if (this->m_settings->unspill == 0) { + this->m_settings->uspillr = 0.0f; + this->m_settings->uspillg = 1.0f; + this->m_settings->uspillb = 0.0f; + } + } + else { + this->m_rmut = 1.0f; + this->m_gmut = 1.0f; + this->m_bmut = -1.0f; - this->m_channel2 = 0; - this->m_channel3 = 1; - if (this->m_settings->unspill == 0) { - this->m_settings->uspillr = 0.0f; - this->m_settings->uspillg = 0.0f; - this->m_settings->uspillb = 1.0f; - } - } + this->m_channel2 = 0; + this->m_channel3 = 1; + if (this->m_settings->unspill == 0) { + this->m_settings->uspillr = 0.0f; + this->m_settings->uspillg = 0.0f; + this->m_settings->uspillb = 1.0f; + } + } } void ColorSpillOperation::deinitExecution() { - this->m_inputImageReader = NULL; - this->m_inputFacReader = NULL; + this->m_inputImageReader = NULL; + this->m_inputFacReader = NULL; } -void ColorSpillOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler) +void ColorSpillOperation::executePixelSampled(float output[4], + float x, + float y, + PixelSampler sampler) { - float fac[4]; - float input[4]; - this->m_inputFacReader->readSampled(fac, x, y, sampler); - this->m_inputImageReader->readSampled(input, x, y, sampler); - float rfac = min(1.0f, fac[0]); - float map; + float fac[4]; + float input[4]; + this->m_inputFacReader->readSampled(fac, x, y, sampler); + this->m_inputImageReader->readSampled(input, x, y, sampler); + float rfac = min(1.0f, fac[0]); + float map; - switch (this->m_spillMethod) { - case 0: /* simple */ - map = rfac * (input[this->m_spillChannel] - (this->m_settings->limscale * input[this->m_settings->limchan])); - break; - default: /* average */ - map = rfac * (input[this->m_spillChannel] - (this->m_settings->limscale * AVG(input[this->m_channel2], input[this->m_channel3]))); - break; - } + switch (this->m_spillMethod) { + case 0: /* simple */ + map = rfac * (input[this->m_spillChannel] - + (this->m_settings->limscale * input[this->m_settings->limchan])); + break; + default: /* average */ + map = rfac * + (input[this->m_spillChannel] - + (this->m_settings->limscale * AVG(input[this->m_channel2], input[this->m_channel3]))); + break; + } - if (map > 0.0f) { - output[0] = input[0] + this->m_rmut * (this->m_settings->uspillr * map); - output[1] = input[1] + this->m_gmut * (this->m_settings->uspillg * map); - output[2] = input[2] + this->m_bmut * (this->m_settings->uspillb * map); - output[3] = input[3]; - } - else { - copy_v4_v4(output, input); - } + if (map > 0.0f) { + output[0] = input[0] + this->m_rmut * (this->m_settings->uspillr * map); + output[1] = input[1] + this->m_gmut * (this->m_settings->uspillg * map); + output[2] = input[2] + this->m_bmut * (this->m_settings->uspillb * map); + output[3] = input[3]; + } + else { + copy_v4_v4(output, input); + } } |