nndeploy C++ API  0.2.0
nndeploy C++ API
Public Types | Public Member Functions | Public Attributes | List of all members
nndeploy::base::Size< T > Class Template Reference

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. More...

#include <type.h>

Public Types

typedef T value_type
 

Public Member Functions

area () const
 the area (width_*height_) More...
 
double aspectRatio () const
 aspect ratio (width_/height_) More...
 
bool empty () const
 true if empty More...
 
template<typename Tp2 >
 operator Size< Tp2 > () const
 conversion of another data type. More...
 
Sizeoperator= (const Size &sz)=default
 
Sizeoperator= (Size &&sz)=default
 
 Size ()
 default constructor More...
 
 Size (const Point< T > &pt)
 
 Size (const Size &sz)=default
 
 Size (Size &&sz)=default
 
 Size (T width, T height)
 

Public Attributes

height_
 the height_ More...
 
width_
 the width_ More...
 

Detailed Description

template<typename T>
class nndeploy::base::Size< T >

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;
Size()
default constructor
Definition: type.h:860
Size< float > Size2f
Definition: type.h:281
Size< int > Size2i
Definition: type.h:280

Definition at line 250 of file type.h.

Member Typedef Documentation

◆ value_type

template<typename T >
typedef T nndeploy::base::Size< T >::value_type

Definition at line 252 of file type.h.

Constructor & Destructor Documentation

◆ Size() [1/5]

template<typename T >
nndeploy::base::Size< T >::Size
inline

default constructor

Definition at line 860 of file type.h.

◆ Size() [2/5]

template<typename T >
nndeploy::base::Size< T >::Size ( width,
height 
)
inline

Definition at line 863 of file type.h.

◆ Size() [3/5]

template<typename T >
nndeploy::base::Size< T >::Size ( const Size< T > &  sz)
default

◆ Size() [4/5]

template<typename T >
nndeploy::base::Size< T >::Size ( Size< T > &&  sz)
default

◆ Size() [5/5]

template<typename T >
nndeploy::base::Size< T >::Size ( const Point< T > &  pt)
inline

Definition at line 866 of file type.h.

Member Function Documentation

◆ area()

template<typename T >
T nndeploy::base::Size< T >::area
inline

the area (width_*height_)

Definition at line 875 of file type.h.

◆ aspectRatio()

template<typename T >
double nndeploy::base::Size< T >::aspectRatio
inline

aspect ratio (width_/height_)

Definition at line 881 of file type.h.

◆ empty()

template<typename T >
bool nndeploy::base::Size< T >::empty
inline

true if empty

Definition at line 886 of file type.h.

◆ operator Size< Tp2 >()

template<typename T >
template<typename Tp2 >
nndeploy::base::Size< T >::operator Size< Tp2 >
inline

conversion of another data type.

Definition at line 870 of file type.h.

◆ operator=() [1/2]

template<typename T >
Size& nndeploy::base::Size< T >::operator= ( const Size< T > &  sz)
default

◆ operator=() [2/2]

template<typename T >
Size& nndeploy::base::Size< T >::operator= ( Size< T > &&  sz)
default

Member Data Documentation

◆ height_

template<typename T >
T nndeploy::base::Size< T >::height_

the height_

Definition at line 277 of file type.h.

◆ width_

template<typename T >
T nndeploy::base::Size< T >::width_

the width_

Definition at line 276 of file type.h.


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