OpenCV  4.0.0-pre
Open Source Computer Vision
Looking for a C++ dev who knows OpenCV?
I'm looking for work. Hire me!
cv::cudev::GpuMat_< T > Class Template Reference

#include "gpumat.hpp"

Inheritance diagram for cv::cudev::GpuMat_< T >:
Collaboration diagram for cv::cudev::GpuMat_< T >:

Public Types

typedef T value_type
 

Public Member Functions

__host__ GpuMat_ (Allocator *allocator=defaultAllocator())
 default constructor More...
 
__host__ GpuMat_ (int arows, int acols, Allocator *allocator=defaultAllocator())
 constructs GpuMat of the specified size More...
 
__host__ GpuMat_ (Size asize, Allocator *allocator=defaultAllocator())
 
__host__ GpuMat_ (int arows, int acols, Scalar val, Allocator *allocator=defaultAllocator())
 constucts GpuMat and fills it with the specified value More...
 
__host__ GpuMat_ (Size asize, Scalar val, Allocator *allocator=defaultAllocator())
 
__host__ GpuMat_ (const GpuMat_ &m)
 copy constructor More...
 
__host__ GpuMat_ (const GpuMat &m, Allocator *allocator=defaultAllocator())
 copy/conversion constructor. If m is of different type, it's converted More...
 
__host__ GpuMat_ (int arows, int acols, T *adata, size_t astep=Mat::AUTO_STEP)
 constructs a matrix on top of user-allocated data. step is in bytes(!!!), regardless of the type More...
 
__host__ GpuMat_ (Size asize, T *adata, size_t astep=Mat::AUTO_STEP)
 
__host__ GpuMat_ (const GpuMat_ &m, Range arowRange, Range acolRange)
 selects a submatrix More...
 
__host__ GpuMat_ (const GpuMat_ &m, Rect roi)
 
__host__ GpuMat_ (InputArray arr, Allocator *allocator=defaultAllocator())
 builds GpuMat from host memory (Blocking call) More...
 
template<class Body >
__host__ GpuMat_ (const Expr< Body > &expr)
 expression templates More...
 
__host__ GpuMat_adjustROI (int dtop, int dbottom, int dleft, int dright)
 
template<class Body >
__host__ GpuMat_assign (const Expr< Body > &expr, Stream &stream)
 
void assignTo (GpuMat &m, int type=-1) const
 
__host__ int channels () const
 
__host__ GpuMat_ clone () const
 overridden forms of GpuMat::row() etc. More...
 
__host__ GpuMat_ col (int x) const
 
__host__ GpuMat_ colRange (int startcol, int endcol) const
 
__host__ GpuMat_ colRange (Range r) const
 
void convertTo (OutputArray dst, int rtype) const
 converts GpuMat to another datatype (Blocking call) More...
 
void convertTo (OutputArray dst, int rtype, Stream &stream) const
 converts GpuMat to another datatype (Non-Blocking call) More...
 
void convertTo (OutputArray dst, int rtype, double alpha, double beta=0.0) const
 converts GpuMat to another datatype with scaling (Blocking call) More...
 
void convertTo (OutputArray dst, int rtype, double alpha, Stream &stream) const
 converts GpuMat to another datatype with scaling (Non-Blocking call) More...
 
void convertTo (OutputArray dst, int rtype, double alpha, double beta, Stream &stream) const
 converts GpuMat to another datatype with scaling (Non-Blocking call) More...
 
void copyTo (OutputArray dst) const
 copies the GpuMat content to device memory (Blocking call) More...
 
void copyTo (OutputArray dst, Stream &stream) const
 copies the GpuMat content to device memory (Non-Blocking call) More...
 
void copyTo (OutputArray dst, InputArray mask) const
 copies those GpuMat elements to "m" that are marked with non-zero mask elements (Blocking call) More...
 
void copyTo (OutputArray dst, InputArray mask, Stream &stream) const
 copies those GpuMat elements to "m" that are marked with non-zero mask elements (Non-Blocking call) More...
 
__host__ void create (int arows, int acols)
 allocates new GpuMat data unless the GpuMat already has specified size and type More...
 
