diff options
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. */ } } |