histmatching: slightly improved match for the shadows part of the tone curve

This commit is contained in:
Alberto Griggio 2018-01-30 15:27:56 +01:00
parent ffbd97960f
commit c04150be35

View File

@ -86,12 +86,19 @@ void mappingToCurve(const std::vector<int> &mapping, std::vector<double> &curve)
curve.clear();
const int npoints = 8;
int idx = 1;
int idx = 15;
for (; idx < int(mapping.size()); ++idx) {
if (mapping[idx] >= idx) {
break;
}
}
if (idx == int(mapping.size())) {
for (idx = 1; idx < int(mapping.size()); ++idx) {
if (mapping[idx] >= idx) {
break;
}
}
}
int step = max(int(mapping.size())/npoints, 1);
auto coord = [](int v) -> double { return double(v)/255.0; };