Fixed bug from ff2000

This commit is contained in:
Desmis 2019-06-26 12:34:57 +02:00
parent 5a59c90b62
commit 9a46885cfe
6 changed files with 62 additions and 55 deletions

View File

@ -1125,7 +1125,7 @@ void CurveFactory::complexCurvelocal(double ecomp, double black, double hlcompr,
int k = avg * 32768; int k = avg * 32768;
avg = lightCurveloc[k]; avg = lightCurveloc[k];
// printf("avg=%f lumaref=%f\n", avg, lumare/100.f); printf("avg=%f lumaref=%f\n", avg, lumare/100.f);
std::vector<double> contrastcurvePoints; std::vector<double> contrastcurvePoints;
bool lumm = true; bool lumm = true;

View File

@ -911,7 +911,7 @@ void Crop::update(int todo)
bool lcmasretiutili = parent->lcmasretiutili; bool lcmasretiutili = parent->lcmasretiutili;
bool llmasretiutili = parent->llmasretiutili; bool llmasretiutili = parent->llmasretiutili;
float avg = parent->avg; // float avg = parent->avg;
LUTu dummy; LUTu dummy;
bool needslocal = params.locallab.enabled; bool needslocal = params.locallab.enabled;
LocretigainCurve locRETgainCurve; LocretigainCurve locRETgainCurve;
@ -976,6 +976,7 @@ void Crop::update(int todo)
double cont = params.locallab.spots.at(sp).contrast; double cont = params.locallab.spots.at(sp).contrast;
double huere, chromare, lumare, huerefblu, chromarefblu, lumarefblu, sobelre; double huere, chromare, lumare, huerefblu, chromarefblu, lumarefblu, sobelre;
float avge;
huerefblu = parent->huerefblurs[sp]; huerefblu = parent->huerefblurs[sp];
chromarefblu = parent->chromarefblurs[sp]; chromarefblu = parent->chromarefblurs[sp];
lumarefblu = parent->lumarefblurs[sp]; lumarefblu = parent->lumarefblurs[sp];
@ -983,8 +984,9 @@ void Crop::update(int todo)
chromare = parent->chromarefs[sp]; chromare = parent->chromarefs[sp];
lumare = parent->lumarefs[sp]; lumare = parent->lumarefs[sp];
sobelre = parent->sobelrefs[sp]; sobelre = parent->sobelrefs[sp];
avge = parent->avgs[sp];
CurveFactory::complexCurvelocal(ecomp, black / 65535., hlcompr, hlcomprthresh, shcompr, br, cont, lumare, CurveFactory::complexCurvelocal(ecomp, black / 65535., hlcompr, hlcomprthresh, shcompr, br, cont, lumare,
hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, avg, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, avge,
sca); sca);
// Locallab mask are only shown for selected spot // Locallab mask are only shown for selected spot
if (sp == params.locallab.selspot) { if (sp == params.locallab.selspot) {
@ -1003,6 +1005,7 @@ void Crop::update(int todo)
LHutili, HHutili, cclocalcurve2, localcutili, localexutili, exlocalcurve2, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, 0, 0, 0, 0, 0); LHutili, HHutili, cclocalcurve2, localcutili, localexutili, exlocalcurve2, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, 0, 0, 0, 0, 0);
} }
lllocalcurve2.clear(); lllocalcurve2.clear();
lightCurveloc2.clear();
cclocalcurve2.clear(); cclocalcurve2.clear();
exlocalcurve2.clear(); exlocalcurve2.clear();
hltonecurveloc2.clear(); hltonecurveloc2.clear();

View File

