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>2018-05-25 11:04:25 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-05-25 11:04:25 +0300
commitef22d2e8adb9965cd3cb91e733d4b9754cf6024f (patch)
tree1d95a52cd619be4b9974c6aa2f197373a1831912 /source/blender/compositor
parent2a6e4f71576ebee19f34fd5f7c214fd2e9f060f8 (diff)
parentd02335a1950c81fffea815f31e47bca92ab7d33c (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/compositor')
-rw-r--r--source/blender/compositor/nodes/COM_MathNode.cpp3
-rw-r--r--source/blender/compositor/operations/COM_MathBaseOperation.cpp13
-rw-r--r--source/blender/compositor/operations/COM_MathBaseOperation.h6
3 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/compositor/nodes/COM_MathNode.cpp b/source/blender/compositor/nodes/COM_MathNode.cpp
index eb6bb2caf56..0fb6933afe7 100644
--- a/source/blender/compositor/nodes/COM_MathNode.cpp
+++ b/source/blender/compositor/nodes/COM_MathNode.cpp
@@ -86,6 +86,9 @@ void MathNode::convertToOperations(NodeConverter &converter, const CompositorCon
case NODE_MATH_ABS:
operation = new MathAbsoluteOperation();
break;
+ case NODE_MATH_ATAN2:
+ operation = new MathArcTan2Operation();
+ break;
}
if (operation) {
diff --git a/source/blender/compositor/operations/COM_MathBaseOperation.cpp b/source/blender/compositor/operations/COM_MathBaseOperation.cpp
index 32a1e77b9a7..dbc91980acd 100644
--- a/source/blender/compositor/operations/COM_MathBaseOperation.cpp
+++ b/source/blender/compositor/operations/COM_MathBaseOperation.cpp
@@ -343,3 +343,16 @@ void MathAbsoluteOperation::executePixelSampled(float output[4], float x, float
clampIfNeeded(output);
}
+
+void MathArcTan2Operation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+{
+ float inputValue1[4];
+ float inputValue2[4];
+
+ this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
+ this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
+
+ output[0] = atan2(inputValue1[0], inputValue2[0]);
+
+ clampIfNeeded(output);
+} \ No newline at end of file
diff --git a/source/blender/compositor/operations/COM_MathBaseOperation.h b/source/blender/compositor/operations/COM_MathBaseOperation.h
index 32cd19f1fb9..04019372711 100644
--- a/source/blender/compositor/operations/COM_MathBaseOperation.h
+++ b/source/blender/compositor/operations/COM_MathBaseOperation.h
@@ -169,4 +169,10 @@ public:
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
+class MathArcTan2Operation : public MathBaseOperation {
+public:
+ MathArcTan2Operation() : MathBaseOperation() {}
+ void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
+};
+
#endif