Bad behavior with blackwhite and gamma - after change avoid color shift - issue 7159 (#7165)

* Bad behavior with blackwhite and gamma - after change avoid color shift

* Change with code Lawrence37 - chprov1 sincosval
This commit is contained in:
Desmis 2024-08-13 07:43:17 +02:00 committed by GitHub
parent b80c694a5f
commit 873729fe0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4778,13 +4778,22 @@ void ImProcFunctions::chromiLuminanceCurve(PipetteBuffer *pipetteBuffer, int pW,
histLCurve[Lprov1 * histLFactor]++;
}
Chprov1 = sqrt(SQR(atmp) + SQR(btmp)) / 327.68f;
// 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 (bwToning) {
atmp -= lold->a[i][j];
btmp -= lold->b[i][j];
Chprov1 = sqrt(SQR(atmp) + SQR(btmp)) / 327.68f;
if (Chprov1 == 0.f) {
sincosval.x = 0.f;
sincosval.y = 1.f;
} else {
sincosval.x = btmp / (327.68f * Chprov1);
sincosval.y = atmp / (327.68f * Chprov1);
}
} else {
Chprov1 = sqrt(SQR(atmp) + SQR(btmp)) / 327.68f;
}
lnew->L[i][j] = Lprov1 * 327.68f;