[][src]Trait opencv::prelude::RangeTrait

pub trait RangeTrait {
    pub fn as_raw_Range(&self) -> *const c_void;
pub fn as_raw_mut_Range(&mut self) -> *mut c_void; pub fn start(&self) -> i32 { ... }
pub fn set_start(&mut self, val: i32) { ... }
pub fn end(&self) -> i32 { ... }
pub fn set_end(&mut self, val: i32) { ... }
pub fn size(&self) -> Result<i32> { ... }
pub fn empty(&self) -> Result<bool> { ... } }

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

Required methods

Loading content...

Provided methods

pub fn start(&self) -> i32[src]

pub fn set_start(&mut self, val: i32)[src]

pub fn end(&self) -> i32[src]

pub fn set_end(&mut self, val: i32)[src]

pub fn size(&self) -> Result<i32>[src]

pub fn empty(&self) -> Result<bool>[src]

Loading content...

Implementors

impl RangeTrait for Range[src]

impl RangeTrait for _Range[src]

Loading content...