summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-07-15 01:49:32 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-07-15 17:29:59 +0300
commit945eedaf2f1106b1ac580cb43f259d33c785776c (patch)
tree648b86145d550ce953de8c1a404085a3abc76494 /include
parent4f509caa8ed0166ef2e99846f12b7997a37c3a7e (diff)
libcamera: geometry: Turn Size and Rectangle into classes
SizeRange is defined as a class while Size and Rectangle are defined as struct. This is confusing for users in forward declarations. Simplify it by turning both structures into classes. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/geometry.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h
index 380248ac..16c94a48 100644
--- a/include/libcamera/geometry.h
+++ b/include/libcamera/geometry.h
@@ -2,7 +2,7 @@
/*
* Copyright (C) 2019, Google Inc.
*
- * geometry.h - Geometry-related structure
+ * geometry.h - Geometry-related classes
*/
#ifndef __LIBCAMERA_GEOMETRY_H__
@@ -13,7 +13,9 @@
namespace libcamera {
-struct Size {
+class Size
+{
+public:
Size()
: Size(0, 0)
{
@@ -126,7 +128,9 @@ static inline bool operator!=(const SizeRange &lhs, const SizeRange &rhs)
return !(lhs == rhs);
}
-struct Rectangle {
+class Rectangle
+{
+public:
Rectangle()
: Rectangle(0, 0, 0, 0)
{