A high-performance general-purpose compute library

Load an image from memory which is stored as a FreeImage stream (FIMEMORY). More...

Functions

AFAPI array loadImageMem (const void *ptr)
 C++ Interface for loading an image from memory. More...
 
AFAPI af_err af_load_image_memory (af_array *out, const void *ptr)
 C Interface for loading an image from memory. More...
 

Detailed Description

Load an image from memory which is stored as a FreeImage stream (FIMEMORY).

Supported formats include JPG, PNG, PPM and other formats supported by freeimage

Function Documentation

◆ af_load_image_memory()

AFAPI af_err af_load_image_memory ( af_array out,
const void *  ptr 
)

C Interface for loading an image from memory.

Parameters
[out]outis an array that will contain the image
[in]ptris the FIMEMORY pointer created by either saveImageMem function, the af_save_image_memory function, or the FreeImage_OpenMemory API.
Returns
AF_SUCCESS if successful

◆ loadImageMem()

AFAPI array loadImageMem ( const void *  ptr)

C++ Interface for loading an image from memory.

Parameters
[in]ptris the location of the image data in memory. This is the pointer created by saveImage.
Returns
image loaded as af::array()
Note
The pointer used is a void* cast of the FreeImage type FIMEMORY which is created using the FreeImage_OpenMemory API. If the user is opening a FreeImage stream external to ArrayFire, that pointer can be passed to this function as well.