merge with dev - I hope no error

This commit is contained in:
Desmis
2018-11-24 14:18:37 +01:00
208 changed files with 2982 additions and 2150 deletions

View File

@@ -817,59 +817,58 @@ void Crop::update(int todo)
}
if (todo & (M_AUTOEXP | M_RGBCURVE)) {
if (todo & M_RGBCURVE) {
Imagefloat *workingCrop = baseCrop;
if (params.icm.workingTRC == "Custom") { //exec TRC IN free
Glib::ustring profile;
profile = params.icm.workingProfile;
const Glib::ustring profile = params.icm.workingProfile;
if (profile == "sRGB" || profile == "Adobe RGB" || profile == "ProPhoto" || profile == "WideGamut" || profile == "BruceRGB" || profile == "Beta RGB" || profile == "BestRGB" || profile == "Rec2020" || profile == "ACESp0" || profile == "ACESp1") {
int cw = baseCrop->getWidth();
int ch = baseCrop->getHeight();
workingCrop = new Imagefloat(cw, ch);
baseCrop->copyData(workingCrop);
//first put gamma TRC to 1
int cw = baseCrop->getWidth();
int ch = baseCrop->getHeight();
Imagefloat* readyImg0 = NULL;
readyImg0 = parent->ipf.workingtrc(baseCrop, cw, ch, -5, params.icm.workingProfile, 2.4, 12.92310);
Imagefloat* readyImg0 = parent->ipf.workingtrc(workingCrop, cw, ch, -5, params.icm.workingProfile, 2.4, 12.92310);
#pragma omp parallel for
for (int row = 0; row < ch; row++) {
for (int col = 0; col < cw; col++) {
baseCrop->r(row, col) = (float)readyImg0->r(row, col);
baseCrop->g(row, col) = (float)readyImg0->g(row, col);
baseCrop->b(row, col) = (float)readyImg0->b(row, col);
workingCrop->r(row, col) = (float)readyImg0->r(row, col);
workingCrop->g(row, col) = (float)readyImg0->g(row, col);
workingCrop->b(row, col) = (float)readyImg0->b(row, col);
}
}
delete readyImg0;
//adjust gamma TRC
Imagefloat* readyImg = NULL;
readyImg = parent->ipf.workingtrc(baseCrop, cw, ch, 5, params.icm.workingProfile, params.icm.workingTRCGamma, params.icm.workingTRCSlope);
Imagefloat* readyImg = parent->ipf.workingtrc(workingCrop, cw, ch, 5, params.icm.workingProfile, params.icm.workingTRCGamma, params.icm.workingTRCSlope);
#pragma omp parallel for
for (int row = 0; row < ch; row++) {
for (int col = 0; col < cw; col++) {
baseCrop->r(row, col) = (float)readyImg->r(row, col);
baseCrop->g(row, col) = (float)readyImg->g(row, col);
baseCrop->b(row, col) = (float)readyImg->b(row, col);
workingCrop->r(row, col) = (float)readyImg->r(row, col);
workingCrop->g(row, col) = (float)readyImg->g(row, col);
workingCrop->b(row, col) = (float)readyImg->b(row, col);
}
}
delete readyImg;
}
}
}
if (todo & M_RGBCURVE) {
double rrm, ggm, bbm;
DCPProfile::ApplyState as;
DCPProfile *dcpProf = parent->imgsrc->getDCP(params.icm, as);
LUTu histToneCurve;
parent->ipf.rgbProc(baseCrop, laboCrop, this, parent->hltonecurve, parent->shtonecurve, parent->tonecurve,
parent->ipf.rgbProc (workingCrop, laboCrop, this, parent->hltonecurve, parent->shtonecurve, parent->tonecurve,
params.toneCurve.saturation, parent->rCurve, parent->gCurve, parent->bCurve, parent->colourToningSatLimit, parent->colourToningSatLimitOpacity, parent->ctColorCurve, parent->ctOpacityCurve, parent->opautili, parent->clToningcurve, parent->cl2Toningcurve,
parent->customToneCurve1, parent->customToneCurve2, parent->beforeToneCurveBW, parent->afterToneCurveBW, rrm, ggm, bbm,
parent->bwAutoR, parent->bwAutoG, parent->bwAutoB, dcpProf, as, histToneCurve);
if (workingCrop != baseCrop) {
delete workingCrop;
}
}
/*xref=000;yref=000;