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§
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
Sourcefn try_clone(&self) -> Result<HostMem>
fn try_clone(&self) -> Result<HostMem>
returns deep copy of the matrix, i.e. the data is copied
Sourcefn reshape(&self, cn: i32, rows: i32) -> Result<HostMem>
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
Sourcefn reshape_def(&self, cn: i32) -> Result<HostMem>
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
Sourcefn create_mat_header(&self) -> Result<Mat>
fn create_mat_header(&self) -> Result<Mat>
returns matrix header with disabled reference counting for HostMem data.
Sourcefn create_gpu_mat_header(&self) -> Result<GpuMat>
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.