GL_IMG_read_format#

Supported Hardware#

Series5, Series5XT, Series6, Series6XE, Series6XT

Valid APIs#

OpenGL ES 1.x, 2.0, 3.x

Description#

Reading pixels from a framebuffer in OpenGL ES is performed via the function glReadPixels(). This function is able to read data out in only two formats; RGBA8888, and another, implementation defined format, which can be queried with glGetIntegerv(). In OpenGL ES 1.x, only one read format is available in core, so GL_OES_read_format is required for this extension. Normally these additional formats are limited to being RGBA, RGB or Alpha-Only formats. This extension adds a new readable format (GL_BGRA_IMG) and a new readable type (UNSIGNED_SHORT_4_4_4_4_REV_IMG), allowing the function to be extended to use a different native format than typically allowed.

Example#

// Read pixels can now be performed with GL_BGRA data as well as any other default formats.
glReadPixels(0, 0, 1024, 1024, GL_BGRA_IMG, GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG, pixelDataOutput);