[libcamera-devel] [PATCH v3 01/16] libcamera: geometry: SizeRange: Add constructor for a single size
Niklas Söderlund
niklas.soderlund at ragnatech.se
Sun Jun 16 15:33:47 CEST 2019
The SizeRange can describe a single size where min == max. Add a
constructor to help create such a description.
Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
include/libcamera/geometry.h | 5 +++++
src/libcamera/geometry.cpp | 7 +++++++
2 files changed, 12 insertions(+)
diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h
index a87d65d3ed7951c2..ec5ed2bee196c82d 100644
--- a/include/libcamera/geometry.h
+++ b/include/libcamera/geometry.h
@@ -72,6 +72,11 @@ struct SizeRange {
{
}
+ SizeRange(unsigned int width, unsigned int height)
+ : min(width, height), max(width, height)
+ {
+ }
+
SizeRange(unsigned int minW, unsigned int minH,
unsigned int maxW, unsigned int maxH)
: min(minW, minH), max(maxW, maxH)
diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp
index fb8f628a0d8af200..26a05b9e7d800077 100644
--- a/src/libcamera/geometry.cpp
+++ b/src/libcamera/geometry.cpp
@@ -196,6 +196,13 @@ bool operator<(const Size &lhs, const Size &rhs)
* \brief Construct a size range initialized to 0
*/
+/**
+ * \fn SizeRange::SizeRange(unsigned int width, unsigned int height)
+ * \brief Construct a size range representing a single size
+ * \param[in] width The size width
+ * \param[in] height The size height
+ */
+
/**
* \fn SizeRange::SizeRange(unsigned int minW, unsigned int minH,
* unsigned int maxW, unsigned int maxH)
--
2.21.0
More information about the libcamera-devel
mailing list