I’m trying something tricky and clever, but no idea which TOP to use to accomplish one step.

I want to create an image with each pixel’s value computed from the corresponding input image pixel. Purely a point operation. An example of what I want to do is

` output = 0.5 + 0.5* tanh( (input-0.5)/a ) `

where a is some constant like 0.25 I will want to use exp(), sqrt(), cos() and other functions of the sort all programming languages have.

Is there a TOP which allows arbitrary math including these functions? Or a way I could write the math I want in python or C++? I know I can write shaders with GLSL, but not sure this situation calls for that. If that’s the only way, though, I’d like to know so I can roll up my sleeves and get to work on it.