Loading and saving to file an image from a raw data memory structure in c++

898 Views Asked by At

I have a piece of code that retrieves images from a camera and store them in a structure. The structure provides the pointer to the first pixel of the image as well as the image dimension, its width and height. My question is: how can I save the image stored in the structure in a say .jpg or .png file to be displayed and processed ?

Thanks in advance !

1

There are 1 best solutions below

0
On

You can integrate the libjpeg or libpng freewares, which are the most complete, but be ready for hard work.