Hi there.
I get image data from an application and I need to find a way to save this image data as a png on the hard drive.
The image data I get comes in this format:
int width
int height
float[] rgba // 4 floats from this array form a pixel. The lines are filled from left to right from top to bottom.
rgba.length == width * height * 4
I get this data from an OpenGL texture.
I googled for a png encoder on the net but all that I found take Image objects as input.
So I figured I need some kind of wrapper for this data, but the Image interface has a lot of methods which I dont really want to implement since most of them are not needed for me.
Are their any suggestions what I should do? I was thinking about using a BufferedImage and fill the pixels, but if possible I would like to keep it simple and efficient.
Thank you very much.