OpenCV  2.4.13
Open Source Computer Vision
cv::ocl::oclMat Class Reference

#include <ocl.hpp>

Public Member Functions

 oclMat ()
 default constructor More...
 
 oclMat (int rows, int cols, int type)
 constructs oclMatrix of the specified size and type (_type is CV_8UC1, CV_64FC3, CV_32SC(12) etc.) More...
 
 oclMat (Size size, int type)
 
 oclMat (int rows, int cols, int type, const Scalar &s)
 constucts oclMatrix and fills it with the specified value _s. More...
 
 oclMat (Size size, int type, const Scalar &s)
 
 oclMat (const oclMat &m)
 copy constructor More...
 
 oclMat (int rows, int cols, int type, void *data, size_t step=Mat::AUTO_STEP)
 constructor for oclMatrix headers pointing to user-allocated data More...
 
 oclMat (Size size, int type, void *data, size_t step=Mat::AUTO_STEP)
 
 oclMat (const oclMat &m, const Range &rowRange, const Range &colRange)
 creates a matrix header for a part of the bigger matrix More...
 
 oclMat (const oclMat &m, const Rect &roi)
 
 oclMat (const Mat &m)
 builds oclMat from Mat. Perfom blocking upload to device. More...
 
 ~oclMat ()
 destructor - calls release() More...
 
oclMatoperator= (const oclMat &m)
 assignment operators More...
 
oclMatoperator= (const Mat &m)
 assignment operator. Perfom blocking upload to device. More...
 
oclMatoperator= (const oclMatExpr &expr)
 
void upload (const cv::Mat &m)
 pefroms blocking upload data to oclMat. More...
 
 operator Mat () const
 downloads data from device to host memory. Blocking calls. More...
 
void download (cv::Mat &m) const
 
 operator _InputArray ()
 convert to _InputArray More...
 
 operator _OutputArray ()
 convert to _OutputArray More...
 
oclMat row (int y) const
 returns a new oclMatrix header for the specified row More...
 
oclMat col (int x) const
 returns a new oclMatrix header for the specified column More...
 
oclMat rowRange (int startrow, int endrow) const
 ... for the specified row span More...
 
oclMat rowRange (const Range &r) const
 
oclMat colRange (int startcol, int endcol) const
 ... for the specified column span More...
 
oclMat colRange (const Range &r) const
 
oclMat clone () const
 returns deep copy of the oclMatrix, i.e. the data is copied More...
 
void copyTo (oclMat &m, const oclMat &mask=oclMat()) const
 copies those oclMatrix elements to "m" that are marked with non-zero mask elements. More...
 
void convertTo (oclMat &m, int rtype, double alpha=1, double beta=0) const
 converts oclMatrix to another datatype with optional scalng. See cvConvertScale. More...
 
void assignTo (oclMat &m, int type=-1) const
 
oclMatoperator= (const Scalar &s)
 sets every oclMatrix element to s More...
 
oclMatsetTo (const Scalar &s, const oclMat &mask=oclMat())
 sets some of the oclMatrix elements to s, according to the mask More...
 
oclMat reshape (int cn, int rows=0) const
 creates alternative oclMatrix header for the same data, with different More...
 
void create (int rows, int cols, int type)
 allocates new oclMatrix data unless the oclMatrix already has specified size and type. More...
 
void create (Size size, int type)
 
void createEx (int rows, int cols, int type, DevMemRW rw_type, DevMemType mem_type)
 allocates new oclMatrix with specified device memory type. More...
 
void createEx (Size size, int type, DevMemRW rw_type, DevMemType mem_type)
 
void release ()
 decreases reference counter; More...
 
void swap (oclMat &mat)
 swaps with other smart pointer More...
 
void locateROI (Size &wholeSize, Point &ofs) const
 locates oclMatrix header within a parent oclMatrix. See below More...
 
oclMatadjustROI (int dtop, int dbottom, int dleft, int dright)
 moves/resizes the current oclMatrix ROI inside the parent oclMatrix. More...
 
oclMat operator() (Range rowRange, Range colRange) const
 extracts a rectangular sub-oclMatrix More...
 
oclMat operator() (const Rect &roi) const
 
oclMatoperator+= (const oclMat &m)
 
oclMatoperator-= (const oclMat &m)
 
oclMatoperator*= (const oclMat &m)
 
oclMatoperator/= (const oclMat &m)
 
bool isContinuous () const
 returns true if the oclMatrix data is continuous More...
 
size_t elemSize () const
 returns element size in bytes, More...
 
