OpenCV  2.4.13
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

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

Constructor & Destructor Documentation

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

various constructors

template<typename _Tp>
cv::Rect_< _Tp >::Rect_ ( _Tp  _x,
_Tp  _y,
_Tp  _width,
_Tp  _height 
)
inline
template<typename _Tp>
cv::Rect_< _Tp >::Rect_ ( const Rect_< _Tp > &  r)
inline
template<typename _Tp>
cv::Rect_< _Tp >::Rect_ ( const CvRect r)
inline
template<typename _Tp>
cv::Rect_< _Tp >::Rect_ ( const Point_< _Tp > &  org,
const Size_< _Tp > &  sz 
)
inline
template<typename _Tp>
cv::Rect_< _Tp >::Rect_ ( const Point_< _Tp > &  pt1,
const Point_< _Tp > &  pt2 
)
inline

Member Function Documentation

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

area (width*height) of the rectangle

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

the bottom-right corner

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

checks whether the rectangle contains the point

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

conversion to the old-style CvRect

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

conversion to another data type

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

size (width, height) of the rectangle

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

the top-left corner

Member Data Documentation

template<typename _Tp>
_Tp cv::Rect_< _Tp >::height
template<typename _Tp>
_Tp cv::Rect_< _Tp >::width
template<typename _Tp>
_Tp cv::Rect_< _Tp >::x
template<typename _Tp>
_Tp cv::Rect_< _Tp >::y

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