From a69414529f463ba1d2f0fa4a9e80538193f9b099 Mon Sep 17 00:00:00 2001
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Date: Sun, 15 Mar 2020 02:56:20 +0200
Subject: libcamera: geometry: Construct SizeRange from Size
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The SizeRange constructors take minimum and maximum width and height
values as separate arguments. We have a Size class to convey size
information, use it in the constructors, and update the callers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 include/libcamera/geometry.h | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

(limited to 'include')

diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h
index 52f4d010..7f1b29fe 100644
--- a/include/libcamera/geometry.h
+++ b/include/libcamera/geometry.h
@@ -74,21 +74,19 @@ public:
 	{
 	}
 
-	SizeRange(unsigned int width, unsigned int height)
-		: min(width, height), max(width, height), hStep(1), vStep(1)
+	SizeRange(const Size &size)
+		: min(size), max(size), hStep(1), vStep(1)
 	{
 	}
 
-	SizeRange(unsigned int minW, unsigned int minH,
-		  unsigned int maxW, unsigned int maxH)
-		: min(minW, minH), max(maxW, maxH), hStep(1), vStep(1)
+	SizeRange(const Size &minSize, const Size &maxSize)
+		: min(minSize), max(maxSize), hStep(1), vStep(1)
 	{
 	}
 
-	SizeRange(unsigned int minW, unsigned int minH,
-		  unsigned int maxW, unsigned int maxH,
+	SizeRange(const Size &minSize, const Size &maxSize,
 		  unsigned int hstep, unsigned int vstep)
-		: min(minW, minH), max(maxW, maxH), hStep(hstep), vStep(vstep)
+		: min(minSize), max(maxSize), hStep(hstep), vStep(vstep)
 	{
 	}
 
-- 
cgit v1.2.1