size_t elemSize1 () const
 returns the size of element channel in bytes. More...
 
int type () const
 returns element type, similar to CV_MAT_TYPE(cvMat->type) More...
 
int ocltype () const
 
int depth () const
 returns element type, similar to CV_MAT_DEPTH(cvMat->type) More...
 
int channels () const
 returns element type, similar to CV_MAT_CN(cvMat->type) More...
 
int oclchannels () const
 
size_t step1 () const
 returns step/elemSize1() More...
 
Size size () const
 returns oclMatrix size: More...
 
bool empty () const
 returns true if oclMatrix data is NULL More...
 
oclMat t () const
 matrix transposition More...
 

Public Attributes

int flags
 
int rows
 the number of rows and columns More...
 
int cols
 
size_t step
 a distance between successive rows in bytes; includes the gap if any More...
 
uchardata
 pointer to the data(OCL memory object) More...
 
intrefcount
 pointer to the reference counter; More...
 
uchardatastart
 helper fields used in locateROI and adjustROI More...
 
uchardataend
 
ContextclCxt
 OpenCL context associated with the oclMat object. More...
 
int offset
 
int wholerows
 
int wholecols
 

Constructor & Destructor Documentation

cv::ocl::oclMat::oclMat ( )
inline

default constructor

cv::ocl::oclMat::oclMat ( int  rows,
int  cols,
int  type 
)
inline

constructs oclMatrix of the specified size and type (_type is CV_8UC1, CV_64FC3, CV_32SC(12) etc.)

cv::ocl::oclMat::oclMat ( Size  size,
int  type 
)
inline
cv::ocl::oclMat::oclMat ( int  rows,
int  cols,
int  type,
const Scalar s 
)
inline

constucts oclMatrix and fills it with the specified value _s.

cv::ocl::oclMat::oclMat ( Size  size,
int  type,
const Scalar s 
)
inline
cv::ocl::oclMat::oclMat ( const oclMat m)
inline

copy constructor

cv::ocl::oclMat::oclMat ( int  rows,
int  cols,
int  type,
void data,
size_t  step = Mat::AUTO_STEP 
)
inline

constructor for oclMatrix headers pointing to user-allocated data

cv::ocl::oclMat::oclMat ( Size  size,
int  type,
void data,
size_t  step = Mat::AUTO_STEP 
)
inline
cv::ocl::oclMat::oclMat ( const oclMat m,
const Range rowRange,
const Range colRange 
)
inline

creates a matrix header for a part of the bigger matrix

cv::ocl::oclMat::oclMat ( const oclMat m,
const Rect roi 
)
inline
cv::ocl::oclMat::oclMat ( const Mat m)
inlineexplicit

builds oclMat from Mat. Perfom blocking upload to device.

cv::ocl::oclMat::~oclMat ( )
inline

destructor - calls release()

Member Function Documentation

oclMat & cv::ocl::oclMat::adjustROI ( int  dtop,
int  dbottom,
int  dleft,
int  dright 
)
inline

moves/resizes the current oclMatrix ROI inside the parent oclMatrix.

void cv::ocl::oclMat::assignTo ( oclMat m,
int  type = -1 
) const
inline
int cv::ocl::oclMat::channels ( ) const
inline

returns element type, similar to CV_MAT_CN(cvMat->type)

oclMat cv::ocl::oclMat::clone ( ) const
inline

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

oclMat cv::ocl::oclMat::col ( int  x) const
inline

returns a new oclMatrix header for the specified column

oclMat cv::ocl::oclMat::colRange ( int  startcol,
int  endcol 
) const
inline

... for the specified column span

oclMat cv::ocl::oclMat::colRange ( const Range r) const
inline
void cv::ocl::oclMat::convertTo ( oclMat m,
int  rtype,
double  alpha = 1,
double  beta = 0 
) const

converts oclMatrix to another datatype with optional scalng. See cvConvertScale.

void cv::ocl::oclMat::copyTo ( oclMat m,
const oclMat mask = oclMat() 
) const

copies those oclMatrix elements to "m" that are marked with non-zero mask elements.

void cv::ocl::oclMat::create ( int  rows,
int  cols,
int  type 
)

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

void cv::ocl::oclMat::create ( Size  size,
int  type 
)
inline
void cv::ocl::oclMat::createEx ( int  rows,
int  cols,
int  type,
DevMemRW  rw_type,
DevMemType  mem_type 
)

allocates new oclMatrix with specified device memory type.

void cv::ocl::oclMat::createEx ( Size  size,
int  type,
DevMemRW  rw_type,
DevMemType  mem_type 
)
int cv::ocl::oclMat::depth ( ) const
inline

