Public Member Functions | Public Attributes | List of all members
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
 includes several bit-fields: More...
 
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 ( )

default constructor

cv::ocl::oclMat::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.)

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

constucts oclMatrix and fills it with the specified value _s.

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

copy constructor

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

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 
)
cv::ocl::oclMat::oclMat ( const oclMat m,
const Range rowRange,
const Range colRange 
)

creates a matrix header for a part of the bigger matrix

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

builds oclMat from Mat. Perfom blocking upload to device.

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

destructor - calls release()

Member Function Documentation

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

assignment operators

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

assignment operator. Perfom blocking upload to device.

oclMat & cv::ocl::oclMat::operator= ( const oclMatExpr expr)
void cv::ocl::oclMat::upload ( const cv::Mat m)

pefroms blocking upload data to oclMat.

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

downloads data from device to host memory. Blocking calls.

void cv::ocl::oclMat::download ( cv::Mat m) const
cv::ocl::oclMat::operator _InputArray ( )

convert to _InputArray

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

convert to _OutputArray

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

returns a new oclMatrix header for the specified row

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

returns a new oclMatrix header for the specified column

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

... for the specified row span

oclMat cv::ocl::oclMat::rowRange ( const Range r) const
oclMat cv::ocl::oclMat::colRange ( int  startcol,
int  endcol 
) const

... for the specified column span

oclMat cv::ocl::oclMat::colRange ( const Range r) const
oclMat cv::ocl::oclMat::clone ( ) const

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

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::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::assignTo ( oclMat m,
int  type = -1 
) const
oclMat& cv::ocl::oclMat::operator= ( const Scalar s)

sets every oclMatrix element to s

oclMat& cv::ocl::oclMat::setTo ( const Scalar s,
const oclMat mask = oclMat() 
)

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

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

creates alternative oclMatrix header for the same data, with different

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 
)
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 
)
void cv::ocl::oclMat::release ( )

decreases reference counter;

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

swaps with other smart pointer

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

locates oclMatrix header within a parent oclMatrix. See below

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

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

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

extracts a rectangular sub-oclMatrix

oclMat cv::ocl::oclMat::operator() ( const Rect roi) const
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)
bool cv::ocl::oclMat::isContinuous ( ) const

returns true if the oclMatrix data is continuous

size_t cv::ocl::oclMat::elemSize ( ) const

returns element size in bytes,

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

returns the size of element channel in bytes.

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

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

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

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

int cv::ocl::oclMat::depth ( ) const

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

int cv::ocl::oclMat::channels ( ) const

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

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

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

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

returns step/elemSize1()

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

returns oclMatrix size:

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

returns true if oclMatrix data is NULL

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

matrix transposition

Member Data Documentation

int cv::ocl::oclMat::flags

includes several bit-fields:

  • the magic signature
  • continuity flag
  • depth
  • number of channels
int cv::ocl::oclMat::rows

the number of rows and columns

int cv::ocl::oclMat::cols
size_t cv::ocl::oclMat::step

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

uchar* cv::ocl::oclMat::data

pointer to the data(OCL memory object)

int* cv::ocl::oclMat::refcount

pointer to the reference counter;

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

helper fields used in locateROI and adjustROI

uchar* cv::ocl::oclMat::dataend
Context* cv::ocl::oclMat::clCxt

OpenCL context associated with the oclMat object.

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

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