OpenCV
3.1.0
Open Source Computer Vision
|
Smart pointer for OpenGL buffer object with reference counting. More...
#include "opengl.hpp"
Public Types | |
enum | Access { READ_ONLY = 0x88B8, WRITE_ONLY = 0x88B9, READ_WRITE = 0x88BA } |
enum | Target { ARRAY_BUFFER = 0x8892, ELEMENT_ARRAY_BUFFER = 0x8893, PIXEL_PACK_BUFFER = 0x88EB, PIXEL_UNPACK_BUFFER = 0x88EC } |
The target defines how you intend to use the buffer object. More... | |
Public Member Functions | |
Buffer () | |
The constructors. More... | |
Buffer (int arows, int acols, int atype, unsigned int abufId, bool autoRelease=false) | |
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) | |
Buffer (Size asize, int atype, Target target=ARRAY_BUFFER, bool autoRelease=false) | |
Buffer (InputArray arr, Target target=ARRAY_BUFFER, bool autoRelease=false) | |
void | bind (Target target) const |
Binds OpenGL buffer to the specified buffer binding point. More... | |
unsigned int | bufId () const |
get OpenGL opject id More... | |
int | channels () const |
Buffer | clone (Target target=ARRAY_BUFFER, bool autoRelease=false) const |
Creates a full copy of the buffer object and the underlying data. More... | |
int | cols () const |
void | copyFrom (InputArray arr, Target target=ARRAY_BUFFER, bool autoRelease=false) |
Copies from host/device memory to OpenGL buffer. More... | |
void | copyFrom (InputArray arr, cuda::Stream &stream, Target target=ARRAY_BUFFER, bool autoRelease=false) |
void | copyTo (OutputArray arr) const |
Copies from OpenGL buffer to host/device memory or another OpenGL buffer object. More... | |
void | copyTo (OutputArray arr, cuda::Stream &stream) const |
void | create (int arows, int acols, int atype, Target target=ARRAY_BUFFER, bool autoRelease=false) |
Allocates memory for ogl::Buffer object. More... | |
void | create (Size asize, int atype, Target target=ARRAY_BUFFER, bool autoRelease=false) |
int | depth () const |
int | elemSize () const |
int | elemSize1 () const |
bool | empty () const |
cuda::GpuMat | mapDevice () |
map to device memory (blocking) More... | |
cuda::GpuMat | mapDevice (cuda::Stream &stream) |
Maps OpenGL buffer to CUDA device memory. More... | |
Mat | mapHost (Access access) |
Maps OpenGL buffer to host memory. More... | |
void | release () |
Decrements the reference counter and destroys the buffer object if needed. More... | |
int | rows () const |
void | setAutoRelease (bool flag) |
Sets auto release mode. More... | |
Size | size () const |
int | type () const |
void | unmapDevice () |
void | unmapDevice (cuda::Stream &stream) |
Unmaps OpenGL buffer. More... | |
void | unmapHost () |
Unmaps OpenGL buffer. More... | |
Static Public Member Functions | |
static void | unbind (Target target) |
Unbind any buffers from the specified binding point. More... | |
Smart pointer for OpenGL buffer object with reference counting.
Buffer Objects are OpenGL objects that store an array of unformatted memory allocated by the OpenGL context. These can be used to store vertex data, pixel data retrieved from images or the framebuffer, and a variety of other things.
ogl::Buffer has interface similar with Mat interface and represents 2D array memory.
ogl::Buffer supports memory transfers between host and device and also can be mapped to CUDA memory.