void cv::gpu::setGlDevice(int device)\r
{\r
#ifndef HAVE_CUDA\r
- (void)device;\r
+ (void)device;\r
throw_nocuda;\r
#else\r
#ifndef HAVE_OPENGL\r
- (void)device;\r
+ (void)device;\r
throw_nogl;\r
#else\r
if (!glFuncTab()->isGlContextInitialized())\r
{\r
public:\r
static const Ptr<Impl>& empty();\r
- \r
+\r
Impl(int rows, int cols, int type, unsigned int target);\r
Impl(const Mat& m, unsigned int target);\r
~Impl();\r
\r
private:\r
Impl();\r
- \r
+\r
unsigned int buffer_;\r
\r
#ifdef HAVE_CUDA\r
\r
#endif // HAVE_OPENGL\r
\r
-cv::GlBuffer::GlBuffer(Usage usage) : rows_(0), cols_(0), type_(0), usage_(usage)\r
+cv::GlBuffer::GlBuffer(Usage _usage) : rows_(0), cols_(0), type_(0), usage_(_usage)\r
{\r
#ifndef HAVE_OPENGL\r
- (void)usage;\r
+ (void)_usage;\r
throw_nogl;\r
#else\r
impl_ = Impl::empty();\r
#endif\r
}\r
\r
-cv::GlBuffer::GlBuffer(int rows, int cols, int type, Usage usage) : rows_(0), cols_(0), type_(0), usage_(usage)\r
+cv::GlBuffer::GlBuffer(int _rows, int _cols, int _type, Usage _usage) : rows_(0), cols_(0), type_(0), usage_(_usage)\r
{\r
#ifndef HAVE_OPENGL\r
- (void)rows;\r
- (void)cols;\r
- (void)type;\r
- (void)usage;\r
+ (void)_rows;\r
+ (void)_cols;\r
+ (void)_type;\r
+ (void)_usage;\r
throw_nogl;\r
#else\r
- impl_ = new Impl(rows, cols, type, usage);\r
- rows_ = rows;\r
- cols_ = cols;\r
- type_ = type;\r
+ impl_ = new Impl(_rows, _cols, _type, _usage);\r
+ rows_ = _rows;\r
+ cols_ = _cols;\r
+ type_ = _type;\r
#endif\r
}\r
\r
-cv::GlBuffer::GlBuffer(Size size, int type, Usage usage) : rows_(0), cols_(0), type_(0), usage_(usage)\r
+cv::GlBuffer::GlBuffer(Size _size, int _type, Usage _usage) : rows_(0), cols_(0), type_(0), usage_(_usage)\r
{\r
#ifndef HAVE_OPENGL\r
- (void)size;\r
- (void)type;\r
- (void)usage;\r
+ (void)_size;\r
+ (void)_type;\r
+ (void)_usage;\r
throw_nogl;\r
#else\r
- impl_ = new Impl(size.height, size.width, type, usage);\r
- rows_ = size.height;\r
- cols_ = size.width;\r
- type_ = type;\r
+ impl_ = new Impl(_size.height, _size.width, _type, _usage);\r
+ rows_ = _size.height;\r
+ cols_ = _size.width;\r
+ type_ = _type;\r
#endif\r
}\r
\r
-cv::GlBuffer::GlBuffer(InputArray mat_, Usage usage) : rows_(0), cols_(0), type_(0), usage_(usage)\r
+cv::GlBuffer::GlBuffer(InputArray mat_, Usage _usage) : rows_(0), cols_(0), type_(0), usage_(_usage)\r
{\r
#ifndef HAVE_OPENGL\r
- (void)mat_;\r
- (void)usage;\r
+ (void)mat_;\r
+ (void)_usage;\r
throw_nogl;\r
#else\r
int kind = mat_.kind();\r
- Size size = mat_.size();\r
- int type = mat_.type();\r
+ Size _size = mat_.size();\r
+ int _type = mat_.type();\r
\r
if (kind == _InputArray::GPU_MAT)\r
{\r
throw_nocuda;\r
#else\r
GpuMat d_mat = mat_.getGpuMat();\r
- impl_ = new Impl(d_mat.rows, d_mat.cols, d_mat.type(), usage);\r
+ impl_ = new Impl(d_mat.rows, d_mat.cols, d_mat.type(), _usage);\r
impl_->copyFrom(d_mat);\r
#endif\r
}\r
else\r
{\r
Mat mat = mat_.getMat();\r
- impl_ = new Impl(mat, usage);\r
+ impl_ = new Impl(mat, _usage);\r
}\r
\r
- rows_ = size.height;\r
- cols_ = size.width;\r
- type_ = type;\r
+ rows_ = _size.height;\r
+ cols_ = _size.width;\r
+ type_ = _type;\r
#endif\r
}\r
\r
-void cv::GlBuffer::create(int rows, int cols, int type, Usage usage)\r
+void cv::GlBuffer::create(int _rows, int _cols, int _type, Usage _usage)\r
{\r
#ifndef HAVE_OPENGL\r
- (void)rows;\r
- (void)cols;\r
- (void)type;\r
- (void)usage;\r
+ (void)_rows;\r
+ (void)_cols;\r
+ (void)_type;\r
+ (void)_usage;\r
throw_nogl;\r
#else\r
- if (rows_ != rows || cols_ != cols || type_ != type || usage_ != usage)\r
+ if (rows_ != _rows || cols_ != _cols || type_ != _type || usage_ != _usage)\r
{\r
- impl_ = new Impl(rows, cols, type, usage);\r
- rows_ = rows;\r
- cols_ = cols;\r
- type_ = type;\r
- usage_ = usage;\r
+ impl_ = new Impl(_rows, _cols, _type, _usage);\r
+ rows_ = _rows;\r
+ cols_ = _cols;\r
+ type_ = _type;\r
+ usage_ = _usage;\r
}\r
#endif\r
}\r
void cv::GlBuffer::copyFrom(InputArray mat_)\r
{\r
#ifndef HAVE_OPENGL\r
- (void)mat_;\r
+ (void)mat_;\r
throw_nogl;\r
#else\r
int kind = mat_.kind();\r
- Size size = mat_.size();\r
- int type = mat_.type();\r
+ Size _size = mat_.size();\r
+ int _type = mat_.type();\r
\r
- create(size, type);\r
+ create(_size, _type);\r
\r
switch (kind)\r
{\r
\r
private:\r
Impl();\r
- \r
+\r
GLuint tex_;\r
};\r
\r
#endif\r
}\r
\r
-cv::GlTexture::GlTexture(int rows, int cols, int type) : rows_(0), cols_(0), type_(0), buf_(GlBuffer::TEXTURE_BUFFER)\r
+cv::GlTexture::GlTexture(int _rows, int _cols, int _type) : rows_(0), cols_(0), type_(0), buf_(GlBuffer::TEXTURE_BUFFER)\r
{\r
#ifndef HAVE_OPENGL\r
- (void)rows;\r
- (void)cols;\r
- (void)type;\r
+ (void)_rows;\r
+ (void)_cols;\r
+ (void)_type;\r
throw_nogl;\r
#else\r
- impl_ = new Impl(rows, cols, type);\r
- rows_ = rows;\r
- cols_ = cols;\r
- type_ = type;\r
+ impl_ = new Impl(_rows, _cols, _type);\r
+ rows_ = _rows;\r
+ cols_ = _cols;\r
+ type_ = _type;\r
#endif\r
}\r
\r
-cv::GlTexture::GlTexture(Size size, int type) : rows_(0), cols_(0), type_(0), buf_(GlBuffer::TEXTURE_BUFFER)\r
+cv::GlTexture::GlTexture(Size _size, int _type) : rows_(0), cols_(0), type_(0), buf_(GlBuffer::TEXTURE_BUFFER)\r
{\r
#ifndef HAVE_OPENGL\r
- (void)size;\r
- (void)type;\r
+ (void)_size;\r
+ (void)_type;\r
throw_nogl;\r
#else\r
- impl_ = new Impl(size.height, size.width, type);\r
- rows_ = size.height;\r
- cols_ = size.width;\r
- type_ = type;\r
+ impl_ = new Impl(_size.height, _size.width, _type);\r
+ rows_ = _size.height;\r
+ cols_ = _size.width;\r
+ type_ = _type;\r
#endif\r
}\r
\r
cv::GlTexture::GlTexture(InputArray mat_, bool bgra) : rows_(0), cols_(0), type_(0), buf_(GlBuffer::TEXTURE_BUFFER)\r
{\r
#ifndef HAVE_OPENGL\r
- (void)mat_;\r
- (void)bgra;\r
+ (void)mat_;\r
+ (void)bgra;\r
throw_nogl;\r
-#else \r
+#else\r
int kind = mat_.kind();\r
- Size size = mat_.size();\r
- int type = mat_.type();\r
+ Size _size = mat_.size();\r
+ int _type = mat_.type();\r
\r
switch (kind)\r
{\r
}\r
}\r
\r
- rows_ = size.height;\r
- cols_ = size.width;\r
- type_ = type;\r
+ rows_ = _size.height;\r
+ cols_ = _size.width;\r
+ type_ = _type;\r
#endif\r
}\r
\r
-void cv::GlTexture::create(int rows, int cols, int type)\r
+void cv::GlTexture::create(int _rows, int _cols, int _type)\r
{\r
#ifndef HAVE_OPENGL\r
- (void)rows;\r
- (void)cols;\r
- (void)type;\r
+ (void)_rows;\r
+ (void)_cols;\r
+ (void)_type;\r
throw_nogl;\r
#else\r
- if (rows_ != rows || cols_ != cols || type_ != type)\r
+ if (rows_ != _rows || cols_ != _cols || type_ != _type)\r
{\r
- impl_ = new Impl(rows, cols, type);\r
- rows_ = rows;\r
- cols_ = cols;\r
- type_ = type;\r
+ impl_ = new Impl(_rows, _cols, _type);\r
+ rows_ = _rows;\r
+ cols_ = _cols;\r
+ type_ = _type;\r
}\r
#endif\r
}\r
void cv::GlTexture::copyFrom(InputArray mat_, bool bgra)\r
{\r
#ifndef HAVE_OPENGL\r
- (void)mat_;\r
- (void)bgra;\r
+ (void)mat_;\r
+ (void)bgra;\r
throw_nogl;\r
#else\r
int kind = mat_.kind();\r
- Size size = mat_.size();\r
- int type = mat_.type();\r
+ Size _size = mat_.size();\r
+ int _type = mat_.type();\r
\r
- create(size, type);\r
+ create(_size, _type);\r
\r
switch(kind)\r
{\r
////////////////////////////////////////////////////////////////////////\r
// GlFont\r
\r
-cv::GlFont::GlFont(const string& family, int height, Weight weight, Style style)\r
- : family_(family), height_(height), weight_(weight), style_(style), base_(0)\r
+cv::GlFont::GlFont(const string& _family, int _height, Weight _weight, Style _style)\r
+ : family_(_family), height_(_height), weight_(_weight), style_(_style), base_(0)\r
{\r
#ifndef HAVE_OPENGL\r
throw_nogl;\r
base_ = glGenLists(256);\r
CV_CheckGlError();\r
\r
- glFuncTab()->generateBitmapFont(family, height, weight, (style & STYLE_ITALIC) != 0, (style & STYLE_UNDERLINE) != 0, 0, 256, base_);\r
+ glFuncTab()->generateBitmapFont(family_, height_, weight_, (style_ & STYLE_ITALIC) != 0, (style_ & STYLE_UNDERLINE) != 0, 0, 256, base_);\r
#endif\r
}\r
\r
class FontCompare : public unary_function<Ptr<GlFont>, bool>\r
{\r
public:\r
- inline FontCompare(const string& family, int height, GlFont::Weight weight, GlFont::Style style) \r
+ inline FontCompare(const string& family, int height, GlFont::Weight weight, GlFont::Style style)\r
: family_(family), height_(height), weight_(weight), style_(style)\r
{\r
}\r
Ptr<GlFont> cv::GlFont::get(const std::string& family, int height, Weight weight, Style style)\r
{\r
#ifndef HAVE_OPENGL\r
- (void)family;\r
- (void)height;\r
- (void)weight;\r
- (void)style;\r
+ (void)family;\r
+ (void)height;\r
+ (void)weight;\r
+ (void)style;\r
throw_nogl;\r
return Ptr<GlFont>();\r
#else\r
void cv::render(const GlTexture& tex, Rect_<double> wndRect, Rect_<double> texRect)\r
{\r
#ifndef HAVE_OPENGL\r
- (void)tex;\r
- (void)wndRect;\r
- (void)texRect;\r
+ (void)tex;\r
+ (void)wndRect;\r
+ (void)texRect;\r
throw_nogl;\r
#else\r
if (!tex.empty())\r
void cv::render(const GlArrays& arr, int mode, Scalar color)\r
{\r
#ifndef HAVE_OPENGL\r
- (void)arr;\r
- (void)mode;\r
- (void)color;\r
+ (void)arr;\r
+ (void)mode;\r
+ (void)color;\r
throw_nogl;\r
#else\r
glColor3d(color[0] / 255.0, color[1] / 255.0, color[2] / 255.0);\r
void cv::render(const string& str, const Ptr<GlFont>& font, Scalar color, Point2d pos)\r
{\r
#ifndef HAVE_OPENGL\r
- (void)str;\r
- (void)font;\r
- (void)color;\r
- (void)pos;\r
+ (void)str;\r
+ (void)font;\r
+ (void)color;\r
+ (void)pos;\r
throw_nogl;\r
#else\r
glPushAttrib(GL_DEPTH_BUFFER_BIT);\r
bool icvCheckGlError(const char* file, const int line, const char* func)\r
{\r
#ifndef HAVE_OPENGL\r
- (void)file;\r
- (void)line;\r
- (void)func;\r
+ (void)file;\r
+ (void)line;\r
+ (void)func;\r
return true;\r
#else\r
GLenum err = glGetError();\r