Struct opencv::core::_OutputArray

source ·
pub struct _OutputArray { /* private fields */ }
Expand description

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:

   typedef OutputArray OutputArrayOfArrays;
   typedef OutputArray InputOutputArray;
   typedef OutputArray InputOutputArrayOfArrays;

Implementations§

source§

impl _OutputArray

source

pub fn default() -> Result<_OutputArray>

/////////////////////////////////////////////////////////////////////////////////////

source

pub unsafe fn new(_flags: i32, _obj: *mut c_void) -> Result<_OutputArray>

source

pub fn from_mat_mut( m: &mut impl MatTrait ) -> Result<BoxedRefMut<'_, _OutputArray>>

source

pub fn from_mat_vec_mut( vec: &mut Vector<Mat> ) -> Result<BoxedRefMut<'_, _OutputArray>>

source

pub fn from_gpumat_mut( d_mat: &mut impl GpuMatTrait ) -> Result<BoxedRefMut<'_, _OutputArray>>

source

pub fn from_gpumat_vec_mut( d_mat: &mut Vector<GpuMat> ) -> Result<BoxedRefMut<'_, _OutputArray>>

source

pub fn from_opengl_mut( buf: &mut impl BufferTrait ) -> Result<BoxedRefMut<'_, _OutputArray>>

source

pub fn from_hostmem_mut( cuda_mem: &mut impl HostMemTrait ) -> Result<BoxedRefMut<'_, _OutputArray>>

source

pub fn from_umat_mut( m: &mut impl UMatTrait ) -> Result<BoxedRefMut<'_, _OutputArray>>

source

pub fn from_umat_vec_mut( vec: &mut Vector<UMat> ) -> Result<BoxedRefMut<'_, _OutputArray>>

source

pub fn from_mat(m: &impl MatTraitConst) -> Result<BoxedRef<'_, _OutputArray>>

source

pub fn from_mat_vec(vec: &Vector<Mat>) -> Result<BoxedRef<'_, _OutputArray>>

source

pub fn from_gpumat( d_mat: &impl GpuMatTraitConst ) -> Result<BoxedRef<'_, _OutputArray>>

source

pub fn from_opengl( buf: &impl BufferTraitConst ) -> Result<BoxedRef<'_, _OutputArray>>

source

pub fn from_hostmem( cuda_mem: &impl HostMemTraitConst ) -> Result<BoxedRef<'_, _OutputArray>>

source

pub fn from_umat(m: &impl UMatTraitConst) -> Result<BoxedRef<'_, _OutputArray>>

source

pub fn from_umat_vec(vec: &Vector<UMat>) -> Result<BoxedRef<'_, _OutputArray>>

Trait Implementations§

source§

impl Boxed for _OutputArray

source§

unsafe fn from_raw( ptr: <_OutputArray as OpenCVFromExtern>::ExternReceive ) -> Self

Wrap the specified raw pointer Read more
source§

fn into_raw(self) -> <_OutputArray as OpenCVTypeExternContainer>::ExternSendMut

Return the underlying raw pointer while consuming this wrapper. Read more
source§

fn as_raw(&self) -> <_OutputArray as OpenCVTypeExternContainer>::ExternSend

Return the underlying raw pointer. Read more
source§

fn as_raw_mut( &mut self ) -> <_OutputArray as OpenCVTypeExternContainer>::ExternSendMut

Return the underlying mutable raw pointer Read more
source§

impl Debug for _OutputArray

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for _OutputArray

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl From<_InputOutputArray> for _OutputArray

source§

fn from(s: _InputOutputArray) -> Self

Converts to this type from the input type.
source§

impl From<_OutputArray> for _InputArray

source§

fn from(s: _OutputArray) -> Self

Converts to this type from the input type.
source§

impl ToInputArray for _OutputArray

source§

impl ToOutputArray for _OutputArray

source§

impl _InputArrayTrait for _OutputArray

source§

impl _InputArrayTraitConst for _OutputArray

source§

fn as_raw__InputArray(&self) -> *const c_void

source§

fn get_mat(&self, idx: i32) -> Result<Mat>

C++ default parameters Read more
source§

fn get_mat_def(&self) -> Result<Mat>

source§

fn get_mat_(&self, idx: i32) -> Result<Mat>

C++ default parameters Read more
source§

fn get_mat__def(&self) -> Result<Mat>

source§

fn get_umat(&self, idx: i32) -> Result<UMat>

C++ default parameters Read more
source§

fn get_umat_def(&self) -> Result<UMat>

source§

