parse pixel data from png file?

Thread Starter


Joined Jul 23, 2014
Now,I have a project to transfer video data and subtitle through PCIe bus from a x86 board with CentOS installed to a Xilinx FPGA.
subtitle is stored in xml file,I should parse subtitle string from xml,get pixel data from a .ttf font file,this has been done by me.
But there are some png file that needed to download to FPGA.It should be converted into pixel matrix before transfering.I do not know how to get pixel data from PNG file.
I search in web,that I found a useful library - libpng.The document is more complex.

Could someone show me example code to get pixel data from a png file with libpng ?

thanks a lot.


Joined Apr 24, 2011
Is the png a fixed file? Heck, even Microsoft paint can open a png and save as a bitmap. The bitmap format is well documented so you can pull whatever pixel data you need there.

Doing it on the fly... don ask me, I don know nuthin bout on the fly.