Add CL=f(H) curve to Color and Light mask

This commit is contained in:
Desmis
2019-01-11 16:05:00 +01:00
parent a4325e4cc0
commit 9d1104517b
17 changed files with 181 additions and 23 deletions

View File

@@ -1663,6 +1663,55 @@ void LocCCmaskexpCurve::Set(const std::vector<double> &curvePoints)
}
}
LocHHmaskCurve::LocHHmaskCurve() : sum(0.f) {};
void LocHHmaskCurve::Reset()
{
lutLocHHmaskCurve.reset();
sum = 0.f;
}
void LocHHmaskCurve::Set(const Curve &pCurve)
{
if (pCurve.isIdentity()) {
Reset(); // raise this value if the quality suffers from this number of samples
return;
}
lutLocHHmaskCurve(501); // raise this value if the quality suffers from this number of samples
sum = 0.f;
for (int i = 0; i < 501; i++) {
lutLocHHmaskCurve[i] = pCurve.getVal(double (i) / 500.);
if (lutLocHHmaskCurve[i] < 0.02f) {
lutLocHHmaskCurve[i] = 0.02f;
}
sum += lutLocHHmaskCurve[i];
}
//lutLocHHCurve.dump("wav");
}
void LocHHmaskCurve::Set(const std::vector<double> &curvePoints)
{
// if (HHutili && !curvePoints.empty() && curvePoints[0] > FCT_Linear && curvePoints[0] < FCT_Unchanged) {
if (!curvePoints.empty() && curvePoints[0] > FCT_Linear && curvePoints[0] < FCT_Unchanged) {
FlatCurve ttcurve(curvePoints, false, CURVES_MIN_POLY_POINTS / 2);
ttcurve.setIdentityValue(0.);
Set(ttcurve);
} else {
Reset();
}
}
LocCCmaskCurve::LocCCmaskCurve() : sum(0.f) {};
void LocCCmaskCurve::Reset()