|
|
|
@ -52,7 +52,7 @@ |
|
|
|
|
|
|
|
|
|
#ifdef HAVE_OPENGL |
|
|
|
|
#include <GL/gl.h> |
|
|
|
|
#include <Gl/glu.h> |
|
|
|
|
#include <GL/glu.h> |
|
|
|
|
|
|
|
|
|
#ifdef HAVE_CUDA |
|
|
|
|
#include <cuda_gl_interop.h> |
|
|
|
@ -1191,6 +1191,7 @@ cv::gpu::GlBuffer::Impl::Impl(int rows, int cols, int type, unsigned int target) |
|
|
|
|
|
|
|
|
|
glFuncTab()->genBuffers(1, &buffer_); |
|
|
|
|
CV_CheckGlError(); |
|
|
|
|
CV_Assert(buffer_ != 0); |
|
|
|
|
|
|
|
|
|
size_t size = rows * cols * CV_ELEM_SIZE(type); |
|
|
|
|
|
|
|
|
@ -1219,6 +1220,7 @@ cv::gpu::GlBuffer::Impl::Impl(const Mat& m, unsigned int target) : buffer_(0) |
|
|
|
|
|
|
|
|
|
glFuncTab()->genBuffers(1, &buffer_); |
|
|
|
|
CV_CheckGlError(); |
|
|
|
|
CV_Assert(buffer_ != 0); |
|
|
|
|
|
|
|
|
|
size_t size = m.rows * m.cols * m.elemSize(); |
|
|
|
|
|
|
|
|
@ -1582,6 +1584,7 @@ cv::gpu::GlTexture::Impl::Impl(int rows, int cols, int type) : tex_(0) |
|
|
|
|
|
|
|
|
|
glGenTextures(1, &tex_); |
|
|
|
|
CV_CheckGlError(); |
|
|
|
|
CV_Assert(tex_ != 0); |
|
|
|
|
|
|
|
|
|
glBindTexture(GL_TEXTURE_2D, tex_); |
|
|
|
|
CV_CheckGlError(); |
|
|
|
@ -1616,6 +1619,7 @@ cv::gpu::GlTexture::Impl::Impl(const Mat& mat, bool bgra) : tex_(0) |
|
|
|
|
|
|
|
|
|
glGenTextures(1, &tex_); |
|
|
|
|
CV_CheckGlError(); |
|
|
|
|
CV_Assert(tex_ != 0); |
|
|
|
|
|
|
|
|
|
glBindTexture(GL_TEXTURE_2D, tex_); |
|
|
|
|
CV_CheckGlError(); |
|
|
|
@ -1643,13 +1647,14 @@ cv::gpu::GlTexture::Impl::Impl(const GlBuffer& buf, bool bgra) : tex_(0) |
|
|
|
|
int depth = buf.depth(); |
|
|
|
|
int cn = buf.channels(); |
|
|
|
|
|
|
|
|
|
CV_DbgAssert(buf.rows() > 0 && buf.cols() > 0); |
|
|
|
|
CV_DbgAssert(buf.rows > 0 && buf.cols > 0); |
|
|
|
|
CV_Assert(cn == 1 || cn == 3 || cn == 4); |
|
|
|
|
CV_Assert(depth >= 0 && depth <= CV_32F); |
|
|
|
|
CV_Assert(buf.usage() == GlBuffer::TEXTURE_BUFFER); |
|
|
|
|
|
|
|
|
|
glGenTextures(1, &tex_); |
|
|
|
|
CV_CheckGlError(); |
|
|
|
|
CV_Assert(tex_ != 0); |
|
|
|
|
|
|
|
|
|
glBindTexture(GL_TEXTURE_2D, tex_); |
|
|
|
|
CV_CheckGlError(); |
|
|
|
|