Enhancement: BW toning in Lab (see issue 1424)

This commit is contained in:
Michael Ezra
2012-06-17 15:48:21 -04:00
parent c312545a5e
commit cbe233c8cf
10 changed files with 71 additions and 10 deletions

View File

@@ -466,12 +466,20 @@ void ImProcFunctions::chrominanceCurve (LabImage* lold, LabImage* lnew, LUTf & a
float atmp = acurve[lold->a[i][j]+32768.0f]-32768.0f;
float btmp = bcurve[lold->b[i][j]+32768.0f]-32768.0f;
if (params->labCurve.saturation) {
// modulation of a and b curves with saturation
if (params->labCurve.saturation!=0 && !params->labCurve.bwtoning) {
float chroma = sqrt(SQR(atmp)+SQR(btmp)+0.001);
float satfactor = (satcurve[chroma+32768.0f]-32768.0f)/chroma;
atmp *= satfactor;
btmp *= satfactor;
}
// labCurve.bwtoning option allows to decouple modulation of a & b curves by saturation
// with bwtoning enabled the net effect of a & b curves is visible
if (params->labCurve.bwtoning) {
atmp -= lold->a[i][j];
btmp -= lold->b[i][j];
}
if (params->labCurve.avoidclip) {
//Luv limiter