returns element type, similar to CV_MAT_DEPTH(cvMat->type)

void cv::ocl::oclMat::download ( cv::Mat m) const
size_t cv::ocl::oclMat::elemSize ( ) const
inline

returns element size in bytes,

size_t cv::ocl::oclMat::elemSize1 ( ) const
inline

returns the size of element channel in bytes.

bool cv::ocl::oclMat::empty ( ) const
inline

returns true if oclMatrix data is NULL

bool cv::ocl::oclMat::isContinuous ( ) const
inline

returns true if the oclMatrix data is continuous

void cv::ocl::oclMat::locateROI ( Size wholeSize,
Point ofs 
) const
inline

locates oclMatrix header within a parent oclMatrix. See below

int cv::ocl::oclMat::oclchannels ( ) const
inline

returns element type, return 4 for 3 channels element, becuase 3 channels element actually use 4 channel space

int cv::ocl::oclMat::ocltype ( ) const
inline

returns element type, i.e. 8UC3 returns 8UC4 because in ocl 3 channels element actually use 4 channel space

cv::ocl::oclMat::operator _InputArray ( )

convert to _InputArray

cv::ocl::oclMat::operator _OutputArray ( )

convert to _OutputArray

cv::ocl::oclMat::operator Mat ( ) const
inline

downloads data from device to host memory. Blocking calls.

oclMat cv::ocl::oclMat::operator() ( Range  rowRange,
Range  colRange 
) const
inline

extracts a rectangular sub-oclMatrix

oclMat cv::ocl::oclMat::operator() ( const Rect roi) const
inline
oclMat& cv::ocl::oclMat::operator*= ( const oclMat m)
oclMat& cv::ocl::oclMat::operator+= ( const oclMat m)
oclMat& cv::ocl::oclMat::operator-= ( const oclMat m)
oclMat& cv::ocl::oclMat::operator/= ( const oclMat m)
oclMat & cv::ocl::oclMat::operator= ( const oclMat m)
inline

assignment operators

oclMat & cv::ocl::oclMat::operator= ( const Mat m)
inline

assignment operator. Perfom blocking upload to device.

oclMat & cv::ocl::oclMat::operator= ( const oclMatExpr expr)
inline
oclMat& cv::ocl::oclMat::operator= ( const Scalar s)

sets every oclMatrix element to s

void cv::ocl::oclMat::release ( )

decreases reference counter;

oclMat cv::ocl::oclMat::reshape ( int  cn,
int  rows = 0 
) const

creates alternative oclMatrix header for the same data, with different

oclMat cv::ocl::oclMat::row ( int  y) const
inline

returns a new oclMatrix header for the specified row

oclMat cv::ocl::oclMat::rowRange ( int  startrow,
int  endrow 
) const
inline

... for the specified row span

oclMat cv::ocl::oclMat::rowRange ( const Range r) const
inline
oclMat& cv::ocl::oclMat::setTo ( const Scalar s,
const oclMat mask = oclMat() 
)

sets some of the oclMatrix elements to s, according to the mask

Size cv::ocl::oclMat::size ( ) const
inline

returns oclMatrix size:

size_t cv::ocl::oclMat::step1 ( ) const
inline

returns step/elemSize1()

void cv::ocl::oclMat::swap ( oclMat mat)
inline

swaps with other smart pointer

oclMat cv::ocl::oclMat::t ( ) const
inline

matrix transposition

int cv::ocl::oclMat::type ( ) const
inline

returns element type, similar to CV_MAT_TYPE(cvMat->type)

void cv::ocl::oclMat::upload ( const cv::Mat m)

pefroms blocking upload data to oclMat.

Member Data Documentation

Context* cv::ocl::oclMat::clCxt

OpenCL context associated with the oclMat object.

int cv::ocl::oclMat::cols
uchar* cv::ocl::oclMat::data

pointer to the data(OCL memory object)

uchar* cv::ocl::oclMat::dataend
uchar* cv::ocl::oclMat::datastart

helper fields used in locateROI and adjustROI

int cv::ocl::oclMat::flags

includes several bit-fields:

  • the magic signature
  • continuity flag
  • depth
  • number of channels
int cv::ocl::oclMat::offset
int* cv::ocl::oclMat::refcount

pointer to the reference counter;

int cv::ocl::oclMat::rows

the number of rows and columns

size_t cv::ocl::oclMat::step

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

int cv::ocl::oclMat::wholecols
int cv::ocl::oclMat::wholerows

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