diff options
Diffstat (limited to 'source/blender/compositor/operations/COM_BrightnessOperation.cc')
-rw-r--r-- | source/blender/compositor/operations/COM_BrightnessOperation.cc | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/source/blender/compositor/operations/COM_BrightnessOperation.cc b/source/blender/compositor/operations/COM_BrightnessOperation.cc index 77f30331767..a445bb122c2 100644 --- a/source/blender/compositor/operations/COM_BrightnessOperation.cc +++ b/source/blender/compositor/operations/COM_BrightnessOperation.cc @@ -22,41 +22,41 @@ namespace blender::compositor { BrightnessOperation::BrightnessOperation() { - this->addInputSocket(DataType::Color); - this->addInputSocket(DataType::Value); - this->addInputSocket(DataType::Value); - this->addOutputSocket(DataType::Color); - inputProgram_ = nullptr; + this->add_input_socket(DataType::Color); + this->add_input_socket(DataType::Value); + this->add_input_socket(DataType::Value); + this->add_output_socket(DataType::Color); + input_program_ = nullptr; use_premultiply_ = false; flags.can_be_constant = true; } -void BrightnessOperation::setUsePremultiply(bool use_premultiply) +void BrightnessOperation::set_use_premultiply(bool use_premultiply) { use_premultiply_ = use_premultiply; } -void BrightnessOperation::initExecution() +void BrightnessOperation::init_execution() { - inputProgram_ = this->getInputSocketReader(0); - inputBrightnessProgram_ = this->getInputSocketReader(1); - inputContrastProgram_ = this->getInputSocketReader(2); + input_program_ = this->get_input_socket_reader(0); + input_brightness_program_ = this->get_input_socket_reader(1); + input_contrast_program_ = this->get_input_socket_reader(2); } -void BrightnessOperation::executePixelSampled(float output[4], - float x, - float y, - PixelSampler sampler) +void BrightnessOperation::execute_pixel_sampled(float output[4], + float x, + float y, + PixelSampler sampler) { - float inputValue[4]; + float input_value[4]; float a, b; - float inputBrightness[4]; - float inputContrast[4]; - inputProgram_->readSampled(inputValue, x, y, sampler); - inputBrightnessProgram_->readSampled(inputBrightness, x, y, sampler); - inputContrastProgram_->readSampled(inputContrast, x, y, sampler); - float brightness = inputBrightness[0]; - float contrast = inputContrast[0]; + float input_brightness[4]; + float input_contrast[4]; + input_program_->read_sampled(input_value, x, y, sampler); + input_brightness_program_->read_sampled(input_brightness, x, y, sampler); + input_contrast_program_->read_sampled(input_contrast, x, y, sampler); + float brightness = input_brightness[0]; + float contrast = input_contrast[0]; brightness /= 100.0f; float delta = contrast / 200.0f; /* @@ -75,12 +75,12 @@ void BrightnessOperation::executePixelSampled(float output[4], b = a * brightness + delta; } if (use_premultiply_) { - premul_to_straight_v4(inputValue); + premul_to_straight_v4(input_value); } - output[0] = a * inputValue[0] + b; - output[1] = a * inputValue[1] + b; - output[2] = a * inputValue[2] + b; - output[3] = inputValue[3]; + output[0] = a * input_value[0] + b; + output[1] = a * input_value[1] + b; + output[2] = a * input_value[2] + b; + output[3] = input_value[3]; if (use_premultiply_) { straight_to_premul_v4(output); } @@ -130,11 +130,11 @@ void BrightnessOperation::update_memory_buffer_partial(MemoryBuffer *output, } } -void BrightnessOperation::deinitExecution() +void BrightnessOperation::deinit_execution() { - inputProgram_ = nullptr; - inputBrightnessProgram_ = nullptr; - inputContrastProgram_ = nullptr; + input_program_ = nullptr; + input_brightness_program_ = nullptr; + input_contrast_program_ = nullptr; } } // namespace blender::compositor |