+ t = i * prescale;
+ d = ((contrastboost - 1) * t + 1);
+ if(d == 0)
+ t = 0; // we could just as well assume 1 here, depending on which side of the division by zero we want to be
+ else
+ t = contrastboost * t / d;
+ adjusted = (int) (255.0 * (pow(t, invgamma) * scale + base) + 0.5);