LA - Move colortoning labgrid from rgb to lab - issue #6132 (#6173)

* Move colortoning labgrid from rgb to lab

* Remove unnecessary variables
This commit is contained in:
Desmis 2021-03-23 16:59:54 +01:00 committed by GitHub
parent ca5a9a26de
commit 3ad786745c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 25 additions and 8 deletions

View File

@ -1171,6 +1171,9 @@ void Crop::update(int todo)
bool cclutili = parent->cclutili;
LUTu dummy;
if (params.colorToning.enabled && params.colorToning.method == "LabGrid") {
parent->ipf.colorToningLabGrid(labnCrop, 0,labnCrop->W , 0, labnCrop->H, false);
}
parent->ipf.shadowsHighlights(labnCrop, params.sh.enabled, params.sh.lab,params.sh.highlights ,params.sh.shadows, params.sh.radius, skip, params.sh.htonalwidth, params.sh.stonalwidth);

View File

@ -1286,6 +1286,9 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
nprevl->CopyFrom(oprevl);
histCCurve.clear();
histLCurve.clear();
if (params->colorToning.enabled && params->colorToning.method == "LabGrid") {
ipf.colorToningLabGrid(nprevl, 0, nprevl->W, 0, nprevl->H, false);
}
ipf.shadowsHighlights(nprevl, params->sh.enabled, params->sh.lab,params->sh.highlights ,params->sh.shadows, params->sh.radius, scale, params->sh.htonalwidth, params->sh.stonalwidth);

View File

@ -2231,7 +2231,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer
}
bool hasColorToning = params->colorToning.enabled && bool (ctOpacityCurve) && bool (ctColorCurve) && params->colorToning.method != "LabGrid";
bool hasColorToningLabGrid = params->colorToning.enabled && params->colorToning.method == "LabGrid";
// bool hasColorToningLabGrid = params->colorToning.enabled && params->colorToning.method == "LabGrid";
// float satLimit = float(params->colorToning.satProtectionThreshold)/100.f*0.7f+0.3f;
// float satLimitOpacity = 1.f-(float(params->colorToning.saturatedOpacity)/100.f);
float strProtect = pow_F((float (params->colorToning.strength) / 100.f), 0.4f);
@ -3184,9 +3184,9 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer
Color::RGB2Lab(&rtemp[ti * TS], &gtemp[ti * TS], &btemp[ti * TS], &(lab->L[i][jstart]), &(lab->a[i][jstart]), &(lab->b[i][jstart]), toxyz, tW - jstart);
}
if (hasColorToningLabGrid) {
colorToningLabGrid(lab, jstart, tW, istart, tH, false);
}
// if (hasColorToningLabGrid) {
// colorToningLabGrid(lab, jstart, tW, istart, tH, false);
// }
} else { // black & white
// Auto channel mixer needs whole image, so we now copy to tmpImage and close the tiled processing
for (int i = istart, ti = 0; i < tH; i++, ti++) {
@ -3565,9 +3565,9 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer
for (int i = 0; i < tH; i++) {
Color::RGB2Lab(tmpImage->r(i), tmpImage->g(i), tmpImage->b(i), lab->L[i], lab->a[i], lab->b[i], toxyz, tW);
if (hasColorToningLabGrid) {
colorToningLabGrid(lab, 0, tW, i, i + 1, false);
}
// if (hasColorToningLabGrid) {
// colorToningLabGrid(lab, 0, tW, i, i + 1, false);
// }
}

View File

@ -1438,6 +1438,11 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, eSensorT
CurveFactory::complexsgnCurve (autili, butili, ccutili, cclutili, params.labCurve.acurve, params.labCurve.bcurve, params.labCurve.cccurve,
params.labCurve.lccurve, curve1, curve2, satcurve, lhskcurve, 16);
if (params.colorToning.enabled && params.colorToning.method == "LabGrid") {
ipf.colorToningLabGrid(labView, 0,labView->W , 0, labView->H, false);
}
ipf.shadowsHighlights(labView, params.sh.enabled, params.sh.lab,params.sh.highlights ,params.sh.shadows, params.sh.radius, 16, params.sh.htonalwidth, params.sh.stonalwidth);
if (params.localContrast.enabled) {

View File

@ -1347,6 +1347,11 @@ private:
CurveFactory::complexsgnCurve(autili, butili, ccutili, cclutili, params.labCurve.acurve, params.labCurve.bcurve, params.labCurve.cccurve,
params.labCurve.lccurve, curve1, curve2, satcurve, lhskcurve, 1);
if (params.colorToning.enabled && params.colorToning.method == "LabGrid") {
ipf.colorToningLabGrid(labView, 0,labView->W , 0, labView->H, false);
}
ipf.shadowsHighlights(labView, params.sh.enabled, params.sh.lab,params.sh.highlights ,params.sh.shadows, params.sh.radius, 1, params.sh.htonalwidth, params.sh.stonalwidth);
if (params.localContrast.enabled) {

View File

@ -346,7 +346,8 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR
//------------------------------------------------------------------------
// LAB grid
auto m = ProcEventMapper::getInstance();
EvColorToningLabGridValue = m->newEvent(RGBCURVE, "HISTORY_MSG_COLORTONING_LABGRID_VALUE");
// EvColorToningLabGridValue = m->newEvent(RGBCURVE, "HISTORY_MSG_COLORTONING_LABGRID_VALUE");
EvColorToningLabGridValue = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_COLORTONING_LABGRID_VALUE");
labgrid = Gtk::manage(new LabGrid(EvColorToningLabGridValue, M("TP_COLORTONING_LABGRID_VALUES")));
pack_start(*labgrid, Gtk::PACK_EXPAND_WIDGET, 4);
//------------------------------------------------------------------------