From patchwork Wed Apr 3 08:01:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 888 Return-Path: Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C0E2A6110D for ; Wed, 3 Apr 2019 10:01:10 +0200 (CEST) X-Originating-IP: 2.224.242.101 Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id EEEEF6000A; Wed, 3 Apr 2019 08:01:08 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Wed, 3 Apr 2019 10:01:36 +0200 Message-Id: <20190403080148.11479-2-jacopo@jmondi.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190403080148.11479-1-jacopo@jmondi.org> References: <20190403080148.11479-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v8 01/13] libcamera: geometry: Add 0-initialized SizeRange constructor 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, 03 Apr 2019 08:01:11 -0000 Add constructor to SizeRange which initialize all the size range fields to 0. While at there make the in-line constructor declarations respect the coding style by moving braces to a new line. Reviewed-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Signed-off-by: Jacopo Mondi --- src/libcamera/geometry.cpp | 11 ++++++++++- src/libcamera/include/geometry.h | 9 ++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp index 6dc8e74d2801..f76001d94562 100644 --- a/src/libcamera/geometry.cpp +++ b/src/libcamera/geometry.cpp @@ -73,7 +73,16 @@ const std::string Rectangle::toString() const /** * \fn SizeRange::SizeRange() - * \brief Construct a size range + * \brief Construct a size range initialized to 0 + */ + +/** + * \fn SizeRange::SizeRange(unsigned int minW, unsigned int minH, unsigned int maxW, unsigned int maxH) + * \brief Construct an initialized size range + * \param minW The minimum width + * \param minH The minimum height + * \param maxW The maximum width + * \param maxH The maximum height */ /** diff --git a/src/libcamera/include/geometry.h b/src/libcamera/include/geometry.h index b14f9732f3db..d8d587d3b47b 100644 --- a/src/libcamera/include/geometry.h +++ b/src/libcamera/include/geometry.h @@ -22,10 +22,17 @@ struct Rectangle { }; struct SizeRange { + SizeRange() + : SizeRange(0, 0, 0, 0) + { + } + SizeRange(unsigned int minW, unsigned int minH, unsigned int maxW, unsigned int maxH) : minWidth(minW), minHeight(minH), maxWidth(maxW), - maxHeight(maxH) {} + maxHeight(maxH) + { + } unsigned int minWidth; unsigned int minHeight;