Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Castilla <manzanillawork@gmail.com>2021-10-14 00:01:15 +0300
committerManuel Castilla <manzanillawork@gmail.com>2021-10-14 00:41:14 +0300
commit1c42d4930a24d639b3aa561b9a8b4bbce05977e0 (patch)
tree68c2aae3fd5ae98b78708bea28c0b55d3f4fb5f0 /source/blender/compositor/operations/COM_ChromaMatteOperation.cc
parenta2ee3c3a9f01f5cb2f05f1e84a1b6c1931d9d4a4 (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_ChromaMatteOperation.cc')
-rw-r--r--source/blender/compositor/operations/COM_ChromaMatteOperation.cc64
1 files changed, 32 insertions, 32 deletions
diff --git a/source/blender/compositor/operations/COM_ChromaMatteOperation.cc b/source/blender/compositor/operations/COM_ChromaMatteOperation.cc
index 172460e9203..fceb0ea1c23 100644
--- a/source/blender/compositor/operations/COM_ChromaMatteOperation.cc
+++ b/source/blender/compositor/operations/COM_ChromaMatteOperation.cc
@@ -22,34 +22,34 @@ namespace blender::compositor {
ChromaMatteOperation::ChromaMatteOperation()
{
- 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 ChromaMatteOperation::initExecution()
+void ChromaMatteOperation::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 ChromaMatteOperation::deinitExecution()
+void ChromaMatteOperation::deinit_execution()
{
- inputImageProgram_ = nullptr;
- inputKeyProgram_ = nullptr;
+ input_image_program_ = nullptr;
+ input_key_program_ = nullptr;
}
-void ChromaMatteOperation::executePixelSampled(float output[4],
- float x,
- float y,
- PixelSampler sampler)
+void ChromaMatteOperation::execute_pixel_sampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
{
- float inKey[4];
- float inImage[4];
+ float in_key[4];
+ float in_image[4];
const float acceptance = settings_->t1; /* in radians */
const float cutoff = settings_->t2; /* in radians */
@@ -59,8 +59,8 @@ void ChromaMatteOperation::executePixelSampled(float output[4],
float theta, beta;
float kfg;
- inputKeyProgram_->readSampled(inKey, x, y, sampler);
- inputImageProgram_->readSampled(inImage, x, y, sampler);
+ input_key_program_->read_sampled(in_key, x, y, sampler);
+ input_image_program_->read_sampled(in_image, x, y, sampler);
/* Store matte(alpha) value in [0] to go with
* #COM_SetAlphaMultiplyOperation and the Value output. */
@@ -69,19 +69,19 @@ void ChromaMatteOperation::executePixelSampled(float output[4],
/* Find theta, the angle that the color space should be rotated based on key. */
/* rescale to -1.0..1.0 */
- // inImage[0] = (inImage[0] * 2.0f) - 1.0f; // UNUSED
- inImage[1] = (inImage[1] * 2.0f) - 1.0f;
- inImage[2] = (inImage[2] * 2.0f) - 1.0f;
+ // in_image[0] = (in_image[0] * 2.0f) - 1.0f; // UNUSED
+ in_image[1] = (in_image[1] * 2.0f) - 1.0f;
+ in_image[2] = (in_image[2] * 2.0f) - 1.0f;
- // inKey[0] = (inKey[0] * 2.0f) - 1.0f; // UNUSED
- inKey[1] = (inKey[1] * 2.0f) - 1.0f;
- inKey[2] = (inKey[2] * 2.0f) - 1.0f;
+ // in_key[0] = (in_key[0] * 2.0f) - 1.0f; // UNUSED
+ in_key[1] = (in_key[1] * 2.0f) - 1.0f;
+ in_key[2] = (in_key[2] * 2.0f) - 1.0f;
- theta = atan2(inKey[2], inKey[1]);
+ theta = atan2(in_key[2], in_key[1]);
/* Rotate the cb and cr into x/z space. */
- x_angle = inImage[1] * cosf(theta) + inImage[2] * sinf(theta);
- z_angle = inImage[2] * cosf(theta) - inImage[1] * sinf(theta);
+ x_angle = in_image[1] * cosf(theta) + in_image[2] * sinf(theta);
+ z_angle = in_image[2] * cosf(theta) - in_image[1] * sinf(theta);
/* If within the acceptance angle. */
/* If kfg is <0 then the pixel is outside of the key color. */
@@ -98,15 +98,15 @@ void ChromaMatteOperation::executePixelSampled(float output[4],
}
/* don't make something that was more transparent less transparent */
- if (alpha < inImage[3]) {
+ if (alpha < in_image[3]) {
output[0] = alpha;
}
else {
- output[0] = inImage[3];
+ output[0] = in_image[3];
}
}
- else { /* Pixel is outside key color. */
- output[0] = inImage[3]; /* Make pixel just as transparent as it was before. */
+ else { /* Pixel is outside key color. */
+ output[0] = in_image[3]; /* Make pixel just as transparent as it was before. */
}
}