PhABResExportCommon_t.alloc_image()

A function exported by PhAB to allocate memory for an image

Synopsis:

PhImage_t* alloc_image  (
  PhImage_t *src );

Arguments:

src
The PhImage_t image for which you want to allocate memory.

Description:

This function is exported from PhAB in the PhABResExportCommon_t structure.

This function allocates a new Photon image, based on the src image. The src image is duplicated: the function allocates a new palette, a new alpha map, etc.

After an image is allocated with alloc_image(), you are free to modify it. If you need to allocate memory for the image palette, image data, or alpha map, use the alloc_mem() function.


Note: The newly allocated image will have the flags member set to Ph_RELEASE_IMAGE_ALL, meaning that all the fields of the new image that required allocating memory will be released when the image is released.

You should free the image with the PhAB exported free_image() function.

Returns:

A pointer to the image, or NULL when an error occurs.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

alloc_mem(), free_image(), PhABResExportCommon_t, PhImage_t