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:
authorCampbell Barton <ideasman42@gmail.com>2019-04-17 07:17:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-17 07:21:24 +0300
commite12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch)
tree8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/compositor/operations/COM_KeyingBlurOperation.cpp
parentb3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff)
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/compositor/operations/COM_KeyingBlurOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_KeyingBlurOperation.cpp95
1 files changed, 48 insertions, 47 deletions
diff --git a/source/blender/compositor/operations/COM_KeyingBlurOperation.cpp b/source/blender/compositor/operations/COM_KeyingBlurOperation.cpp
index 71386c20886..300d122589f 100644
--- a/source/blender/compositor/operations/COM_KeyingBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_KeyingBlurOperation.cpp
@@ -25,70 +25,71 @@
KeyingBlurOperation::KeyingBlurOperation() : NodeOperation()
{
- this->addInputSocket(COM_DT_VALUE);
- this->addOutputSocket(COM_DT_VALUE);
+ this->addInputSocket(COM_DT_VALUE);
+ this->addOutputSocket(COM_DT_VALUE);
- this->m_size = 0;
- this->m_axis = BLUR_AXIS_X;
+ this->m_size = 0;
+ this->m_axis = BLUR_AXIS_X;
- this->setComplex(true);
+ this->setComplex(true);
}
void *KeyingBlurOperation::initializeTileData(rcti *rect)
{
- void *buffer = getInputOperation(0)->initializeTileData(rect);
+ void *buffer = getInputOperation(0)->initializeTileData(rect);
- return buffer;
+ return buffer;
}
void KeyingBlurOperation::executePixel(float output[4], int x, int y, void *data)
{
- MemoryBuffer *inputBuffer = (MemoryBuffer *)data;
- const int bufferWidth = inputBuffer->getWidth();
- float *buffer = inputBuffer->getBuffer();
- int count = 0;
- float average = 0.0f;
+ MemoryBuffer *inputBuffer = (MemoryBuffer *)data;
+ const int bufferWidth = inputBuffer->getWidth();
+ float *buffer = inputBuffer->getBuffer();
+ int count = 0;
+ float average = 0.0f;
- if (this->m_axis == 0) {
- const int start = max(0, x - this->m_size + 1),
- end = min(bufferWidth, x + this->m_size);
- for (int cx = start; cx < end; ++cx) {
- int bufferIndex = (y * bufferWidth + cx);
- average += buffer[bufferIndex];
- count++;
- }
- }
- else {
- const int start = max(0, y - this->m_size + 1),
- end = min(inputBuffer->getHeight(), y + this->m_size);
- for (int cy = start; cy < end; ++cy) {
- int bufferIndex = (cy * bufferWidth + x);
- average += buffer[bufferIndex];
- count++;
- }
- }
+ if (this->m_axis == 0) {
+ const int start = max(0, x - this->m_size + 1), end = min(bufferWidth, x + this->m_size);
+ for (int cx = start; cx < end; ++cx) {
+ int bufferIndex = (y * bufferWidth + cx);
+ average += buffer[bufferIndex];
+ count++;
+ }
+ }
+ else {
+ const int start = max(0, y - this->m_size + 1),
+ end = min(inputBuffer->getHeight(), y + this->m_size);
+ for (int cy = start; cy < end; ++cy) {
+ int bufferIndex = (cy * bufferWidth + x);
+ average += buffer[bufferIndex];
+ count++;
+ }
+ }
- average /= (float) count;
+ average /= (float)count;
- output[0] = average;
+ output[0] = average;
}
-bool KeyingBlurOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
+bool KeyingBlurOperation::determineDependingAreaOfInterest(rcti *input,
+ ReadBufferOperation *readOperation,
+ rcti *output)
{
- rcti newInput;
+ rcti newInput;
- if (this->m_axis == BLUR_AXIS_X) {
- newInput.xmin = input->xmin - this->m_size;
- newInput.ymin = input->ymin;
- newInput.xmax = input->xmax + this->m_size;
- newInput.ymax = input->ymax;
- }
- else {
- newInput.xmin = input->xmin;
- newInput.ymin = input->ymin - this->m_size;
- newInput.xmax = input->xmax;
- newInput.ymax = input->ymax + this->m_size;
- }
+ if (this->m_axis == BLUR_AXIS_X) {
+ newInput.xmin = input->xmin - this->m_size;
+ newInput.ymin = input->ymin;
+ newInput.xmax = input->xmax + this->m_size;
+ newInput.ymax = input->ymax;
+ }
+ else {
+ newInput.xmin = input->xmin;
+ newInput.ymin = input->ymin - this->m_size;
+ newInput.xmax = input->xmax;
+ newInput.ymax = input->ymax + this->m_size;
+ }
- return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
+ return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}