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-08 02:09:26 +0300
committerManuel Castilla <manzanillawork@gmail.com>2021-10-08 02:29:02 +0300
commit4a22faf15a0cd027f724d515d06b24ba47cac03c (patch)
tree2f5fe18a57b9523eb1339284a05dab2d199d5db4 /source/blender/compositor/operations/COM_MapUVOperation.cc
parent12a5a605572d742335a4978966444d393792cd28 (diff)
Cleanup: Convert camelCase naming to snake_case in Compositortemp-compositor-cleanups
To follow the style guide.
Diffstat (limited to 'source/blender/compositor/operations/COM_MapUVOperation.cc')
-rw-r--r--source/blender/compositor/operations/COM_MapUVOperation.cc88
1 files changed, 44 insertions, 44 deletions
diff --git a/source/blender/compositor/operations/COM_MapUVOperation.cc b/source/blender/compositor/operations/COM_MapUVOperation.cc
index a5140c30fed..fb4fcff381d 100644
--- a/source/blender/compositor/operations/COM_MapUVOperation.cc
+++ b/source/blender/compositor/operations/COM_MapUVOperation.cc
@@ -22,55 +22,55 @@ namespace blender::compositor {
MapUVOperation::MapUVOperation()
{
- this->addInputSocket(DataType::Color, ResizeMode::Align);
- this->addInputSocket(DataType::Vector);
- this->addOutputSocket(DataType::Color);
+ this->add_input_socket(DataType::Color, ResizeMode::Align);
+ this->add_input_socket(DataType::Vector);
+ this->add_output_socket(DataType::Color);
alpha_ = 0.0f;
this->flags.complex = true;
set_canvas_input_index(UV_INPUT_INDEX);
inputUVProgram_ = nullptr;
- inputColorProgram_ = nullptr;
+ input_color_program_ = nullptr;
}
void MapUVOperation::init_data()
{
NodeOperation *image_input = get_input_operation(IMAGE_INPUT_INDEX);
- image_width_ = image_input->getWidth();
- image_height_ = image_input->getHeight();
+ image_width_ = image_input->get_width();
+ image_height_ = image_input->get_height();
NodeOperation *uv_input = get_input_operation(UV_INPUT_INDEX);
- uv_width_ = uv_input->getWidth();
- uv_height_ = uv_input->getHeight();
+ uv_width_ = uv_input->get_width();
+ uv_height_ = uv_input->get_height();
}
-void MapUVOperation::initExecution()
+void MapUVOperation::init_execution()
{
- inputColorProgram_ = this->getInputSocketReader(0);
- inputUVProgram_ = this->getInputSocketReader(1);
+ input_color_program_ = this->get_input_socket_reader(0);
+ inputUVProgram_ = this->get_input_socket_reader(1);
if (execution_model_ == eExecutionModel::Tiled) {
uv_input_read_fn_ = [=](float x, float y, float *out) {
- inputUVProgram_->readSampled(out, x, y, PixelSampler::Bilinear);
+ inputUVProgram_->read_sampled(out, x, y, PixelSampler::Bilinear);
};
}
}
-void MapUVOperation::executePixelSampled(float output[4],
- float x,
- float y,
- PixelSampler /*sampler*/)
+void MapUVOperation::execute_pixel_sampled(float output[4],
+ float x,
+ float y,
+ PixelSampler /*sampler*/)
{
float xy[2] = {x, y};
float uv[2], deriv[2][2], alpha;
- pixelTransform(xy, uv, deriv, alpha);
+ pixel_transform(xy, uv, deriv, alpha);
if (alpha == 0.0f) {
zero_v4(output);
return;
}
/* EWA filtering */
- inputColorProgram_->readFiltered(output, uv[0], uv[1], deriv[0], deriv[1]);
+ input_color_program_->read_filtered(output, uv[0], uv[1], deriv[0], deriv[1]);
/* UV to alpha threshold */
const float threshold = alpha_ * 0.05f;
@@ -79,8 +79,8 @@ void MapUVOperation::executePixelSampled(float output[4],
*/
float du = len_v2(deriv[0]);
float dv = len_v2(deriv[1]);
- float factor = 1.0f - threshold * (du / inputColorProgram_->getWidth() +
- dv / inputColorProgram_->getHeight());
+ float factor = 1.0f - threshold * (du / input_color_program_->get_width() +
+ dv / input_color_program_->get_height());
if (factor < 0.0f) {
alpha = 0.0f;
}
@@ -111,10 +111,10 @@ bool MapUVOperation::read_uv(float x, float y, float &r_u, float &r_v, float &r_
return true;
}
-void MapUVOperation::pixelTransform(const float xy[2],
- float r_uv[2],
- float r_deriv[2][2],
- float &r_alpha)
+void MapUVOperation::pixel_transform(const float xy[2],
+ float r_uv[2],
+ float r_deriv[2][2],
+ float &r_alpha)
{
float uv[2], alpha; /* temporary variables for derivative estimation */
int num;
@@ -162,37 +162,37 @@ void MapUVOperation::pixelTransform(const float xy[2],
}
}
-void MapUVOperation::deinitExecution()
+void MapUVOperation::deinit_execution()
{
inputUVProgram_ = nullptr;
- inputColorProgram_ = nullptr;
+ input_color_program_ = nullptr;
}
-bool MapUVOperation::determineDependingAreaOfInterest(rcti *input,
- ReadBufferOperation *readOperation,
- rcti *output)
+bool MapUVOperation::determine_depending_area_of_interest(rcti *input,
+ ReadBufferOperation *read_operation,
+ rcti *output)
{
- rcti colorInput;
- rcti uvInput;
+ rcti color_input;
+ rcti uv_input;
NodeOperation *operation = nullptr;
/* the uv buffer only needs a 3x3 buffer. The image needs whole buffer */
- operation = getInputOperation(0);
- colorInput.xmax = operation->getWidth();
- colorInput.xmin = 0;
- colorInput.ymax = operation->getHeight();
- colorInput.ymin = 0;
- if (operation->determineDependingAreaOfInterest(&colorInput, readOperation, output)) {
+ operation = get_input_operation(0);
+ color_input.xmax = operation->get_width();
+ color_input.xmin = 0;
+ color_input.ymax = operation->get_height();
+ color_input.ymin = 0;
+ if (operation->determine_depending_area_of_interest(&color_input, read_operation, output)) {
return true;
}
- operation = getInputOperation(1);
- uvInput.xmax = input->xmax + 1;
- uvInput.xmin = input->xmin - 1;
- uvInput.ymax = input->ymax + 1;
- uvInput.ymin = input->ymin - 1;
- if (operation->determineDependingAreaOfInterest(&uvInput, readOperation, output)) {
+ operation = get_input_operation(1);
+ uv_input.xmax = input->xmax + 1;
+ uv_input.xmin = input->xmin - 1;
+ uv_input.ymax = input->ymax + 1;
+ uv_input.ymin = input->ymin - 1;
+ if (operation->determine_depending_area_of_interest(&uv_input, read_operation, output)) {
return true;
}
@@ -236,7 +236,7 @@ void MapUVOperation::update_memory_buffer_partial(MemoryBuffer *output,
float uv[2];
float deriv[2][2];
float alpha;
- pixelTransform(xy, uv, deriv, alpha);
+ pixel_transform(xy, uv, deriv, alpha);
if (alpha == 0.0f) {
zero_v4(it.out);
continue;