Struct opencv::core::Range

source ·
pub struct Range { /* private fields */ }
Expand 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 inline formula .

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)
       }
   }

Implementations

////////////////////////////// Range /////////////////////////////////

Trait Implementations

Wrap the specified raw pointer Read more
Return an the underlying raw pointer while consuming this wrapper. Read more
Return the underlying raw pointer. Read more
Return the underlying mutable raw pointer Read more
Executes the destructor for this type. Read more
Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.