rifContextCreateImageFromMetalMemory

Creates a new image object with the defined format and MTLBuffer object associated with the context.

rif_int rifContextCreateImageFromMetalMemory(

rif_context context,

rif_image_desc const * image_desc,

void * mem,

rif_longlong size,

rif_image * out_image);

Parameters

Parameter

Input/Output

Description

context

input

A valid context object.

image_desc

input

A description of image size and image pixels format.

mem

input

An MTLBuffer object with image content.

size

input

A size of MTLBuffer object in bytes.

out_image

output

A pointer to the image object which will be created if the function performs successfully.

Return

Returns RIF_SUCCESS if the function is executed successfully, or RIF_ERROR code if a problem is encountered.

Errors

Possible error codes:

  • RIF_ERROR_INVALID_CONTEXT - context is not a valid context object.

  • RIF_ERROR_INVALID_PARAMETER - out_image or mem are nullptr.

  • RIF_ERROR_UNSUPPORTED_IMAGE_FORMAT - image format defined by image_desc is currently unsupported.