From patchwork Wed Jun 19 02:51:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 1451 Return-Path: Received: from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net [195.74.38.228]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3D44561A23 for ; Wed, 19 Jun 2019 04:52:23 +0200 (CEST) X-Halon-ID: 3af7e874-923d-11e9-8ab4-005056917a89 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [89.233.230.99]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id 3af7e874-923d-11e9-8ab4-005056917a89; Wed, 19 Jun 2019 04:52:09 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Wed, 19 Jun 2019 04:51:14 +0200 Message-Id: <20190619025129.21164-2-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190619025129.21164-1-niklas.soderlund@ragnatech.se> References: <20190619025129.21164-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 01/16] libcamera: geometry: SizeRange: Add constructor for a single size X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 02:52:23 -0000 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 Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- 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)