Trait HostMemTraitConst

Source
pub trait HostMemTraitConst {
Show 24 methods // Required method fn as_raw_HostMem(&self) -> *const c_void; // Provided methods fn flags(&self) -> i32 { ... } fn rows(&self) -> i32 { ... } fn cols(&self) -> i32 { ... } fn step(&self) -> size_t { ... } fn data(&self) -> *const u8 { ... } fn refcount(&self) -> *const i32 { ... } fn datastart(&self) -> *const u8 { ... } fn dataend(&self) -> *const u8 { ... } fn alloc_type(&self) -> HostMem_AllocType { ... } fn try_clone(&self) -> Result<HostMem> { ... } fn reshape(&self, cn: i32, rows: i32) -> Result<HostMem> { ... } fn reshape_def(&self, cn: i32) -> Result<HostMem> { ... } fn create_mat_header(&self) -> Result<Mat> { ... } fn create_gpu_mat_header(&self) -> Result<GpuMat> { ... } fn is_continuous(&self) -> Result<bool> { ... } fn elem_size(&self) -> Result<size_t> { ... } fn elem_size1(&self) -> Result<size_t> { ... } fn typ(&self) -> Result<i32> { ... } fn depth(&self) -> Result<i32> { ... } fn channels(&self) -> Result<i32> { ... } fn step1(&self) -> Result<size_t> { ... } fn size(&self) -> Result<Size> { ... } fn empty(&self) -> Result<bool> { ... }
}
Expand description

Constant methods for core::HostMem

Required Methods§

Provided Methods§

Source

fn flags(&self) -> i32

Source

fn rows(&self) -> i32

Source

fn cols(&self) -> i32

Source

fn step(&self) -> size_t

Source

fn data(&self) -> *const u8

Source

fn refcount(&self) -> *const i32

Source

fn datastart(&self) -> *const u8

Source

fn dataend(&self) -> *const u8

Source

fn alloc_type(&self) -> HostMem_AllocType

Source

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

returns deep copy of the matrix, i.e. the data is copied

Source

fn reshape(&self, cn: i32, rows: i32) -> Result<HostMem>

creates alternative HostMem header for the same data, with different number of channels and/or different number of rows

§C++ default parameters
  • rows: 0
Source

fn reshape_def(&self, cn: i32) -> Result<HostMem>

creates alternative HostMem header for the same data, with different number of channels and/or different number of rows

§Note

This alternative version of HostMemTraitConst::reshape function uses the following default values for its arguments:

  • rows: 0
Source

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

returns matrix header with disabled reference counting for HostMem data.

Source

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

Maps CPU memory to GPU address space and creates the cuda::GpuMat header without reference counting for it.

This can be done only if memory was allocated with the SHARED flag and if it is supported by the hardware. Laptops often share video and CPU memory, so address spaces can be mapped, which eliminates an extra copy.

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Implementors§