|
nndeploy C++ API
0.2.0
nndeploy C++ API
|
Template class for 2D points specified by its coordinates x_ an y_. An instance of the class is interchangeable with C structures, CvPoint and CvPoint2D32f . There is also a cast operator to convert point coordinates to the specified type. The conversion from floating-point coordinates to integer coordinates is done by rounding. Commonly, the conversion uses this operation for each of the coordinates. Besides the class members listed in the declaration above, the following operations on points are implemented:
More...
#include <type.h>
Public Types | |
| typedef T | value_type |
Public Member Functions | |
| double | cross (const Point &pt) const |
| cross-product More... | |
| double | ddot (const Point &pt) const |
| dot product computed in double-precision arithmetics More... | |
| T | dot (const Point &pt) const |
| dot product More... | |
| bool | inside (const Rect< T > &r) const |
| checks whether the point is inside the specified rectangle More... | |
| template<typename Tp2 > | |
| operator Point< Tp2 > () const | |
| conversion to another data type More... | |
| Point & | operator= (const Point &pt) |
| Point & | operator= (Point &&pt)=default |
| Point () | |
| default constructor More... | |
| Point (const Point &pt) | |
| Point (const Size< T > &sz) | |
| Point (Point &&pt)=default | |
| Point (T x, T y) | |
Public Attributes | |
| T | x_ |
| x_ coordinate of the point More... | |
| T | y_ |
| y_ coordinate of the point More... | |
Template class for 2D points specified by its coordinates x_ an y_. An instance of the class is interchangeable with C structures, CvPoint and CvPoint2D32f . There is also a cast operator to convert point coordinates to the specified type. The conversion from floating-point coordinates to integer coordinates is done by rounding. Commonly, the conversion uses this operation for each of the coordinates. Besides the class members listed in the declaration above, the following operations on points are implemented:
For your convenience, the following type aliases are defined:
Example:
| typedef T nndeploy::base::Point< T >::value_type |
|
inline |
|
inline |
|
inline |
|
default |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
default |
| T nndeploy::base::Point< T >::x_ |
| T nndeploy::base::Point< T >::y_ |