how to view image from ycbcr using glDrawPixels()


i have problem with making yuv viewer.

i use glDrawPixels() function and input GL_YCRCB_SGIX parameter for YUV420 format

ex> glDrawPixels(m_iWidth, m_iHeight, GL_YCRCB_SGIX, GL_UNSIGNED_BYTE, pData);

pData is LPBYTE type buffer with YUV420 format data

size is WIDTH * HEIGHT * 3/2

but, i can’t see anything…

then how can i solve this problem?

Do you have the GL_SGIX_ycrcb extension supported? And I think that the YUV420 format is not supported by this extension. This link have some information about GL_YCRCB_422_SGIX.

Hope that help.

thank you for trinitrotoluene.

there are no referrence that more detail?

If you know how to make the color space conversion from YUV to RGB and you are able to use shaders, you can write a fragment shader to make the conversion of the texture.