Jacko
Jacko

Reputation: 13205

opencl image with mirroring at border

Can I set up an opencl image so that coordinate access past the boundary of the image will return the mirror image?

For example, if image is of dimensions width by height, then

read_floati(width, 0) 

will return

read_floati(width-2,0)

Upvotes: 0

Views: 321

Answers (1)

Dithermaster
Dithermaster

Reputation: 6343

Yes. Read section 6.11.13 of the OpenCL specification. OpenCL images are read using (for example) read_imagef function and that function takes a sampler which can be set up for mirroring using CLK_ADDRESS_MIRRORED_REPEAT.

Upvotes: 1

Related Questions