I am looking for a way to get a buffer of image data in a PNG file and a way to get a PNG file into a buffer.
There are only two things I want to do.
It would be a dead simple shell that uses png.h Well, not quite dead just because of the terribly complex libpng API, but there is a concept.
I tried DevIL before. It is much easier to use than libpng. However, I used issues . In addition, Devil does too much. I need only the exact and average basic support for the PNG format, and not 20 other formats.
Then I find this page . I praised Pixel Fairy and Almighty Google for giving me an implementation on a silver platter ... Then it turns out that this spins the image: on the processed image, every fourth pixel in every scan line disappears. I am quite sure that I am reading the source that this should not happen! He had to zero out red and set green to blue. This did not happen either.
I also tried png ++. The problem that I encountered is that I could not get the data from PNG in a format compatible for loading in OpenGL, I would have to build another buffer. It just looked ugly, but I will definitely try png ++ again before I even think about giving Delilah another shot. Because png ++ worked, at least. He also got a heading aspect for him. However, this caused a bunch of compiler warnings.
Are there any other rivals? Anyone who worked directly with libpng would know how to do what I ask: one function that takes a file name and populates a buffer with 32 bits and sets two permission integers; one function that takes a buffer with 32 bits, two permission integers and a file name.
Update-edit: I found this one . Maybe something is there.
source share