From 724bbf7d2506d65e060c9475010738983f5b85bd Mon Sep 17 00:00:00 2001 From: Yudhistira Erlandinata Date: Wed, 25 Sep 2024 08:12:24 +0000 Subject: libcamera: geometry: Add two-point Rectangle constructor Add a constructor to the Rectangle class that accepts two points. The constructed Rectangle spans all the space between the two given points. Signed-off-by: Yudhistira Erlandinata Co-developed-by: Harvey Yang Reviewed-by: Jacopo Mondi Signed-off-by: Jacopo Mondi Reviewed-by: Harvey Yang --- src/libcamera/geometry.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp index 85a7f53a..90ccf8c1 100644 --- a/src/libcamera/geometry.cpp +++ b/src/libcamera/geometry.cpp @@ -635,6 +635,13 @@ std::ostream &operator<<(std::ostream &out, const SizeRange &sr) * \param[in] size The desired Rectangle size */ +/** + * \fn Rectangle::Rectangle(const Point &point1, const Point &point2) + * \brief Construct a Rectangle from two opposite corners + * \param[in] point1 One of corners of the rectangle + * \param[in] point2 The opposite corner of \a point1 + */ + /** * \var Rectangle::x * \brief The horizontal coordinate of the rectangle's top-left corner -- cgit v1.2.1