The following table describes the mapping of the number of channels of an image element to the appropriate components in the float4, int4 or unsigned int4 vector data type for the color values returned by read_image{f|i|ui}
or supplied to write_image{f|i|ui}
. The unmapped components will be set to 0.0
for red, green and blue channels and will be set to 1.0
for the alpha channel.
Channel Order float4, int4 or unsigned int4 components of channel data
CL_R (r, 0.0, 0.0, 1.0)
CL_A (0.0, 0.0, 0.0, a)
CL_RG (r, g, 0.0, 1.0)
CL_RA (r, 0.0, 0.0, a)
CL_RGB (r, g, b, 1.0)
CL_RGBA, CL_BGRA, CL_ARGB (r, g, b, a)
CL_INTENSITY (GRAY) (I, I, I, I)
CL_LUMINANCE (GRAY) (L, L, L, 1.0)