Unification if sRGB gamma value
see issue 856
This commit is contained in:
@@ -126,6 +126,9 @@ class CurveFactory {
|
||||
|
||||
|
||||
public:
|
||||
const static double sRGBGamma; // standard average gamma
|
||||
const static double sRGBGammaCurve; // 2.4 in the curve
|
||||
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
// accurately determine value from integer array with float as index
|
||||
@@ -154,10 +157,10 @@ class CurveFactory {
|
||||
|
||||
// standard srgb gamma and its inverse
|
||||
static inline double gamma2 (double x) {
|
||||
return x <= 0.00304 ? x*12.92 : 1.055*exp(log(x)/2.4)-0.055;
|
||||
return x <= 0.00304 ? x*12.92 : 1.055*exp(log(x)/sRGBGammaCurve)-0.055;
|
||||
}
|
||||
static inline double igamma2 (double x) {
|
||||
return x <= 0.03928 ? x/12.92 : exp(log((x+0.055)/1.055)*2.4);
|
||||
return x <= 0.03928 ? x/12.92 : exp(log((x+0.055)/1.055)*sRGBGammaCurve);
|
||||
}
|
||||
// gamma function with adjustable parameters
|
||||
static inline double gamma (double x, double gamma, double start, double slope, double mul, double add){
|
||||
|
Reference in New Issue
Block a user