Esempio n. 1
0
 /// <summary>
 /// Implements the log-contrast correction.
 /// </summary>
 /// <param name="x">Brightness</param>
 /// <param name="power">Power</param>
 /// <returns>float precision floating point number</returns>
 public static float LogContrast(float x, float power)
 {
     if (x <= 0.5)
     {
         return((float)Intensity.LogPow(x * 2, power) * 0.5f);
     }
     return(1.0f - (float)Intensity.LogPow((1 - x) * 2, power) * 0.5f);
 }
Esempio n. 2
0
 /// <summary>
 /// Implements the logarithmic stretch algorithm.
 /// </summary>
 /// <param name="x">Brightness</param>
 /// <param name="mu">Filter brightness</param>
 /// <param name="s">Shadows</param>
 /// <param name="l">Highlights</param>
 /// <returns>float precision floating point number</returns>
 public static float LogStretch(float x, float mu, float s, float l)
 {
     return(Intensity.LogPow(x, Maths.Range(Intensity.log05 / (float)Math.Log(mu), s, l)));
 }