merge with dev

This commit is contained in:
Desmis
2019-10-12 08:50:16 +02:00
59 changed files with 3161 additions and 2563 deletions

View File

@@ -210,6 +210,13 @@ public:
return r * workingspace[1][0] + g * workingspace[1][1] + b * workingspace[1][2];
}
#ifdef __SSE2__
static vfloat rgbLuminance(vfloat r, vfloat g, vfloat b, const vfloat workingspace[3])
{
return r * workingspace[0] + g * workingspace[1] + b * workingspace[2];
}
#endif
/**
* @brief Convert red/green/blue to L*a*b
* @brief Convert red/green/blue to hue/saturation/luminance
@@ -1064,12 +1071,11 @@ public:
*/
static inline double gamma2 (double x) // g3 1+g4
{
// return x <= 0.003041 ? x * 12.92310 : 1.055 * exp(log(x) / 2.39990) - 0.055;//calculate with calcgamma
// return x <= 0.003041 ? x * 12.92310 : 1.055 * exp(log(x) / 2.39990) - 0.055;//calculate with calcgamma
//return x <= 0.0031308 ? x * 12.92310 : 1.055 * exp(log(x) / sRGBGammaCurve) - 0.055;//standard discontinuous
//very small differences between the 2
//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.92310 : 1.055011 * exp(log(x) / sRGBGammaCurve) - 0.055011;//continuous
// return x <= 0.003041 ? x * 12.92310 : 1.055011 * exp(log(x) / sRGBGammaCurve) - 0.055011;//continuous
}
@@ -1081,12 +1087,11 @@ public:
*/
static inline double igamma2 (double x) //g2
{
// return x <= 0.039289 ? x / 12.92310 : exp(log((x + 0.055) / 1.055) * 2.39990);//calculate with calcgamma
// return x <= 0.04045 ? x / 12.92310 : exp(log((x + 0.055) / 1.055) * sRGBGammaCurve);//standard discontinuous
//very small differences between the 4
// return x <= 0.039289 ? x / 12.92310 : exp(log((x + 0.055) / 1.055) * 2.39990);//calculate with calcgamma
// return x <= 0.04045 ? x / 12.92310 : 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.92310 : exp(log((x + 0.055011) / 1.055011) * sRGBGammaCurve);//continuous
// return x <= 0.039293 ? x / 12.92310 : exp(log((x + 0.055011) / 1.055011) * sRGBGammaCurve);//continuous
}