summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2020-07-01 10:21:17 +0200
committerJacopo Mondi <jacopo@jmondi.org>2020-08-03 11:16:16 +0200
commitdd0793ed1b28a6819116d6bfa676bc3d1a028780 (patch)
tree1c754df7ddfc5acf6ef2e39131464b1f37705042 /src
parentd405d1fd5e791b3ebc45dc980be2fce9ac0f3529 (diff)
libcamera: geometry: Add isNull() function to Rectangle class
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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/geometry.cpp6
1 files changed, 6 insertions, 0 deletions
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
@@ -386,6 +386,12 @@ bool operator==(const SizeRange &lhs, const SizeRange &rhs)
*/
/**
+ * \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
*/