Convert data from one image format to another
#include <img/img.h> int img_convert_data( img_format_t sformat, const uint8_t* src, img_format_t dformat, uint8_t* dst, size_t n );
- The format of the data you are converting from; see img_format_t.
- A pointer to a buffer containing the source data.
- The format you would like to convert the data to.
- A pointer to a buffer to store the converted data. This may point to a different buffer, or it can point to the same buffer as src, as long as you've ensured that the source buffer is large enough to store the converted data (the IMG_FMT_BPL() macro can help you with this).
- The number of samples to convert.
Use the -l img option to qcc to link against this library.
This function converts data from one image format to another. The conversion may be done from one buffer to another, or in place.
If you're repeatedly converting data, it's better to call img_convert_getfunc() to get the conversion function, and then call the conversion function as required.
- One of the formats specified is invalid.