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

Enumerator
READ_ONLY 
WRITE_ONLY 
READ_WRITE 
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

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

create empty buffer

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

create buffer from existed buffer id

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

create buffer

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

copy from host/device memory

Member Function Documentation

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

bind buffer for specified target

unsigned int cv::ogl::Buffer::bufId ( ) const
int cv::ogl::Buffer::channels ( ) const
inline
Buffer cv::ogl::Buffer::clone ( Target  target = ARRAY_BUFFER,
bool  autoRelease = false 
) const

create copy of current buffer

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

copy from host/device memory

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

copy to host/device memory

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

create buffer

void cv::ogl::Buffer::create ( Size  asize,
int  atype,
Target  target = ARRAY_BUFFER,
bool  autoRelease = false 
)
inline
int cv::ogl::Buffer::depth ( ) const
inline
int cv::ogl::Buffer::elemSize ( ) const
inline
int cv::ogl::Buffer::elemSize1 ( ) const
inline
bool cv::ogl::Buffer::empty ( ) const
inline
gpu::GpuMat cv::ogl::Buffer::mapDevice ( )

map to device memory

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

map to host memory

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

release memory and delete buffer object

int cv::ogl::Buffer::rows ( ) const
inline
void cv::ogl::Buffer::setAutoRelease ( bool  flag)

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

Size cv::ogl::Buffer::size ( ) const
inline
int cv::ogl::Buffer::type ( ) const
inline
static void cv::ogl::Buffer::unbind ( Target  target)
static

unbind any buffers from specified target

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

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