another small change to gamma2 igamma2

This commit is contained in:
Desmis
2018-04-05 07:56:22 +02:00
parent 6561636ee0
commit 7926e01f49
3 changed files with 11 additions and 5 deletions

View File

@@ -1080,8 +1080,11 @@ public:
static inline double gamma2 (double x) // g3 1+g4
{
// return x <= 0.003041 ? x * 12.92 : 1.055 * exp(log(x) / 2.39990) - 0.055;//calculate with calcgamma
return x <= 0.0031308 ? x * 12.92 : 1.055 * exp(log(x) / sRGBGammaCurve) - 0.055;
//return x <= 0.0031308 ? x * 12.92 : 1.055 * exp(log(x) / sRGBGammaCurve) - 0.055;//standard discontinuous
//very small differences between the 2
return x <= 0.003040 ? x * 12.92310 : 1.055 * exp(log(x) / sRGBGammaCurve) - 0.055;//continuous
// return x <= 0.003041 ? x * 12.92 : 1.055011 * exp(log(x) / sRGBGammaCurve) - 0.055011;//continuous
}
@@ -1094,8 +1097,11 @@ public:
static inline double igamma2 (double x) //g2
{
// return x <= 0.039289 ? x / 12.92 : exp(log((x + 0.055) / 1.055) * 2.39990);//calculate with calcgamma
return x <= 0.04045 ? x / 12.92 : exp(log((x + 0.055) / 1.055) * sRGBGammaCurve);
//very small differences between the 2
// return x <= 0.04045 ? x / 12.92 : exp(log((x + 0.055) / 1.055) * sRGBGammaCurve);//standard discontinuous
//very small differences between the 4
return x <= 0.039286 ? x / 12.92310 : exp(log((x + 0.055) / 1.055) * sRGBGammaCurve);//continuous
// return x <= 0.039293 ? x / 12.92 : exp(log((x + 0.055011) / 1.055011) * sRGBGammaCurve);//continuous
}