Click here to Skip to main content
15,748,098 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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.).
Posted
Updated 11-Jul-17 22:13pm
v2
Comments
Richard MacCutchan 12-Jul-17 3:50am    
You need to read the documentation.
DingTingTing 12-Jul-17 9:52am    
what kind of documentation?
Richard MacCutchan 12-Jul-17 9:57am    
Are you kidding?
DingTingTing 12-Jul-17 10:01am    
No,I'm not kidding.
Richard MacCutchan 12-Jul-17 10:16am    
So what documentation do you think will help you to learn how to use the library that you want to use?

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900