Creation of the ICCProfileCreator

This commit is contained in:
Hombre
2018-06-25 00:43:11 +02:00
parent e2dc8ea2c3
commit fb0c95969b
35 changed files with 1330 additions and 1799 deletions

View File

@@ -1074,34 +1074,34 @@ public:
/**
* @brief sRGB gamma
* See also calcGamma above with the following values: pwr=2.399 ts=12.92 mode=0.003041 imax=0.055
* See also calcGamma above with the following values: pwr=2.399 ts=12.92310 mode=0.003041 imax=0.055
* @param x red, green or blue channel's value [0 ; 1]
* @return the gamma modified's value [0 ; 1]
*/
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;//standard discontinuous
// 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
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
// return x <= 0.003041 ? x * 12.92310 : 1.055011 * exp(log(x) / sRGBGammaCurve) - 0.055011;//continuous
}
/**
* @brief Inverse sRGB gamma
* See also calcGamma above with the following values: pwr=2.3999 ts=12.92 mode=0.003041 imax=0.055
* See also calcGamma above with the following values: pwr=2.3999 ts=12.92310 mode=0.003041 imax=0.055
* @param x red, green or blue channel's value [0 ; 1]
* @return the inverse gamma modified's value [0 ; 1]
*/
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);//standard discontinuous
// 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.92 : 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
}