From fea35baf69300de63680ffdb94a5a6135abb548c Mon Sep 17 00:00:00 2001 From: Desmis Date: Mon, 1 Feb 2016 10:55:34 +0100 Subject: [PATCH] Try to solved iplab2rgb ipwavelet partialpasted retinex --- rtengine/iplab2rgb.cc | 8 ++++++++ rtengine/ipwavelet.cc | 8 ++++++-- rtengine/procparams.cc | 7 ++++++- rtgui/partialpastedlg.h | 2 +- rtgui/retinex.cc | 2 +- 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/rtengine/iplab2rgb.cc b/rtengine/iplab2rgb.cc index c36e185d0..9dd68d29a 100644 --- a/rtengine/iplab2rgb.cc +++ b/rtengine/iplab2rgb.cc @@ -386,6 +386,14 @@ Image16* ImProcFunctions::lab2rgb16b (LabImage* lab, int cx, int cy, int cw, int Image16* image = new Image16 (cw, ch); float p1, p2, p3, p4, p5, p6; //primaries + //default primaries + p1 = 0.7347; //Prophoto primaries + p2 = 0.2653; + p3 = 0.1596; + p4 = 0.8404; + p5 = 0.0366; + p6 = 0.0001; + //double ga0,ga1,ga2,ga3,ga4,ga5=0.0,ga6=0.0;//gamma parameters double g_a0, g_a1, g_a2, g_a3, g_a4, g_a5; //gamma parameters double pwr; diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 8680a17dc..fd672f2b7 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -2032,7 +2032,8 @@ void ImProcFunctions::WaveletcontAllL(LabImage * labco, float ** varhue, float * if(cp.lip3 && cp.lipp) { // comparaison betwwen pixel and neighbours - float kneigh, somm; + float kneigh = 38.f; + float somm = 50.f; if(cp.neigh == 0) { kneigh = 38.f; @@ -3191,7 +3192,9 @@ void ImProcFunctions::ContAllL (float *koeLi[12], float *maxkoeLi, bool lipschit float scale = 1.f; float scale2 = 1.f; - float LL100, LL100res, LL100init, kH[maxlvl]; + float LL100, LL100res, LL100init;// kH[maxlvl]; + float *kH = new float [maxlvl];//allocate memory + int ii = i / W_L; int jj = i - ii * W_L; float LL = labco->L[ii * 2][jj * 2]; @@ -3307,6 +3310,7 @@ void ImProcFunctions::ContAllL (float *koeLi[12], float *maxkoeLi, bool lipschit kLlev = alpha; } + delete [] kH; WavCoeffs_L[dir][i] *= (kLlev); } } diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 90eafe375..f79f51c91 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2609,17 +2609,21 @@ int ProcParams::save (Glib::ustring fname, Glib::ustring fname2, bool fnameAbsol if (!pedited || pedited->icm.outputIntent) { Glib::ustring intent; + switch (icm.outputIntent) { default: case RI_PERCEPTUAL: intent = "Perceptual"; break; + case RI_RELATIVE: intent = "Relative"; break; + case RI_SATURATION: intent = "Saturation"; break; + case RI_ABSOLUTE: intent = "Absolute"; break; @@ -4110,7 +4114,7 @@ int ProcParams::load (Glib::ustring fname, ParamsEdited* pedited) if (keyFile.has_key ("Retinex", "Radius")) { - sh.radius = keyFile.get_integer ("Retinex", "Radius"); + retinex.radius = keyFile.get_integer ("Retinex", "Radius"); if (pedited) { pedited->retinex.radius = true; @@ -5845,6 +5849,7 @@ int ProcParams::load (Glib::ustring fname, ParamsEdited* pedited) if (keyFile.has_key ("Color Management", "OutputProfileIntent")) { Glib::ustring intent = keyFile.get_string ("Color Management", "OutputProfileIntent"); + if (intent == "Perceptual") { icm.outputIntent = RI_PERCEPTUAL; } else if (intent == "Relative") { diff --git a/rtgui/partialpastedlg.h b/rtgui/partialpastedlg.h index 86f7fd1c2..b443f9dc6 100644 --- a/rtgui/partialpastedlg.h +++ b/rtgui/partialpastedlg.h @@ -67,7 +67,7 @@ public: // options in color: Gtk::CheckButton* icm; - Gtk::CheckButton* gam; + // Gtk::CheckButton* gam; Gtk::CheckButton* vibrance; Gtk::CheckButton* chmixer; Gtk::CheckButton* blackwhite; diff --git a/rtgui/retinex.cc b/rtgui/retinex.cc index 3d9a56fc3..561a28edf 100644 --- a/rtgui/retinex.cc +++ b/rtgui/retinex.cc @@ -1327,12 +1327,12 @@ void Retinex::trimValues (rtengine::procparams::ProcParams* pp) limd->trimValue(pp->retinex.limd); highl->trimValue(pp->retinex.highl); baselog->trimValue(pp->retinex.baselog); -// grbl->trimValue(pp->retinex.grbl); gam->trimValue(pp->retinex.gam); slope->trimValue(pp->retinex.slope); highlights->trimValue(pp->retinex.highlights); shadows->trimValue(pp->retinex.shadows); + } void Retinex::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve,/* LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histLRETI) {