summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-07-15 01:43:34 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-07-15 17:29:59 +0300
commit935aec66ae50ec2448e052c95757b2a83e3999ba (patch)
tree89fee10062105c3321c80c1e95e8f9fa6adb7abf /src
parent120cbd802463803165d342a0206f820bd1e11e6c (diff)
libcamera: geometry: Define Rectangle after Size
A subsequent change to the Rectangle will require the definition of the Size to be available. Define Rectangle after Size to ease review of that change. No code change is included. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/geometry.cpp122
1 files changed, 61 insertions, 61 deletions
diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp
index 4594f9ff..5a0bcf7c 100644
--- a/src/libcamera/geometry.cpp
+++ b/src/libcamera/geometry.cpp
@@ -18,67 +18,6 @@
namespace libcamera {
/**
- * \struct Rectangle
- * \brief Describe a rectangle's position and dimensions
- *
- * Rectangles are used to identify an area of an image. They are specified by
- * the coordinates of top-left corner and their horizontal and vertical size.
- *
- * The measure unit of the rectangle coordinates and size, as well as the
- * reference point from which the Rectangle::x and Rectangle::y displacements
- * refers to, are defined by the context were rectangle is used.
- */
-
-/**
- * \var Rectangle::x
- * \brief The horizontal coordinate of the rectangle's top-left corner
- */
-
-/**
- * \var Rectangle::y
- * \brief The vertical coordinate of the rectangle's top-left corner
- */
-
-/**
- * \var Rectangle::width
- * \brief The distance between the left and right sides
- */
-
-/**
- * \var Rectangle::height
- * \brief The distance between the top and bottom sides
- */
-
-/**
- * \brief Assemble and return a string describing the rectangle
- * \return A string describing the Rectangle
- */
-const std::string Rectangle::toString() const
-{
- std::stringstream ss;
-
- ss << "(" << x << "x" << y << ")/" << width << "x" << height;
-
- return ss.str();
-}
-
-/**
- * \brief Compare rectangles for equality
- * \return True if the two rectangles are equal, false otherwise
- */
-bool operator==(const Rectangle &lhs, const Rectangle &rhs)
-{
- return lhs.x == rhs.x && lhs.y == rhs.y &&
- lhs.width == rhs.width && lhs.height == rhs.height;
-}
-
-/**
- * \fn bool operator!=(const Rectangle &lhs, const Rectangle &rhs)
- * \brief Compare rectangles for inequality
- * \return True if the two rectangles are not equal, false otherwise
- */
-
-/**
* \struct Size
* \brief Describe a two-dimensional size
*
@@ -346,4 +285,65 @@ bool operator==(const SizeRange &lhs, const SizeRange &rhs)
* \return True if the two size ranges are not equal, false otherwise
*/
+/**
+ * \struct Rectangle
+ * \brief Describe a rectangle's position and dimensions
+ *
+ * Rectangles are used to identify an area of an image. They are specified by
+ * the coordinates of top-left corner and their horizontal and vertical size.
+ *
+ * The measure unit of the rectangle coordinates and size, as well as the
+ * reference point from which the Rectangle::x and Rectangle::y displacements
+ * refers to, are defined by the context were rectangle is used.
+ */
+
+/**
+ * \var Rectangle::x
+ * \brief The horizontal coordinate of the rectangle's top-left corner
+ */
+
+/**
+ * \var Rectangle::y
+ * \brief The vertical coordinate of the rectangle's top-left corner
+ */
+
+/**
+ * \var Rectangle::width
+ * \brief The distance between the left and right sides
+ */
+
+/**
+ * \var Rectangle::height
+ * \brief The distance between the top and bottom sides
+ */
+
+/**
+ * \brief Assemble and return a string describing the rectangle
+ * \return A string describing the Rectangle
+ */
+const std::string Rectangle::toString() const
+{
+ std::stringstream ss;
+
+ ss << "(" << x << "x" << y << ")/" << width << "x" << height;
+
+ return ss.str();
+}
+
+/**
+ * \brief Compare rectangles for equality
+ * \return True if the two rectangles are equal, false otherwise
+ */
+bool operator==(const Rectangle &lhs, const Rectangle &rhs)
+{
+ return lhs.x == rhs.x && lhs.y == rhs.y &&
+ lhs.width == rhs.width && lhs.height == rhs.height;
+}
+
+/**
+ * \fn bool operator!=(const Rectangle &lhs, const Rectangle &rhs)
+ * \brief Compare rectangles for inequality
+ * \return True if the two rectangles are not equal, false otherwise
+ */
+
} /* namespace libcamera */