Image samplers#
See also
SYCL Specification Section 4.7.8
sycl::image_sampler
#
namespace sycl {
struct image_sampler {
addressing_mode addressing;
coordinate_normalization_mode coordinate;
filtering_mode filtering;
};
} // namespace sycl
The sycl::image_sampler
struct contains a configuration
for sampling a sycl::sampled_image.
The members of this struct are defined by the following tables.
sycl::addressing_mode
#
namespace sycl {
enum class addressing_mode : /* unspecified */ {
mirrored_repeat,
repeat,
clamp_to_edge,
clamp,
none
};
} // namespace sycl
Addressing mode |
Description |
---|---|
|
Out of range coordinates will be flipped at every integer junction. This addressing mode can only be used with normalized coordinates. If normalized coordinates are not used, this addressing mode may generate image coordinates that are undefined. |
|
Out of range image coordinates are wrapped to the valid range. This addressing mode can only be used with normalized coordinates. If normalized coordinates are not used, this addressing mode may generate image coordinates that are undefined. |
|
Out of range image coordinates are clamped to the extent. |
|
Out of range image coordinates will return a border color. |
|
For this addressing mode the programmer guarantees that the image coordinates used to sample elements of the image refer to a location inside the image; otherwise the results are undefined. |
sycl::filtering_mode
#
namespace sycl {
enum class filtering_mode : /* unspecified */ {
nearest,
linear
};
} //namespace sycl
Filtering mode |
Description |
---|---|
|
Chooses a color of nearest pixel. |
|
Performs a linear sampling of adjacent pixels. |
sycl::coordinate_normalization_mode
#
namespace sycl {
enum class coordinate_normalization_mode : /* unspecified */ {
normalized,
unnormalized
};
} // namespace sycl
Coordinate normalization mode |
Description |
---|---|
|
Normalizes image coordinates. |
|
Does not normalize image coordinates. |