I have being study about OpenGL ES for iOS. I wonder that data of YUV format is can display without converting RGB. In most, the yuv data have to convert RGB for display. But, converting process is very slow, Then, that is not display smoothly. So, I would like to try to dispaly YUV data without convert to RGB. Is it possible? If possible, what can I do? Please, let me give a advice.
I think it is not possible in OpenGL ES to display YUV data without convert to RGB data.
You can do this very easily using OpenGL ES 2.0 shaders. I use this technique for my super-fast iOS camera app SnappyCam. The fragment shader would perform the matrix multiplication to take you from YCbCr
("YUV
") to RGB
. You can have each {Y, Cb, Cr}
channel in a separate GL_LUMINANCE
texture, or combine the {Cb, Cr}
textures together using a GL_LUMINANCE_ALPHA
texture if your chrominance data is already interleaved (Apple call this a bi-planar format).
See my related answer to the question YUV to RGBA on Apple A4, should I use shaders or NEON? here on StackOverflow.
You may also do this using the fixed rendering pipeline of ES 1.1, but I haven't tried it. I would look toward the the texture blending functions, e.g. given in this OpenGL Texture Combiners Wiki Page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With