Created
December 28, 2018 02:06
-
-
Save z4none/2d4975edd7271dc0dedeed3531bb07f0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int width = m_view_size.width(); | |
| int height = m_view_size.height(); | |
| uint8_t * data = new uint8_t[width * height * 4]; | |
| m_gles2->ReadPixels(m_context->pp_resource(), 0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data); | |
| cv::Mat rgbFrame, outputFrame; | |
| cv::Mat glFrame = cv::Mat(height, width, CV_8UC4, data); | |
| cv::cvtColor(glFrame, rgbFrame, CV_BGRA2RGB); | |
| cv::flip(rgbFrame, outputFrame, 0); | |
| cv::imwrite("d:\\1.bmp", outputFrame); | |
| delete[] data; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment