Export: Do not allocate memory for locallab if locallab is disabled
This commit is contained in:
parent
763e3f7364
commit
d7c6b4b8f9
@ -971,8 +971,6 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
labView = new LabImage(fw, fh);
|
labView = new LabImage(fw, fh);
|
||||||
reservView = new LabImage(fw, fh);
|
|
||||||
lastorigView = new LabImage(fw, fh);
|
|
||||||
|
|
||||||
if (params.blackwhite.enabled) {
|
if (params.blackwhite.enabled) {
|
||||||
CurveFactory::curveBW(params.blackwhite.beforeCurve, params.blackwhite.afterCurve, hist16, dummy, customToneCurvebw1, customToneCurvebw2, 1);
|
CurveFactory::curveBW(params.blackwhite.beforeCurve, params.blackwhite.afterCurve, hist16, dummy, customToneCurvebw1, customToneCurvebw2, 1);
|
||||||
@ -1080,15 +1078,13 @@ private:
|
|||||||
params.labCurve.lccurve, curve1, curve2, satcurve, lhskcurve, 1);
|
params.labCurve.lccurve, curve1, curve2, satcurve, lhskcurve, 1);
|
||||||
|
|
||||||
|
|
||||||
// bool locallutili = false;
|
|
||||||
// bool localcutili = false;
|
|
||||||
reservView->CopyFrom(labView);
|
|
||||||
lastorigView->CopyFrom(labView);
|
|
||||||
|
|
||||||
if (params.locallab.enabled) {
|
if (params.locallab.enabled) {
|
||||||
MyTime t1, t2;
|
MyTime t1, t2;
|
||||||
t1.set();
|
t1.set();
|
||||||
|
const std::unique_ptr<LabImage> reservView(new LabImage(fw, fh));
|
||||||
|
reservView->CopyFrom(labView);
|
||||||
|
const std::unique_ptr<LabImage> lastorigView(new LabImage(fw, fh));
|
||||||
|
lastorigView->CopyFrom(labView);
|
||||||
LUTf huerefs(500, -10000.f);
|
LUTf huerefs(500, -10000.f);
|
||||||
LUTf sobelrefs(500, -10000.f);
|
LUTf sobelrefs(500, -10000.f);
|
||||||
LUTi centerx(500, -10000);
|
LUTi centerx(500, -10000);
|
||||||
@ -1292,7 +1288,7 @@ private:
|
|||||||
int lastsav;
|
int lastsav;
|
||||||
float avge;
|
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, avge, locwavCurveden, locwavdenutili);
|
ipf.calc_ref(sp, reservView.get(), reservView.get(), 0, 0, fw, fh, 1, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge, locwavCurveden, locwavdenutili);
|
||||||
} else {
|
} else {
|
||||||
ipf.calc_ref(sp, labView, labView, 0, 0, fw, fh, 1, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge, locwavCurveden, locwavdenutili);
|
ipf.calc_ref(sp, labView, labView, 0, 0, fw, fh, 1, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge, locwavCurveden, locwavdenutili);
|
||||||
}
|
}
|
||||||
@ -1309,7 +1305,7 @@ private:
|
|||||||
float Tmax;
|
float Tmax;
|
||||||
|
|
||||||
// No Locallab mask is shown in exported picture
|
// No Locallab mask is shown in exported picture
|
||||||
ipf.Lab_Local(2, sp, (float**)shbuffer, labView, labView, reservView, lastorigView, 0, 0, fw, fh, 1, locRETgainCurve, locRETtransCurve,
|
ipf.Lab_Local(2, sp, (float**)shbuffer, labView, labView, reservView.get(), lastorigView.get(), 0, 0, fw, fh, 1, locRETgainCurve, locRETtransCurve,
|
||||||
lllocalcurve, locallutili,
|
lllocalcurve, locallutili,
|
||||||
cllocalcurve, localclutili,
|
cllocalcurve, localclutili,
|
||||||
lclocalcurve, locallcutili,
|
lclocalcurve, locallcutili,
|
||||||
@ -1347,7 +1343,7 @@ private:
|
|||||||
lastorigView->CopyFrom(labView);
|
lastorigView->CopyFrom(labView);
|
||||||
|
|
||||||
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, avge, locwavCurveden, locwavdenutili);
|
ipf.calc_ref(sp, reservView.get(), reservView.get(), 0, 0, fw, fh, 1, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge, locwavCurveden, locwavdenutili);
|
||||||
} else {
|
} else {
|
||||||
ipf.calc_ref(sp, labView, labView, 0, 0, fw, fh, 1, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge, locwavCurveden, locwavdenutili);
|
ipf.calc_ref(sp, labView, labView, 0, 0, fw, fh, 1, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge, locwavCurveden, locwavdenutili);
|
||||||
}
|
}
|
||||||
@ -1391,11 +1387,6 @@ private:
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delete reservView;
|
|
||||||
reservView = nullptr;
|
|
||||||
delete lastorigView;
|
|
||||||
lastorigView = nullptr;
|
|
||||||
|
|
||||||
ipf.chromiLuminanceCurve(nullptr, 1, labView, labView, curve1, curve2, satcurve, lhskcurve, clcurve, lumacurve, utili, autili, butili, ccutili, cclutili, clcutili, dummy, dummy);
|
ipf.chromiLuminanceCurve(nullptr, 1, labView, labView, curve1, curve2, satcurve, lhskcurve, clcurve, lumacurve, utili, autili, butili, ccutili, cclutili, clcutili, dummy, dummy);
|
||||||
|
|
||||||
if ((params.colorappearance.enabled && !params.colorappearance.tonecie) || (!params.colorappearance.enabled)) {
|
if ((params.colorappearance.enabled && !params.colorappearance.tonecie) || (!params.colorappearance.enabled)) {
|
||||||
@ -1742,10 +1733,6 @@ private:
|
|||||||
delete labView;
|
delete labView;
|
||||||
labView = nullptr;
|
labView = nullptr;
|
||||||
|
|
||||||
// delete reservView;
|
|
||||||
// reservView = nullptr;
|
|
||||||
|
|
||||||
|
|
||||||
if (bwonly) { //force BW r=g=b
|
if (bwonly) { //force BW r=g=b
|
||||||
if (settings->verbose) {
|
if (settings->verbose) {
|
||||||
printf("Force BW\n");
|
printf("Force BW\n");
|
||||||
@ -2020,8 +2007,6 @@ private:
|
|||||||
ColorTemp currWB;
|
ColorTemp currWB;
|
||||||
Imagefloat *baseImg;
|
Imagefloat *baseImg;
|
||||||
LabImage* labView;
|
LabImage* labView;
|
||||||
LabImage* reservView;
|
|
||||||
LabImage* lastorigView;
|
|
||||||
|
|
||||||
LUTu hist16;
|
LUTu hist16;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user