OpenCV  2.4.13.6
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

§ oclMat() [1/11]

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

default constructor

§ oclMat() [2/11]

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.)

§ oclMat() [3/11]

cv::ocl::oclMat::oclMat ( Size  size,
int  type 
)
inline

§ oclMat() [4/11]

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

constucts oclMatrix and fills it with the specified value _s.

§ oclMat() [5/11]

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

§ oclMat() [6/11]

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

copy constructor

§ oclMat() [7/11]

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

§ oclMat() [8/11]

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

§ oclMat() [9/11]

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

§ oclMat() [10/11]

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

§ oclMat() [11/11]

cv::ocl::oclMat::oclMat ( const Mat m)
inlineexplicit

builds oclMat from Mat. Perfom blocking upload to device.

§ ~oclMat()

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

destructor - calls release()

Member Function Documentation

§ adjustROI()

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

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

§ assignTo()

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

§ channels()

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

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

§ clone()

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

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

§ col()

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

returns a new oclMatrix header for the specified column

§ colRange() [1/2]

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

... for the specified column span

§ colRange() [2/2]

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

§ convertTo()

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.

§ copyTo()

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.

§ create() [1/2]

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

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

§ create() [2/2]

void cv::ocl::oclMat::create ( Size  size,
int  type 
)
inline

§ createEx() [1/2]

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.

§ createEx() [2/2]

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

§ depth()

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

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

§ download()

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

§ elemSize()

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

returns element size in bytes,

§ elemSize1()

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

returns the size of element channel in bytes.

§ empty()

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

returns true if oclMatrix data is NULL

§ isContinuous()

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

returns true if the oclMatrix data is continuous

§ locateROI()

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

locates oclMatrix header within a parent oclMatrix. See below

§ oclchannels()

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

§ ocltype()

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

§ operator _InputArray()

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

convert to _InputArray

§ operator _OutputArray()

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

convert to _OutputArray

§ operator Mat()

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

downloads data from device to host memory. Blocking calls.

§ operator()() [1/2]

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

extracts a rectangular sub-oclMatrix

§ operator()() [2/2]

oclMat cv::ocl::oclMat::operator() ( const Rect roi) const
inline

§ operator*=()

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

§ operator+=()

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

§ operator-=()

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

§ operator/=()

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

§ operator=() [1/4]

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

assignment operators

§ operator=() [2/4]

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

assignment operator. Perfom blocking upload to device.

§ operator=() [3/4]

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

§ operator=() [4/4]

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

sets every oclMatrix element to s

§ release()

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

decreases reference counter;

§ reshape()

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

creates alternative oclMatrix header for the same data, with different

§ row()

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

returns a new oclMatrix header for the specified row

§ rowRange() [1/2]

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

... for the specified row span

§ rowRange() [2/2]

oclMat cv::ocl::oclMat::rowRange ( const Range r) const
inline

§ setTo()

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()

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

returns oclMatrix size:

§ step1()

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

returns step/elemSize1()

§ swap()

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

swaps with other smart pointer

§ t()

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

matrix transposition

§ type()

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

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

§ upload()

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

pefroms blocking upload data to oclMat.

Member Data Documentation

§ clCxt

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

OpenCL context associated with the oclMat object.

§ cols

int cv::ocl::oclMat::cols

§ data

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

pointer to the data(OCL memory object)

§ dataend

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

§ datastart

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

helper fields used in locateROI and adjustROI

§ flags

int cv::ocl::oclMat::flags

includes several bit-fields:

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

§ offset

int cv::ocl::oclMat::offset

§ refcount

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

pointer to the reference counter;

§ rows

int cv::ocl::oclMat::rows

the number of rows and columns

§ step

size_t cv::ocl::oclMat::step

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

§ wholecols

int cv::ocl::oclMat::wholecols

§ wholerows

int cv::ocl::oclMat::wholerows

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