Background histogram exposure

This commit is contained in:
jdc
2013-11-20 14:54:58 +01:00
parent f2e90df722
commit 43869ed883
5 changed files with 13 additions and 11 deletions

View File

@@ -291,7 +291,7 @@ void CurveFactory::curveLightBrightColor (
void CurveFactory::curveBW (
procparams::ChannelMixerbwParams::eTCModeId curveModeb, const std::vector<double>& curvePointsbw,
procparams::ChannelMixerbwParams::eTCModeId curveModeb2, const std::vector<double>& curvePointsbw2,
LUTu & histogram, LUTu & histogramCropped, LUTu & outBeforeCCurveHistogram,//for Luminance
LUTu & histogrambw, LUTu & histogramCropped, LUTu & outBeforeCCurveHistogrambw,//for Luminance
ChMixerbw & customToneCurvebw1,
ChMixerbw & customToneCurvebw2,
int skip)
@@ -304,7 +304,7 @@ void CurveFactory::curveBW (
dcurve[i] = CLIPD(val);
}
outBeforeCCurveHistogram.clear();
outBeforeCCurveHistogrambw.clear();
bool histNeeded = false;
DiagonalCurve* tcurve = NULL;
@@ -312,7 +312,7 @@ void CurveFactory::curveBW (
if (!curvePointsbw2.empty() && curvePointsbw2[0]>DCT_Linear && curvePointsbw2[0]<DCT_Unchanged) {
tcurve = new DiagonalCurve (curvePointsbw2, CURVES_MIN_POLY_POINTS/skip);
if (outBeforeCCurveHistogram /*&& histogramCropped*/)
if (outBeforeCCurveHistogrambw /*&& histogramCropped*/)
histNeeded = true;
}
@@ -331,7 +331,7 @@ void CurveFactory::curveBW (
if (!curvePointsbw.empty() && curvePointsbw[0]>DCT_Linear && curvePointsbw[0]<DCT_Unchanged) {
tcurve = new DiagonalCurve (curvePointsbw, CURVES_MIN_POLY_POINTS/skip);
if (outBeforeCCurveHistogram /*&& histogramCropped*/)
if (outBeforeCCurveHistogrambw /*&& histogramCropped*/)
histNeeded = true;
}
@@ -353,7 +353,7 @@ void CurveFactory::curveBW (
if (histNeeded) {
float hval = dcurve[i];
int hi = (int)(255.0*CLIPD(hval));
outBeforeCCurveHistogram[hi] += histogram[i] ;
outBeforeCCurveHistogrambw[hi] += histogrambw[i] ;
}
}

View File

@@ -190,7 +190,7 @@ class CurveFactory {
static void curveBW (
procparams::ChannelMixerbwParams::eTCModeId curveModeb, const std::vector<double>& curvePointsbw,
procparams::ChannelMixerbwParams::eTCModeId curveModeb2, const std::vector<double>& curvePointsbw2,
LUTu & histogram, LUTu & histogramCropped, LUTu & outBeforeCCurveHistogram,
LUTu & histogrambw, LUTu & histogramCropped, LUTu & outBeforeCCurveHistogrambw,
ChMixerbw & customToneCurvebw1,
ChMixerbw & customToneCurvebw2,
int skip);

View File

@@ -44,7 +44,7 @@ ImProcCoordinator::ImProcCoordinator ()
lhskcurve(65536,0),
clcurve(65536,0),
vhist16(65536),
vhist16(65536),vhist16bw(65536),
lhist16(65536), lhist16Cropped(65536),
lhist16CAM(65536), lhist16CroppedCAM(65536),
lhist16CCAM(65536), lhist16CroppedCCAM(65536),
@@ -57,6 +57,7 @@ ImProcCoordinator::ImProcCoordinator ()
histBlue(256), histBlueRaw(256),
histLuma(256), histChroma(256),
histToneCurve(256),
histToneCurveBW(256),
histLCurve(256),
histCCurve(256),
histCLurve(256),
@@ -298,7 +299,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) {
CurveFactory::RGBCurve (params.rgbCurves.bcurve, bCurve, scale==1 ? 1 : 1);
CurveFactory::curveBW (params.chmixerbw.curveMode, params.chmixerbw.curve, params.chmixerbw.curveMode2, params.chmixerbw.curve2,
vhist16, histCropped, histToneCurve, customToneCurvebw1, customToneCurvebw2,scale==1 ? 1 : 1);
vhist16bw, histCropped, histToneCurveBW, customToneCurvebw1, customToneCurvebw2,scale==1 ? 1 : 1);
//initialize rrm bbm ggm different from zero to avoid black screen in somme cases
double rrm=33.;

View File

@@ -88,7 +88,7 @@ class ImProcCoordinator : public StagedImageProcessor {
LUTf lhskcurve;
LUTf clcurve;
LUTu vhist16;
LUTu vhist16,vhist16bw;
LUTu lhist16,lhist16Cropped;
LUTu lhist16CAM,lhist16CroppedCAM;
LUTu lhist16CCAM,lhist16CroppedCCAM;
@@ -99,7 +99,7 @@ class ImProcCoordinator : public StagedImageProcessor {
LUTu histRed, histRedRaw;
LUTu histGreen, histGreenRaw;
LUTu histBlue, histBlueRaw;
LUTu histLuma, histToneCurve, histLCurve, histCCurve, histCLurve, histLLCurve, histLCAM, histCCAM, histClad, bcabhist, histChroma;
LUTu histLuma, histToneCurve, histToneCurveBW, histLCurve, histCCurve, histCLurve, histLLCurve, histLCAM, histCCAM, histClad, bcabhist, histChroma;
LUTf rCurve;
LUTf gCurve;

View File

@@ -2847,9 +2847,10 @@ void ImProcFunctions::chromiLuminanceCurve (int pW, LabImage* lold, LabImage* ln
val = (double)i / 47999.0;
dCcurve[i] = CLIPD(val);
}
for (int i=0; i<65535; i++) { //# 32768*1.414 approximation maxi for chroma
for (int i=0; i<65535; i++) { // a
val = (double)i / 65534.0;
dLcurve[i] = CLIPD(val);
}
hist16Clad.clear();