EstervQrCode 1.1.1
Library for qr code manipulation
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
cv::cuda::HostMem Class Reference

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

#include <cuda.hpp>

Public Types

enum  AllocType { PAGE_LOCKED = 1 , SHARED = 2 , WRITE_COMBINED = 4 }
 

Public Member Functions

CV_WRAP HostMem (HostMem::AllocType alloc_type=HostMem::AllocType::PAGE_LOCKED)
 
 HostMem (const HostMem &m)
 
CV_WRAP HostMem (int rows, int cols, int type, HostMem::AllocType alloc_type=HostMem::AllocType::PAGE_LOCKED)
 
CV_WRAP HostMem (Size size, int type, HostMem::AllocType alloc_type=HostMem::AllocType::PAGE_LOCKED)
 
CV_WRAP HostMem (InputArray arr, HostMem::AllocType alloc_type=HostMem::AllocType::PAGE_LOCKED)
 creates from host memory with coping data More...
 
 ~HostMem ()
 
HostMemoperator= (const HostMem &m)
 
CV_WRAP void swap (HostMem &b)
 swaps with other smart pointer More...
 
CV_WRAP HostMem clone () const
 returns deep copy of the matrix, i.e. the data is copied More...
 
CV_WRAP void create (int rows, int cols, int type)
 allocates new matrix data unless the matrix already has specified size and type. More...
 
void create (Size size, int type)
 
CV_WRAP HostMem reshape (int cn, int rows=0) const
 
void release ()
 decrements reference counter and released memory if needed. More...
 
CV_WRAP Mat createMatHeader () const
 returns matrix header with disabled reference counting for HostMem data. More...
 
GpuMat createGpuMatHeader () const
 Maps CPU memory to GPU address space and creates the cuda::GpuMat header without reference counting for it. More...
 
CV_WRAP bool isContinuous () const
 
CV_WRAP size_t elemSize () const
 
CV_WRAP size_t elemSize1 () const
 
CV_WRAP int type () const
 
CV_WRAP int depth () const
 
CV_WRAP int channels () const
 
CV_WRAP size_t step1 () const
 
CV_WRAP Size size () const
 
CV_WRAP bool empty () const
 

Static Public Member Functions

static MatAllocatorgetAllocator (HostMem::AllocType alloc_type=HostMem::AllocType::PAGE_LOCKED)
 

Public Attributes

int flags
 
int rows
 
int cols
 
CV_PROP size_t step
 
uchardata
 
int * refcount
 
uchardatastart
 
const uchardataend
 
AllocType alloc_type
 

Detailed Description

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

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

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.

Member Enumeration Documentation

◆ AllocType

Enumerator
PAGE_LOCKED 
SHARED 
WRITE_COMBINED 

Constructor & Destructor Documentation

◆ HostMem() [1/5]

CV_WRAP cv::cuda::HostMem::HostMem ( HostMem::AllocType  alloc_type = HostMem::AllocType::PAGE_LOCKED)
explicit

◆ HostMem() [2/5]

cv::cuda::HostMem::HostMem ( const HostMem m)

◆ HostMem() [3/5]

CV_WRAP cv::cuda::HostMem::HostMem ( int  rows,
int  cols,
int  type,
HostMem::AllocType  alloc_type = HostMem::AllocType::PAGE_LOCKED 
)

◆ HostMem() [4/5]

CV_WRAP cv::cuda::HostMem::HostMem ( Size  size,
int  type,
HostMem::AllocType  alloc_type = HostMem::AllocType::PAGE_LOCKED 
)

◆ HostMem() [5/5]

CV_WRAP cv::cuda::HostMem::HostMem ( InputArray  arr,
HostMem::AllocType  alloc_type = HostMem::AllocType::PAGE_LOCKED 
)
explicit

creates from host memory with coping data

◆ ~HostMem()

cv::cuda::HostMem::~HostMem ( )

Member Function Documentation

◆ channels()

CV_WRAP int cv::cuda::HostMem::channels ( ) const

◆ clone()

CV_WRAP HostMem cv::cuda::HostMem::clone ( ) const

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

◆ create() [1/2]

CV_WRAP void cv::cuda::HostMem::create ( int  rows,
int  cols,
int  type 
)

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

◆ create() [2/2]

void cv::cuda::HostMem::create ( Size  size,
int  type 
)

◆ createGpuMatHeader()

GpuMat cv::cuda::HostMem::createGpuMatHeader ( ) const

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.

◆ createMatHeader()

CV_WRAP Mat cv::cuda::HostMem::createMatHeader ( ) const

returns matrix header with disabled reference counting for HostMem data.

◆ depth()

CV_WRAP int cv::cuda::HostMem::depth ( ) const

◆ elemSize()

CV_WRAP size_t cv::cuda::HostMem::elemSize ( ) const

◆ elemSize1()

CV_WRAP size_t cv::cuda::HostMem::elemSize1 ( ) const

◆ empty()

CV_WRAP bool cv::cuda::HostMem::empty ( ) const

◆ getAllocator()

static MatAllocator* cv::cuda::HostMem::getAllocator ( HostMem::AllocType  alloc_type = HostMem::AllocType::PAGE_LOCKED)
static

◆ isContinuous()

CV_WRAP bool cv::cuda::HostMem::isContinuous ( ) const

◆ operator=()

HostMem& cv::cuda::HostMem::operator= ( const HostMem m)

◆ release()

void cv::cuda::HostMem::release ( )

decrements reference counter and released memory if needed.

◆ reshape()

CV_WRAP HostMem cv::cuda::HostMem::reshape ( int  cn,
int  rows = 0 
) const

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

◆ size()

CV_WRAP Size cv::cuda::HostMem::size ( ) const

◆ step1()

CV_WRAP size_t cv::cuda::HostMem::step1 ( ) const

◆ swap()

CV_WRAP void cv::cuda::HostMem::swap ( HostMem b)

swaps with other smart pointer

◆ type()

CV_WRAP int cv::cuda::HostMem::type ( ) const

Member Data Documentation

◆ alloc_type

AllocType cv::cuda::HostMem::alloc_type

◆ cols

int cv::cuda::HostMem::cols

◆ data

uchar* cv::cuda::HostMem::data

◆ dataend

const uchar* cv::cuda::HostMem::dataend

◆ datastart

uchar* cv::cuda::HostMem::datastart

◆ flags

int cv::cuda::HostMem::flags

◆ refcount

int* cv::cuda::HostMem::refcount

◆ rows

int cv::cuda::HostMem::rows

◆ step

CV_PROP size_t cv::cuda::HostMem::step

The documentation for this class was generated from the following file: