OpenCV: cv::Size_< _Tp > Class Template Reference

| OpenCV 3.4.2 Open Source Computer Vision

Public Types | Public Member Functions | Public Attributes | List of all members
cv::Size_< _Tp > Class Template Reference
Core functionality » Basic structures

Template class for specifying the size of an image or rectangle. More...

`#include "types.hpp"`

## Public Types
typedef _Tp | value_type

## Public Member Functions
| Size_ ()
| default constructor More...
| Size_ (_Tp _width, _Tp _height)
| Size_ (const Size_ &sz)
| Size_ (const Point_< _Tp > &pt)
_Tp | area () const
| the area (width*height) More...
bool | empty () const
| true if empty More...
template<typename _Tp2 >
| operator Size_< _Tp2 > () const
| conversion of another data type. More...
Size_ & | operator= (const Size_ &sz)

## Public Attributes
_Tp | height
| the height More...
_Tp | width
| the width More...

## Detailed Description

### template<typename _Tp>
class cv::Size_< _Tp >

Template class for specifying the size of an image or rectangle.

The class includes two members called width and height. The structure can be converted to and from the old OpenCV structures CvSize and CvSize2D32f . The same set of arithmetic and comparison operations as for Point_ is available.

OpenCV defines the following Size_<> aliases:

typedef Size_<int> Size2i;
typedef Size2i Size;
typedef Size_<float> Size2f;

Examples:
  decompose_homography.cpp, Drawing_2.cpp, fitellipse.cpp, hog.cpp, homography_from_camera_displacement.cpp, lkdemo.cpp, pose_from_homography.cpp, shape_example.cpp, train_HOG.cpp, and warpPerspective_demo.cpp.

## Member Typedef Documentation

## ◆ value_type

template<typename _Tp>

typedef _Tp cv::Size_< _Tp >::value_type

## Constructor & Destructor Documentation

## ◆ Size_() [1/4]

template<typename _Tp>

cv::Size_< _Tp >::Size_ | ( |  | ) |

default constructor

## ◆ Size_() [2/4]

template<typename _Tp>

cv::Size_< _Tp >::Size_ | ( | _Tp | _width,
|  | _Tp | _height
| ) |  |

## ◆ Size_() [3/4]

template<typename _Tp>

cv::Size_< _Tp >::Size_ | ( | const Size_< _Tp > & | sz | ) |

## ◆ Size_() [4/4]

template<typename _Tp>

cv::Size_< _Tp >::Size_ | ( | const Point_< _Tp > & | pt | ) |

## Member Function Documentation

## ◆ area()

template<typename _Tp>

_Tp cv::Size_< _Tp >::area | ( |  | ) | const

the area (width*height)

## ◆ empty()

template<typename _Tp>

bool cv::Size_< _Tp >::empty | ( |  | ) | const

true if empty

## ◆ operator Size_< _Tp2 >()

template<typename _Tp>
template<typename _Tp2 >

cv::Size_< _Tp >::operator Size_< _Tp2 > | ( |  | ) | const

conversion of another data type.

## ◆ operator=()

template<typename _Tp>

Size_& cv::Size_< _Tp >::operator= | ( | const Size_< _Tp > & | sz | ) |

## Member Data Documentation

## ◆ height

template<typename _Tp>

_Tp cv::Size_< _Tp >::height

the height

Examples:
  decompose_homography.cpp, Drawing_2.cpp, fitellipse.cpp, homography_from_camera_displacement.cpp, pose_from_homography.cpp, and train_HOG.cpp.

## ◆ width

template<typename _Tp>

_Tp cv::Size_< _Tp >::width

the width

Examples:
  decompose_homography.cpp, Drawing_2.cpp, fitellipse.cpp, homography_from_camera_displacement.cpp, pose_from_homography.cpp, and train_HOG.cpp.

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

- core/include/opencv2/core/types.hpp