[][src]Struct opencv::core::GpuMat

pub struct GpuMat { /* fields omitted */ }

Base storage class for GPU memory with reference counting.

Its interface matches the Mat interface with the following limitations:

  • no arbitrary dimensions support (only 2D)
  • no functions that return references to their data (because references on GPU are not valid for CPU)
  • no expression templates technique support

Beware that the latter limitation may lead to overloaded matrix operators that cause memory allocations. The GpuMat class is convertible to cuda::PtrStepSz and cuda::PtrStep so it can be passed directly to the kernel.

Note: In contrast with Mat, in most cases GpuMat::isContinuous() == false . This means that rows are aligned to a size depending on the hardware. Single-row GpuMat is always a continuous matrix.

Note: You are not recommended to leave static or global GpuMat variables allocated, that is, to rely on its destructor. The destruction order of such variables and CUDA context is undefined. GPU memory release function returns error if the CUDA context has been destroyed before.

Some member functions are described as a "Blocking Call" while some are described as a "Non-Blocking Call". Blocking functions are synchronous to host. It is guaranteed that the GPU operation is finished when the function returns. However, non-blocking functions are asynchronous to host. Those functions may return even if the GPU operation is not finished.

Compared to their blocking counterpart, non-blocking functions accept Stream as an additional argument. If a non-default stream is passed, the GPU operation may overlap with operations in other streams.

See also

Mat

Implementations

impl GpuMat[src]

impl GpuMat[src]

pub fn default_allocator(
) -> Result<AbstractRefMut<'static, dyn GpuMat_Allocator>>
[src]

default allocator

pub unsafe fn set_default_allocator(
    allocator: &mut dyn GpuMat_Allocator
) -> Result<()>
[src]

pub unsafe fn new(allocator: &mut dyn GpuMat_Allocator) -> Result<GpuMat>[src]

default constructor

C++ default parameters

  • allocator: GpuMat::defaultAllocator()

pub unsafe fn new_rows_cols(
    rows: i32,
    cols: i32,
    typ: i32,
    allocator: &mut dyn GpuMat_Allocator
) -> Result<GpuMat>
[src]

constructs GpuMat of the specified size and type

C++ default parameters

  • allocator: GpuMat::defaultAllocator()

pub unsafe fn new_size(
    size: Size,
    typ: i32,
    allocator: &mut dyn GpuMat_Allocator
) -> Result<GpuMat>
[src]

C++ default parameters

  • allocator: GpuMat::defaultAllocator()

pub unsafe fn new_rows_cols_with_default(
    rows: i32,
    cols: i32,
    typ: i32,
    s: Scalar,
    allocator: &mut dyn GpuMat_Allocator
) -> Result<GpuMat>
[src]

constructs GpuMat and fills it with the specified value _s

C++ default parameters

  • allocator: GpuMat::defaultAllocator()

pub unsafe fn new_size_with_default(
    size: Size,
    typ: i32,
    s: Scalar,
    allocator: &mut dyn GpuMat_Allocator
) -> Result<GpuMat>
[src]

C++ default parameters

  • allocator: GpuMat::defaultAllocator()

pub fn copy(m: &GpuMat) -> Result<GpuMat>[src]

copy constructor

pub unsafe fn new_rows_cols_with_data(
    rows: i32,
    cols: i32,
    typ: i32,
    data: *mut c_void,
    step: size_t
) -> Result<GpuMat>
[src]

constructor for GpuMat headers pointing to user-allocated data

C++ default parameters

  • step: Mat::AUTO_STEP

pub unsafe fn new_size_with_data(
    size: Size,
    typ: i32,
    data: *mut c_void,
    step: size_t
) -> Result<GpuMat>
[src]

C++ default parameters

  • step: Mat::AUTO_STEP

pub fn rowscols(
    m: &GpuMat,
    row_range: Range,
    col_range: Range
) -> Result<GpuMat>
[src]

creates a GpuMat header for a part of the bigger matrix

pub fn roi(m: &GpuMat, roi: Rect) -> Result<GpuMat>[src]

pub unsafe fn from_hostmem(
    arr: &dyn ToInputArray,
    allocator: &mut dyn GpuMat_Allocator
) -> Result<GpuMat>
[src]

builds GpuMat from host memory (Blocking call)

C++ default parameters

  • allocator: GpuMat::defaultAllocator()

impl GpuMat[src]

pub fn default() -> Result<Self>[src]

Trait Implementations

impl Boxed for GpuMat[src]

impl Clone for GpuMat[src]

pub fn clone(&self) -> Self[src]

Calls try_clone() and panics if that fails

impl Drop for GpuMat[src]

impl GpuMatTrait for GpuMat[src]

impl Send for GpuMat[src]

impl ToInputArray for GpuMat[src]

impl<'_> ToInputArray for &'_ GpuMat[src]

impl ToInputOutputArray for GpuMat[src]

impl<'_> ToInputOutputArray for &'_ mut GpuMat[src]

impl ToOutputArray for GpuMat[src]

impl<'_> ToOutputArray for &'_ mut GpuMat[src]

impl VectorElement for GpuMat where
    Vector<GpuMat>: VectorExtern<GpuMat>, 
[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.