OpenCV
4.3.0
Open Source Computer Vision
|
Template class for 2D points specified by its coordinates x
and y
.
More...
#include <opencv2/core/types.hpp>
Public Types | |
typedef _Tp | value_type |
Public Member Functions | |
Point_ () | |
default constructor More... | |
Point_ (_Tp _x, _Tp _y) | |
Point_ (const Point_ &pt) | |
Point_ (Point_ &&pt) CV_NOEXCEPT | |
Point_ (const Size_< _Tp > &sz) | |
Point_ (const Vec< _Tp, 2 > &v) | |
double | cross (const Point_ &pt) const |
cross-product More... | |
double | ddot (const Point_ &pt) const |
dot product computed in double-precision arithmetics More... | |
_Tp | dot (const Point_ &pt) const |
dot product More... | |
bool | inside (const Rect_< _Tp > &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... | |
operator Vec< _Tp, 2 > () const | |
conversion to the old-style C structures More... | |
Point_ & | operator= (const Point_ &pt) |
Point_ & | operator= (Point_ &&pt) CV_NOEXCEPT |
Public Attributes | |
_Tp | x |
x coordinate of the point More... | |
_Tp | y |
y coordinate of the point More... | |
Template class for 2D points specified by its coordinates x
and 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 _Tp cv::Point_< _Tp >::value_type |
cv::Point_< _Tp >::Point_ | ( | ) |
default constructor
cv::Point_< _Tp >::Point_ | ( | _Tp | _x, |
_Tp | _y | ||
) |
cv::Point_< _Tp >::Point_ | ( | const Point_< _Tp > & | pt | ) |
cv::Point_< _Tp >::Point_ | ( | Point_< _Tp > && | pt | ) |
cv::Point_< _Tp >::Point_ | ( | const Size_< _Tp > & | sz | ) |
cv::Point_< _Tp >::Point_ | ( | const Vec< _Tp, 2 > & | v | ) |
double cv::Point_< _Tp >::cross | ( | const Point_< _Tp > & | pt | ) | const |
cross-product
double cv::Point_< _Tp >::ddot | ( | const Point_< _Tp > & | pt | ) | const |
dot product computed in double-precision arithmetics
_Tp cv::Point_< _Tp >::dot | ( | const Point_< _Tp > & | pt | ) | const |
dot product
bool cv::Point_< _Tp >::inside | ( | const Rect_< _Tp > & | r | ) | const |
checks whether the point is inside the specified rectangle
cv::Point_< _Tp >::operator Point_< _Tp2 > | ( | ) | const |
conversion to another data type
cv::Point_< _Tp >::operator Vec< _Tp, 2 > | ( | ) | const |
conversion to the old-style C structures
Point_& cv::Point_< _Tp >::operator= | ( | const Point_< _Tp > & | pt | ) |
Point_& cv::Point_< _Tp >::operator= | ( | Point_< _Tp > && | pt | ) |
_Tp cv::Point_< _Tp >::x |
x coordinate of the point
_Tp cv::Point_< _Tp >::y |
y coordinate of the point