nndeploy C++ API  0.2.0
nndeploy C++ API
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
nndeploy::base::Range Class Reference

Template class specifying a continuous subsequence (slice) of a sequence. The class is used to specify a row or a column span in a matrix ( Mat ) and for many other purposes. Range(a,b) is basically the same as a:b in Matlab or a..b in Python. As in Python, start_ is an inclusive left boundary of the range and end_ is an exclusive right boundary of the range. Such a half-opened interval is usually denoted as $[start_,end_)$ . The static method Range::all() returns a special variable that means "the whole sequence" or "the whole range", just like " : " in Matlab or " ... " in Python. All the methods and functions in OpenCV that take Range support this special Range::all() value. But, of course, in case of your own custom processing, you will probably have to check and handle it explicitly: More...

#include <type.h>

Public Member Functions

bool empty () const
 
 Range ()
 
 Range (int _start, int _end)
 
int size () const
 

Static Public Member Functions

static Range all ()
 

Public Attributes

int end_
 
int start_
 

Detailed Description

Template class specifying a continuous subsequence (slice) of a sequence. The class is used to specify a row or a column span in a matrix ( Mat ) and for many other purposes. Range(a,b) is basically the same as a:b in Matlab or a..b in Python. As in Python, start_ is an inclusive left boundary of the range and end_ is an exclusive right boundary of the range. Such a half-opened interval is usually denoted as $[start_,end_)$ . The static method Range::all() returns a special variable that means "the whole sequence" or "the whole range", just like " : " in Matlab or " ... " in Python. All the methods and functions in OpenCV that take Range support this special Range::all() value. But, of course, in case of your own custom processing, you will probably have to check and handle it explicitly:

void my_function(..., const Range& r, ....)
{
if(r == Range::all()) {
// process all the data
}
else {
// process [r.start_, r.end_)
}
}
static Range all()
Definition: type.h:1180

Definition at line 403 of file type.h.

Constructor & Destructor Documentation

◆ Range() [1/2]

nndeploy::base::Range::Range ( )
inline

Definition at line 1172 of file type.h.

◆ Range() [2/2]

nndeploy::base::Range::Range ( int  _start,
int  _end 
)
inline

Definition at line 1174 of file type.h.

Member Function Documentation

◆ all()

Range nndeploy::base::Range::all ( )
inlinestatic

Definition at line 1180 of file type.h.

Here is the call graph for this function:

◆ empty()

bool nndeploy::base::Range::empty ( ) const
inline

Definition at line 1178 of file type.h.

◆ size()

int nndeploy::base::Range::size ( ) const
inline

Definition at line 1176 of file type.h.

Member Data Documentation

◆ end_

int nndeploy::base::Range::end_

Definition at line 411 of file type.h.

◆ start_

int nndeploy::base::Range::start_

Definition at line 411 of file type.h.


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