SOD C/C++ API Reference - Image Processing


unsigned char * sod_image_to_blob(sod_img input);


Convert back a sod_img object to its original raw memory (i.e. Blob) representation.


sod_img    input

The input image to be converted. The image can be loaded from disk using sod_img_load_from_file(), from memory (i.e. network socket) via sod_img_load_from_mem() or dynamically created via sod_make_image().

Return Value

1 to 3 bytes per pixel value of the original sod_img object is allocated & written into this memory pointer. if something goes wrong during processing (i.e. running out-of-memory), then NULL is returned instead. When done, sod_image_free_blob() must be called in order to avoid memory leaks.


Checkout the introduction course, the C/C++ samples on the download page or refer to the SOD Github Repository.

See also