@ -192,6 +192,7 @@ ImProcCoordinator::ImProcCoordinator() :
chromarefs(500, -100000.f), chromarefs(500, -100000.f),
lumarefs(500, -100000.f), lumarefs(500, -100000.f),
sobelrefs(500, -100000.f), sobelrefs(500, -100000.f),
avgs(500, -100000.f),
huer(0), huer(0),
huerblu(0), huerblu(0),
chromarblu(0), chromarblu(0),
@ -199,13 +200,13 @@ ImProcCoordinator::ImProcCoordinator() :
chromar(0), chromar(0),
lumar(0), lumar(0),
sobeler(0), sobeler(0),
avg(0),
lastspotdup(false), lastspotdup(false),
locallColorMask(0), locallColorMask(0),
locallExpMask(0), locallExpMask(0),
locallSHMask(0), locallSHMask(0),
locallcbMask(0), locallcbMask(0),
locallretiMask(0), locallretiMask(0),
avg(0),
retistrsav(nullptr) retistrsav(nullptr)
{ {
@ -865,6 +866,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
float **shbuffer = nullptr; float **shbuffer = nullptr;
int sca = 1; int sca = 1;
double huere, chromare, lumare, huerefblu, chromarefblu, lumarefblu, sobelre; double huere, chromare, lumare, huerefblu, chromarefblu, lumarefblu, sobelre;
float avge;
for (int sp = 0; sp < params->locallab.nbspot && sp < (int)params->locallab.spots.size(); sp++) { for (int sp = 0; sp < params->locallab.nbspot && sp < (int)params->locallab.spots.size(); sp++) {
// Set local curves of current spot to LUT // Set local curves of current spot to LUT
@ -919,9 +921,9 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
// Reference parameters computation // Reference parameters computation
if (params->locallab.spots.at(sp).spotMethod == "exc") { if (params->locallab.spots.at(sp).spotMethod == "exc") {
ipf.calc_ref(sp, reserv, reserv, 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avg); ipf.calc_ref(sp, reserv, reserv, 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge);
} else { } else {
ipf.calc_ref(sp, nprevl, nprevl, 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avg); ipf.calc_ref(sp, nprevl, nprevl, 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge);
} }
// printf("improc avg=%f\n", avg); // printf("improc avg=%f\n", avg);
@ -932,6 +934,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
chromar = chromarefs[sp] = chromare; chromar = chromarefs[sp] = chromare;
lumar = lumarefs[sp] = lumare ; lumar = lumarefs[sp] = lumare ;
sobeler = sobelrefs[sp] = sobelre; sobeler = sobelrefs[sp] = sobelre;
avg = avgs[sp] = avge;
CurveFactory::complexCurvelocal(ecomp, black / 65535., hlcompr, hlcomprthresh, shcompr, br, cont, lumar, CurveFactory::complexCurvelocal(ecomp, black / 65535., hlcompr, hlcomprthresh, shcompr, br, cont, lumar,
hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, avg, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, avg,
sca); sca);
@ -969,6 +972,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
} }
lllocalcurve.clear(); lllocalcurve.clear();
lightCurveloc.clear();
cclocalcurve.clear(); cclocalcurve.clear();
exlocalcurve.clear(); exlocalcurve.clear();
hltonecurveloc.clear(); hltonecurveloc.clear();

View File

@ -279,14 +279,15 @@ protected:
LUTf chromarefs; LUTf chromarefs;
LUTf lumarefs; LUTf lumarefs;
LUTf sobelrefs; LUTf sobelrefs;
LUTf avgs;
double huer, huerblu, chromarblu, lumarblu, chromar, lumar, sobeler; double huer, huerblu, chromarblu, lumarblu, chromar, lumar, sobeler;
float avg;
bool lastspotdup; bool lastspotdup;
int locallColorMask; int locallColorMask;
int locallExpMask; int locallExpMask;
int locallSHMask; int locallSHMask;
int locallcbMask; int locallcbMask;
int locallretiMask; int locallretiMask;
float avg;
public: public:

View File

@ -3215,23 +3215,23 @@ ProcParams::ProcParams()
void ProcParams::setDefaults() void ProcParams::setDefaults()
{ {
toneCurve = {}; toneCurve = ToneCurveParams();
labCurve = {}; labCurve = LCurveParams();
rgbCurves = {}; rgbCurves = RGBCurvesParams();
localContrast = {}; localContrast = LocalContrastParams();
colorToning = {}; colorToning = ColorToningParams();
sharpenEdge = {}; sharpenEdge = SharpenEdgeParams();
sharpenMicro = {}; sharpenMicro = SharpenMicroParams();
sharpening = {}; sharpening = SharpeningParams();
prsharpening = {}; prsharpening = SharpeningParams();
prsharpening.contrast = 15.0; prsharpening.contrast = 15.0;
prsharpening.method = "rld"; prsharpening.method = "rld";
prsharpening.deconvamount = 100; prsharpening.deconvamount = 100;
@ -3239,72 +3239,71 @@ void ProcParams::setDefaults()
prsharpening.deconviter = 100; prsharpening.deconviter = 100;
prsharpening.deconvdamping = 0; prsharpening.deconvdamping = 0;
vibrance = {}; vibrance = VibranceParams();
wb = {}; wb = WBParams();
colorappearance = {}; colorappearance = ColorAppearanceParams();
defringe = {}; defringe = DefringeParams();
impulseDenoise = {}; impulseDenoise = ImpulseDenoiseParams();
dirpyrDenoise = {}; dirpyrDenoise = DirPyrDenoiseParams();
epd = {}; epd = EPDParams();
fattal = {}; fattal = FattalToneMappingParams();
sh = {}; sh = SHParams();
crop = {}; crop = CropParams();
coarse = {}; coarse = CoarseTransformParams();
commonTrans = {}; commonTrans = CommonTransformParams();
rotate = {}; rotate = RotateParams();
distortion = {}; distortion = DistortionParams();
lensProf = {}; lensProf = LensProfParams();
perspective = {}; perspective = PerspectiveParams();
gradient = {}; gradient = GradientParams();
pcvignette = {}; locallab = LocallabParams();
locallab = {}; pcvignette = PCVignetteParams();
vignetting = VignettingParams();
vignetting = {}; chmixer = ChannelMixerParams();
chmixer = {}; blackwhite = BlackWhiteParams();
blackwhite = {}; cacorrection = CACorrParams();
cacorrection = {}; resize = ResizeParams();
resize = {}; icm = ColorManagementParams();
icm = {}; wavelet = WaveletParams();
wavelet = {}; dirpyrequalizer = DirPyrEqualizerParams();
dirpyrequalizer = {}; hsvequalizer = HSVEqualizerParams();
hsvequalizer = {}; filmSimulation = FilmSimulationParams();
filmSimulation = {}; softlight = SoftLightParams();
softlight = {}; dehaze = DehazeParams();
dehaze = {}; raw = RAWParams();
raw = {}; metadata = MetaDataParams();
metadata = {};
exif.clear(); exif.clear();
iptc.clear(); iptc.clear();

View File

@ -1174,14 +1174,14 @@ private:
// Reference parameters computation // Reference parameters computation
double huere, chromare, lumare, huerefblu, chromarefblu, lumarefblu, sobelre; double huere, chromare, lumare, huerefblu, chromarefblu, lumarefblu, sobelre;
float avg = 0.f; float avge;
if (params.locallab.spots.at(sp).spotMethod == "exc") { if (params.locallab.spots.at(sp).spotMethod == "exc") {
ipf.calc_ref(sp, reservView, reservView, 0, 0, fw, fh, 1, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avg); ipf.calc_ref(sp, reservView, reservView, 0, 0, fw, fh, 1, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge);
} else { } else {
ipf.calc_ref(sp, labView, labView, 0, 0, fw, fh, 1, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avg); ipf.calc_ref(sp, labView, labView, 0, 0, fw, fh, 1, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge);
} }
CurveFactory::complexCurvelocal(ecomp, black / 65535., hlcompr, hlcomprthresh, shcompr, br, cont, lumare, CurveFactory::complexCurvelocal(ecomp, black / 65535., hlcompr, hlcomprthresh, shcompr, br, cont, lumare,
hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, avg, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, avge,
1); 1);
// No Locallab mask is shown in exported picture // No Locallab mask is shown in exported picture
@ -1199,7 +1199,7 @@ private:
hltonecurveloc.clear(); hltonecurveloc.clear();
shtonecurveloc.clear(); shtonecurveloc.clear();
tonecurveloc.clear(); tonecurveloc.clear();
lightCurveloc.clear();
if (params.locallab.spots.at(sp).inverssha) { if (params.locallab.spots.at(sp).inverssha) {
for (int i = 0; i < fh; i++) { for (int i = 0; i < fh; i++) {