summaryrefslogtreecommitdiff
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
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>
-rw-r--r--include/libcamera/geometry.h30
-rw-r--r--src/libcamera/geometry.cpp122
2 files changed, 76 insertions, 76 deletions
diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h
index d217cfd5..f3088d33 100644
--- a/include/libcamera/geometry.h
+++ b/include/libcamera/geometry.h
@@ -13,21 +13,6 @@
namespace libcamera {
-struct Rectangle {
- int x;
- int y;
- unsigned int width;
- unsigned int height;
-
- const std::string toString() const;
-};
-
-bool operator==(const Rectangle &lhs, const Rectangle &rhs);
-static inline bool operator!=(const Rectangle &lhs, const Rectangle &rhs)
-{
- return !(lhs == rhs);
-}
-
struct Size {
Size()
: Size(0, 0)
@@ -141,6 +126,21 @@ static inline bool operator!=(const SizeRange &lhs, const SizeRange &rhs)
return !(lhs == rhs);
}
+struct Rectangle {
+ int x;
+ int y;
+ unsigned int width;
+ unsigned int height;
+
+ const std::string toString() const;
+};
+
+bool operator==(const Rectangle &lhs, const Rectangle &rhs);
+static inline bool operator!=(const Rectangle &lhs, const Rectangle &rhs)
+{
+ return !(lhs == rhs);
+}
+
} /* namespace libcamera */
#endif /* __LIBCAMERA_GEOMETRY_H__ */
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 */