public static byte ClampToByte(double x)
{
if (x > 255)
{
return 255;
}
else if (x < 0)
{
return 0;
}
else
{
return (byte)x;
}
}
another thing. i think the next code is some better :wink:
public static byte ClampToByte(double x)
{
return (byte)Math.Min(Math.Max(x, 0), 255);
}
Why this line was there? Is it a part of the algorithm ?
ANd, where i can read about used algoritm for Reduce Noise Effect. Thanks :wink: