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_WrapOperation.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_WrapOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_WrapOperation.cpp126
1 files changed, 66 insertions, 60 deletions
diff --git a/source/blender/compositor/operations/COM_WrapOperation.cpp b/source/blender/compositor/operations/COM_WrapOperation.cpp
index c43e6961064..e55f63f7d73 100644
--- a/source/blender/compositor/operations/COM_WrapOperation.cpp
+++ b/source/blender/compositor/operations/COM_WrapOperation.cpp
@@ -20,86 +20,92 @@
WrapOperation::WrapOperation(DataType datatype) : ReadBufferOperation(datatype)
{
- this->m_wrappingType = CMP_NODE_WRAP_NONE;
+ this->m_wrappingType = CMP_NODE_WRAP_NONE;
}
inline float WrapOperation::getWrappedOriginalXPos(float x)
{
- if (this->getWidth() == 0) return 0;
- while (x < 0) x += this->m_width;
- return fmodf(x, this->getWidth());
+ if (this->getWidth() == 0)
+ return 0;
+ while (x < 0)
+ x += this->m_width;
+ return fmodf(x, this->getWidth());
}
inline float WrapOperation::getWrappedOriginalYPos(float y)
{
- if (this->getHeight() == 0) return 0;
- while (y < 0) y += this->m_height;
- return fmodf(y, this->getHeight());
+ if (this->getHeight() == 0)
+ return 0;
+ while (y < 0)
+ y += this->m_height;
+ return fmodf(y, this->getHeight());
}
void WrapOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
- float nx, ny;
- nx = x;
- ny = y;
- MemoryBufferExtend extend_x = COM_MB_CLIP, extend_y = COM_MB_CLIP;
- switch (m_wrappingType) {
- case CMP_NODE_WRAP_NONE:
- //Intentionally empty, originalXPos and originalYPos have been set before
- break;
- case CMP_NODE_WRAP_X:
- // wrap only on the x-axis
- nx = this->getWrappedOriginalXPos(x);
- extend_x = COM_MB_REPEAT;
- break;
- case CMP_NODE_WRAP_Y:
- // wrap only on the y-axis
- ny = this->getWrappedOriginalYPos(y);
- extend_y = COM_MB_REPEAT;
- break;
- case CMP_NODE_WRAP_XY:
- // wrap on both
- nx = this->getWrappedOriginalXPos(x);
- ny = this->getWrappedOriginalYPos(y);
- extend_x = COM_MB_REPEAT;
- extend_y = COM_MB_REPEAT;
- break;
- }
+ float nx, ny;
+ nx = x;
+ ny = y;
+ MemoryBufferExtend extend_x = COM_MB_CLIP, extend_y = COM_MB_CLIP;
+ switch (m_wrappingType) {
+ case CMP_NODE_WRAP_NONE:
+ //Intentionally empty, originalXPos and originalYPos have been set before
+ break;
+ case CMP_NODE_WRAP_X:
+ // wrap only on the x-axis
+ nx = this->getWrappedOriginalXPos(x);
+ extend_x = COM_MB_REPEAT;
+ break;
+ case CMP_NODE_WRAP_Y:
+ // wrap only on the y-axis
+ ny = this->getWrappedOriginalYPos(y);
+ extend_y = COM_MB_REPEAT;
+ break;
+ case CMP_NODE_WRAP_XY:
+ // wrap on both
+ nx = this->getWrappedOriginalXPos(x);
+ ny = this->getWrappedOriginalYPos(y);
+ extend_x = COM_MB_REPEAT;
+ extend_y = COM_MB_REPEAT;
+ break;
+ }
- executePixelExtend(output, nx, ny, sampler, extend_x, extend_y);
+ executePixelExtend(output, nx, ny, sampler, extend_x, extend_y);
}
-bool WrapOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
+bool WrapOperation::determineDependingAreaOfInterest(rcti *input,
+ ReadBufferOperation *readOperation,
+ rcti *output)
{
- rcti newInput;
- newInput.xmin = input->xmin;
- newInput.xmax = input->xmax;
- newInput.ymin = input->ymin;
- newInput.ymax = input->ymax;
+ rcti newInput;
+ newInput.xmin = input->xmin;
+ newInput.xmax = input->xmax;
+ newInput.ymin = input->ymin;
+ newInput.ymax = input->ymax;
- if (m_wrappingType == CMP_NODE_WRAP_X || m_wrappingType == CMP_NODE_WRAP_XY) {
- // wrap only on the x-axis if tile is wrapping
- newInput.xmin = getWrappedOriginalXPos(input->xmin);
- newInput.xmax = getWrappedOriginalXPos(input->xmax) + 0.5f;
- if (newInput.xmin >= newInput.xmax) {
- newInput.xmin = 0;
- newInput.xmax = this->getWidth();
- }
- }
- if (m_wrappingType == CMP_NODE_WRAP_Y || m_wrappingType == CMP_NODE_WRAP_XY) {
- // wrap only on the y-axis if tile is wrapping
- newInput.ymin = getWrappedOriginalYPos(input->ymin);
- newInput.ymax = getWrappedOriginalYPos(input->ymax) + 0.5f;
- if (newInput.ymin >= newInput.ymax) {
- newInput.ymin = 0;
- newInput.ymax = this->getHeight();
- }
- }
+ if (m_wrappingType == CMP_NODE_WRAP_X || m_wrappingType == CMP_NODE_WRAP_XY) {
+ // wrap only on the x-axis if tile is wrapping
+ newInput.xmin = getWrappedOriginalXPos(input->xmin);
+ newInput.xmax = getWrappedOriginalXPos(input->xmax) + 0.5f;
+ if (newInput.xmin >= newInput.xmax) {
+ newInput.xmin = 0;
+ newInput.xmax = this->getWidth();
+ }
+ }
+ if (m_wrappingType == CMP_NODE_WRAP_Y || m_wrappingType == CMP_NODE_WRAP_XY) {
+ // wrap only on the y-axis if tile is wrapping
+ newInput.ymin = getWrappedOriginalYPos(input->ymin);
+ newInput.ymax = getWrappedOriginalYPos(input->ymax) + 0.5f;
+ if (newInput.ymin >= newInput.ymax) {
+ newInput.ymin = 0;
+ newInput.ymax = this->getHeight();
+ }
+ }
- return ReadBufferOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
+ return ReadBufferOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
void WrapOperation::setWrapping(int wrapping_type)
{
- m_wrappingType = wrapping_type;
+ m_wrappingType = wrapping_type;
}