use minmal access rights with umat.get

pull/3471/head
kallaballa 2 years ago
parent 46e4a9012f
commit 268bcdc85c
  1. 4
      src/common/detail/clglcontext.cpp

@ -96,14 +96,14 @@ void CLGLContext::end() {
}
void CLGLContext::download(cv::UMat& m) {
cv::Mat tmp = m.getMat(cv::ACCESS_RW);
cv::Mat tmp = m.getMat(cv::ACCESS_WRITE);
assert(tmp.data != nullptr);
GL_CHECK(glReadPixels(0, 0, tmp.cols, tmp.rows, GL_RGBA, GL_UNSIGNED_BYTE, tmp.data));
tmp.release();
}
void CLGLContext::upload(const cv::UMat& m) {
cv::Mat tmp = m.getMat(cv::ACCESS_RW);
cv::Mat tmp = m.getMat(cv::ACCESS_READ);
assert(tmp.data != nullptr);
GL_CHECK(glTexSubImage2D(
GL_TEXTURE_2D,

Loading…
Cancel
Save