2
<!-- core spec p. 288, section 6.12.14 --> The built-in functions defined in this section
3
can only be used with image memory objects. An image memory object can be accessed by
4
specific function calls that read from and/or write to specific locations in the image.
7
<!-- Note: use <function> instead of <citerefentry> for the read and write functions in the text below. -->
10
Image memory objects that are being read by a kernel should be declared with the <citerefentry
11
href="accessQualifiers"><refentrytitle>__read_only</refentrytitle></citerefentry>
12
qualifier. <function>write_image</function> calls to image memory objects declared with the
13
<citerefentry href="accessQualifiers"><refentrytitle>__read_only</refentrytitle></citerefentry>
14
qualifier will generate a compilation error. Image memory objects that
15
are being written to by a kernel should be declared with the <citerefentry
16
href="accessQualifiers"><refentrytitle>__write_only</refentrytitle></citerefentry> qualifier.
17
<function>read_image</function> calls to image memory objects declared with the <citerefentry
18
href="accessQualifiers"><refentrytitle>__write_only</refentrytitle></citerefentry>
19
qualifier will generate a compilation error. <function>read_image</function> and
20
<function>write_image</function> calls to the same image memory object in a kernel are
25
The <function>read_image</function> calls returns a four component floating-point, integer or
26
unsigned integer color value. The color values returned by <function>read_image</function>
27
are identified as <code>x, y, z, w</code> where <code>x</code> refers to the red component,
28
<code>y</code> refers to the green component, <code>z</code> refers to the blue component
29
and <code>w</code> refers to the alpha component.