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_FlipOperation.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_FlipOperation.cc')
-rw-r--r--source/blender/compositor/operations/COM_FlipOperation.cc76
1 files changed, 38 insertions, 38 deletions
diff --git a/source/blender/compositor/operations/COM_FlipOperation.cc b/source/blender/compositor/operations/COM_FlipOperation.cc
index ae2aa21131a..7ca12a504b7 100644
--- a/source/blender/compositor/operations/COM_FlipOperation.cc
+++ b/source/blender/compositor/operations/COM_FlipOperation.cc
@@ -22,57 +22,57 @@ namespace blender::compositor {
FlipOperation::FlipOperation()
{
- this->addInputSocket(DataType::Color, ResizeMode::None);
- this->addOutputSocket(DataType::Color);
+ this->add_input_socket(DataType::Color, ResizeMode::None);
+ this->add_output_socket(DataType::Color);
this->set_canvas_input_index(0);
- inputOperation_ = nullptr;
- flipX_ = true;
- flipY_ = false;
+ input_operation_ = nullptr;
+ flip_x_ = true;
+ flip_y_ = false;
}
-void FlipOperation::initExecution()
+void FlipOperation::init_execution()
{
- inputOperation_ = this->getInputSocketReader(0);
+ input_operation_ = this->get_input_socket_reader(0);
}
-void FlipOperation::deinitExecution()
+void FlipOperation::deinit_execution()
{
- inputOperation_ = nullptr;
+ input_operation_ = nullptr;
}
-void FlipOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+void FlipOperation::execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler)
{
- float nx = flipX_ ? ((int)this->getWidth() - 1) - x : x;
- float ny = flipY_ ? ((int)this->getHeight() - 1) - y : y;
+ float nx = flip_x_ ? ((int)this->get_width() - 1) - x : x;
+ float ny = flip_y_ ? ((int)this->get_height() - 1) - y : y;
- inputOperation_->readSampled(output, nx, ny, sampler);
+ input_operation_->read_sampled(output, nx, ny, sampler);
}
-bool FlipOperation::determineDependingAreaOfInterest(rcti *input,
- ReadBufferOperation *readOperation,
- rcti *output)
+bool FlipOperation::determine_depending_area_of_interest(rcti *input,
+ ReadBufferOperation *read_operation,
+ rcti *output)
{
- rcti newInput;
+ rcti new_input;
- if (flipX_) {
- const int w = (int)this->getWidth() - 1;
- newInput.xmax = (w - input->xmin) + 1;
- newInput.xmin = (w - input->xmax) - 1;
+ if (flip_x_) {
+ const int w = (int)this->get_width() - 1;
+ new_input.xmax = (w - input->xmin) + 1;
+ new_input.xmin = (w - input->xmax) - 1;
}
else {
- newInput.xmin = input->xmin;
- newInput.xmax = input->xmax;
+ new_input.xmin = input->xmin;
+ new_input.xmax = input->xmax;
}
- if (flipY_) {
- const int h = (int)this->getHeight() - 1;
- newInput.ymax = (h - input->ymin) + 1;
- newInput.ymin = (h - input->ymax) - 1;
+ if (flip_y_) {
+ const int h = (int)this->get_height() - 1;
+ new_input.ymax = (h - input->ymin) + 1;
+ new_input.ymin = (h - input->ymax) - 1;
}
else {
- newInput.ymin = input->ymin;
- newInput.ymax = input->ymax;
+ new_input.ymin = input->ymin;
+ new_input.ymax = input->ymax;
}
- return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
+ return NodeOperation::determine_depending_area_of_interest(&new_input, read_operation, output);
}
void FlipOperation::determine_canvas(const rcti &preferred_area, rcti &r_area)
@@ -80,12 +80,12 @@ void FlipOperation::determine_canvas(const rcti &preferred_area, rcti &r_area)
NodeOperation::determine_canvas(preferred_area, r_area);
if (execution_model_ == eExecutionModel::FullFrame) {
rcti input_area = r_area;
- if (flipX_) {
+ if (flip_x_) {
const int width = BLI_rcti_size_x(&input_area) - 1;
r_area.xmax = (width - input_area.xmin) + 1;
r_area.xmin = (width - input_area.xmax) + 1;
}
- if (flipY_) {
+ if (flip_y_) {
const int height = BLI_rcti_size_y(&input_area) - 1;
r_area.ymax = (height - input_area.ymin) + 1;
r_area.ymin = (height - input_area.ymax) + 1;
@@ -99,8 +99,8 @@ void FlipOperation::get_area_of_interest(const int input_idx,
{
BLI_assert(input_idx == 0);
UNUSED_VARS_NDEBUG(input_idx);
- if (flipX_) {
- const int w = (int)this->getWidth() - 1;
+ if (flip_x_) {
+ const int w = (int)this->get_width() - 1;
r_input_area.xmax = (w - output_area.xmin) + 1;
r_input_area.xmin = (w - output_area.xmax) + 1;
}
@@ -108,8 +108,8 @@ void FlipOperation::get_area_of_interest(const int input_idx,
r_input_area.xmin = output_area.xmin;
r_input_area.xmax = output_area.xmax;
}
- if (flipY_) {
- const int h = (int)this->getHeight() - 1;
+ if (flip_y_) {
+ const int h = (int)this->get_height() - 1;
r_input_area.ymax = (h - output_area.ymin) + 1;
r_input_area.ymin = (h - output_area.ymax) + 1;
}
@@ -127,8 +127,8 @@ void FlipOperation::update_memory_buffer_partial(MemoryBuffer *output,
const int input_offset_x = input_img->get_rect().xmin;
const int input_offset_y = input_img->get_rect().ymin;
for (BuffersIterator<float> it = output->iterate_with({}, area); !it.is_end(); ++it) {
- const int nx = flipX_ ? ((int)this->getWidth() - 1) - it.x : it.x;
- const int ny = flipY_ ? ((int)this->getHeight() - 1) - it.y : it.y;
+ const int nx = flip_x_ ? ((int)this->get_width() - 1) - it.x : it.x;
+ const int ny = flip_y_ ? ((int)this->get_height() - 1) - it.y : it.y;
input_img->read_elem(input_offset_x + nx, input_offset_y + ny, it.out);
}
}