43 #ifndef __OPENCV_OPENGL_INTEROP_HPP__
44 #define __OPENCV_OPENGL_INTEROP_HPP__
51 namespace cv {
namespace ogl {
61 ARRAY_BUFFER = 0x8892,
62 ELEMENT_ARRAY_BUFFER = 0x8893,
63 PIXEL_PACK_BUFFER = 0x88EB,
64 PIXEL_UNPACK_BUFFER = 0x88EC
78 Buffer(
int arows,
int acols,
int atype,
unsigned int abufId,
bool autoRelease =
false);
79 Buffer(
Size asize,
int atype,
unsigned int abufId,
bool autoRelease =
false);
82 Buffer(
int arows,
int acols,
int atype, Target
target = ARRAY_BUFFER,
bool autoRelease =
false);
83 Buffer(
Size asize,
int atype, Target
target = ARRAY_BUFFER,
bool autoRelease =
false);
89 void create(
int arows,
int acols,
int atype, Target
target = ARRAY_BUFFER,
bool autoRelease =
false);
96 void setAutoRelease(
bool flag);
105 Buffer clone(Target
target = ARRAY_BUFFER,
bool autoRelease =
false)
const;
108 void bind(Target
target)
const;
111 static void unbind(Target
target);
121 int rows()
const {
return rows_; }
122 int cols()
const {
return cols_; }
124 bool empty()
const {
return rows_ == 0 || cols_ == 0; }
126 int type()
const {
return type_; }
127 int depth()
const {
return CV_MAT_DEPTH(type_); }
129 int elemSize()
const {
return CV_ELEM_SIZE(type_); }
132 unsigned int bufId()
const;
150 DEPTH_COMPONENT = 0x1902,
159 Texture2D(
int arows,
int acols, Format aformat,
unsigned int atexId,
bool autoRelease =
false);
160 Texture2D(
Size asize, Format aformat,
unsigned int atexId,
bool autoRelease =
false);
163 Texture2D(
int arows,
int acols, Format aformat,
bool autoRelease =
false);
164 Texture2D(
Size asize, Format aformat,
bool autoRelease =
false);
170 void create(
int arows,
int acols, Format aformat,
bool autoRelease =
false);
177 void setAutoRelease(
bool flag);
183 void copyTo(
OutputArray arr,
int ddepth = CV_32F,
bool autoRelease =
false)
const;
188 int rows()
const {
return rows_; }
189 int cols()
const {
return cols_; }
191 bool empty()
const {
return rows_ == 0 || cols_ == 0; }
195 unsigned int texId()
const;
213 void resetVertexArray();
216 void resetColorArray();
219 void resetNormalArray();
222 void resetTexCoordArray();
226 void setAutoRelease(
bool flag);
230 int size()
const {
return size_; }
231 bool empty()
const {
return size_ == 0; }
244 CV_EXPORTS
void render(
const Texture2D& tex,
268 namespace cv {
namespace gpu {
282 #endif // __cplusplus
284 #endif // __OPENCV_OPENGL_INTEROP_HPP__
Definition: opengl_interop.hpp:253
Access
Definition: opengl_interop.hpp:67
int size() const
Definition: opengl_interop.hpp:230
Target
Definition: opengl_interop.hpp:59
void delete_obj()
deletes the object. Override if needed
Definition: operations.hpp:2612
Size2i Size
Definition: core.hpp:896
Definition: opengl_interop.hpp:251
Smart pointer for OpenGL 2D texture memory with reference counting.
Definition: opengl_interop.hpp:144
bool empty() const
Definition: opengl_interop.hpp:191
OpenGL Arrays.
Definition: opengl_interop.hpp:207
Definition: opengl_interop.hpp:250
int elemSize() const
Definition: opengl_interop.hpp:129
int elemSize1() const
Definition: opengl_interop.hpp:130
Definition: opengl_interop.hpp:258
void normal(float x, float y, float z)
CV_EXPORTS void render(const Texture2D &tex, Rect_< double > wndRect=Rect_< double >(0.0, 0.0, 1.0, 1.0), Rect_< double > texRect=Rect_< double >(0.0, 0.0, 1.0, 1.0))
render texture rectangle in window
const CvPoint2D32f vertex[4]
Definition: legacy.hpp:1070
The 2D size class.
Definition: core.hpp:81
bool empty() const
Definition: opengl_interop.hpp:124
int cols() const
Definition: opengl_interop.hpp:122
int depth() const
Definition: opengl_interop.hpp:127
bool empty() const
Definition: opengl_interop.hpp:231
Definition: opengl_interop.hpp:254
GLuint GLuint GLsizei GLenum const GLvoid * indices
Definition: legacy.hpp:3084
int channels() const
Definition: opengl_interop.hpp:128
Definition: opengl_interop.hpp:257
Definition: opengl_interop.hpp:252
GLintptr GLsizeiptr GLbitfield access
Smart pointer for OpenGL buffer memory with reference counting.
Definition: opengl_interop.hpp:56
Smart pointer for GPU memory with reference counting. Its interface is mostly similar with cv::Mat...
Definition: gpumat.hpp:154
int rows() const
Definition: opengl_interop.hpp:121
void create(Size asize, int atype, Target target=ARRAY_BUFFER, bool autoRelease=false)
Definition: opengl_interop.hpp:90
Definition: opengl_interop.hpp:256
int CvSeq float CvSize2D32f int flag
Definition: legacy.hpp:237
int rows() const
Definition: opengl_interop.hpp:188
Definition: opengl_interop.hpp:255
The n-dimensional matrix class.
Definition: core.hpp:1688
Format format() const
Definition: opengl_interop.hpp:193
static Scalar_< double > all(doublev0)
returns a scalar with all elements set to v0
int type() const
Definition: opengl_interop.hpp:126
_Tp width
Definition: core.hpp:840
The 2D up-right rectangle class.
Definition: core.hpp:83
CvArr * arr
Definition: core_c.h:649
void create(Size asize, Format aformat, bool autoRelease=false)
Definition: opengl_interop.hpp:171
Size size() const
Definition: opengl_interop.hpp:190
Format
Definition: opengl_interop.hpp:147
Definition: opengl_interop.hpp:259
int cols() const
Definition: opengl_interop.hpp:189
_Tp height
Definition: core.hpp:840
CV_EXPORTS void setGlDevice(int device=0)
set a CUDA device to use OpenGL interoperability
void texCoord(float x, float y)
Proxy datatype for passing Mat's and vector<>'s as input parameters.
Definition: core.hpp:1400
Size size() const
Definition: opengl_interop.hpp:123
GLuint color
Definition: core_c.h:1276