I feel like I'm missing something really simple. I've got the simplest possible CIKernel, it looks like this:
extern "C" float4 Simple(coreimage::sampler s) {
float2 current = s.coord();
float2 anotherCoord = float2(current.x + 1.0, current.y);
float4 sample = s.sample(anotherCoord); // s.sample(current) works fine
return sample;
}
It's (in my mind) incrementing the x position of the sampler by 1 and sampling the neighboring pixel. What I get in practice is a bunch of banded garbage (pictured below.) The sampler seems to be pretty much undocumented, so I have no idea whether I'm incrementing by the right amount to advance one pixel. The weird banding is still present if I clamp anootherCoord
to s.extent()
but it behaves normally if I sample s.coord()
unchanged. I'm trying to write a box blur that samples / averages neighboring pixels and am completely blocked by this. What am I missing?