From dd0793ed1b28a6819116d6bfa676bc3d1a028780 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Wed, 1 Jul 2020 10:21:17 +0200 Subject: libcamera: geometry: Add isNull() function to Rectangle class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's common for code to check if a rectangle is null. Add a helper function to do so and test the function in test/geometry.cpp Reviewed-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Signed-off-by: Jacopo Mondi --- src/libcamera/geometry.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/libcamera/geometry.cpp') diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp index 23181bde..b12e1a62 100644 --- a/src/libcamera/geometry.cpp +++ b/src/libcamera/geometry.cpp @@ -385,6 +385,12 @@ bool operator==(const SizeRange &lhs, const SizeRange &rhs) * \brief The distance between the top and bottom sides */ +/** + * \fn bool Rectangle::isNull() const + * \brief Check if the rectangle is null + * \return True if both the width and height are 0, or false otherwise + */ + /** * \brief Assemble and return a string describing the rectangle * \return A string describing the Rectangle -- cgit v1.2.1