template class cv::Size_

Overview

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

#include <types.hpp>

template <typename _Tp>
class Size_
{
public:
    // typedefs

    typedef _Tp value_type;

    // fields

    _Tp height;
    _Tp width;

    // construction

    Size_();

    Size_(
        _Tp _width,
        _Tp _height
        );

    Size_(const Size_& sz);
    Size_(const Point_<_Tp>& pt);

    // methods

    _Tp
    area() const;

    template <typename _Tp2>
    operator Size_< _Tp2 >() const;

    Size_&
    operator=(const Size_& sz);
};

Detailed Documentation

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;

Construction

Size_()

various constructors

Methods

_Tp
area() const

the area (width*height)

template <typename _Tp2>
operator Size_< _Tp2 >() const

conversion of another data type.