OpenGL色彩空间转换 [英] OpenGL Colorspace Conversion

查看:179
本文介绍了OpenGL色彩空间转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何使用YUV颜色空间创建纹理,以便我们无需使用片段着色器就可以将基于YUV的颜色转换为RGB颜色空间吗?我正在使用NVidia 9400,但没有看到明显的GL扩展似乎可以解决问题.我已经找到了如何使用片段着色器的示例,但是我正在处理的项目目前仅支持OpenGL 1.1,并且我没有时间将其转换为2.0并执行所有必要的回归测试.这也针对Linux.在其他平台上,我一直在使用MESA扩展程序,但它在Nvidia卡上不起作用.

Does anyone know how to create a texture with a YUV colorspace so that we can get hardware based YUV to RGB colorspace conversion without having to use a fragment shader? I'm using an NVidia 9400 and I don't see an obvious GL extension that seems to do the trick. I've found examples how to use a fragment shader, but the project I'm working on currently only supports OpenGL 1.1 and I don't have time to convert it to 2.0 and perform all the regression testing necessary. This is also targeting Linux. On other platforms I've been using a MESA extension but it doesn't function on the Nvidia card.

推荐答案

由于您可以使用扩展程序,但您担心要全面使用OpenGL 2.0,因此请考虑为旧的扩展程序提供一个简单的片段着色器.学校 ARB_fragment_program 扩展名.

Since you're okay with using extensions, but you're worried about going all-out with OpenGL 2.0, consider providing a simple fragment shader with the old-school ARB_fragment_program extension.

或者,您可以使用DevIL,ImageMagick或FreeImage之类的库来为您执行转换.

Alternatively, you could use a library like DevIL, ImageMagick, or FreeImage to perform the conversion for you.

这篇关于OpenGL色彩空间转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