Display histogram L in Histogram equalizer

This commit is contained in:
Desmis
2015-09-14 13:14:28 +02:00
parent 48690e0fab
commit 270367c592
23 changed files with 106 additions and 40 deletions

View File

@@ -504,19 +504,31 @@ void CurveFactory::curveCL ( bool & clcutili, const std::vector<double>& clcurve
}
}
void CurveFactory::curveDehaContL ( bool & dehacontlutili, const std::vector<double>& dehaclcurvePoints, LUTf & dehaclCurve, int skip)
void CurveFactory::curveDehaContL ( bool & dehacontlutili, const std::vector<double>& dehaclcurvePoints, LUTf & dehaclCurve, int skip, LUTu & histogram, LUTu & outBeforeCurveHistogram)
{
bool needed = false;
DiagonalCurve* dCurve = NULL;
outBeforeCurveHistogram.clear();
bool histNeeded = false;
if (!dehaclcurvePoints.empty() && dehaclcurvePoints[0] != 0) {
dCurve = new DiagonalCurve (dehaclcurvePoints, CURVES_MIN_POLY_POINTS / skip);
if (outBeforeCurveHistogram) {
histNeeded = true;
}
if (dCurve && !dCurve->isIdentity()) {
needed = true;
dehacontlutili = true;
}
}
if (histNeeded) {
for (int i = 0; i < 32768; i++) {
double hval = CLIPD((double)i / 32767.0);
int hi = (int)(255.0 * hval);
outBeforeCurveHistogram[hi] += histogram[i] ;
}
}
fillCurveArray(dCurve, dehaclCurve, skip, needed);