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_SMAAOperation.cc')
-rw-r--r--source/blender/compositor/operations/COM_SMAAOperation.cc274
1 files changed, 137 insertions, 137 deletions
diff --git a/source/blender/compositor/operations/COM_SMAAOperation.cc b/source/blender/compositor/operations/COM_SMAAOperation.cc
index 40af7389d7f..c73462d2e6d 100644
--- a/source/blender/compositor/operations/COM_SMAAOperation.cc
+++ b/source/blender/compositor/operations/COM_SMAAOperation.cc
@@ -38,7 +38,7 @@ namespace blender::compositor {
*
* This file is based on SMAA-CPP:
*
- * https://github.com/iRi-E/smaa-cpp
+ * https://github.com/i_ri-E/smaa-cpp
*
* Currently only SMAA 1x mode is provided, so the operation will be done
* with no spatial multi-sampling nor temporal super-sampling.
@@ -64,7 +64,7 @@ namespace blender::compositor {
* #buffer->read_elem_checked. */
static inline void sample(SocketReader *reader, int x, int y, float color[4])
{
- if (x < 0 || x >= reader->getWidth() || y < 0 || y >= reader->getHeight()) {
+ if (x < 0 || x >= reader->get_width() || y < 0 || y >= reader->get_height()) {
color[0] = color[1] = color[2] = color[3] = 0.0;
return;
}
@@ -167,50 +167,50 @@ static void area_diag(int d1, int d2, int e1, int e2, float weights[2])
SMAAEdgeDetectionOperation::SMAAEdgeDetectionOperation()
{
- this->addInputSocket(DataType::Color); /* image */
- this->addInputSocket(DataType::Value); /* Depth, material ID, etc. TODO: currently unused. */
- this->addOutputSocket(DataType::Color);
+ this->add_input_socket(DataType::Color); /* image */
+ this->add_input_socket(DataType::Value); /* Depth, material ID, etc. TODO: currently unused. */
+ this->add_output_socket(DataType::Color);
this->flags.complex = true;
- imageReader_ = nullptr;
- valueReader_ = nullptr;
- this->setThreshold(CMP_DEFAULT_SMAA_THRESHOLD);
- this->setLocalContrastAdaptationFactor(CMP_DEFAULT_SMAA_CONTRAST_LIMIT);
+ image_reader_ = nullptr;
+ value_reader_ = nullptr;
+ this->set_threshold(CMP_DEFAULT_SMAA_THRESHOLD);
+ this->set_local_contrast_adaptation_factor(CMP_DEFAULT_SMAA_CONTRAST_LIMIT);
}
-void SMAAEdgeDetectionOperation::initExecution()
+void SMAAEdgeDetectionOperation::init_execution()
{
- imageReader_ = this->getInputSocketReader(0);
- valueReader_ = this->getInputSocketReader(1);
+ image_reader_ = this->get_input_socket_reader(0);
+ value_reader_ = this->get_input_socket_reader(1);
}
-void SMAAEdgeDetectionOperation::deinitExecution()
+void SMAAEdgeDetectionOperation::deinit_execution()
{
- imageReader_ = nullptr;
- valueReader_ = nullptr;
+ image_reader_ = nullptr;
+ value_reader_ = nullptr;
}
-void SMAAEdgeDetectionOperation::setThreshold(float threshold)
+void SMAAEdgeDetectionOperation::set_threshold(float threshold)
{
/* UI values are between 0 and 1 for simplicity but algorithm expects values between 0 and 0.5 */
threshold_ = scalenorm(0, 0.5, threshold);
}
-void SMAAEdgeDetectionOperation::setLocalContrastAdaptationFactor(float factor)
+void SMAAEdgeDetectionOperation::set_local_contrast_adaptation_factor(float factor)
{
/* UI values are between 0 and 1 for simplicity but algorithm expects values between 1 and 10 */
contrast_limit_ = scalenorm(1, 10, factor);
}
-bool SMAAEdgeDetectionOperation::determineDependingAreaOfInterest(
- rcti *input, ReadBufferOperation *readOperation, rcti *output)
+bool SMAAEdgeDetectionOperation::determine_depending_area_of_interest(
+ rcti *input, ReadBufferOperation *read_operation, rcti *output)
{
- rcti newInput;
- newInput.xmax = input->xmax + 1;
- newInput.xmin = input->xmin - 2;
- newInput.ymax = input->ymax + 1;
- newInput.ymin = input->ymin - 2;
+ rcti new_input;
+ new_input.xmax = input->xmax + 1;
+ new_input.xmin = input->xmin - 2;
+ new_input.ymax = input->ymax + 1;
+ new_input.ymin = input->ymin - 2;
- return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
+ return NodeOperation::determine_depending_area_of_interest(&new_input, read_operation, output);
}
void SMAAEdgeDetectionOperation::get_area_of_interest(const int UNUSED(input_idx),
@@ -223,16 +223,16 @@ void SMAAEdgeDetectionOperation::get_area_of_interest(const int UNUSED(input_idx
r_input_area.ymin = output_area.ymin - 2;
}
-void SMAAEdgeDetectionOperation::executePixel(float output[4], int x, int y, void * /*data*/)
+void SMAAEdgeDetectionOperation::execute_pixel(float output[4], int x, int y, void * /*data*/)
{
float color[4];
/* Calculate luma deltas: */
- sample(imageReader_, x, y, color);
+ sample(image_reader_, x, y, color);
float L = IMB_colormanagement_get_luminance(color);
- sample(imageReader_, x - 1, y, color);
+ sample(image_reader_, x - 1, y, color);
float Lleft = IMB_colormanagement_get_luminance(color);
- sample(imageReader_, x, y - 1, color);
+ sample(image_reader_, x, y - 1, color);
float Ltop = IMB_colormanagement_get_luminance(color);
float Dleft = fabsf(L - Lleft);
float Dtop = fabsf(L - Ltop);
@@ -249,36 +249,36 @@ void SMAAEdgeDetectionOperation::executePixel(float output[4], int x, int y, voi
}
/* Calculate right and bottom deltas: */
- sample(imageReader_, x + 1, y, color);
+ sample(image_reader_, x + 1, y, color);
float Lright = IMB_colormanagement_get_luminance(color);
- sample(imageReader_, x, y + 1, color);
+ sample(image_reader_, x, y + 1, color);
float Lbottom = IMB_colormanagement_get_luminance(color);
float Dright = fabsf(L - Lright);
float Dbottom = fabsf(L - Lbottom);
/* Calculate the maximum delta in the direct neighborhood: */
- float maxDelta = fmaxf(fmaxf(Dleft, Dright), fmaxf(Dtop, Dbottom));
+ float max_delta = fmaxf(fmaxf(Dleft, Dright), fmaxf(Dtop, Dbottom));
/* Calculate luma used for both left and top edges: */
- sample(imageReader_, x - 1, y - 1, color);
+ sample(image_reader_, x - 1, y - 1, color);
float Llefttop = IMB_colormanagement_get_luminance(color);
/* Left edge */
if (output[0] != 0.0f) {
/* Calculate deltas around the left pixel: */
- sample(imageReader_, x - 2, y, color);
+ sample(image_reader_, x - 2, y, color);
float Lleftleft = IMB_colormanagement_get_luminance(color);
- sample(imageReader_, x - 1, y + 1, color);
+ sample(image_reader_, x - 1, y + 1, color);
float Lleftbottom = IMB_colormanagement_get_luminance(color);
float Dleftleft = fabsf(Lleft - Lleftleft);
float Dlefttop = fabsf(Lleft - Llefttop);
float Dleftbottom = fabsf(Lleft - Lleftbottom);
/* Calculate the final maximum delta: */
- maxDelta = fmaxf(maxDelta, fmaxf(Dleftleft, fmaxf(Dlefttop, Dleftbottom)));
+ max_delta = fmaxf(max_delta, fmaxf(Dleftleft, fmaxf(Dlefttop, Dleftbottom)));
/* Local contrast adaptation: */
- if (maxDelta > contrast_limit_ * Dleft) {
+ if (max_delta > contrast_limit_ * Dleft) {
output[0] = 0.0f;
}
}
@@ -286,19 +286,19 @@ void SMAAEdgeDetectionOperation::executePixel(float output[4], int x, int y, voi
/* Top edge */
if (output[1] != 0.0f) {
/* Calculate top-top delta: */
- sample(imageReader_, x, y - 2, color);
+ sample(image_reader_, x, y - 2, color);
float Ltoptop = IMB_colormanagement_get_luminance(color);
- sample(imageReader_, x + 1, y - 1, color);
+ sample(image_reader_, x + 1, y - 1, color);
float Ltopright = IMB_colormanagement_get_luminance(color);
float Dtoptop = fabsf(Ltop - Ltoptop);
float Dtopleft = fabsf(Ltop - Llefttop);
float Dtopright = fabsf(Ltop - Ltopright);
/* Calculate the final maximum delta: */
- maxDelta = fmaxf(maxDelta, fmaxf(Dtoptop, fmaxf(Dtopleft, Dtopright)));
+ max_delta = fmaxf(max_delta, fmaxf(Dtoptop, fmaxf(Dtopleft, Dtopright)));
/* Local contrast adaptation: */
- if (maxDelta > contrast_limit_ * Dtop) {
+ if (max_delta > contrast_limit_ * Dtop) {
output[1] = 0.0f;
}
}
@@ -344,7 +344,7 @@ void SMAAEdgeDetectionOperation::update_memory_buffer_partial(MemoryBuffer *outp
const float Dbottom = fabsf(L - Lbottom);
/* Calculate the maximum delta in the direct neighborhood: */
- float maxDelta = fmaxf(fmaxf(Dleft, Dright), fmaxf(Dtop, Dbottom));
+ float max_delta = fmaxf(fmaxf(Dleft, Dright), fmaxf(Dtop, Dbottom));
/* Calculate luma used for both left and top edges: */
image->read_elem_checked(x - 1, y - 1, color);
@@ -362,10 +362,10 @@ void SMAAEdgeDetectionOperation::update_memory_buffer_partial(MemoryBuffer *outp
const float Dleftbottom = fabsf(Lleft - Lleftbottom);
/* Calculate the final maximum delta: */
- maxDelta = fmaxf(maxDelta, fmaxf(Dleftleft, fmaxf(Dlefttop, Dleftbottom)));
+ max_delta = fmaxf(max_delta, fmaxf(Dleftleft, fmaxf(Dlefttop, Dleftbottom)));
/* Local contrast adaptation: */
- if (maxDelta > contrast_limit_ * Dleft) {
+ if (max_delta > contrast_limit_ * Dleft) {
it.out[0] = 0.0f;
}
}
@@ -382,10 +382,10 @@ void SMAAEdgeDetectionOperation::update_memory_buffer_partial(MemoryBuffer *outp
const float Dtopright = fabsf(Ltop - Ltopright);
/* Calculate the final maximum delta: */
- maxDelta = fmaxf(maxDelta, fmaxf(Dtoptop, fmaxf(Dtopleft, Dtopright)));
+ max_delta = fmaxf(max_delta, fmaxf(Dtoptop, fmaxf(Dtopleft, Dtopright)));
/* Local contrast adaptation: */
- if (maxDelta > contrast_limit_ * Dtop) {
+ if (max_delta > contrast_limit_ * Dtop) {
it.out[1] = 0.0f;
}
}
@@ -398,47 +398,47 @@ void SMAAEdgeDetectionOperation::update_memory_buffer_partial(MemoryBuffer *outp
SMAABlendingWeightCalculationOperation::SMAABlendingWeightCalculationOperation()
{
- this->addInputSocket(DataType::Color); /* edges */
- this->addOutputSocket(DataType::Color);
+ this->add_input_socket(DataType::Color); /* edges */
+ this->add_output_socket(DataType::Color);
this->flags.complex = true;
- imageReader_ = nullptr;
- this->setCornerRounding(CMP_DEFAULT_SMAA_CORNER_ROUNDING);
+ image_reader_ = nullptr;
+ this->set_corner_rounding(CMP_DEFAULT_SMAA_CORNER_ROUNDING);
}
-void *SMAABlendingWeightCalculationOperation::initializeTileData(rcti *rect)
+void *SMAABlendingWeightCalculationOperation::initialize_tile_data(rcti *rect)
{
- return getInputOperation(0)->initializeTileData(rect);
+ return get_input_operation(0)->initialize_tile_data(rect);
}
-void SMAABlendingWeightCalculationOperation::initExecution()
+void SMAABlendingWeightCalculationOperation::init_execution()
{
- imageReader_ = this->getInputSocketReader(0);
+ image_reader_ = this->get_input_socket_reader(0);
if (execution_model_ == eExecutionModel::Tiled) {
- sample_image_fn_ = [=](int x, int y, float *out) { sample(imageReader_, x, y, out); };
+ sample_image_fn_ = [=](int x, int y, float *out) { sample(image_reader_, x, y, out); };
}
}
-void SMAABlendingWeightCalculationOperation::setCornerRounding(float rounding)
+void SMAABlendingWeightCalculationOperation::set_corner_rounding(float rounding)
{
/* UI values are between 0 and 1 for simplicity but algorithm expects values between 0 and 100 */
corner_rounding_ = static_cast<int>(scalenorm(0, 100, rounding));
}
-void SMAABlendingWeightCalculationOperation::executePixel(float output[4],
- int x,
- int y,
- void * /*data*/)
+void SMAABlendingWeightCalculationOperation::execute_pixel(float output[4],
+ int x,
+ int y,
+ void * /*data*/)
{
float edges[4], c[4];
zero_v4(output);
- sample(imageReader_, x, y, edges);
+ sample(image_reader_, x, y, edges);
/* Edge at north */
if (edges[1] > 0.0f) {
/* Diagonals have both north and west edges, so calculating weights for them */
/* in one of the boundaries is enough. */
- calculateDiagWeights(x, y, edges, output);
+ calculate_diag_weights(x, y, edges, output);
/* We give priority to diagonals, so if we find a diagonal we skip. */
/* horizontal/vertical processing. */
@@ -447,25 +447,25 @@ void SMAABlendingWeightCalculationOperation::executePixel(float output[4],
}
/* Find the distance to the left and the right: */
- int left = searchXLeft(x, y);
- int right = searchXRight(x, y);
+ int left = search_xleft(x, y);
+ int right = search_xright(x, y);
int d1 = x - left, d2 = right - x;
/* Fetch the left and right crossing edges: */
int e1 = 0, e2 = 0;
- sample(imageReader_, left, y - 1, c);
+ sample(image_reader_, left, y - 1, c);
if (c[0] > 0.0) {
e1 += 1;
}
- sample(imageReader_, left, y, c);
+ sample(image_reader_, left, y, c);
if (c[0] > 0.0) {
e1 += 2;
}
- sample(imageReader_, right + 1, y - 1, c);
+ sample(image_reader_, right + 1, y - 1, c);
if (c[0] > 0.0) {
e2 += 1;
}
- sample(imageReader_, right + 1, y, c);
+ sample(image_reader_, right + 1, y, c);
if (c[0] > 0.0) {
e2 += 2;
}
@@ -476,37 +476,37 @@ void SMAABlendingWeightCalculationOperation::executePixel(float output[4],
/* Fix corners: */
if (corner_rounding_) {
- detectHorizontalCornerPattern(output, left, right, y, d1, d2);
+ detect_horizontal_corner_pattern(output, left, right, y, d1, d2);
}
}
/* Edge at west */
if (edges[0] > 0.0f) {
/* Did we already do diagonal search for this west edge from the left neighboring pixel? */
- if (isVerticalSearchUnneeded(x, y)) {
+ if (is_vertical_search_unneeded(x, y)) {
return;
}
/* Find the distance to the top and the bottom: */
- int top = searchYUp(x, y);
- int bottom = searchYDown(x, y);
+ int top = search_yup(x, y);
+ int bottom = search_ydown(x, y);
int d1 = y - top, d2 = bottom - y;
/* Fetch the top and bottom crossing edges: */
int e1 = 0, e2 = 0;
- sample(imageReader_, x - 1, top, c);
+ sample(image_reader_, x - 1, top, c);
if (c[1] > 0.0) {
e1 += 1;
}
- sample(imageReader_, x, top, c);
+ sample(image_reader_, x, top, c);
if (c[1] > 0.0) {
e1 += 2;
}
- sample(imageReader_, x - 1, bottom + 1, c);
+ sample(image_reader_, x - 1, bottom + 1, c);
if (c[1] > 0.0) {
e2 += 1;
}
- sample(imageReader_, x, bottom + 1, c);
+ sample(image_reader_, x, bottom + 1, c);
if (c[1] > 0.0) {
e2 += 2;
}
@@ -516,7 +516,7 @@ void SMAABlendingWeightCalculationOperation::executePixel(float output[4],
/* Fix corners: */
if (corner_rounding_) {
- detectVerticalCornerPattern(output + 2, x, top, bottom, d1, d2);
+ detect_vertical_corner_pattern(output + 2, x, top, bottom, d1, d2);
}
}
}
@@ -544,7 +544,7 @@ void SMAABlendingWeightCalculationOperation::update_memory_buffer_partial(
if (edges[1] > 0.0f) {
/* Diagonals have both north and west edges, so calculating weights for them */
/* in one of the boundaries is enough. */
- calculateDiagWeights(x, y, edges, it.out);
+ calculate_diag_weights(x, y, edges, it.out);
/* We give priority to diagonals, so if we find a diagonal we skip. */
/* horizontal/vertical processing. */
@@ -553,8 +553,8 @@ void SMAABlendingWeightCalculationOperation::update_memory_buffer_partial(
}
/* Find the distance to the left and the right: */
- int left = searchXLeft(x, y);
- int right = searchXRight(x, y);
+ int left = search_xleft(x, y);
+ int right = search_xright(x, y);
int d1 = x - left, d2 = right - x;
/* Fetch the left and right crossing edges: */
@@ -582,20 +582,20 @@ void SMAABlendingWeightCalculationOperation::update_memory_buffer_partial(
/* Fix corners: */
if (corner_rounding_) {
- detectHorizontalCornerPattern(it.out, left, right, y, d1, d2);
+ detect_horizontal_corner_pattern(it.out, left, right, y, d1, d2);
}
}
/* Edge at west */
if (edges[0] > 0.0f) {
/* Did we already do diagonal search for this west edge from the left neighboring pixel? */
- if (isVerticalSearchUnneeded(x, y)) {
+ if (is_vertical_search_unneeded(x, y)) {
continue;
}
/* Find the distance to the top and the bottom: */
- int top = searchYUp(x, y);
- int bottom = searchYDown(x, y);
+ int top = search_yup(x, y);
+ int bottom = search_ydown(x, y);
int d1 = y - top, d2 = bottom - y;
/* Fetch the top and bottom crossing edges: */
@@ -622,30 +622,30 @@ void SMAABlendingWeightCalculationOperation::update_memory_buffer_partial(
/* Fix corners: */
if (corner_rounding_) {
- detectVerticalCornerPattern(it.out + 2, x, top, bottom, d1, d2);
+ detect_vertical_corner_pattern(it.out + 2, x, top, bottom, d1, d2);
}
}
}
}
-void SMAABlendingWeightCalculationOperation::deinitExecution()
+void SMAABlendingWeightCalculationOperation::deinit_execution()
{
- imageReader_ = nullptr;
+ image_reader_ = nullptr;
}
-bool SMAABlendingWeightCalculationOperation::determineDependingAreaOfInterest(
- rcti *input, ReadBufferOperation *readOperation, rcti *output)
+bool SMAABlendingWeightCalculationOperation::determine_depending_area_of_interest(
+ rcti *input, ReadBufferOperation *read_operation, rcti *output)
{
- rcti newInput;
+ rcti new_input;
- newInput.xmax = input->xmax + fmax(SMAA_MAX_SEARCH_STEPS, SMAA_MAX_SEARCH_STEPS_DIAG + 1);
- newInput.xmin = input->xmin -
- fmax(fmax(SMAA_MAX_SEARCH_STEPS - 1, 1), SMAA_MAX_SEARCH_STEPS_DIAG + 1);
- newInput.ymax = input->ymax + fmax(SMAA_MAX_SEARCH_STEPS, SMAA_MAX_SEARCH_STEPS_DIAG);
- newInput.ymin = input->ymin -
- fmax(fmax(SMAA_MAX_SEARCH_STEPS - 1, 1), SMAA_MAX_SEARCH_STEPS_DIAG);
+ new_input.xmax = input->xmax + fmax(SMAA_MAX_SEARCH_STEPS, SMAA_MAX_SEARCH_STEPS_DIAG + 1);
+ new_input.xmin = input->xmin -
+ fmax(fmax(SMAA_MAX_SEARCH_STEPS - 1, 1), SMAA_MAX_SEARCH_STEPS_DIAG + 1);
+ new_input.ymax = input->ymax + fmax(SMAA_MAX_SEARCH_STEPS, SMAA_MAX_SEARCH_STEPS_DIAG);
+ new_input.ymin = input->ymin -
+ fmax(fmax(SMAA_MAX_SEARCH_STEPS - 1, 1), SMAA_MAX_SEARCH_STEPS_DIAG);
- return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
+ return NodeOperation::determine_depending_area_of_interest(&new_input, read_operation, output);
}
void SMAABlendingWeightCalculationOperation::get_area_of_interest(const int UNUSED(input_idx),
@@ -667,7 +667,7 @@ void SMAABlendingWeightCalculationOperation::get_area_of_interest(const int UNUS
/**
* These functions allows to perform diagonal pattern searches.
*/
-int SMAABlendingWeightCalculationOperation::searchDiag1(int x, int y, int dir, bool *found)
+int SMAABlendingWeightCalculationOperation::search_diag1(int x, int y, int dir, bool *found)
{
float e[4];
int end = x + SMAA_MAX_SEARCH_STEPS_DIAG * dir;
@@ -690,7 +690,7 @@ int SMAABlendingWeightCalculationOperation::searchDiag1(int x, int y, int dir, b
return x - dir;
}
-int SMAABlendingWeightCalculationOperation::searchDiag2(int x, int y, int dir, bool *found)
+int SMAABlendingWeightCalculationOperation::search_diag2(int x, int y, int dir, bool *found)
{
float e[4];
int end = x + SMAA_MAX_SEARCH_STEPS_DIAG * dir;
@@ -717,10 +717,10 @@ int SMAABlendingWeightCalculationOperation::searchDiag2(int x, int y, int dir, b
/**
* This searches for diagonal patterns and returns the corresponding weights.
*/
-void SMAABlendingWeightCalculationOperation::calculateDiagWeights(int x,
- int y,
- const float edges[2],
- float weights[2])
+void SMAABlendingWeightCalculationOperation::calculate_diag_weights(int x,
+ int y,
+ const float edges[2],
+ float weights[2])
{
int d1, d2;
bool d1_found, d2_found;
@@ -734,13 +734,13 @@ void SMAABlendingWeightCalculationOperation::calculateDiagWeights(int x,
/* Search for the line ends: */
if (edges[0] > 0.0f) {
- d1 = x - searchDiag1(x, y, -1, &d1_found);
+ d1 = x - search_diag1(x, y, -1, &d1_found);
}
else {
d1 = 0;
d1_found = true;
}
- d2 = searchDiag1(x, y, 1, &d2_found) - x;
+ d2 = search_diag1(x, y, 1, &d2_found) - x;
if (d1 + d2 > 2) { /* d1 + d2 + 1 > 3 */
int e1 = 0, e2 = 0;
@@ -778,10 +778,10 @@ void SMAABlendingWeightCalculationOperation::calculateDiagWeights(int x,
}
/* Search for the line ends: */
- d1 = x - searchDiag2(x, y, -1, &d1_found);
+ d1 = x - search_diag2(x, y, -1, &d1_found);
sample_image_fn_(x + 1, y, e);
if (e[0] > 0.0f) {
- d2 = searchDiag2(x, y, 1, &d2_found) - x;
+ d2 = search_diag2(x, y, 1, &d2_found) - x;
}
else {
d2 = 0;
@@ -826,7 +826,7 @@ void SMAABlendingWeightCalculationOperation::calculateDiagWeights(int x,
}
}
-bool SMAABlendingWeightCalculationOperation::isVerticalSearchUnneeded(int x, int y)
+bool SMAABlendingWeightCalculationOperation::is_vertical_search_unneeded(int x, int y)
{
int d1, d2;
bool found;
@@ -839,12 +839,12 @@ bool SMAABlendingWeightCalculationOperation::isVerticalSearchUnneeded(int x, int
/* Search for the line ends: */
sample_image_fn_(x - 1, y, e);
if (e[1] > 0.0f) {
- d1 = x - searchDiag2(x - 1, y, -1, &found);
+ d1 = x - search_diag2(x - 1, y, -1, &found);
}
else {
d1 = 0;
}
- d2 = searchDiag2(x - 1, y, 1, &found) - x;
+ d2 = search_diag2(x - 1, y, 1, &found) - x;
return (d1 + d2 > 2); /* d1 + d2 + 1 > 3 */
}
@@ -852,7 +852,7 @@ bool SMAABlendingWeightCalculationOperation::isVerticalSearchUnneeded(int x, int
/*-----------------------------------------------------------------------------*/
/* Horizontal/Vertical Search Functions */
-int SMAABlendingWeightCalculationOperation::searchXLeft(int x, int y)
+int SMAABlendingWeightCalculationOperation::search_xleft(int x, int y)
{
int end = x - SMAA_MAX_SEARCH_STEPS;
float e[4];
@@ -875,7 +875,7 @@ int SMAABlendingWeightCalculationOperation::searchXLeft(int x, int y)
return x + 1;
}
-int SMAABlendingWeightCalculationOperation::searchXRight(int x, int y)
+int SMAABlendingWeightCalculationOperation::search_xright(int x, int y)
{
int end = x + SMAA_MAX_SEARCH_STEPS;
float e[4];
@@ -896,7 +896,7 @@ int SMAABlendingWeightCalculationOperation::searchXRight(int x, int y)
return x - 1;
}
-int SMAABlendingWeightCalculationOperation::searchYUp(int x, int y)
+int SMAABlendingWeightCalculationOperation::search_yup(int x, int y)
{
int end = y - SMAA_MAX_SEARCH_STEPS;
float e[4];
@@ -919,7 +919,7 @@ int SMAABlendingWeightCalculationOperation::searchYUp(int x, int y)
return y + 1;
}
-int SMAABlendingWeightCalculationOperation::searchYDown(int x, int y)
+int SMAABlendingWeightCalculationOperation::search_ydown(int x, int y)
{
int end = y + SMAA_MAX_SEARCH_STEPS;
float e[4];
@@ -943,7 +943,7 @@ int SMAABlendingWeightCalculationOperation::searchYDown(int x, int y)
/*-----------------------------------------------------------------------------*/
/* Corner Detection Functions */
-void SMAABlendingWeightCalculationOperation::detectHorizontalCornerPattern(
+void SMAABlendingWeightCalculationOperation::detect_horizontal_corner_pattern(
float weights[2], int left, int right, int y, int d1, int d2)
{
float factor[2] = {1.0f, 1.0f};
@@ -972,7 +972,7 @@ void SMAABlendingWeightCalculationOperation::detectHorizontalCornerPattern(
weights[1] *= CLAMPIS(factor[1], 0.0f, 1.0f);
}
-void SMAABlendingWeightCalculationOperation::detectVerticalCornerPattern(
+void SMAABlendingWeightCalculationOperation::detect_vertical_corner_pattern(
float weights[2], int x, int top, int bottom, int d1, int d2)
{
float factor[2] = {1.0f, 1.0f};
@@ -1007,29 +1007,29 @@ void SMAABlendingWeightCalculationOperation::detectVerticalCornerPattern(
SMAANeighborhoodBlendingOperation::SMAANeighborhoodBlendingOperation()
{
- this->addInputSocket(DataType::Color); /* image */
- this->addInputSocket(DataType::Color); /* blend */
- this->addOutputSocket(DataType::Color);
+ this->add_input_socket(DataType::Color); /* image */
+ this->add_input_socket(DataType::Color); /* blend */
+ this->add_output_socket(DataType::Color);
this->flags.complex = true;
image1Reader_ = nullptr;
image2Reader_ = nullptr;
}
-void *SMAANeighborhoodBlendingOperation::initializeTileData(rcti *rect)
+void *SMAANeighborhoodBlendingOperation::initialize_tile_data(rcti *rect)
{
- return getInputOperation(0)->initializeTileData(rect);
+ return get_input_operation(0)->initialize_tile_data(rect);
}
-void SMAANeighborhoodBlendingOperation::initExecution()
+void SMAANeighborhoodBlendingOperation::init_execution()
{
- image1Reader_ = this->getInputSocketReader(0);
- image2Reader_ = this->getInputSocketReader(1);
+ image1Reader_ = this->get_input_socket_reader(0);
+ image2Reader_ = this->get_input_socket_reader(1);
}
-void SMAANeighborhoodBlendingOperation::executePixel(float output[4],
- int x,
- int y,
- void * /*data*/)
+void SMAANeighborhoodBlendingOperation::execute_pixel(float output[4],
+ int x,
+ int y,
+ void * /*data*/)
{
float w[4];
@@ -1127,23 +1127,23 @@ void SMAANeighborhoodBlendingOperation::update_memory_buffer_partial(MemoryBuffe
}
}
-void SMAANeighborhoodBlendingOperation::deinitExecution()
+void SMAANeighborhoodBlendingOperation::deinit_execution()
{
image1Reader_ = nullptr;
image2Reader_ = nullptr;
}
-bool SMAANeighborhoodBlendingOperation::determineDependingAreaOfInterest(
- rcti *input, ReadBufferOperation *readOperation, rcti *output)
+bool SMAANeighborhoodBlendingOperation::determine_depending_area_of_interest(
+ rcti *input, ReadBufferOperation *read_operation, rcti *output)
{
- rcti newInput;
+ rcti new_input;
- newInput.xmax = input->xmax + 1;
- newInput.xmin = input->xmin - 1;
- newInput.ymax = input->ymax + 1;
- newInput.ymin = input->ymin - 1;
+ new_input.xmax = input->xmax + 1;
+ new_input.xmin = input->xmin - 1;
+ new_input.ymax = input->ymax + 1;
+ new_input.ymin = input->ymin - 1;
- return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
+ return NodeOperation::determine_depending_area_of_interest(&new_input, read_operation, output);
}
void SMAANeighborhoodBlendingOperation::get_area_of_interest(const int UNUSED(input_idx),