fn get_mat_vector(&self, mv: &mut Vector<Mat>) -> Result<()>

source§

fn get_umat_vector(&self, umv: &mut Vector<UMat>) -> Result<()>

source§

fn get_gpu_mat_vector(&self, gpumv: &mut Vector<GpuMat>) -> Result<()>

source§

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

source§

fn get_o_gl_buffer(&self) -> Result<Buffer>

source§

fn get_flags(&self) -> Result<i32>

source§

fn get_obj(&self) -> Result<*mut c_void>

source§

fn get_sz(&self) -> Result<Size>

source§

fn kind(&self) -> Result<_InputArray_KindFlag>

source§

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

C++ default parameters Read more
source§

fn dims_def(&self) -> Result<i32>

source§

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

C++ default parameters Read more
source§

fn cols_def(&self) -> Result<i32>

source§

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

C++ default parameters Read more
source§

fn rows_def(&self) -> Result<i32>

source§

fn size(&self, i: i32) -> Result<Size>

C++ default parameters Read more
source§

fn size_def(&self) -> Result<Size>

source§

fn sizend(&self, sz: &mut i32, i: i32) -> Result<i32>

C++ default parameters Read more
source§

fn sizend_def(&self, sz: &mut i32) -> Result<i32>

source§

fn same_size(&self, arr: &impl ToInputArray) -> Result<bool>

source§

fn total(&self, i: i32) -> Result<size_t>

C++ default parameters Read more
source§

fn total_def(&self) -> Result<size_t>

source§

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

C++ default parameters Read more
source§

fn typ_def(&self) -> Result<i32>

source§

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

C++ default parameters Read more
source§

fn depth_def(&self) -> Result<i32>

source§

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

C++ default parameters Read more
source§

fn channels_def(&self) -> Result<i32>

source§

fn is_continuous(&self, i: i32) -> Result<bool>

C++ default parameters Read more
source§

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

source§

fn is_submatrix(&self, i: i32) -> Result<bool>

C++ default parameters Read more
source§

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

source§

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

source§

fn copy_to(&self, arr: &mut impl ToOutputArray) -> Result<()>

source§

fn copy_to_masked( &self, arr: &mut impl ToOutputArray, mask: &impl ToInputArray ) -> Result<()>

source§

fn offset(&self, i: i32) -> Result<size_t>

C++ default parameters Read more
source§

fn offset_def(&self) -> Result<size_t>

source§

fn step(&self, i: i32) -> Result<size_t>

C++ default parameters Read more
source§

fn step_def(&self) -> Result<size_t>

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

impl _OutputArrayTrait for _OutputArray

source§

impl _OutputArrayTraitConst for _OutputArray

source§

fn as_raw__OutputArray(&self) -> *const c_void

source§

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

source§

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

source§

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

source§

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

C++ default parameters Read more
source§

fn get_mat_ref_def(&self) -> Result<Mat>

source§

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

C++ default parameters Read more
source§

fn get_umat_ref_def(&self) -> Result<UMat>

source§

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

source§

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

source§

fn get_o_gl_buffer_ref(&self) -> Result<Buffer>

source§

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

source§

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

C++ default parameters Read more
source§

fn create_size_def(&self, sz: Size, typ: i32) -> Result<()>

source§

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

C++ default parameters Read more
source§

fn create_def(&self, rows: i32, cols: i32, typ: i32) -> Result<()>

source§

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

C++ default parameters Read more
source§

fn create_nd_def(&self, size: &[i32], typ: i32) -> Result<()>

source§

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

source§

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

source§

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

source§

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

C++ default parameters Read more
source§

fn set_to_def(&self, value: &impl ToInputArray) -> Result<()>

source§

fn assign_umat(&self, u: &impl UMatTraitConst) -> Result<()>

source§

fn assign_mat(&self, m: &impl MatTraitConst) -> Result<()>

source§

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

source§

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

source§

fn move_umat(&self, u: &mut impl UMatTrait) -> Result<()>

source§

fn move_mat(&self, m: &mut impl MatTrait) -> Result<()>

source§

impl Send for _OutputArray

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<Mat> ModifyInplace for Mat
where Mat: Boxed,

source§

unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res ) -> Res

Helper function to call OpenCV functions that allow in-place modification of a Mat or another similar object. By passing a mutable reference to the Mat to this function your closure will get called with the read reference and a write references to the same Mat. This is of course unsafe as it breaks the Rust aliasing rules, but it might be useful for some performance sensitive operations. One example of an OpenCV function that allows such in-place modification is imgproc::threshold. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.