[][src]Trait opencv::prelude::HostMemTrait

pub trait HostMemTrait {
    pub fn as_raw_HostMem(&self) -> *const c_void;
pub fn as_raw_mut_HostMem(&mut self) -> *mut c_void; pub fn flags(&self) -> i32 { ... }
pub fn set_flags(&mut self, val: i32) { ... }
pub fn rows(&self) -> i32 { ... }
pub fn set_rows(&mut self, val: i32) { ... }
pub fn cols(&self) -> i32 { ... }
pub fn set_cols(&mut self, val: i32) { ... }
pub fn step(&self) -> size_t { ... }
pub fn set_step(&mut self, val: size_t) { ... }
pub fn data(&mut self) -> &mut u8 { ... }
pub fn set_data(&mut self, val: &mut u8) { ... }
pub fn refcount(&mut self) -> &mut i32 { ... }
pub fn set_refcount(&mut self, val: &mut i32) { ... }
pub fn datastart(&mut self) -> &mut u8 { ... }
pub fn set_datastart(&mut self, val: &mut u8) { ... }
pub fn dataend(&self) -> &u8 { ... }
pub fn alloc_type(&self) -> HostMem_AllocType { ... }
pub fn set_alloc_type(&mut self, val: HostMem_AllocType) { ... }
pub fn swap(&mut self, b: &mut HostMem) -> Result<()> { ... }
pub fn try_clone(&self) -> Result<HostMem> { ... }
pub fn create(&mut self, rows: i32, cols: i32, typ: i32) -> Result<()> { ... }
pub fn create_1(&mut self, size: Size, typ: i32) -> Result<()> { ... }
pub fn reshape(&self, cn: i32, rows: i32) -> Result<HostMem> { ... }
pub fn release(&mut self) -> Result<()> { ... }
pub fn create_mat_header(&self) -> Result<Mat> { ... }
pub fn create_gpu_mat_header(&self) -> Result<GpuMat> { ... }
pub fn is_continuous(&self) -> Result<bool> { ... }
pub fn elem_size(&self) -> Result<size_t> { ... }
pub fn elem_size1(&self) -> Result<size_t> { ... }
pub fn typ(&self) -> Result<i32> { ... }
pub fn depth(&self) -> Result<i32> { ... }
pub fn channels(&self) -> Result<i32> { ... }
pub fn step1(&self) -> Result<size_t> { ... }
pub fn size(&self) -> Result<Size> { ... }
pub fn empty(&self) -> Result<bool> { ... } }

Class with reference counting wrapping special memory type allocation functions from CUDA.

Its interface is also Mat-like but with additional memory type parameters.

  • PAGE_LOCKED sets a page locked memory type used commonly for fast and asynchronous uploading/downloading data from/to GPU.
  • SHARED specifies a zero copy memory allocation that enables mapping the host memory to GPU address space, if supported.
  • WRITE_COMBINED sets the write combined buffer that is not cached by CPU. Such buffers are used to supply GPU with data when GPU only reads it. The advantage is a better CPU cache utilization.

Note: Allocation size of such memory types is usually limited. For more details, see CUDA 2.2 Pinned Memory APIs document or CUDA C Programming Guide.

Required methods

Loading content...

Provided methods

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

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

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

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

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

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

pub fn step(&self) -> size_t[src]

pub fn set_step(&mut self, val: size_t)[src]

pub fn data(&mut self) -> &mut u8[src]

pub fn set_data(&mut self, val: &mut u8)[src]

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

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

pub fn datastart(&mut self) -> &mut u8[src]

pub fn set_datastart(&mut self, val: &mut u8)[src]

pub fn dataend(&self) -> &u8[src]

pub fn alloc_type(&self) -> HostMem_AllocType[src]

pub fn set_alloc_type(&mut self, val: HostMem_AllocType)[src]

pub fn swap(&mut self, b: &mut HostMem) -> Result<()>[src]

swaps with other smart pointer

pub fn try_clone(&self) -> Result<HostMem>[src]

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

pub fn create(&mut self, rows: i32, cols: i32, typ: i32) -> Result<()>[src]

allocates new matrix data unless the matrix already has specified size and type.

pub fn create_1(&mut self, size: Size, typ: i32) -> Result<()>[src]

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

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

C++ default parameters

  • rows: 0

pub fn release(&mut self) -> Result<()>[src]

decrements reference counter and released memory if needed.

pub fn create_mat_header(&self) -> Result<Mat>[src]

returns matrix header with disabled reference counting for HostMem data.

pub fn create_gpu_mat_header(&self) -> Result<GpuMat>[src]

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.

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

pub fn elem_size(&self) -> Result<size_t>[src]

pub fn elem_size1(&self) -> Result<size_t>[src]

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

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

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

pub fn step1(&self) -> Result<size_t>[src]

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

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

Loading content...

Implementors

impl HostMemTrait for HostMem[src]

Loading content...