sod_img sod_img_load_from_file(const char *zFile, int nChannels);
Load an image from disk. On success, a memory representation of the target image is returned in an instance of the sod_img object which can be processed or analyzed via the exported interfaces. As of this release, the following image format are officially supported: JPEG, PNG, BMP, HDR, PSD, TGA, PIC, PPM, PGM, PBM. If you want to load an image from memory, call sod_img_load_from_mem() instead. You can also load an entire set of images from a given directory via sod_img_set_load_from_directory().
const char *zFile
Source path of the target image to load.
Total number of color channels to load. Set this parameter to 0 (SOD_IMG_COLOR) for the default behavior. 1 (SOD_IMG_GRAYSCALE) for grayscale colorspace conversion or 3 (SOD_IMG_COLOR) for full color channels.
Memory representation of the target image is returned in an instance of the sod_img object. if something goes wrong during loading (i.e. Invalid path, format or running out-of-memory), then an empty image is returned via sod_make_empty_image(). Once done, you must release the memory allocated to this object via sod_free_image() to avoid memory leaks.