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:
Diffstat (limited to 'source/blender/compositor/operations/COM_DespeckleOperation.cc')
-rw-r--r--source/blender/compositor/operations/COM_DespeckleOperation.cc88
1 files changed, 44 insertions, 44 deletions
diff --git a/source/blender/compositor/operations/COM_DespeckleOperation.cc b/source/blender/compositor/operations/COM_DespeckleOperation.cc
index f655c17fdf2..be0dc06b8ec 100644
--- a/source/blender/compositor/operations/COM_DespeckleOperation.cc
+++ b/source/blender/compositor/operations/COM_DespeckleOperation.cc
@@ -24,23 +24,23 @@ namespace blender::compositor {
DespeckleOperation::DespeckleOperation()
{
- this->addInputSocket(DataType::Color);
- this->addInputSocket(DataType::Value);
- this->addOutputSocket(DataType::Color);
+ this->add_input_socket(DataType::Color);
+ this->add_input_socket(DataType::Value);
+ this->add_output_socket(DataType::Color);
this->set_canvas_input_index(0);
- inputOperation_ = nullptr;
+ input_operation_ = nullptr;
this->flags.complex = true;
}
-void DespeckleOperation::initExecution()
+void DespeckleOperation::init_execution()
{
- inputOperation_ = this->getInputSocketReader(0);
- inputValueOperation_ = this->getInputSocketReader(1);
+ input_operation_ = this->get_input_socket_reader(0);
+ input_value_operation_ = this->get_input_socket_reader(1);
}
-void DespeckleOperation::deinitExecution()
+void DespeckleOperation::deinit_execution()
{
- inputOperation_ = nullptr;
- inputValueOperation_ = nullptr;
+ input_operation_ = nullptr;
+ input_value_operation_ = nullptr;
}
BLI_INLINE int color_diff(const float a[3], const float b[3], const float threshold)
@@ -49,7 +49,7 @@ BLI_INLINE int color_diff(const float a[3], const float b[3], const float thresh
(fabsf(a[2] - b[2]) > threshold));
}
-void DespeckleOperation::executePixel(float output[4], int x, int y, void * /*data*/)
+void DespeckleOperation::execute_pixel(float output[4], int x, int y, void * /*data*/)
{
float w = 0.0f;
float color_org[4];
@@ -62,17 +62,17 @@ void DespeckleOperation::executePixel(float output[4], int x, int y, void * /*da
int y1 = y - 1;
int y2 = y;
int y3 = y + 1;
- CLAMP(x1, 0, getWidth() - 1);
- CLAMP(x2, 0, getWidth() - 1);
- CLAMP(x3, 0, getWidth() - 1);
- CLAMP(y1, 0, getHeight() - 1);
- CLAMP(y2, 0, getHeight() - 1);
- CLAMP(y3, 0, getHeight() - 1);
+ CLAMP(x1, 0, get_width() - 1);
+ CLAMP(x2, 0, get_width() - 1);
+ CLAMP(x3, 0, get_width() - 1);
+ CLAMP(y1, 0, get_height() - 1);
+ CLAMP(y2, 0, get_height() - 1);
+ CLAMP(y3, 0, get_height() - 1);
float value[4];
- inputValueOperation_->read(value, x2, y2, nullptr);
+ input_value_operation_->read(value, x2, y2, nullptr);
// const float mval = 1.0f - value[0];
- inputOperation_->read(color_org, x2, y2, nullptr);
+ input_operation_->read(color_org, x2, y2, nullptr);
#define TOT_DIV_ONE 1.0f
#define TOT_DIV_CNR (float)M_SQRT1_2
@@ -91,27 +91,27 @@ void DespeckleOperation::executePixel(float output[4], int x, int y, void * /*da
zero_v4(color_mid);
zero_v4(color_mid_ok);
- inputOperation_->read(in1, x1, y1, nullptr);
+ input_operation_->read(in1, x1, y1, nullptr);
COLOR_ADD(TOT_DIV_CNR)
- inputOperation_->read(in1, x2, y1, nullptr);
+ input_operation_->read(in1, x2, y1, nullptr);
COLOR_ADD(TOT_DIV_ONE)
- inputOperation_->read(in1, x3, y1, nullptr);
+ input_operation_->read(in1, x3, y1, nullptr);
COLOR_ADD(TOT_DIV_CNR)
- inputOperation_->read(in1, x1, y2, nullptr);
+ input_operation_->read(in1, x1, y2, nullptr);
COLOR_ADD(TOT_DIV_ONE)
#if 0
- inputOperation_->read(in2, x2, y2, nullptr);
+ input_operation_->read(in2, x2, y2, nullptr);
madd_v4_v4fl(color_mid, in2, filter_[4]);
#endif
- inputOperation_->read(in1, x3, y2, nullptr);
+ input_operation_->read(in1, x3, y2, nullptr);
COLOR_ADD(TOT_DIV_ONE)
- inputOperation_->read(in1, x1, y3, nullptr);
+ input_operation_->read(in1, x1, y3, nullptr);
COLOR_ADD(TOT_DIV_CNR)
- inputOperation_->read(in1, x2, y3, nullptr);
+ input_operation_->read(in1, x2, y3, nullptr);
COLOR_ADD(TOT_DIV_ONE)
- inputOperation_->read(in1, x3, y3, nullptr);
+ input_operation_->read(in1, x3, y3, nullptr);
COLOR_ADD(TOT_DIV_CNR)
mul_v4_fl(color_mid, 1.0f / (4.0f + (4.0f * (float)M_SQRT1_2)));
@@ -132,19 +132,19 @@ void DespeckleOperation::executePixel(float output[4], int x, int y, void * /*da
#undef COLOR_ADD
}
-bool DespeckleOperation::determineDependingAreaOfInterest(rcti *input,
- ReadBufferOperation *readOperation,
- rcti *output)
+bool DespeckleOperation::determine_depending_area_of_interest(rcti *input,
+ ReadBufferOperation *read_operation,
+ rcti *output)
{
- rcti newInput;
- int addx = 2; //(filterWidth_ - 1) / 2 + 1;
- int addy = 2; //(filterHeight_ - 1) / 2 + 1;
- newInput.xmax = input->xmax + addx;
- newInput.xmin = input->xmin - addx;
- newInput.ymax = input->ymax + addy;
- newInput.ymin = input->ymin - addy;
-
- return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
+ rcti new_input;
+ int addx = 2; //(filter_width_ - 1) / 2 + 1;
+ int addy = 2; //(filter_height_ - 1) / 2 + 1;
+ new_input.xmax = input->xmax + addx;
+ new_input.xmin = input->xmin - addx;
+ new_input.ymax = input->ymax + addy;
+ new_input.ymin = input->ymin - addy;
+
+ return NodeOperation::determine_depending_area_of_interest(&new_input, read_operation, output);
}
void DespeckleOperation::get_area_of_interest(const int input_idx,
@@ -153,8 +153,8 @@ void DespeckleOperation::get_area_of_interest(const int input_idx,
{
switch (input_idx) {
case IMAGE_INPUT_INDEX: {
- const int add_x = 2; //(filterWidth_ - 1) / 2 + 1;
- const int add_y = 2; //(filterHeight_ - 1) / 2 + 1;
+ const int add_x = 2; //(filter_width_ - 1) / 2 + 1;
+ const int add_y = 2; //(filter_height_ - 1) / 2 + 1;
r_input_area.xmin = output_area.xmin - add_x;
r_input_area.xmax = output_area.xmax + add_x;
r_input_area.ymin = output_area.ymin - add_y;
@@ -173,8 +173,8 @@ void DespeckleOperation::update_memory_buffer_partial(MemoryBuffer *output,
Span<MemoryBuffer *> inputs)
{
const MemoryBuffer *image = inputs[IMAGE_INPUT_INDEX];
- const int last_x = getWidth() - 1;
- const int last_y = getHeight() - 1;
+ const int last_x = get_width() - 1;
+ const int last_y = get_height() - 1;
for (BuffersIterator<float> it = output->iterate_with(inputs, area); !it.is_end(); ++it) {
const int x1 = MAX2(it.x - 1, 0);
const int x2 = it.x;