From c730dc74795d6a603ac9f725c081ff07ed70ee35 Mon Sep 17 00:00:00 2001 From: Han-Lin Chen Date: Tue, 19 Apr 2022 20:42:19 +0800 Subject: libcamera: geometry: Add operator<< for classes in geometry Add operator<< for geometry classes for easier logging. Signed-off-by: Han-Lin Chen Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Reviewed-by: Paul Elder Signed-off-by: Laurent Pinchart --- include/libcamera/geometry.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h index 7838b679..d4a144bc 100644 --- a/include/libcamera/geometry.h +++ b/include/libcamera/geometry.h @@ -46,6 +46,8 @@ static inline bool operator!=(const Point &lhs, const Point &rhs) return !(lhs == rhs); } +std::ostream &operator<<(std::ostream &out, const Point &p); + class Size { public: @@ -192,6 +194,8 @@ static inline bool operator>=(const Size &lhs, const Size &rhs) return !(lhs < rhs); } +std::ostream &operator<<(std::ostream &out, const Size &s); + class SizeRange { public: @@ -232,6 +236,8 @@ static inline bool operator!=(const SizeRange &lhs, const SizeRange &rhs) return !(lhs == rhs); } +std::ostream &operator<<(std::ostream &out, const SizeRange &sr); + class Rectangle { public: @@ -291,4 +297,6 @@ static inline bool operator!=(const Rectangle &lhs, const Rectangle &rhs) return !(lhs == rhs); } +std::ostream &operator<<(std::ostream &out, const Rectangle &r); + } /* namespace libcamera */ -- cgit v1.2.1