From b6cf8f71a9be5d060eed782266cdbd0c5f9230e3 Mon Sep 17 00:00:00 2001 From: Emil Martinec Date: Thu, 16 Sep 2010 14:37:13 -0500 Subject: [PATCH] A fix for bad behavior of the GUI under the NR tools. The problem seems to be the separation of luminance and chrominance operations in all other tools besides the pyramid NR, while the latter operates simultaneously on luma and chroma data. I put all luma/chroma curves, NR, sharpening, equalizer etc. into a single grouping, which means that if any one is changed, all must be redone. This will slow down the GUI for now but I expect that the pipeline will be retooled at some point anyway. --- rtengine/dcrop.cc | 17 +++++++++-------- rtengine/improccoordinator.cc | 27 ++++++++++++++------------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index de4415553..4d29a82d0 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -159,7 +159,7 @@ void Crop::update (int todo, bool internal) { // shadows & highlights & tone curve & convert to cielab if (todo & M_RGBCURVE) parent->ipf.rgbProc (baseCrop, laboCrop, parent->tonecurve, cshmap); - +/* // apply luminance operations if (todo & M_LUMINANCE) { parent->ipf.luminanceCurve (laboCrop, labnCrop, parent->lumacurve, 0, croph); @@ -181,24 +181,25 @@ void Crop::update (int todo, bool internal) { parent->ipf.waveletEqualizer(labnCrop, false, true); } } - +*/ // apply luminance operations - /*if (todo & M_LUMINANCE) { + if (todo & (M_LUMINANCE+M_COLOR)) { parent->ipf.luminanceCurve (laboCrop, labnCrop, parent->lumacurve, 0, croph); + parent->ipf.colorCurve (laboCrop, labnCrop); + if (skip==1) { parent->ipf.impulsedenoise (labnCrop); parent->ipf.lumadenoise (labnCrop, cbuffer); parent->ipf.colordenoise (labnCrop, cbuffer); parent->ipf.dirpyrdenoise (labnCrop); parent->ipf.sharpening (labnCrop, (unsigned short**)cbuffer); - parent->ipf.impulsedenoise (labnCrop); - parent->ipf.waveletEqualizer(labnCrop, true, false); - parent->ipf.waveletEqualizer(labnCrop, false, true); + //parent->ipf.impulsedenoise (labnCrop); + parent->ipf.waveletEqualizer(labnCrop, true, true); + //parent->ipf.waveletEqualizer(labnCrop, false, true); } - parent->ipf.colorCurve (labnCrop, labnCrop); - }*/ + } // switch back to rgb diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 457076d7c..ba78140fc 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -157,7 +157,7 @@ void ImProcCoordinator::updatePreviewImage (int todo) { if (todo & M_LUMACURVE) CurveFactory::complexCurve (0.0, 0.0, 0.0, 0.0, params.lumaCurve.brightness, params.lumaCurve.contrast, 0.0, 0.0, false, params.lumaCurve.curve, lhist16, lumacurve, bcLhist, scale==1 ? 1 : 16); - +/* if (todo & M_LUMINANCE) { progress ("Applying Luminance Curve...",100*readyphase/numofphases); ipf.luminanceCurve (oprevl, nprevl, lumacurve, 0, pH); @@ -201,13 +201,16 @@ void ImProcCoordinator::updatePreviewImage (int todo) { } readyphase++; } +*/ - - /*if (todo & M_LUMINANCE ) { + if (todo & (M_LUMINANCE+M_COLOR) ) { progress ("Applying Luminance Curve...",100*readyphase/numofphases); ipf.luminanceCurve (oprevl, nprevl, lumacurve, 0, pH); + readyphase++; + progress ("Applying Color Boost...",100*readyphase/numofphases); + ipf.colorCurve (oprevl, nprevl); readyphase++; if (scale==1) { progress ("Denoising luminance impulse...",100*readyphase/numofphases); @@ -230,24 +233,22 @@ void ImProcCoordinator::updatePreviewImage (int todo) { progress ("Sharpening...",100*readyphase/numofphases); ipf.sharpening (nprevl, (unsigned short**)buffer); } + readyphase++; //if (scale==1) { // progress ("Denoising luminance impulse...",100*readyphase/numofphases); // ipf.impulsedenoise (nprevl); //} if (scale==1) { progress ("Wavelet...",100*readyphase/numofphases); - ipf.waveletEqualizer (nprevl, true, false); + ipf.waveletEqualizer (nprevl, true, true); } - if (scale==1) { - progress ("Wavelet...",100*readyphase/numofphases); - ipf.waveletEqualizer (nprevl, false, true); - } - readyphase++; + //if (scale==1) { + // progress ("Wavelet...",100*readyphase/numofphases); + // ipf.waveletEqualizer (nprevl, false, true); + //} - progress ("Applying Color Boost...",100*readyphase/numofphases); - ipf.colorCurve (nprevl, nprevl); - readyphase++; - }*/ + + } // process crop, if needed for (int i=0; i