Very inefficient implementation of direcional filter (on CPU, in C#).