summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2019-05-26 18:27:09 +0200
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2019-06-19 01:44:51 +0200
commit85a9b66134d48a4f805c77079599056492576b0b (patch)
treeef1f12ff31ffbb9a07eb294c6e732578c90ce988
parentc6090542cd4623d39ec9affb7d127ea188933890 (diff)
libcamera: geometry: SizeRange: Add constructor for a single size
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@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--include/libcamera/geometry.h5
-rw-r--r--src/libcamera/geometry.cpp7
2 files changed, 12 insertions, 0 deletions
diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h
index a87d65d3..ec5ed2be 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 fb8f628a..26a05b9e 100644
--- a/src/libcamera/geometry.cpp
+++ b/src/libcamera/geometry.cpp
@@ -197,6 +197,13 @@ bool operator<(const Size &lhs, const Size &rhs)
*/
/**
+ * \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)
* \brief Construct an initialized size range