diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/geometry.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h index 80f79c6b..3dbbced5 100644 --- a/include/libcamera/geometry.h +++ b/include/libcamera/geometry.h @@ -21,6 +21,12 @@ struct Rectangle { const std::string toString() const; }; +bool operator==(const Rectangle &lhs, const Rectangle &rhs); +static inline bool operator!=(const Rectangle &lhs, const Rectangle &rhs) +{ + return !(lhs == rhs); +} + struct Size { Size() : Size(0, 0) @@ -36,6 +42,29 @@ struct Size { unsigned int height; }; +bool operator==(const Size &lhs, const Size &rhs); +bool operator<(const Size &lhs, const Size &rhs); + +static inline bool operator!=(const Size &lhs, const Size &rhs) +{ + return !(lhs == rhs); +} + +static inline bool operator<=(const Size &lhs, const Size &rhs) +{ + return lhs < rhs || lhs == rhs; +} + +static inline bool operator>(const Size &lhs, const Size &rhs) +{ + return !(lhs <= rhs); +} + +static inline bool operator>=(const Size &lhs, const Size &rhs) +{ + return !(lhs < rhs); +} + struct SizeRange { SizeRange() { @@ -51,6 +80,12 @@ struct SizeRange { Size max; }; +bool operator==(const SizeRange &lhs, const SizeRange &rhs); +static inline bool operator!=(const SizeRange &lhs, const SizeRange &rhs) +{ + return !(lhs == rhs); +} + } /* namespace libcamera */ #endif /* __LIBCAMERA_GEOMETRY_H__ */ |