cl_int
clGetSupportedImageFormats
(
| cl_context context, |
cl_mem_flags flags, | |
cl_mem_object_type image_type, | |
cl_uint num_entries, | |
cl_image_format *image_formats, | |
cl_uint *num_image_formats) |
context
A valid OpenCL context on which the image object(s) will be created.
flags
A bit-field that is used to specify allocation and usage information about the image
memory object being created and is described in the List of supported cl_mem_flags
values for clCreateBuffer
image_type
Describes the image type and must be either CL_MEM_OBJECT_IMAGE2D
or
CL_MEM_OBJECT_IMAGE3D
.
num_entries
Specifies the number of entries that can be returned in the memory location given by
image_formats
.
image_formats
A pointer to a memory location where the list of supported image formats are
returned. Each entry describes a cl_image_format structure supported by the OpenCL
implementation. If image_formats
is NULL, it is ignored.
num_image_formats
The actual number of supported image formats for a specific context
and
values specified by flags
. If num_image_formats
is NULL, it is ignored.
clGetSupportedImageFormats
can be used to get the list of image formats supported by an OpenCL implementation when the following information about an image memory object is specified:
The minimum list of supported image formats is given by the table below:
image_num_channels |
image_channel_order |
image_channel_data_type |
---|---|---|
4 | CL_RGBA |
|
4 | CL_BGRA |
|
Returns CL_SUCCESS if the function is executed successfully,
returns CL_INVALID_CONTEXT if context
is not a valid context, returns CL_INVALID_VALUE
if flags
or image_type
are not valid, or if num_entries
is 0 and image_formats
is not NULL.