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_KeyingOperation.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_KeyingOperation.cc')
-rw-r--r-- | source/blender/compositor/operations/COM_KeyingOperation.cc | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/source/blender/compositor/operations/COM_KeyingOperation.cc b/source/blender/compositor/operations/COM_KeyingOperation.cc index 7a7fe716fb5..c7ab3aca2e2 100644 --- a/source/blender/compositor/operations/COM_KeyingOperation.cc +++ b/source/blender/compositor/operations/COM_KeyingOperation.cc @@ -20,7 +20,7 @@ namespace blender::compositor { -static float get_pixel_saturation(const float pixelColor[4], +static float get_pixel_saturation(const float pixel_color[4], float screen_balance, int primary_channel) { @@ -30,43 +30,46 @@ static float get_pixel_saturation(const float pixelColor[4], const int min_channel = MIN2(other_1, other_2); const int max_channel = MAX2(other_1, other_2); - const float val = screen_balance * pixelColor[min_channel] + - (1.0f - screen_balance) * pixelColor[max_channel]; + const float val = screen_balance * pixel_color[min_channel] + + (1.0f - screen_balance) * pixel_color[max_channel]; - return (pixelColor[primary_channel] - val) * fabsf(1.0f - val); + return (pixel_color[primary_channel] - val) * fabsf(1.0f - val); } KeyingOperation::KeyingOperation() { - this->addInputSocket(DataType::Color); - this->addInputSocket(DataType::Color); - this->addOutputSocket(DataType::Value); + this->add_input_socket(DataType::Color); + this->add_input_socket(DataType::Color); + this->add_output_socket(DataType::Value); - screenBalance_ = 0.5f; + screen_balance_ = 0.5f; - pixelReader_ = nullptr; - screenReader_ = nullptr; + pixel_reader_ = nullptr; + screen_reader_ = nullptr; } -void KeyingOperation::initExecution() +void KeyingOperation::init_execution() { - pixelReader_ = this->getInputSocketReader(0); - screenReader_ = this->getInputSocketReader(1); + pixel_reader_ = this->get_input_socket_reader(0); + screen_reader_ = this->get_input_socket_reader(1); } -void KeyingOperation::deinitExecution() +void KeyingOperation::deinit_execution() { - pixelReader_ = nullptr; - screenReader_ = nullptr; + pixel_reader_ = nullptr; + screen_reader_ = nullptr; } -void KeyingOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler) +void KeyingOperation::execute_pixel_sampled(float output[4], + float x, + float y, + PixelSampler sampler) { float pixel_color[4]; float screen_color[4]; - pixelReader_->readSampled(pixel_color, x, y, sampler); - screenReader_->readSampled(screen_color, x, y, sampler); + pixel_reader_->read_sampled(pixel_color, x, y, sampler); + screen_reader_->read_sampled(screen_color, x, y, sampler); const int primary_channel = max_axis_v3(screen_color); const float min_pixel_color = min_fff(pixel_color[0], pixel_color[1], pixel_color[2]); @@ -80,8 +83,8 @@ void KeyingOperation::executePixelSampled(float output[4], float x, float y, Pix output[0] = 1.0f; } else { - float saturation = get_pixel_saturation(pixel_color, screenBalance_, primary_channel); - float screen_saturation = get_pixel_saturation(screen_color, screenBalance_, primary_channel); + float saturation = get_pixel_saturation(pixel_color, screen_balance_, primary_channel); + float screen_saturation = get_pixel_saturation(screen_color, screen_balance_, primary_channel); if (saturation < 0) { /* means main channel of pixel is different from screen, @@ -124,9 +127,9 @@ void KeyingOperation::update_memory_buffer_partial(MemoryBuffer *output, it.out[0] = 1.0f; } else { - const float saturation = get_pixel_saturation(pixel_color, screenBalance_, primary_channel); + const float saturation = get_pixel_saturation(pixel_color, screen_balance_, primary_channel); const float screen_saturation = get_pixel_saturation( - screen_color, screenBalance_, primary_channel); + screen_color, screen_balance_, primary_channel); if (saturation < 0) { /* Means main channel of pixel is different from screen, |