From 4f509caa8ed0166ef2e99846f12b7997a37c3a7e Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 15 Jul 2020 01:41:07 +0300 Subject: libcamera: geometry: Give constructors to Rectangle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rectangle, unlike Size, has no constructor, requiring the users to explicitly initialize the instances. This is error-prone, add constructors. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- src/libcamera/geometry.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/libcamera/geometry.cpp') diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp index 5a0bcf7c..3a3784df 100644 --- a/src/libcamera/geometry.cpp +++ b/src/libcamera/geometry.cpp @@ -297,6 +297,28 @@ bool operator==(const SizeRange &lhs, const SizeRange &rhs) * refers to, are defined by the context were rectangle is used. */ +/** + * \fn Rectangle::Rectangle() + * \brief Construct a Rectangle with all coordinates set to 0 + */ + +/** + * \fn Rectangle::Rectangle(int x, int y, const Size &size) + * \brief Construct a Rectangle with the given position and size + * \param[in] x The horizontal coordinate of the top-left corner + * \param[in] y The vertical coordinate of the top-left corner + * \param[in] size The size + */ + +/** + * \fn Rectangle::Rectangle(int x, int y, unsigned int width, unsigned int height) + * \brief Construct a Rectangle with the given position and size + * \param[in] x The horizontal coordinate of the top-left corner + * \param[in] y The vertical coordinate of the top-left corner + * \param[in] width The width + * \param[in] height The height + */ + /** * \var Rectangle::x * \brief The horizontal coordinate of the rectangle's top-left corner -- cgit v1.2.1