rprContextCreateImageFromFile

Creates new image from file data.

Images are used as HDRI maps or inputs for various shading system nodes. The following image formats are supported: PNG, JPG, TGA, BMP, TIFF, TX(0-mip), HDR, EXR.

rpr_status rprContextCreateImageFromFile(

rpr_context context,

rpr_char const * path,

rpr_image * out_image);

Parameters

Parameter

Description

context

The current rendering context.

path

NULL terminated path to an image file (can be relative). For UNICODE, supports UTF-8 encoding.

out_image

A pointer to the created image object.

Notes

Resolution has no fixed limit.

Output

A pointer to an image object.

Return

Returns RPR_SUCCESS in case of success, or RPR_ERROR code if a problem was encountered.

To learn how to handle errors in AMD Radeon ProRender SDK, see Error Handling.

Errors

Possible error codes:

  • RPR_ERROR_OUT_OF_SYSTEM_MEMORY

  • RPR_ERROR_OUT_OF_VIDEO_MEMORY

  • RPR_ERROR_UNSUPPORTED_IMAGE_FORMAT

  • RPR_ERROR_INVALID_PARAMETER

  • RPR_ERROR_IO_ERROR