Display histogram L in Histogram equalizer
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user