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 }