本文整理汇总了C++中InputArray::getGlBuffer方法的典型用法代码示例。如果您正苦于以下问题:C++ InputArray::getGlBuffer方法的具体用法?C++ InputArray::getGlBuffer怎么用?C++ InputArray::getGlBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InputArray
的用法示例。
在下文中一共展示了InputArray::getGlBuffer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: create
void cv::GlTexture::copyFrom(InputArray mat_, bool bgra)
{
#ifndef HAVE_OPENGL
(void)mat_;
(void)bgra;
throw_nogl;
#else
int kind = mat_.kind();
Size _size = mat_.size();
int _type = mat_.type();
create(_size, _type);
switch(kind)
{
case _InputArray::OPENGL_TEXTURE:
{
GlTexture tex = mat_.getGlTexture();
*this = tex;
break;
}
case _InputArray::OPENGL_BUFFER:
{
GlBuffer buf = mat_.getGlBuffer();
impl_->copyFrom(buf, bgra);
break;
}
case _InputArray::GPU_MAT:
{
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
throw_nocuda;
#else
GpuMat d_mat = mat_.getGpuMat();
buf_.copyFrom(d_mat);
impl_->copyFrom(buf_, bgra);
#endif
break;
}
default:
{
Mat mat = mat_.getMat();
impl_->copyFrom(mat, bgra);
}
}
#endif
}
示例2: buf
cv::GlTexture::GlTexture(InputArray mat_, bool bgra) : rows_(0), cols_(0), type_(0), buf_(GlBuffer::TEXTURE_BUFFER)
{
#ifndef HAVE_OPENGL
(void)mat_;
(void)bgra;
throw_nogl;
#else
int kind = mat_.kind();
Size _size = mat_.size();
int _type = mat_.type();
switch (kind)
{
case _InputArray::OPENGL_BUFFER:
{
GlBuffer buf = mat_.getGlBuffer();
impl_ = new Impl(buf, bgra);
break;
}
case _InputArray::GPU_MAT:
{
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
throw_nocuda;
#else
GpuMat d_mat = mat_.getGpuMat();
GlBuffer buf(d_mat, GlBuffer::TEXTURE_BUFFER);
impl_ = new Impl(buf, bgra);
#endif
break;
}
default:
{
Mat mat = mat_.getMat();
impl_ = new Impl(mat, bgra);
break;
}
}
rows_ = _size.height;
cols_ = _size.width;
type_ = _type;
#endif
}