The built-in functions defined in this section can only be used
with image memory objects. An image memory object can be accessed by
specific function calls that read from and/or write to specific locations in
the image.
Image memory objects that are being read by a kernel should be
declared with the accessQualifiers(3clc) qualifier.
write_image calls to image memory objects declared with the
accessQualifiers(3clc) qualifier will generate a compilation error.
Image memory objects that are being written to by a kernel should be
declared with the accessQualifiers(3clc) qualifier. read_image
calls to image memory objects declared with the
accessQualifiers(3clc) qualifier will generate a compilation error.
read_image and write_image calls to the same image memory
object in a kernel are not supported.
The read_image calls returns a four component
floating-point, integer or unsigned integer color value. The color values
returned by read_image are identified as x, y, z, w where x refers to
the red component, y refers to the green component, z refers to the blue
component and w refers to the alpha component.
Copyright © 2007-2011 The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to the
condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.
- 1.
- OpenCL Specification
page 292, section 6.12.14 - Image Read and Write
Functions