diff options
author | Manuel Castilla <manzanillawork@gmail.com> | 2021-10-14 00:01:15 +0300 |
---|---|---|
committer | Manuel Castilla <manzanillawork@gmail.com> | 2021-10-14 00:41:14 +0300 |
commit | 1c42d4930a24d639b3aa561b9a8b4bbce05977e0 (patch) | |
tree | 68c2aae3fd5ae98b78708bea28c0b55d3f4fb5f0 /source/blender/compositor/operations/COM_ColorMatteOperation.cc | |
parent | a2ee3c3a9f01f5cb2f05f1e84a1b6c1931d9d4a4 (diff) |
Cleanup: convert camelCase naming to snake_case in Compositor
To convert old code to the current convention and
use a single code style.
Diffstat (limited to 'source/blender/compositor/operations/COM_ColorMatteOperation.cc')
-rw-r--r-- | source/blender/compositor/operations/COM_ColorMatteOperation.cc | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/source/blender/compositor/operations/COM_ColorMatteOperation.cc b/source/blender/compositor/operations/COM_ColorMatteOperation.cc index c693e7d06e1..c4bf1bdf1cf 100644 --- a/source/blender/compositor/operations/COM_ColorMatteOperation.cc +++ b/source/blender/compositor/operations/COM_ColorMatteOperation.cc @@ -22,34 +22,34 @@ namespace blender::compositor { ColorMatteOperation::ColorMatteOperation() { - addInputSocket(DataType::Color); - addInputSocket(DataType::Color); - addOutputSocket(DataType::Value); + add_input_socket(DataType::Color); + add_input_socket(DataType::Color); + add_output_socket(DataType::Value); - inputImageProgram_ = nullptr; - inputKeyProgram_ = nullptr; + input_image_program_ = nullptr; + input_key_program_ = nullptr; flags.can_be_constant = true; } -void ColorMatteOperation::initExecution() +void ColorMatteOperation::init_execution() { - inputImageProgram_ = this->getInputSocketReader(0); - inputKeyProgram_ = this->getInputSocketReader(1); + input_image_program_ = this->get_input_socket_reader(0); + input_key_program_ = this->get_input_socket_reader(1); } -void ColorMatteOperation::deinitExecution() +void ColorMatteOperation::deinit_execution() { - inputImageProgram_ = nullptr; - inputKeyProgram_ = nullptr; + input_image_program_ = nullptr; + input_key_program_ = nullptr; } -void ColorMatteOperation::executePixelSampled(float output[4], - float x, - float y, - PixelSampler sampler) +void ColorMatteOperation::execute_pixel_sampled(float output[4], + float x, + float y, + PixelSampler sampler) { - float inColor[4]; - float inKey[4]; + float in_color[4]; + float in_key[4]; const float hue = settings_->t1; const float sat = settings_->t2; @@ -57,8 +57,8 @@ void ColorMatteOperation::executePixelSampled(float output[4], float h_wrap; - inputImageProgram_->readSampled(inColor, x, y, sampler); - inputKeyProgram_->readSampled(inKey, x, y, sampler); + input_image_program_->read_sampled(in_color, x, y, sampler); + input_key_program_->read_sampled(in_key, x, y, sampler); /* Store matte(alpha) value in [0] to go with * COM_SetAlphaMultiplyOperation and the Value output. @@ -67,18 +67,19 @@ void ColorMatteOperation::executePixelSampled(float output[4], if ( /* Do hue last because it needs to wrap, and does some more checks. */ - /* sat */ (fabsf(inColor[1] - inKey[1]) < sat) && - /* val */ (fabsf(inColor[2] - inKey[2]) < val) && + /* sat */ (fabsf(in_color[1] - in_key[1]) < sat) && + /* val */ (fabsf(in_color[2] - in_key[2]) < val) && /* multiply by 2 because it wraps on both sides of the hue, * otherwise 0.5 would key all hue's */ - /* hue */ ((h_wrap = 2.0f * fabsf(inColor[0] - inKey[0])) < hue || (2.0f - h_wrap) < hue)) { + /* hue */ + ((h_wrap = 2.0f * fabsf(in_color[0] - in_key[0])) < hue || (2.0f - h_wrap) < hue)) { output[0] = 0.0f; /* make transparent */ } - else { /* Pixel is outside key color. */ - output[0] = inColor[3]; /* Make pixel just as transparent as it was before. */ + else { /* Pixel is outside key color. */ + output[0] = in_color[3]; /* Make pixel just as transparent as it was before. */ } } |