Syntax
int sod_img_blob_save_as_jpeg(const char * zPath, const unsigned char *zBlob, int width, int height, int nChannels, int Quality);
Description
Save a raw memory representation of an image in a file on disk (JPEG format). JPEG does ignore alpha channels in input data.
Parameters
const char *zPath
Destination path on disk.
const unsigned char *zBlob
Raw memory representation of an image.
int width
Image width.
int height
Image height.
int nChannels
Total number of color channels.
int Quality
Compression quality (a value between 0 and 100). Lower quality results in a smaller image. Higher quality looks better but results in a bigger image. Pass a negative value for a default ratio.
Return Value
SOD_OK is returned on success. Any other return value indicates failure.
Example
Checkout the introduction course, the C/C++ samples on the download page or refer to the SOD Github Repository.
See also
sod_canny_edge_image • sod_image_to_blob • sod_hough_lines_detect • sod_img_save_as_png • sod_crop_image.