From patchwork Tue Apr 2 16:21:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 844 Return-Path: Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DF6B0610BF for ; Tue, 2 Apr 2019 18:20:55 +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 relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 6D7ED20004; Tue, 2 Apr 2019 16:20:55 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Tue, 2 Apr 2019 18:21:24 +0200 Message-Id: <20190402162134.3894-3-jacopo@jmondi.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190402162134.3894-1-jacopo@jmondi.org> References: <20190402162134.3894-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v6 02/12] 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 16:20:56 -0000 Add a simple Size structure that contains an image width and height. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- 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..30531d0c678a 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 an image size + * + * Size describes the vertical and horizontal sizes of an image. + */ + +/** + * \fn Size::Size() + * \brief Construct a size initialized to 0 + */ + +/** + * \fn Size::Size(unsigned int w, unsigned int h) + * \brief Construct an initialized size + * \param w The image width + * \param h The image height + */ + +/** + * \var Size::width + * \brief The image width + */ + +/** + * \var Size::height + * \brief The image height + */ + } /* namespace libcamera */ diff --git a/src/libcamera/include/geometry.h b/src/libcamera/include/geometry.h index 567a54299b24..24be5e2f6f78 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(void) + : 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__ */