I found this function somewhere, quite a while ago. I do not exactly know what it is doing. I use it to manipulate a simplex noise output (with greyscale values between 0 and 255), but would like to understand it better.
int ExponentFilter(int value, int cover, double sharpness)
{
int c = value - (255 - cover);
if(c < 0)
c = 0;
return 255 - ((std::pow(sharpness,c)) * 255);
}
I use it like:
ExponentFilter(n,140,0.98f)
Where n is my value between 0 and 255.