opengl es - android read pixels from GL_TEXTURE_EXTERNAL_OES -


I am trying to read pixel / data from an OpenGL texture which is bound to GL_ TEXTURE_EXTERNAL_OES.

The reason for complying this goal to texture is that to obtain a live camera feed on Android, SurgeText is required to create an OpgL texture which is bound to GL_TEXTURE_EXTERNAL_OES.

Since Android uses OpenGL ES, use glGetTexImage () to read image data.

So I am aiming for an FBO and then reading it using readPixels (). This is my code:

  Glument framebuffer; GlenFrefrbuffers (1, and framebuffer); GlobindFramebuffer (GL_FamBuffer, framebuffer); // Attach the 2D texture into this FBO glFramebufferTextxture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_EXTERNAL_OES, camera detection, 0); Status ("glFramebufferTextxture2D (error)% d", glGetError ()) returned;   

However I'm getting error 1282 (GL_INVALID_OPERATION) for some reason.

GL_TEXTURE_EXTERNAL_OES Texture targets usually occur in a YUV color space and the glReadPixels () It does not necessarily have color space conversion automatically, however, you can make a conversion in your own piece shader which provides RGB another texture and then use glReadPixels () to read that .



Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -