diff --git a/rtengine/colortemp.cc b/rtengine/colortemp.cc index e22c2fd06..d4f1c995f 100644 --- a/rtengine/colortemp.cc +++ b/rtengine/colortemp.cc @@ -1794,7 +1794,7 @@ The next 3 methods are inspired from: This program is in the public domain. b) Bruce Lindbloom - Adapted to Rawtherapee by J.Desmis + Adapted to RawTherapee by J.Desmis this values are often called xBar yBar zBar and are characteristics of a color / illuminant diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 58a48abed..523171ba2 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -158,7 +158,7 @@ void Crop::update (int todo) int heiIm = parent->fh; bool needstransform = parent->ipf.needsTransform(); - + if (todo & (M_INIT | M_LINDENOISE)) { MyMutex::MyLock lock(parent->minit); // Also used in improccoord @@ -305,6 +305,7 @@ void Crop::update (int todo) if(parent->adnListener) { parent->adnListener->noiseTilePrev (centerTile_X[poscenterX], centerTile_Y[poscenterY], CenterPreview_X, CenterPreview_Y, crW, trafw * skip); } + // I have tried "blind" some solutions..to move review ...but GUI is not my truc ! // int W,H; // cropgl->cropMoved (centerTile_X[poscenterX],centerTile_Y[poscenterY] , W, H); @@ -807,7 +808,7 @@ void Crop::update (int todo) LUTu dummy; int modedehaz; - // parent->ipf.MSR(labnCrop, labnCrop->W, labnCrop->H, 1); + // parent->ipf.MSR(labnCrop, labnCrop->W, labnCrop->H, 1); parent->ipf.chromiLuminanceCurve (this, 1, labnCrop, labnCrop, parent->chroma_acurve, parent->chroma_bcurve, parent->satcurve, parent->lhskcurve, parent->clcurve, parent->lumacurve, utili, autili, butili, ccutili, cclutili, clcutili, dummy, dummy, dummy, dummy); parent->ipf.vibrance (labnCrop); diff --git a/rtengine/demosaic_algos.cc b/rtengine/demosaic_algos.cc index 954be456b..aa1b90278 100644 --- a/rtengine/demosaic_algos.cc +++ b/rtengine/demosaic_algos.cc @@ -1242,7 +1242,7 @@ void RawImageSource::border_interpolate2( int winw, int winh, int lborders) // Joint Demosaicing and Denoising using High Order Interpolation Techniques // Revision 0.9.1a - 09/02/2010 - Contact info: luis.sanz.rodriguez@gmail.com // Copyright Luis Sanz Rodriguez 2010 -// Adapted to RT by Jacques Desmis 3/2013 +// Adapted to RawTherapee by Jacques Desmis 3/2013 void RawImageSource::jdl_interpolate_omp() // from "Lassus" { @@ -1367,7 +1367,7 @@ void RawImageSource::jdl_interpolate_omp() // from "Lassus" // Color demozaicing via directional Linear Minimum Mean Square-error Estimation, // IEEE Trans. on Image Processing, vol. 14, pp. 2167-2178, // Dec. 2005. -// Adapted to RT by Jacques Desmis 3/2013 +// Adapted to RawTherapee by Jacques Desmis 3/2013 // Improved speed and reduced memory consumption by Ingo Weyrich 2/2015 //TODO Tiles to reduce memory consumption SSEFUNCTION void RawImageSource::lmmse_interpolate_omp(int winw, int winh, int iterations) @@ -2041,7 +2041,7 @@ SSEFUNCTION void RawImageSource::lmmse_interpolate_omp(int winw, int winh, int i * Visit for more information. * ***/ -// Adapted to RT by Jacques Desmis 3/2013 +// Adapted to RawTherapee by Jacques Desmis 3/2013 // SSE version by Ingo Weyrich 5/2013 #ifdef __SSE2__ #define CLIPV(a) LIMV(a,zerov,c65535v) @@ -2965,7 +2965,7 @@ void RawImageSource::nodemosaic(bool bw) /* Refinement based on EECI demosaicing algorithm by L. Chang and Y.P. Tan Paul Lee - Adapted for Rawtherapee - Jacques Desmis 04/2013 + Adapted for RawTherapee - Jacques Desmis 04/2013 */ #ifdef __SSE2__ diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index f2ab07155..9e9fa24c8 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -242,11 +242,12 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) DehaParams.getCurves(dehatransmissionCurve); float minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax; imgsrc->dehaz( params.raw, params.icm, params.dehaz, cdcurve, dehatransmissionCurve, dehacontlutili, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax);//enabled Dehaze + if(dehaListener) { - dehaListener->minmaxChanged(maxCD, minCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax); + dehaListener->minmaxChanged(maxCD, minCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax); } - } + } } // Updating toneCurve.hrenabled if necessary diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index 9edefba80..a6d6e044c 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -155,7 +155,7 @@ protected: AutoChromaListener* adnListener; WaveletListener* awavListener; DehazListener* dehaListener; - + HistogramListener* hListener; std::vector sizeListeners; diff --git a/rtengine/ipdehaz.cc b/rtengine/ipdehaz.cc index 357c672d2..5f85f883a 100644 --- a/rtengine/ipdehaz.cc +++ b/rtengine/ipdehaz.cc @@ -16,7 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . - * adaptation to Rawtherapee + * adaptation to RawTherapee * 2015 Jacques Desmis * 2015 Ingo Weyrich @@ -24,13 +24,13 @@ * Retinex for bridging the gap between color images and the * human observation of scenes. IEEE Transactions on Image Processing, * 1997, 6(7): 965-976 - + * Fan Guo Zixing Cai Bin Xie Jin Tang * School of Information Science and Engineering, Central South University Changsha, China - * Weixing Wang and Lian Xu + * Weixing Wang and Lian Xu * College of Physics and Information Engineering, Fuzhou University, Fuzhou, China - + * inspired from 2003 Fabien Pelisson */ @@ -203,7 +203,7 @@ void RawImageSource::MSR(float** luminance, float** originalLuminance, int width if (deh.enabled) {//enabled StopWatch Stop1("MSR"); float mean, stddv, maxtr, mintr; - // float mini, delta, maxi; + // float mini, delta, maxi; float delta; float eps = 2.f; float gain2 = (float) deh.gain / 100.f; //def =1 not use @@ -438,43 +438,51 @@ void RawImageSource::MSR(float** luminance, float** originalLuminance, int width } float cdfactor = gain2 * 32768.f / delta; - maxCD =-9999999.f; - minCD =9999999.f; - + maxCD = -9999999.f; + minCD = 9999999.f; + #ifdef _OPENMP - #pragma omp parallel -#endif - { - float cdmax = -999999.f, cdmin = 999999.f; - -#ifdef _OPENMP - #pragma omp for -#endif - for ( int i = 0; i < H_L; i ++ ) - for (int j = 0; j < W_L; j++) { - // float cd = cdfactor * ( luminance[i][j] * logBetaGain - mini ) + offse; - float cd = cdfactor * ( luminance[i][j] - mini ) + offse; - if(cd > cdmax) cdmax=cd; - if(cd < cdmin) cdmin=cd; - - - luminance[i][j] = clipdehaz( cd, 0.f, 32768.f ) * strength + (1.f - strength) * originalLuminance[i][j]; - } -#ifdef _OPENMP - #pragma omp critical + #pragma omp parallel #endif { - maxCD = maxCD > cdmax ? maxCD : cdmax; - minCD = minCD < cdmin ? minCD : cdmin; + float cdmax = -999999.f, cdmin = 999999.f; + +#ifdef _OPENMP + #pragma omp for +#endif + + for ( int i = 0; i < H_L; i ++ ) + for (int j = 0; j < W_L; j++) { + // float cd = cdfactor * ( luminance[i][j] * logBetaGain - mini ) + offse; + float cd = cdfactor * ( luminance[i][j] - mini ) + offse; + + if(cd > cdmax) { + cdmax = cd; + } + + if(cd < cdmin) { + cdmin = cd; + } + + + luminance[i][j] = clipdehaz( cd, 0.f, 32768.f ) * strength + (1.f - strength) * originalLuminance[i][j]; + } + +#ifdef _OPENMP + #pragma omp critical +#endif + { + maxCD = maxCD > cdmax ? maxCD : cdmax; + minCD = minCD < cdmin ? minCD : cdmin; + } + } - + // printf("cdmin=%f cdmax=%f\n",minCD, maxCD); + Tmean = mean; + Tsigma = stddv; + Tmin = mintr; + Tmax = maxtr; } - // printf("cdmin=%f cdmax=%f\n",minCD, maxCD); - Tmean = mean; - Tsigma = stddv; - Tmin = mintr; - Tmax = maxtr; - } } } diff --git a/rtgui/dehaz.cc b/rtgui/dehaz.cc index 842e572a9..8c9f7bbfb 100644 --- a/rtgui/dehaz.cc +++ b/rtgui/dehaz.cc @@ -11,15 +11,15 @@ Dehaz::Dehaz () : FoldableToolPanel(this, "dehaz", M("TP_DEHAZ_LABEL"), false, t { CurveListener::setMulti(true); std::vector milestones; - nextmin =0.; - nextmax =0.; + nextmin = 0.; + nextmax = 0.; nextminiT = 0.; nextmaxiT = 0.; nextmeanT = 0.; nextsigma = 0.; nextminT = 0.; nextmaxT = 0.; - + dehazFrame = Gtk::manage (new Gtk::Frame (M("TP_DEHAZ_LAB")) ); dehazFrame->set_tooltip_text(M("TP_DEHAZ_LAB_TOOLTIP")); dehazFrame->set_border_width(0); @@ -94,13 +94,13 @@ Dehaz::Dehaz () : FoldableToolPanel(this, "dehaz", M("TP_DEHAZ_LABEL"), false, t dehazVBox->pack_start (*retinex); retinex->show (); - + mMLabels = Gtk::manage(new Gtk::Label("---", Gtk::ALIGN_CENTER)); mMLabels->set_tooltip_markup (M("TP_DEHAZ_MLABEL_TOOLTIP")); transLabels = Gtk::manage(new Gtk::Label("---", Gtk::ALIGN_CENTER)); transLabels->set_tooltip_markup (M("TP_DEHAZ_TLABEL_TOOLTIP")); - + scal = Gtk::manage (new Adjuster (M("TP_DEHAZ_SCAL"), 1, 8., 1., 3.)); gain = Gtk::manage (new Adjuster (M("TP_DEHAZ_GAIN"), 20, 200, 1, 100));//50 150 offs = Gtk::manage (new Adjuster (M("TP_DEHAZ_OFFS"), -10000, 10000, 1, 0)); @@ -121,7 +121,7 @@ Dehaz::Dehaz () : FoldableToolPanel(this, "dehaz", M("TP_DEHAZ_LABEL"), false, t RetiVBox->pack_start (*transLabels); transLabels->show (); - + RetiVBox->pack_start (*curveEditorGD, Gtk::PACK_SHRINK, 4); curveEditorGD->show(); @@ -179,7 +179,7 @@ int minmaxChangedUI (void* data) } void Dehaz::minmaxChanged (double cdma, double cdmin, double mini, double maxi, double Tmean, double Tsigma, double Tmin, double Tmax) -{ +{ nextmin = cdmin; nextmax = cdma; nextminiT = mini; @@ -189,7 +189,7 @@ void Dehaz::minmaxChanged (double cdma, double cdmin, double mini, double maxi, nextminT = Tmin; nextmaxT = Tmax; g_idle_add (minmaxChangedUI, this); - + } bool Dehaz::minmaxComputed_ () @@ -200,7 +200,7 @@ bool Dehaz::minmaxComputed_ () updateLabel (); updateTrans (); return false; - + } void Dehaz::updateLabel () { diff --git a/rtgui/dehaz.h b/rtgui/dehaz.h index 0f3b2f07e..48007bea8 100644 --- a/rtgui/dehaz.h +++ b/rtgui/dehaz.h @@ -15,7 +15,7 @@ class Dehaz : public ToolParamBlock, public FoldableToolPanel, public rtengine::DehazListener, public CurveListener, public AdjusterListener - + { protected: @@ -42,10 +42,10 @@ protected: double nextminT; double nextmaxT; double nextsigma; - + Gtk::Label* mMLabels; Gtk::Label* transLabels; - + DiagonalCurveEditor* cdshape; CurveEditorGroup* transmissionCurveEditorG; sigc::connection dehazmetConn; diff --git a/rtgui/labcurve.cc b/rtgui/labcurve.cc index 2fb7f250c..fdcbed683 100644 --- a/rtgui/labcurve.cc +++ b/rtgui/labcurve.cc @@ -215,7 +215,7 @@ LCurve::LCurve () : FoldableToolPanel(this, "labcurves", M("TP_LABCURVE_LABEL")) LCurve::~LCurve () { delete curveEditorG; - + } void LCurve::read (const ProcParams* pp, const ParamsEdited* pedited) @@ -318,7 +318,7 @@ void LCurve::autoOpenCurve () if (!active) { clshape->openIfNonlinear(); } - + } void LCurve::setEditProvider (EditDataProvider *provider) @@ -379,10 +379,10 @@ void LCurve::write (ProcParams* pp, ParamsEdited* pedited) pedited->labCurve.hhcurve = !hhshape->isUnChanged (); pedited->labCurve.lccurve = !lcshape->isUnChanged (); pedited->labCurve.clcurve = !clshape->isUnChanged (); - - + + } - + } void LCurve::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) @@ -392,6 +392,7 @@ void LCurve::setDefaults (const ProcParams* defParams, const ParamsEdited* pedit contrast->setDefault (defParams->labCurve.contrast); chromaticity->setDefault (defParams->labCurve.chromaticity); rstprotection->setDefault (defParams->labCurve.rstprotection); + if (pedited) { brightness->setDefaultEditedState (pedited->labCurve.brightness ? Edited : UnEdited); contrast->setDefaultEditedState (pedited->labCurve.contrast ? Edited : UnEdited); @@ -506,8 +507,8 @@ void LCurve::curveChanged (CurveEditor* ce) if (ce == clshape) { listener->panelChanged (EvLCLCurve, M("HISTORY_CUSTOMCURVE")); } - - + + } } diff --git a/rtgui/labcurve.h b/rtgui/labcurve.h index 765574a67..f41ba29e2 100644 --- a/rtgui/labcurve.h +++ b/rtgui/labcurve.h @@ -81,11 +81,11 @@ public: void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve,/* LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma); virtual void colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller); - - private: + +private: + - }; #endif diff --git a/rtgui/options.cc b/rtgui/options.cc index 5212c6505..44cfca208 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -177,7 +177,7 @@ void Options::updatePaths() if (lastLabCurvesDir.empty() || !safe_file_test (lastLabCurvesDir, Glib::FILE_TEST_EXISTS) || !safe_file_test (lastLabCurvesDir, Glib::FILE_TEST_IS_DIR)) { lastLabCurvesDir = preferredPath; } - + if (lastDehazDir.empty() || !safe_file_test (lastDehazDir, Glib::FILE_TEST_EXISTS) || !safe_file_test (lastLabCurvesDir, Glib::FILE_TEST_IS_DIR)) { lastDehazDir = preferredPath; }