PDA

View Full Version : how to view image from ycbcr using glDrawPixels()



speaking bear
10-14-2008, 12:16 PM
hello.

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?

trinitrotoluene
10-14-2008, 01:38 PM
Do you have the GL_SGIX_ycrcb (http://www.opengl.org/registry/specs/SGIX/ycrcb.txt) extension supported? And I think that the YUV420 format is not supported by this extension. This link (http://lurkertech.com/lg/ogl.video.html) have some information about GL_YCRCB_422_SGIX.

Hope that help.

speaking bear
10-14-2008, 08:40 PM
thank you for trinitrotoluene.

there are no referrence that more detail?

trinitrotoluene
10-15-2008, 06:51 AM
If you know how to make the color space conversion from YUV to RGB (http://www.fourcc.org/fccyvrgb.php) and you are able to use shaders, you can write a fragment shader to make the conversion of the texture.