Image IO (Save/Load) operations. More...
Functions | |
SIMD_API uint8_t * | SimdImageSaveToMemory (const uint8_t *src, size_t stride, size_t width, size_t height, SimdPixelFormatType format, SimdImageFileType file, int quality, size_t *size) |
Saves an image to memory in given image file format. More... | |
SIMD_API SimdBool | SimdImageSaveToFile (const uint8_t *src, size_t stride, size_t width, size_t height, SimdPixelFormatType format, SimdImageFileType file, int quality, const char *path) |
Saves an image to memory in given image file format. More... | |
SIMD_API uint8_t * | SimdImageLoadFromMemory (const uint8_t *data, size_t size, size_t *stride, size_t *width, size_t *height, SimdPixelFormatType *format) |
Loads an image from memory buffer. More... | |
SIMD_API uint8_t * | SimdImageLoadFormFile (const char *path, size_t *stride, size_t *width, size_t *height, SimdPixelFormatType *format) |
Loads an image from file. More... | |
Detailed Description
Image IO (Save/Load) operations.
Function Documentation
◆ SimdImageSaveToMemory()
uint8_t * SimdImageSaveToMemory | ( | const uint8_t * | src, |
size_t | stride, | ||
size_t | width, | ||
size_t | height, | ||
SimdPixelFormatType | format, | ||
SimdImageFileType | file, | ||
int | quality, | ||
size_t * | size | ||
) |
Saves an image to memory in given image file format.
- Parameters
-
[in] src - a pointer to pixels data of input image. [in] stride - a row size of input image in bytes. [in] width - a width of input image. [in] height - a height of input image. [in] format - a pixel format of input image. Supported pixel formats: SimdPixelFormatGray8, SimdPixelFormatBgr24, SimdPixelFormatBgra32, SimdPixelFormatRgb24. [in] file - a format of output image file. To auto choise format of output file set this parameter to SimdImageFileUndefined. [in] quality - a parameter of compression quality (if file format supports it). [out] size - a pointer to the size of output image file in bytes.
- Returns
- a pointer to memory buffer with output image file. It has to be deleted after use by function SimdFree. On error it returns NULL.
◆ SimdImageSaveToFile()
SimdBool SimdImageSaveToFile | ( | const uint8_t * | src, |
size_t | stride, | ||
size_t | width, | ||
size_t | height, | ||
SimdPixelFormatType | format, | ||
SimdImageFileType | file, | ||
int | quality, | ||
const char * | path | ||
) |
Saves an image to memory in given image file format.
- Parameters
-
[in] src - a pointer to pixels data of input image. [in] stride - a row size of input image in bytes. [in] width - a width of input image. [in] height - a height of input image. [in] format - a pixel format of input image. Supported pixel formats: SimdPixelFormatGray8, SimdPixelFormatBgr24, SimdPixelFormatBgra32, SimdPixelFormatRgb24. [in] file - a format of output image file. To auto choise format of output file set this parameter to SimdImageFileUndefined. [in] quality - a parameter of compression quality (if file format supports it). [in] path - a path to output image file.
- Returns
- result of the operation.
◆ SimdImageLoadFromMemory()
uint8_t * SimdImageLoadFromMemory | ( | const uint8_t * | data, |
size_t | size, | ||
size_t * | stride, | ||
size_t * | width, | ||
size_t * | height, | ||
SimdPixelFormatType * | format | ||
) |
Loads an image from memory buffer.
- Parameters
-
[in] data - a pointer to memory buffer with input image file. [in] size - a size of input image file in bytes. [out] stride - a pointer to row size of output image in bytes. [out] width - a pointer to width of output image. [out] height - a pointer to height of output image. [in,out] format - a pointer to pixel format of output image. Here you can set desired pixel format (it can be SimdPixelFormatGray8, SimdPixelFormatBgr24, SimdPixelFormatBgra32, SimdPixelFormatRgb24). Or set SimdPixelFormatNone and use pixel format of input image file.
- Returns
- a pointer to pixels data of output image. It has to be deleted after use by function SimdFree. On error it returns NULL.
◆ SimdImageLoadFormFile()
uint8_t * SimdImageLoadFormFile | ( | const char * | path, |
size_t * | stride, | ||
size_t * | width, | ||
size_t * | height, | ||
SimdPixelFormatType * | format | ||
) |
Loads an image from file.
- Parameters
-
[in] path - a path to input image file. [out] stride - a pointer to row size of output image in bytes. [out] width - a pointer to width of output image. [out] height - a pointer to height of output image. [in,out] format - a pointer to pixel format of output image. Here you can set desired pixel format (it can be SimdPixelFormatGray8, SimdPixelFormatBgr24, SimdPixelFormatBgra32, SimdPixelFormatRgb24). Or set SimdPixelFormatNone and use pixel format of input image file.
- Returns
- a pointer to pixels data of output image. It has to be deleted after use by function SimdFree. On error it returns NULL.