5.7. Sampler Objects
5.7. 采样器对象
A sampler object describes how to sample an image when the image is read in the kernel. The built-in functions to read from an image in a kernel take a sampler as an argument. The sampler arguments to the image read function can be sampler objects created using OpenCL functions and passed as argument values to the kernel or can be samplers declared inside a kernel. In this section we discuss how sampler objects are created using OpenCL functions.
采样器对象描述在内核中读取图像时如何对图像进行采样。从内核中的图像读取的内置函数将采样器作为参数。图像读取函数的采样器参数可以是使用OpenCL函数创建并作为参数值传递给内核的采样器对象,也可以是内核内部声明的采样器。在本节中,我们将讨论如何使用OpenCL函数创建采样器对象。