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 --- include/libcamera/geometry.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/libcamera/geometry.h') diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h index d858f85c..02fb63c0 100644 --- a/include/libcamera/geometry.h +++ b/include/libcamera/geometry.h @@ -181,6 +181,7 @@ public: unsigned int width; unsigned int height; + bool isNull() const { return !width && !height; } const std::string toString() const; }; -- cgit v1.2.1