From patchwork Tue Apr 2 17:12:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 858 Return-Path: Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 860E16110E for ; Tue, 2 Apr 2019 19:12:31 +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 relay9-d.mail.gandi.net (Postfix) with ESMTPSA id E21D7FF80D; Tue, 2 Apr 2019 17:12:30 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Tue, 2 Apr 2019 19:12:58 +0200 Message-Id: <20190402171309.6447-3-jacopo@jmondi.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190402171309.6447-1-jacopo@jmondi.org> References: <20190402171309.6447-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v7 02/13] libcamera: geometry: Add Size structure 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: Tue, 02 Apr 2019 17:12:31 -0000 Add a simple Size structure that contains an image width and height. Reviewed-by: Laurent Pinchart Signed-off-by: Jacopo Mondi Reviewed-by: Niklas Söderlund --- src/libcamera/geometry.cpp | 29 +++++++++++++++++++++++++++++ src/libcamera/include/geometry.h | 15 +++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp index f76001d94562..d0c63c353ab3 100644 --- a/src/libcamera/geometry.cpp +++ b/src/libcamera/geometry.cpp @@ -105,4 +105,33 @@ const std::string Rectangle::toString() const * \brief The maximum image height */ +/** + * \struct Size + * \brief Describe a two-dimensional size + * + * The Size structure defines a two-dimensional size with integer precision. + */ + +/** + * \fn Size::Size() + * \brief Construct a Size with width and height set to 0 + */ + +/** + * \fn Size::Size(unsigned int width, unsigned int height) + * \brief Construct a Size with given \a width and \a height + * \param width The Size width + * \param height The Size height + */ + +/** + * \var Size::width + * \brief The Size width + */ + +/** + * \var Size::height + * \brief The Size height + */ + } /* namespace libcamera */ diff --git a/src/libcamera/include/geometry.h b/src/libcamera/include/geometry.h index 567a54299b24..315168a5fbbd 100644 --- a/src/libcamera/include/geometry.h +++ b/src/libcamera/include/geometry.h @@ -40,6 +40,21 @@ struct SizeRange { unsigned int maxHeight; }; +struct Size { + Size() + : Size(0, 0) + { + } + + Size(unsigned int w, unsigned int h) + : width(w), height(h) + { + } + + unsigned int width; + unsigned int height; +}; + } /* namespace libcamera */ #endif /* __LIBCAMERA_GEOMETRY_H__ */