If a custom TRC is set, it is applied after every edit, fixes #5023
This commit is contained in:
@@ -808,56 +808,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
|
if (params.icm.workingTRC == "Custom") { //exec TRC IN free
|
||||||
Glib::ustring profile;
|
const Glib::ustring profile = params.icm.workingProfile;
|
||||||
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") {
|
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
|
//first put gamma TRC to 1
|
||||||
int cw = baseCrop->getWidth();
|
Imagefloat* readyImg0 = parent->ipf.workingtrc(workingCrop, cw, ch, -5, params.icm.workingProfile, 2.4, 12.92310);
|
||||||
int ch = baseCrop->getHeight();
|
|
||||||
Imagefloat* readyImg0 = parent->ipf.workingtrc(baseCrop, cw, ch, -5, params.icm.workingProfile, 2.4, 12.92310);
|
|
||||||
#pragma omp parallel for
|
#pragma omp parallel for
|
||||||
|
|
||||||
for (int row = 0; row < ch; row++) {
|
for (int row = 0; row < ch; row++) {
|
||||||
for (int col = 0; col < cw; col++) {
|
for (int col = 0; col < cw; col++) {
|
||||||
baseCrop->r(row, col) = (float)readyImg0->r(row, col);
|
workingCrop->r(row, col) = (float)readyImg0->r(row, col);
|
||||||
baseCrop->g(row, col) = (float)readyImg0->g(row, col);
|
workingCrop->g(row, col) = (float)readyImg0->g(row, col);
|
||||||
baseCrop->b(row, col) = (float)readyImg0->b(row, col);
|
workingCrop->b(row, col) = (float)readyImg0->b(row, col);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete readyImg0;
|
delete readyImg0;
|
||||||
|
|
||||||
//adjust gamma TRC
|
//adjust gamma TRC
|
||||||
Imagefloat* 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
|
#pragma omp parallel for
|
||||||
|
|
||||||
for (int row = 0; row < ch; row++) {
|
for (int row = 0; row < ch; row++) {
|
||||||
for (int col = 0; col < cw; col++) {
|
for (int col = 0; col < cw; col++) {
|
||||||
baseCrop->r(row, col) = (float)readyImg->r(row, col);
|
workingCrop->r(row, col) = (float)readyImg->r(row, col);
|
||||||
baseCrop->g(row, col) = (float)readyImg->g(row, col);
|
workingCrop->g(row, col) = (float)readyImg->g(row, col);
|
||||||
baseCrop->b(row, col) = (float)readyImg->b(row, col);
|
workingCrop->b(row, col) = (float)readyImg->b(row, col);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete readyImg;
|
delete readyImg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (todo & M_RGBCURVE) {
|
|
||||||
double rrm, ggm, bbm;
|
double rrm, ggm, bbm;
|
||||||
DCPProfile::ApplyState as;
|
DCPProfile::ApplyState as;
|
||||||
DCPProfile *dcpProf = parent->imgsrc->getDCP(params.icm, as);
|
DCPProfile *dcpProf = parent->imgsrc->getDCP(params.icm, as);
|
||||||
|
|
||||||
LUTu histToneCurve;
|
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,
|
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->customToneCurve1, parent->customToneCurve2, parent->beforeToneCurveBW, parent->afterToneCurveBW, rrm, ggm, bbm,
|
||||||
parent->bwAutoR, parent->bwAutoG, parent->bwAutoB, dcpProf, as, histToneCurve);
|
parent->bwAutoR, parent->bwAutoG, parent->bwAutoB, dcpProf, as, histToneCurve);
|
||||||
|
if (workingCrop != baseCrop) {
|
||||||
|
delete workingCrop;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*xref=000;yref=000;
|
/*xref=000;yref=000;
|
||||||
|
@@ -506,8 +506,12 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
|||||||
|
|
||||||
if (todo & (M_AUTOEXP | M_RGBCURVE)) {
|
if (todo & (M_AUTOEXP | M_RGBCURVE)) {
|
||||||
if (params.icm.workingTRC == "Custom") { //exec TRC IN free
|
if (params.icm.workingTRC == "Custom") { //exec TRC IN free
|
||||||
Glib::ustring profile;
|
if (oprevi == orig_prev) {
|
||||||
profile = params.icm.workingProfile;
|
oprevi = new Imagefloat(pW, pH);
|
||||||
|
orig_prev->copyData(oprevi);
|
||||||
|
}
|
||||||
|
|
||||||
|
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") {
|
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 = oprevi->getWidth();
|
int cw = oprevi->getWidth();
|
||||||
|
Reference in New Issue
Block a user