summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/bitmap.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/util/bitmap.h')
-rw-r--r--src/lib/util/bitmap.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/util/bitmap.h b/src/lib/util/bitmap.h
index 4deb2550329..1b8dee3b5b5 100644
--- a/src/lib/util/bitmap.h
+++ b/src/lib/util/bitmap.h
@@ -75,6 +75,20 @@ public:
return *this;
}
+ rectangle operator&(const rectangle &b)
+ {
+ rectangle a(*this);
+ a &= b;
+ return a;
+ }
+
+ rectangle operator|(const rectangle &b)
+ {
+ rectangle a(*this);
+ a |= b;
+ return a;
+ }
+
// comparisons
constexpr bool operator==(const rectangle &rhs) const { return min_x == rhs.min_x && max_x == rhs.max_x && min_y == rhs.min_y && max_y == rhs.max_y; }
constexpr bool operator!=(const rectangle &rhs) const { return min_x != rhs.min_x || max_x != rhs.max_x || min_y != rhs.min_y || max_y != rhs.max_y; }