OpenCV  2.4.13.6
Open Source Computer Vision
cv::Rect_< _Tp > Class Template Reference

#include <core.hpp>

Public Types

typedef _Tp value_type
 

Public Member Functions

 Rect_ ()
 various constructors More...
 
 Rect_ (_Tp _x, _Tp _y, _Tp _width, _Tp _height)
 
 Rect_ (const Rect_ &r)
 
 Rect_ (const CvRect &r)
 
 Rect_ (const Point_< _Tp > &org, const Size_< _Tp > &sz)
 
 Rect_ (const Point_< _Tp > &pt1, const Point_< _Tp > &pt2)
 
Rect_operator= (const Rect_ &r)
 
Point_< _Tp > tl () const
 the top-left corner More...
 
Point_< _Tp > br () const
 the bottom-right corner More...
 
Size_< _Tp > size () const
 size (width, height) of the rectangle More...
 
_Tp area () const
 area (width*height) of the rectangle More...
 
template<typename _Tp2 >
 operator Rect_< _Tp2 > () const
 conversion to another data type More...
 
 operator CvRect () const
 conversion to the old-style CvRect More...
 
bool contains (const Point_< _Tp > &pt) const
 checks whether the rectangle contains the point More...
 

Public Attributes

_Tp x
 
_Tp y
 
_Tp width
 
_Tp height
 

Detailed Description

template<typename _Tp>
class cv::Rect_< _Tp >

The 2D up-right rectangle class

The class represents a 2D rectangle with coordinates of the specified data type. Normally, cv::Rect ~ cv::Rect_<int> is used.

Member Typedef Documentation

§ value_type

template<typename _Tp>
typedef _Tp cv::Rect_< _Tp >::value_type

Constructor & Destructor Documentation

§ Rect_() [1/6]

template<typename _Tp >
cv::Rect_< _Tp >::Rect_ ( )
inline

various constructors

§ Rect_() [2/6]

template<typename _Tp>
cv::Rect_< _Tp >::Rect_ ( _Tp  _x,
_Tp  _y,
_Tp  _width,
_Tp  _height 
)
inline

§ Rect_() [3/6]

template<typename _Tp>
cv::Rect_< _Tp >::Rect_ ( const Rect_< _Tp > &  r)
inline

§ Rect_() [4/6]

template<typename _Tp>
cv::Rect_< _Tp >::Rect_ ( const CvRect r)
inline

§ Rect_() [5/6]

template<typename _Tp>
cv::Rect_< _Tp >::Rect_ ( const Point_< _Tp > &  org,
const Size_< _Tp > &  sz 
)
inline

§ Rect_() [6/6]

template<typename _Tp>
cv::Rect_< _Tp >::Rect_ ( const Point_< _Tp > &  pt1,
const Point_< _Tp > &  pt2 
)
inline

Member Function Documentation

§ area()

template<typename _Tp >
_Tp cv::Rect_< _Tp >::area ( ) const
inline

area (width*height) of the rectangle

§ br()

template<typename _Tp >
Point_< _Tp > cv::Rect_< _Tp >::br ( ) const
inline

the bottom-right corner

§ contains()

template<typename _Tp>
bool cv::Rect_< _Tp >::contains ( const Point_< _Tp > &  pt) const
inline

checks whether the rectangle contains the point

§ operator CvRect()

template<typename _Tp >
cv::Rect_< _Tp >::operator CvRect ( ) const
inline

conversion to the old-style CvRect

§ operator Rect_< _Tp2 >()

template<typename _Tp >
template<typename _Tp2 >
cv::Rect_< _Tp >::operator Rect_< _Tp2 > ( ) const
inline

conversion to another data type

§ operator=()

template<typename _Tp >
Rect_< _Tp > & cv::Rect_< _Tp >::operator= ( const Rect_< _Tp > &  r)
inline

§ size()

template<typename _Tp >
Size_< _Tp > cv::Rect_< _Tp >::size ( ) const
inline

size (width, height) of the rectangle

§ tl()

template<typename _Tp >
Point_< _Tp > cv::Rect_< _Tp >::tl ( ) const
inline

the top-left corner

Member Data Documentation

§ height

template<typename _Tp>
_Tp cv::Rect_< _Tp >::height

§ width

template<typename _Tp>
_Tp cv::Rect_< _Tp >::width

§ x

template<typename _Tp>
_Tp cv::Rect_< _Tp >::x

§ y

template<typename _Tp>
_Tp cv::Rect_< _Tp >::y

The documentation for this class was generated from the following files: