diff options
Diffstat (limited to 'source/blender/compositor/operations/COM_KeyingDespillOperation.cc')
-rw-r--r-- | source/blender/compositor/operations/COM_KeyingDespillOperation.cc | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/source/blender/compositor/operations/COM_KeyingDespillOperation.cc b/source/blender/compositor/operations/COM_KeyingDespillOperation.cc index 8b090d5dc38..f819a39e9e0 100644 --- a/source/blender/compositor/operations/COM_KeyingDespillOperation.cc +++ b/source/blender/compositor/operations/COM_KeyingDespillOperation.cc @@ -22,42 +22,42 @@ namespace blender::compositor { KeyingDespillOperation::KeyingDespillOperation() { - this->addInputSocket(DataType::Color); - this->addInputSocket(DataType::Color); - this->addOutputSocket(DataType::Color); + this->add_input_socket(DataType::Color); + this->add_input_socket(DataType::Color); + this->add_output_socket(DataType::Color); - despillFactor_ = 0.5f; - colorBalance_ = 0.5f; + despill_factor_ = 0.5f; + color_balance_ = 0.5f; - pixelReader_ = nullptr; - screenReader_ = nullptr; + pixel_reader_ = nullptr; + screen_reader_ = nullptr; flags.can_be_constant = true; } -void KeyingDespillOperation::initExecution() +void KeyingDespillOperation::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 KeyingDespillOperation::deinitExecution() +void KeyingDespillOperation::deinit_execution() { - pixelReader_ = nullptr; - screenReader_ = nullptr; + pixel_reader_ = nullptr; + screen_reader_ = nullptr; } -void KeyingDespillOperation::executePixelSampled(float output[4], - float x, - float y, - PixelSampler sampler) +void KeyingDespillOperation::execute_pixel_sampled(float output[4], + float x, + float y, + PixelSampler sampler) { - float pixelColor[4]; - float screenColor[4]; + float pixel_color[4]; + float screen_color[4]; - pixelReader_->readSampled(pixelColor, x, y, sampler); - screenReader_->readSampled(screenColor, x, y, sampler); + pixel_reader_->read_sampled(pixel_color, x, y, sampler); + screen_reader_->read_sampled(screen_color, x, y, sampler); - const int screen_primary_channel = max_axis_v3(screenColor); + const int screen_primary_channel = max_axis_v3(screen_color); const int other_1 = (screen_primary_channel + 1) % 3; const int other_2 = (screen_primary_channel + 2) % 3; @@ -66,15 +66,15 @@ void KeyingDespillOperation::executePixelSampled(float output[4], float average_value, amount; - average_value = colorBalance_ * pixelColor[min_channel] + - (1.0f - colorBalance_) * pixelColor[max_channel]; - amount = (pixelColor[screen_primary_channel] - average_value); + average_value = color_balance_ * pixel_color[min_channel] + + (1.0f - color_balance_) * pixel_color[max_channel]; + amount = (pixel_color[screen_primary_channel] - average_value); - copy_v4_v4(output, pixelColor); + copy_v4_v4(output, pixel_color); - const float amount_despill = despillFactor_ * amount; + const float amount_despill = despill_factor_ * amount; if (amount_despill > 0.0f) { - output[screen_primary_channel] = pixelColor[screen_primary_channel] - amount_despill; + output[screen_primary_channel] = pixel_color[screen_primary_channel] - amount_despill; } } @@ -93,13 +93,13 @@ void KeyingDespillOperation::update_memory_buffer_partial(MemoryBuffer *output, const int min_channel = MIN2(other_1, other_2); const int max_channel = MAX2(other_1, other_2); - const float average_value = colorBalance_ * pixel_color[min_channel] + - (1.0f - colorBalance_) * pixel_color[max_channel]; + const float average_value = color_balance_ * pixel_color[min_channel] + + (1.0f - color_balance_) * pixel_color[max_channel]; const float amount = (pixel_color[screen_primary_channel] - average_value); copy_v4_v4(it.out, pixel_color); - const float amount_despill = despillFactor_ * amount; + const float amount_despill = despill_factor_ * amount; if (amount_despill > 0.0f) { it.out[screen_primary_channel] = pixel_color[screen_primary_channel] - amount_despill; } |