[][src]Trait opencv::core::prelude::_OutputArrayTrait

pub trait _OutputArrayTrait: _InputArrayTrait {
    fn as_raw__OutputArray(&self) -> *const c_void;
fn as_raw_mut__OutputArray(&mut self) -> *mut c_void; fn fixed_size(&self) -> Result<bool> { ... }
fn fixed_type(&self) -> Result<bool> { ... }
fn needed(&self) -> Result<bool> { ... }
fn get_mat_ref(&self, i: i32) -> Result<Mat> { ... }
fn get_umat_ref(&self, i: i32) -> Result<UMat> { ... }
fn get_gpu_mat_ref(&self) -> Result<GpuMat> { ... }
fn get_gpu_mat_vec_ref(&self) -> Result<Vector<GpuMat>> { ... }
fn get_host_mem_ref(&self) -> Result<HostMem> { ... }
fn create_size(
        &self,
        sz: Size,
        typ: i32,
        i: i32,
        allow_transposed: bool,
        fixed_depth_mask: _OutputArray_DepthMask
    ) -> Result<()> { ... }
fn create(
        &self,
        rows: i32,
        cols: i32,
        typ: i32,
        i: i32,
        allow_transposed: bool,
        fixed_depth_mask: _OutputArray_DepthMask
    ) -> Result<()> { ... }
fn create_nd(
        &self,
        size: &[i32],
        typ: i32,
        i: i32,
        allow_transposed: bool,
        fixed_depth_mask: _OutputArray_DepthMask
    ) -> Result<()> { ... }
unsafe fn create_same_size(
        &self,
        arr: &dyn ToInputArray,
        mtype: i32
    ) -> Result<()> { ... }
fn release(&self) -> Result<()> { ... }
fn clear(&self) -> Result<()> { ... }
fn set_to(
        &self,
        value: &dyn ToInputArray,
        mask: &dyn ToInputArray
    ) -> Result<()> { ... }
fn assign(&self, u: &UMat) -> Result<()> { ... }
fn assign_1(&self, m: &Mat) -> Result<()> { ... }
fn assign_2(&self, v: &Vector<UMat>) -> Result<()> { ... }
fn assign_3(&self, v: &Vector<Mat>) -> Result<()> { ... }
fn move_(&self, u: &mut UMat) -> Result<()> { ... }
fn move__1(&self, m: &mut Mat) -> Result<()> { ... } }

This type is very similar to InputArray except that it is used for input/output and output function parameters.

Just like with InputArray, OpenCV users should not care about OutputArray, they just pass Mat, vector<T> etc. to the functions. The same limitation as for InputArray: Do not explicitly create OutputArray instances applies here too.

If you want to make your function polymorphic (i.e. accept different arrays as output parameters), it is also not very difficult. Take the sample above as the reference. Note that _OutputArray::create() needs to be called before _OutputArray::getMat(). This way you guarantee that the output array is properly allocated.

Optional output parameters. If you do not need certain output array to be computed and returned to you, pass cv::noArray(), just like you would in the case of optional input array. At the implementation level, use _OutputArray::needed() to check if certain output array needs to be computed or not.

There are several synonyms for OutputArray that are used to assist automatic Python/Java/... wrapper generators:

This example is not tested
   typedef OutputArray OutputArrayOfArrays;
   typedef OutputArray InputOutputArray;
   typedef OutputArray InputOutputArrayOfArrays;

Required methods

Loading content...

Provided methods

fn fixed_size(&self) -> Result<bool>

fn fixed_type(&self) -> Result<bool>

fn needed(&self) -> Result<bool>

fn get_mat_ref(&self, i: i32) -> Result<Mat>

fn get_umat_ref(&self, i: i32) -> Result<UMat>

fn get_gpu_mat_ref(&self) -> Result<GpuMat>

fn get_gpu_mat_vec_ref(&self) -> Result<Vector<GpuMat>>

fn get_host_mem_ref(&self) -> Result<HostMem>

fn create_size(
    &self,
    sz: Size,
    typ: i32,
    i: i32,
    allow_transposed: bool,
    fixed_depth_mask: _OutputArray_DepthMask
) -> Result<()>

C++ default parameters

  • i: -1
  • allow_transposed: false
  • fixed_depth_mask: static_cast<_OutputArray::DepthMask>(0)

fn create(
    &self,
    rows: i32,
    cols: i32,
    typ: i32,
    i: i32,
    allow_transposed: bool,
    fixed_depth_mask: _OutputArray_DepthMask
) -> Result<()>

C++ default parameters

  • i: -1
  • allow_transposed: false
  • fixed_depth_mask: static_cast<_OutputArray::DepthMask>(0)

fn create_nd(
    &self,
    size: &[i32],
    typ: i32,
    i: i32,
    allow_transposed: bool,
    fixed_depth_mask: _OutputArray_DepthMask
) -> Result<()>

C++ default parameters

  • i: -1
  • allow_transposed: false
  • fixed_depth_mask: static_cast<_OutputArray::DepthMask>(0)

unsafe fn create_same_size(
    &self,
    arr: &dyn ToInputArray,
    mtype: i32
) -> Result<()>

fn release(&self) -> Result<()>

fn clear(&self) -> Result<()>

fn set_to(
    &self,
    value: &dyn ToInputArray,
    mask: &dyn ToInputArray
) -> Result<()>

C++ default parameters

  • mask: _InputArray()

fn assign(&self, u: &UMat) -> Result<()>

fn assign_1(&self, m: &Mat) -> Result<()>

fn assign_2(&self, v: &Vector<UMat>) -> Result<()>

fn assign_3(&self, v: &Vector<Mat>) -> Result<()>

fn move_(&self, u: &mut UMat) -> Result<()>

fn move__1(&self, m: &mut Mat) -> Result<()>

Loading content...

Implementors

Loading content...