- Main Page
- Tutorials
- Functions
- Release Notes
- Examples

Functions
loadImageMem
Complete List of ArrayFire Functions ArrayFire Functions by Category » Input and Output functions » | Reading and writing images

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

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

C Interface for loading an image from memory.

Parameters

  [out] | out | is an array that will contain the image
  [in] | ptr | is the FIMEMORY pointer created by either saveImageMem function, the af_save_image_memory function, or the FreeImage_OpenMemory API.

Returns
  AF_SUCCESS if successful

AFAPI array af::loadImageMem | ( | const void * | ptr | ) |

C++ Interface for loading an image from memory.

Parameters

  [in] | ptr | is 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.