__host__ void create (Size asize)
 
void create (int rows, int cols, int type)
 allocates new GpuMat data unless the GpuMat already has specified size and type More...
 
void create (Size size, int type)
 
__host__ int depth () const
 
void download (OutputArray dst) const
 Performs data download from GpuMat (Blocking call) More...
 
void download (OutputArray dst, Stream &stream) const
 Performs data download from GpuMat (Non-Blocking call) More...
 
__host__ size_t elemSize () const
 overridden forms of GpuMat::elemSize() etc. More...
 
__host__ size_t elemSize1 () const
 
bool empty () const
 returns true if GpuMat data is NULL More...
 
bool isContinuous () const
 returns true iff the GpuMat data is continuous (i.e. More...
 
void locateROI (Size &wholeSize, Point &ofs) const
 locates GpuMat header within a parent GpuMat More...
 
__host__ operator GlobPtr< T > () const
 
__host__ operator GlobPtrSz< T > () const
 convert to GlobPtr More...
 
template<typename _Tp >
 operator PtrStep< _Tp > () const
 
template<typename _Tp >
 operator PtrStepSz< _Tp > () const
 
__host__ GpuMat_ operator() (Range rowRange, Range colRange) const
 
__host__ GpuMat_ operator() (Rect roi) const
 
__host__ GpuMat_operator= (const GpuMat_ &m)
 assignment operators More...
 
template<class Body >
__host__ GpuMat_operator= (const Expr< Body > &expr)
 
__host__ Toperator[] (int y)
 more convenient forms of row and element access operators More...
 
__host__ const Toperator[] (int y) const
 
ucharptr (int y=0)
 returns pointer to y-th row More...
 
const ucharptr (int y=0) const
 
template<typename _Tp >
_Tp * ptr (int y=0)
 template version of the above method More...
 
template<typename _Tp >
const _Tp * ptr (int y=0) const
 
void release ()
 decreases reference counter, deallocate the data when reference counter reaches 0 More...
 
GpuMat reshape (int cn, int rows=0) const
 creates alternative GpuMat header for the same data, with different number of channels and/or different number of rows More...
 
__host__ GpuMat_ row (int y) const
 
__host__ GpuMat_ rowRange (int startrow, int endrow) const
 
__host__ GpuMat_ rowRange (Range r) const
 
GpuMatsetTo (Scalar s)
 sets some of the GpuMat elements to s (Blocking call) More...
 
GpuMatsetTo (Scalar s, Stream &stream)
 sets some of the GpuMat elements to s (Non-Blocking call) More...
 
GpuMatsetTo (Scalar s, InputArray mask)
 sets some of the GpuMat elements to s, according to the mask (Blocking call) More...
 
GpuMatsetTo (Scalar s, InputArray mask, Stream &stream)
 sets some of the GpuMat elements to s, according to the mask (Non-Blocking call) More...
 
Size size () const
 returns GpuMat size : width == number of columns, height == number of rows More...
 
__host__ size_t step1 () const
 
__host__ size_t stepT () const
 returns step()/sizeof(T) More...
 
__host__ void swap (GpuMat_ &mat)
 swaps with other smart pointer More...
 
void swap (GpuMat &mat)
 swaps with other smart pointer More...
 
__host__ int type () const
 
void updateContinuityFlag ()
 internal use method: updates the continuity flag More...
 
__host__ void upload (InputArray arr)
 pefroms upload data to GpuMat (Blocking call) More...
 
__host__ void upload (InputArray arr, Stream &stream)
 pefroms upload data to GpuMat (Non-Blocking call) More...
 

Static Public Member Functions

static GpuMat::AllocatordefaultAllocator ()
 default allocator More...
 
static void setDefaultAllocator (GpuMat::Allocator *allocator)
 

Public Attributes

Allocatorallocator
 allocator More...
 
int cols
 
uchardata
 pointer to the data More...
 
const uchardataend
 
uchardatastart
 helper fields used in locateROI and adjustROI More...
 
int flags
 includes several bit-fields: More...
 
int * refcount
 pointer to the reference counter; when GpuMat points to user-allocated data, the pointer is NULL More...
 
int rows
 the number of rows and columns More...
 
size_t step
 a distance between successive rows in bytes; includes the gap if any More...
 

Member Typedef Documentation

◆ value_type

template<typename T>
typedef T cv::cudev::GpuMat_< T >::value_type

Constructor & Destructor Documentation

◆ GpuMat_() [1/13]

template<typename T>
__host__ cv::cudev::GpuMat_< T >::GpuMat_ ( Allocator allocator = defaultAllocator())

default constructor

◆ GpuMat_() [2/13]

template<typename T>
__host__ cv::cudev::GpuMat_< T >::GpuMat_ ( int  arows,
int  acols,
Allocator allocator = defaultAllocator() 
)

constructs GpuMat of the specified size

◆ GpuMat_() [3/13]

template<typename T>
__host__ cv::cudev::GpuMat_< T >::GpuMat_ ( Size  asize,
Allocator allocator = defaultAllocator() 
)
explicit

◆ GpuMat_() [4/13]

template<typename T>
__host__ cv::cudev::GpuMat_< T >::GpuMat_ ( int  arows,
int  acols,
Scalar  val,
Allocator allocator = defaultAllocator() 
)

constucts GpuMat and fills it with the specified value

◆ GpuMat_() [5/13]

template<typename T>
__host__ cv::cudev::GpuMat_< T >::GpuMat_ ( Size  asize,
Scalar  val,
Allocator allocator = defaultAllocator() 
)

◆ GpuMat_() [6/13]

template<typename T>
__host__ cv::cudev::GpuMat_< T >::GpuMat_ ( const GpuMat_< T > &  m)

copy constructor

◆ GpuMat_() [7/13]

template<typename T>
__host__ cv::cudev::GpuMat_< T >::GpuMat_ ( const GpuMat m,
Allocator allocator = defaultAllocator() 
)
explicit

copy/conversion constructor. If m is of different type, it's converted

◆ GpuMat_() [8/13]

template<typename T>
__host__ cv::cudev::GpuMat_< T >::GpuMat_ ( int  arows,
int  acols,
T adata,
size_t  astep = Mat::AUTO_STEP 
)

constructs a matrix on top of user-allocated data. step is in bytes(!!!), regardless of the type

◆ GpuMat_() [9/13]

template<typename T>
__host__ cv::cudev::GpuMat_< T >::GpuMat_ ( Size  asize,
T adata,
size_t  astep = Mat::AUTO_STEP 
)

◆ GpuMat_() [10/13]

template<typename T>
__host__ cv::cudev::GpuMat_< T >::GpuMat_ ( const GpuMat_< T > &  m,
Range  arowRange,
Range  acolRange 
)

selects a submatrix

◆ GpuMat_() [11/13]

template<typename T>
__host__ cv::cudev::GpuMat_< T >::GpuMat_ ( const GpuMat_< T > &  m,
Rect  roi 
)

◆ GpuMat_() [12/13]

template<typename T>
__host__ cv::cudev::GpuMat_< T >::GpuMat_ ( InputArray  arr,
Allocator allocator = defaultAllocator() 
)
explicit

builds GpuMat from host memory (Blocking call)

◆ GpuMat_() [13/13]

template<typename T>
template<class Body >
__host__ cv::cudev::GpuMat_< T >::GpuMat_ ( const Expr< Body > &  expr)

expression templates

Member Function Documentation

◆ adjustROI()

template<typename T>
__host__ GpuMat_& cv::cudev::GpuMat_< T >::adjustROI ( int  dtop,
int  dbottom,
int  dleft,
int  dright 
)

◆ assign()

template<typename T>
template<class Body >
__host__ GpuMat_& cv::cudev::GpuMat_< T >::assign ( const Expr< Body > &  expr,
Stream stream 
)

◆ assignTo()

void cv::cuda::GpuMat::assignTo ( GpuMat m,
int  type = -1 
) const
inherited

◆ channels()

template<typename T>
__host__ int cv::cudev::GpuMat_< T >::channels ( ) const

◆ clone()

template<typename T>
__host__ GpuMat_ cv::cudev::GpuMat_< T >::clone ( ) const

overridden forms of GpuMat::row() etc.

◆ col()

template<typename T>
__host__ GpuMat_ cv::cudev::GpuMat_< T >::col ( int  x) const

Referenced by cv::cudev::gridFindMinMaxVal_().

Here is the caller graph for this function:

◆ colRange() [1/2]

template<typename T>
__host__ GpuMat_ cv::cudev::GpuMat_< T >::colRange ( int  startcol,
int  endcol 
) const

◆ colRange() [2/2]

template<typename T>
__host__ GpuMat_ cv::cudev::GpuMat_< T >::colRange ( Range  r) const

◆ convertTo() [1/5]

void cv::cuda::GpuMat::convertTo ( OutputArray  dst,
int  rtype 
) const
inherited

converts GpuMat to another datatype (Blocking call)

◆ convertTo() [2/5]

void cv::cuda::GpuMat::convertTo ( OutputArray  dst,
int  rtype,
Stream stream 
) const
inherited

converts GpuMat to another datatype (Non-Blocking call)

◆ convertTo() [3/5]

void cv::cuda::GpuMat::convertTo ( OutputArray  dst,
int  rtype,
double  alpha,
double  beta = 0.0 
) const
inherited

converts GpuMat to another datatype with scaling (Blocking call)

◆ convertTo() [4/5]

void cv::cuda::GpuMat::convertTo ( OutputArray  dst,
int  rtype,
double  alpha,
Stream stream 
) const
inherited

converts GpuMat to another datatype with scaling (Non-Blocking call)

◆ convertTo() [5/5]

void cv::cuda::GpuMat::convertTo ( OutputArray  dst,
int  rtype,
double  alpha,
double  beta,
Stream stream 
) const
inherited

converts GpuMat to another datatype with scaling (Non-Blocking call)

◆ copyTo() [1/4]

void cv::cuda::GpuMat::copyTo ( OutputArray  dst) const
inherited

copies the GpuMat content to device memory (Blocking call)

◆ copyTo() [2/4]

void cv::cuda::GpuMat::copyTo ( OutputArray  dst,
Stream stream 
) const
inherited

copies the GpuMat content to device memory (Non-Blocking call)

◆ copyTo() [3/4]

void cv::cuda::GpuMat::copyTo ( OutputArray  dst,
InputArray  mask 
) const
inherited

copies those GpuMat elements to "m" that are marked with non-zero mask elements (Blocking call)

◆ copyTo() [4/4]

void cv::cuda::GpuMat::copyTo ( OutputArray  dst,
InputArray  mask,
Stream stream 
) const
inherited

copies those GpuMat elements to "m" that are marked with non-zero mask elements (Non-Blocking call)

◆ create() [1/4]

◆ create() [2/4]

template<typename T>
__host__ void cv::cudev::GpuMat_< T >::create ( Size  asize)

◆ create() [3/4]

void cv::cuda::GpuMat::create ( int  rows,
int  cols,
int  type 
)
inherited

allocates new GpuMat data unless the GpuMat already has specified size and type

◆ create() [4/4]

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

◆ defaultAllocator()

static GpuMat::Allocator* cv::cuda::GpuMat::defaultAllocator ( )
staticinherited

default allocator

Referenced by cv::cuda::GpuMat::Allocator::~Allocator().

Here is the caller graph for this function:

◆ depth()

template<typename T>
__host__ int cv::cudev::GpuMat_< T >::depth ( ) const

◆ download() [1/2]

void cv::cuda::GpuMat::download ( OutputArray  dst) const
inherited

Performs data download from GpuMat (Blocking call)

This function copies data from device memory to host memory. As being a blocking call, it is guaranteed that the copy operation is finished when this function returns.

◆ download() [2/2]

void cv::cuda::GpuMat::download ( OutputArray  dst,
Stream stream 
) const
inherited

Performs data download from GpuMat (Non-Blocking call)

This function copies data from device memory to host memory. As being a non-blocking call, this function may return even if the copy operation is not finished.

The copy operation may be overlapped with operations in other non-default streams if stream is not the default stream and dst is HostMem allocated with HostMem::PAGE_LOCKED option.

◆ elemSize()

template<typename T>
__host__ size_t cv::cudev::GpuMat_< T >::elemSize ( ) const

overridden forms of GpuMat::elemSize() etc.

◆ elemSize1()

template<typename T>
__host__ size_t cv::cudev::GpuMat_< T >::elemSize1 ( ) const

◆ empty()

bool cv::cuda::GpuMat::empty ( ) const
inherited

returns true if GpuMat data is NULL

◆ isContinuous()

bool cv::cuda::GpuMat::isContinuous ( ) const
inherited

returns true iff the GpuMat data is continuous (i.e.

when there are no gaps between successive rows)

Referenced by cv::cudev::affineMap(), and cv::cudev::perspectiveMap().

Here is the caller graph for this function:

◆ locateROI()

void cv::cuda::GpuMat::locateROI ( Size wholeSize,
Point ofs 
) const
inherited

locates GpuMat header within a parent GpuMat

◆ operator GlobPtr< T >()

template<typename T>
__host__ cv::cudev::GpuMat_< T >::operator GlobPtr< T > ( ) const

◆ operator GlobPtrSz< T >()

template<typename T>
__host__ cv::cudev::GpuMat_< T >::operator GlobPtrSz< T > ( ) const

convert to GlobPtr

◆ operator PtrStep< _Tp >()

template<typename _Tp >
cv::cuda::GpuMat::operator PtrStep< _Tp > ( ) const
inherited

◆ operator PtrStepSz< _Tp >()

template<typename _Tp >
cv::cuda::GpuMat::operator PtrStepSz< _Tp > ( ) const
inherited

◆ operator()() [1/2]

template<typename T>
__host__ GpuMat_ cv::cudev::GpuMat_< T >::operator() ( Range  rowRange,
Range  colRange 
) const

◆ operator()() [2/2]

template<typename T>
__host__ GpuMat_ cv::cudev::GpuMat_< T >::operator() ( Rect  roi) const

◆ operator=() [1/2]

template<typename T>
__host__ GpuMat_& cv::cudev::GpuMat_< T >::operator= ( const GpuMat_< T > &  m)

assignment operators

◆ operator=() [2/2]

template<typename T>
template<class Body >
__host__ GpuMat_& cv::cudev::GpuMat_< T >::operator= ( const Expr< Body > &  expr)

◆ operator[]() [1/2]

template<typename T>
__host__ T* cv::cudev::GpuMat_< T >::operator[] ( int  y)

more convenient forms of row and element access operators

◆ operator[]() [2/2]

template<typename T>
__host__ const T* cv::cudev::GpuMat_< T >::operator[] ( int  y) const

◆ ptr() [1/4]

uchar* cv::cuda::GpuMat::ptr ( int  y = 0)
inherited

returns pointer to y-th row

◆ ptr() [2/4]

const uchar* cv::cuda::GpuMat::ptr ( int  y = 0) const
inherited

◆ ptr() [3/4]

template<typename _Tp >
_Tp* cv::cuda::GpuMat::ptr ( int  y = 0)
inherited

template version of the above method

◆ ptr() [4/4]

template<typename _Tp >
const _Tp* cv::cuda::GpuMat::ptr ( int  y = 0) const
inherited

◆ release()

void cv::cuda::GpuMat::release ( )
inherited

decreases reference counter, deallocate the data when reference counter reaches 0

◆ reshape()

GpuMat cv::cuda::GpuMat::reshape ( int  cn,
int  rows = 0 
) const
inherited

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

Referenced by cv::cudev::reshape_().

Here is the caller graph for this function:

◆ row()

template<typename T>
__host__ GpuMat_ cv::cudev::GpuMat_< T >::row ( int  y) const

◆ rowRange() [1/2]

template<typename T>
__host__ GpuMat_ cv::cudev::GpuMat_< T >::rowRange ( int  startrow,
int  endrow 
) const

◆ rowRange() [2/2]

template<typename T>
__host__ GpuMat_ cv::cudev::GpuMat_< T >::rowRange ( Range  r) const

◆ setDefaultAllocator()

static void cv::cuda::GpuMat::setDefaultAllocator ( GpuMat::Allocator allocator)
staticinherited

◆ setTo() [1/4]

GpuMat& cv::cuda::GpuMat::setTo ( Scalar  s)
inherited

sets some of the GpuMat elements to s (Blocking call)

Referenced by cv::cudev::gridCalcSum_(), cv::cudev::gridCountNonZero_(), cv::cudev::gridFindMaxVal_(), cv::cudev::gridFindMinMaxVal_(), cv::cudev::gridFindMinVal_(), and cv::cudev::gridHistogram_().

Here is the caller graph for this function:

◆ setTo() [2/4]

GpuMat& cv::cuda::GpuMat::setTo ( Scalar  s,
Stream stream 
)
inherited

sets some of the GpuMat elements to s (Non-Blocking call)

◆ setTo() [3/4]

GpuMat& cv::cuda::GpuMat::setTo ( Scalar  s,
InputArray  mask 
)
inherited

sets some of the GpuMat elements to s, according to the mask (Blocking call)

◆ setTo() [4/4]

GpuMat& cv::cuda::GpuMat::setTo ( Scalar  s,
InputArray  mask,
Stream stream 
)
inherited

sets some of the GpuMat elements to s, according to the mask (Non-Blocking call)

◆ size()

Size cv::cuda::GpuMat::size ( ) const
inherited

returns GpuMat size : width == number of columns, height == number of rows

◆ step1()

template<typename T>
__host__ size_t cv::cudev::GpuMat_< T >::step1 ( ) const

◆ stepT()

template<typename T>
__host__ size_t cv::cudev::GpuMat_< T >::stepT ( ) const

returns step()/sizeof(T)

◆ swap() [1/2]

template<typename T>
__host__ void cv::cudev::GpuMat_< T >::swap ( GpuMat_< T > &  mat)

swaps with other smart pointer

◆ swap() [2/2]

void cv::cuda::GpuMat::swap ( GpuMat mat)
inherited

swaps with other smart pointer

◆ type()

template<typename T>
__host__ int cv::cudev::GpuMat_< T >::type ( ) const

Referenced by cv::cudev::gridReduceToColumn_(), and cv::cudev::reshape_().

Here is the caller graph for this function:

◆ updateContinuityFlag()

void cv::cuda::GpuMat::updateContinuityFlag ( )
inherited

internal use method: updates the continuity flag

◆ upload() [1/2]

template<typename T>
__host__ void cv::cudev::GpuMat_< T >::upload ( InputArray  arr)

pefroms upload data to GpuMat (Blocking call)

◆ upload() [2/2]

template<typename T>
__host__ void cv::cudev::GpuMat_< T >::upload ( InputArray  arr,
Stream stream 
)

pefroms upload data to GpuMat (Non-Blocking call)

Member Data Documentation

◆ allocator

Allocator* cv::cuda::GpuMat::allocator
inherited

allocator

◆ cols

◆ data

uchar* cv::cuda::GpuMat::data
inherited

pointer to the data

Referenced by cv::cudev::globPtr().

◆ dataend

const uchar* cv::cuda::GpuMat::dataend
inherited

◆ datastart

uchar* cv::cuda::GpuMat::datastart
inherited

helper fields used in locateROI and adjustROI

◆ flags

int cv::cuda::GpuMat::flags
inherited

includes several bit-fields:

  • the magic signature
  • continuity flag
  • depth
  • number of channels

◆ refcount

int* cv::cuda::GpuMat::refcount
inherited

pointer to the reference counter; when GpuMat points to user-allocated data, the pointer is NULL

◆ rows

int cv::cuda::GpuMat::rows
inherited

◆ step

size_t cv::cuda::GpuMat::step
inherited

a distance between successive rows in bytes; includes the gap if any

Referenced by cv::cudev::globPtr().


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