如何将png转换为yuv? [英] How to convert png to yuv?

查看:918
本文介绍了如何将png转换为yuv?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用libpng函数解码png图像并将其解码为YUV444数据格式,但我不知道要调用哪个函数,或者如何编写这个自定义回调函数?

我发现一些代码使用libpng来解码png图像,但我不知道如何设置png数据格式(如RGB888,YUV444等)。

我希望能够提供基于libpng的代码,非常感谢。有C ++ / C



我尝试过:



我找到一些使用libpng解码png图像的代码,但我不知道如何设置png数据格式(如RGB888,YUV444等)。

I would like to use function of libpng to decode png image and decode it into YUV444 data format, but I do not know which function to call, or how to write this custom callback function?
I find some code to use libpng to decode png image, but I do not know how to set the png data format (such as RGB888, YUV444, etc.).
I hope to be able to provide code based on libpng, very grateful.With C ++ / C

What I have tried:

I find some code to use libpng to decode png image, but I do not know how to set the png data format (such as RGB888, YUV444, etc.).

推荐答案

使用libpng应该很容易,如阅读图像 。通过将公式应用于图像的每个像素,您必须从该图像提取像素以将eacha像素转换为YUV变得容易。阅读维基百科中的 YUV文章了解不同的公式。在写作时要注意不同的YUV文件格式。
With libpng should be easy as decribed Reading an image. From that image you must extract the pixels to converting eacha pixel into YUV is easy by applying the formulas to every pixel of the image. Read the YUV article in the wikipedia for the different formulas. Pay attention to the differnet YUV file formats when writing.


这篇关于如何将png转换为yuv?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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