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/realtime_compositor/intern/domain.cc')
-rw-r--r--source/blender/compositor/realtime_compositor/intern/domain.cc38
1 files changed, 38 insertions, 0 deletions
diff --git a/source/blender/compositor/realtime_compositor/intern/domain.cc b/source/blender/compositor/realtime_compositor/intern/domain.cc
new file mode 100644
index 00000000000..31b297c212e
--- /dev/null
+++ b/source/blender/compositor/realtime_compositor/intern/domain.cc
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include "BLI_float3x3.hh"
+#include "BLI_math_vec_types.hh"
+
+#include "COM_domain.hh"
+
+namespace blender::realtime_compositor {
+
+Domain::Domain(int2 size) : size(size), transformation(float3x3::identity())
+{
+}
+
+Domain::Domain(int2 size, float3x3 transformation) : size(size), transformation(transformation)
+{
+}
+
+void Domain::transform(const float3x3 &input_transformation)
+{
+ transformation = input_transformation * transformation;
+}
+
+Domain Domain::identity()
+{
+ return Domain(int2(1), float3x3::identity());
+}
+
+bool operator==(const Domain &a, const Domain &b)
+{
+ return a.size == b.size && a.transformation == b.transformation;
+}
+
+bool operator!=(const Domain &a, const Domain &b)
+{
+ return !(a == b);
+}
+
+} // namespace blender::realtime_compositor