summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-06-25 04:23:30 +0300
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-06-29 16:17:34 +0200
commit7fc65e9680f604099d5d4f294b37fe7eb93acb03 (patch)
treeeaf53f9b38bbb375d830dabaf07273cb37947c50 /include
parentd8848693bf92c15a4ce18a3ff8b43f537de5e033 (diff)
libcamera: geometry: Add isNull() function to Size class
It's common for code to check if a size is null. Add a helper function to do so. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <email@uajain.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/geometry.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h
index edda42cf..7d4b8bcf 100644
--- a/include/libcamera/geometry.h
+++ b/include/libcamera/geometry.h
@@ -41,6 +41,7 @@ struct Size {
unsigned int width;
unsigned int height;
+ bool isNull() const { return !width && !height; }
const std::string toString() const;
};