I'm studing opencl, in particular image processing.
is possible to create a sampler that interpolates values from two color: start and end color and the normalized coordinates from 0 to 1 in automatic mode?
I wish use bilinear interpolation.
I must create a texture with interpolated colors or is possible to set the bilinear interpolation in the creation of the sampler?
next, is possible use integer coordinates(for ex from 0px to 600px) and interpolation in the same mode?
on the gpu side, you can create the same sampler objects. Some examples:
__constant sampler_t the_sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST;
__constant sampler_t the_linear_sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_LINEAR;
__constant sampler_t the_normalized_sampler = CLK_NORMALIZED_COORDS_TRUE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST;
__constant sampler_t the_normalized_linear_sampler = CLK_NORMALIZED_COORDS_TRUE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_LINEAR;
normalized means access with texture coordinates, unnormalized is basically textureFetch from glsl. You can do the same clamping as in glsl, however you only have the linear/nearest options (so no mip mapping) as far as I know.