diff --git a/rtengine/EdgePreservingDecomposition.cc b/rtengine/EdgePreservingDecomposition.cc index 927bfac2d..06fe38f2b 100644 --- a/rtengine/EdgePreservingDecomposition.cc +++ b/rtengine/EdgePreservingDecomposition.cc @@ -127,15 +127,13 @@ float *SparseConjugateGradient(void Ax(float *Product, float *x, void *Pass), fl #endif { float c = 0.0f; - float t; - float temp; #ifdef _OPENMP #pragma omp for reduction(+:rs) // Summation with error correction #endif for(int ii = 0; ii < n; ii++) { - temp = r[ii] * s[ii]; - t = rs + temp; + float temp = r[ii] * s[ii]; + float t = rs + temp; if( fabsf(rs) >= fabsf(temp) ) { c += ((rs - t) + temp); @@ -183,7 +181,7 @@ float *SparseConjugateGradient(void Ax(float *Product, float *x, void *Pass), fl return x; } -MultiDiagonalSymmetricMatrix::MultiDiagonalSymmetricMatrix(int Dimension, int NumberOfDiagonalsInLowerTriangle) +MultiDiagonalSymmetricMatrix::MultiDiagonalSymmetricMatrix(int Dimension, int NumberOfDiagonalsInLowerTriangle) : buffer(nullptr), DiagBuffer(nullptr) { n = Dimension; m = NumberOfDiagonalsInLowerTriangle; @@ -305,9 +303,9 @@ SSEFUNCTION void MultiDiagonalSymmetricMatrix::VectorProduct(float* RESTRICT Pro const int chunkSize = (lm - srm) / (omp_get_num_procs() * 32); #else const int chunkSize = (lm - srm) / (omp_get_num_procs() * 8); -#endif #endif #pragma omp parallel +#endif { // First fill the big part in the middle // This can be done without intermediate stores to memory and it can be parallelized too @@ -443,8 +441,8 @@ bool MultiDiagonalSymmetricMatrix::CreateIncompleteCholeskyFactorization(int Max } //It's all initialized? Uhkay. Do the actual math then. - int sss, ss, s; - int k, MaxStartRow = StartRows[m - 1]; //Handy number. + int sss, ss; + int MaxStartRow = StartRows[m - 1]; //Handy number. float **l = ic->Diagonals; float *d = ic->Diagonals[0]; //Describes D in LDLt. int icm = ic->m; @@ -506,8 +504,8 @@ bool MultiDiagonalSymmetricMatrix::CreateIncompleteCholeskyFactorization(int Max //This is a loop over k from 1 to j, inclusive. We'll cover that by looping over the index of the diagonals (s), and get k from it. //The first diagonal is d (k = 0), so skip that and have s start at 1. Cover all available s but stop if k exceeds j. - s = 1; - k = icStartRows[s]; + int s = 1; + int k = icStartRows[s]; while(k <= j) { d[j] -= l[s][j - k] * l[s][j - k] * d[j - k]; @@ -713,9 +711,7 @@ SSEFUNCTION float *EdgePreservingDecomposition::CreateBlur(float *Source, float a = Blur, g = Source; } - int i; int w1 = w - 1, h1 = h - 1; -// float eps = 0.02f; const float sqreps = 0.0004f; // removed eps*eps from inner loop diff --git a/rtengine/LUT.h b/rtengine/LUT.h index 2d3d91ed5..d83a431ca 100644 --- a/rtengine/LUT.h +++ b/rtengine/LUT.h @@ -536,6 +536,8 @@ public: size = 0; upperBound = 0; maxs = 0; + maxsf = 0.f; + clip = 0; } // create an identity LUT (LUT(x) = x) or a scaled identity LUT (LUT(x) = x / divisor) diff --git a/rtengine/array2D.h b/rtengine/array2D.h index db44fcfc8..2d38d2e15 100644 --- a/rtengine/array2D.h +++ b/rtengine/array2D.h @@ -74,7 +74,8 @@ class array2D : { private: - int x, y, owner, flags; + int x, y, owner; + unsigned int flags; T ** ptr; T * data; bool lock; // useful lock to ensure data is not changed anymore. @@ -112,7 +113,7 @@ public: // use as empty declaration, resize before use! // very useful as a member object array2D() : - x(0), y(0), owner(0), ptr(NULL), data(NULL), lock(0) + x(0), y(0), owner(0), ptr(NULL), data(NULL), lock(0), flags(0) { //printf("got empty array2D init\n"); } @@ -285,6 +286,8 @@ public: if (this != &rhs) { + flags = rhs.flags; + lock = rhs.lock; if (!owner) { // we can only copy same size data if ((x != rhs.x) || (y != rhs.y)) { printf(" assignment error in array2D\n"); diff --git a/rtengine/color.cc b/rtengine/color.cc index a23a261b7..6dda2c8b8 100644 --- a/rtengine/color.cc +++ b/rtengine/color.cc @@ -2757,8 +2757,8 @@ SSEFUNCTION void Color::LabGamutMunsell(float *labL, float *laba, float *labb, printf(" Gamut : G1negat=%iiter G165535=%iiter \n", negat, moreRGB); if (MunsDebugInfo) { - printf(" Munsell chrominance: MaxBP=%1.2frad MaxRY=%1.2frad MaxGY=%1.2frad MaxRP=%1.2frad depass=%i\n", MunsDebugInfo->maxdhue[0], MunsDebugInfo->maxdhue[1], MunsDebugInfo->maxdhue[2], MunsDebugInfo->maxdhue[3], MunsDebugInfo->depass); - printf(" Munsell luminance : MaxBP=%1.2frad MaxRY=%1.2frad MaxGY=%1.2frad MaxRP=%1.2frad depass=%i\n", MunsDebugInfo->maxdhuelum[0] , MunsDebugInfo->maxdhuelum[1], MunsDebugInfo->maxdhuelum[2], MunsDebugInfo->maxdhuelum[3], MunsDebugInfo->depassLum); + printf(" Munsell chrominance: MaxBP=%1.2frad MaxRY=%1.2frad MaxGY=%1.2frad MaxRP=%1.2frad depass=%u\n", MunsDebugInfo->maxdhue[0], MunsDebugInfo->maxdhue[1], MunsDebugInfo->maxdhue[2], MunsDebugInfo->maxdhue[3], MunsDebugInfo->depass); + printf(" Munsell luminance : MaxBP=%1.2frad MaxRY=%1.2frad MaxGY=%1.2frad MaxRP=%1.2frad depass=%u\n", MunsDebugInfo->maxdhuelum[0] , MunsDebugInfo->maxdhuelum[1], MunsDebugInfo->maxdhuelum[2], MunsDebugInfo->maxdhuelum[3], MunsDebugInfo->depassLum); } else { printf(" Munsell correction wasn't requested\n"); } diff --git a/rtengine/curves.cc b/rtengine/curves.cc index 9b68cc9ee..4da4a4a36 100644 --- a/rtengine/curves.cc +++ b/rtengine/curves.cc @@ -44,7 +44,7 @@ using namespace std; namespace rtengine { -Curve::Curve () : N(0), x(nullptr), y(nullptr), ypp(nullptr), hashSize(1000 /* has to be initialized to the maximum value */) {} +Curve::Curve () : N(0), ppn(0), x(nullptr), y(nullptr), mc(0.0), mfc(0.0), msc(0.0), mhc(0.0), ypp(nullptr), x1(0.0), y1(0.0), x2(0.0), y2(0.0), x3(0.0), y3(0.0), firstPointIncluded(false), increment(0.0), nbr_points(0), hashSize(1000 /* has to be initialized to the maximum value */) {} void Curve::AddPolygons () { @@ -1434,11 +1434,9 @@ void ColorGradientCurve::SetXYZ(const Curve *pCurve, const double xyz_rgb[3][3], double currY = pCurve->getVal(x) - prevY; if (dY > 0.000001 || dY < -0.000001) { - float r1, g1, b1, r2, g2, b2, ro, go, bo; + float r1, g1, b1, r2, g2, b2; Color::hsv2rgb(float(prevY), satur, lr1, r1, g1, b1); Color::hsv2rgb(float(nextY), satur, lr2, r2, g2, b2); - bool chr = false; - bool lum = true; LUTf dum; float X1, X2, Y1, Y2, Z1, Z2, L1, a_1, b_1, c1, h1; Color::rgbxyz(r2, g2, b2, X2, Y2, Z2, xyz_rgb); diff --git a/rtengine/dfmanager.cc b/rtengine/dfmanager.cc index e06ac27e2..e0dea012b 100644 --- a/rtengine/dfmanager.cc +++ b/rtengine/dfmanager.cc @@ -36,16 +36,18 @@ extern const Settings* settings; inline dfInfo& dfInfo::operator =(const dfInfo &o) { - pathname = o.pathname; - maker = o.maker; - model = o.model; - iso = o.iso; - shutter = o.shutter; - timestamp = o.timestamp; + if (this != &o) { + pathname = o.pathname; + maker = o.maker; + model = o.model; + iso = o.iso; + shutter = o.shutter; + timestamp = o.timestamp; - if( ri ) { - delete ri; - ri = NULL; + if( ri ) { + delete ri; + ri = NULL; + } } return *this; diff --git a/rtengine/ffmanager.cc b/rtengine/ffmanager.cc index 8b26c3121..29121a696 100644 --- a/rtengine/ffmanager.cc +++ b/rtengine/ffmanager.cc @@ -31,17 +31,19 @@ extern const Settings* settings; inline ffInfo& ffInfo::operator =(const ffInfo &o) { - pathname = o.pathname; - maker = o.maker; - model = o.model; - lens = o.lens; - shutter = o.shutter; - focallength = o.focallength; - timestamp = o.timestamp; + if (this != &o) { + pathname = o.pathname; + maker = o.maker; + model = o.model; + lens = o.lens; + focallength = o.focallength; + timestamp = o.timestamp; + aperture = o.aperture; - if( ri ) { - delete ri; - ri = NULL; + if( ri ) { + delete ri; + ri = NULL; + } } return *this; diff --git a/rtengine/ffmanager.h b/rtengine/ffmanager.h index 5f6b2d267..f081c5e33 100644 --- a/rtengine/ffmanager.h +++ b/rtengine/ffmanager.h @@ -34,8 +34,6 @@ public: std::string maker; ///< manufacturer std::string model; ///< model std::string lens; ///< lens - int iso; ///< ISO (gain) - double shutter; ///< shutter or exposure time in sec double aperture; ///< aperture in stops double focallength; ///< focal length in mm time_t timestamp; ///< seconds since 1 Jan 1970 diff --git a/rtengine/imagesource.h b/rtengine/imagesource.h index 305c67da5..65b2b76c0 100644 --- a/rtengine/imagesource.h +++ b/rtengine/imagesource.h @@ -41,10 +41,10 @@ class ImageMatrices { public: - double rgb_cam[3][3]; - double cam_rgb[3][3]; - double xyz_cam[3][3]; - double cam_xyz[3][3]; + double rgb_cam[3][3] = {}; + double cam_rgb[3][3] = {}; + double xyz_cam[3][3] = {}; + double cam_xyz[3][3] = {}; }; class ImageSource : public InitialImage diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 8925b29e0..20eea3011 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -40,8 +40,6 @@ ImProcCoordinator::ImProcCoordinator () hltonecurve(65536), shtonecurve(65536), tonecurve(65536, 0), //,1); - chaut(0.f), redaut(0.f), blueaut(0.f), maxredaut(0.f), maxblueaut(0.f), minredaut(0.f), minblueaut(0.f), nresi(0.f), - chromina(0.f), sigma(0.f), lumema(0.f), lumacurve(32770, 0), // lumacurve[32768] and lumacurve[32769] will be set to 32768 and 32769 later to allow linear interpolation chroma_acurve(65536, 0), chroma_bcurve(65536, 0), @@ -84,11 +82,12 @@ ImProcCoordinator::ImProcCoordinator () rcurvehist(256), rcurvehistCropped(256), rbeforehist(256), gcurvehist(256), gcurvehistCropped(256), gbeforehist(256), bcurvehist(256), bcurvehistCropped(256), bbeforehist(256), + fw(0), fh(0), tr(0), fullw(1), fullh(1), pW(-1), pH(-1), plistener(NULL), imageListener(NULL), aeListener(NULL), acListener(NULL), abwListener(NULL), actListener(NULL), adnListener(NULL), awavListener(NULL), dehaListener(NULL), hListener(NULL), - resultValid(false), changeSinceLast(0), updaterRunning(false), destroying(false), utili(false), autili(false), wavcontlutili(false), - butili(false), ccutili(false), cclutili(false), clcutili(false), opautili(false), conversionBuffer(1, 1) + resultValid(false), thread(NULL), changeSinceLast(0), updaterRunning(false), destroying(false), utili(false), autili(false), wavcontlutili(false), + butili(false), ccutili(false), cclutili(false), clcutili(false), opautili(false), conversionBuffer(1, 1), colourToningSatLimit(0.f), colourToningSatLimitOpacity(0.f) {} @@ -138,9 +137,6 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) int readyphase = 0; bwAutoR = bwAutoG = bwAutoB = -9000.f; - chaut = redaut = blueaut = maxredaut = maxblueaut = nresi = highresi = 0.f; - chromina = sigma = lumema = 0.f; - minredaut = minblueaut = 10000.f; if (todo == CROP && ipf.needsPCVignetting()) { todo |= TRANSFORM; // Change about Crop does affect TRANSFORM @@ -443,11 +439,11 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) params.toneCurve.hlcompr, params.toneCurve.hlcomprthresh, params.toneCurve.shcompr, params.toneCurve.brightness, params.toneCurve.contrast, params.toneCurve.curveMode, params.toneCurve.curve, params.toneCurve.curveMode2, params.toneCurve.curve2, - vhist16, hltonecurve, shtonecurve, tonecurve, histToneCurve, customToneCurve1, customToneCurve2, scale == 1 ? 1 : 1); + vhist16, hltonecurve, shtonecurve, tonecurve, histToneCurve, customToneCurve1, customToneCurve2, 1); - CurveFactory::RGBCurve (params.rgbCurves.rcurve, rCurve, scale == 1 ? 1 : 1); - CurveFactory::RGBCurve (params.rgbCurves.gcurve, gCurve, scale == 1 ? 1 : 1); - CurveFactory::RGBCurve (params.rgbCurves.bcurve, bCurve, scale == 1 ? 1 : 1); + CurveFactory::RGBCurve (params.rgbCurves.rcurve, rCurve, 1); + CurveFactory::RGBCurve (params.rgbCurves.gcurve, gCurve, 1); + CurveFactory::RGBCurve (params.rgbCurves.bcurve, bCurve, 1); opautili = false; @@ -471,7 +467,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) } if(params.blackwhite.enabled) { - CurveFactory::curveBW (params.blackwhite.beforeCurve, params.blackwhite.afterCurve, vhist16bw, histToneCurveBW, beforeToneCurveBW, afterToneCurveBW, scale == 1 ? 1 : 1); + CurveFactory::curveBW (params.blackwhite.beforeCurve, params.blackwhite.afterCurve, vhist16bw, histToneCurveBW, beforeToneCurveBW, afterToneCurveBW, 1); } colourToningSatLimit = float(params.colorToning.satProtectionThreshold) / 100.f * 0.7f + 0.3f; diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index 0fb0041f3..dd901789f 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -90,7 +90,6 @@ protected: LUTf hltonecurve; LUTf shtonecurve; LUTf tonecurve; - float chaut, redaut, blueaut, maxredaut, maxblueaut, minredaut, minblueaut, nresi, highresi, chromina, sigma, lumema; LUTf lumacurve; LUTf chroma_acurve; @@ -327,7 +326,7 @@ public: } struct DenoiseInfoStore { - DenoiseInfoStore () : valid(false) {} + DenoiseInfoStore () : chM(0), max_r{}, max_b{}, ch_M{}, valid(false) {} float chM; float max_r[9]; float max_b[9]; diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 1f41dd6b4..b170ba52f 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -524,7 +524,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh xw2 = xwd; yw2 = ywd; zw2 = zwd; - } else if(params->colorappearance.wbmodel == "RawTCAT02") { + } else /*if(params->colorappearance.wbmodel == "RawTCAT02")*/ { xw1 = xw; // Settings RT WB are used for CAT02 => mix , CAT02 is use for output device (screen: D50 D65, projector: lamp, LED) see preferences yw1 = yw; zw1 = zw; @@ -1034,7 +1034,6 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh // if(!params->epd.enabled || !params->colorappearance.tonecie || !settings->autocielab){ // if(!params->epd.enabled || !params->colorappearance.tonecie || !params->colorappearance.sharpcie){ - int posl, posc; double brli = 327.; double chsacol = 327.; int libr = 0; @@ -1065,9 +1064,10 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh jp = true; if(pW != 1) { //only with improccoordinator + int posl; if(libr == 1) { posl = CLIP((int)(Q * brli)); //40.0 to 100.0 approximative factor for Q - 327 for J - } else if(libr == 0) { + } else /*if(libr == 0)*/ { posl = CLIP((int)(J * brli)); //327 for J } @@ -1077,11 +1077,12 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh chropC = true; if(pW != 1) { //only with improccoordinator + int posc; if(colch == 0) { posc = CLIP((int)(C * chsacol)); //450.0 approximative factor for s 320 for M } else if(colch == 1) { posc = CLIP((int)(s * chsacol)); - } else if(colch == 2) { + } else /*if(colch == 2)*/ { posc = CLIP((int)(M * chsacol)); } @@ -1303,7 +1304,6 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh ncie->C_p[i][j] = (ncie->M_p[i][j]) / co_e; //show histogram in CIECAM mode (Q,J, M,s,C) - int posl, posc; double brli = 327.; double chsacol = 327.; int libr = 0; @@ -1335,9 +1335,10 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh jp = true; if(pW != 1) { //only with improccoordinator + int posl; if(libr == 1) { posl = CLIP((int)(ncie->Q_p[i][j] * brli)); //40.0 to 100.0 approximative factor for Q - 327 for J - } else if(libr == 0) { + } else /*if(libr == 0)*/ { posl = CLIP((int)(ncie->J_p[i][j] * brli)); //327 for J } @@ -1347,12 +1348,13 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh chropC = true; if(pW != 1) { //only with improccoordinator + int posc; if(colch == 0) { posc = CLIP((int)(ncie->C_p[i][j] * chsacol)); //450.0 approximative factor for s 320 for M } else if(colch == 1) { sa_t = 100.f * sqrt(ncie->C_p[i][j] / ncie->Q_p[i][j]); //Q_p always > 0 posc = CLIP((int)(sa_t * chsacol)); - } else if(colch == 2) { + } else /*if(colch == 2)*/ { posc = CLIP((int)(ncie->M_p[i][j] * chsacol)); } @@ -1822,7 +1824,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int xw2 = xwd; yw2 = ywd; zw2 = zwd; - } else if(params->colorappearance.wbmodel == "RawTCAT02") { + } else /*if(params->colorappearance.wbmodel == "RawTCAT02")*/ { xw1 = xw; // Settings RT WB are used for CAT02 => mix , CAT02 is use for output device (screen: D50 D65, projector: lamp, LED) see preferences yw1 = yw; zw1 = zw; @@ -2680,8 +2682,6 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int for (int i = 0; i < height; i++) { // update CIECAM with new values after tone-mapping for (int j = 0; j < width; j++) { - float xx, yy, zz; - float x, y, z; // if(epdEnabled) ncie->J_p[i][j]=(100.0f* ncie->Q_p[i][j]*ncie->Q_p[i][j])/(w_h*w_h); if(epdEnabled) { @@ -4663,7 +4663,6 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer for (int i = 0; i < tH; i++) { for (int j = 0; j < tW; j++) { - float h, s, l; float r = tmpImage->r(i, j); float g = tmpImage->g(i, j); float b = tmpImage->b(i, j); diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index ce65bc2f8..7401c871c 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -194,27 +194,9 @@ public: }; double lumimul[3]; -// float chau; -// float chred; -// float chblue; -// float maxchred; -// float maxchblue; -// float minchred; -// float minchblue; -// float resid;//used by noise_residual -// float residred;//used by noise_residual -// float residblue;//used by noise_residual -// int nb; - int nbresid; - float redresid; - float blueresid; -// float maxredresid;//used by noise_residual -// float maxblueresid;//used by noise_residual -// int comptlevel; - ImProcFunctions (const ProcParams* iparams, bool imultiThread = true) - : monitorTransform(NULL), lab2outputTransform(NULL), output2monitorTransform(NULL), params(iparams), scale(1), multiThread(imultiThread) {} + : monitorTransform(NULL), lab2outputTransform(NULL), output2monitorTransform(NULL), params(iparams), scale(1), multiThread(imultiThread), lumimul{} {} ~ImProcFunctions (); void setScale (double iscale); diff --git a/rtgui/rawprocess.cc b/rtgui/rawprocess.cc deleted file mode 100644 index 0ca4350cc..000000000 --- a/rtgui/rawprocess.cc +++ /dev/null @@ -1,303 +0,0 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include "rawprocess.h" -#include "options.h" -#include "guiutils.h" -using namespace rtengine; -using namespace rtengine::procparams; - -RawProcess::RawProcess () : FoldableToolPanel(this) -{ - Gtk::HBox* hb1 = Gtk::manage (new Gtk::HBox ()); - hb1->pack_start (*Gtk::manage (new Gtk::Label ( M("TP_RAW_DMETHOD") + ": ")), Gtk::PACK_SHRINK, 4); - dmethod = Gtk::manage (new MyComboBoxText ()); - - for( size_t i = 0; i < procparams::RAWParams::numMethods; i++) { - dmethod->append_text(procparams::RAWParams::methodstring[i]); - } - - dmethod->set_active(0); - hb1->set_tooltip_markup (M("TP_RAW_DMETHOD_TOOLTIP")); - - hb1->pack_end (*dmethod, Gtk::PACK_EXPAND_WIDGET, 4); - pack_start( *hb1, Gtk::PACK_SHRINK, 4); - - dcbOptions = Gtk::manage (new Gtk::VBox ()); - dcbOptions->set_border_width(4); - - dcbIterations = Gtk::manage (new Adjuster (M("TP_RAW_DCBITERATIONS"), 0, 5, 1, 2)); - dcbIterations->setAdjusterListener (this); - - if (dcbIterations->delay < options.adjusterMaxDelay) { - dcbIterations->delay = options.adjusterMaxDelay; - } - - dcbIterations->show(); - dcbEnhance = Gtk::manage (new Gtk::CheckButton(M("TP_RAW_DCBENHANCE"))); - dcbOptions->pack_start(*dcbIterations); - dcbOptions->pack_start(*dcbEnhance); - pack_start( *dcbOptions, Gtk::PACK_SHRINK, 4); - - lmmseOptions = Gtk::manage (new Gtk::VBox ()); - lmmseOptions->set_border_width(4); - - lmmseIterations = Gtk::manage (new Adjuster (M("TP_RAW_LMMSEITERATIONS"), 0, 6, 1, 2)); - lmmseIterations->setAdjusterListener (this); - lmmseIterations->set_tooltip_markup (M("TP_RAW_LMMSE_TOOLTIP")); - - if (lmmseIterations->delay < options.adjusterMaxDelay) { - lmmseIterations->delay = options.adjusterMaxDelay; - } - - lmmseIterations->show(); - lmmseOptions->pack_start(*lmmseIterations); - pack_start( *lmmseOptions, Gtk::PACK_SHRINK, 4); - - pack_start( *Gtk::manage( new Gtk::HSeparator()), Gtk::PACK_SHRINK, 0 ); - ccSteps = Gtk::manage (new Adjuster (M("TP_RAW_FALSECOLOR"), 0, 5, 1, 0 )); - ccSteps->setAdjusterListener (this); - - if (ccSteps->delay < options.adjusterMaxDelay) { - ccSteps->delay = options.adjusterMaxDelay; - } - - ccSteps->show(); - pack_start( *ccSteps, Gtk::PACK_SHRINK, 4); - - //pack_start( *Gtk::manage( new Gtk::HSeparator()), Gtk::PACK_SHRINK, 0 ); - //allOptions = Gtk::manage (new Gtk::VBox ()); - //allOptions->set_border_width(2); - //allEnhance = Gtk::manage (new Gtk::CheckButton(M("TP_RAW_ALLENHANCE"))); - //allOptions->pack_start(*allEnhance); - //pack_start( *allOptions, Gtk::PACK_SHRINK, 4); - - methodconn = dmethod->signal_changed().connect( sigc::mem_fun(*this, &RawProcess::methodChanged) ); - dcbEnhconn = dcbEnhance->signal_toggled().connect ( sigc::mem_fun(*this, &RawProcess::dcbEnhanceChanged), true); - //allEnhconn = allEnhance->signal_toggled().connect ( sigc::mem_fun(*this, &RawProcess::allEnhanceChanged), true); -} - - -void RawProcess::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited) -{ - disableListener (); - methodconn.block (true); - dcbEnhconn.block (true); - //allEnhconn.block (true); - - dmethod->set_active(procparams::RAWParams::numMethods); - - for( size_t i = 0; i < procparams::RAWParams::numMethods; i++) - if( pp->raw.dmethod == procparams::RAWParams::methodstring[i]) { - dmethod->set_active(i); - oldSelection = i; - break; - } - - if(pedited ) { - ccSteps->setEditedState (pedited->raw.ccSteps ? Edited : UnEdited); - dcbIterations->setEditedState ( pedited->raw.dcbIterations ? Edited : UnEdited); - dcbEnhance->set_inconsistent(!pedited->raw.dcbEnhance); - //allEnhance->set_inconsistent(!pedited->raw.allEnhance); - lmmseIterations->setEditedState ( pedited->raw.lmmseIterations ? Edited : UnEdited); - - if( !pedited->raw.dmethod ) { - dmethod->set_active(procparams::RAWParams::numMethods); // No name - } - } - - //allEnhance->set_active(pp->raw.all_enhance); - - dcbIterations->setValue (pp->raw.dcb_iterations); - dcbEnhance->set_active(pp->raw.dcb_enhance); - ccSteps->setValue (pp->raw.ccSteps); - - if (pp->raw.dmethod == procparams::RAWParams::methodstring[procparams::RAWParams::dcb] || - dmethod->get_active_row_number() == procparams::RAWParams::numMethods) { - dcbOptions->show(); - } else { - dcbOptions->hide(); - } - - lmmseIterations->setValue (pp->raw.lmmse_iterations); - - if (pp->raw.dmethod == procparams::RAWParams::methodstring[procparams::RAWParams::lmmse] || - dmethod->get_active_row_number() == procparams::RAWParams::numMethods) { - lmmseOptions->show(); - } else { - lmmseOptions->hide(); - } - - // Flase color suppression is applied to all demozaicing method, so don't hide anything - /*if (pp->raw.dmethod == procparams::RAWParams::methodstring[procparams::RAWParams::eahd] || - pp->raw.dmethod == procparams::RAWParams::methodstring[procparams::RAWParams::hphd] || - pp->raw.dmethod == procparams::RAWParams::methodstring[procparams::RAWParams::vng4]) - ccSteps->show(); - else - ccSteps->hide();*/ - - lastDCBen = pp->raw.dcb_enhance; - //lastALLen = pp->raw.all_enhance; - - methodconn.block (false); - dcbEnhconn.block (false); - //allEnhconn.block (false); - - enableListener (); -} - -void RawProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedited) -{ - pp->raw.ccSteps = ccSteps->getIntValue(); - pp->raw.dcb_iterations = dcbIterations->getIntValue(); - pp->raw.dcb_enhance = dcbEnhance->get_active(); - //pp->raw.all_enhance = allEnhance->get_active(); - pp->raw.lmmse_iterations = lmmseIterations->getIntValue(); - - int currentRow = dmethod->get_active_row_number(); - - if( currentRow >= 0 && currentRow < procparams::RAWParams::numMethods) { - pp->raw.dmethod = procparams::RAWParams::methodstring[currentRow]; - } - - if (pedited) { - pedited->raw.ccSteps = ccSteps->getEditedState (); - pedited->raw.dmethod = dmethod->get_active_row_number() != procparams::RAWParams::numMethods; - pedited->raw.dcbIterations = dcbIterations->getEditedState (); - pedited->raw.dcbEnhance = !dcbEnhance->get_inconsistent(); - //pedited->raw.allEnhance = !allEnhance->get_inconsistent(); - pedited->raw.lmmseIterations = lmmseIterations->getEditedState (); - - } -} - -void RawProcess::setBatchMode(bool batchMode) -{ - dmethod->append_text (M("GENERAL_UNCHANGED")); - dmethod->set_active(procparams::RAWParams::numMethods); // No name - dcbOptions->hide(); - lmmseOptions->hide(); - ToolPanel::setBatchMode (batchMode); - ccSteps->showEditedCB (); - dcbIterations->showEditedCB (); - lmmseIterations->showEditedCB (); - -} - -void RawProcess::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited) -{ - dcbIterations->setDefault( defParams->raw.dcb_iterations); - lmmseIterations->setDefault( defParams->raw.lmmse_iterations); - ccSteps->setDefault (defParams->raw.ccSteps); - - if (pedited) { - dcbIterations->setDefaultEditedState( pedited->raw.dcbIterations ? Edited : UnEdited); - lmmseIterations->setDefaultEditedState( pedited->raw.lmmseIterations ? Edited : UnEdited); - ccSteps->setDefaultEditedState(pedited->raw.ccSteps ? Edited : UnEdited); - } else { - dcbIterations->setDefaultEditedState( Irrelevant ); - lmmseIterations->setDefaultEditedState( Irrelevant ); - ccSteps->setDefaultEditedState(Irrelevant ); - } -} - -void RawProcess::adjusterChanged (Adjuster* a, double newval) -{ - if (listener) { - if (a == dcbIterations) { - listener->panelChanged (EvDemosaicDCBIter, a->getTextValue() ); - } else if (a == ccSteps) { - listener->panelChanged (EvDemosaicFalseColorIter, a->getTextValue() ); - } else if (a == lmmseIterations) { - listener->panelChanged (EvDemosaicLMMSEIter, a->getTextValue() ); - } - - } -} - -void RawProcess::methodChanged () -{ - int curSelection = dmethod->get_active_row_number(); - - if ( curSelection == procparams::RAWParams::dcb) { - dcbOptions->show(); - } else { - dcbOptions->hide(); - } - - if ( curSelection == procparams::RAWParams::lmmse) { - lmmseOptions->show(); - } else { - lmmseOptions->hide(); - } - - Glib::ustring methodName = ""; - bool ppreq = false; - - if( curSelection >= 0 && curSelection < procparams::RAWParams::numMethods) { - methodName = procparams::RAWParams::methodstring[curSelection]; - - if (curSelection == procparams::RAWParams::mono || oldSelection == procparams::RAWParams::mono) { - ppreq = true; - } - } - - oldSelection = curSelection; - - if (listener) { - listener->panelChanged (ppreq ? EvDemosaicMethodPreProc : EvDemosaicMethod, methodName); - } -} - -void RawProcess::dcbEnhanceChanged () -{ - if (batchMode) { - if (dcbEnhance->get_inconsistent()) { - dcbEnhance->set_inconsistent (false); - dcbEnhconn.block (true); - dcbEnhance->set_active (false); - dcbEnhconn.block (false); - } else if (lastDCBen) { - dcbEnhance->set_inconsistent (true); - } - - lastDCBen = dcbEnhance->get_active (); - } - - if (listener) { - listener->panelChanged (EvDemosaicDCBEnhanced, dcbEnhance->get_active() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED")); - } -} - -/*void RawProcess::allEnhanceChanged () -{ - if (batchMode) { - if (allEnhance->get_inconsistent()) { - allEnhance->set_inconsistent (false); - allEnhconn.block (true); - allEnhance->set_active (false); - allEnhconn.block (false); - } - else if (lastALLen) - allEnhance->set_inconsistent (true); - - lastALLen = allEnhance->get_active (); - } - if (listener) - listener->panelChanged (EvDemosaicALLEnhanced, allEnhance->get_active()?M("GENERAL_ENABLED"):M("GENERAL_DISABLED")); -}*/ diff --git a/rtgui/rawprocess.h b/rtgui/rawprocess.h deleted file mode 100644 index 85c1c9f44..000000000 --- a/rtgui/rawprocess.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _RAWPROCESS_H_ -#define _RAWPROCESS_H_ - -#include -#include "adjuster.h" -#include "guiutils.h" -#include "toolpanel.h" - - -class RawProcess : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel -{ - -protected: - - MyComboBoxText* dmethod; - Gtk::Label* methodl; - Adjuster* ccSteps; - Gtk::VBox *dcbOptions; - Adjuster* dcbIterations; - Gtk::CheckButton* dcbEnhance; - //Gtk::VBox *allOptions; - //Gtk::CheckButton* allEnhance; - Gtk::VBox *lmmseOptions; - Adjuster* lmmseIterations; - - bool lastDCBen; - int oldSelection; - //bool lastALLen; - sigc::connection methodconn, dcbEnhconn; //,allEnhconn; -public: - - RawProcess (); - - void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = NULL); - void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = NULL); - void setBatchMode (bool batchMode); - void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = NULL); - - void methodChanged (); - void adjusterChanged (Adjuster* a, double newval); - void dcbEnhanceChanged(); - //void allEnhanceChanged(); - -}; - -#endif diff --git a/rtgui/thumbbrowserentry.cc b/rtgui/thumbbrowserentry.cc deleted file mode 100644 index 1c491a641..000000000 --- a/rtgui/thumbbrowserentry.cc +++ /dev/null @@ -1,69 +0,0 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#include - -FileBrowserEntry::FileBrowserEntry (Thumbnail* thm, const Glib::ustring& fname) - : ThumbBrowserEntryBase (fname), thumbnail(thm) -{ - - previewOwner = false; - italicstyle = thumbnail->getType() != FT_Raw; - datetimeline = thumbnail->getDateTimeString (); - exifline = thumbnail->getExifString (); -} - -void ThumbBrowserEntry::obtainThumbnailSize () -{ - - if (thumbnail) { - thumbnail->getThumbnailSize (prew, preh); - } -} -Glib::RefPtr ThumbBrowserEntry::editedIcon; -Glib::RefPtr ThumbBrowserEntry::recentlySavedIcon; -Glib::RefPtr ThumbBrowserEntry::enqueuedIcon; -std::vector > ThumbBrowserEntry::getIconsOnImageArea () -{ - - std::vector > ret; - - if (!thumbnail) { - return ret; - } - - if (thumbnail->hasProcParams() && editedIcon) { - ret.push_back (editedIcon); - } - - if (thumbnail->isRecentlySaved() && recentlySavedIcon) { - ret.push_back (recentlySavedIcon); - } - - if (thumbnail->isEnqueued () && enqueuedIcon) { - ret.push_back (enqueuedIcon); - } - - return ret; -} - -ThumbnailButtonSet* ThumbBrowserEntry::getThumbButtonSet () -{ - - return (ThumbnailButtonSet*)buttonSet; -}