OpenCV  2.4.13.3
Open Source Computer Vision
cv::ogl::Buffer Class Reference

Smart pointer for OpenGL buffer memory with reference counting. More...

#include <opengl_interop.hpp>

Public Types

enum  Target { ARRAY_BUFFER = 0x8892, ELEMENT_ARRAY_BUFFER = 0x8893, PIXEL_PACK_BUFFER = 0x88EB, PIXEL_UNPACK_BUFFER = 0x88EC }
 
enum  Access { READ_ONLY = 0x88B8, WRITE_ONLY = 0x88B9, READ_WRITE = 0x88BA }
 

Public Member Functions

 Buffer ()
 create empty buffer More...
 
 Buffer (int arows, int acols, int atype, unsigned int abufId, bool autoRelease=false)
 create buffer from existed buffer id More...
 
 Buffer (Size asize, int atype, unsigned int abufId, bool autoRelease=false)
 
 Buffer (int arows, int acols, int atype, Target target=ARRAY_BUFFER, bool autoRelease=false)
 create buffer More...
 
 Buffer (Size asize, int atype, Target target=ARRAY_BUFFER, bool autoRelease=false)
 
 Buffer (InputArray arr, Target target=ARRAY_BUFFER, bool autoRelease=false)
 copy from host/device memory More...
 
void create (int arows, int acols, int atype, Target target=ARRAY_BUFFER, bool autoRelease=false)
 create buffer More...
 
void create (Size asize, int atype, Target target=ARRAY_BUFFER, bool autoRelease=false)
 
void release ()
 release memory and delete buffer object More...
 
void setAutoRelease (bool flag)
 set auto release mode (if true, release will be called in object's destructor) More...
 
void copyFrom (InputArray arr, Target target=ARRAY_BUFFER, bool autoRelease=false)
 copy from host/device memory More...
 
void copyTo (OutputArray arr, Target target=ARRAY_BUFFER, bool autoRelease=false) const
 copy to host/device memory More...
 
Buffer clone (Target target=ARRAY_BUFFER, bool autoRelease=false) const
 create copy of current buffer More...
 
void bind (Target target) const
 bind buffer for specified target More...
 
Mat mapHost (Access access)
 map to host memory More...
 
void unmapHost ()
 
gpu::GpuMat mapDevice ()
 map to device memory More...
 
void unmapDevice ()
 
int rows () const
 
int cols () const
 
Size size () const
 
bool empty () const
 
int type () const
 
int depth () const
 
int channels () const
 
int elemSize () const
 
int elemSize1 () const
 
unsigned int bufId () const
 

Static Public Member Functions

static void unbind (Target target)
 unbind any buffers from specified target More...
 

Detailed Description

Smart pointer for OpenGL buffer memory with reference counting.

Member Enumeration Documentation

§ Access

Enumerator
READ_ONLY 
WRITE_ONLY 
READ_WRITE 

§ Target

Enumerator
ARRAY_BUFFER 

The buffer will be used as a source for vertex data.

ELEMENT_ARRAY_BUFFER 

The buffer will be used for indices (in glDrawElements, for example)

PIXEL_PACK_BUFFER 

The buffer will be used for reading from OpenGL textures.

PIXEL_UNPACK_BUFFER 

The buffer will be used for writing to OpenGL textures.

Constructor & Destructor Documentation

§ Buffer() [1/6]

cv::ogl::Buffer::Buffer ( )

create empty buffer

§ Buffer() [2/6]

cv::ogl::Buffer::Buffer ( int  arows,
int  acols,
int  atype,
unsigned int  abufId,
bool  autoRelease = false 
)

create buffer from existed buffer id

§ Buffer() [3/6]

cv::ogl::Buffer::Buffer ( Size  asize,
int  atype,
unsigned int  abufId,
bool  autoRelease = false 
)

§ Buffer() [4/6]

cv::ogl::Buffer::Buffer ( int  arows,
int  acols,
int  atype,
Target  target = ARRAY_BUFFER,
bool  autoRelease = false 
)

create buffer

§ Buffer() [5/6]

cv::ogl::Buffer::Buffer ( Size  asize,
int  atype,
Target  target = ARRAY_BUFFER,
bool  autoRelease = false 
)

§ Buffer() [6/6]

cv::ogl::Buffer::Buffer ( InputArray  arr,
Target  target = ARRAY_BUFFER,
bool  autoRelease = false 
)
explicit

copy from host/device memory

Member Function Documentation

§ bind()

void cv::ogl::Buffer::bind ( Target  target) const

bind buffer for specified target

§ bufId()

unsigned int cv::ogl::Buffer::bufId ( ) const

§ channels()

int cv::ogl::Buffer::channels ( ) const
inline

§ clone()

Buffer cv::ogl::Buffer::clone ( Target  target = ARRAY_BUFFER,
bool  autoRelease = false 
) const

create copy of current buffer

§ cols()

int cv::ogl::Buffer::cols ( ) const
inline

§ copyFrom()

void cv::ogl::Buffer::copyFrom ( InputArray  arr,
Target  target = ARRAY_BUFFER,
bool  autoRelease = false 
)

copy from host/device memory

§ copyTo()

void cv::ogl::Buffer::copyTo ( OutputArray  arr,
Target  target = ARRAY_BUFFER,
bool  autoRelease = false 
) const

copy to host/device memory

§ create() [1/2]

void cv::ogl::Buffer::create ( int  arows,
int  acols,
int  atype,
Target  target = ARRAY_BUFFER,
bool  autoRelease = false 
)

create buffer

§ create() [2/2]

void cv::ogl::Buffer::create ( Size  asize,
int  atype,
Target  target = ARRAY_BUFFER,
bool  autoRelease = false 
)
inline

§ depth()

int cv::ogl::Buffer::depth ( ) const
inline

§ elemSize()

int cv::ogl::Buffer::elemSize ( ) const
inline

§ elemSize1()

int cv::ogl::Buffer::elemSize1 ( ) const
inline

§ empty()

bool cv::ogl::Buffer::empty ( ) const
inline

§ mapDevice()

gpu::GpuMat cv::ogl::Buffer::mapDevice ( )

map to device memory

§ mapHost()

Mat cv::ogl::Buffer::mapHost ( Access  access)

map to host memory

§ release()

void cv::ogl::Buffer::release ( )

release memory and delete buffer object

§ rows()

int cv::ogl::Buffer::rows ( ) const
inline

§ setAutoRelease()

void cv::ogl::Buffer::setAutoRelease ( bool  flag)

set auto release mode (if true, release will be called in object's destructor)

§ size()

Size cv::ogl::Buffer::size ( ) const
inline

§ type()

int cv::ogl::Buffer::type ( ) const
inline

§ unbind()

static void cv::ogl::Buffer::unbind ( Target  target)
static

unbind any buffers from specified target

§ unmapDevice()

void cv::ogl::Buffer::unmapDevice ( )

§ unmapHost()

void cv::ogl::Buffer::unmapHost ( )

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