OpenPose 1.0.0rc2 OpenPose: A Real-Time Multi-Person Key-Point Detection And Multi-Threading C++ Library

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
rectangle.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_CORE_RECTANGLE_HPP
2 #define OPENPOSE_CORE_RECTANGLE_HPP
3
4 #include <string>
5 #include <openpose/core/macros.hpp>
6 #include <openpose/core/point.hpp>
7
8 namespace op
9 {
10 template<typename T>
11 struct Rectangle
12 {
13 T x;
14 T y;
15 T width;
16 T height;
17
18 Rectangle(const T x = 0, const T y = 0, const T width = 0, const T height = 0);
19
28 Rectangle<T>(const Rectangle<T>& rectangle);
29
36 Rectangle<T>& operator=(const Rectangle<T>& rectangle);
37
43 Rectangle<T>(Rectangle<T>&& rectangle);
44
51 Rectangle<T>& operator=(Rectangle<T>&& rectangle);
52
53 Point<T> center() const;
54
55 inline Point<T> topLeft() const
56 {
57 return Point<T>{x, y};
58 }
59
60 Point<T> bottomRight() const;
61
62 inline T area() const
63 {
64 return width * height;
65 }
66
67 void recenter(const T newWidth, const T newHeight);
68
74 std::string toString() const;
75
76 // ------------------------------ Basic Operators ------------------------------ //
77 Rectangle<T>& operator*=(const T value);
78
79 Rectangle<T> operator*(const T value) const;
80
81 Rectangle<T>& operator/=(const T value);
82
83 Rectangle<T> operator/(const T value) const;
84 };
85
86 // Static methods
87 template<typename T>
88 Rectangle<T> recenter(const Rectangle<T>& rectangle, const T newWidth, const T newHeight);
89
90 OVERLOAD_C_OUT(Rectangle)
91 }
92
93 #endif // OPENPOSE_CORE_RECTANGLE_HPP
op::Rectangle::center
Point< T > center() const
op::Rectangle::operator=
Rectangle< T > & operator=(const Rectangle< T > &rectangle)
point.hpp
op::Rectangle::Rectangle
Rectangle(const T x=0, const T y=0, const T width=0, const T height=0)
op::Rectangle::y
T y
Definition: rectangle.hpp:14
op::Rectangle::recenter
void recenter(const T newWidth, const T newHeight)
op::Point
Definition: point.hpp:10
OVERLOAD_C_OUT
#define OVERLOAD_C_OUT(className)
Definition: macros.hpp:61
op::Rectangle::operator/
Rectangle< T > operator/(const T value) const
op::Rectangle::operator/=
Rectangle< T > & operator/=(const T value)
op::Rectangle::toString
std::string toString() const
op::Rectangle::bottomRight
Point< T > bottomRight() const
op::Rectangle::operator*
Rectangle< T > operator*(const T value) const
op::Rectangle::height
T height
Definition: rectangle.hpp:16
macros.hpp
op::Rectangle::topLeft
Point< T > topLeft() const
Definition: rectangle.hpp:55
op::Rectangle::width
T width
Definition: rectangle.hpp:15
op::Rectangle::x
T x
Definition: rectangle.hpp:13
op::Rectangle::operator*=
Rectangle< T > & operator*=(const T value)
op::Rectangle
Definition: rectangle.hpp:11
op::recenter
Rectangle< T > recenter(const Rectangle< T > &rectangle, const T newWidth, const T newHeight)
op::Rectangle::area
T area() const
Definition: rectangle.hpp:62
cl::string
std::string string
Definition: cl2.hpp:574