diff --git a/CMakeLists.txt b/CMakeLists.txt index b5626512a..d7368f115 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,6 +89,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PROC_FLAGS}") # Stop compilation on typos such as std:swap (missing colon will be detected as unused label): set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=unused-label") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=delete-incomplete") # Special treatment for x87 and x86-32 SSE (see GitHub issue #4324) include(FindX87Math) diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index a2d68402f..36b2fa05f 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -28,6 +28,7 @@ #include "gauss.h" #include "median.h" #include "StopWatch.h" + namespace { bool LinEqSolve(int nDim, double* pfMatr, double* pfVect, double* pfSolution) @@ -106,10 +107,6 @@ bool LinEqSolve(int nDim, double* pfMatr, double* pfVect, double* pfSolution) //end of linear equation solver } -namespace rtengine { - extern const Settings* settings; -} - using namespace std; using namespace rtengine; @@ -198,7 +195,7 @@ float* RawImageSource::CA_correct_RT( //block CA shift values and weight assigned to block float* const blockwt = buffer + (height * width); - memset(blockwt, 0, vblsz * hblsz * (2 * 2 + 1) * sizeof(float)); + memset(blockwt, 0, static_cast(vblsz) * hblsz * (2 * 2 + 1) * sizeof(float)); float (*blockshifts)[2][2] = (float (*)[2][2])(blockwt + vblsz * hblsz); // Because we can't break parallel processing, we need a switch do handle the errors diff --git a/rtengine/CMakeLists.txt b/rtengine/CMakeLists.txt index df586357c..1750e0572 100644 --- a/rtengine/CMakeLists.txt +++ b/rtengine/CMakeLists.txt @@ -124,7 +124,6 @@ set(RTENGINESOURCEFILES rtthumbnail.cc shmap.cc simpleprocess.cc - slicer.cc stdimagesource.cc tmo_fattal02.cc utils.cc diff --git a/rtengine/EdgePreservingDecomposition.cc b/rtengine/EdgePreservingDecomposition.cc index baa5df5aa..a8d3575cf 100644 --- a/rtengine/EdgePreservingDecomposition.cc +++ b/rtengine/EdgePreservingDecomposition.cc @@ -4,8 +4,7 @@ #ifdef _OPENMP #include #endif -#include "sleef.c" -#include "opthelper.h" +#include "sleef.h" #define DIAGONALS 5 #define DIAGONALSP1 6 diff --git a/rtengine/FTblockDN.cc b/rtengine/FTblockDN.cc index fac02f47b..806122f3b 100644 --- a/rtengine/FTblockDN.cc +++ b/rtengine/FTblockDN.cc @@ -23,25 +23,34 @@ //////////////////////////////////////////////////////////////// #include + #include -#include "../rtgui/threadutils.h" -#include "rtengine.h" -#include "improcfun.h" -#include "LUT.h" + #include "array2D.h" -#include "iccmatrices.h" #include "boxblur.h" -#include "rt_math.h" -#include "mytime.h" -#include "sleef.c" -#include "opthelper.h" #include "cplx_wavelet_dec.h" -#include "median.h" +#include "color.h" +#include "curves.h" +#include "iccmatrices.h" #include "iccstore.h" +#include "imagefloat.h" +#include "improcfun.h" +#include "labimage.h" +#include "LUT.h" +#include "median.h" +#include "mytime.h" +#include "opthelper.h" #include "procparams.h" +#include "rt_math.h" +#include "sleef.h" + +#include "../rtgui/threadutils.h" +#include "../rtgui/options.h" + #ifdef _OPENMP #include #endif + //#define BENCHMARK #include "StopWatch.h" @@ -69,11 +78,7 @@ namespace rtengine */ -//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -extern const Settings* settings; extern MyMutex *fftwMutex; diff --git a/rtengine/LUT.h b/rtengine/LUT.h index 34f572f58..a80e5996d 100644 --- a/rtengine/LUT.h +++ b/rtengine/LUT.h @@ -56,21 +56,18 @@ * LUTuc stands for LUT */ -#ifndef LUT_H_ -#define LUT_H_ +#pragma once #include #include #include #ifndef NDEBUG -#include #include #endif #include "opthelper.h" #include "rt_math.h" -#include "noncopyable.h" // Bit representations of flags enum { @@ -485,26 +482,6 @@ public: return (p1 + p2 * diff); } -#ifndef NDEBUG - // Debug facility ; dump the content of the LUT in a file. No control of the filename is done - void dump(Glib::ustring fname) - { - if (size) { - Glib::ustring fname_ = fname + ".xyz"; // TopSolid'Design "plot" file format - std::ofstream f (fname_.c_str()); - f << "$" << std::endl; - - for (unsigned int iter = 0; iter < size; iter++) { - f << iter << ", " << data[iter] << ", 0." << std::endl; - } - - f << "$" << std::endl; - f.close (); - } - } -#endif - - operator bool (void) const { return size > 0; @@ -649,5 +626,3 @@ public: }; - -#endif /* LUT_H_ */ diff --git a/rtengine/PF_correct_RT.cc b/rtengine/PF_correct_RT.cc index 7df042663..9a95b8e2f 100644 --- a/rtengine/PF_correct_RT.cc +++ b/rtengine/PF_correct_RT.cc @@ -29,8 +29,12 @@ #include "gauss.h" #include "improcfun.h" -#include "sleef.c" -#include "../rtgui/myflatcurve.h" +#include "cieimage.h" +#include "color.h" +#include "curves.h" +#include "labimage.h" +#include "sleef.h" +#include "curves.h" #include "rt_math.h" #include "opthelper.h" #include "median.h" diff --git a/rtengine/ahd_demosaic_RT.cc b/rtengine/ahd_demosaic_RT.cc index b3a34295c..88ab0bf56 100644 --- a/rtengine/ahd_demosaic_RT.cc +++ b/rtengine/ahd_demosaic_RT.cc @@ -27,7 +27,6 @@ #include "rtengine.h" #include "rawimagesource.h" #include "rt_math.h" -#include "procparams.h" #include "../rtgui/multilangmgr.h" #include "median.h" //#define BENCHMARK diff --git a/rtengine/alignedbuffer.h b/rtengine/alignedbuffer.h index b2c720bd8..05a965766 100644 --- a/rtengine/alignedbuffer.h +++ b/rtengine/alignedbuffer.h @@ -16,8 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _ALIGNEDBUFFER_ -#define _ALIGNEDBUFFER_ +#pragma once #include #include @@ -142,5 +141,3 @@ public: return unitSize ? allocatedSize / unitSize : 0; } }; - -#endif diff --git a/rtengine/amaze_demosaic_RT.cc b/rtengine/amaze_demosaic_RT.cc index 43aef0f71..11ff1f5a0 100644 --- a/rtengine/amaze_demosaic_RT.cc +++ b/rtengine/amaze_demosaic_RT.cc @@ -30,10 +30,9 @@ #include "rawimagesource.h" #include "rt_math.h" #include "../rtgui/multilangmgr.h" -#include "sleef.c" +#include "sleef.h" #include "opthelper.h" #include "median.h" -#include "procparams.h" #include "StopWatch.h" namespace rtengine diff --git a/rtengine/array2D.h b/rtengine/array2D.h index 7713cd55c..208dab1aa 100644 --- a/rtengine/array2D.h +++ b/rtengine/array2D.h @@ -52,8 +52,8 @@ * * !! locked arrays cannot be resized and cannot be unlocked again !! */ -#ifndef ARRAY2D_H_ -#define ARRAY2D_H_ +#pragma once + #include // for raise() #include @@ -249,7 +249,7 @@ public: ar_realloc(w, h, offset); if (flags & ARRAY2D_CLEAR_DATA) { - memset(data + offset, 0, w * h * sizeof(T)); + memset(data + offset, 0, static_cast(w) * h * sizeof(T)); } } @@ -313,4 +313,3 @@ public: return list[index]; } }; -#endif /* array2D_H_ */ diff --git a/rtengine/badpixels.cc b/rtengine/badpixels.cc index 79b8187f7..5f519f7c2 100644 --- a/rtengine/badpixels.cc +++ b/rtengine/badpixels.cc @@ -20,6 +20,7 @@ #include "array2D.h" #include "median.h" #include "pixelsmap.h" +#include "rawimage.h" #include "rawimagesource.h" namespace rtengine diff --git a/rtengine/bilateral2.h b/rtengine/bilateral2.h index d0496810d..53e18fb20 100644 --- a/rtengine/bilateral2.h +++ b/rtengine/bilateral2.h @@ -16,22 +16,16 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _BILATERAL2_ -#define _BILATERAL2_ +#pragma once +#include #include -#include #include -#include - -#include "rtengine.h" -#include "rt_math.h" -#include "mytime.h" +#include #include "array2D.h" -#ifdef _OPENMP -#include -#endif +#include "LUT.h" +#include "rt_math.h" using namespace rtengine; @@ -573,7 +567,7 @@ template void bilateral (T** src, T** dst, int W, int H, int sigmar, do // calculate histogram at the beginning of the row rhist.clear(); - for (int x = MAX(0, row_from - r); x <= MIN(H, row_from + r); x++) + for (int x = std::max(0, row_from - r); x <= std::min(H, row_from + r); x++) for (int y = 0; y < r + 1; y++) { rhist[((int)src[x][y]) >> TRANSBIT]++; } @@ -584,12 +578,12 @@ template void bilateral (T** src, T** dst, int W, int H, int sigmar, do // calculate histogram at the beginning of the row if (i > r) - for (int x = 0; x <= MIN(H, r); x++) { + for (int x = 0; x <= std::min(H, r); x++) { rhist[((int)src[i - r - 1][x]) >> TRANSBIT]--; } if (i < H - r) - for (int x = 0; x <= MIN(H, r); x++) { + for (int x = 0; x <= std::min(H, r); x++) { rhist[((int)src[i + r][x]) >> TRANSBIT]++; } @@ -599,12 +593,12 @@ template void bilateral (T** src, T** dst, int W, int H, int sigmar, do // subtract pixels at the left and add pixels at the right if (j > r) - for (int x = MAX(0, i - r); x <= MIN(i + r, H - 1); x++) { + for (int x = std::max(0, i - r); x <= std::min(i + r, H - 1); x++) { hist[(int)(src[x][j - r - 1]) >> TRANSBIT]--; } if (j < W - r) - for (int x = MAX(0, i - r); x <= MIN(i + r, H - 1); x++) { + for (int x = std::max(0, i - r); x <= std::min(i + r, H - 1); x++) { hist[((int)src[x][j + r]) >> TRANSBIT]++; } @@ -643,5 +637,3 @@ template void bilateral (T** src, T** dst, int W, int H, int sigmar, do } #undef BINBIT #undef TRANSBIT - -#endif diff --git a/rtengine/calc_distort.h b/rtengine/calc_distort.h index 711bf9515..7d0c5ef54 100644 --- a/rtengine/calc_distort.h +++ b/rtengine/calc_distort.h @@ -1,4 +1,3 @@ -#ifndef CALC_DISTORTION__H -#define CALC_DISTORTION__H +#pragma once + int calcDistortion (unsigned char* img1, unsigned char* img2, int ncols, int nrows, int nfactor, double &distortion); -#endif diff --git a/rtengine/camconst.cc b/rtengine/camconst.cc index 43de5d688..e8f7b1cbf 100644 --- a/rtengine/camconst.cc +++ b/rtengine/camconst.cc @@ -2,6 +2,9 @@ * This file is part of RawTherapee. */ #include "camconst.h" +#include +#include +#include #include "settings.h" #include "rt_math.h" #include @@ -17,8 +20,6 @@ namespace rtengine { -extern const Settings* settings; - CameraConst::CameraConst() : pdafOffset(0) { memset(dcraw_matrix, 0, sizeof(dcraw_matrix)); diff --git a/rtengine/camconst.h b/rtengine/camconst.h index eb43da483..1096e1767 100644 --- a/rtengine/camconst.h +++ b/rtengine/camconst.h @@ -1,11 +1,11 @@ /* * This file is part of RawTherapee. */ -#ifndef __CAMCONST__ -#define __CAMCONST__ +#pragma once -#include +#include #include +#include namespace rtengine { @@ -72,5 +72,3 @@ public: }; } - -#endif diff --git a/rtengine/capturesharpening.cc b/rtengine/capturesharpening.cc index a080b4f36..80693c8b7 100644 --- a/rtengine/capturesharpening.cc +++ b/rtengine/capturesharpening.cc @@ -20,18 +20,15 @@ #include #include "rtengine.h" +#include "rawimage.h" #include "rawimagesource.h" #include "rt_math.h" -#include "improcfun.h" #include "procparams.h" #include "color.h" #include "gauss.h" #include "rt_algo.h" //#define BENCHMARK #include "StopWatch.h" -#ifdef _OPENMP -#include -#endif #include "opthelper.h" #include "../rtgui/multilangmgr.h" @@ -583,10 +580,10 @@ BENCHFUN } else { if (sigmaCornerOffset != 0.0) { const float distance = sqrt(rtengine::SQR(i + tileSize / 2 - H / 2) + rtengine::SQR(j + tileSize / 2 - W / 2)); - const float sigmaTile = sigma + distanceFactor * distance; + const float sigmaTile = static_cast(sigma) + distanceFactor * distance; if (sigmaTile >= 0.4f) { float lkernel7[7][7]; - compute7x7kernel(sigma + distanceFactor * distance, lkernel7); + compute7x7kernel(static_cast(sigma) + distanceFactor * distance, lkernel7); for (int k = 0; k < iterations - 1; ++k) { // apply 7x7 gaussian blur and divide luminance by result of gaussian blur gauss7x7div(tmpIThr, tmpThr, lumThr, fullTileSize, fullTileSize, lkernel7); @@ -605,13 +602,13 @@ BENCHFUN // special handling for small tiles at end of row or column for (int k = border, ii = endOfCol ? H - fullTileSize - border : i - border; k < fullTileSize - border; ++k) { for (int l = border, jj = endOfRow ? W - fullTileSize - border : j - border; l < fullTileSize - border; ++l) { - luminance[ii + k][jj + l] = rtengine::intp(blend[ii + k][jj + l], max(tmpIThr[k][l], 0.0f), luminance[ii + k][jj + l]); + luminance[ii + k][jj + l] = rtengine::intp(blend[ii + k][jj + l], std::max(tmpIThr[k][l], 0.0f), luminance[ii + k][jj + l]); } } } else { for (int ii = border; ii < fullTileSize - border; ++ii) { for (int jj = border; jj < fullTileSize - border; ++jj) { - luminance[i + ii - border][j + jj - border] = rtengine::intp(blend[i + ii - border][j + jj - border], max(tmpIThr[ii][jj], 0.0f), luminance[i + ii - border][j + jj - border]); + luminance[i + ii - border][j + jj - border] = rtengine::intp(blend[i + ii - border][j + jj - border], std::max(tmpIThr[ii][jj], 0.0f), luminance[i + ii - border][j + jj - border]); } } } diff --git a/rtengine/cfa_linedn_RT.cc b/rtengine/cfa_linedn_RT.cc index 5f6e46f8f..ba26740c1 100644 --- a/rtengine/cfa_linedn_RT.cc +++ b/rtengine/cfa_linedn_RT.cc @@ -24,7 +24,6 @@ #include -#include "rtengine.h" #include "rawimagesource.h" #include "rt_math.h" @@ -63,7 +62,7 @@ void RawImageSource::CLASS cfa_linedn(float noise, bool horizontal, bool vertica // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% float noisevar = SQR(3 * noise * 65535); // _noise_ (as a fraction of saturation) is input to the algorithm float noisevarm4 = 4.0f * noisevar; - float* RawDataTmp = (float*)malloc( width * height * sizeof(float)); + float* RawDataTmp = (float*)malloc(static_cast(width) * height * sizeof(float)); #ifdef _OPENMP #pragma omp parallel #endif diff --git a/rtengine/ciecam02.cc b/rtengine/ciecam02.cc index dc71fee85..8314e5e8f 100644 --- a/rtengine/ciecam02.cc +++ b/rtengine/ciecam02.cc @@ -17,10 +17,10 @@ * along with RawTherapee. If not, see . */ #include "ciecam02.h" -#include "rtengine.h" +#include "rt_math.h" #include "curves.h" #include -#include "sleef.c" +#include "sleef.h" #ifdef _DEBUG #include "settings.h" @@ -34,10 +34,6 @@ namespace rtengine { -#ifdef _DEBUG -extern const Settings* settings; -#endif - void Ciecam02::curvecolorfloat (float satind, float satval, float &sres, float parsat) { if (satind > 0.f) { diff --git a/rtengine/ciecam02.h b/rtengine/ciecam02.h index fea35ab12..8b532fba0 100644 --- a/rtengine/ciecam02.h +++ b/rtengine/ciecam02.h @@ -16,12 +16,19 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _CIECAM02_ -#define _CIECAM02_ +#pragma once + #include -#include "LUT.h" +#include + #include "opthelper.h" +template +class LUT; + +using LUTu = LUT; +using LUTf = LUT; + namespace rtengine { @@ -106,4 +113,3 @@ public: }; } -#endif diff --git a/rtengine/cieimage.cc b/rtengine/cieimage.cc index be122febf..f19808df7 100644 --- a/rtengine/cieimage.cc +++ b/rtengine/cieimage.cc @@ -1,5 +1,7 @@ #include "cieimage.h" -#include + +#include +#include namespace rtengine { @@ -10,7 +12,6 @@ CieImage::CieImage (int w, int h) : fromImage(false), W(w), H(h) M_p = new float*[H]; C_p = new float*[H]; sh_p = new float*[H]; - // ch_p = new float*[H]; h_p = new float*[H]; // Initialize the pointers to zero @@ -98,9 +99,6 @@ CieImage::CieImage (int w, int h) : fromImage(false), W(w), H(h) ++c; - // for (int i=0; i. */ -#ifndef _CIEIMAGE_H_ -#define _CIEIMAGE_H_ +#pragma once -#include "image16.h" #include "noncopyable.h" namespace rtengine @@ -39,7 +37,6 @@ public: float** M_p; float** C_p; float** sh_p; -// float** ch_p; float** h_p; CieImage (int w, int h); @@ -50,4 +47,3 @@ public: }; } -#endif diff --git a/rtengine/clutstore.cc b/rtengine/clutstore.cc index 10b7a2c38..e3bd9c988 100644 --- a/rtengine/clutstore.cc +++ b/rtengine/clutstore.cc @@ -1,7 +1,11 @@ #include +#include +#include + #include "clutstore.h" +#include "colortemp.h" #include "iccstore.h" #include "imagefloat.h" #include "opthelper.h" diff --git a/rtengine/clutstore.h b/rtengine/clutstore.h index cd94bc18b..7c570df98 100644 --- a/rtengine/clutstore.h +++ b/rtengine/clutstore.h @@ -3,8 +3,6 @@ #include #include -#include - #include "cache.h" #include "alignedbuffer.h" #include "noncopyable.h" diff --git a/rtengine/color.cc b/rtengine/color.cc index 4ffc6ff3a..d7767b5f5 100644 --- a/rtengine/color.cc +++ b/rtengine/color.cc @@ -20,18 +20,19 @@ #include "rtengine.h" #include "color.h" #include "iccmatrices.h" -#include "mytime.h" -#include "sleef.c" +#include "sleef.h" #include "opthelper.h" #include "iccstore.h" +#ifdef _DEBUG +#include "mytime.h" +#endif + using namespace std; namespace rtengine { -extern const Settings* settings; - cmsToneCurve* Color::linearGammaTRC; LUTf Color::cachef; LUTf Color::cachefy; diff --git a/rtengine/color.h b/rtengine/color.h index f1dead7ad..09e515c73 100644 --- a/rtengine/color.h +++ b/rtengine/color.h @@ -20,14 +20,13 @@ #pragma once #include -#include +#include #include "rt_math.h" #include "LUT.h" -#include "labimage.h" #include "iccmatrices.h" #include "lcms2.h" -#include "sleef.c" +#include "sleef.h" #define SAT(a,b,c) ((float)max(a,b,c)-(float)min(a,b,c))/(float)max(a,b,c) diff --git a/rtengine/colortemp.cc b/rtengine/colortemp.cc index 3ddbdc28a..02d3e0e6d 100644 --- a/rtengine/colortemp.cc +++ b/rtengine/colortemp.cc @@ -16,19 +16,21 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ + +#include + #include "colortemp.h" -#include "rtengine.h" +#include "iccmatrices.h" +#include "rt_math.h" #include #include #include -#include "sleef.c" +#include "sleef.h" #include "settings.h" namespace rtengine { -extern const Settings* settings; - static const double cie_colour_match_jd[97][3] = {//350nm to 830nm 5 nm J.Desmis 2° Standard Observer. {0.0000000, 0.000000, 0.000000}, {0.0000000, 0.000000, 0.000000}, {0.0001299, 0.0003917, 0.0006061}, {0.0002321, 0.000006965, 0.001086}, {0.0004149, 0.00001239, 0.001946}, {0.0007416, 0.00002202, 0.003846}, diff --git a/rtengine/colortemp.h b/rtengine/colortemp.h index da83177be..a38e01072 100644 --- a/rtengine/colortemp.h +++ b/rtengine/colortemp.h @@ -16,8 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _COLORTEMP_ -#define _COLORTEMP_ +#pragma once #include #include @@ -207,4 +206,3 @@ public: }; } -#endif diff --git a/rtengine/coord.h b/rtengine/coord.h index 5f16cf606..6a7decdda 100644 --- a/rtengine/coord.h +++ b/rtengine/coord.h @@ -17,8 +17,7 @@ * along with RawTherapee. If not, see . */ -#ifndef __COORD__ -#define __COORD__ +#pragma once namespace rtengine { @@ -253,5 +252,3 @@ inline const PolarCoord operator* (const double lhs, const PolarCoord& rhs) } } - -#endif diff --git a/rtengine/coord2d.h b/rtengine/coord2d.h index 252219e47..9f0784b9a 100644 --- a/rtengine/coord2d.h +++ b/rtengine/coord2d.h @@ -16,8 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef __COORD2D__ -#define __COORD2D__ +#pragma once namespace rtengine { @@ -35,5 +34,5 @@ public: y = y_; } }; + } -#endif diff --git a/rtengine/cplx_wavelet_dec.h b/rtengine/cplx_wavelet_dec.h index 91e71fcd5..c127a7adf 100644 --- a/rtengine/cplx_wavelet_dec.h +++ b/rtengine/cplx_wavelet_dec.h @@ -17,9 +17,7 @@ * 2010 Ilya Popov * 2012 Emil Martinec */ - -#ifndef CPLX_WAVELET_DEC_H_INCLUDED -#define CPLX_WAVELET_DEC_H_INCLUDED +#pragma once #include #include @@ -266,5 +264,3 @@ void wavelet_decomposition::reconstruct(E * dst, const float blend) } } - -#endif diff --git a/rtengine/cplx_wavelet_filter_coeffs.h b/rtengine/cplx_wavelet_filter_coeffs.h index 6b8255b89..6287fc03b 100644 --- a/rtengine/cplx_wavelet_filter_coeffs.h +++ b/rtengine/cplx_wavelet_filter_coeffs.h @@ -17,7 +17,7 @@ * 2012 Emil Martinec * 2014 Jacques Desmis */ - +#pragma once namespace rtengine { diff --git a/rtengine/cplx_wavelet_level.h b/rtengine/cplx_wavelet_level.h index 4c98addfe..8664606c6 100644 --- a/rtengine/cplx_wavelet_level.h +++ b/rtengine/cplx_wavelet_level.h @@ -17,10 +17,8 @@ * 2010 Ilya Popov * 2012 Emil Martinec * 2014 Ingo Weyrich - */ - -#ifndef CPLX_WAVELET_LEVEL_H_INCLUDED -#define CPLX_WAVELET_LEVEL_H_INCLUDED +*/ +#pragma once #include #include "rt_math.h" @@ -759,5 +757,3 @@ template template void wavelet_level::reconstruct_lev } #endif } - -#endif diff --git a/rtengine/curves.cc b/rtengine/curves.cc index 961445a19..de1a378c2 100644 --- a/rtengine/curves.cc +++ b/rtengine/curves.cc @@ -23,9 +23,6 @@ #include #include #include -#ifdef _OPENMP -#include -#endif #include "rt_math.h" @@ -792,16 +789,16 @@ void CurveFactory::complexsgnCurve(bool & autili, bool & butili, bool & ccutili } -void CurveFactory::complexCurve(double ecomp, double black, double hlcompr, double hlcomprthresh, - double shcompr, double br, double contr, - const std::vector& curvePoints, - const std::vector& curvePoints2, - LUTu & histogram, - LUTf & hlCurve, LUTf & shCurve, LUTf & outCurve, - LUTu & outBeforeCCurveHistogram, - ToneCurve & customToneCurve1, - ToneCurve & customToneCurve2, - int skip) +void CurveFactory::complexCurve (double ecomp, double black, double hlcompr, double hlcomprthresh, + double shcompr, double br, double contr, + const std::vector& curvePoints, + const std::vector& curvePoints2, + const LUTu & histogram, + LUTf & hlCurve, LUTf & shCurve, LUTf & outCurve, + LUTu & outBeforeCCurveHistogram, + ToneCurve & customToneCurve1, + ToneCurve & customToneCurve2, + int skip) { // the curve shapes are defined in sRGB gamma, but the output curves will operate on linear floating point data, diff --git a/rtengine/curves.h b/rtengine/curves.h index fee4ca7b6..3b9b8d65f 100644 --- a/rtengine/curves.h +++ b/rtengine/curves.h @@ -16,24 +16,21 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef __CURVES_H__ -#define __CURVES_H__ +#pragma once #include #include #include -#include +#include #include "rt_math.h" -#include "../rtgui/mycurve.h" -#include "../rtgui/myflatcurve.h" -#include "../rtgui/mydiagonalcurve.h" -#include "color.h" +#include "flatcurvetypes.h" +#include "diagonalcurvetypes.h" #include "pipettebuffer.h" #include "LUT.h" - +#include "sleef.h" #define CURVES_MIN_POLY_POINTS 1000 #include "rt_math.h" @@ -356,8 +353,7 @@ public: public: static void complexCurve(double ecomp, double black, double hlcompr, double hlcomprthresh, double shcompr, double br, double contr, const std::vector& curvePoints, const std::vector& curvePoints2, - LUTu & histogram, LUTf & hlCurve, LUTf & shCurve, LUTf & outCurve, LUTu & outBeforeCCurveHistogram, ToneCurve & outToneCurve, ToneCurve & outToneCurve2, - + const LUTu & histogram, LUTf & hlCurve, LUTf & shCurve, LUTf & outCurve, LUTu & outBeforeCCurveHistogram, ToneCurve & outToneCurve, ToneCurve & outToneCurve2, int skip = 1); static void complexCurvelocal(double ecomp, double black, double hlcompr, double hlcomprthresh, double shcompr, double br, double cont, double lumare, @@ -678,7 +674,6 @@ public: } }; - class LocCCmaskblCurve { private: @@ -1700,12 +1695,6 @@ public: float *r, float *g, float *b) const; }; -class SatAndValueBlendingToneCurve : public ToneCurve -{ -public: - void Apply(float& r, float& g, float& b) const; -}; - class WeightedStdToneCurve : public ToneCurve { private: @@ -2085,47 +2074,6 @@ inline void WeightedStdToneCurve::BatchApply(const size_t start, const size_t en #endif } -// Tone curve modifying the value channel only, preserving hue and saturation -// values in 0xffff space -inline void SatAndValueBlendingToneCurve::Apply(float& ir, float& ig, float& ib) const -{ - - assert(lutToneCurve); - - float r = CLIP(ir); - float g = CLIP(ig); - float b = CLIP(ib); - - const float lum = (r + g + b) / 3.f; - const float newLum = lutToneCurve[lum]; - - if (newLum == lum) { - return; - } - - float h, s, v; - Color::rgb2hsvtc(r, g, b, h, s, v); - - float dV; - - if (newLum > lum) { - // Linearly targeting Value = 1 and Saturation = 0 - const float coef = (newLum - lum) / (65535.f - lum); - dV = (1.f - v) * coef; - s *= 1.f - coef; - } else { - // Linearly targeting Value = 0 - const float coef = (newLum - lum) / lum ; - dV = v * coef; - } - - Color::hsv2rgbdcp(h, s, v + dV, r, g, b); - - setUnlessOOG(ir, ig, ib, r, g, b); -} - } #undef CLIPI - -#endif diff --git a/rtengine/dcp.cc b/rtengine/dcp.cc index 8127ebfcb..11fe306b8 100644 --- a/rtengine/dcp.cc +++ b/rtengine/dcp.cc @@ -21,22 +21,22 @@ #include #include #include +#include +#include +#include #include "dcp.h" #include "cJSON.h" +#include "color.h" #include "iccmatrices.h" #include "iccstore.h" -#include "improcfun.h" +#include "imagefloat.h" #include "rawimagesource.h" #include "rt_math.h" - -namespace rtengine -{ - -extern const Settings* settings; - -} +#include "utils.h" +#include "../rtexif/rtexif.h" +#include "../rtgui/options.h" using namespace rtengine; using namespace rtexif; @@ -432,7 +432,7 @@ std::map getAliases(const Glib::ustring& profile_dir) } -struct DCPProfile::ApplyState::Data { +struct DCPProfileApplyState::Data { float pro_photo[3][3]; float work[3][3]; bool already_pro_photo; @@ -441,14 +441,12 @@ struct DCPProfile::ApplyState::Data { float bl_scale; }; -DCPProfile::ApplyState::ApplyState() : +DCPProfileApplyState::DCPProfileApplyState() : data(new Data{}) { } -DCPProfile::ApplyState::~ApplyState() -{ -} +DCPProfileApplyState::~DCPProfileApplyState() = default; DCPProfile::DCPProfile(const Glib::ustring& filename) : has_color_matrix_1(false), @@ -1148,7 +1146,7 @@ void DCPProfile::apply( } } -void DCPProfile::setStep2ApplyState(const Glib::ustring& working_space, bool use_tone_curve, bool apply_look_table, bool apply_baseline_exposure, ApplyState& as_out) +void DCPProfile::setStep2ApplyState(const Glib::ustring& working_space, bool use_tone_curve, bool apply_look_table, bool apply_baseline_exposure, DCPProfileApplyState& as_out) { as_out.data->use_tone_curve = use_tone_curve; as_out.data->apply_look_table = apply_look_table; @@ -1192,7 +1190,7 @@ void DCPProfile::setStep2ApplyState(const Glib::ustring& working_space, bool use } } -void DCPProfile::step2ApplyTile(float* rc, float* gc, float* bc, int width, int height, int tile_width, const ApplyState& as_in) const +void DCPProfile::step2ApplyTile(float* rc, float* gc, float* bc, int width, int height, int tile_width, const DCPProfileApplyState& as_in) const { #define FCLIP(a) ((a)>0.0?((a)<65535.5?(a):65535.5):0.0) @@ -1868,7 +1866,7 @@ DCPProfile* DCPStore::getProfile(const Glib::ustring& filename) const if (res->isValid()) { // Add profile profile_cache[key] = res; - if (options.rtSettings.verbose) { + if (settings->verbose) { printf("DCP profile '%s' loaded from disk\n", filename.c_str()); } return res; diff --git a/rtengine/dcp.h b/rtengine/dcp.h index 826f073a5..573349348 100644 --- a/rtengine/dcp.h +++ b/rtengine/dcp.h @@ -24,35 +24,23 @@ #include #include -#include +#include #include "../rtgui/threadutils.h" -#include "imagefloat.h" #include "curves.h" -#include "colortemp.h" #include "noncopyable.h" namespace rtengine { +class ColorTemp; +class Imagefloat; +class DCPProfileApplyState; + class DCPProfile final { public: - class ApplyState final - { - public: - ApplyState(); - ~ApplyState(); - - private: - struct Data; - - const std::unique_ptr data; - - friend class DCPProfile; - }; - struct Illuminants { short light_source_1; short light_source_2; @@ -86,8 +74,8 @@ public: const Matrix& cam_wb_matrix, bool apply_hue_sat_map = true ) const; - void setStep2ApplyState(const Glib::ustring& working_space, bool use_tone_curve, bool apply_look_table, bool apply_baseline_exposure, ApplyState& as_out); - void step2ApplyTile(float* r, float* g, float* b, int width, int height, int tile_width, const ApplyState& as_in) const; + void setStep2ApplyState(const Glib::ustring& working_space, bool use_tone_curve, bool apply_look_table, bool apply_baseline_exposure, DCPProfileApplyState& as_out); + void step2ApplyTile(float* r, float* g, float* b, int width, int height, int tile_width, const DCPProfileApplyState& as_in) const; private: struct HsbModify { @@ -148,6 +136,20 @@ private: AdobeToneCurve tone_curve; }; +class DCPProfileApplyState final +{ +public: + DCPProfileApplyState(); + ~DCPProfileApplyState(); + +private: + struct Data; + + const std::unique_ptr data; + + friend class DCPProfile; +}; + class DCPStore final : public NonCopyable { diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index eb206a15f..ae6f60cd1 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -26,12 +26,13 @@ /*RT*/#include /*RT*/#endif +#include #include #include #include "opthelper.h" //#define BENCHMARK #include "StopWatch.h" - +#include "utils.h" #include #include diff --git a/rtengine/dcraw.h b/rtengine/dcraw.h index fdebda0cc..eaf1fe35e 100644 --- a/rtengine/dcraw.h +++ b/rtengine/dcraw.h @@ -17,8 +17,7 @@ * along with RawTherapee. If not, see . */ -#ifndef DCRAW_H -#define DCRAW_H +#pragma once #include "myfile.h" #include @@ -529,6 +528,3 @@ void shiftXtransMatrix( const int offsy, const int offsx) { void nikon_14bit_load_raw(); // ported from LibRaw }; - - -#endif //DCRAW_H diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index f726ab6d1..4bd7a9576 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -17,20 +17,18 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ + +#include "cieimage.h" #include "curves.h" +#include "dcp.h" #include "dcrop.h" +#include "image8.h" +#include "imagefloat.h" +#include "labimage.h" #include "mytime.h" #include "procparams.h" #include "refreshmap.h" #include "rt_math.h" -#include -#include -#include -#include - -//#include -// "ceil" rounding -//#define SKIPS(a,b) ((a) / (b) + ((a) % (b) > 0)) #include "../rtgui/editcallbacks.h" #pragma GCC diagnostic warning "-Wall" @@ -50,8 +48,6 @@ constexpr T skips(T a, T b) namespace rtengine { -extern const Settings* settings; - Crop::Crop(ImProcCoordinator* parent, EditDataProvider *editDataProvider, bool isDetailWindow) : PipetteBuffer(editDataProvider), origCrop(nullptr), laboCrop(nullptr), labnCrop(nullptr), reservCrop(nullptr), cropImg(nullptr), shbuf_real(nullptr), transCrop(nullptr), cieCrop(nullptr), shbuffer(nullptr), @@ -834,7 +830,7 @@ void Crop::update(int todo) } } double rrm, ggm, bbm; - DCPProfile::ApplyState as; + DCPProfileApplyState as; DCPProfile *dcpProf = parent->imgsrc->getDCP(params.icm, as); LUTu histToneCurve; @@ -1152,7 +1148,7 @@ void Crop::update(int todo) loclmasCurvecolwav.Reset(); if (skip <= 2) { - usleep(settings->cropsleep); //wait to avoid crash when crop 100% and move window + Glib::usleep(settings->cropsleep); //wait to avoid crash when crop 100% and move window } } } diff --git a/rtengine/dcrop.h b/rtengine/dcrop.h index 4135dbc55..ccf9a8333 100644 --- a/rtengine/dcrop.h +++ b/rtengine/dcrop.h @@ -21,8 +21,6 @@ #include "improccoordinator.h" #include "rtengine.h" #include "improcfun.h" -#include "image8.h" -#include "image16.h" #include "imagesource.h" #include "procevents.h" #include "pipettebuffer.h" @@ -31,6 +29,8 @@ namespace rtengine { +class Image8; + using namespace procparams; class ImProcCoordinator; diff --git a/rtengine/demosaic_algos.cc b/rtengine/demosaic_algos.cc index 51db8bb3f..45779fc9c 100644 --- a/rtengine/demosaic_algos.cc +++ b/rtengine/demosaic_algos.cc @@ -22,12 +22,10 @@ #include "rawimagesource.h" #include "rawimage.h" #include "mytime.h" -#include "image8.h" #include "rt_math.h" #include "color.h" #include "../rtgui/multilangmgr.h" -#include "procparams.h" -#include "sleef.c" +#include "sleef.h" #include "opthelper.h" #include "median.h" //#define BENCHMARK @@ -41,8 +39,6 @@ using namespace std; namespace rtengine { -extern const Settings* settings; - #undef ABS #define ABS(a) ((a)<0?-(a):(a)) @@ -78,7 +74,7 @@ void RawImageSource::ppg_demosaic() plistener->setProgress (0.0); } - image = (float (*)[4]) calloc (H * W, sizeof * image); + image = (float (*)[4]) calloc (static_cast(H) * W, sizeof * image); for (int ii = 0; ii < H; ii++) for (int jj = 0; jj < W; jj++) { @@ -376,9 +372,9 @@ void RawImageSource::jdl_interpolate_omp() // from "Lassus" int row, col, c, d, i, u = width, v = 2 * u, w = 3 * u, x = 4 * u, y = 5 * u, z = 6 * u, indx, (*dif)[2], (*chr)[2]; float f[4], g[4]; float (*image)[4]; - image = (float (*)[4]) calloc (width * height, sizeof * image); - dif = (int (*)[2]) calloc(width * height, sizeof * dif); - chr = (int (*)[2]) calloc(width * height, sizeof * chr); + image = (float (*)[4]) calloc (static_cast(width) * height, sizeof * image); + dif = (int (*)[2]) calloc(static_cast(width) * height, sizeof * dif); + chr = (int (*)[2]) calloc(static_cast(width) * height, sizeof * chr); if (plistener) { // this function seems to be unused @@ -543,14 +539,14 @@ void RawImageSource::lmmse_interpolate_omp(int winw, int winh, array2D &r float *rix[5]; float *qix[5]; - float *buffer = (float *)calloc(rr1 * cc1 * 5 * sizeof(float), 1); + float *buffer = (float *)calloc(static_cast(rr1) * cc1 * 5 * sizeof(float), 1); if(buffer == nullptr) { // allocation of big block of memory failed, try to get 5 smaller ones printf("lmmse_interpolate_omp: allocation of big memory block failed, try to get 5 smaller ones now...\n"); bool allocationFailed = false; for(int i = 0; i < 5; i++) { - qix[i] = (float *)calloc(rr1 * cc1 * sizeof(float), 1); + qix[i] = (float *)calloc(static_cast(rr1) * cc1 * sizeof(float), 1); if(!qix[i]) { // allocation of at least one small block failed allocationFailed = true; @@ -1145,7 +1141,7 @@ void RawImageSource::igv_interpolate(int winw, int winh) vdif = (float (*)) calloc( width * height / 2, sizeof * vdif ); hdif = (float (*)) calloc( width * height / 2, sizeof * hdif ); - chrarray = (float (*)) calloc( width * height, sizeof( float ) ); + chrarray = (float (*)) calloc(static_cast(width) * height, sizeof( float ) ); chr[0] = chrarray; chr[1] = chrarray + (width * height) / 2; @@ -2040,7 +2036,7 @@ void RawImageSource::refinement_lassus(int PassCount) t1e.set(); int u = W, v = 2 * u, w = 3 * u, x = 4 * u, y = 5 * u; float (*image)[3]; - image = (float(*)[3]) calloc(W * H, sizeof * image); + image = (float(*)[3]) calloc(static_cast(W) * H, sizeof * image); #ifdef _OPENMP #pragma omp parallel shared(image) #endif diff --git a/rtengine/dfmanager.cc b/rtengine/dfmanager.cc index 4877aacd8..1fb1d2e1b 100644 --- a/rtengine/dfmanager.cc +++ b/rtengine/dfmanager.cc @@ -16,23 +16,27 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#include "dfmanager.h" -#include "../rtgui/options.h" -#include -#include "../rtgui/guiutils.h" -#include "rawimage.h" + #include #include #include -#include "imagedata.h" +#include #include +#include "dfmanager.h" +#include "../rtgui/options.h" +#include "rawimage.h" +#include "imagedata.h" +#include "utils.h" + namespace rtengine { -extern const Settings* settings; - // *********************** class dfInfo ************************************** +dfInfo::~dfInfo() +{ + delete ri; +} inline dfInfo& dfInfo::operator =(const dfInfo &o) { diff --git a/rtengine/dfmanager.h b/rtengine/dfmanager.h index 23ca97d14..216dcfc53 100644 --- a/rtengine/dfmanager.h +++ b/rtengine/dfmanager.h @@ -19,17 +19,18 @@ #pragma once #include +#include #include #include #include #include "pixelsmap.h" -#include "rawimage.h" namespace rtengine { +class RawImage; class dfInfo { public: @@ -48,13 +49,7 @@ public: dfInfo( const dfInfo &o) : pathname(o.pathname), maker(o.maker), model(o.model), iso(o.iso), shutter(o.shutter), timestamp(o.timestamp), ri(nullptr) {} - ~dfInfo() - { - if( ri ) { - delete ri; - } - } - + ~dfInfo(); dfInfo &operator =(const dfInfo &o); bool operator <(const dfInfo &e2) const; diff --git a/rtengine/diagonalcurvetypes.h b/rtengine/diagonalcurvetypes.h new file mode 100644 index 000000000..0d304957a --- /dev/null +++ b/rtengine/diagonalcurvetypes.h @@ -0,0 +1,31 @@ +/* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2019 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 . +*/ +#pragma once + +// For compatibility and simplicity reason, order shouldn't change, and must be identical to the order specified in the curveType widget +enum DiagonalCurveType { + DCT_Empty = -1, // Also used for identity curves + DCT_Linear, // 0 + DCT_Spline, // 1 + DCT_Parametric, // 2 + DCT_NURBS, // 3 + DCT_CatumullRom, // 4 + // Insert new curve type above this line + DCT_Unchanged // Must remain the last of the enum +}; diff --git a/rtengine/dirpyr_equalizer.cc b/rtengine/dirpyr_equalizer.cc index 8fac71134..9d48bea47 100644 --- a/rtengine/dirpyr_equalizer.cc +++ b/rtengine/dirpyr_equalizer.cc @@ -18,13 +18,20 @@ * */ -#include +#include #include -#include "improcfun.h" +#include + #include "array2D.h" -#include "rt_math.h" +#include "cieimage.h" +#include "color.h" +#include "curves.h" +#include "improcfun.h" +#include "LUT.h" #include "opthelper.h" #include "boxblur.h" +#include "rt_math.h" +#include "settings.h" namespace { @@ -73,8 +80,8 @@ void dirpyr_channel(const float * const * data_fine, float ** data_coarse, int w float val = 0.f; float norm = 0.f; - for (int inbr = max(0, i - scalewin); inbr <= min(height - 1, i + scalewin); inbr += scale) { - for (int jnbr = max(0, j - scalewin); jnbr <= j + scalewin; jnbr += scale) { + for (int inbr = std::max(0, i - scalewin); inbr <= std::min(height - 1, i + scalewin); inbr += scale) { + for (int jnbr = std::max(0, j - scalewin); jnbr <= j + scalewin; jnbr += scale) { const float dirwt = domker[(inbr - i) / scale + halfwin][(jnbr - j)/ scale + halfwin] * rangeFn(fabsf(data_fine[inbr][jnbr] - data_fine[i][j])); val += dirwt * data_fine[inbr][jnbr]; norm += dirwt; @@ -107,7 +114,7 @@ void dirpyr_channel(const float * const * data_fine, float ** data_coarse, int w float val = 0.f; float norm = 0.f; - for (int inbr = max(0, i - scalewin); inbr <= min(height - 1, i + scalewin); inbr += scale) { + for (int inbr = std::max(0, i - scalewin); inbr <= std::min(height - 1, i + scalewin); inbr += scale) { for (int jnbr = j - scalewin; jnbr <= j + scalewin; jnbr += scale) { const float dirwt = domker[(inbr - i) / scale + halfwin][(jnbr - j)/ scale + halfwin] * rangeFn(fabsf(data_fine[inbr][jnbr] - data_fine[i][j])); val += dirwt * data_fine[inbr][jnbr]; @@ -121,8 +128,8 @@ void dirpyr_channel(const float * const * data_fine, float ** data_coarse, int w float val = 0.f; float norm = 0.f; - for (int inbr = max(0, i - scalewin); inbr <= min(height - 1, i + scalewin); inbr += scale) { - for (int jnbr = j - scalewin; jnbr <= min(width - 1, j + scalewin); jnbr += scale) { + for (int inbr = std::max(0, i - scalewin); inbr <= std::min(height - 1, i + scalewin); inbr += scale) { + for (int jnbr = j - scalewin; jnbr <= std::min(width - 1, j + scalewin); jnbr += scale) { const float dirwt = domker[(inbr - i) / scale + halfwin][(jnbr - j)/ scale + halfwin] * rangeFn(fabsf(data_fine[inbr][jnbr] - data_fine[i][j])); val += dirwt * data_fine[inbr][jnbr]; norm += dirwt; @@ -151,8 +158,8 @@ void dirpyr_channel(const float * const * data_fine, float ** data_coarse, int w float val = 0.f; float norm = 0.f; - for (int inbr = max(0, i - scale); inbr <= min(height - 1, i + scale); inbr += scale) { - for (int jnbr = max(0, j - scale); jnbr <= j + scale; jnbr += scale) { + for (int inbr = std::max(0, i - scale); inbr <= std::min(height - 1, i + scale); inbr += scale) { + for (int jnbr = std::max(0, j - scale); jnbr <= j + scale; jnbr += scale) { const float dirwt = rangeFn(fabsf(data_fine[inbr][jnbr] - data_fine[i][j])); val += dirwt * data_fine[inbr][jnbr]; norm += dirwt; @@ -184,7 +191,7 @@ void dirpyr_channel(const float * const * data_fine, float ** data_coarse, int w float val = 0.f; float norm = 0.f; - for (int inbr = max(0, i - scale); inbr <= min(height - 1, i + scale); inbr += scale) { + for (int inbr = std::max(0, i - scale); inbr <= std::min(height - 1, i + scale); inbr += scale) { for (int jnbr = j - scale; jnbr <= j + scale; jnbr += scale) { const float dirwt = rangeFn(fabsf(data_fine[inbr][jnbr] - data_fine[i][j])); val += dirwt * data_fine[inbr][jnbr]; @@ -198,8 +205,8 @@ void dirpyr_channel(const float * const * data_fine, float ** data_coarse, int w float val = 0.f; float norm = 0.f; - for (int inbr = max(0, i - scale); inbr <= min(height - 1, i + scale); inbr += scale) { - for (int jnbr = j - scale; jnbr <= min(width - 1, j + scale); jnbr += scale) { + for (int inbr = std::max(0, i - scale); inbr <= std::min(height - 1, i + scale); inbr += scale) { + for (int jnbr = j - scale; jnbr <= std::min(width - 1, j + scale); jnbr += scale) { const float dirwt = rangeFn(fabsf(data_fine[inbr][jnbr] - data_fine[i][j])); val += dirwt * data_fine[inbr][jnbr]; norm += dirwt; @@ -390,8 +397,6 @@ void idirpyr_eq_channelcam(const float * const * data_coarse, const float * cons namespace rtengine { -extern const Settings* settings; - void ImProcFunctions::dirpyr_equalizer(const float * const * src, float ** dst, int srcwidth, int srcheight, const float * const * l_a, const float * const * l_b, const double * mult, const double dirpyrThreshold, const double skinprot, float b_l, float t_l, float t_r, int scaleprev) { //sequence of scales diff --git a/rtengine/dual_demosaic_RT.cc b/rtengine/dual_demosaic_RT.cc index 60cce506b..b5839ee8b 100644 --- a/rtengine/dual_demosaic_RT.cc +++ b/rtengine/dual_demosaic_RT.cc @@ -23,36 +23,40 @@ // //////////////////////////////////////////////////////////////// +#include "color.h" #include "jaggedarray.h" -#include "rtengine.h" -#include "rawimagesource.h" -#include "rt_math.h" #include "procparams.h" +#include "rawimagesource.h" +#include "rt_algo.h" +#include "rt_math.h" +#include "rtengine.h" + +#include "../rtgui/options.h" + //#define BENCHMARK #include "StopWatch.h" -#include "rt_algo.h" using namespace std; namespace rtengine { -void RawImageSource::dual_demosaic_RT(bool isBayer, const RAWParams &raw, int winw, int winh, const array2D &rawData, array2D &red, array2D &green, array2D &blue, double &contrast, bool autoContrast) +void RawImageSource::dual_demosaic_RT(bool isBayer, const procparams::RAWParams &raw, int winw, int winh, const array2D &rawData, array2D &red, array2D &green, array2D &blue, double &contrast, bool autoContrast) { BENCHFUN if (contrast == 0.f && !autoContrast) { // contrast == 0.0 means only first demosaicer will be used if(isBayer) { - if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::AMAZEVNG4) ) { + if (raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::AMAZEVNG4) ) { amaze_demosaic_RT(0, 0, winw, winh, rawData, red, green, blue, options.chunkSizeAMAZE, options.measure); - } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::DCBVNG4) ) { + } else if (raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::DCBVNG4) ) { dcb_demosaic(raw.bayersensor.dcb_iterations, raw.bayersensor.dcb_enhance); - } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::RCDVNG4) ) { + } else if (raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::RCDVNG4) ) { rcd_demosaic(options.chunkSizeRCD, options.measure); } } else { - if (raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::FOUR_PASS) ) { + if (raw.xtranssensor.method == procparams::RAWParams::XTransSensor::getMethodString(procparams::RAWParams::XTransSensor::Method::FOUR_PASS) ) { xtrans_interpolate (3, true, options.chunkSizeXT, options.measure); } else { xtrans_interpolate (1, false, options.chunkSizeXT, options.measure); @@ -70,15 +74,15 @@ void RawImageSource::dual_demosaic_RT(bool isBayer, const RAWParams &raw, int wi if (isBayer) { vng4_demosaic(rawData, redTmp, greenTmp, blueTmp); - if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::AMAZEVNG4) || raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::PIXELSHIFT)) { + if (raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::AMAZEVNG4) || raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::PIXELSHIFT)) { amaze_demosaic_RT(0, 0, winw, winh, rawData, red, green, blue, options.chunkSizeAMAZE, options.measure); - } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::DCBVNG4) ) { + } else if (raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::DCBVNG4) ) { dcb_demosaic(raw.bayersensor.dcb_iterations, raw.bayersensor.dcb_enhance); - } else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::RCDVNG4) ) { + } else if (raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::RCDVNG4) ) { rcd_demosaic(options.chunkSizeRCD, options.measure); } } else { - if (raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::FOUR_PASS) ) { + if (raw.xtranssensor.method == procparams::RAWParams::XTransSensor::getMethodString(procparams::RAWParams::XTransSensor::Method::FOUR_PASS) ) { xtrans_interpolate (3, true, options.chunkSizeXT, options.measure); } else { xtrans_interpolate (1, false, options.chunkSizeXT, options.measure); diff --git a/rtengine/dynamicprofile.cc b/rtengine/dynamicprofile.cc index af6ecd2ff..617ec2747 100644 --- a/rtengine/dynamicprofile.cc +++ b/rtengine/dynamicprofile.cc @@ -17,10 +17,15 @@ * along with RawTherapee. If not, see . */ -#include "../rtengine/dynamicprofile.h" +#include "dynamicprofile.h" #include #include +#include +#include + +#include "rtengine.h" +#include "../rtgui/options.h" using namespace rtengine; using namespace rtengine::procparams; @@ -176,7 +181,7 @@ bool DynamicProfileRules::loadRules() return false; } - if (options.rtSettings.verbose) { + if (settings->verbose) { printf ("loading dynamic profiles...\n"); } @@ -195,7 +200,7 @@ bool DynamicProfileRules::loadRules() return false; } - if (options.rtSettings.verbose) { + if (settings->verbose) { printf (" loading rule %d\n", serial); } @@ -225,7 +230,7 @@ bool DynamicProfileRules::loadRules() bool DynamicProfileRules::storeRules() { - if (options.rtSettings.verbose) { + if (settings->verbose) { printf ("saving dynamic profiles...\n"); } diff --git a/rtengine/dynamicprofile.h b/rtengine/dynamicprofile.h index aaffc5c4f..d91b91aee 100644 --- a/rtengine/dynamicprofile.h +++ b/rtengine/dynamicprofile.h @@ -16,12 +16,15 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _DYNAMICPROFILE_H_ -#define _DYNAMICPROFILE_H_ +#pragma once -#include +#include #include -#include "../rtgui/options.h" + +namespace rtengine +{ + class FramesMetaData; +} class DynamicProfileRule { @@ -76,5 +79,3 @@ public: const std::vector &getRules(); void setRules (const std::vector &r); }; - -#endif // _DYNAMICPROFILE_H_ diff --git a/rtengine/eahd_demosaic.cc b/rtengine/eahd_demosaic.cc index aa8fdf485..c470eb297 100644 --- a/rtengine/eahd_demosaic.cc +++ b/rtengine/eahd_demosaic.cc @@ -20,14 +20,13 @@ #include #include "color.h" +#include "rawimage.h" #include "rawimagesource.h" #include "rawimagesource_i.h" #include "jaggedarray.h" -#include "rawimage.h" #include "iccmatrices.h" #include "rt_math.h" #include "../rtgui/multilangmgr.h" -#include "procparams.h" //#define BENCHMARK #include "StopWatch.h" diff --git a/rtengine/fast_demo.cc b/rtengine/fast_demo.cc index a40f107af..82176e59c 100644 --- a/rtengine/fast_demo.cc +++ b/rtengine/fast_demo.cc @@ -25,7 +25,6 @@ #include #include "rawimagesource.h" #include "../rtgui/multilangmgr.h" -#include "procparams.h" #include "opthelper.h" using namespace std; diff --git a/rtengine/ffmanager.cc b/rtengine/ffmanager.cc index e1a9134a8..ce60277e1 100644 --- a/rtengine/ffmanager.cc +++ b/rtengine/ffmanager.cc @@ -16,6 +16,10 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ + +#include +#include + #include "ffmanager.h" #include "../rtgui/options.h" #include "rawimage.h" @@ -26,8 +30,6 @@ namespace rtengine { -extern const Settings* settings; - // *********************** class ffInfo ************************************** inline ffInfo& ffInfo::operator =(const ffInfo &o) @@ -50,6 +52,11 @@ inline ffInfo& ffInfo::operator =(const ffInfo &o) return *this; } +ffInfo::~ffInfo() +{ + delete ri; +} + bool ffInfo::operator <(const ffInfo &e2) const { if( this->maker.compare( e2.maker) >= 0 ) { diff --git a/rtengine/ffmanager.h b/rtengine/ffmanager.h index 537f8ee46..80ef5fa1c 100644 --- a/rtengine/ffmanager.h +++ b/rtengine/ffmanager.h @@ -19,16 +19,16 @@ #pragma once #include +#include #include #include #include -#include "rawimage.h" - namespace rtengine { +class RawImage; class ffInfo { public: @@ -48,13 +48,8 @@ public: ffInfo( const ffInfo &o) : pathname(o.pathname), maker(o.maker), model(o.model), lens(o.lens), aperture(o.aperture), focallength(o.focallength), timestamp(o.timestamp), ri(nullptr) {} - ~ffInfo() - { - if( ri ) { - delete ri; - } - } + ~ffInfo(); ffInfo &operator =(const ffInfo &o); bool operator <(const ffInfo &e2) const; diff --git a/rtengine/filmnegativeproc.cc b/rtengine/filmnegativeproc.cc index 4293c6b2a..86bad00f7 100644 --- a/rtengine/filmnegativeproc.cc +++ b/rtengine/filmnegativeproc.cc @@ -19,28 +19,19 @@ #include #include -#ifdef _OPENMP -#include -#endif - +#include "rawimage.h" #include "rawimagesource.h" +#include "coord.h" #include "mytime.h" #include "opthelper.h" #include "procparams.h" #include "rt_algo.h" #include "rtengine.h" - +#include "sleef.h" //#define BENCHMARK #include "StopWatch.h" -namespace rtengine -{ - -extern const Settings* settings; - -} - namespace { @@ -98,7 +89,7 @@ bool channelsAvg( } -bool rtengine::RawImageSource::getFilmNegativeExponents(Coord2D spotA, Coord2D spotB, int tran, const FilmNegativeParams ¤tParams, std::array& newExps) +bool rtengine::RawImageSource::getFilmNegativeExponents(Coord2D spotA, Coord2D spotB, int tran, const procparams::FilmNegativeParams ¤tParams, std::array& newExps) { newExps = { static_cast(currentParams.redRatio * currentParams.greenExp), diff --git a/rtengine/filmnegativethumb.cc b/rtengine/filmnegativethumb.cc index 6a4da31b0..b31432a55 100644 --- a/rtengine/filmnegativethumb.cc +++ b/rtengine/filmnegativethumb.cc @@ -18,23 +18,17 @@ */ #include +#include "LUT.h" #include "rtengine.h" #include "rtthumbnail.h" #include "opthelper.h" +#include "sleef.h" #include "rt_algo.h" -#include "rtengine.h" #include "settings.h" #include "procparams.h" #define BENCHMARK #include "StopWatch.h" -namespace rtengine -{ - -extern const Settings* settings; - -} - void rtengine::Thumbnail::processFilmNegative( const procparams::ProcParams ¶ms, const Imagefloat* baseImg, diff --git a/rtgui/ilabel.h b/rtengine/flatcurvetypes.h similarity index 59% rename from rtgui/ilabel.h rename to rtengine/flatcurvetypes.h index 06da470b1..9efe0d259 100644 --- a/rtgui/ilabel.h +++ b/rtengine/flatcurvetypes.h @@ -1,7 +1,7 @@ /* * This file is part of RawTherapee. * - * Copyright (c) 2004-2010 Gabor Horvath + * Copyright (c) 2004-2019 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 @@ -15,23 +15,15 @@ * * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . - */ -#ifndef _ILABEL_ -#define _ILABEL_ +*/ +#pragma once -#include - -class ILabel : public Gtk::DrawingArea -{ - - Glib::ustring label; - -public: - explicit ILabel (const Glib::ustring &lab); - bool on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr) override; - void on_realize() override; - void on_style_updated () override; +// For compatibility and simplicity reason, order shouldn't change, and must be identical to the order specified in the curveType widget +enum FlatCurveType { + FCT_Empty = -1, // Also used for identity curves + FCT_Linear, // 0 + FCT_MinMaxCPoints, // 1 + //FCT_Parametric, // 2 + // Insert new curve type above this line + FCT_Unchanged // Must remain the last of the enum }; - -#endif - diff --git a/rtengine/gamutwarning.cc b/rtengine/gamutwarning.cc index 3fc20d43a..569ea3066 100644 --- a/rtengine/gamutwarning.cc +++ b/rtengine/gamutwarning.cc @@ -23,10 +23,14 @@ * also distributed under the GPL V3+ */ -#include "gamutwarning.h" #include -namespace rtengine { +#include "gamutwarning.h" +#include "iccstore.h" +#include "image8.h" + +namespace rtengine +{ GamutWarning::GamutWarning(cmsHPROFILE iprof, cmsHPROFILE gamutprof, RenderingIntent intent, bool gamutbpc): lab2ref(nullptr), @@ -126,5 +130,4 @@ inline void GamutWarning::mark(Image8 *image, int y, int x) image->b(y, x) = 255; } - } // namespace rtengine diff --git a/rtengine/gamutwarning.h b/rtengine/gamutwarning.h index e0aaa98d9..b940b911f 100644 --- a/rtengine/gamutwarning.h +++ b/rtengine/gamutwarning.h @@ -25,11 +25,14 @@ #pragma once -#include "iccstore.h" -#include "noncopyable.h" -#include "image8.h" +#include -namespace rtengine { +#include "noncopyable.h" + +namespace rtengine +{ + +class Image8; enum RenderingIntent : int; diff --git a/rtengine/gauss.h b/rtengine/gauss.h index df5aa7d87..71e3506da 100644 --- a/rtengine/gauss.h +++ b/rtengine/gauss.h @@ -16,13 +16,10 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _GAUSS_H_ -#define _GAUSS_H_ +#pragma once enum eGaussType {GAUSS_STANDARD, GAUSS_MULT, GAUSS_DIV}; static constexpr auto GAUSS_SKIP = 0.25; void gaussianBlur(float** src, float** dst, const int W, const int H, const double sigma, bool useBoxBlur = false, eGaussType gausstype = GAUSS_STANDARD, float** buffer2 = nullptr); - -#endif \ No newline at end of file diff --git a/rtengine/guidedfilter.cc b/rtengine/guidedfilter.cc index bed4d8be7..a0c6361c4 100644 --- a/rtengine/guidedfilter.cc +++ b/rtengine/guidedfilter.cc @@ -28,32 +28,20 @@ * available at https://arxiv.org/abs/1505.00996 */ -#include "guidedfilter.h" #include "boxblur.h" -#include "sleef.c" -#include "rescale.h" +#include "guidedfilter.h" #include "imagefloat.h" +#include "rescale.h" +#include "sleef.h" -namespace rtengine { +#define BENCHMARK +#include "StopWatch.h" -#if 0 -# define DEBUG_DUMP(arr) \ - do { \ - Imagefloat im(arr.width(), arr.height()); \ - const char *out = "/tmp/" #arr ".tif"; \ - for (int y = 0; y < im.getHeight(); ++y) { \ - for (int x = 0; x < im.getWidth(); ++x) { \ - im.r(y, x) = im.g(y, x) = im.b(y, x) = arr[y][x] * 65535.f; \ - } \ - } \ - im.saveTIFF(out, 16); \ - } while (false) -#else -# define DEBUG_DUMP(arr) -#endif +namespace rtengine +{ - -namespace { +namespace +{ int calculate_subsampling(int w, int h, int r) { @@ -76,7 +64,6 @@ int calculate_subsampling(int w, int h, int r) } // namespace - void guidedFilter(const array2D &guide, const array2D &src, array2D &dst, int r, float epsilon, bool multithread, int subsampling) { @@ -166,54 +153,39 @@ void guidedFilter(const array2D &guide, const array2D &src, array2 f_subsample(I1, I); f_subsample(p1, p); - DEBUG_DUMP(I); - DEBUG_DUMP(p); - DEBUG_DUMP(I1); - DEBUG_DUMP(p1); - float r1 = float(r) / subsampling; array2D meanI(w, h); f_mean(meanI, I1, r1); - DEBUG_DUMP(meanI); array2D meanp(w, h); f_mean(meanp, p1, r1); - DEBUG_DUMP(meanp); array2D &corrIp = p1; apply(MUL, corrIp, I1, p1); f_mean(corrIp, corrIp, r1); - DEBUG_DUMP(corrIp); array2D &corrI = I1; apply(MUL, corrI, I1, I1); f_mean(corrI, corrI, r1); - DEBUG_DUMP(corrI); array2D &varI = corrI; apply(SUBMUL, varI, meanI, meanI, corrI); - DEBUG_DUMP(varI); array2D &covIp = corrIp; apply(SUBMUL, covIp, meanI, meanp, corrIp); - DEBUG_DUMP(covIp); array2D &a = varI; apply(DIVEPSILON, a, covIp, varI); - DEBUG_DUMP(a); array2D &b = covIp; apply(SUBMUL, b, a, meanI, meanp); - DEBUG_DUMP(b); array2D &meana = a; f_mean(meana, a, r1); - DEBUG_DUMP(meana); array2D &meanb = b; f_mean(meanb, b, r1); - DEBUG_DUMP(meanb); // speedup by heckflosse67 const int Ws = meana.width(); diff --git a/rtengine/guidedfilter.h b/rtengine/guidedfilter.h index 543bce34e..cd5d64e71 100644 --- a/rtengine/guidedfilter.h +++ b/rtengine/guidedfilter.h @@ -22,7 +22,8 @@ #include "array2D.h" -namespace rtengine { +namespace rtengine +{ void guidedFilter(const array2D &guide, const array2D &src, array2D &dst, int r, float epsilon, bool multithread, int subsampling=0); diff --git a/rtengine/hilite_recon.cc b/rtengine/hilite_recon.cc index 35dd74463..697a5e3d3 100644 --- a/rtengine/hilite_recon.cc +++ b/rtengine/hilite_recon.cc @@ -288,8 +288,6 @@ void boxblur_resamp(const float* const* src, float** dst, float** temp, int H, i namespace rtengine { -extern const Settings* settings; - void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue) { double progress = 0.0; diff --git a/rtengine/histmatching.cc b/rtengine/histmatching.cc index 212b11d00..f5d16866e 100644 --- a/rtengine/histmatching.cc +++ b/rtengine/histmatching.cc @@ -18,23 +18,22 @@ * along with RawTherapee. If not, see . */ -#include "rawimagesource.h" -#include "rtthumbnail.h" -#include "curves.h" -#include "color.h" -#include "rt_math.h" -#include "iccstore.h" -#include "procparams.h" -#include "../rtgui/mydiagonalcurve.h" -#include "improcfun.h" -//#define BENCHMARK -#include "StopWatch.h" #include +#include "color.h" +#include "curves.h" +#include "improcfun.h" +#include "procparams.h" +#include "rawimagesource.h" +#include "rt_math.h" +#include "rtthumbnail.h" +#include "settings.h" -namespace rtengine { +//#define BENCHMARK +#include "StopWatch.h" -extern const Settings *settings; +namespace rtengine +{ namespace { diff --git a/rtengine/hphd_demosaic_RT.cc b/rtengine/hphd_demosaic_RT.cc index 0e56eae48..2b61bbe07 100644 --- a/rtengine/hphd_demosaic_RT.cc +++ b/rtengine/hphd_demosaic_RT.cc @@ -18,12 +18,11 @@ */ #include +#include "rawimage.h" #include "rawimagesource.h" #include "rawimagesource_i.h" #include "jaggedarray.h" -#include "rawimage.h" #include "rt_math.h" -#include "procparams.h" #include "../rtgui/multilangmgr.h" #include "opthelper.h" //#define BENCHMARK diff --git a/rtengine/iccmatrices.h b/rtengine/iccmatrices.h index 3e0d0b5d6..5b9883421 100644 --- a/rtengine/iccmatrices.h +++ b/rtengine/iccmatrices.h @@ -16,8 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _ICCMATRICES_ -#define _ICCMATRICES_ +#pragma once // Bradford transform between illuminants constexpr double d65_d50[3][3] = { @@ -296,4 +295,3 @@ constexpr double d50_best[3][3] = { {-0.253000840399762, 0.0215532098817316,1.22569552576991} }; */ -#endif diff --git a/rtengine/iccstore.cc b/rtengine/iccstore.cc index a8d54b810..aea03664e 100644 --- a/rtengine/iccstore.cc +++ b/rtengine/iccstore.cc @@ -18,7 +18,9 @@ */ #include -#include +#include +#include +#include #include #ifdef WIN32 @@ -32,6 +34,7 @@ #include "iccstore.h" #include "iccmatrices.h" +#include "utils.h" #include "../rtgui/options.h" #include "../rtgui/threadutils.h" @@ -41,12 +44,6 @@ #include "cJSON.h" #define inkc_constant 0x696E6B43 -namespace rtengine -{ - -extern const Settings* settings; - -} namespace { diff --git a/rtengine/iccstore.h b/rtengine/iccstore.h index 5c76660e5..731a155bb 100644 --- a/rtengine/iccstore.h +++ b/rtengine/iccstore.h @@ -19,15 +19,14 @@ #pragma once #include +#include #include #include -#include +#include #include -#include "color.h" - namespace rtengine { diff --git a/rtengine/iimage.cc b/rtengine/iimage.cc index a1ec979a1..7548fc8bf 100644 --- a/rtengine/iimage.cc +++ b/rtengine/iimage.cc @@ -17,6 +17,7 @@ * along with RawTherapee. If not, see . */ +#include "color.h" #include "procparams.h" #include "rtengine.h" @@ -45,3 +46,7 @@ int rtengine::getCoarseBitMask( const procparams::CoarseTransformParams &coarse) return tr; } + +const LUTf& rtengine::getigammatab() { + return Color::igammatab_srgb; +} diff --git a/rtengine/iimage.h b/rtengine/iimage.h index b04b4bf9a..7309dd91f 100644 --- a/rtengine/iimage.h +++ b/rtengine/iimage.h @@ -16,17 +16,19 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _IIMAGE_ -#define _IIMAGE_ +#pragma once -#include #include -#include "rt_math.h" + +#include +#include + #include "alignedbuffer.h" +#include "coord2d.h" #include "imagedimensions.h" #include "LUT.h" -#include "coord2d.h" -#include "color.h" +#include "rt_math.h" + #include "../rtgui/threadutils.h" #define TR_NONE 0 @@ -57,6 +59,7 @@ extern const char sImage16[]; extern const char sImagefloat[]; int getCoarseBitMask(const procparams::CoarseTransformParams& coarse); +const LUTf& getigammatab(); enum TypeInterpolation { TI_Nearest, TI_Bilinear }; @@ -955,17 +958,35 @@ public: histogram(65536 >> histcompr); histogram.clear(); + const LUTf& igammatab = getigammatab(); - for (int i = 0; i < height; i++) - for (int j = 0; j < width; j++) { - float r_, g_, b_; - convertTo(r(i, j), r_); - convertTo(g(i, j), g_); - convertTo(b(i, j), b_); - histogram[(int)Color::igamma_srgb (r_) >> histcompr]++; - histogram[(int)Color::igamma_srgb (g_) >> histcompr]++; - histogram[(int)Color::igamma_srgb (b_) >> histcompr]++; +#ifdef _OPENMP + #pragma omp parallel +#endif + { + LUTu histThr(histogram.getSize()); + histThr.clear(); +#ifdef _OPENMP + #pragma omp for schedule(dynamic,16) nowait +#endif + for (int i = 0; i < height; i++) { + for (int j = 0; j < width; j++) { + float r_, g_, b_; + convertTo(r(i, j), r_); + convertTo(g(i, j), g_); + convertTo(b(i, j), b_); + histThr[static_cast(igammatab[r_]) >> histcompr]++; + histThr[static_cast(igammatab[g_]) >> histcompr]++; + histThr[static_cast(igammatab[b_]) >> histcompr]++; + } } +#ifdef _OPENMP + #pragma omp critical +#endif + { + histogram += histThr; + } + } } void computeHistogramAutoWB (double &avg_r, double &avg_g, double &avg_b, int &n, LUTu &histogram, const int compression) const override @@ -973,16 +994,16 @@ public: histogram.clear(); avg_r = avg_g = avg_b = 0.; n = 0; - + const LUTf& igammatab = getigammatab(); for (unsigned int i = 0; i < (unsigned int)(height); i++) for (unsigned int j = 0; j < (unsigned int)(width); j++) { float r_, g_, b_; convertTo(r(i, j), r_); convertTo(g(i, j), g_); convertTo(b(i, j), b_); - int rtemp = Color::igamma_srgb (r_); - int gtemp = Color::igamma_srgb (g_); - int btemp = Color::igamma_srgb (b_); + int rtemp = igammatab[r_]; + int gtemp = igammatab[g_]; + int btemp = igammatab[b_]; histogram[rtemp >> compression]++; histogram[gtemp >> compression] += 2; @@ -1009,6 +1030,9 @@ public: int n = 0; //int p = 6; +#ifdef _OPENMP + #pragma omp parallel for reduction(+:avg_r,avg_g,avg_b,n) schedule(dynamic,16) +#endif for (unsigned int i = 0; i < (unsigned int)(height); i++) for (unsigned int j = 0; j < (unsigned int)(width); j++) { float r_, g_, b_; @@ -1564,17 +1588,35 @@ public: histogram(65536 >> histcompr); histogram.clear(); + const LUTf& igammatab = getigammatab(); - for (int i = 0; i < height; i++) - for (int j = 0; j < width; j++) { - float r_, g_, b_; - convertTo(r(i, j), r_); - convertTo(g(i, j), g_); - convertTo(b(i, j), b_); - histogram[(int)Color::igamma_srgb (r_) >> histcompr]++; - histogram[(int)Color::igamma_srgb (g_) >> histcompr]++; - histogram[(int)Color::igamma_srgb (b_) >> histcompr]++; +#ifdef _OPENMP + #pragma omp parallel +#endif + { + LUTu histThr(histogram.getSize()); + histThr.clear(); +#ifdef _OPENMP + #pragma omp for schedule(dynamic,16) nowait +#endif + for (int i = 0; i < height; i++) { + for (int j = 0; j < width; j++) { + float r_, g_, b_; + convertTo(r(i, j), r_); + convertTo(g(i, j), g_); + convertTo(b(i, j), b_); + histThr[static_cast(igammatab[r_]) >> histcompr]++; + histThr[static_cast(igammatab[g_]) >> histcompr]++; + histThr[static_cast(igammatab[b_]) >> histcompr]++; + } } +#ifdef _OPENMP + #pragma omp critical +#endif + { + histogram += histThr; + } + } } void computeHistogramAutoWB (double &avg_r, double &avg_g, double &avg_b, int &n, LUTu &histogram, const int compression) const override @@ -1582,6 +1624,7 @@ public: histogram.clear(); avg_r = avg_g = avg_b = 0.; n = 0; + const LUTf& igammatab = getigammatab(); for (unsigned int i = 0; i < (unsigned int)(height); i++) for (unsigned int j = 0; j < (unsigned int)(width); j++) { @@ -1589,9 +1632,9 @@ public: convertTo(r(i, j), r_); convertTo(g(i, j), g_); convertTo(b(i, j), b_); - int rtemp = Color::igamma_srgb (r_); - int gtemp = Color::igamma_srgb (g_); - int btemp = Color::igamma_srgb (b_); + int rtemp = igammatab[r_]; + int gtemp = igammatab[g_]; + int btemp = igammatab[b_]; histogram[rtemp >> compression]++; histogram[gtemp >> compression] += 2; @@ -1618,6 +1661,9 @@ public: int n = 0; //int p = 6; +#ifdef _OPENMP + #pragma omp parallel for reduction(+:avg_r,avg_g,avg_b,n) schedule(dynamic,16) +#endif for (unsigned int i = 0; i < (unsigned int)(height); i++) for (unsigned int j = 0; j < (unsigned int)(width); j++) { float r_, g_, b_; @@ -1808,5 +1854,3 @@ public: }; } - -#endif diff --git a/rtengine/image16.cc b/rtengine/image16.cc index 0cdcc578f..a98d64d51 100644 --- a/rtengine/image16.cc +++ b/rtengine/image16.cc @@ -16,11 +16,13 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ +#include + +#include "colortemp.h" #include "image16.h" #include "imagefloat.h" #include "image8.h" -#include -#include "rtengine.h" +#include "rt_math.h" namespace { diff --git a/rtengine/image16.h b/rtengine/image16.h index 07747a172..d0053cbfc 100644 --- a/rtengine/image16.h +++ b/rtengine/image16.h @@ -19,17 +19,15 @@ // // A class representing a 16 bit rgb image with separate planes and 16 byte aligned data // -#ifndef _IMAGE16_ -#define _IMAGE16_ +#pragma once #include "imageio.h" -#include "rtengine.h" -#include "imagefloat.h" namespace rtengine { class Image8; +class Imagefloat; class Image16 : public IImage16, public ImageIO { @@ -109,4 +107,3 @@ public: }; } -#endif diff --git a/rtengine/image8.cc b/rtengine/image8.cc index abcd4efae..3d0a8df06 100644 --- a/rtengine/image8.cc +++ b/rtengine/image8.cc @@ -18,7 +18,10 @@ */ #include #include + +#include "colortemp.h" #include "image8.h" +#include "imagefloat.h" #include "rtengine.h" using namespace rtengine; diff --git a/rtengine/image8.h b/rtengine/image8.h index 969627f69..f125dccf8 100644 --- a/rtengine/image8.h +++ b/rtengine/image8.h @@ -19,15 +19,13 @@ // // A class representing a 8 bit rgb image without alpha channel // -#ifndef _IMAGE8_ -#define _IMAGE8_ +#pragma once #include "imageio.h" -#include "rtengine.h" -#include "imagefloat.h" namespace rtengine { +class Imagefloat; class Image8 : public IImage8, public ImageIO { @@ -104,4 +102,3 @@ public: }; } -#endif diff --git a/rtengine/imagedata.cc b/rtengine/imagedata.cc index 13b50a1b8..bbbe8794e 100644 --- a/rtengine/imagedata.cc +++ b/rtengine/imagedata.cc @@ -17,15 +17,22 @@ * along with RawTherapee. If not, see . */ #include + #include -#include + #include +#include + +#include + #include "imagedata.h" -#include "iptcpairs.h" #include "imagesource.h" -#include "rt_math.h" +#include "iptcpairs.h" #include "procparams.h" +#include "rt_math.h" +#include "utils.h" +#include "../rtexif/rtexif.h" #pragma GCC diagnostic warning "-Wextra" #define PRINT_HDR_PS_DETECTION 0 diff --git a/rtengine/imagedata.h b/rtengine/imagedata.h index 99caaf361..ff8ed4b86 100644 --- a/rtengine/imagedata.h +++ b/rtengine/imagedata.h @@ -16,17 +16,24 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef __IMAGEDATA_H__ -#define __IMAGEDATA_H__ +#pragma once #include #include -#include "rawimage.h" #include -#include -#include "../rtexif/rtexif.h" +#include + +#include + #include -#include "rtengine.h" + +#include "imageio.h" + +namespace rtexif +{ + +class TagDirectory; +} namespace rtengine { @@ -133,4 +140,3 @@ public: } -#endif diff --git a/rtengine/imagefloat.cc b/rtengine/imagefloat.cc index 8a9a511a6..1da91a4b4 100644 --- a/rtengine/imagefloat.cc +++ b/rtengine/imagefloat.cc @@ -17,12 +17,14 @@ * along with RawTherapee. If not, see . */ #include + +#include "colortemp.h" #include "imagefloat.h" #include "image16.h" #include "image8.h" +#include "labimage.h" #include #include "rtengine.h" -#include "mytime.h" #include "iccstore.h" #include "alignedbuffer.h" #include "rt_math.h" diff --git a/rtengine/imagefloat.h b/rtengine/imagefloat.h index 261a0677c..4a2b2f7e1 100644 --- a/rtengine/imagefloat.h +++ b/rtengine/imagefloat.h @@ -19,11 +19,9 @@ // // A class representing a 16 bit rgb image with separate planes and 16 byte aligned data // -#ifndef _IMAGEFLOAT_ -#define _IMAGEFLOAT_ +#pragma once #include "imageio.h" -#include "rtengine.h" namespace rtengine { @@ -31,6 +29,7 @@ using namespace procparams; class Image8; class Image16; +class LabImage; /* * Image type used by most tools; expected range: [0.0 ; 65535.0] @@ -227,4 +226,3 @@ public: }; } -#endif diff --git a/rtengine/imageformat.h b/rtengine/imageformat.h index dc40cf147..f8fee4c59 100644 --- a/rtengine/imageformat.h +++ b/rtengine/imageformat.h @@ -16,8 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _IMAGEFORMAT_ -#define _IMAGEFORMAT_ +#pragma once namespace rtengine { @@ -51,5 +50,3 @@ typedef enum SensorType { } eSensorType; } - -#endif diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index f335f5be8..fce181c3f 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -27,8 +27,10 @@ #include #include "rt_math.h" #include "procparams.h" +#include "utils.h" #include "../rtgui/options.h" #include "../rtgui/version.h" +#include "../rtexif/rtexif.h" #ifdef WIN32 #include @@ -810,7 +812,7 @@ int ImageIO::loadTIFF (const Glib::ustring &fname) * TIFFTAG_SMAXSAMPLEVALUE, but for now, we normalize the image to the * effective minimum and maximum values */ - if (options.rtSettings.verbose) { + if (settings->verbose) { printf("Information of \"%s\":\n", fname.c_str()); uint16 tiffDefaultScale, tiffBaselineExposure, tiffLinearResponseLimit; if (TIFFGetField(in, TIFFTAG_DEFAULTSCALE, &tiffDefaultScale)) { diff --git a/rtengine/imageio.h b/rtengine/imageio.h index 89c482ca3..d9afa926f 100644 --- a/rtengine/imageio.h +++ b/rtengine/imageio.h @@ -16,35 +16,51 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _IMAGEIO_ -#define _IMAGEIO_ - -#define IMIO_SUCCESS 0 -#define IMIO_CANNOTREADFILE 1 -#define IMIO_INVALIDHEADER 2 -#define IMIO_HEADERERROR 3 -#define IMIO_READERROR 4 -#define IMIO_VARIANTNOTSUPPORTED 5 -#define IMIO_FILETYPENOTSUPPORTED 6 -#define IMIO_CANNOTWRITEFILE 7 +#pragma once #include -#include +#include + #include -#include "rtengine.h" -#include "imageformat.h" -#include "../rtexif/rtexif.h" -#include "imagedimensions.h" + #include "iimage.h" -#include "colortemp.h" +#include "imagedimensions.h" +#include "imageformat.h" +#include "rtengine.h" + +enum { + IMIO_SUCCESS, + IMIO_CANNOTREADFILE, + IMIO_INVALIDHEADER, + IMIO_HEADERERROR, + IMIO_READERROR, + IMIO_VARIANTNOTSUPPORTED, + IMIO_FILETYPENOTSUPPORTED, + IMIO_CANNOTWRITEFILE +}; + +namespace rtexif +{ + +class TagDirectory; + +} namespace rtengine { +class ColorTemp; class ProgressListener; class Imagefloat; +namespace procparams +{ + +class ExifPairs; + +} + class ImageIO : virtual public ImageDatas { @@ -111,4 +127,3 @@ public: }; } -#endif diff --git a/rtengine/imagesource.h b/rtengine/imagesource.h index edc1102c4..e0c26aa9f 100644 --- a/rtengine/imagesource.h +++ b/rtengine/imagesource.h @@ -21,21 +21,31 @@ #include #include -#include +#include -#include "colortemp.h" #include "coord2d.h" -#include "dcp.h" -#include "image16.h" -#include "image8.h" #include "imagedata.h" -#include "imagefloat.h" #include "LUT.h" #include "rtengine.h" +template +class LUT; + +using LUTf = LUT; + +template +class multi_array2D; + namespace rtengine { +class ColorTemp; +class DCPProfile; +class DCPProfileApplyState; +class Imagefloat; +class RetinexgaintransmissionCurve; +class RetinextransmissionCurve; + namespace procparams { @@ -47,7 +57,7 @@ struct RAWParams; struct RetinexParams; struct ToneCurveParams; struct CaptureSharpeningParams; -} +}; class ImageMatrices { @@ -82,7 +92,7 @@ public: virtual int load (const Glib::ustring &fname) = 0; virtual void preprocess (const procparams::RAWParams &raw, const procparams::LensProfParams &lensProf, const procparams::CoarseTransformParams& coarse, bool prepareDenoise = true) {}; virtual void filmNegativeProcess (const procparams::FilmNegativeParams ¶ms) {}; - virtual bool getFilmNegativeExponents (Coord2D spotA, Coord2D spotB, int tran, const FilmNegativeParams& currentParams, std::array& newExps) { return false; }; + virtual bool getFilmNegativeExponents (Coord2D spotA, Coord2D spotB, int tran, const procparams::FilmNegativeParams& currentParams, std::array& newExps) { return false; }; virtual void demosaic (const procparams::RAWParams &raw, bool autoContrast, double &contrastThreshold, bool cache = false) {}; virtual void retinex (const procparams::ColorManagementParams& cmp, const procparams::RetinexParams &deh, const procparams::ToneCurveParams& Tc, LUTf & cdcurve, LUTf & mapcurve, const RetinextransmissionCurve & dehatransmissionCurve, const RetinexgaintransmissionCurve & dehagaintransmissionCurve, multi_array2D &conversionBuffer, bool dehacontlutili, bool mapcontlutili, bool useHsl, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax, LUTu &histLRETI) {}; virtual void retinexPrepareCurves (const procparams::RetinexParams &retinexParams, LUTf &cdcurve, LUTf &mapcurve, RetinextransmissionCurve &retinextransmissionCurve, RetinexgaintransmissionCurve &retinexgaintransmissionCurve, bool &retinexcontlutili, bool &mapcontlutili, bool &useHsl, LUTu & lhist16RETI, LUTu & histLRETI) {}; @@ -101,13 +111,13 @@ public: // use right after demosaicing image, add coarse transformation and put the result in the provided Imagefloat* - virtual void getImage (const ColorTemp &ctemp, int tran, Imagefloat* image, const PreviewProps &pp, const procparams::ToneCurveParams &hlp, const RAWParams &raw) = 0; + virtual void getImage (const ColorTemp &ctemp, int tran, Imagefloat* image, const PreviewProps &pp, const procparams::ToneCurveParams &hlp, const procparams::RAWParams &raw) = 0; virtual eSensorType getSensorType () const = 0; virtual bool isMono () const = 0; // true is ready to provide the AutoWB, i.e. when the image has been demosaiced for RawImageSource virtual bool isWBProviderReady () = 0; - virtual void convertColorSpace (Imagefloat* image, const ColorManagementParams &cmp, const ColorTemp &wb) = 0; // DIRTY HACK: this method is derived in rawimagesource and strimagesource, but (...,RAWParams raw) will be used ONLY for raw images + virtual void convertColorSpace (Imagefloat* image, const procparams::ColorManagementParams &cmp, const ColorTemp &wb) = 0; // DIRTY HACK: this method is derived in rawimagesource and strimagesource, but (...,RAWParams raw) will be used ONLY for raw images virtual void getAutoWBMultipliers (double &rm, double &gm, double &bm) = 0; virtual ColorTemp getWB () const = 0; virtual ColorTemp getSpotWB (std::vector &red, std::vector &green, std::vector &blue, int tran, double equal) = 0; @@ -126,7 +136,7 @@ public: virtual ImageMatrices* getImageMatrices () = 0; virtual bool isRAW () const = 0; - virtual DCPProfile* getDCP (const procparams::ColorManagementParams &cmp, DCPProfile::ApplyState &as) + virtual DCPProfile* getDCP (const procparams::ColorManagementParams &cmp, DCPProfileApplyState &as) { return nullptr; }; diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index bb2a90f29..4632b93c2 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -16,33 +16,39 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#include "improccoordinator.h" -#include "curves.h" -#include "mytime.h" -#include "refreshmap.h" -#include "../rtgui/ppversion.h" -#include "colortemp.h" -#include "improcfun.h" -#include #include +#include #include -#include -#include "jaggedarray.h" +#include -#include "iccstore.h" -#include "procparams.h" -#include -#include -#include +#include "improccoordinator.h" + +#include "cieimage.h" #include "color.h" +#include "colortemp.h" +#include "jaggedarray.h" +#include "curves.h" +#include "dcp.h" +#include "iccstore.h" +#include "image8.h" +#include "imagefloat.h" +#include "improcfun.h" +#include "labimage.h" +#include "lcp.h" +#include "procparams.h" +#include "refreshmap.h" + +#include "../rtgui/options.h" +#include "../rtgui/ppversion.h" + #ifdef _OPENMP #include #endif + + namespace rtengine { -extern const Settings* settings; - ImProcCoordinator::ImProcCoordinator() : orig_prev(nullptr), oprevi(nullptr), @@ -814,7 +820,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) double ggm = 33.; double bbm = 33.; - DCPProfile::ApplyState as; + DCPProfileApplyState as; DCPProfile *dcpProf = imgsrc->getDCP(params->icm, as); ipf.rgbProc (oprevi, oprevl, nullptr, hltonecurve, shtonecurve, tonecurve, params->toneCurve.saturation, diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index 096e6a1d2..1c89567f7 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -16,21 +16,27 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _IMPROCCOORDINATOR_H_ -#define _IMPROCCOORDINATOR_H_ +#pragma once #include -#include "rtengine.h" -#include "improcfun.h" -#include "image8.h" -#include "image16.h" -#include "imagesource.h" -#include "procevents.h" +#include "array2D.h" +#include "colortemp.h" +#include "curves.h" #include "dcrop.h" +#include "imagesource.h" +#include "improcfun.h" #include "LUT.h" +#include "procevents.h" +#include "rtengine.h" + #include "../rtgui/threadutils.h" +namespace Glib +{ +class Thread; +} + namespace rtengine { @@ -538,5 +544,5 @@ public: } denoiseInfoStore; }; + } -#endif diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 06619fedf..fa5636f02 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -18,16 +18,18 @@ */ #include #include -#include +#include #ifdef _OPENMP #include #endif #include "alignedbuffer.h" +#include "cieimage.h" +#include "labimage.h" #include "rtengine.h" #include "improcfun.h" #include "curves.h" -#include "mytime.h" +#include "dcp.h" #include "iccstore.h" #include "imagesource.h" #include "rtthumbnail.h" @@ -40,12 +42,16 @@ #include "improccoordinator.h" #include "clutstore.h" #include "ciecam02.h" +#include "satandvalueblendingcurve.h" #include "StopWatch.h" #include "procparams.h" #include "../rtgui/ppversion.h" -#include "../rtgui/guiutils.h" #include "../rtgui/editcallbacks.h" +#ifdef _DEBUG +#include "mytime.h" +#endif + #undef CLIPD #define CLIPD(a) ((a)>0.0f?((a)<1.0f?(a):1.0f):0.0f) @@ -273,10 +279,7 @@ namespace rtengine using namespace procparams; -extern const Settings* settings; - - -ImProcFunctions::~ImProcFunctions() +ImProcFunctions::~ImProcFunctions () { if (monitorTransform) { cmsDeleteTransform(monitorTransform); @@ -2065,25 +2068,17 @@ filmlike_clip(float *r, float *g, float *b) } } - - - - - - - - -void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve, - int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clToningcurve, LUTf & cl2Toningcurve, - const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2, const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, DCPProfile *dcpProf, const DCPProfile::ApplyState &asIn, LUTu &histToneCurve, size_t chunkSize, bool measure) +void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve, + int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clToningcurve, LUTf & cl2Toningcurve, + const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2, const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, DCPProfile *dcpProf, const DCPProfileApplyState &asIn, LUTu &histToneCurve, size_t chunkSize, bool measure) { rgbProc (working, lab, pipetteBuffer, hltonecurve, shtonecurve, tonecurve, sat, rCurve, gCurve, bCurve, satLimit, satLimitOpacity, ctColorCurve, ctOpacityCurve, opautili, clToningcurve, cl2Toningcurve, customToneCurve1, customToneCurve2, customToneCurvebw1, customToneCurvebw2, rrm, ggm, bbm, autor, autog, autob, params->toneCurve.expcomp, params->toneCurve.hlcompr, params->toneCurve.hlcomprthresh, dcpProf, asIn, histToneCurve, chunkSize, measure); } // Process RGB image and convert to LAB space -void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve, - int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clToningcurve, LUTf & cl2Toningcurve, - const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2, const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, double expcomp, int hlcompr, int hlcomprthresh, DCPProfile *dcpProf, const DCPProfile::ApplyState &asIn, LUTu &histToneCurve, size_t chunkSize, bool measure) +void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve, + int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clToningcurve, LUTf & cl2Toningcurve, + const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2, const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, double expcomp, int hlcompr, int hlcomprthresh, DCPProfile *dcpProf, const DCPProfileApplyState &asIn, LUTu &histToneCurve, size_t chunkSize, bool measure) { std::unique_ptr stop; diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 85e329774..6824b9f37 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -16,29 +16,57 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _IMPROCFUN_H_ -#define _IMPROCFUN_H_ +#pragma once + +#include -#include "imagefloat.h" -#include "image16.h" -#include "image8.h" -#include "shmap.h" #include "coord2d.h" -#include "color.h" -#include "labimage.h" -#include "cieimage.h" -#include "LUT.h" -#include "lcp.h" -#include "dcp.h" -#include "curves.h" -#include "cplx_wavelet_dec.h" -#include "pipettebuffer.h" #include "gamutwarning.h" #include "jaggedarray.h" +#include "pipettebuffer.h" +#include "shmap.h" +template +class LUT; + +using LUTu = LUT; +using LUTf = LUT; + +template +class multi_array2D; namespace rtengine { +class ColorAppearance; +class ColorGradientCurve; +class DCPProfile; +class DCPProfileApplyState; +class FlatCurve; +class FramesMetaData; +class LensCorrection; +class LocCCmaskCurve; +class LocLLmaskCurve; +class LocHHmaskCurve; +class LocwavCurve; +class LocretigainCurve; +class LocretitransCurve; +class LocLHCurve; +class LocHHCurve; +class NoiseCurve; +class OpacityCurve; +class ToneCurve; +class WavCurve; +class WavOpacityCurveBY; +class WavOpacityCurveRG; +class WavOpacityCurveW; +class WavOpacityCurveWL; + +class CieImage; +class Image8; +class Imagefloat; +class LabImage; +class wavelet_decomposition; + namespace procparams { @@ -46,6 +74,7 @@ class ProcParams; struct DehazeParams; struct FattalToneMappingParams; +struct ColorManagementParams; struct DirPyrDenoiseParams; struct LocalContrastParams; struct LocallabParams; @@ -64,7 +93,7 @@ class ImProcFunctions cmsHTRANSFORM monitorTransform; std::unique_ptr gamutWarning; - const ProcParams* params; + const procparams::ProcParams* params; double scale; bool multiThread; @@ -102,7 +131,7 @@ public: double lumimul[3]; - explicit ImProcFunctions(const ProcParams* iparams, bool imultiThread = true) + explicit ImProcFunctions(const procparams::ProcParams* iparams, bool imultiThread = true) : monitorTransform(nullptr), params(iparams), scale(1), multiThread(imultiThread), lumimul{} {} ~ImProcFunctions(); bool needsLuminanceOnly() @@ -118,11 +147,11 @@ public: void updateColorProfiles(const Glib::ustring& monitorProfile, RenderingIntent monitorIntent, bool softProof, bool gamutCheck); void rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve, int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clcurve, LUTf & cl2curve, const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2, - const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, DCPProfile *dcpProf, const DCPProfile::ApplyState &asIn, LUTu &histToneCurve, size_t chunkSize = 1, bool measure = false); + const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, DCPProfile *dcpProf, const DCPProfileApplyState &asIn, LUTu &histToneCurve, size_t chunkSize = 1, bool measure = false); void rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve, int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clcurve, LUTf & cl2curve, const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2, const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, - double expcomp, int hlcompr, int hlcomprthresh, DCPProfile *dcpProf, const DCPProfile::ApplyState &asIn, LUTu &histToneCurve, size_t chunkSize = 1, bool measure = false); + double expcomp, int hlcompr, int hlcomprthresh, DCPProfile *dcpProf, const DCPProfileApplyState &asIn, LUTu &histToneCurve, size_t chunkSize = 1, bool measure = false); void labtoning(float r, float g, float b, float &ro, float &go, float &bo, int algm, int metchrom, int twoc, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, LUTf & clToningcurve, LUTf & cl2Toningcurve, float iplow, float iphigh, double wp[3][3], double wip[3][3]); void toning2col(float r, float g, float b, float &ro, float &go, float &bo, float iplow, float iphigh, float rl, float gl, float bl, float rh, float gh, float bh, float SatLow, float SatHigh, float balanS, float balanH, float reducac, int mode, int preser, float strProtect); void toningsmh(float r, float g, float b, float &ro, float &go, float &bo, float RedLow, float GreenLow, float BlueLow, float RedMed, float GreenMed, float BlueMed, float RedHigh, float GreenHigh, float BlueHigh, float reducac, int mode, float strProtect); @@ -134,10 +163,9 @@ public: void moyeqt(Imagefloat* working, float &moyS, float &eqty); void luminanceCurve(LabImage* lold, LabImage* lnew, LUTf &curve); - void ciecamloc_02float(int sp, LabImage* lab); - void ciecam_02float(CieImage* ncie, float adap, int pW, int pwb, LabImage* lab, const ProcParams* params, + void ciecam_02float(CieImage* ncie, float adap, int pW, int pwb, LabImage* lab, const procparams::ProcParams* params, const ColorAppearance & customColCurve1, const ColorAppearance & customColCurve, const ColorAppearance & customColCurve3, LUTu &histLCAM, LUTu &histCCAM, LUTf & CAMBrightCurveJ, LUTf & CAMBrightCurveQ, float &mean, int Iterates, int scale, bool execsharp, float &d, float &dj, float &yb, int rtt, bool showSharpMask = false); @@ -149,7 +177,7 @@ public: void sharpening(LabImage* lab, const procparams::SharpeningParams &sharpenParam, bool showMask = false); void sharpeningcam(CieImage* ncie, float** buffer, bool showMask = false); void transform(Imagefloat* original, Imagefloat* transformed, int cx, int cy, int sx, int sy, int oW, int oH, int fW, int fH, const FramesMetaData *metadata, int rawRotationDeg, bool fullImage); - float resizeScale(const ProcParams* params, int fw, int fh, int &imw, int &imh); + float resizeScale(const procparams::ProcParams* params, int fw, int fh, int &imw, int &imh); void lab2monitorRgb(LabImage* lab, Image8* image); void resize(Imagefloat* src, Imagefloat* dst, float dScale); void Lanczos(const LabImage* src, LabImage* dst, float scale); @@ -354,14 +382,14 @@ public: void Badpixelscam(CieImage * ncie, double radius, int thresh, int mode, float chrom, bool hotbad); void BadpixelsLab(LabImage * lab, double radius, int thresh, float chrom); - void dehaze(Imagefloat *rgb, const DehazeParams &dehazeParams); - void ToneMapFattal02(Imagefloat *rgb, const FattalToneMappingParams &fatParams, int detail_level); - void localContrast(LabImage *lab, float **destination, const LocalContrastParams &localContrastParams, bool fftwlc, double scale); + void dehaze(Imagefloat *rgb, const procparams::DehazeParams &dehazeParams); + void ToneMapFattal02(Imagefloat *rgb, const procparams::FattalToneMappingParams &fatParams, int detail_level); + void localContrast(LabImage *lab, float **destination, const procparams::LocalContrastParams &localContrastParams, bool fftwlc, double scale); void colorToningLabGrid(LabImage *lab, int xstart, int xend, int ystart, int yend, bool MultiThread); // void shadowsHighlights(LabImage *lab); void shadowsHighlights(LabImage *lab, bool ena, int labmode, int hightli, int shado, int rad, int scal, int hltonal, int shtonal); - void softLight(LabImage *lab, const SoftLightParams &softLightParams); + void softLight(LabImage *lab, const procparams::SoftLightParams &softLightParams); void labColorCorrectionRegions(LabImage *lab); Image8* lab2rgb(LabImage* lab, int cx, int cy, int cw, int ch, const procparams::ColorManagementParams &icm, bool consider_histogram_settings = true); @@ -377,5 +405,5 @@ public: void rgb2lab(const Imagefloat &src, LabImage &dst, const Glib::ustring &workingSpace); void lab2rgb(const LabImage &src, Imagefloat &dst, const Glib::ustring &workingSpace); }; + } -#endif diff --git a/rtengine/impulse_denoise.cc b/rtengine/impulse_denoise.cc index c08f55700..20229e714 100644 --- a/rtengine/impulse_denoise.cc +++ b/rtengine/impulse_denoise.cc @@ -22,7 +22,7 @@ #include "labimage.h" #include "improcfun.h" #include "cieimage.h" -#include "sleef.c" +#include "sleef.h" #include "opthelper.h" #include "gauss.h" diff --git a/rtengine/init.cc b/rtengine/init.cc index 8d3ee96cb..1a00f7ff6 100644 --- a/rtengine/init.cc +++ b/rtengine/init.cc @@ -18,6 +18,7 @@ */ #include #include "../rtgui/profilestorecombobox.h" +#include "color.h" #include "rtengine.h" #include "iccstore.h" #include "dcp.h" @@ -42,7 +43,7 @@ const Settings* settings; MyMutex* lcmsMutex = nullptr; MyMutex *fftwMutex = nullptr; -int init (const Settings* s, Glib::ustring baseDir, Glib::ustring userSettingsDir, bool loadAll) +int init (const Settings* s, const Glib::ustring& baseDir, const Glib::ustring& userSettingsDir, bool loadAll) { settings = s; ProcParams::init(); diff --git a/rtengine/ipdehaze.cc b/rtengine/ipdehaze.cc index bc8f8be74..e52164187 100644 --- a/rtengine/ipdehaze.cc +++ b/rtengine/ipdehaze.cc @@ -32,17 +32,22 @@ #include #include +#include "color.h" #include "guidedfilter.h" +#include "iccstore.h" +#include "imagefloat.h" #include "improcfun.h" #include "procparams.h" #include "rescale.h" #include "rt_math.h" -extern Options options; +#include "../rtgui/options.h" -namespace rtengine { +namespace rtengine +{ -namespace { +namespace +{ float normalize(Imagefloat *rgb, bool multithread) { @@ -198,7 +203,7 @@ float estimate_ambient_light(const array2D &R, const array2D &G, c } } - if (options.rtSettings.verbose) { + if (settings->verbose) { std::cout << "dehaze: computing ambient light from " << patches.size() << " patches" << std::endl; } @@ -269,7 +274,6 @@ void extract_channels(Imagefloat *img, array2D &r, array2D &g, arr } // namespace - void ImProcFunctions::dehaze(Imagefloat *img, const DehazeParams &dehazeParams) { if (!dehazeParams.enabled || dehazeParams.strength == 0.0) { @@ -282,7 +286,7 @@ void ImProcFunctions::dehaze(Imagefloat *img, const DehazeParams &dehazeParams) const int H = img->getHeight(); const float strength = LIM01(float(dehazeParams.strength) / 100.f * 0.9f); - if (options.rtSettings.verbose) { + if (settings->verbose) { std::cout << "dehaze: strength = " << strength << std::endl; } @@ -324,7 +328,7 @@ void ImProcFunctions::dehaze(Imagefloat *img, const DehazeParams &dehazeParams) } if (min(ambient[0], ambient[1], ambient[2]) < 0.01f) { - if (options.rtSettings.verbose) { + if (settings->verbose) { std::cout << "dehaze: no haze detected" << std::endl; } restore(img, maxChannel, multiThread); @@ -332,7 +336,7 @@ void ImProcFunctions::dehaze(Imagefloat *img, const DehazeParams &dehazeParams) } patchsize = max(max(W, H) / 600, 2); - if (options.rtSettings.verbose) { + if (settings->verbose) { std::cout << "dehaze: ambient light is " << ambient[0] << ", " << ambient[1] << ", " << ambient[2] << std::endl; @@ -347,7 +351,7 @@ void ImProcFunctions::dehaze(Imagefloat *img, const DehazeParams &dehazeParams) array2D guideB(W, H, img->b.ptrs, ARRAY2D_BYREFERENCE); guidedFilter(guideB, dark, dark, radius, epsilon, multiThread); - if (options.rtSettings.verbose) { + if (settings->verbose) { std::cout << "dehaze: max distance is " << maxDistance << std::endl; } @@ -429,5 +433,4 @@ void ImProcFunctions::dehaze(Imagefloat *img, const DehazeParams &dehazeParams) } } - } // namespace rtengine diff --git a/rtengine/ipgrain.cc b/rtengine/ipgrain.cc index 75c9218b7..b9079606a 100644 --- a/rtengine/ipgrain.cc +++ b/rtengine/ipgrain.cc @@ -39,10 +39,7 @@ along with darktable. If not, see . */ -#ifdef _OPENMP -#include -#endif - +#include "imagefloat.h" #include "improcfun.h" #include "rt_math.h" diff --git a/rtengine/iplab2rgb.cc b/rtengine/iplab2rgb.cc index f751ecb46..18f0aa427 100644 --- a/rtengine/iplab2rgb.cc +++ b/rtengine/iplab2rgb.cc @@ -17,13 +17,14 @@ * along with RawTherapee. If not, see . */ #include "rtengine.h" +#include "image8.h" +#include "imagefloat.h" +#include "labimage.h" #include "improcfun.h" -#include +#include #include "iccstore.h" #include "iccmatrices.h" -#include "../rtgui/options.h" #include "settings.h" -#include "curves.h" #include "alignedbuffer.h" #include "color.h" #include "procparams.h" @@ -33,8 +34,6 @@ namespace rtengine extern void filmlike_clip(float *r, float *g, float *b); -extern const Settings* settings; - namespace { inline void copyAndClampLine(const float *src, unsigned char *dst, const int W) diff --git a/rtengine/iplabregions.cc b/rtengine/iplabregions.cc index af6567c3c..1768101c8 100644 --- a/rtengine/iplabregions.cc +++ b/rtengine/iplabregions.cc @@ -18,16 +18,17 @@ * along with RawTherapee. If not, see . */ -#ifdef _OPENMP -#include -#endif - -#include "improcfun.h" +#include "color.h" +#include "curves.h" #include "guidedfilter.h" +#include "iccstore.h" +#include "improcfun.h" +#include "labimage.h" #include "procparams.h" +#include "sleef.h" + //#define BENCHMARK #include "StopWatch.h" -#include "sleef.c" namespace { @@ -51,7 +52,8 @@ void fastlin2log(float *x, float factor, float base, int w) } -namespace rtengine { +namespace rtengine +{ void ImProcFunctions::labColorCorrectionRegions(LabImage *lab) { diff --git a/rtengine/iplocalcontrast.cc b/rtengine/iplocalcontrast.cc index 107ee453b..910efba5e 100644 --- a/rtengine/iplocalcontrast.cc +++ b/rtengine/iplocalcontrast.cc @@ -22,22 +22,17 @@ * along with RawTherapee. If not, see . */ -#ifdef _OPENMP -#include -#endif - #include "array2D.h" #include "gauss.h" +#include "labimage.h" #include "improcfun.h" #include "procparams.h" +#include "settings.h" namespace rtengine { - extern const Settings* settings; - - LocallabParams locallab; ///< Local lab parameters -void ImProcFunctions::localContrast(LabImage *lab, float **destination, const LocalContrastParams &localContrastParams, bool fftwlc, double scale) +void ImProcFunctions::localContrast(LabImage *lab, float **destination, const rtengine::procparams::LocalContrastParams &localContrastParams, bool fftwlc, double scale) { if (!localContrastParams.enabled) { return; diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index bec12739b..cad205068 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -24,13 +24,17 @@ #include #include "improcfun.h" +#include "colortemp.h" #include "curves.h" #include "gauss.h" -#include "iccmatrices.h" +#include "iccstore.h" +#include "imagefloat.h" +#include "labimage.h" #include "color.h" #include "rt_math.h" #include "jaggedarray.h" #include "rt_algo.h" +#include "settings.h" #ifdef _OPENMP #include @@ -179,9 +183,6 @@ extern MyMutex *fftwMutex; using namespace procparams; -extern const Settings* settings; - - struct local_params { float yc, xc; float ycbuf, xcbuf; diff --git a/rtengine/ipresize.cc b/rtengine/ipresize.cc index 0c1fb1ad8..b9e234b63 100644 --- a/rtengine/ipresize.cc +++ b/rtengine/ipresize.cc @@ -20,10 +20,12 @@ #include "improcfun.h" #include "alignedbuffer.h" +#include "imagefloat.h" +#include "labimage.h" #include "opthelper.h" #include "rt_math.h" #include "procparams.h" -#include "sleef.c" +#include "sleef.h" //#define PROFILE diff --git a/rtengine/ipretinex.cc b/rtengine/ipretinex.cc index e11b6514f..dc1353b08 100644 --- a/rtengine/ipretinex.cc +++ b/rtengine/ipretinex.cc @@ -41,8 +41,11 @@ #include #include +#include "color.h" +#include "curves.h" #include "gauss.h" #include "improcfun.h" +#include "labimage.h" #include "median.h" #include "opthelper.h" #include "procparams.h" @@ -181,9 +184,7 @@ void mean_stddv2(float **dst, float &mean, float &stddv, int W_L, int H_L, float namespace rtengine { -extern const Settings* settings; - -void RawImageSource::MSR(float** luminance, float** originalLuminance, float **exLuminance, const LUTf& mapcurve, bool mapcontlutili, int width, int height, const RetinexParams &deh, const RetinextransmissionCurve & dehatransmissionCurve, const RetinexgaintransmissionCurve & dehagaintransmissionCurve, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax) +void RawImageSource::MSR(float** luminance, float** originalLuminance, float **exLuminance, const LUTf& mapcurve, bool mapcontlutili, int width, int height, const procparams::RetinexParams &deh, const RetinextransmissionCurve & dehatransmissionCurve, const RetinexgaintransmissionCurve & dehagaintransmissionCurve, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax) { BENCHFUN diff --git a/rtengine/ipshadowshighlights.cc b/rtengine/ipshadowshighlights.cc index b40dbc4a2..9ca9e8b58 100644 --- a/rtengine/ipshadowshighlights.cc +++ b/rtengine/ipshadowshighlights.cc @@ -20,11 +20,15 @@ #include "improcfun.h" +#include "color.h" +#include "curves.h" #include "gauss.h" #include "guidedfilter.h" +#include "iccstore.h" +#include "labimage.h" #include "opthelper.h" #include "procparams.h" -#include "sleef.c" +#include "sleef.h" namespace rtengine { //modifications to pass parameters needs by locallab, to avoid 2 functions - no change in process - J.Desmis march 2019 diff --git a/rtengine/ipsharpen.cc b/rtengine/ipsharpen.cc index a4d643c7d..756ba4fe7 100644 --- a/rtengine/ipsharpen.cc +++ b/rtengine/ipsharpen.cc @@ -17,22 +17,27 @@ * along with RawTherapee. If not, see . */ -#include "improcfun.h" -#include "gauss.h" #include "bilateral2.h" +#include "cieimage.h" +#include "gauss.h" +#include "improcfun.h" #include "jaggedarray.h" -#include "rt_math.h" -#include "procparams.h" -#include "sleef.c" +#include "labimage.h" #include "opthelper.h" +#include "procparams.h" +#include "rt_algo.h" +#include "rt_math.h" +#include "settings.h" +#include "sleef.h" + //#define BENCHMARK #include "StopWatch.h" -#include "rt_algo.h" + using namespace std; namespace { -void sharpenHaloCtrl (float** luminance, float** blurmap, float** base, float** blend, int W, int H, const SharpeningParams &sharpenParam) +void sharpenHaloCtrl (float** luminance, float** blurmap, float** base, float** blend, int W, int H, const procparams::SharpeningParams &sharpenParam) { const float scale = (100.f - sharpenParam.halocontrol_amount) * 0.01f; @@ -156,9 +161,7 @@ void dcdamping (float** aI, float** aO, float damping, int W, int H) namespace rtengine { -extern const Settings* settings; - -void ImProcFunctions::deconvsharpening (float** luminance, float** tmp, const float * const * blend, int W, int H, const SharpeningParams &sharpenParam, double Scale) +void ImProcFunctions::deconvsharpening (float** luminance, float** tmp, const float * const * blend, int W, int H, const procparams::SharpeningParams &sharpenParam, double Scale) { if (sharpenParam.deconvamount == 0 && sharpenParam.blurradius < 0.25f) { return; @@ -342,10 +345,7 @@ void ImProcFunctions::deconvsharpeningloc (float** luminance, float** tmp, int W } - - - -void ImProcFunctions::sharpening (LabImage* lab, const SharpeningParams &sharpenParam, bool showMask) +void ImProcFunctions::sharpening (LabImage* lab, const procparams::SharpeningParams &sharpenParam, bool showMask) { if ((!sharpenParam.enabled) || sharpenParam.amount < 1 || lab->W < 8 || lab->H < 8) { diff --git a/rtengine/ipsoftlight.cc b/rtengine/ipsoftlight.cc index ae939f91f..7df44702e 100644 --- a/rtengine/ipsoftlight.cc +++ b/rtengine/ipsoftlight.cc @@ -19,7 +19,10 @@ * along with RawTherapee. If not, see . */ +#include "color.h" +#include "iccstore.h" #include "improcfun.h" +#include "labimage.h" #include "procparams.h" @@ -59,7 +62,7 @@ inline vfloat sl(vfloat blend, vfloat x) //} // namespace -void ImProcFunctions::softLight(LabImage *lab, const SoftLightParams &softLightParams) +void ImProcFunctions::softLight(LabImage *lab, const rtengine::procparams::SoftLightParams &softLightParams) { if (!softLightParams.enabled || !softLightParams.strength) { return; diff --git a/rtengine/iptcpairs.h b/rtengine/iptcpairs.h index 21099735a..af45d7d38 100644 --- a/rtengine/iptcpairs.h +++ b/rtengine/iptcpairs.h @@ -16,9 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _IPTCPAIRS_ -#define _IPTCPAIRS_ - +#pragma once struct IptcPair { IptcTag tag; @@ -44,6 +42,3 @@ const IptcPair strTags[] = { {IPTC_TAG_ORIG_TRANS_REF, 32, "TransReference"}, {IPTC_TAG_DATE_CREATED, 8, "DateCreated"} }; - -#endif - diff --git a/rtengine/iptransform.cc b/rtengine/iptransform.cc index 69b57d0ba..a4f304413 100644 --- a/rtengine/iptransform.cc +++ b/rtengine/iptransform.cc @@ -18,18 +18,14 @@ */ #include -#ifdef _OPENMP -#include -#endif - +#include "imagefloat.h" #include "improcfun.h" -#include "mytime.h" #include "procparams.h" #include "rt_math.h" #include "rtengine.h" #include "rtlensfun.h" -#include "sleef.c" +#include "sleef.h" using namespace std; diff --git a/rtengine/ipvibrance.cc b/rtengine/ipvibrance.cc index 534a2a018..a56a2c82a 100644 --- a/rtengine/ipvibrance.cc +++ b/rtengine/ipvibrance.cc @@ -23,16 +23,11 @@ #include "rtengine.h" #include "improcfun.h" #include "iccstore.h" -#include "mytime.h" -#include "../rtgui/thresholdselector.h" +#include "labimage.h" #include "curves.h" #include "color.h" #include "procparams.h" #include "StopWatch.h" -#ifdef _OPENMP -#include -#endif - using namespace std; diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index ff10b7b7f..bb750f005 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -28,18 +28,21 @@ #include "../rtgui/threadutils.h" -#include "rtengine.h" -#include "improcfun.h" -#include "LUT.h" #include "array2D.h" -#include "rt_math.h" -#include "mytime.h" -#include "sleef.c" -#include "opthelper.h" -#include "median.h" +#include "color.h" +#include "curves.h" #include "EdgePreservingDecomposition.h" #include "iccstore.h" +#include "improcfun.h" +#include "labimage.h" +#include "LUT.h" +#include "median.h" +#include "opthelper.h" #include "procparams.h" +#include "rt_math.h" +#include "rtengine.h" +#include "sleef.h" +#include "../rtgui/options.h" #ifdef _OPENMP #include @@ -54,12 +57,9 @@ #define epsilon 0.001f/(TS*TS) //tolerance - namespace rtengine { -extern const Settings* settings; - struct cont_params { float mul[10]; int chrom; diff --git a/rtengine/jpeg.h b/rtengine/jpeg.h index 99baecc5a..9b1f45f1d 100644 --- a/rtengine/jpeg.h +++ b/rtengine/jpeg.h @@ -1,5 +1,4 @@ -#ifndef _RT_JPEG_H -#define _RT_JPEG_H +#pragma once #include @@ -29,6 +28,3 @@ typedef struct { #ifdef __cplusplus } #endif - - -#endif diff --git a/rtengine/labimage.cc b/rtengine/labimage.cc index c49ecbbee..ef54bf862 100644 --- a/rtengine/labimage.cc +++ b/rtengine/labimage.cc @@ -17,7 +17,6 @@ * along with RawTherapee. If not, see . */ -#include #include #include "labimage.h" diff --git a/rtengine/labimage.h b/rtengine/labimage.h index a23f76624..4dd10dfb0 100644 --- a/rtengine/labimage.h +++ b/rtengine/labimage.h @@ -16,8 +16,9 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _LABIMAGE_H_ -#define _LABIMAGE_H_ +#pragma once + +#include namespace rtengine { @@ -46,4 +47,3 @@ public: }; } -#endif diff --git a/rtengine/lcp.cc b/rtengine/lcp.cc index b456fc478..57a87c1f1 100644 --- a/rtengine/lcp.cc +++ b/rtengine/lcp.cc @@ -18,8 +18,11 @@ */ #include +#include #include +#include +#include #include #ifdef WIN32 @@ -29,15 +32,11 @@ #include "lcp.h" +#include "opthelper.h" #include "procparams.h" +#include "rt_math.h" #include "settings.h" - -namespace rtengine -{ - -extern const Settings* settings; - -} +#include "utils.h" class rtengine::LCPProfile::LCPPersModel { @@ -984,7 +983,7 @@ rtengine::LCPMapper::LCPMapper( bool useCADistP, int fullWidth, int fullHeight, - const CoarseTransformParams& coarse, + const procparams::CoarseTransformParams& coarse, int rawRotationDeg ) : enableCA(false), diff --git a/rtengine/lcp.h b/rtengine/lcp.h index 30b7e5191..69fd43932 100644 --- a/rtengine/lcp.h +++ b/rtengine/lcp.h @@ -25,16 +25,23 @@ #include #include -#include +#include #include #include "cache.h" -#include "imagefloat.h" -#include "opthelper.h" namespace rtengine { +namespace procparams +{ + +class ProcParams; + +struct CoarseTransformParams; + +} + enum class LCPCorrectionMode { VIGNETTE, DISTORTION, @@ -185,7 +192,7 @@ public: bool useCADistP, int fullWidth, int fullHeight, - const CoarseTransformParams& coarse, + const procparams::CoarseTransformParams& coarse, int rawRotationDeg ); diff --git a/rtengine/myfile.cc b/rtengine/myfile.cc index 259e08565..842766dcf 100644 --- a/rtengine/myfile.cc +++ b/rtengine/myfile.cc @@ -18,8 +18,7 @@ */ #include "myfile.h" #include -#include - +#include "rtengine.h" // get mmap() sorted out #ifdef MYFILE_MMAP diff --git a/rtengine/myfile.h b/rtengine/myfile.h index f2ed4150c..7c498e556 100644 --- a/rtengine/myfile.h +++ b/rtengine/myfile.h @@ -16,13 +16,22 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _MYFILE_ -#define _MYFILE_ +#pragma once -#include #include #include -#include "rtengine.h" + +#include + +#include "opthelper.h" + +namespace rtengine +{ + +class ProgressListener; + +} + struct IMFILE { int fd; ssize_t pos; @@ -134,6 +143,3 @@ inline unsigned char* fdata(int offset, IMFILE* f) int fscanf (IMFILE* f, const char* s ...); char* fgets (char* s, int n, IMFILE* f); - -#endif - diff --git a/rtengine/pdaflinesfilter.cc b/rtengine/pdaflinesfilter.cc index d0694fd11..e788c6c83 100644 --- a/rtengine/pdaflinesfilter.cc +++ b/rtengine/pdaflinesfilter.cc @@ -18,17 +18,18 @@ * along with RawTherapee. If not, see . */ -#include "pdaflinesfilter.h" -#include "settings.h" #include + #include "camconst.h" +#include "pdaflinesfilter.h" +#include "rawimage.h" +#include "settings.h" -namespace rtengine { +namespace rtengine +{ -extern const Settings *settings; - - -namespace { +namespace +{ class PDAFGreenEqulibrateThreshold: public RawImageSource::GreenEqulibrateThreshold { static constexpr float BASE_THRESHOLD = 0.5f; @@ -166,8 +167,6 @@ private: } // namespace - - PDAFLinesFilter::PDAFLinesFilter(RawImage *ri): ri_(ri), W_(ri->get_width()), diff --git a/rtengine/pdaflinesfilter.h b/rtengine/pdaflinesfilter.h index 7f4c7985b..c3d8b47f4 100644 --- a/rtengine/pdaflinesfilter.h +++ b/rtengine/pdaflinesfilter.h @@ -21,10 +21,14 @@ #pragma once #include -#include "rawimagesource.h" -#include "noncopyable.h" -namespace rtengine { +#include "noncopyable.h" +#include "rawimagesource.h" + +namespace rtengine +{ + +class RawImage; class PDAFLinesFilter: public rtengine::NonCopyable { diff --git a/rtengine/pipettebuffer.cc b/rtengine/pipettebuffer.cc index d915381ef..11cf50ae9 100644 --- a/rtengine/pipettebuffer.cc +++ b/rtengine/pipettebuffer.cc @@ -20,6 +20,7 @@ #include "pipettebuffer.h" #include "imagefloat.h" +#include "labimage.h" #include "../rtgui/editcallbacks.h" diff --git a/rtengine/pipettebuffer.h b/rtengine/pipettebuffer.h index 01b24720c..ef8a5f69a 100644 --- a/rtengine/pipettebuffer.h +++ b/rtengine/pipettebuffer.h @@ -31,6 +31,7 @@ namespace rtengine { class Imagefloat; +class LabImage; /// @brief Structure that contains information about and pointers to the Edit buffer class PipetteBuffer diff --git a/rtengine/pixelshift.cc b/rtengine/pixelshift.cc index 4b93f3f61..0d83d7af3 100644 --- a/rtengine/pixelshift.cc +++ b/rtengine/pixelshift.cc @@ -21,13 +21,20 @@ //////////////////////////////////////////////////////////////// #include -#include "rawimagesource.h" -#include "../rtgui/multilangmgr.h" -#include "procparams.h" +#include + +#include "array2D.h" #include "gauss.h" #include "median.h" +#include "procparams.h" +#include "rawimagesource.h" +#include "sleef.h" +#include "../rtgui/multilangmgr.h" +#include "../rtgui/options.h" + //#define BENCHMARK #include "StopWatch.h" + namespace { @@ -107,9 +114,9 @@ void xorMasks(int xStart, int xEnd, int yStart, int yEnd, const array2D } } -void floodFill4Impl(int y, int x, int xStart, int xEnd, int yStart, int yEnd, array2D &mask, std::stack, std::vector>> &coordStack) +void floodFill4Impl(int yin, int xin, int xStart, int xEnd, int yStart, int yEnd, array2D &mask, std::stack, std::vector>> &coordStack) { - coordStack.emplace(x, y); + coordStack.emplace(xin, yin); while(!coordStack.empty()) { auto coord = coordStack.top(); @@ -295,7 +302,7 @@ void calcFrameBrightnessFactor(unsigned int frame, uint32_t datalen, LUTu *histo using namespace std; using namespace rtengine; -void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RAWParams &rawParamsIn, unsigned int frame, const std::string &make, const std::string &model, float rawWpCorrection) +void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const procparams::RAWParams &rawParamsIn, unsigned int frame, const std::string &make, const std::string &model, float rawWpCorrection) { BENCHFUN if(numFrames != 4) { // fallback for non pixelshift files @@ -303,15 +310,15 @@ BENCHFUN return; } - RAWParams::BayerSensor bayerParams = rawParamsIn.bayersensor; + procparams::RAWParams::BayerSensor bayerParams = rawParamsIn.bayersensor; bool motionDetection = true; - if(bayerParams.pixelShiftMotionCorrectionMethod == RAWParams::BayerSensor::PSMotionCorrectionMethod::AUTO) { + if(bayerParams.pixelShiftMotionCorrectionMethod == procparams::RAWParams::BayerSensor::PSMotionCorrectionMethod::AUTO) { bool pixelShiftEqualBright = bayerParams.pixelShiftEqualBright; bayerParams.setPixelShiftDefaults(); bayerParams.pixelShiftEqualBright = pixelShiftEqualBright; - } else if(bayerParams.pixelShiftMotionCorrectionMethod == RAWParams::BayerSensor::PSMotionCorrectionMethod::OFF) { + } else if(bayerParams.pixelShiftMotionCorrectionMethod == procparams::RAWParams::BayerSensor::PSMotionCorrectionMethod::OFF) { motionDetection = false; bayerParams.pixelShiftShowMotion = false; } @@ -323,9 +330,9 @@ BENCHFUN if(motionDetection) { if(!showOnlyMask) { if(bayerParams.pixelShiftMedian) { // We need the demosaiced frames for motion correction - if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(RAWParams::BayerSensor::PSDemosaicMethod::LMMSE)) { + if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(procparams::RAWParams::BayerSensor::PSDemosaicMethod::LMMSE)) { lmmse_interpolate_omp(winw, winh, *(rawDataFrames[0]), red, green, blue, bayerParams.lmmse_iterations); - } else if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(RAWParams::BayerSensor::PSDemosaicMethod::AMAZEVNG4)) { + } else if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(procparams::RAWParams::BayerSensor::PSDemosaicMethod::AMAZEVNG4)) { dual_demosaic_RT (true, rawParamsIn, winw, winh, *(rawDataFrames[0]), red, green, blue, bayerParams.dualDemosaicContrast, true); } else { amaze_demosaic_RT(winx, winy, winw, winh, *(rawDataFrames[0]), red, green, blue, options.chunkSizeAMAZE, options.measure); @@ -335,9 +342,9 @@ BENCHFUN multi_array2D blueTmp(winw, winh); for(int i = 0; i < 3; i++) { - if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(RAWParams::BayerSensor::PSDemosaicMethod::LMMSE)) { + if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(procparams::RAWParams::BayerSensor::PSDemosaicMethod::LMMSE)) { lmmse_interpolate_omp(winw, winh, *(rawDataFrames[i + 1]), redTmp[i], greenTmp[i], blueTmp[i], bayerParams.lmmse_iterations); - } else if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(RAWParams::BayerSensor::PSDemosaicMethod::AMAZEVNG4)) { + } else if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(procparams::RAWParams::BayerSensor::PSDemosaicMethod::AMAZEVNG4)) { dual_demosaic_RT (true, rawParamsIn, winw, winh, *(rawDataFrames[i + 1]), redTmp[i], greenTmp[i], blueTmp[i], bayerParams.dualDemosaicContrast, true); } else { amaze_demosaic_RT(winx, winy, winw, winh, *(rawDataFrames[i + 1]), redTmp[i], greenTmp[i], blueTmp[i], options.chunkSizeAMAZE, options.measure); @@ -362,11 +369,11 @@ BENCHFUN } } } else { - if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(RAWParams::BayerSensor::PSDemosaicMethod::LMMSE)) { + if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(procparams::RAWParams::BayerSensor::PSDemosaicMethod::LMMSE)) { lmmse_interpolate_omp(winw, winh, rawData, red, green, blue, bayerParams.lmmse_iterations); - } else if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(RAWParams::BayerSensor::PSDemosaicMethod::AMAZEVNG4)) { - RAWParams rawParamsTmp = rawParamsIn; - rawParamsTmp.bayersensor.method = RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::AMAZEVNG4); + } else if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(procparams::RAWParams::BayerSensor::PSDemosaicMethod::AMAZEVNG4)) { + procparams::RAWParams rawParamsTmp = rawParamsIn; + rawParamsTmp.bayersensor.method = procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::AMAZEVNG4); dual_demosaic_RT (true, rawParamsTmp, winw, winh, rawData, red, green, blue, bayerParams.dualDemosaicContrast, true); } else { amaze_demosaic_RT(winx, winy, winw, winh, rawData, red, green, blue, options.chunkSizeAMAZE, options.measure); diff --git a/rtengine/previewimage.cc b/rtengine/previewimage.cc index 7216e6a34..de1603f1c 100644 --- a/rtengine/previewimage.cc +++ b/rtengine/previewimage.cc @@ -19,6 +19,7 @@ #include "previewimage.h" +#include "color.h" #include "iimage.h" #include "iimage.h" #include "procparams.h" diff --git a/rtengine/previewimage.h b/rtengine/previewimage.h index 71ddefe8a..e6c3ea070 100644 --- a/rtengine/previewimage.h +++ b/rtengine/previewimage.h @@ -16,10 +16,10 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _PREVIEWIMAGE_ -#define _PREVIEWIMAGE_ +#pragma once + +#include -#include #include namespace rtengine @@ -52,5 +52,3 @@ public: }; } - -#endif diff --git a/rtengine/processingjob.h b/rtengine/processingjob.h index 004eb006f..6cdc6bd7c 100644 --- a/rtengine/processingjob.h +++ b/rtengine/processingjob.h @@ -16,11 +16,10 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _PROCESSINGJOB_ -#define _PROCESSINGJOB_ +#pragma once -#include "rtengine.h" #include "procparams.h" +#include "rtengine.h" namespace rtengine { @@ -55,5 +54,3 @@ public: }; } - -#endif diff --git a/rtengine/procevents.h b/rtengine/procevents.h index e5136bd3b..a25123a3b 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -16,15 +16,11 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef __PROCEVENT__ -#define __PROCEVENT__ +#pragma once namespace rtengine { - - - // Aligned so the first entry starts on line 30 enum ProcEventCode { EvPhotoLoaded = 0, @@ -843,31 +839,11 @@ private: }; -inline bool operator==(ProcEvent a, ProcEvent b) -{ - return int(a) == int(b); -} -inline bool operator==(ProcEvent a, ProcEventCode b) -{ - return int(a) == int(b); -} -inline bool operator==(ProcEventCode a, ProcEvent b) -{ - return int(a) == int(b); -} -inline bool operator!=(ProcEvent a, ProcEvent b) -{ - return int(a) != int(b); -} -inline bool operator!=(ProcEvent a, ProcEventCode b) -{ - return int(a) != int(b); -} -inline bool operator!=(ProcEventCode a, ProcEvent b) -{ - return int(a) != int(b); -} +inline bool operator ==(ProcEvent a, ProcEvent b) { return int(a) == int(b); } +inline bool operator ==(ProcEvent a, ProcEventCode b) { return int(a) == int(b); } +inline bool operator ==(ProcEventCode a, ProcEvent b) { return int(a) == int(b); } +inline bool operator !=(ProcEvent a, ProcEvent b) { return int(a) != int(b); } +inline bool operator !=(ProcEvent a, ProcEventCode b) { return int(a) != int(b); } +inline bool operator !=(ProcEventCode a, ProcEvent b) { return int(a) != int(b); } } -#endif - diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 3abf7d02d..74d6bbf15 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -22,9 +22,14 @@ #include #include +#include +#include +#include +#include "color.h" #include "curves.h" #include "procparams.h" +#include "utils.h" #include "../rtgui/multilangmgr.h" #include "../rtgui/options.h" diff --git a/rtengine/procparams.h b/rtengine/procparams.h index cfaebe3b3..e99a0434c 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -20,10 +20,11 @@ #include #include +#include #include #include -#include +#include #include #include "noncopyable.h" diff --git a/rtengine/profilestore.cc b/rtengine/profilestore.cc index 5c38cf705..7d937e736 100644 --- a/rtengine/profilestore.cc +++ b/rtengine/profilestore.cc @@ -16,6 +16,10 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ + +#include +#include + #include "profilestore.h" #include "dynamicprofile.h" @@ -156,7 +160,7 @@ void ProfileStore::_parseProfiles () if (findEntryFromFullPathU (options.defProfRaw) == nullptr) { options.setDefProfRawMissing (true); - if (options.rtSettings.verbose) { + if (settings->verbose) { printf ("WARNING: Default profile \"%s\" for raw images not found!\n", options.defProfRaw.c_str()); } } @@ -164,7 +168,7 @@ void ProfileStore::_parseProfiles () if (findEntryFromFullPathU (options.defProfImg) == nullptr) { options.setDefProfImgMissing (true); - if (options.rtSettings.verbose) { + if (settings->verbose) { printf ("WARNING: Default profile \"%s\" for standard images not found!\n", options.defProfImg.c_str()); } } @@ -216,7 +220,7 @@ bool ProfileStore::parseDir (Glib::ustring& realPath, Glib::ustring& virtualPath if (lastdot != Glib::ustring::npos && lastdot == currDir.length() - 4 && currDir.substr (lastdot).casefold() == paramFileExtension) { // file found - if ( options.rtSettings.verbose ) { + if (settings->verbose) { printf ("Processing file %s...", fname.c_str()); } @@ -229,7 +233,7 @@ bool ProfileStore::parseDir (Glib::ustring& realPath, Glib::ustring& virtualPath if (!res && pProf->pparams->ppVersion >= 220) { fileFound = true; - if ( options.rtSettings.verbose ) { + if (settings->verbose) { printf ("OK\n"); } @@ -240,7 +244,7 @@ bool ProfileStore::parseDir (Glib::ustring& realPath, Glib::ustring& virtualPath // map the partial profile partProfiles[filePSE] = pProf; //partProfiles.insert( std::pair (filePSE, pProf) ); - } else if ( options.rtSettings.verbose ) { + } else if (settings->verbose) { printf ("failed!\n"); } } @@ -518,7 +522,7 @@ PartialProfile *ProfileStore::loadDynamicProfile (const FramesMetaData *im) for (auto rule : dynamicRules) { if (rule.matches (im)) { - if (options.rtSettings.verbose) { + if (settings->verbose) { printf ("found matching profile %s\n", rule.profilepath.c_str()); } diff --git a/rtengine/profilestore.h b/rtengine/profilestore.h index 384aa2a46..460facb72 100644 --- a/rtengine/profilestore.h +++ b/rtengine/profilestore.h @@ -16,16 +16,16 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _PROFILESTORE_ -#define _PROFILESTORE_ +#pragma once #include #include -#include -#include "rtengine.h" -#include "noncopyable.h" +#include + #include "dynamicprofile.h" +#include "noncopyable.h" +#include "../rtgui/threadutils.h" // forward decl namespace rtengine @@ -34,6 +34,8 @@ namespace rtengine namespace procparams { +class ProcParams; + class AutoPartialProfile; class PartialProfile; @@ -211,5 +213,3 @@ public: void dumpFolderList(); }; - -#endif diff --git a/rtengine/rawflatfield.cc b/rtengine/rawflatfield.cc index 782a44b78..05b3be408 100644 --- a/rtengine/rawflatfield.cc +++ b/rtengine/rawflatfield.cc @@ -23,6 +23,7 @@ #include "rawimagesource.h" #include "procparams.h" +#include "rawimage.h" //#define BENCHMARK //#include "StopWatch.h" #include "opthelper.h" @@ -32,7 +33,7 @@ namespace { void cfaboxblur(const float* const * riFlatFile, float* cfablur, int boxH, int boxW, int H, int W) { if (boxW < 0 || boxH < 0 || (boxW == 0 && boxH == 0)) { // nothing to blur or negative values - memcpy(cfablur, riFlatFile[0], W * H * sizeof(float)); + memcpy(cfablur, riFlatFile[0], static_cast(W) * H * sizeof(float)); return; } @@ -262,7 +263,7 @@ void cfaboxblur(const float* const * riFlatFile, float* cfablur, int boxH, int b namespace rtengine { -void RawImageSource::processFlatField(const RAWParams &raw, const RawImage *riFlatFile, const unsigned short black[4]) +void RawImageSource::processFlatField(const procparams::RAWParams &raw, const RawImage *riFlatFile, const unsigned short black[4]) { // BENCHFUN const float fblack[4] = {static_cast(black[0]), static_cast(black[1]), static_cast(black[2]), static_cast(black[3])}; @@ -270,11 +271,11 @@ void RawImageSource::processFlatField(const RAWParams &raw, const RawImage *riFl const int BS = raw.ff_BlurRadius + (raw.ff_BlurRadius & 1); - if (raw.ff_BlurType == RAWParams::getFlatFieldBlurTypeString(RAWParams::FlatFieldBlurType::V)) { + if (raw.ff_BlurType == procparams::RAWParams::getFlatFieldBlurTypeString(procparams::RAWParams::FlatFieldBlurType::V)) { cfaboxblur(riFlatFile->data, cfablur.get(), 2 * BS, 0, H, W); - } else if (raw.ff_BlurType == RAWParams::getFlatFieldBlurTypeString(RAWParams::FlatFieldBlurType::H)) { + } else if (raw.ff_BlurType == procparams::RAWParams::getFlatFieldBlurTypeString(procparams::RAWParams::FlatFieldBlurType::H)) { cfaboxblur(riFlatFile->data, cfablur.get(), 0, 2 * BS, H, W); - } else if (raw.ff_BlurType == RAWParams::getFlatFieldBlurTypeString(RAWParams::FlatFieldBlurType::VH)) { + } else if (raw.ff_BlurType == procparams::RAWParams::getFlatFieldBlurTypeString(procparams::RAWParams::FlatFieldBlurType::VH)) { //slightly more complicated blur if trying to correct both vertical and horizontal anomalies cfaboxblur(riFlatFile->data, cfablur.get(), BS, BS, H, W); //first do area blur to correct vignette } else { //(raw.ff_BlurType == RAWParams::getFlatFieldBlurTypeString(RAWParams::area_ff)) @@ -464,7 +465,7 @@ void RawImageSource::processFlatField(const RAWParams &raw, const RawImage *riFl } } - if (raw.ff_BlurType == RAWParams::getFlatFieldBlurTypeString(RAWParams::FlatFieldBlurType::VH)) { + if (raw.ff_BlurType == procparams::RAWParams::getFlatFieldBlurTypeString(procparams::RAWParams::FlatFieldBlurType::VH)) { std::unique_ptr cfablur1(new float[H * W]); std::unique_ptr cfablur2(new float[H * W]); //slightly more complicated blur if trying to correct both vertical and horizontal anomalies diff --git a/rtengine/rawimage.cc b/rtengine/rawimage.cc index e1c39cf9c..dc44307aa 100644 --- a/rtengine/rawimage.cc +++ b/rtengine/rawimage.cc @@ -15,12 +15,11 @@ #include "settings.h" #include "camconst.h" #include "utils.h" +#include "rtengine.h" namespace rtengine { -extern const Settings* settings; - RawImage::RawImage(const Glib::ustring &name) : data(nullptr) , prefilters(0) diff --git a/rtengine/rawimage.h b/rtengine/rawimage.h index c31b7db41..7fb1dbbc4 100644 --- a/rtengine/rawimage.h +++ b/rtengine/rawimage.h @@ -16,12 +16,12 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef __RAWIMAGE_H -#define __RAWIMAGE_H +#pragma once #include #include #include +#include #include "dcraw.h" #include "imageformat.h" @@ -308,5 +308,3 @@ public: }; } - -#endif // __RAWIMAGE_H diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index ce3097f7b..6a99aca2f 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -19,32 +19,38 @@ #include #include -#include "rtengine.h" -#include "rawimagesource.h" -#include "rawimagesource_i.h" -#include "jaggedarray.h" -#include "median.h" -#include "rawimage.h" -#include "mytime.h" -#include "iccstore.h" +#include "camconst.h" +#include "color.h" #include "curves.h" +#include "dcp.h" #include "dfmanager.h" #include "ffmanager.h" -#include "dcp.h" -#include "rt_math.h" +#include "iccstore.h" +#include "imagefloat.h" #include "improcfun.h" -#include "rtlensfun.h" +#include "jaggedarray.h" +#include "median.h" +#include "mytime.h" #include "pdaflinesfilter.h" -#include "camconst.h" #include "procparams.h" -#include "color.h" +#include "rawimage.h" +#include "rawimagesource_i.h" +#include "rawimagesource.h" +#include "rt_math.h" +#include "rtengine.h" +#include "rtlensfun.h" +#include "../rtgui/options.h" + //#define BENCHMARK //#include "StopWatch.h" + #ifdef _OPENMP #include #endif + #include "opthelper.h" #define clipretinex( val, minv, maxv ) (( val = (val < minv ? minv : val ) ) > maxv ? maxv : val ) + #undef CLIPD #define CLIPD(a) ((a)>0.0f?((a)<1.0f?(a):1.0f):0.0f) @@ -419,7 +425,6 @@ void transLineD1x (const float* const red, const float* const green, const float namespace rtengine { -extern const Settings* settings; #undef ABS #undef DIST @@ -501,6 +506,26 @@ RawImageSource::~RawImageSource() } } +unsigned RawImageSource::FC(int row, int col) const +{ + return ri->FC(row, col); +} + +eSensorType RawImageSource::getSensorType () const +{ + return ri != nullptr ? ri->getSensorType() : ST_NONE; +} + +bool RawImageSource::isMono() const +{ + return ri->get_colors() == 1; +} + +int RawImageSource::getRotateDegree() const +{ + return ri->get_rotateDegree(); +} + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void RawImageSource::transformRect(const PreviewProps &pp, int tran, int &ssx1, int &ssy1, int &width, int &height, int &fw) @@ -914,7 +939,7 @@ void RawImageSource::getImage(const ColorTemp &ctemp, int tran, Imagefloat* imag } } -DCPProfile *RawImageSource::getDCP(const ColorManagementParams &cmp, DCPProfile::ApplyState &as) +DCPProfile *RawImageSource::getDCP(const ColorManagementParams &cmp, DCPProfileApplyState &as) { if (cmp.inputProfile == "(camera)" || cmp.inputProfile == "(none)") { return nullptr; diff --git a/rtengine/rawimagesource.h b/rtengine/rawimagesource.h index 74ec7f00a..f20a08ecc 100644 --- a/rtengine/rawimagesource.h +++ b/rtengine/rawimagesource.h @@ -23,9 +23,7 @@ #include #include "array2D.h" -#include "color.h" -#include "curves.h" -#include "dcp.h" +#include "colortemp.h" #include "iimage.h" #include "imagesource.h" #include "pixelsmap.h" @@ -34,6 +32,10 @@ namespace rtengine { +class RawImage; +class DiagonalCurve; +class RetinextransmissionCurve; +class RetinexgaintransmissionCurve; class RawImageSource : public ImageSource { @@ -107,11 +109,8 @@ protected: void transformRect(const PreviewProps &pp, int tran, int &sx1, int &sy1, int &width, int &height, int &fw); void transformPosition(int x, int y, int tran, int& tx, int& ty); - unsigned FC(int row, int col) const - { - return ri->FC(row, col); - } - inline void getRowStartEnd(int x, int &start, int &end); + unsigned FC(int row, int col) const; + inline void getRowStartEnd (int x, int &start, int &end); static void getProfilePreprocParams(cmsHPROFILE in, float& gammafac, float& lineFac, float& lineSum); public: @@ -122,7 +121,7 @@ public: int load(const Glib::ustring &fname, bool firstFrameOnly); void preprocess (const procparams::RAWParams &raw, const procparams::LensProfParams &lensProf, const procparams::CoarseTransformParams& coarse, bool prepareDenoise = true) override; void filmNegativeProcess (const procparams::FilmNegativeParams ¶ms) override; - bool getFilmNegativeExponents (Coord2D spotA, Coord2D spotB, int tran, const FilmNegativeParams ¤tParams, std::array& newExps) override; + bool getFilmNegativeExponents (Coord2D spotA, Coord2D spotB, int tran, const procparams::FilmNegativeParams ¤tParams, std::array& newExps) override; void demosaic (const procparams::RAWParams &raw, bool autoContrast, double &contrastThreshold, bool cache = false) override; void retinex (const procparams::ColorManagementParams& cmp, const procparams::RetinexParams &deh, const procparams::ToneCurveParams& Tc, LUTf & cdcurve, LUTf & mapcurve, const RetinextransmissionCurve & dehatransmissionCurve, const RetinexgaintransmissionCurve & dehagaintransmissionCurve, multi_array2D &conversionBuffer, bool dehacontlutili, bool mapcontlutili, bool useHsl, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax, LUTu &histLRETI) override; void retinexPrepareCurves (const procparams::RetinexParams &retinexParams, LUTf &cdcurve, LUTf &mapcurve, RetinextransmissionCurve &retinextransmissionCurve, RetinexgaintransmissionCurve &retinexgaintransmissionCurve, bool &retinexcontlutili, bool &mapcontlutili, bool &useHsl, LUTu & lhist16RETI, LUTu & histLRETI) override; @@ -138,20 +137,14 @@ public: return rgbSourceModified; // tracks whether cached rgb output of demosaic has been modified } - void processFlatField(const RAWParams &raw, const RawImage *riFlatFile, const unsigned short black[4]); - void copyOriginalPixels(const RAWParams &raw, RawImage *ri, RawImage *riDark, RawImage *riFlatFile, array2D &rawData); - void scaleColors(int winx, int winy, int winw, int winh, const RAWParams &raw, array2D &rawData); // raw for cblack + void processFlatField(const procparams::RAWParams &raw, const RawImage *riFlatFile, const unsigned short black[4]); + void copyOriginalPixels(const procparams::RAWParams &raw, RawImage *ri, RawImage *riDark, RawImage *riFlatFile, array2D &rawData ); + void scaleColors (int winx, int winy, int winw, int winh, const procparams::RAWParams &raw, array2D &rawData); // raw for cblack void getImage (const ColorTemp &ctemp, int tran, Imagefloat* image, const PreviewProps &pp, const procparams::ToneCurveParams &hrp, const procparams::RAWParams &raw) override; - eSensorType getSensorType () const override - { - return ri != nullptr ? ri->getSensorType() : ST_NONE; - } - bool isMono () const override - { - return ri->get_colors() == 1; - } - ColorTemp getWB () const override + eSensorType getSensorType () const override; + bool isMono () const override; + ColorTemp getWB () const override { return camera_wb; } @@ -169,10 +162,7 @@ public: void getFullSize (int& w, int& h, int tr = TR_NONE) override; void getSize (const PreviewProps &pp, int& w, int& h) override; - int getRotateDegree() const override - { - return ri->get_rotateDegree(); - } + int getRotateDegree() const override; ImageMatrices* getImageMatrices () override { @@ -190,17 +180,17 @@ public: void getAutoExpHistogram (LUTu & histogram, int& histcompr) override; void getRAWHistogram (LUTu & histRedRaw, LUTu & histGreenRaw, LUTu & histBlueRaw) override; void getAutoMatchedToneCurve(const procparams::ColorManagementParams &cp, std::vector &outCurve) override; - DCPProfile *getDCP(const procparams::ColorManagementParams &cmp, DCPProfile::ApplyState &as) override; + DCPProfile *getDCP(const procparams::ColorManagementParams &cmp, DCPProfileApplyState &as) override; void convertColorSpace(Imagefloat* image, const procparams::ColorManagementParams &cmp, const ColorTemp &wb) override; static bool findInputProfile(Glib::ustring inProfile, cmsHPROFILE embedded, std::string camName, DCPProfile **dcpProf, cmsHPROFILE& in); - static void colorSpaceConversion(Imagefloat* im, const ColorManagementParams& cmp, const ColorTemp &wb, double pre_mul[3], cmsHPROFILE embedded, cmsHPROFILE camprofile, double cam[3][3], const std::string &camName) + static void colorSpaceConversion(Imagefloat* im, const procparams::ColorManagementParams& cmp, const ColorTemp &wb, double pre_mul[3], cmsHPROFILE embedded, cmsHPROFILE camprofile, double cam[3][3], const std::string &camName) { colorSpaceConversion_(im, cmp, wb, pre_mul, embedded, camprofile, cam, camName); } static void inverse33(const double (*coeff)[3], double (*icoeff)[3]); - void MSR(float** luminance, float **originalLuminance, float **exLuminance, const LUTf& mapcurve, bool mapcontlutili, int width, int height, const RetinexParams &deh, const RetinextransmissionCurve & dehatransmissionCurve, const RetinexgaintransmissionCurve & dehagaintransmissionCurve, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax); + void MSR(float** luminance, float **originalLuminance, float **exLuminance, const LUTf& mapcurve, bool mapcontlutili, int width, int height, const procparams::RetinexParams &deh, const RetinextransmissionCurve & dehatransmissionCurve, const RetinexgaintransmissionCurve & dehagaintransmissionCurve, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax); void HLRecovery_inpaint (float** red, float** green, float** blue) override; static void HLRecovery_Luminance (float* rin, float* gin, float* bin, float* rout, float* gout, float* bout, int width, float maxval); static void HLRecovery_CIELab (float* rin, float* gin, float* bin, float* rout, float* gout, float* bout, int width, float maxval, double cam[3][3], double icam[3][3]); @@ -281,7 +271,7 @@ protected: void igv_interpolate(int winw, int winh); void lmmse_interpolate_omp(int winw, int winh, array2D &rawData, array2D &red, array2D &green, array2D &blue, int iterations); void amaze_demosaic_RT(int winx, int winy, int winw, int winh, const array2D &rawData, array2D &red, array2D &green, array2D &blue, size_t chunkSize = 1, bool measure = false);//Emil's code for AMaZE - void dual_demosaic_RT(bool isBayer, const RAWParams &raw, int winw, int winh, const array2D &rawData, array2D &red, array2D &green, array2D &blue, double &contrast, bool autoContrast = false); + void dual_demosaic_RT(bool isBayer, const procparams::RAWParams &raw, int winw, int winh, const array2D &rawData, array2D &red, array2D &green, array2D &blue, double &contrast, bool autoContrast = false); void fast_demosaic();//Emil's code for fast demosaicing void dcb_demosaic(int iterations, bool dcb_enhance); void ahd_demosaic(); @@ -306,7 +296,7 @@ protected: void xtransborder_interpolate (int border, array2D &red, array2D &green, array2D &blue); void xtrans_interpolate (const int passes, const bool useCieLab, size_t chunkSize = 1, bool measure = false); void fast_xtrans_interpolate (const array2D &rawData, array2D &red, array2D &green, array2D &blue); - void pixelshift(int winx, int winy, int winw, int winh, const RAWParams &rawParams, unsigned int frame, const std::string &make, const std::string &model, float rawWpCorrection); + void pixelshift(int winx, int winy, int winw, int winh, const procparams::RAWParams &rawParams, unsigned int frame, const std::string &make, const std::string &model, float rawWpCorrection); void hflip (Imagefloat* im); void vflip (Imagefloat* im); void getRawValues(int x, int y, int rotate, int &R, int &G, int &B) override; diff --git a/rtengine/rawimagesource_i.h b/rtengine/rawimagesource_i.h index 485205d9d..47c6b5bab 100644 --- a/rtengine/rawimagesource_i.h +++ b/rtengine/rawimagesource_i.h @@ -16,9 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ - -#ifndef RAWIMAGESOURCE_I_H_INCLUDED -#define RAWIMAGESOURCE_I_H_INCLUDED +#pragma once #include "rawimagesource.h" @@ -184,5 +182,3 @@ inline void RawImageSource::interpolate_row_rb_mul_pp (const array2D &raw } } - -#endif diff --git a/rtengine/rawmetadatalocation.h b/rtengine/rawmetadatalocation.h index 559815a4f..894bc6bd2 100644 --- a/rtengine/rawmetadatalocation.h +++ b/rtengine/rawmetadatalocation.h @@ -16,8 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _RAWMETADATALOCATION_ -#define _RAWMETADATALOCATION_ +#pragma once namespace rtengine { @@ -36,6 +35,3 @@ public: }; } - -#endif - diff --git a/rtengine/rcd_demosaic.cc b/rtengine/rcd_demosaic.cc index 48c3ad334..63b5989ab 100644 --- a/rtengine/rcd_demosaic.cc +++ b/rtengine/rcd_demosaic.cc @@ -20,7 +20,6 @@ #include "rawimagesource.h" #include "rt_math.h" -#include "procparams.h" #include "../rtgui/multilangmgr.h" #include "opthelper.h" #include "StopWatch.h" diff --git a/rtengine/refreshmap.h b/rtengine/refreshmap.h index 3f4831329..0f3e5ee90 100644 --- a/rtengine/refreshmap.h +++ b/rtengine/refreshmap.h @@ -16,10 +16,10 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef __REFRESHMAP__ -#define __REFRESHMAP__ +#pragma once #include + #include "procevents.h" // Use M_VOID if you wish to update the proc params without updating the preview at all ! @@ -80,7 +80,8 @@ extern int refreshmap[]; -namespace rtengine { +namespace rtengine +{ class RefreshMapper { public: @@ -97,5 +98,3 @@ private: }; } // namespace rtengine - -#endif diff --git a/rtengine/rescale.h b/rtengine/rescale.h index 8e1f99271..70974aa48 100644 --- a/rtengine/rescale.h +++ b/rtengine/rescale.h @@ -23,7 +23,8 @@ #include "array2D.h" #include "rt_math.h" -namespace rtengine { +namespace rtengine +{ inline float getBilinearValue(const array2D &src, float x, float y) { @@ -96,5 +97,4 @@ inline void rescaleNearest(const array2D &src, array2D &dst, bool } } - } // namespace rtengine diff --git a/rtengine/rt_algo.cc b/rtengine/rt_algo.cc index aadbac7f7..b02e75461 100644 --- a/rtengine/rt_algo.cc +++ b/rtengine/rt_algo.cc @@ -31,7 +31,7 @@ #include "opthelper.h" #include "rt_algo.h" #include "rt_math.h" -#include "sleef.c" +#include "sleef.h" namespace { float calcBlendFactor(float val, float threshold) { diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h index 96b25e5a6..401c55302 100644 --- a/rtengine/rtengine.h +++ b/rtengine/rtengine.h @@ -21,21 +21,18 @@ #include #include #include +#include -#include +#include #include #include "iimage.h" #include "imageformat.h" -#include "LUT.h" #include "procevents.h" #include "rawmetadatalocation.h" #include "rt_math.h" #include "settings.h" -#include "utils.h" - -#include "../rtexif/rtexif.h" #include "../rtgui/threadutils.h" @@ -46,7 +43,18 @@ * */ +template +class LUT; + +using LUTu = LUT; + class EditDataProvider; +namespace rtexif +{ + +class TagDirectory; + +} namespace rtengine { @@ -574,7 +582,7 @@ public: * @param baseDir base directory of RT's installation dir * @param userSettingsDir RT's base directory in the user's settings dir * @param loadAll if false, don't load the various dependencies (profiles, HALDClut files, ...), they'll be loaded from disk each time they'll be used (launching time improvement) */ -int init (const Settings* s, Glib::ustring baseDir, Glib::ustring userSettingsDir, bool loadAll = true); +int init (const Settings* s, const Glib::ustring& baseDir, const Glib::ustring& userSettingsDir, bool loadAll = true); /** Cleanup the RT engine (static variables) */ void cleanup (); diff --git a/rtengine/rtlensfun.cc b/rtengine/rtlensfun.cc index 8c634eaa8..665fbd199 100644 --- a/rtengine/rtlensfun.cc +++ b/rtengine/rtlensfun.cc @@ -18,14 +18,15 @@ * along with RawTherapee. If not, see . */ -#include "rtlensfun.h" -#include "procparams.h" -#include "settings.h" #include -namespace rtengine { +#include "imagedata.h" +#include "procparams.h" +#include "rtlensfun.h" +#include "settings.h" -extern const Settings *settings; +namespace rtengine +{ //----------------------------------------------------------------------------- // LFModifier @@ -500,7 +501,7 @@ std::unique_ptr LFDatabase::getModifier(const LFCamera &camera, cons } -std::unique_ptr LFDatabase::findModifier(const LensProfParams &lensProf, const FramesMetaData *idata, int width, int height, const CoarseTransformParams &coarse, int rawRotationDeg) +std::unique_ptr LFDatabase::findModifier(const procparams::LensProfParams &lensProf, const FramesMetaData *idata, int width, int height, const procparams::CoarseTransformParams &coarse, int rawRotationDeg) { Glib::ustring make, model, lens; float focallen = idata->getFocalLen(); diff --git a/rtengine/rtlensfun.h b/rtengine/rtlensfun.h index 092e2bf01..7dcd96007 100644 --- a/rtengine/rtlensfun.h +++ b/rtengine/rtlensfun.h @@ -23,18 +23,22 @@ #include #include -#include +#include #include #include "lcp.h" #include "noncopyable.h" -namespace rtengine { +namespace rtengine +{ + +class FramesMetaData; namespace procparams { +struct CoarseTransformParams; struct LensProfParams; } @@ -119,7 +123,7 @@ public: LFCamera findCamera(const Glib::ustring &make, const Glib::ustring &model) const; LFLens findLens(const LFCamera &camera, const Glib::ustring &name) const; - static std::unique_ptr findModifier(const procparams::LensProfParams &lensProf, const FramesMetaData *idata, int width, int height, const CoarseTransformParams &coarse, int rawRotationDeg); + static std::unique_ptr findModifier(const procparams::LensProfParams &lensProf, const FramesMetaData *idata, int width, int height, const procparams::CoarseTransformParams &coarse, int rawRotationDeg); private: std::unique_ptr getModifier(const LFCamera &camera, const LFLens &lens, diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 6d691f098..2530cdfc3 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -16,31 +16,41 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ +#include + +#include + +#include + +#include +#include +#include + +#include "cieimage.h" +#include "color.h" +#include "colortemp.h" +#include "curves.h" +#include "dcp.h" +#include "iccmatrices.h" +#include "iccstore.h" +#include "image8.h" +#include "improccoordinator.h" +#include "improcfun.h" +#include "jpeg.h" +#include "labimage.h" +#include "median.h" +#include "mytime.h" +#include "procparams.h" +#include "rawimage.h" +#include "rawimagesource.h" #include "rtengine.h" #include "rtthumbnail.h" -#include "../rtgui/options.h" -#include "image8.h" -#include -#include "curves.h" -#include -#include "improcfun.h" -#include "colortemp.h" -#include "mytime.h" -#include "utils.h" -#include "iccstore.h" -#include "iccmatrices.h" -#include "rawimagesource.h" -#include "stdimagesource.h" -#include -#include "rawimage.h" -#include "jpeg.h" -#include "../rtgui/ppversion.h" -#include "improccoordinator.h" #include "settings.h" -#include "procparams.h" -#include +#include "stdimagesource.h" #include "StopWatch.h" -#include "median.h" +#include "utils.h" + +#include "../rtgui/ppversion.h" namespace { @@ -183,13 +193,9 @@ void scale_colors (rtengine::RawImage *ri, float scale_mul[4], float cblack[4], } -extern Options options; - namespace rtengine { -extern const Settings *settings; - using namespace procparams; Thumbnail* Thumbnail::loadFromImage (const Glib::ustring& fname, int &w, int &h, int fixwh, double wbEq, bool inspectorMode) @@ -329,7 +335,7 @@ Image8 *load_inspector_mode(const Glib::ustring &fname, RawMetaDataLocation &rml neutral.raw.bayersensor.method = RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::FAST); neutral.raw.xtranssensor.method = RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::FAST); neutral.icm.inputProfile = "(camera)"; - neutral.icm.workingProfile = options.rtSettings.srgb; + neutral.icm.workingProfile = settings->srgb; src.preprocess(neutral.raw, neutral.lensProf, neutral.coarse, false); double thresholdDummy = 0.f; @@ -428,7 +434,7 @@ Thumbnail* Thumbnail::loadQuickFromRaw (const Glib::ustring& fname, RawMetaDataL // did we succeed? if ( err ) { - if (options.rtSettings.verbose) { + if (settings->verbose) { std::cout << "Could not extract thumb from " << fname.c_str() << std::endl; } delete tpp; @@ -1236,7 +1242,7 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, eSensorT ImProcFunctions ipf (¶ms, forHistogramMatching); // enable multithreading when forHistogramMatching is true ipf.setScale (sqrt (double (fw * fw + fh * fh)) / sqrt (double (thumbImg->getWidth() * thumbImg->getWidth() + thumbImg->getHeight() * thumbImg->getHeight()))*scale); - ipf.updateColorProfiles (ICCStore::getInstance()->getDefaultMonitorProfileName(), RenderingIntent(options.rtSettings.monitorIntent), false, false); + ipf.updateColorProfiles (ICCStore::getInstance()->getDefaultMonitorProfileName(), RenderingIntent(settings->monitorIntent), false, false); LUTu hist16 (65536); @@ -1363,7 +1369,7 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, eSensorT LabImage* labView = new LabImage (fw, fh); DCPProfile *dcpProf = nullptr; - DCPProfile::ApplyState as; + DCPProfileApplyState as; if (isRaw) { cmsHPROFILE dummy; @@ -2127,11 +2133,11 @@ bool Thumbnail::readData (const Glib::ustring& fname) return true; } catch (Glib::Error &err) { - if (options.rtSettings.verbose) { + if (settings->verbose) { printf ("Thumbnail::readData / Error code %d while reading values from \"%s\":\n%s\n", err.code(), fname.c_str(), err.what().c_str()); } } catch (...) { - if (options.rtSettings.verbose) { + if (settings->verbose) { printf ("Thumbnail::readData / Unknown exception while trying to load \"%s\"!\n", fname.c_str()); } } @@ -2178,11 +2184,11 @@ bool Thumbnail::writeData (const Glib::ustring& fname) keyData = keyFile.to_data (); } catch (Glib::Error& err) { - if (options.rtSettings.verbose) { + if (settings->verbose) { printf ("Thumbnail::writeData / Error code %d while reading values from \"%s\":\n%s\n", err.code(), fname.c_str(), err.what().c_str()); } } catch (...) { - if (options.rtSettings.verbose) { + if (settings->verbose) { printf ("Thumbnail::writeData / Unknown exception while trying to save \"%s\"!\n", fname.c_str()); } } @@ -2194,7 +2200,7 @@ bool Thumbnail::writeData (const Glib::ustring& fname) FILE *f = g_fopen (fname.c_str (), "wt"); if (!f) { - if (options.rtSettings.verbose) { + if (settings->verbose) { printf ("Thumbnail::writeData / Error: unable to open file \"%s\" with write access!\n", fname.c_str()); } diff --git a/rtengine/rtthumbnail.h b/rtengine/rtthumbnail.h index 8b3f27a8b..dcc9596f6 100644 --- a/rtengine/rtthumbnail.h +++ b/rtengine/rtthumbnail.h @@ -16,15 +16,18 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _THUMBPROCESSINGPARAMETERS_ -#define _THUMBPROCESSINGPARAMETERS_ +#pragma once + +#include -#include "rawmetadatalocation.h" -#include #include -#include "image8.h" + #include "image16.h" +#include "image8.h" #include "imagefloat.h" +#include "LUT.h" +#include "rawmetadatalocation.h" + #include "../rtgui/threadutils.h" namespace rtengine @@ -160,6 +163,3 @@ public: } }; } - -#endif - diff --git a/rtengine/satandvalueblendingcurve.h b/rtengine/satandvalueblendingcurve.h new file mode 100644 index 000000000..c610652b4 --- /dev/null +++ b/rtengine/satandvalueblendingcurve.h @@ -0,0 +1,70 @@ +/* + * 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 . + */ +#pragma once + +#include "color.h" +#include "curves.h" + +namespace rtengine +{ + +class SatAndValueBlendingToneCurve : public ToneCurve +{ +public: + void Apply(float& r, float& g, float& b) const; +}; + +// Tone curve modifying the value channel only, preserving hue and saturation +// values in 0xffff space +inline void SatAndValueBlendingToneCurve::Apply (float& ir, float& ig, float& ib) const +{ + + assert (lutToneCurve); + + float r = CLIP(ir); + float g = CLIP(ig); + float b = CLIP(ib); + + const float lum = (r + g + b) / 3.f; + const float newLum = lutToneCurve[lum]; + + if (newLum == lum) { + return; + } + + float h, s, v; + Color::rgb2hsvtc(r, g, b, h, s, v); + + float dV; + if (newLum > lum) { + // Linearly targeting Value = 1 and Saturation = 0 + const float coef = (newLum - lum) / (65535.f - lum); + dV = (1.f - v) * coef; + s *= 1.f - coef; + } else { + // Linearly targeting Value = 0 + const float coef = (newLum - lum) / lum ; + dV = v * coef; + } + Color::hsv2rgbdcp(h, s, v + dV, r, g, b); + + setUnlessOOG(ir, ig, ib, r, g, b); +} + +} diff --git a/rtengine/settings.h b/rtengine/settings.h index f946c7f8f..13c74676a 100644 --- a/rtengine/settings.h +++ b/rtengine/settings.h @@ -16,9 +16,9 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _RTSETTINGS_ -#define _RTSETTINGS_ +#pragma once +#include namespace rtengine { @@ -106,7 +106,5 @@ public: * @param s a pointer to the Settings instance to destroy. */ static void destroy(Settings* s); }; +extern const Settings* settings; } - -#endif - diff --git a/rtengine/shmap.cc b/rtengine/shmap.cc index 368442f2b..44096d965 100644 --- a/rtengine/shmap.cc +++ b/rtengine/shmap.cc @@ -18,9 +18,11 @@ */ #include "shmap.h" #include "gauss.h" +#include "imagefloat.h" #include "rtengine.h" #include "rt_math.h" #include "rawimagesource.h" +#include "sleef.h" #include "jaggedarray.h" #undef THREAD_PRIORITY_NORMAL #include "opthelper.h" @@ -28,8 +30,6 @@ namespace rtengine { -extern const Settings* settings; - SHMap::SHMap (int w, int h) : max_f(0.f), min_f(0.f), avg(0.f), W(w), H(h) { diff --git a/rtengine/shmap.h b/rtengine/shmap.h index 108cca853..5b710e48f 100644 --- a/rtengine/shmap.h +++ b/rtengine/shmap.h @@ -16,16 +16,21 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef __SHMAP__ -#define __SHMAP__ +#pragma once -#include "imagefloat.h" -#include "image16.h" #include "noncopyable.h" +template +class LUT; + +using LUTf = LUT; + namespace rtengine { +class Imagefloat; +class LabImage; + class SHMap : public NonCopyable { @@ -51,5 +56,5 @@ private: void dirpyr_shmap(float ** data_fine, float ** data_coarse, int width, int height, LUTf & rangefn, int level, int scale); }; + } -#endif diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 45e706d4e..4f139b617 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -16,6 +16,10 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ +#include "cieimage.h" +#include "dcp.h" +#include "imagefloat.h" +#include "labimage.h" #include "rtengine.h" #include "colortemp.h" #include "imagesource.h" @@ -25,7 +29,8 @@ #include "clutstore.h" #include "processingjob.h" #include "procparams.h" -#include +#include +#include #include "../rtgui/options.h" #include "rawimagesource.h" #include "../rtgui/multilangmgr.h" @@ -36,7 +41,6 @@ namespace rtengine { -extern const Settings* settings; namespace { @@ -242,7 +246,6 @@ private: bool dehacontlutili = false; bool mapcontlutili = false; bool useHsl = false; -// multi_array2D conversionBuffer(1, 1); multi_array2D conversionBuffer(1, 1); imgsrc->retinexPrepareBuffers(params.icm, params.retinex, conversionBuffer, dummy); imgsrc->retinexPrepareCurves(params.retinex, cdcurve, mapcurve, dehatransmissionCurve, dehagaintransmissionCurve, dehacontlutili, mapcontlutili, useHsl, dummy, dummy); @@ -1002,8 +1005,8 @@ private: } autor = -9000.f; // This will ask to compute the "auto" values for the B&W tool (have to be inferior to -5000) - DCPProfile::ApplyState as; - DCPProfile *dcpProf = imgsrc->getDCP(params.icm, as); + DCPProfileApplyState as; + DCPProfile *dcpProf = imgsrc->getDCP (params.icm, as); LUTu histToneCurve; diff --git a/rtengine/simpleprocess.h b/rtengine/simpleprocess.h index d6efe802d..9b41b4643 100644 --- a/rtengine/simpleprocess.h +++ b/rtengine/simpleprocess.h @@ -4,24 +4,11 @@ * * Created on September 18, 2010, 8:31 PM */ +#pragma once -#ifndef SIMPLEPROCESS_H -#define SIMPLEPROCESS_H - -#ifdef __cplusplus -extern "C" { -#endif - - - - -#ifdef __cplusplus -} -#endif namespace rtengine { extern Glib::Thread *batchThread; -} -#endif /* SIMPLEPROCESS_H */ +} diff --git a/rtengine/sleef.c b/rtengine/sleef.h similarity index 99% rename from rtengine/sleef.c rename to rtengine/sleef.h index a01aef5b9..30c059010 100644 --- a/rtengine/sleef.c +++ b/rtengine/sleef.h @@ -6,9 +6,7 @@ // This version contains modifications made by Ingo Weyrich // //////////////////////////////////////////////////////////////// - -#ifndef _SLEEFC_ -#define _SLEEFC_ +#pragma once #include #include @@ -1275,5 +1273,3 @@ __inline float xlog2lin(float x, float base) constexpr float one(1); return (pow_F(base, x) - one) / (base - one); } - -#endif diff --git a/rtengine/slicer.cc b/rtengine/slicer.cc deleted file mode 100644 index 96c0a0ee8..000000000 --- a/rtengine/slicer.cc +++ /dev/null @@ -1,152 +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 -#include -#include "rt_math.h" - -#include "slicer.h" - -#ifdef _OPENMP -#include -#endif - -using namespace std; - -// If no parameter set, everything = 0 -> process all the image -Block::Block() -{ - posX = 0; - posY = 0; - width = 0; - height = 0; -} - -Block::Block(unsigned int x, unsigned int y, unsigned int w, unsigned int h) -{ - posX = x; - posY = y; - width = w; - height = h; -} - -/* - * Slice a sub-region to process in blocks who's size is given by the number of processor - * and the number of pixel per block (and hence the memory footprint) - */ -Slicer::Slicer(unsigned int imageWidth, unsigned int imageHeight, Block *subRegion, unsigned int pixels ) -{ - // If the sub-region has a portrait shape, X and Y coordinates are swapped for better result - // It will be swapped back when sending back the block coordinates - region.width = !(subRegion->width) ? imageWidth : subRegion->width; - region.height = !(subRegion->height) ? imageHeight : subRegion->height; // Assuming that the sub-region is under posY - - if (region.width < region.height) { - region.width = !(subRegion->height) ? imageHeight : subRegion->height; - region.height = !(subRegion->width) ? imageWidth : subRegion->width; // Assuming that the sub-region is under posY - portrait = true; - imWidth = imageHeight; - imHeight = imageWidth; - region.posX = subRegion->posY; - region.posY = subRegion->posX; - } else { - portrait = false; - imWidth = imageWidth; - imHeight = imageHeight; - region.posX = subRegion->posX; - region.posY = subRegion->posY; - } - - double subRegionRatio = (double)(region.width) / (double)(region.height); - - //total number of core/processor -#ifdef _OPENMP - unsigned int procNumber = omp_get_num_procs(); -#else - unsigned int procNumber = 1; -#endif - - //calculate the number of block - blockNumber = (double(region.width * region.height) / (double)pixels); - blockNumber = int((rtengine::max(blockNumber, 1U) + (double)procNumber / 2.) / procNumber) * procNumber; - vBlockNumber = (unsigned int)(sqrt((double)blockNumber / subRegionRatio) + 0.5); - vBlockNumber = CLAMP(vBlockNumber, 1, blockNumber); - hBlockNumber = (double)blockNumber / (double)vBlockNumber; - blockWidth = 1.0 / hBlockNumber; - - double maxPixelNumberX = (double)region.height / (double)vBlockNumber; - double maxPixelNumberY = (double)region.width / (double)((unsigned int)hBlockNumber); - - if (maxPixelNumberX - (double)((unsigned int)maxPixelNumberX) != 0.) { - maxPixelNumberX += 1.; - } - - if (maxPixelNumberY - (double)((unsigned int)maxPixelNumberY) != 0.) { - maxPixelNumberY += 1.; - } - - maxPixelNumber = (unsigned int)maxPixelNumberX * (unsigned int)maxPixelNumberY; - -} - -// return the absolute position and size of the requested block -void Slicer::get_block(unsigned int numBlock, Block *block) -{ - double roundingTradeOff = (hBlockNumber - (double)((int)hBlockNumber)) == 0.5 ? 2.1 : 2.0; - unsigned int alreadyCompletedLineNbr = (unsigned int)((double)(numBlock) * blockWidth + (blockWidth / roundingTradeOff)); - - unsigned int prevLineEnd = (unsigned int)((double)alreadyCompletedLineNbr * hBlockNumber + 0.5); - unsigned int myLineEnd = (unsigned int)((double)(alreadyCompletedLineNbr + 1) * hBlockNumber + 0.5); - - unsigned int nbrCellsOnMyLine = myLineEnd - prevLineEnd; - unsigned int cellOnMyLine = numBlock - prevLineEnd; - - unsigned int blockStart = (unsigned int)(((double)region.width / (double)nbrCellsOnMyLine) * (double)(cellOnMyLine)); - unsigned int blockEnd = (unsigned int)(((double)region.width / (double)nbrCellsOnMyLine) * (double)(cellOnMyLine + 1)); - block->width = blockEnd - blockStart; - block->posX = region.posX + blockStart; - - if (cellOnMyLine == (nbrCellsOnMyLine - 1)) { - // We make sure that the last block of the row take the rest of the remaining X space - block->width = region.posX + region.width - block->posX; - } - - blockStart = (unsigned int)(((double)region.height / (double)vBlockNumber) * (double)(alreadyCompletedLineNbr)); - blockEnd = (unsigned int)(((double)region.height / (double)vBlockNumber) * (double)(alreadyCompletedLineNbr + 1)); - block->height = blockEnd - blockStart; - block->posY = region.posY + blockStart; - - if (alreadyCompletedLineNbr == (vBlockNumber - 1)) { - block->height = region.posY + region.height - block->posY; - } - - if (portrait) { - // we swap back the X/Y coordinates - unsigned int temp; - - temp = block->posX; - block->posX = block->posY; - block->posY = temp; - - temp = block->width; - block->width = block->height; - block->height = temp; - - } -} diff --git a/rtengine/slicer.h b/rtengine/slicer.h deleted file mode 100644 index 658133e5f..000000000 --- a/rtengine/slicer.h +++ /dev/null @@ -1,63 +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 _SLICER_ -#define _SLICER_ - -//The image is divided in blocks even on single processor machine, mainly to decrease memory consumption -//maximum number of pixel per block -#define PIXELS_PER_BLOCK 250000 - -/* - * Used to specify a subregion of an image and to specify a cell in this subregion - */ -class Block -{ -public: - unsigned int posX; - unsigned int posY; - unsigned int width; // If 0, use the full width of the image - unsigned int height; // If 0, use the full height of the image - Block(); - Block(unsigned int x, unsigned int y, unsigned int w, unsigned int h); -}; - -/* - * This class handle the best slicing of the image with a given number of pixels per block and the number of - * processor, and tries to create blocks as square as possible. There can be a different number of block on - * each line, and the pixel per block requested may be oversized by very few percents. - */ -class Slicer -{ -protected: - bool portrait; // Orientation of the sub-region - unsigned int imWidth; // Image width - unsigned int imHeight; // Image height - Block region; // Sub-region to process - double hBlockNumber; // Horizontal number of block for the sub-region - unsigned int vBlockNumber; // Vertical number of block for the sub-region - double blockWidth; - -public: - unsigned int blockNumber; // number of block for the sub-region - unsigned int maxPixelNumber; // number of pixel of the biggest block (for memory allocation purpose) - Slicer(unsigned int imageWidth, unsigned int imageHeight, Block *subRegion, unsigned int pixels); - void get_block(unsigned int blockId, Block *block); -}; - -#endif diff --git a/rtengine/stdimagesource.cc b/rtengine/stdimagesource.cc index 2ec1529f7..1cb11e94d 100644 --- a/rtengine/stdimagesource.cc +++ b/rtengine/stdimagesource.cc @@ -19,19 +19,20 @@ #include "stdimagesource.h" #include "color.h" -#include "curves.h" #include "iccstore.h" +#include "image8.h" +#include "image16.h" +#include "imagefloat.h" #include "imageio.h" #include "mytime.h" #include "procparams.h" +#include "utils.h" #undef THREAD_PRIORITY_NORMAL namespace rtengine { -extern const Settings* settings; - template void freeArray (T** a, int H) { for (int i = 0; i < H; i++) { diff --git a/rtengine/stdimagesource.h b/rtengine/stdimagesource.h index 0dffe2fd0..b95328c80 100644 --- a/rtengine/stdimagesource.h +++ b/rtengine/stdimagesource.h @@ -16,14 +16,27 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _STDIMAGESOURCE_ -#define _STDIMAGESOURCE_ +#pragma once +#include "colortemp.h" #include "imagesource.h" namespace rtengine { +class ImageIO; + +namespace procparams +{ + +class ProcParams; + +struct ToneCurveParams; +struct RAWParams; +struct ColorManagementParams; + +} + class StdImageSource : public ImageSource { @@ -43,7 +56,7 @@ public: ~StdImageSource () override; int load (const Glib::ustring &fname) override; - void getImage (const ColorTemp &ctemp, int tran, Imagefloat* image, const PreviewProps &pp, const ToneCurveParams &hrp, const RAWParams &raw) override; + void getImage (const ColorTemp &ctemp, int tran, Imagefloat* image, const PreviewProps &pp, const procparams::ToneCurveParams &hrp, const procparams::RAWParams &raw) override; ColorTemp getWB () const override { return wb; @@ -87,8 +100,8 @@ public: plistener = pl; } - void convertColorSpace(Imagefloat* image, const ColorManagementParams &cmp, const ColorTemp &wb) override;// RAWParams raw will not be used for non-raw files (see imagesource.h) - static void colorSpaceConversion (Imagefloat* im, const ColorManagementParams &cmp, cmsHPROFILE embedded, IIOSampleFormat sampleFormat); + void convertColorSpace(Imagefloat* image, const procparams::ColorManagementParams &cmp, const ColorTemp &wb) override;// RAWParams raw will not be used for non-raw files (see imagesource.h) + static void colorSpaceConversion (Imagefloat* im, const procparams::ColorManagementParams &cmp, cmsHPROFILE embedded, IIOSampleFormat sampleFormat); bool isRGBSourceModified() const override { @@ -104,5 +117,5 @@ public: void flushRGB () override; void captureSharpening(const procparams::CaptureSharpeningParams &sharpeningParams, bool showMask, double &conrastThreshold, double &radius) override {}; }; + } -#endif diff --git a/rtengine/tmo_fattal02.cc b/rtengine/tmo_fattal02.cc index 13082354e..c8d8d1924 100644 --- a/rtengine/tmo_fattal02.cc +++ b/rtengine/tmo_fattal02.cc @@ -50,31 +50,33 @@ * $Id: tmo_fattal02.cpp,v 1.3 2008/11/04 23:43:08 rafm Exp $ */ - #ifdef _OPENMP #include #endif + +#include #include #include #include -#include -#include #include +#include -#include #include #include +#include #include "array2D.h" -#include "improcfun.h" -#include "settings.h" +#include "color.h" #include "iccstore.h" -#include "StopWatch.h" -#include "sleef.c" +#include "imagefloat.h" +#include "improcfun.h" #include "opthelper.h" -#include "rt_algo.h" -#include "rescale.h" #include "procparams.h" +#include "rescale.h" +#include "rt_algo.h" +#include "settings.h" +#include "sleef.h" +#include "StopWatch.h" namespace rtengine { @@ -83,7 +85,6 @@ namespace rtengine * RT code ******************************************************************************/ -extern const Settings *settings; extern MyMutex *fftwMutex; using namespace std; @@ -1102,7 +1103,7 @@ void ImProcFunctions::ToneMapFattal02(Imagefloat *rgb, const FattalToneMappingPa float oldMedian; const float percentile = float(LIM(fatParams.anchor, 1, 100)) / 100.f; - findMinMaxPercentile(Yr.data(), Yr.getRows() * Yr.getCols(), percentile, oldMedian, percentile, oldMedian, multiThread); + findMinMaxPercentile (Yr.data(), static_cast(Yr.getRows()) * Yr.getCols(), percentile, oldMedian, percentile, oldMedian, multiThread); // median filter on the deep shadows, to avoid boosting noise // because w2 >= w and h2 >= h, we can use the L buffer as temporary buffer for Median_Denoise() int w2 = find_fast_dim(w) + 1; @@ -1145,7 +1146,7 @@ void ImProcFunctions::ToneMapFattal02(Imagefloat *rgb, const FattalToneMappingPa const float wr = float(w2) / float(w); float newMedian; - findMinMaxPercentile(L.data(), L.getRows() * L.getCols(), percentile, newMedian, percentile, newMedian, multiThread); + findMinMaxPercentile (L.data(), static_cast(L.getRows()) * L.getCols(), percentile, newMedian, percentile, newMedian, multiThread); const float scale = (oldMedian == 0.f || newMedian == 0.f) ? 65535.f : (oldMedian / newMedian); // avoid Nan #ifdef _OPENMP diff --git a/rtengine/vng4_demosaic_RT.cc b/rtengine/vng4_demosaic_RT.cc index 66413e4c7..95fa58cef 100644 --- a/rtengine/vng4_demosaic_RT.cc +++ b/rtengine/vng4_demosaic_RT.cc @@ -21,8 +21,8 @@ //////////////////////////////////////////////////////////////// #include "rtengine.h" +#include "rawimage.h" #include "rawimagesource.h" -#include "procparams.h" #include "../rtgui/multilangmgr.h" //#define BENCHMARK #include "StopWatch.h" @@ -102,7 +102,7 @@ void RawImageSource::vng4_demosaic (const array2D &rawData, array2D(height) * width, sizeof * image); int lcode[16][16][32]; float mul[16][16][8]; diff --git a/rtengine/xtrans_demosaic.cc b/rtengine/xtrans_demosaic.cc index 9a3b341cc..c1a526535 100644 --- a/rtengine/xtrans_demosaic.cc +++ b/rtengine/xtrans_demosaic.cc @@ -19,7 +19,9 @@ // //////////////////////////////////////////////////////////////// +#include "color.h" #include "rtengine.h" +#include "rawimage.h" #include "rawimagesource.h" #include "rt_algo.h" #include "rt_math.h" diff --git a/rtexif/rtexif.cc b/rtexif/rtexif.cc index 4e3be8486..b2edc2842 100644 --- a/rtexif/rtexif.cc +++ b/rtexif/rtexif.cc @@ -29,6 +29,7 @@ #include #include +#include #include "rtexif.h" diff --git a/rtexif/rtexif.h b/rtexif/rtexif.h index f4b0e089e..4c5a6cafe 100644 --- a/rtexif/rtexif.h +++ b/rtexif/rtexif.h @@ -16,8 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _MEXIF3_ -#define _MEXIF3_ +#pragma once #include #include @@ -30,11 +29,15 @@ #include #include -#include +#include #include "../rtengine/noncopyable.h" #include "../rtengine/rawmetadatalocation.h" +namespace Glib +{ + class KeyFile; +} namespace rtengine { @@ -686,5 +689,5 @@ extern const TagAttrib kodakIfdAttribs[]; void parseKodakIfdTextualInfo (Tag *textualInfo, Tag* exif); extern const TagAttrib panasonicAttribs[]; extern const TagAttrib panasonicRawAttribs[]; + } -#endif diff --git a/rtgui/CMakeLists.txt b/rtgui/CMakeLists.txt index 257d7fe77..a0acfa181 100644 --- a/rtgui/CMakeLists.txt +++ b/rtgui/CMakeLists.txt @@ -80,7 +80,6 @@ set(NONCLISOURCEFILES hsvequalizer.cc iccprofilecreator.cc icmpanel.cc - ilabel.cc imagearea.cc imageareapanel.cc impulsedenoise.cc diff --git a/rtgui/addsetids.h b/rtgui/addsetids.h index 6a4ea83d3..46cf19ed5 100644 --- a/rtgui/addsetids.h +++ b/rtgui/addsetids.h @@ -1,6 +1,4 @@ -#ifndef _ADDSETIDS_ -#define _ADDSETIDS_ - +#pragma once // UPDATE THE DEFAULT VALUE IN OPTIONS.CC int babehav[] TOO !!! @@ -146,5 +144,3 @@ enum { ADDSET_PARAM_NUM // THIS IS USED AS A DELIMITER!! }; - -#endif diff --git a/rtgui/adjuster.cc b/rtgui/adjuster.cc index 5182cd825..302a2de00 100644 --- a/rtgui/adjuster.cc +++ b/rtgui/adjuster.cc @@ -17,14 +17,14 @@ * along with RawTherapee. If not, see . */ #include "adjuster.h" + #include #include -#include "multilangmgr.h" -#include "../rtengine/rtengine.h" -#include "options.h" -#include "guiutils.h" -#include "rtimage.h" +#include "multilangmgr.h" +#include "options.h" +#include "rtimage.h" +#include "../rtengine/rt_math.h" namespace { diff --git a/rtgui/adjuster.h b/rtgui/adjuster.h index 52857a3d2..9800dbac8 100644 --- a/rtgui/adjuster.h +++ b/rtgui/adjuster.h @@ -16,10 +16,8 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _ADJUSTER_H_ -#define _ADJUSTER_H_ +#pragma once -#include #include "editedstate.h" #include "guiutils.h" @@ -130,5 +128,3 @@ public: void trimValue (int &val) const; void setLogScale(double base, double pivot, bool anchorMiddle = false); }; - -#endif diff --git a/rtgui/batchqueue.cc b/rtgui/batchqueue.cc index abb37b24d..acb45c266 100644 --- a/rtgui/batchqueue.cc +++ b/rtgui/batchqueue.cc @@ -16,7 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#include +#include #include #include #include @@ -28,12 +28,14 @@ #include #include +#include "cachemanager.h" #include "thumbnail.h" #include "batchqueue.h" #include "multilangmgr.h" #include "filecatalog.h" #include "batchqueuebuttonset.h" #include "guiutils.h" +#include "pathutils.h" #include "rtimage.h" #include diff --git a/rtgui/batchqueue.h b/rtgui/batchqueue.h index f61b7b5c4..9ae615965 100644 --- a/rtgui/batchqueue.h +++ b/rtgui/batchqueue.h @@ -15,20 +15,19 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _BATCHQUEUE_ -#define _BATCHQUEUE_ +#pragma once #include #include -#include "../rtengine/rtengine.h" - #include "batchqueueentry.h" +#include "lwbutton.h" #include "lwbuttonset.h" -#include "options.h" #include "threadutils.h" #include "thumbbrowserbase.h" + +#include "../rtengine/rtengine.h" #include "../rtengine/noncopyable.h" class BatchQueueListener @@ -124,5 +123,3 @@ private: IdleRegister idle_register; }; - -#endif diff --git a/rtgui/batchqueuebuttonset.cc b/rtgui/batchqueuebuttonset.cc index a8be9eedf..969a55079 100644 --- a/rtgui/batchqueuebuttonset.cc +++ b/rtgui/batchqueuebuttonset.cc @@ -18,8 +18,10 @@ */ #include "batchqueuebuttonset.h" +#include "lwbutton.h" #include "multilangmgr.h" #include "rtimage.h" +#include "rtsurface.h" bool BatchQueueButtonSet::iconsLoaded = false; diff --git a/rtgui/batchqueuebuttonset.h b/rtgui/batchqueuebuttonset.h index 19479ccc1..fb45df518 100644 --- a/rtgui/batchqueuebuttonset.h +++ b/rtgui/batchqueuebuttonset.h @@ -16,14 +16,15 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _BATCHQUEUEBUTTONSET_ -#define _BATCHQUEUEBUTTONSET_ +#pragma once -#include "lwbuttonset.h" -#include "rtsurface.h" #include +#include "lwbuttonset.h" + class BatchQueueEntry; +class RTSurface; + class BatchQueueButtonSet : public LWButtonSet { @@ -40,5 +41,3 @@ public: explicit BatchQueueButtonSet (BatchQueueEntry* myEntry); }; - -#endif diff --git a/rtgui/batchqueueentry.cc b/rtgui/batchqueueentry.cc index 424c8e486..90079b2cc 100644 --- a/rtgui/batchqueueentry.cc +++ b/rtgui/batchqueueentry.cc @@ -25,8 +25,10 @@ #include "rtimage.h" #include "multilangmgr.h" #include "thumbbrowserbase.h" +#include "thumbnail.h" #include "../rtengine/procparams.h" +#include "../rtengine/rtengine.h" bool BatchQueueEntry::iconsLoaded(false); Glib::RefPtr BatchQueueEntry::savedAsIcon; diff --git a/rtgui/batchqueueentry.h b/rtgui/batchqueueentry.h index 03097e55e..c4cd48615 100644 --- a/rtgui/batchqueueentry.h +++ b/rtgui/batchqueueentry.h @@ -16,18 +16,33 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _BATCHQUEUEENTRY_ -#define _BATCHQUEUEENTRY_ +#pragma once #include #include -#include "../rtengine/rtengine.h" -#include "thumbbrowserentrybase.h" -#include "thumbnail.h" + #include "bqentryupdater.h" +#include "options.h" +#include "thumbbrowserentrybase.h" + #include "../rtengine/noncopyable.h" +class Thumbnail; + +namespace rtengine +{ +class ProcessingJob; + +namespace procparams +{ + +class ProcParams; + +} + +} + class BatchQueueEntry; struct BatchQueueEntryIdleHelper { BatchQueueEntry* bqentry; @@ -77,7 +92,3 @@ public: void updateImage (guint8* img, int w, int h, int origw, int origh, guint8* newOPreview) override; void _updateImage (guint8* img, int w, int h); // inside gtk thread }; - - - -#endif diff --git a/rtgui/batchqueuepanel.h b/rtgui/batchqueuepanel.h index 2f8e27057..590ec2347 100644 --- a/rtgui/batchqueuepanel.h +++ b/rtgui/batchqueuepanel.h @@ -16,15 +16,15 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _BATCHQUEUEPANEL_ -#define _BATCHQUEUEPANEL_ +#pragma once #include #include + #include "batchqueue.h" -#include "saveformatpanel.h" #include "guiutils.h" +#include "saveformatpanel.h" class RTWindow; class FileCatalog; @@ -83,5 +83,3 @@ private: void formatChanged(const Glib::ustring& format) override; void updateTab (int qsize, int forceOrientation = 0); // forceOrientation=0: base on options / 1: horizontal / 2: vertical }; -#endif - diff --git a/rtgui/batchtoolpanelcoord.cc b/rtgui/batchtoolpanelcoord.cc index 2a37e7b18..0ede8a4af 100644 --- a/rtgui/batchtoolpanelcoord.cc +++ b/rtgui/batchtoolpanelcoord.cc @@ -16,12 +16,17 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ + +#include "bayerpreprocess.h" +#include "bayerprocess.h" + #include "multilangmgr.h" #include "batchtoolpanelcoord.h" #include "options.h" #include "filepanel.h" #include "procparamchangers.h" #include "addsetids.h" +#include "thumbnail.h" using namespace rtengine::procparams; diff --git a/rtgui/batchtoolpanelcoord.h b/rtgui/batchtoolpanelcoord.h index f03d1d4b2..7a5fe77ed 100644 --- a/rtgui/batchtoolpanelcoord.h +++ b/rtgui/batchtoolpanelcoord.h @@ -16,17 +16,18 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef __BATCHTOOLPANELCCORD__ -#define __BATCHTOOLPANELCCORD__ +#pragma once -#include "thumbnail.h" -#include "toolpanelcoord.h" #include "fileselectionchangelistener.h" -#include "../rtengine/rtengine.h" #include "paramsedited.h" #include "thumbnaillistener.h" +#include "toolpanelcoord.h" + +#include "../rtengine/procevents.h" +#include "../rtengine/procparams.h" class FilePanel; +class Thumbnail; class BatchToolPanelCoordinator : public ToolPanelCoordinator, public FileSelectionChangeListener, @@ -84,5 +85,3 @@ public: void optionsChanged (); }; - -#endif diff --git a/rtgui/bayerpreprocess.h b/rtgui/bayerpreprocess.h index 5d2b101d9..c07bbcba4 100644 --- a/rtgui/bayerpreprocess.h +++ b/rtgui/bayerpreprocess.h @@ -16,13 +16,12 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _BAYERPREPROCESS_H_ -#define _BAYERPREPROCESS_H_ +#pragma once #include + #include "adjuster.h" #include "toolpanel.h" -#include "../rtengine/rawimage.h" class BayerPreProcess : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel { @@ -54,5 +53,3 @@ public: void lineDenoiseDirectionChanged(); void pdafLinesFilterChanged(); }; - -#endif diff --git a/rtgui/bayerprocess.cc b/rtgui/bayerprocess.cc index aa09067e4..4a57177e1 100644 --- a/rtgui/bayerprocess.cc +++ b/rtgui/bayerprocess.cc @@ -23,6 +23,7 @@ #include "options.h" #include "../rtengine/procparams.h" +#include "../rtengine/utils.h" using namespace rtengine; using namespace rtengine::procparams; diff --git a/rtgui/bayerprocess.h b/rtgui/bayerprocess.h index 893010e65..04985dc66 100644 --- a/rtgui/bayerprocess.h +++ b/rtgui/bayerprocess.h @@ -16,16 +16,22 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _BAYERPROCESS_H_ -#define _BAYERPROCESS_H_ +#pragma once #include + #include "adjuster.h" #include "checkbox.h" #include "guiutils.h" #include "toolpanel.h" -class BayerProcess : public ToolParamBlock, public AdjusterListener, public CheckBoxListener, public FoldableToolPanel, public rtengine::FrameCountListener, public rtengine::AutoContrastListener +class BayerProcess : + public ToolParamBlock, + public AdjusterListener, + public CheckBoxListener, + public FoldableToolPanel, + public rtengine::FrameCountListener, + public rtengine::AutoContrastListener { protected: @@ -89,5 +95,3 @@ public: void autoContrastChanged (double autoContrast) override; void FrameCountChanged(int n, int frameNum) override; }; - -#endif diff --git a/rtgui/bayerrawexposure.h b/rtgui/bayerrawexposure.h index 5825383be..247bf6ff0 100644 --- a/rtgui/bayerrawexposure.h +++ b/rtgui/bayerrawexposure.h @@ -16,26 +16,21 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _BAYERRAWEXPOSURE_H_ -#define _BAYERRAWEXPOSURE_H_ +#pragma once #include + #include "adjuster.h" #include "checkbox.h" #include "toolpanel.h" -class BayerRAWExposure : public ToolParamBlock, public AdjusterListener, public CheckBoxListener, public FoldableToolPanel +class BayerRAWExposure : + public ToolParamBlock, + public AdjusterListener, + public CheckBoxListener, + public FoldableToolPanel { - -protected: - Adjuster* PexBlack0; - Adjuster* PexBlack1; - Adjuster* PexBlack2; - Adjuster* PexBlack3; - CheckBox* PextwoGreen; - public: - BayerRAWExposure (); void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr) override; @@ -46,6 +41,11 @@ public: void checkBoxToggled (CheckBox* c, CheckValue newval) override; void setAdjusterBehavior (bool pexblackadd); void trimValues (rtengine::procparams::ProcParams* pp) override; -}; -#endif +protected: + Adjuster* PexBlack0; + Adjuster* PexBlack1; + Adjuster* PexBlack2; + Adjuster* PexBlack3; + CheckBox* PextwoGreen; +}; diff --git a/rtgui/blackwhite.cc b/rtgui/blackwhite.cc index b5ecb96bd..b3ebea28a 100644 --- a/rtgui/blackwhite.cc +++ b/rtgui/blackwhite.cc @@ -23,9 +23,11 @@ #include "guiutils.h" #include "rtimage.h" +#include "options.h" #include "../rtengine/color.h" #include "../rtengine/procparams.h" +#include "../rtengine/utils.h" using namespace rtengine; using namespace rtengine::procparams; diff --git a/rtgui/blackwhite.h b/rtgui/blackwhite.h index 36234cda5..9f504fd4f 100644 --- a/rtgui/blackwhite.h +++ b/rtgui/blackwhite.h @@ -16,17 +16,17 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _BLACKWHITE_H_ -#define _BLACKWHITE_H_ +#pragma once #include + #include "adjuster.h" -#include "toolpanel.h" -#include "guiutils.h" +#include "colorprovider.h" #include "curveeditor.h" #include "curveeditorgroup.h" +#include "guiutils.h" #include "mycurve.h" -#include "colorprovider.h" +#include "toolpanel.h" class EditDataProvider; @@ -144,5 +144,3 @@ private: IdleRegister idle_register; }; - -#endif diff --git a/rtgui/bqentryupdater.cc b/rtgui/bqentryupdater.cc index 21a0f5ad0..61683e158 100644 --- a/rtgui/bqentryupdater.cc +++ b/rtgui/bqentryupdater.cc @@ -17,8 +17,26 @@ * along with RawTherapee. If not, see . */ #include "bqentryupdater.h" -#include + #include "guiutils.h" +#include "options.h" +#include "thumbnail.h" +#include "../rtengine/utils.h" + +namespace +{ + +void thumbInterp(const unsigned char* src, int sw, int sh, unsigned char* dst, int dw, int dh) +{ + + if (options.thumbInterp == 0) { + rtengine::nearestInterp (src, sw, sh, dst, dw, dh); + } else if (options.thumbInterp == 1) { + rtengine::bilinearInterp (src, sw, sh, dst, dw, dh); + } +} + +} BatchQueueEntryUpdater batchQueueEntryUpdater; @@ -27,7 +45,7 @@ BatchQueueEntryUpdater::BatchQueueEntryUpdater () { } -void BatchQueueEntryUpdater::process (guint8* oimg, int ow, int oh, int newh, BQEntryUpdateListener* listener, rtengine::ProcParams* pparams, Thumbnail* thumbnail) +void BatchQueueEntryUpdater::process (guint8* oimg, int ow, int oh, int newh, BQEntryUpdateListener* listener, rtengine::procparams::ProcParams* pparams, Thumbnail* thumbnail) { if (!oimg && (!pparams || !thumbnail)) { //printf("WARNING! !oimg && (!pparams || !thumbnail)\n"); diff --git a/rtgui/bqentryupdater.h b/rtgui/bqentryupdater.h index efd63f9de..dfd42aff1 100644 --- a/rtgui/bqentryupdater.h +++ b/rtgui/bqentryupdater.h @@ -16,14 +16,24 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _BQENTRYUPDATER_ -#define _BQENTRYUPDATER_ +#pragma once + +#include -#include -#include "../rtengine/rtengine.h" #include "threadutils.h" -#include "thumbnail.h" +class Thumbnail; + +namespace rtengine +{ +namespace procparams +{ + +class ProcParams; + +} + +} class BQEntryUpdateListener { @@ -39,7 +49,7 @@ class BatchQueueEntryUpdater guint8* oimg; int ow, oh, newh; BQEntryUpdateListener* listener; - rtengine::ProcParams* pparams; + rtengine::procparams::ProcParams* pparams; Thumbnail* thumbnail; }; @@ -53,7 +63,7 @@ protected: public: BatchQueueEntryUpdater (); - void process (guint8* oimg, int ow, int oh, int newh, BQEntryUpdateListener* listener, rtengine::ProcParams* pparams = nullptr, Thumbnail* thumbnail = nullptr); + void process (guint8* oimg, int ow, int oh, int newh, BQEntryUpdateListener* listener, rtengine::procparams::ProcParams* pparams = nullptr, Thumbnail* thumbnail = nullptr); void removeJobs (BQEntryUpdateListener* listener); void terminate (); @@ -61,5 +71,3 @@ public: }; extern BatchQueueEntryUpdater batchQueueEntryUpdater; - -#endif diff --git a/rtgui/browserfilter.h b/rtgui/browserfilter.h index f5dac180e..df9a94c11 100644 --- a/rtgui/browserfilter.h +++ b/rtgui/browserfilter.h @@ -16,15 +16,14 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _BROWSERFILTER_ -#define _BROWSERFILTER_ +#pragma once + +#include #include "exiffiltersettings.h" -#include class BrowserFilter { - public: bool showRanked[6]; bool showCLabeled[6]; @@ -41,5 +40,3 @@ public: BrowserFilter (); }; - -#endif diff --git a/rtgui/cacheimagedata.cc b/rtgui/cacheimagedata.cc index d31b6c7a5..d44ca28ec 100644 --- a/rtgui/cacheimagedata.cc +++ b/rtgui/cacheimagedata.cc @@ -19,10 +19,12 @@ #include "cacheimagedata.h" #include #include +#include #include "version.h" #include #include "../rtengine/procparams.h" +#include "../rtengine/settings.h" CacheImageData::CacheImageData() : supported(false), @@ -223,11 +225,11 @@ int CacheImageData::load (const Glib::ustring& fname) return 0; } } catch (Glib::Error &err) { - if (options.rtSettings.verbose) { + if (rtengine::settings->verbose) { printf("CacheImageData::load / Error code %d while reading values from \"%s\":\n%s\n", err.code(), fname.c_str(), err.what().c_str()); } } catch (...) { - if (options.rtSettings.verbose) { + if (rtengine::settings->verbose) { printf("CacheImageData::load / Unknown exception while trying to load \"%s\"!\n", fname.c_str()); } } @@ -305,11 +307,11 @@ int CacheImageData::save (const Glib::ustring& fname) keyData = keyFile.to_data (); } catch (Glib::Error &err) { - if (options.rtSettings.verbose) { + if (rtengine::settings->verbose) { printf("CacheImageData::save / Error code %d while reading values from \"%s\":\n%s\n", err.code(), fname.c_str(), err.what().c_str()); } } catch (...) { - if (options.rtSettings.verbose) { + if (rtengine::settings->verbose) { printf("CacheImageData::save / Unknown exception while trying to save \"%s\"!\n", fname.c_str()); } } @@ -321,7 +323,7 @@ int CacheImageData::save (const Glib::ustring& fname) FILE *f = g_fopen (fname.c_str (), "wt"); if (!f) { - if (options.rtSettings.verbose) { + if (rtengine::settings->verbose) { printf("CacheImageData::save / Error: unable to open file \"%s\" with write access!\n", fname.c_str()); } diff --git a/rtgui/cacheimagedata.h b/rtgui/cacheimagedata.h index 72bf55749..caab1de5b 100644 --- a/rtgui/cacheimagedata.h +++ b/rtgui/cacheimagedata.h @@ -16,17 +16,18 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _CACHEIMAGEDATA_ -#define _CACHEIMAGEDATA_ +#pragma once + +#include -#include #include "options.h" -#include "../rtengine/rtengine.h" + #include "../rtengine/imageformat.h" +#include "../rtengine/rtengine.h" -class CacheImageData: public rtengine::FramesMetaData +class CacheImageData : + public rtengine::FramesMetaData { - public: // basic information @@ -115,4 +116,3 @@ public: std::string getImageType (unsigned int frame) const override { return isPixelShift ? "PS" : isHDR ? "HDR" : "STD"; } rtengine::IIOSampleFormat getSampleFormat (unsigned int frame = 0) const override { return sampleFormat; } }; -#endif diff --git a/rtgui/cachemanager.cc b/rtgui/cachemanager.cc index 8092d6829..20b179529 100644 --- a/rtgui/cachemanager.cc +++ b/rtgui/cachemanager.cc @@ -32,9 +32,9 @@ #include "guiutils.h" #include "options.h" -#include "procparamchangers.h" #include "thumbnail.h" -//#include "md5helper.h" +#include "procparamchangers.h" + namespace { @@ -64,8 +64,8 @@ void CacheManager::init () } } - if (error != 0 && options.rtSettings.verbose) { - std::cerr << "Failed to create all cache directories: " << g_strerror (errno) << std::endl; + if (error != 0 && rtengine::settings->verbose) { + std::cerr << "Failed to create all cache directories: " << g_strerror(errno) << std::endl; } } @@ -197,8 +197,8 @@ void CacheManager::renameEntry (const std::string& oldfilename, const std::strin error |= g_rename (getCacheFileName ("embprofiles", oldfilename, ".icc", oldmd5).c_str (), getCacheFileName ("embprofiles", newfilename, ".icc", newmd5).c_str ()); error |= g_rename (getCacheFileName ("data", oldfilename, ".txt", oldmd5).c_str (), getCacheFileName ("data", newfilename, ".txt", newmd5).c_str ()); - if (error != 0 && options.rtSettings.verbose) { - std::cerr << "Failed to rename all files for cache entry '" << oldfilename << "': " << g_strerror (errno) << std::endl; + if (error != 0 && rtengine::settings->verbose) { + std::cerr << "Failed to rename all files for cache entry '" << oldfilename << "': " << g_strerror(errno) << std::endl; } // check if it is opened @@ -273,8 +273,8 @@ void CacheManager::deleteDir (const Glib::ustring& dirName) const error |= g_remove (Glib::build_filename (baseDir, dirName, *entry).c_str ()); } - if (error != 0 && options.rtSettings.verbose) { - std::cerr << "Failed to delete all entries in cache directory '" << dirName << "': " << g_strerror (errno) << std::endl; + if (error != 0 && rtengine::settings->verbose) { + std::cerr << "Failed to delete all entries in cache directory '" << dirName << "': " << g_strerror(errno) << std::endl; } } catch (Glib::Error&) {} @@ -296,7 +296,10 @@ void CacheManager::deleteFiles (const Glib::ustring& fname, const std::string& m if (purgeProfile) { error |= g_remove (getCacheFileName ("profiles", fname, paramFileExtension, md5).c_str ()); + } + if (error != 0 && rtengine::settings->verbose) { + std::cerr << "Failed to delete all files for cache entry '" << fname << "': " << g_strerror(errno) << std::endl; } } diff --git a/rtgui/cachemanager.h b/rtgui/cachemanager.h index e2a162961..61602aeba 100644 --- a/rtgui/cachemanager.h +++ b/rtgui/cachemanager.h @@ -16,18 +16,17 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _CACHEMANAGER_ -#define _CACHEMANAGER_ +#pragma once -#include #include +#include #include -#include "../rtengine/noncopyable.h" - #include "threadutils.h" +#include "../rtengine/noncopyable.h" + class Thumbnail; class CacheManager : @@ -69,6 +68,3 @@ public: }; #define cacheMgr CacheManager::getInstance() - -#endif - diff --git a/rtgui/cacorrection.h b/rtgui/cacorrection.h index f6e1f89e3..6e1667a00 100644 --- a/rtgui/cacorrection.h +++ b/rtgui/cacorrection.h @@ -16,14 +16,17 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _CACORRECTION_H_ -#define _CACORRECTION_H_ +#pragma once #include + #include "adjuster.h" #include "toolpanel.h" -class CACorrection : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel +class CACorrection : + public ToolParamBlock, + public AdjusterListener, + public FoldableToolPanel { protected: @@ -43,5 +46,3 @@ public: void setAdjusterBehavior (bool badd); void trimValues (rtengine::procparams::ProcParams* pp) override; }; - -#endif diff --git a/rtgui/checkbox.h b/rtgui/checkbox.h index 48324d4c8..45433300c 100644 --- a/rtgui/checkbox.h +++ b/rtgui/checkbox.h @@ -16,10 +16,10 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _CHECKBOX_H_ -#define _CHECKBOX_H_ +#pragma once #include + #include "editedstate.h" #include "guiutils.h" @@ -72,5 +72,3 @@ public: void set_tooltip_markup (const Glib::ustring& tooltip); */ }; - -#endif diff --git a/rtgui/chmixer.h b/rtgui/chmixer.h index 94f54ed3d..fb028cf14 100644 --- a/rtgui/chmixer.h +++ b/rtgui/chmixer.h @@ -16,14 +16,17 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _CHMIXER_H_ -#define _CHMIXER_H_ +#pragma once #include + #include "adjuster.h" #include "toolpanel.h" -class ChMixer : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel +class ChMixer : + public ToolParamBlock, + public AdjusterListener, + public FoldableToolPanel { protected: @@ -46,5 +49,3 @@ public: void trimValues (rtengine::procparams::ProcParams* pp) override; void enabledChanged() override; }; - -#endif diff --git a/rtgui/clipboard.cc b/rtgui/clipboard.cc index 4cd50f574..f64f2ed07 100644 --- a/rtgui/clipboard.cc +++ b/rtgui/clipboard.cc @@ -18,6 +18,7 @@ */ #include "clipboard.h" +#include "paramsedited.h" #include "../rtengine/procparams.h" Clipboard clipboard; diff --git a/rtgui/clipboard.h b/rtgui/clipboard.h index 4c0ec452f..0a1c8e2fa 100644 --- a/rtgui/clipboard.h +++ b/rtgui/clipboard.h @@ -16,25 +16,24 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _CLIPBOARD_ -#define _CLIPBOARD_ +#pragma once #include #include -#include "mydiagonalcurve.h" -#include "myflatcurve.h" -#include "paramsedited.h" +#include "../rtengine/diagonalcurvetypes.h" +#include "../rtengine/flatcurvetypes.h" -#include "../rtengine/rtengine.h" +struct ParamsEdited; namespace rtengine { namespace procparams { - +class ProcParams; class PartialProfile; +class IPTCPairs; } @@ -80,5 +79,3 @@ private: }; extern Clipboard clipboard; - -#endif diff --git a/rtgui/coarsepanel.h b/rtgui/coarsepanel.h index 2da56b904..c028bbcad 100644 --- a/rtgui/coarsepanel.h +++ b/rtgui/coarsepanel.h @@ -16,13 +16,15 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef __COARSEPANEL__ -#define __COARSEPANEL__ +#pragma once #include + #include "toolpanel.h" -class CoarsePanel : public Gtk::HBox, public ToolPanel +class CoarsePanel : + public Gtk::HBox, + public ToolPanel { protected: @@ -46,5 +48,3 @@ public: void flipHorizontal (); void flipVertical (); }; - -#endif diff --git a/rtgui/colorappearance.cc b/rtgui/colorappearance.cc index f8eb736d4..094ffec2f 100644 --- a/rtgui/colorappearance.cc +++ b/rtgui/colorappearance.cc @@ -21,9 +21,12 @@ #include "colorappearance.h" #include "guiutils.h" +#include "options.h" +#include "rtimage.h" #include "../rtengine/color.h" #include "../rtengine/procparams.h" +#include "../rtengine/utils.h" #define MINTEMP0 2000 //1200 #define MAXTEMP0 12000 //12000 diff --git a/rtgui/colorappearance.h b/rtgui/colorappearance.h index da2e3c8b9..3d82ee831 100644 --- a/rtgui/colorappearance.h +++ b/rtgui/colorappearance.h @@ -16,25 +16,24 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _COLORAPPEARANCE_H_ -#define _COLORAPPEARANCE_H_ +#pragma once #include + #include "adjuster.h" -#include "toolpanel.h" +#include "colorprovider.h" #include "curveeditor.h" #include "curveeditorgroup.h" -#include "mycurve.h" #include "guiutils.h" -#include "colorprovider.h" +#include "toolpanel.h" class ColorAppearance final : - public ToolParamBlock, - public AdjusterListener, - public FoldableToolPanel, - public rtengine::AutoCamListener, - public CurveListener, - public ColorProvider + public ToolParamBlock, + public AdjusterListener, + public FoldableToolPanel, + public rtengine::AutoCamListener, + public CurveListener, + public ColorProvider { public: ColorAppearance (); @@ -173,5 +172,3 @@ private: IdleRegister idle_register; }; - -#endif diff --git a/rtgui/coloredbar.h b/rtgui/coloredbar.h index 089dfa8cd..6cc121cd5 100644 --- a/rtgui/coloredbar.h +++ b/rtgui/coloredbar.h @@ -16,8 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _COLOREDBAR_ -#define _COLOREDBAR_ +#pragma once #include "colorprovider.h" #include "guiutils.h" @@ -62,5 +61,3 @@ public: BackBuffer::setDirty(isDirty); } }; - -#endif diff --git a/rtgui/colorprovider.h b/rtgui/colorprovider.h index feea792b6..988b080bd 100644 --- a/rtgui/colorprovider.h +++ b/rtgui/colorprovider.h @@ -16,10 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _COLORPROVIDER_ -#define _COLORPROVIDER_ - -#include +#pragma once class ColorProvider; @@ -61,10 +58,7 @@ public: */ class ColorProvider { - public: - virtual ~ColorProvider() {}; + virtual ~ColorProvider() = default; virtual void colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller) {}; }; - -#endif diff --git a/rtgui/colortoning.cc b/rtgui/colortoning.cc index e164739e5..1a6a9b918 100644 --- a/rtgui/colortoning.cc +++ b/rtgui/colortoning.cc @@ -6,6 +6,8 @@ #include "rtimage.h" #include "eventmapper.h" #include "labgrid.h" +#include "options.h" +#include "../rtengine/color.h" using namespace rtengine; using namespace rtengine::procparams; diff --git a/rtgui/colortoning.h b/rtgui/colortoning.h index faba1e383..9c7a54488 100644 --- a/rtgui/colortoning.h +++ b/rtgui/colortoning.h @@ -1,18 +1,19 @@ /* * This file is part of RawTherapee. */ -#ifndef _COLORTONING_H_ -#define _COLORTONING_H_ +#pragma once #include + #include "adjuster.h" -#include "toolpanel.h" -#include "guiutils.h" +#include "colorprovider.h" #include "curveeditor.h" #include "curveeditorgroup.h" -#include "thresholdadjuster.h" -#include "colorprovider.h" +#include "guiutils.h" #include "labgrid.h" +#include "thresholdadjuster.h" +#include "toolpanel.h" + #include "../rtengine/procparams.h" class ColorToning final : @@ -166,5 +167,3 @@ private: IdleRegister idle_register; }; - -#endif diff --git a/rtgui/controlspotpanel.cc b/rtgui/controlspotpanel.cc index a3af8a214..3e98f6df1 100644 --- a/rtgui/controlspotpanel.cc +++ b/rtgui/controlspotpanel.cc @@ -24,6 +24,7 @@ #include #include "editwidgets.h" #include "options.h" +#include "rtimage.h" using namespace rtengine; extern Options options; diff --git a/rtgui/coordinateadjuster.h b/rtgui/coordinateadjuster.h index d705915ab..70fe42233 100644 --- a/rtgui/coordinateadjuster.h +++ b/rtgui/coordinateadjuster.h @@ -16,8 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _COORDINATEADJUSTER_ -#define _COORDINATEADJUSTER_ +#pragma once #include @@ -160,6 +159,3 @@ public: void stopNumericalAdjustment(); }; - - -#endif diff --git a/rtgui/crop.cc b/rtgui/crop.cc index b1780538e..3bdcf14cf 100644 --- a/rtgui/crop.cc +++ b/rtgui/crop.cc @@ -26,8 +26,6 @@ using namespace rtengine; using namespace rtengine::procparams; -extern Options options; - namespace { diff --git a/rtgui/crop.h b/rtgui/crop.h index 1bbad548d..b9221a803 100644 --- a/rtgui/crop.h +++ b/rtgui/crop.h @@ -16,14 +16,15 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _CROP_H_ -#define _CROP_H_ +#pragma once + +#include #include + #include "cropguilistener.h" -#include "toolpanel.h" #include "guiutils.h" -#include +#include "toolpanel.h" class CropPanelListener { @@ -129,5 +130,3 @@ private: IdleRegister idle_register; }; - -#endif diff --git a/rtgui/cropguilistener.h b/rtgui/cropguilistener.h index c20d6556a..a7e18683a 100644 --- a/rtgui/cropguilistener.h +++ b/rtgui/cropguilistener.h @@ -16,8 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef __CROPGUILISTENER__ -#define __CROPGUILISTENER__ +#pragma once class CropGUIListener { @@ -39,5 +38,3 @@ public: virtual bool inImageArea(int x, int y) = 0; virtual double getRatio() const = 0; }; - -#endif diff --git a/rtgui/crophandler.h b/rtgui/crophandler.h index 77355b868..d5da1cf6e 100644 --- a/rtgui/crophandler.h +++ b/rtgui/crophandler.h @@ -16,21 +16,20 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef __CROPHANDLER__ -#define __CROPHANDLER__ +#pragma once #include -#include #include +#include #include -#include "../rtengine/rtengine.h" #include "editbuffer.h" - #include "lockablecolorpicker.h" #include "threadutils.h" +#include "../rtengine/rtengine.h" + class EditSubscriber; class CropDisplayHandler @@ -139,5 +138,3 @@ private: IdleRegister idle_register; }; - -#endif diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index ef682cf1f..f44e78a56 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -17,6 +17,9 @@ * along with RawTherapee. If not, see . */ #include +#ifdef WIN32 +#include +#endif #include "cropwindow.h" @@ -30,9 +33,9 @@ #include "editcallbacks.h" #include "editbuffer.h" #include "editwidgets.h" +#include "rtsurface.h" #include "../rtengine/dcrop.h" -#include "../rtengine/mytime.h" #include "../rtengine/procparams.h" #include "../rtengine/rt_math.h" diff --git a/rtgui/cropwindow.h b/rtgui/cropwindow.h index 99b0fd897..db44a2508 100644 --- a/rtgui/cropwindow.h +++ b/rtgui/cropwindow.h @@ -16,23 +16,31 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _CROPWINDOW_ -#define _CROPWINDOW_ +#pragma once -#include "../rtengine/rtengine.h" -#include -#include "lwbutton.h" -#include "lwbuttonset.h" -#include "editenums.h" -#include "crophandler.h" #include + +#include + #include "cropguilistener.h" -#include "pointermotionlistener.h" +#include "crophandler.h" #include "cursormanager.h" #include "editbuffer.h" #include "editcoordsys.h" +#include "editenums.h" +#include "lwbutton.h" +#include "lwbuttonset.h" +#include "pointermotionlistener.h" + #include "../rtengine/noncopyable.h" +namespace rtengine +{ + +struct Coord; + +} + class CropWindow; class CropWindowListener @@ -239,5 +247,3 @@ public: ImageArea* getImageArea(); }; - -#endif diff --git a/rtgui/cursormanager.cc b/rtgui/cursormanager.cc index 76b4eabfb..e915150aa 100644 --- a/rtgui/cursormanager.cc +++ b/rtgui/cursormanager.cc @@ -18,7 +18,6 @@ */ #include "cursormanager.h" -#include "options.h" #include "rtimage.h" CursorManager mainWindowCursorManager; diff --git a/rtgui/cursormanager.h b/rtgui/cursormanager.h index aec5110d1..38f198e32 100644 --- a/rtgui/cursormanager.h +++ b/rtgui/cursormanager.h @@ -16,8 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _CURSORMANAGER_ -#define _CURSORMANAGER_ +#pragma once #include @@ -89,6 +88,3 @@ public: extern CursorManager mainWindowCursorManager; extern CursorManager editWindowCursorManager; - -#endif - diff --git a/rtgui/curveeditor.h b/rtgui/curveeditor.h index ae01c3afd..0543f88bc 100644 --- a/rtgui/curveeditor.h +++ b/rtgui/curveeditor.h @@ -16,21 +16,20 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _CURVEEDITOR_ -#define _CURVEEDITOR_ +#pragma once -#include "popuptogglebutton.h" -#include "../rtengine/LUT.h" #include "coloredbar.h" #include "editcallbacks.h" -#include "mydiagonalcurve.h" -#include "myflatcurve.h" +#include "popuptogglebutton.h" + +#include "../rtengine/diagonalcurvetypes.h" +#include "../rtengine/flatcurvetypes.h" +#include "../rtengine/LUT.h" #include "../rtengine/noncopyable.h" class CurveEditorGroup; class CurveEditorSubGroup; - /* *********************** Curve Editor *********************** */ @@ -182,7 +181,6 @@ public: class FlatCurveEditor : public CurveEditor { - friend class FlatCurveEditorSubGroup; protected: @@ -207,5 +205,3 @@ public: // set the reset curve for a given curve type. This is optional; all curve type have a default reset curve void setResetCurve(FlatCurveType cType, const std::vector &resetCurve); }; - -#endif diff --git a/rtgui/curveeditorgroup.cc b/rtgui/curveeditorgroup.cc index 663abaf6a..93e440aac 100644 --- a/rtgui/curveeditorgroup.cc +++ b/rtgui/curveeditorgroup.cc @@ -25,6 +25,8 @@ #include "flatcurveeditorsubgroup.h" #include "multilangmgr.h" #include "rtimage.h" +#include "options.h" +#include "pathutils.h" CurveEditorGroup::CurveEditorGroup (Glib::ustring& curveDir, Glib::ustring groupLabel) : curveDir(curveDir), line(0), curve_reset(nullptr), displayedCurve(nullptr), flatSubGroup(nullptr), diagonalSubGroup(nullptr), cl(nullptr), numberOfPackedCurve(0) diff --git a/rtgui/curveeditorgroup.h b/rtgui/curveeditorgroup.h index 77cc0100f..1ff3485db 100644 --- a/rtgui/curveeditorgroup.h +++ b/rtgui/curveeditorgroup.h @@ -16,18 +16,20 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _CURVEEDITORGROUP_ -#define _CURVEEDITORGROUP_ +#pragma once -#include #include #include + +#include + +#include "adjuster.h" #include "guiutils.h" #include "mycurve.h" -#include "myflatcurve.h" -#include "mydiagonalcurve.h" #include "shcselector.h" -#include "adjuster.h" + +#include "../rtengine/diagonalcurvetypes.h" +#include "../rtengine/flatcurvetypes.h" class CurveEditor; class DiagonalCurveEditorSubGroup; @@ -171,5 +173,3 @@ protected: virtual const std::vector getCurveFromGUI (int type) = 0; }; - -#endif diff --git a/rtgui/curvelistener.h b/rtgui/curvelistener.h index 05a9a4e99..d99167a98 100644 --- a/rtgui/curvelistener.h +++ b/rtgui/curvelistener.h @@ -16,8 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _CURVELISTENER_ -#define _CURVELISTENER_ +#pragma once #include @@ -86,5 +85,3 @@ public: return retVal; } }; - -#endif diff --git a/rtgui/darkframe.cc b/rtgui/darkframe.cc index af7ffeace..74ef1384a 100644 --- a/rtgui/darkframe.cc +++ b/rtgui/darkframe.cc @@ -25,6 +25,7 @@ #include "rtimage.h" #include "../rtengine/procparams.h" +#include "../rtengine/rawimage.h" using namespace rtengine; using namespace rtengine::procparams; diff --git a/rtgui/darkframe.h b/rtgui/darkframe.h index c576712a8..779caf16f 100644 --- a/rtgui/darkframe.h +++ b/rtgui/darkframe.h @@ -16,24 +16,34 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _DARKFRAME_H_ -#define _DARKFRAME_H_ +#pragma once #include + #include -#include "toolpanel.h" -#include "../rtengine/rawimage.h" + #include "guiutils.h" +#include "toolpanel.h" + +namespace rtengine +{ + +class RawImage; + +} class DFProvider { public: + virtual ~DFProvider() = default; virtual rtengine::RawImage* getDF() = 0; virtual Glib::ustring GetCurrentImageFilePath() = 0; // add other info here }; -class DarkFrame : public ToolParamBlock, public FoldableToolPanel +class DarkFrame : + public ToolParamBlock, + public FoldableToolPanel { protected: @@ -66,5 +76,3 @@ public: dfp = p; }; }; - -#endif diff --git a/rtgui/defringe.cc b/rtgui/defringe.cc index 659d41960..7114f9a52 100644 --- a/rtgui/defringe.cc +++ b/rtgui/defringe.cc @@ -20,7 +20,9 @@ #include #include "defringe.h" +#include "options.h" +#include "../rtengine/color.h" #include "../rtengine/procparams.h" using namespace rtengine; diff --git a/rtgui/defringe.h b/rtgui/defringe.h index 8a6eb0753..5dd17b547 100644 --- a/rtgui/defringe.h +++ b/rtgui/defringe.h @@ -16,18 +16,23 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _DEFRINGE_H_ -#define _DEFRINGE_H_ +#pragma once #include + #include "adjuster.h" -#include "toolpanel.h" -#include "guiutils.h" +#include "colorprovider.h" #include "curveeditor.h" #include "curveeditorgroup.h" -#include "colorprovider.h" +#include "guiutils.h" +#include "toolpanel.h" -class Defringe : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel, public CurveListener, public ColorProvider +class Defringe : + public ToolParamBlock, + public AdjusterListener, + public FoldableToolPanel, + public CurveListener, + public ColorProvider { protected: @@ -54,5 +59,3 @@ public: void colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller) override; }; - -#endif diff --git a/rtgui/diagonalcurveeditorsubgroup.cc b/rtgui/diagonalcurveeditorsubgroup.cc index 21b42a6ce..cece9be66 100644 --- a/rtgui/diagonalcurveeditorsubgroup.cc +++ b/rtgui/diagonalcurveeditorsubgroup.cc @@ -31,6 +31,7 @@ #include "curveeditor.h" #include "diagonalcurveeditorsubgroup.h" #include "rtimage.h" +#include "options.h" #include "../rtengine/curves.h" diff --git a/rtgui/diagonalcurveeditorsubgroup.h b/rtgui/diagonalcurveeditorsubgroup.h index 077ef590e..184fa576f 100644 --- a/rtgui/diagonalcurveeditorsubgroup.h +++ b/rtgui/diagonalcurveeditorsubgroup.h @@ -16,16 +16,22 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _DIAGONALCURVEEDITORSUBGROUP_ -#define _DIAGONALCURVEEDITORSUBGROUP_ +#pragma once #include + #include "curveeditorgroup.h" + #include "../rtengine/noncopyable.h" class DiagonalCurveEditor; +class MyDiagonalCurve; -class DiagonalCurveEditorSubGroup : public CurveEditorSubGroup, public SHCListener, public AdjusterListener, public rtengine::NonCopyable +class DiagonalCurveEditorSubGroup : + public CurveEditorSubGroup, + public SHCListener, + public AdjusterListener, + public rtengine::NonCopyable { friend class DiagonalCurveEditor; @@ -111,5 +117,3 @@ protected: void setSubGroupRangeLabels(Glib::ustring r1, Glib::ustring r2, Glib::ustring r3, Glib::ustring r4); void setSubGroupBottomBarBgGradient(); }; - -#endif diff --git a/rtgui/dirbrowser.cc b/rtgui/dirbrowser.cc index 32361d5c5..669528ac1 100644 --- a/rtgui/dirbrowser.cc +++ b/rtgui/dirbrowser.cc @@ -63,7 +63,7 @@ std::vector listSubDirs (const Glib::RefPtr& dir, bool subDirs.push_back (file->get_name ()); } catch (const Glib::Exception& exception) { - if (options.rtSettings.verbose) { + if (rtengine::settings->verbose) { std::cerr << exception.what().c_str() << std::endl; } @@ -72,7 +72,7 @@ std::vector listSubDirs (const Glib::RefPtr& dir, bool } catch (const Glib::Exception& exception) { - if (options.rtSettings.verbose) { + if (rtengine::settings->verbose) { std::cerr << "Failed to list subdirectories of \"" << dir->get_parse_name() << "\": " << exception.what () << std::endl; } diff --git a/rtgui/dirbrowser.h b/rtgui/dirbrowser.h index 68422f8be..fa526c3a6 100644 --- a/rtgui/dirbrowser.h +++ b/rtgui/dirbrowser.h @@ -16,13 +16,13 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _DIRBROWSER_ -#define _DIRBROWSER_ +#pragma once #include #include #include "guiutils.h" + #ifdef WIN32 #include "windows.h" #endif @@ -110,5 +110,3 @@ inline DirBrowser::DirSelectionSignal DirBrowser::dirSelected () const { return dirSelectionSignal; } - -#endif diff --git a/rtgui/dirpyrdenoise.cc b/rtgui/dirpyrdenoise.cc index 2a0bba596..b429dfc9f 100644 --- a/rtgui/dirpyrdenoise.cc +++ b/rtgui/dirpyrdenoise.cc @@ -21,14 +21,15 @@ #include "dirpyrdenoise.h" -#include "guiutils.h" - -#include "../rtengine/procparams.h" #include "editbuffer.h" +#include "guiutils.h" +#include "options.h" + +#include "../rtengine/color.h" +#include "../rtengine/procparams.h" using namespace rtengine; using namespace rtengine::procparams; -extern Options options; DirPyrDenoise::DirPyrDenoise () : FoldableToolPanel(this, "dirpyrdenoise", M("TP_DIRPYRDENOISE_LABEL"), true, true), lastmedian(false) { diff --git a/rtgui/dirpyrdenoise.h b/rtgui/dirpyrdenoise.h index a513eb262..424104314 100644 --- a/rtgui/dirpyrdenoise.h +++ b/rtgui/dirpyrdenoise.h @@ -16,17 +16,16 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _DIRPYRDENOISE_H_ -#define _DIRPYRDENOISE_H_ +#pragma once #include + #include "adjuster.h" -#include "toolpanel.h" +#include "colorprovider.h" #include "curveeditor.h" #include "curveeditorgroup.h" -#include "colorprovider.h" #include "guiutils.h" -#include "options.h" +#include "toolpanel.h" class EditDataProvider; @@ -138,5 +137,3 @@ private: IdleRegister idle_register; }; - -#endif diff --git a/rtgui/dirpyrequalizer.cc b/rtgui/dirpyrequalizer.cc index fc03c83ad..fd0268efa 100644 --- a/rtgui/dirpyrequalizer.cc +++ b/rtgui/dirpyrequalizer.cc @@ -19,6 +19,8 @@ #include "dirpyrequalizer.h" +#include "../rtengine/color.h" + using namespace rtengine; using namespace rtengine::procparams; diff --git a/rtgui/dirpyrequalizer.h b/rtgui/dirpyrequalizer.h index e236dc29b..ff08f36bc 100644 --- a/rtgui/dirpyrequalizer.h +++ b/rtgui/dirpyrequalizer.h @@ -16,17 +16,20 @@ * * (C) 2010 Emil Martinec */ - -#ifndef DIRPYREQUALIZER_H_INCLUDED -#define DIRPYREQUALIZER_H_INCLUDED +#pragma once #include -#include "adjuster.h" -#include "toolpanel.h" -#include "thresholdadjuster.h" -#include "colorprovider.h" -class DirPyrEqualizer : public ToolParamBlock, public ThresholdAdjusterListener, public AdjusterListener, public FoldableToolPanel +#include "adjuster.h" +#include "colorprovider.h" +#include "thresholdadjuster.h" +#include "toolpanel.h" + +class DirPyrEqualizer : + public ToolParamBlock, + public ThresholdAdjusterListener, + public AdjusterListener, + public FoldableToolPanel { protected: @@ -77,5 +80,3 @@ public: void adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight) override; void adjusterChanged2(ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR) override; }; - -#endif diff --git a/rtgui/distortion.h b/rtgui/distortion.h index 5e1cf6a6b..dab20bbd9 100644 --- a/rtgui/distortion.h +++ b/rtgui/distortion.h @@ -16,15 +16,18 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _DISTORTION_H_ -#define _DISTORTION_H_ +#pragma once #include -#include "adjuster.h" -#include "toolpanel.h" -#include "lensgeomlistener.h" -class Distortion : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel +#include "adjuster.h" +#include "lensgeomlistener.h" +#include "toolpanel.h" + +class Distortion : + public ToolParamBlock, + public AdjusterListener, + public FoldableToolPanel { protected: @@ -51,5 +54,3 @@ public: rlistener = l; } }; - -#endif diff --git a/rtgui/dynamicprofilepanel.cc b/rtgui/dynamicprofilepanel.cc index 38029af71..d7ed8ee97 100644 --- a/rtgui/dynamicprofilepanel.cc +++ b/rtgui/dynamicprofilepanel.cc @@ -22,6 +22,7 @@ #include "../rtengine/profilestore.h" #include "../rtengine/rtengine.h" #include "../rtengine/dynamicprofile.h" +#include "../rtengine/settings.h" #include #include @@ -615,7 +616,7 @@ void DynamicProfilePanel::save() if (!ProfileStore::getInstance()->storeRules()) { printf ("Error in saving dynamic profile rules\n"); - } else if (options.rtSettings.verbose) { + } else if (rtengine::settings->verbose) { printf ("Saved %d dynamic profile rules\n", int (rules.size())); } } diff --git a/rtgui/dynamicprofilepanel.h b/rtgui/dynamicprofilepanel.h index fd4a6e80e..5796c9c85 100644 --- a/rtgui/dynamicprofilepanel.h +++ b/rtgui/dynamicprofilepanel.h @@ -16,14 +16,16 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _DYNAMICPROFILEPANEL_H_ -#define _DYNAMICPROFILEPANEL_H_ +#pragma once #include -#include "../rtengine/dynamicprofile.h" + #include "profilestorecombobox.h" -class DynamicProfilePanel: public Gtk::VBox +#include "../rtengine/dynamicprofile.h" + +class DynamicProfilePanel : + public Gtk::VBox { public: DynamicProfilePanel(); @@ -133,5 +135,3 @@ private: Gtk::Button button_edit_; Gtk::Button button_delete_; }; - -#endif // _DYNAMICPROFILEPANEL_H_ diff --git a/rtgui/editbuffer.h b/rtgui/editbuffer.h index 77afb6449..046ab7364 100644 --- a/rtgui/editbuffer.h +++ b/rtgui/editbuffer.h @@ -22,10 +22,6 @@ #include "../rtengine/coord.h" #include -#ifdef GUIVERSION -#include "rtsurface.h" -#endif - class EditDataProvider; class EditSubscriber; diff --git a/rtgui/editedstate.h b/rtgui/editedstate.h index 2cee07eb9..c34aaf539 100644 --- a/rtgui/editedstate.h +++ b/rtgui/editedstate.h @@ -16,10 +16,6 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _EDITEDSTATE_ -#define _EDITEDSTATE_ +#pragma once enum EditedState { UnEdited = 0, Edited = 1, Irrelevant = 2 }; - -#endif - diff --git a/rtgui/editenums.h b/rtgui/editenums.h index 8fc28e922..f1ade8bfc 100644 --- a/rtgui/editenums.h +++ b/rtgui/editenums.h @@ -16,8 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _EDITENUMS_ -#define _EDITENUMS_ +#pragma once enum ImgEditState {SNormal, SCropMove, SHandMove, SResizeW1, SResizeW2, SResizeH1, SResizeH2, SResizeTL, SResizeTR, SResizeBL, SResizeBR, SCropSelecting, SRotateSelecting, SCropWinMove, SCropFrameMove, SCropImgMove, SCropWinResize, SObservedMove, @@ -26,5 +25,3 @@ enum ImgEditState {SNormal, SCropMove, SHandMove, SResizeW1, SResizeW2, SResizeH enum CursorArea {CropWinButtons, CropToolBar, CropImage, ColorPicker, CropBorder, CropTop, CropTopLeft, CropTopRight, CropBottom, CropBottomLeft, CropBottomRight, CropLeft, CropRight, CropInside, CropResize, CropObserved }; - -#endif diff --git a/rtgui/editid.h b/rtgui/editid.h index 88d77f859..39dc2bf7c 100644 --- a/rtgui/editid.h +++ b/rtgui/editid.h @@ -16,9 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _EDITID_H_ -#define _EDITID_H_ - +#pragma once /// @brief List of pipette editing operation enum EditUniqueID : int { @@ -67,5 +65,3 @@ enum ObjectMode { OM_255, /// less or equal than 255 objects OM_65535 /// less or equal than 65535 objects }; - -#endif diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 9e50b7e5a..df3ecf894 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -23,6 +23,7 @@ #include "../rtengine/imagesource.h" #include "../rtengine/iccstore.h" +#include "batchqueue.h" #include "soundman.h" #include "rtimage.h" #include "rtwindow.h" @@ -32,6 +33,9 @@ #include "progressconnector.h" #include "procparamchangers.h" #include "placesbrowser.h" +#include "pathutils.h" +#include "thumbnail.h" +#include "toolpanelcoord.h" using namespace rtengine::procparams; @@ -889,41 +893,17 @@ EditorPanel::~EditorPanel () delete vboxright; //delete saveAsDialog; - if (catalogPane) { - delete catalogPane; - } - - if (iTopPanel_1_Show) { - delete iTopPanel_1_Show; - } - - if (iTopPanel_1_Hide) { - delete iTopPanel_1_Hide; - } - - if (iHistoryShow) { - delete iHistoryShow; - } - - if (iHistoryHide) { - delete iHistoryHide; - } - - if (iBeforeLockON) { - delete iBeforeLockON; - } - - if (iBeforeLockOFF) { - delete iBeforeLockOFF; - } - - if (iRightPanel_1_Show) { - delete iRightPanel_1_Show; - } - - if (iRightPanel_1_Hide) { - delete iRightPanel_1_Hide; - } + delete catalogPane; + delete iTopPanel_1_Show; + delete iTopPanel_1_Hide; + delete iHistoryShow; + delete iHistoryHide; + delete iBeforeLockON; + delete iBeforeLockOFF; + delete iRightPanel_1_Show; + delete iRightPanel_1_Hide; + delete iShowHideSidePanels_exit; + delete iShowHideSidePanels; } void EditorPanel::leftPaneButtonReleased (GdkEventButton *event) @@ -1130,7 +1110,7 @@ Glib::ustring EditorPanel::getShortName () } } -Glib::ustring EditorPanel::getFileName () +Glib::ustring EditorPanel::getFileName () const { if (openThm) { return openThm->getFileName (); @@ -2040,9 +2020,9 @@ bool EditorPanel::idle_sendToGimp ( ProgressConnector *p if (img) { // get file name base - Glib::ustring shortname = removeExtension (Glib::path_get_basename (fname)); - Glib::ustring dirname = Glib::get_tmp_dir (); - Glib::ustring fname = Glib::build_filename (dirname, shortname); + const Glib::ustring shortname = removeExtension (Glib::path_get_basename (fname)); + const Glib::ustring dirname = Glib::get_tmp_dir (); + const Glib::ustring lfname = Glib::build_filename (dirname, shortname); SaveFormat sf; sf.format = "tif"; @@ -2051,13 +2031,13 @@ bool EditorPanel::idle_sendToGimp ( ProgressConnector *p sf.tiffUncompressed = true; sf.saveParams = true; - Glib::ustring fileName = Glib::ustring::compose ("%1.%2", fname, sf.format); + Glib::ustring fileName = Glib::ustring::compose ("%1.%2", lfname, sf.format); // TODO: Just list all file with a suitable name instead of brute force... int tries = 1; while (Glib::file_test (fileName, Glib::FILE_TEST_EXISTS) && tries < 1000) { - fileName = Glib::ustring::compose ("%1-%2.%3", fname, tries, sf.format); + fileName = Glib::ustring::compose ("%1-%2.%3", lfname, tries, sf.format); tries++; } diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index c4349f693..b577b858f 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -17,27 +17,28 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _EDITORPANEL_ -#define _EDITORPANEL_ +#pragma once #include -#include "imageareapanel.h" -#include "toolpanelcoord.h" -#include "profilepanel.h" -#include "../rtengine/rtengine.h" -#include "history.h" -#include "histogrampanel.h" -#include "thumbnail.h" -#include "saveasdlg.h" + #include "batchqueueentry.h" -#include "thumbnaillistener.h" -#include "navigator.h" -#include "progressconnector.h" #include "filepanel.h" +#include "histogrampanel.h" +#include "history.h" +#include "imageareapanel.h" +#include "navigator.h" +#include "profilepanel.h" +#include "progressconnector.h" +#include "saveasdlg.h" +#include "thumbnaillistener.h" + #include "../rtengine/noncopyable.h" +#include "../rtengine/rtengine.h" class EditorPanel; class MyProgressBar; +class Thumbnail; +class ToolPanelCoordinator; struct EditorPanelIdleHelper { EditorPanel* epanel; @@ -149,7 +150,7 @@ public: void saveProfile (); Glib::ustring getShortName (); - Glib::ustring getFileName (); + Glib::ustring getFileName () const; bool handleShortcutKey (GdkEventKey* event); bool getIsProcessing() const @@ -259,6 +260,3 @@ private: IdleRegister idle_register; }; - -#endif - diff --git a/rtgui/editwidgets.cc b/rtgui/editwidgets.cc index 910cd3ab5..2928104b7 100644 --- a/rtgui/editwidgets.cc +++ b/rtgui/editwidgets.cc @@ -18,8 +18,10 @@ */ #include "editwidgets.h" + #include "editbuffer.h" #include "editcallbacks.h" +#include "rtsurface.h" #include "../rtengine/rt_math.h" RGBColor Geometry::getInnerLineColor () diff --git a/rtgui/editwidgets.h b/rtgui/editwidgets.h index c7abb3eae..3735cd46a 100644 --- a/rtgui/editwidgets.h +++ b/rtgui/editwidgets.h @@ -20,12 +20,14 @@ #ifdef GUIVERSION -#include "rtsurface.h" +#include + #include "editbuffer.h" #include "editcoordsys.h" #include "../rtengine/coord.h" class ObjectMOBuffer; +class RTSurface; /** @file * diff --git a/rtgui/editwindow.cc b/rtgui/editwindow.cc index 50a1484cf..11c0be4e2 100644 --- a/rtgui/editwindow.cc +++ b/rtgui/editwindow.cc @@ -16,6 +16,7 @@ */ #include "editwindow.h" +#include "../rtengine/procparams.h" #include "options.h" #include "preferences.h" #include "cursormanager.h" diff --git a/rtgui/editwindow.h b/rtgui/editwindow.h index 8a2ade6ba..08e8c0199 100644 --- a/rtgui/editwindow.h +++ b/rtgui/editwindow.h @@ -14,15 +14,18 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _EDITWINDOW_ -#define _EDITWINDOW_ +#pragma once -#include -#include "filepanel.h" -#include "editorpanel.h" #include -class EditWindow : public Gtk::Window +#include + +#include "editorpanel.h" +#include "filepanel.h" +#include "rtimage.h" + +class EditWindow : + public Gtk::Window { private: @@ -66,5 +69,3 @@ public: void set_title_decorated(Glib::ustring fname); void on_realize () override; }; - -#endif diff --git a/rtgui/epd.h b/rtgui/epd.h index d8781ef27..410004d89 100644 --- a/rtgui/epd.h +++ b/rtgui/epd.h @@ -16,14 +16,17 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _EPD_H_ -#define _EPD_H_ +#pragma once #include + #include "adjuster.h" #include "toolpanel.h" -class EdgePreservingDecompositionUI : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel +class EdgePreservingDecompositionUI : + public ToolParamBlock, + public AdjusterListener, + public FoldableToolPanel { protected: Adjuster *strength; @@ -45,5 +48,3 @@ public: void enabledChanged () override; void setAdjusterBehavior (bool stAdd, bool gAdd, bool esAdd, bool scAdd, bool rAdd); }; - -#endif diff --git a/rtgui/exiffiltersettings.h b/rtgui/exiffiltersettings.h index e820a2cac..5a25af6ad 100644 --- a/rtgui/exiffiltersettings.h +++ b/rtgui/exiffiltersettings.h @@ -16,8 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _EXIFFILTERSETTINGS_ -#define _EXIFFILTERSETTINGS_ +#pragma once #include #include @@ -51,6 +50,3 @@ public: ExifFilterSettings (); void clear (); }; - -#endif - diff --git a/rtgui/exifpanel.h b/rtgui/exifpanel.h index f054f37c7..0894c21ad 100644 --- a/rtgui/exifpanel.h +++ b/rtgui/exifpanel.h @@ -16,16 +16,18 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _EXIFPANEL_ -#define _EXIFPANEL_ +#pragma once #include #include #include "toolpanel.h" +#include "../rtexif/rtexif.h" -class ExifPanel : public Gtk::VBox, public ToolPanel +class ExifPanel : + public Gtk::VBox, + public ToolPanel { private: @@ -114,5 +116,3 @@ public: void notifyListener(); }; - -#endif diff --git a/rtgui/exportpanel.h b/rtgui/exportpanel.h index d13ca08ad..f70e47386 100644 --- a/rtgui/exportpanel.h +++ b/rtgui/exportpanel.h @@ -17,12 +17,12 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _EXPORTPANEL_ -#define _EXPORTPANEL_ +#pragma once #include -#include "guiutils.h" + #include "adjuster.h" +#include "guiutils.h" class ExportPanelListener { @@ -122,5 +122,3 @@ public: listener = l; } }; - -#endif diff --git a/rtgui/extprog.cc b/rtgui/extprog.cc index 00ea07713..a7a757c1b 100644 --- a/rtgui/extprog.cc +++ b/rtgui/extprog.cc @@ -26,6 +26,8 @@ #include #endif +#include + #include "options.h" #include "multilangmgr.h" @@ -211,7 +213,7 @@ bool ExtProgStore::spawnCommandAsync (const Glib::ustring& cmd) } catch (const Glib::Exception& exception) { - if (options.rtSettings.verbose) { + if (rtengine::settings->verbose) { std::cerr << "Failed to execute \"" << cmd << "\": " << exception.what() << std::endl; } @@ -230,7 +232,7 @@ bool ExtProgStore::spawnCommandSync (const Glib::ustring& cmd) } catch (const Glib::Exception& exception) { - if (options.rtSettings.verbose) { + if (rtengine::settings->verbose) { std::cerr << "Failed to execute \"" << cmd << "\": " << exception.what() << std::endl; } diff --git a/rtgui/extprog.h b/rtgui/extprog.h index ea2749a61..c5e00bb1b 100644 --- a/rtgui/extprog.h +++ b/rtgui/extprog.h @@ -16,14 +16,12 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ - -#ifndef _EXTPROG_ -#define _EXTPROG_ - -#include +#pragma once #include +#include + #include "threadutils.h" struct ExtProgAction @@ -74,5 +72,3 @@ inline const std::vector& ExtProgStore::getActions () const { return actions; } - -#endif diff --git a/rtgui/fattaltonemap.cc b/rtgui/fattaltonemap.cc index a0baf3531..89a1e9e30 100644 --- a/rtgui/fattaltonemap.cc +++ b/rtgui/fattaltonemap.cc @@ -23,6 +23,7 @@ #include "fattaltonemap.h" #include "eventmapper.h" +#include "rtimage.h" #include "../rtengine/procparams.h" diff --git a/rtgui/favoritbrowser.h b/rtgui/favoritbrowser.h index 292f17de6..7a73b98af 100644 --- a/rtgui/favoritbrowser.h +++ b/rtgui/favoritbrowser.h @@ -16,17 +16,19 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _FAVORITBROWSER_ -#define _FAVORITBROWSER_ +#pragma once #include + #include "dirbrowserremoteinterface.h" #include "dirselectionlistener.h" -class FavoritBrowser : public Gtk::VBox, public DirSelectionListener +class FavoritBrowser : + public Gtk::VBox, + public DirSelectionListener { - - class FavoritColumns : public Gtk::TreeModel::ColumnRecord + class FavoritColumns : + public Gtk::TreeModel::ColumnRecord { public: Gtk::TreeModelColumn > icon; @@ -61,7 +63,3 @@ public: void delPressed (); void selectionChanged (); }; - -#endif - - diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index 967b257c4..48ade4036 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -21,7 +21,7 @@ #include #include -#include +#include #include "filebrowser.h" @@ -29,16 +29,17 @@ #include "clipboard.h" #include "multilangmgr.h" #include "options.h" +#include "paramsedited.h" +#include "profilestorecombobox.h" #include "procparamchangers.h" #include "rtimage.h" #include "threadutils.h" +#include "thumbnail.h" #include "../rtengine/dfmanager.h" #include "../rtengine/ffmanager.h" #include "../rtengine/procparams.h" -extern Options options; - namespace { diff --git a/rtgui/filebrowser.h b/rtgui/filebrowser.h index 6911a944f..b941ea9df 100644 --- a/rtgui/filebrowser.h +++ b/rtgui/filebrowser.h @@ -16,25 +16,28 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _FILEBROWSER_ -#define _FILEBROWSER_ +#pragma once + +#include #include -#include -#include "thumbbrowserbase.h" -#include "exiffiltersettings.h" -#include "filebrowserentry.h" + #include "browserfilter.h" -#include "pparamschangelistener.h" -#include "partialpastedlg.h" +#include "exiffiltersettings.h" #include "exportpanel.h" #include "extprog.h" -#include "profilestorecombobox.h" +#include "filebrowserentry.h" +#include "lwbutton.h" +#include "partialpastedlg.h" +#include "pparamschangelistener.h" +#include "../rtengine/profilestore.h" +#include "thumbbrowserbase.h" + #include "../rtengine/noncopyable.h" -class ProfileStoreLabel; class FileBrowser; class FileBrowserEntry; +class ProfileStoreLabel; class FileBrowserListener { @@ -210,5 +213,3 @@ public: type_trash_changed trash_changed(); }; - -#endif diff --git a/rtgui/filebrowserentry.cc b/rtgui/filebrowserentry.cc index 44146b990..4d31d625e 100644 --- a/rtgui/filebrowserentry.cc +++ b/rtgui/filebrowserentry.cc @@ -27,6 +27,7 @@ #include "rtimage.h" #include "threadutils.h" #include "thumbbrowserbase.h" +#include "thumbnail.h" #include "../rtengine/procparams.h" diff --git a/rtgui/filebrowserentry.h b/rtgui/filebrowserentry.h index 646e8e67e..1bdbb2ecb 100644 --- a/rtgui/filebrowserentry.h +++ b/rtgui/filebrowserentry.h @@ -16,28 +16,27 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _FILEBROWSERENTRY_ -#define _FILEBROWSERENTRY_ +#pragma once #include #include #include -#include "../rtengine/rtengine.h" - #include "crophandler.h" #include "editenums.h" #include "filethumbnailbuttonset.h" #include "imageareatoollistener.h" #include "thumbbrowserentrybase.h" #include "thumbimageupdater.h" -#include "thumbnail.h" #include "thumbnaillistener.h" -#include "../rtengine/noncopyable.h" +#include "../rtengine/noncopyable.h" +#include "../rtengine/rtengine.h" class FileBrowserEntry; +class Thumbnail; + struct FileBrowserEntryIdleHelper { FileBrowserEntry* fbentry; bool destroyed; @@ -109,5 +108,3 @@ public: bool pressNotify (int button, int type, int bstate, int x, int y) override; bool releaseNotify (int button, int type, int bstate, int x, int y) override; }; - -#endif diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index 56aff6bc6..4fea8563d 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -25,6 +25,7 @@ #include #include "../rtengine/rt_math.h" +#include "../rtengine/procparams.h" #include "guiutils.h" #include "options.h" @@ -36,6 +37,8 @@ #include "thumbimageupdater.h" #include "batchqueue.h" #include "placesbrowser.h" +#include "pathutils.h" +#include "thumbnail.h" using namespace std; @@ -602,7 +605,7 @@ std::vector FileCatalog::getFileList() names.push_back(Glib::build_filename(selectedDirectory, fname)); } catch (Glib::Exception& exception) { - if (options.rtSettings.verbose) { + if (rtengine::settings->verbose) { std::cerr << exception.what() << std::endl; } } @@ -610,7 +613,7 @@ std::vector FileCatalog::getFileList() } catch (Glib::Exception& exception) { - if (options.rtSettings.verbose) { + if (rtengine::settings->verbose) { std::cerr << "Failed to list directory \"" << selectedDirectory << "\": " << exception.what() << std::endl; } diff --git a/rtgui/filecatalog.h b/rtgui/filecatalog.h index 9796f26c6..f78ca2808 100644 --- a/rtgui/filecatalog.h +++ b/rtgui/filecatalog.h @@ -16,22 +16,24 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _FILECATALOG_ -#define _FILECATALOG_ +#pragma once -#include "filebrowser.h" -#include "exiffiltersettings.h" -#include -#include "fileselectionlistener.h" #include -#include "fileselectionchangelistener.h" + +#include + #include "coarsepanel.h" -#include "toolbar.h" -#include "filterpanel.h" +#include "exiffiltersettings.h" #include "exportpanel.h" -#include "previewloader.h" +#include "filebrowser.h" +#include "fileselectionchangelistener.h" +#include "fileselectionlistener.h" +#include "filterpanel.h" #include "multilangmgr.h" +#include "previewloader.h" #include "threadutils.h" +#include "toolbar.h" + #include "../rtengine/noncopyable.h" class FilePanel; @@ -289,5 +291,3 @@ inline void FileCatalog::setDirSelector (const FileCatalog::DirSelectionSlot& se { this->selectDir = selectDir; } - -#endif diff --git a/rtgui/filepanel.cc b/rtgui/filepanel.cc index 3e23cbc5d..8f45343de 100644 --- a/rtgui/filepanel.cc +++ b/rtgui/filepanel.cc @@ -18,9 +18,12 @@ */ #include "filepanel.h" +#include "batchtoolpanelcoord.h" +#include "editorpanel.h" #include "rtwindow.h" #include "inspector.h" #include "placesbrowser.h" +#include "thumbnail.h" FilePanel::FilePanel () : parent(nullptr), error(0) { diff --git a/rtgui/filepanel.h b/rtgui/filepanel.h index bdeb266f4..9db9d99b7 100644 --- a/rtgui/filepanel.h +++ b/rtgui/filepanel.h @@ -16,23 +16,24 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _FILEPANEL_ -#define _FILEPANEL_ +#pragma once #include -#include "batchtoolpanelcoord.h" -#include "filecatalog.h" + #include "dirbrowser.h" -#include "fileselectionlistener.h" -#include "placesbrowser.h" -#include "recentbrowser.h" -#include "pparamschangelistener.h" -#include "history.h" -#include "filterpanel.h" #include "exportpanel.h" +#include "filecatalog.h" +#include "fileselectionlistener.h" +#include "filterpanel.h" +#include "history.h" +#include "placesbrowser.h" +#include "pparamschangelistener.h" #include "progressconnector.h" +#include "recentbrowser.h" + #include "../rtengine/noncopyable.h" +class BatchToolPanelCoordinator; class RTWindow; class FilePanel final : @@ -108,6 +109,3 @@ private: IdleRegister idle_register; }; - -#endif - diff --git a/rtgui/fileselectionchangelistener.h b/rtgui/fileselectionchangelistener.h index 1f3b8e612..64251c1bd 100644 --- a/rtgui/fileselectionchangelistener.h +++ b/rtgui/fileselectionchangelistener.h @@ -16,8 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _FILESELECTIONCHANGELISTENER_ -#define _FILESELECTIONCHANGELISTENER_ +#pragma once class Thumbnail; @@ -27,6 +26,3 @@ public: virtual ~FileSelectionChangeListener() = default; virtual void selectionChanged(const std::vector& selected) = 0; }; - -#endif - diff --git a/rtgui/fileselectionlistener.h b/rtgui/fileselectionlistener.h index a7f7fb284..394a35f51 100644 --- a/rtgui/fileselectionlistener.h +++ b/rtgui/fileselectionlistener.h @@ -16,11 +16,10 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _FILESELECTIONLISTENER_ -#define _FILESELECTIONLISTENER_ +#pragma once -class Thumbnail; class BatchQueueEntry; +class Thumbnail; class FileSelectionListener { @@ -29,6 +28,3 @@ public: virtual bool fileSelected(Thumbnail* thm) = 0; virtual bool addBatchQueueJobs(const std::vector& entries) = 0; }; - -#endif - diff --git a/rtgui/filethumbnailbuttonset.cc b/rtgui/filethumbnailbuttonset.cc index ef497a535..bb64675a1 100644 --- a/rtgui/filethumbnailbuttonset.cc +++ b/rtgui/filethumbnailbuttonset.cc @@ -20,6 +20,8 @@ #include "rtimage.h" #include "multilangmgr.h" +#include "lwbutton.h" +#include "rtsurface.h" bool FileThumbnailButtonSet::iconsLoaded = false; diff --git a/rtgui/filethumbnailbuttonset.h b/rtgui/filethumbnailbuttonset.h index 102b573c8..66d5b5f67 100644 --- a/rtgui/filethumbnailbuttonset.h +++ b/rtgui/filethumbnailbuttonset.h @@ -16,18 +16,20 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _FILETHUMBNAILBUTTONSET_ -#define _FILETHUMBNAILBUTTONSET_ +#pragma once #include -#include "lwbuttonset.h" #include + #include "filebrowserentry.h" -#include "rtsurface.h" +#include "lwbuttonset.h" class FileBrowserEntry; -class FileThumbnailButtonSet : public LWButtonSet +class RTSurface; + +class FileThumbnailButtonSet : + public LWButtonSet { static bool iconsLoaded; @@ -55,5 +57,3 @@ public: void setInTrash (bool inTrash); }; - -#endif diff --git a/rtgui/filmsimulation.h b/rtgui/filmsimulation.h index b5c9ffa6b..fc9e804e1 100644 --- a/rtgui/filmsimulation.h +++ b/rtgui/filmsimulation.h @@ -1,14 +1,17 @@ -#ifndef FILM_SIMULATION_INCLUDED -#define FILM_SIMULATION_INCLUDED +#pragma once + +#include #include -#include -#include -#include "toolpanel.h" -#include "guiutils.h" -#include "adjuster.h" -class ClutComboBox : public MyComboBox +#include + +#include "adjuster.h" +#include "guiutils.h" +#include "toolpanel.h" + +class ClutComboBox : + public MyComboBox { public: explicit ClutComboBox(const Glib::ustring &path); @@ -74,5 +77,3 @@ private: Adjuster *m_strength; }; - -#endif diff --git a/rtgui/filterpanel.h b/rtgui/filterpanel.h index e6e41a416..25a368b27 100644 --- a/rtgui/filterpanel.h +++ b/rtgui/filterpanel.h @@ -16,10 +16,10 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _FILTERPANEL_ -#define _FILTERPANEL_ +#pragma once #include + #include "exiffiltersettings.h" class FilterPanelListener @@ -79,5 +79,3 @@ public: enabled->set_active(enabledState); } }; - -#endif diff --git a/rtgui/flatcurveeditorsubgroup.cc b/rtgui/flatcurveeditorsubgroup.cc index 33130a8f4..31809cc14 100644 --- a/rtgui/flatcurveeditorsubgroup.cc +++ b/rtgui/flatcurveeditorsubgroup.cc @@ -32,6 +32,7 @@ #include "curveeditor.h" #include "flatcurveeditorsubgroup.h" #include "rtimage.h" +#include "options.h" #include "../rtengine/curves.h" diff --git a/rtgui/flatcurveeditorsubgroup.h b/rtgui/flatcurveeditorsubgroup.h index 1149c3634..bfdca4aae 100644 --- a/rtgui/flatcurveeditorsubgroup.h +++ b/rtgui/flatcurveeditorsubgroup.h @@ -16,16 +16,20 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _FLATCURVEEDITORSUBGROUP_ -#define _FLATCURVEEDITORSUBGROUP_ +#pragma once #include + #include "curveeditorgroup.h" + #include "../rtengine/noncopyable.h" class FlatCurveEditor; +class MyFlatCurve; -class FlatCurveEditorSubGroup: public CurveEditorSubGroup, public rtengine::NonCopyable +class FlatCurveEditorSubGroup: + public CurveEditorSubGroup, + public rtengine::NonCopyable { friend class FlatCurveEditor; @@ -78,5 +82,3 @@ protected: void editPointToggled(Gtk::ToggleButton *button); void editToggled (Gtk::ToggleButton *button); }; - -#endif diff --git a/rtgui/flatfield.cc b/rtgui/flatfield.cc index 03da558cb..ff0c0f9dd 100644 --- a/rtgui/flatfield.cc +++ b/rtgui/flatfield.cc @@ -25,6 +25,7 @@ #include "rtimage.h" #include "../rtengine/procparams.h" +#include "../rtengine/rawimage.h" using namespace rtengine; using namespace rtengine::procparams; diff --git a/rtgui/flatfield.h b/rtgui/flatfield.h index b9997f65e..4308e938a 100644 --- a/rtgui/flatfield.h +++ b/rtgui/flatfield.h @@ -16,15 +16,22 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _FLATFIELD_H_ -#define _FLATFIELD_H_ +#pragma once #include + #include + #include "adjuster.h" -#include "toolpanel.h" -#include "../rtengine/rawimage.h" #include "guiutils.h" +#include "toolpanel.h" + +namespace rtengine +{ + +class RawImage; + +} class FFProvider { @@ -84,5 +91,3 @@ public: }; void flatFieldAutoClipValueChanged(int n = 0) override; }; - -#endif diff --git a/rtgui/gradient.h b/rtgui/gradient.h index 05a267a0d..834f08670 100644 --- a/rtgui/gradient.h +++ b/rtgui/gradient.h @@ -1,16 +1,20 @@ /* * This file is part of RawTherapee. */ -#ifndef _GRADIENT_H_ -#define _GRADIENT_H_ +#pragma once #include + #include "adjuster.h" #include "editcallbacks.h" -#include "toolpanel.h" #include "guiutils.h" +#include "toolpanel.h" -class Gradient : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel, public EditSubscriber +class Gradient : + public ToolParamBlock, + public AdjusterListener, + public FoldableToolPanel, + public EditSubscriber { private: @@ -58,5 +62,3 @@ public: bool drag1(int modifierKey) override; void switchOffEditMode () override; }; - -#endif diff --git a/rtgui/guiutils.cc b/rtgui/guiutils.cc index 189cf6178..d6ede26da 100644 --- a/rtgui/guiutils.cc +++ b/rtgui/guiutils.cc @@ -217,16 +217,6 @@ bool removeIfThere (Gtk::Container* cont, Gtk::Widget* w, bool increference) } } -void thumbInterp (const unsigned char* src, int sw, int sh, unsigned char* dst, int dw, int dh) -{ - - if (options.thumbInterp == 0) { - rtengine::nearestInterp (src, sw, sh, dst, dw, dh); - } else if (options.thumbInterp == 1) { - rtengine::bilinearInterp (src, sw, sh, dst, dw, dh); - } -} - bool confirmOverwrite (Gtk::Window& parent, const std::string& filename) { bool safe = true; diff --git a/rtgui/guiutils.h b/rtgui/guiutils.h index b09e20abb..97c72513b 100644 --- a/rtgui/guiutils.h +++ b/rtgui/guiutils.h @@ -16,8 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef __GUI_UTILS_ -#define __GUI_UTILS_ +#pragma once #include #include @@ -26,19 +25,29 @@ #include +#include "threadutils.h" + #include "../rtengine/coord.h" #include "../rtengine/noncopyable.h" -#include "../rtengine/rtengine.h" -#include "rtimage.h" +namespace rtengine +{ -// for convenience... -#include "pathutils.h" +namespace procparams +{ +class ProcParams; + +struct CropParams; + +} + +} + +class RTImage; Glib::ustring escapeHtmlChars(const Glib::ustring &src); bool removeIfThere (Gtk::Container* cont, Gtk::Widget* w, bool increference = true); -void thumbInterp (const unsigned char* src, int sw, int sh, unsigned char* dst, int dw, int dh); bool confirmOverwrite (Gtk::Window& parent, const std::string& filename); void writeFailed (Gtk::Window& parent, const std::string& filename); void drawCrop (Cairo::RefPtr cr, int imx, int imy, int imw, int imh, int startx, int starty, double scale, const rtengine::procparams::CropParams& cparams, bool drawGuide = true, bool useBgColor = true, bool fullImageVisible = true); @@ -644,5 +653,3 @@ inline Gtk::Window& getToplevelWindow (Gtk::Widget* widget) { return *static_cast (widget->get_toplevel ()); } - -#endif diff --git a/rtgui/histogrampanel.cc b/rtgui/histogrampanel.cc index 36803ddf2..ddf60ca75 100644 --- a/rtgui/histogrampanel.cc +++ b/rtgui/histogrampanel.cc @@ -24,15 +24,10 @@ #include #include "../rtengine/LUT.h" #include "rtimage.h" -#include "../rtengine/improccoordinator.h" #include "../rtengine/color.h" -#include "../rtengine/opthelper.h" -#include "../rtengine/iccstore.h" using namespace rtengine; -extern Options options; - // // diff --git a/rtgui/histogrampanel.h b/rtgui/histogrampanel.h index 1515db97a..23b065534 100644 --- a/rtgui/histogrampanel.h +++ b/rtgui/histogrampanel.h @@ -16,21 +16,22 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _HISTOGRAMPANEL_ -#define _HISTOGRAMPANEL_ - +#pragma once #include -#include -#include -#include "../rtengine/LUT.h" -#include "../rtengine/improccoordinator.h" -#include "guiutils.h" +#include + +#include + +#include "guiutils.h" #include "pointermotionlistener.h" + +#include "../rtengine/LUT.h" #include "../rtengine/noncopyable.h" class HistogramArea; + struct HistogramAreaIdleHelper { HistogramArea* harea; bool destroyed; @@ -252,5 +253,3 @@ public: // drawModeListener interface void toggleButtonMode () override; }; - -#endif diff --git a/rtgui/history.h b/rtgui/history.h index abf0d1ba5..faebe4765 100644 --- a/rtgui/history.h +++ b/rtgui/history.h @@ -16,14 +16,15 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _HISTORY_ -#define _HISTORY_ +#pragma once #include -#include "../rtengine/rtengine.h" + +#include "paramsedited.h" #include "pparamschangelistener.h" #include "profilechangelistener.h" -#include "paramsedited.h" + +#include "../rtengine/rtengine.h" class HistoryBeforeLineListener { @@ -135,5 +136,3 @@ public: bmnum = 1; }; }; - -#endif diff --git a/rtgui/hsvequalizer.cc b/rtgui/hsvequalizer.cc index b6b5b04f2..b570a23ac 100644 --- a/rtgui/hsvequalizer.cc +++ b/rtgui/hsvequalizer.cc @@ -18,6 +18,8 @@ */ #include "hsvequalizer.h" +#include "options.h" + #include "../rtengine/color.h" #include "../rtengine/procparams.h" diff --git a/rtgui/hsvequalizer.h b/rtgui/hsvequalizer.h index 2ffa9fa0f..7d313cc76 100644 --- a/rtgui/hsvequalizer.h +++ b/rtgui/hsvequalizer.h @@ -16,20 +16,22 @@ * * 2010 Ilya Popov */ - -#ifndef HSVEQUALIZER_H_INCLUDED -#define HSVEQUALIZER_H_INCLUDED +#pragma once #include + #include "adjuster.h" -#include "toolpanel.h" -#include "guiutils.h" +#include "colorprovider.h" #include "curveeditor.h" #include "curveeditorgroup.h" -#include "colorprovider.h" +#include "guiutils.h" +#include "toolpanel.h" - -class HSVEqualizer : public ToolParamBlock, public FoldableToolPanel, public CurveListener, public ColorProvider +class HSVEqualizer : + public ToolParamBlock, + public FoldableToolPanel, + public CurveListener, + public ColorProvider { protected: @@ -56,5 +58,3 @@ public: //void adjusterChanged (Adjuster* a, double newval); void enabledChanged() override; }; - -#endif diff --git a/rtgui/iccprofilecreator.cc b/rtgui/iccprofilecreator.cc index 9efa4360b..a8f9be007 100644 --- a/rtgui/iccprofilecreator.cc +++ b/rtgui/iccprofilecreator.cc @@ -17,25 +17,20 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ + +#include +#include + #include #include "iccprofilecreator.h" +#include "../rtengine/iccstore.h" #include "multilangmgr.h" #include "cachemanager.h" -#include "addsetids.h" #include "../rtengine/color.h" +#include "options.h" +#include "pathutils.h" #include "rtimage.h" -#ifdef _OPENMP -#include -#endif - -extern Options options; - -namespace rtengine -{ - -extern const Settings* settings; - -} +#include "rtwindow.h" const char* sTRCPreset[] = {"BT709_g2.2_s4.5", "sRGB_g2.4_s12.92", "linear_g1.0", "standard_g2.2", "standard_g1.8", "High_g1.3_s3.35", "Low_g2.6_s6.9", "Lab_g3.0s9.03296"}; //gamma free diff --git a/rtgui/iccprofilecreator.h b/rtgui/iccprofilecreator.h index b28ac29f2..2cd19e14f 100644 --- a/rtgui/iccprofilecreator.h +++ b/rtgui/iccprofilecreator.h @@ -19,11 +19,13 @@ */ #pragma once +#include + #include #include "adjuster.h" -#include "options.h" #include -#include "rtwindow.h" + +class RTWindow; class ICCProfileCreator : public Gtk::Dialog, public AdjusterListener { diff --git a/rtgui/icmpanel.cc b/rtgui/icmpanel.cc index 012aeca78..3e3c0508c 100644 --- a/rtgui/icmpanel.cc +++ b/rtgui/icmpanel.cc @@ -23,6 +23,7 @@ #include "eventmapper.h" #include "guiutils.h" #include "options.h" +#include "pathutils.h" #include "rtimage.h" #include "../rtengine/dcp.h" @@ -32,8 +33,6 @@ using namespace rtengine; using namespace rtengine::procparams; -extern Options options; - ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iunchanged(nullptr), icmplistener(nullptr) { auto m = ProcEventMapper::getInstance(); diff --git a/rtgui/icmpanel.h b/rtgui/icmpanel.h index 9b4706ecd..5573bacb8 100644 --- a/rtgui/icmpanel.h +++ b/rtgui/icmpanel.h @@ -16,16 +16,17 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _ICMPANEL_ -#define _ICMPANEL_ +#pragma once #include + #include + #include "adjuster.h" #include "guiutils.h" - -#include "toolpanel.h" #include "popupbutton.h" +#include "toolpanel.h" + #include "../rtengine/imagedata.h" class ICMPanelListener @@ -148,5 +149,3 @@ public: icmplistener = ipl; } }; - -#endif diff --git a/rtgui/ilabel.cc b/rtgui/ilabel.cc deleted file mode 100644 index 9dfd50b89..000000000 --- a/rtgui/ilabel.cc +++ /dev/null @@ -1,66 +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 "ilabel.h" - -ILabel::ILabel (const Glib::ustring &lab) : label(lab) {} - -void ILabel::on_realize() -{ - - Gtk::DrawingArea::on_realize(); - add_events(Gdk::EXPOSURE_MASK); - - Glib::RefPtr fn = create_pango_layout(label); - fn->set_markup (label); - int labw, labh; - fn->get_pixel_size (labw, labh); - set_size_request (2 + labw, 2 + labh); -} - -bool ILabel::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr) -{ - - Glib::RefPtr style = get_style_context (); - - Gtk::StateFlags state = get_state_flags(); - Gdk::RGBA c = style->get_background_color(state); - cr->set_source_rgb (c.get_red(), c.get_green(), c.get_blue()); - cr->rectangle (0, 0, get_width (), get_height()); - cr->fill (); - - Glib::RefPtr fn = create_pango_layout (label); - fn->set_markup (label); - cr->move_to(1., 1.); - fn->add_to_cairo_context(cr); - c = style->get_color (state); - cr->set_source_rgb (c.get_red(), c.get_green(), c.get_blue()); - cr->fill(); - - return true; -} - -void ILabel::on_style_updated () -{ - - Glib::RefPtr fn = create_pango_layout(label); - fn->set_markup (label); - int labw, labh; - fn->get_pixel_size (labw, labh); - set_size_request (2 + labw, 2 + labh); -} diff --git a/rtgui/imagearea.cc b/rtgui/imagearea.cc index 9cb670e83..22e140e7d 100644 --- a/rtgui/imagearea.cc +++ b/rtgui/imagearea.cc @@ -25,6 +25,7 @@ #include "../rtengine/refreshmap.h" #include "../rtengine/procparams.h" #include "options.h" +#include "rtscalable.h" ImageArea::ImageArea (ImageAreaPanel* p) : parent(p), fullImageWidth(0), fullImageHeight(0) { diff --git a/rtgui/imagearea.h b/rtgui/imagearea.h index 099b4f8e4..3f5c321a3 100644 --- a/rtgui/imagearea.h +++ b/rtgui/imagearea.h @@ -16,24 +16,29 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef __IMAGEAREA_H__ -#define __IMAGEAREA_H__ +#pragma once #include + #include "cropguilistener.h" -#include "imageareapanel.h" -#include "editenums.h" -#include "toolbar.h" -#include "previewhandler.h" -#include "imageareatoollistener.h" #include "cropwindow.h" #include "editcallbacks.h" -#include "zoompanel.h" +#include "editenums.h" +#include "imageareapanel.h" +#include "imageareatoollistener.h" #include "indclippedpanel.h" +#include "previewhandler.h" #include "previewmodepanel.h" +#include "toolbar.h" +#include "zoompanel.h" class ImageAreaPanel; -class ImageArea : public Gtk::DrawingArea, public CropWindowListener, public EditDataProvider, public LockablePickerToolListener + +class ImageArea : + public Gtk::DrawingArea, + public CropWindowListener, + public EditDataProvider, + public LockablePickerToolListener { friend class ZoomPanel; @@ -160,7 +165,3 @@ public: return mainCropWindow; } }; - - - -#endif diff --git a/rtgui/imageareapanel.h b/rtgui/imageareapanel.h index 4ec3ffcf3..831371dbb 100644 --- a/rtgui/imageareapanel.h +++ b/rtgui/imageareapanel.h @@ -16,13 +16,14 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _IMAGEAREAPANEL_ -#define _IMAGEAREAPANEL_ +#pragma once #include "imagearea.h" class ImageArea; -class ImageAreaPanel : public Gtk::VBox + +class ImageAreaPanel : + public Gtk::VBox { protected: @@ -42,5 +43,3 @@ public: void setBeforeAfterViews (ImageAreaPanel* bef, ImageAreaPanel* aft); void syncBeforeAfterViews(); }; - -#endif diff --git a/rtgui/imageareatoollistener.h b/rtgui/imageareatoollistener.h index d387b595c..3c753a5e0 100644 --- a/rtgui/imageareatoollistener.h +++ b/rtgui/imageareatoollistener.h @@ -16,13 +16,12 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _IMAGEAREATOOLLISTENER_ -#define _IMAGEAREATOOLLISTENER_ +#pragma once -#include "toolbar.h" -#include "thumbnail.h" #include "cropguilistener.h" +#include "toolbar.h" +class Thumbnail; class ImageAreaToolListener { @@ -36,6 +35,3 @@ public: virtual ToolBar* getToolBar() const = 0; virtual CropGUIListener* startCropEditing(Thumbnail* thm = nullptr) = 0; }; - -#endif - diff --git a/rtgui/impulsedenoise.h b/rtgui/impulsedenoise.h index 1ebdc430b..e3cfc619a 100644 --- a/rtgui/impulsedenoise.h +++ b/rtgui/impulsedenoise.h @@ -16,14 +16,17 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _IMPULSEDENOISE_H_ -#define _IMPULSEDENOISE_H_ +#pragma once #include + #include "adjuster.h" #include "toolpanel.h" -class ImpulseDenoise : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel +class ImpulseDenoise : + public ToolParamBlock, + public AdjusterListener, + public FoldableToolPanel { protected: @@ -45,5 +48,3 @@ public: void setAdjusterBehavior (bool threshadd); void trimValues (rtengine::procparams::ProcParams* pp) override; }; - -#endif diff --git a/rtgui/indclippedpanel.h b/rtgui/indclippedpanel.h index 54476af10..1017b58f1 100644 --- a/rtgui/indclippedpanel.h +++ b/rtgui/indclippedpanel.h @@ -15,14 +15,16 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _INDCLIPPEDPANEL_ -#define _INDCLIPPEDPANEL_ +#pragma once -#include #include +#include + class ImageArea; -class IndicateClippedPanel : public Gtk::HBox + +class IndicateClippedPanel : + public Gtk::HBox { protected: @@ -59,5 +61,3 @@ public: return indClippedH->get_active(); } }; - -#endif diff --git a/rtgui/inspector.cc b/rtgui/inspector.cc index 8bd9862a7..d38239cde 100644 --- a/rtgui/inspector.cc +++ b/rtgui/inspector.cc @@ -22,10 +22,10 @@ #include "cursormanager.h" #include "guiutils.h" #include "options.h" +#include "pathutils.h" +#include "rtscalable.h" #include "../rtengine/previewimage.h" -extern Options options; - InspectorBuffer::InspectorBuffer(const Glib::ustring &imagePath) : currTransform(0), fromRaw(false) { if (!imagePath.empty() && Glib::file_test(imagePath, Glib::FILE_TEST_EXISTS) && !Glib::file_test(imagePath, Glib::FILE_TEST_IS_DIR)) { diff --git a/rtgui/inspector.h b/rtgui/inspector.h index 681b90aa3..bb144834a 100644 --- a/rtgui/inspector.h +++ b/rtgui/inspector.h @@ -16,12 +16,15 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _INSPECTOR_ -#define _INSPECTOR_ +#pragma once #include + #include "guiutils.h" + #include "../rtengine/coord.h" +#include "../rtengine/coord2d.h" +#include "../rtengine/rt_math.h" class InspectorBuffer { @@ -99,5 +102,3 @@ public: void get_preferred_width_for_height_vfunc (int height, int &minimum_width, int &natural_width) const override; }; - -#endif diff --git a/rtgui/iptcpanel.h b/rtgui/iptcpanel.h index 0317314a1..15d117f87 100644 --- a/rtgui/iptcpanel.h +++ b/rtgui/iptcpanel.h @@ -16,8 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _IPTCPANEL_ -#define _IPTCPANEL_ +#pragma once #include @@ -26,7 +25,9 @@ #include "guiutils.h" #include "toolpanel.h" -class IPTCPanel : public Gtk::VBox, public ToolPanel +class IPTCPanel : + public Gtk::VBox, + public ToolPanel { private: @@ -92,5 +93,3 @@ public: void copyClicked (); void pasteClicked (); }; - -#endif diff --git a/rtgui/labcurve.cc b/rtgui/labcurve.cc index 237f9ea9b..bd4b27f14 100644 --- a/rtgui/labcurve.cc +++ b/rtgui/labcurve.cc @@ -20,6 +20,9 @@ #include "labcurve.h" +#include "options.h" + +#include "../rtengine/color.h" #include "../rtengine/improcfun.h" #include "../rtengine/procparams.h" #include "editcallbacks.h" diff --git a/rtgui/labcurve.h b/rtgui/labcurve.h index 51ba0fdd6..46f506d68 100644 --- a/rtgui/labcurve.h +++ b/rtgui/labcurve.h @@ -16,19 +16,24 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _LABCURVE_H_ -#define _LABCURVE_H_ +#pragma once #include + #include "adjuster.h" -#include "toolpanel.h" +#include "colorprovider.h" #include "curveeditor.h" #include "curveeditorgroup.h" -#include "colorprovider.h" +#include "toolpanel.h" class EditDataProvider; -class LCurve : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel, public CurveListener, public ColorProvider +class LCurve : + public ToolParamBlock, + public AdjusterListener, + public FoldableToolPanel, + public CurveListener, + public ColorProvider { protected: @@ -97,5 +102,3 @@ public: void enabledChanged() override; }; - -#endif diff --git a/rtgui/labgrid.cc b/rtgui/labgrid.cc index b6393f6f5..516dbb825 100644 --- a/rtgui/labgrid.cc +++ b/rtgui/labgrid.cc @@ -38,7 +38,9 @@ #include "labgrid.h" +#include "../rtengine/color.h" #include "options.h" +#include "rtimage.h" using rtengine::Color; diff --git a/rtgui/lensgeom.h b/rtgui/lensgeom.h index 06b8e5689..e3352a506 100644 --- a/rtgui/lensgeom.h +++ b/rtgui/lensgeom.h @@ -16,14 +16,16 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _LENSGEOM_H_ -#define _LENSGEOM_H_ +#pragma once #include -#include "toolpanel.h" -#include "lensgeomlistener.h" -class LensGeometry : public ToolParamBlock, public FoldableToolPanel +#include "lensgeomlistener.h" +#include "toolpanel.h" + +class LensGeometry : + public ToolParamBlock, + public FoldableToolPanel { protected: @@ -58,5 +60,3 @@ public: private: IdleRegister idle_register; }; - -#endif diff --git a/rtgui/lensgeomlistener.h b/rtgui/lensgeomlistener.h index dbe58f1fa..7bfa0fb45 100644 --- a/rtgui/lensgeomlistener.h +++ b/rtgui/lensgeomlistener.h @@ -16,8 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _LENSGEOMLISTENER_H_ -#define _LENSGEOMLISTENER_H_ +#pragma once class LensGeomListener { @@ -27,5 +26,3 @@ public: virtual void autoCropRequested () = 0; virtual double autoDistorRequested () = 0; }; - -#endif diff --git a/rtgui/lensprofile.cc b/rtgui/lensprofile.cc index 389f15461..e2cdb5649 100644 --- a/rtgui/lensprofile.cc +++ b/rtgui/lensprofile.cc @@ -18,9 +18,10 @@ */ #include #include +#include #include -#include +#include #include "lensprofile.h" @@ -586,7 +587,7 @@ void LensProfilePanel::onCorrModeChanged(const Gtk::RadioButton* rbChanged) LensProfilePanel::LFDbHelper::LFDbHelper() { #ifdef _OPENMP -#pragma omp parallel sections if (!options.rtSettings.verbose) +#pragma omp parallel sections if (!settings->verbose) #endif { #ifdef _OPENMP @@ -608,7 +609,7 @@ LensProfilePanel::LFDbHelper::LFDbHelper() void LensProfilePanel::LFDbHelper::fillLensfunCameras() { - if (options.rtSettings.verbose) { + if (settings->verbose) { std::cout << "LENSFUN, scanning cameras:" << std::endl; } @@ -618,7 +619,7 @@ void LensProfilePanel::LFDbHelper::fillLensfunCameras() for (const auto& c : camlist) { camnames[c.getMake()].insert(c.getModel()); - if (options.rtSettings.verbose) { + if (settings->verbose) { std::cout << " found: " << c.getDisplayString().c_str() << std::endl; } } @@ -638,7 +639,7 @@ void LensProfilePanel::LFDbHelper::fillLensfunCameras() void LensProfilePanel::LFDbHelper::fillLensfunLenses() { - if (options.rtSettings.verbose) { + if (settings->verbose) { std::cout << "LENSFUN, scanning lenses:" << std::endl; } @@ -650,7 +651,7 @@ void LensProfilePanel::LFDbHelper::fillLensfunLenses() const auto& make = l.getMake(); lenses[make].insert(name); - if (options.rtSettings.verbose) { + if (settings->verbose) { std::cout << " found: " << l.getDisplayString().c_str() << std::endl; } } diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index ac8ff94f7..9cb97b994 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -31,6 +31,7 @@ #include "guiutils.h" #include #include +#include "../rtengine/color.h" #include "../rtengine/improcfun.h" #include "labgrid.h" @@ -482,7 +483,7 @@ Locallab::Locallab(): nextminT = 0.; nextmaxT = 0.; - LocallabParams::LocallabSpot defSpot; + rtengine::procparams::LocallabParams::LocallabSpot defSpot; // Settings @@ -2846,7 +2847,7 @@ void Locallab::lumacontrastMinusPressed() adjusterChanged(multiplier[0], multiplier[0]->getValue()); // Value isn't used } -void Locallab::read(const ProcParams* pp, const ParamsEdited* pedited) +void Locallab::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited) { // printf("Locallab read\n"); @@ -2981,7 +2982,7 @@ void Locallab::read(const ProcParams* pp, const ParamsEdited* pedited) } } -void Locallab::write(ProcParams* pp, ParamsEdited* pedited) +void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited) { // printf("Locallab write\n"); @@ -2990,7 +2991,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) const int spotPanelEvent = expsettings->getEventType(); int spotId; ControlSpotPanel::SpotRow* r; - LocallabParams::LocallabSpot* newSpot; + rtengine::procparams::LocallabParams::LocallabSpot* newSpot; int imW, imH; // Size of image int prW, prH; // Size of preview area @@ -3000,7 +3001,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) switch (spotPanelEvent) { case (ControlSpotPanel::SpotCreation): // Spot creation event // Spot creation (default initialization) - newSpot = new LocallabParams::LocallabSpot(); + newSpot = new rtengine::procparams::LocallabParams::LocallabSpot(); spotId = expsettings->getNewId(); r = new ControlSpotPanel::SpotRow(); r->id = newSpot->id = spotId; @@ -3233,7 +3234,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) for (int i = 0; i < pp->locallab.nbspot && i < (int)pp->locallab.spots.size(); i++) { if (pp->locallab.spots.at(i).id == spotId) { - newSpot = new LocallabParams::LocallabSpot(pp->locallab.spots.at(i)); + newSpot = new rtengine::procparams::LocallabParams::LocallabSpot(pp->locallab.spots.at(i)); break; } } @@ -3489,10 +3490,10 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pp->locallab.spots.at(pp->locallab.selspot).chroma = chroma->getIntValue(); labgrid->getParams(pp->locallab.spots.at(pp->locallab.selspot).labgridALow, pp->locallab.spots.at(pp->locallab.selspot).labgridBLow, pp->locallab.spots.at(pp->locallab.selspot).labgridAHigh, pp->locallab.spots.at(pp->locallab.selspot).labgridBHigh); pp->locallab.spots.at(pp->locallab.selspot).strengthgrid = strengthgrid->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).labgridALow *= LocallabParams::LABGRIDL_CORR_MAX; - pp->locallab.spots.at(pp->locallab.selspot).labgridAHigh *= LocallabParams::LABGRIDL_CORR_MAX; - pp->locallab.spots.at(pp->locallab.selspot).labgridBLow *= LocallabParams::LABGRIDL_CORR_MAX; - pp->locallab.spots.at(pp->locallab.selspot).labgridBHigh *= LocallabParams::LABGRIDL_CORR_MAX; + pp->locallab.spots.at(pp->locallab.selspot).labgridALow *= rtengine::procparams::LocallabParams::LABGRIDL_CORR_MAX; + pp->locallab.spots.at(pp->locallab.selspot).labgridAHigh *= rtengine::procparams::LocallabParams::LABGRIDL_CORR_MAX; + pp->locallab.spots.at(pp->locallab.selspot).labgridBLow *= rtengine::procparams::LocallabParams::LABGRIDL_CORR_MAX; + pp->locallab.spots.at(pp->locallab.selspot).labgridBHigh *= rtengine::procparams::LocallabParams::LABGRIDL_CORR_MAX; pp->locallab.spots.at(pp->locallab.selspot).sensi = sensi->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).structcol = structcol->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).blurcolde = blurcolde->getIntValue(); @@ -6275,7 +6276,7 @@ void Locallab::setDefaults(const rtengine::procparams::ProcParams* defParams, co } } -void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pedited, int id) +void Locallab::setDefaults(const rtengine::procparams::ProcParams * defParams, const ParamsEdited * pedited, int id) { // printf("setDefaults\n"); @@ -6294,7 +6295,7 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe } // Set default values for adjusters - const LocallabParams::LocallabSpot* defSpot = new LocallabParams::LocallabSpot(); + const rtengine::procparams::LocallabParams::LocallabSpot* defSpot = new rtengine::procparams::LocallabParams::LocallabSpot(); if (index != -1 && index < (int)defParams->locallab.spots.size()) { defSpot = &defParams->locallab.spots.at(index); @@ -6304,7 +6305,7 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe lightness->setDefault((double)defSpot->lightness); contrast->setDefault((double)defSpot->contrast); chroma->setDefault((double)defSpot->chroma); - labgrid->setDefault(defSpot->labgridALow / LocallabParams::LABGRIDL_CORR_MAX, defSpot->labgridBLow / LocallabParams::LABGRIDL_CORR_MAX, defSpot->labgridAHigh / LocallabParams::LABGRIDL_CORR_MAX, defSpot->labgridBHigh / LocallabParams::LABGRIDL_CORR_MAX); + labgrid->setDefault(defSpot->labgridALow / rtengine::procparams::LocallabParams::LABGRIDL_CORR_MAX, defSpot->labgridBLow / rtengine::procparams::LocallabParams::LABGRIDL_CORR_MAX, defSpot->labgridAHigh / rtengine::procparams::LocallabParams::LABGRIDL_CORR_MAX, defSpot->labgridBHigh / rtengine::procparams::LocallabParams::LABGRIDL_CORR_MAX); sensi->setDefault((double)defSpot->sensi); structcol->setDefault((double)defSpot->structcol); blurcolde->setDefault((double)defSpot->blurcolde); @@ -8578,7 +8579,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con lightness->setValue(pp->locallab.spots.at(index).lightness); contrast->setValue(pp->locallab.spots.at(index).contrast); chroma->setValue(pp->locallab.spots.at(index).chroma); - labgrid->setParams(pp->locallab.spots.at(index).labgridALow / LocallabParams::LABGRIDL_CORR_MAX, pp->locallab.spots.at(index).labgridBLow / LocallabParams::LABGRIDL_CORR_MAX, pp->locallab.spots.at(index).labgridAHigh / LocallabParams::LABGRIDL_CORR_MAX, pp->locallab.spots.at(index).labgridBHigh / LocallabParams::LABGRIDL_CORR_MAX, false); + labgrid->setParams(pp->locallab.spots.at(index).labgridALow / rtengine::procparams::LocallabParams::LABGRIDL_CORR_MAX, pp->locallab.spots.at(index).labgridBLow / rtengine::procparams::LocallabParams::LABGRIDL_CORR_MAX, pp->locallab.spots.at(index).labgridAHigh / rtengine::procparams::LocallabParams::LABGRIDL_CORR_MAX, pp->locallab.spots.at(index).labgridBHigh / rtengine::procparams::LocallabParams::LABGRIDL_CORR_MAX, false); strengthgrid->setValue(pp->locallab.spots.at(index).strengthgrid); sensi->setValue(pp->locallab.spots.at(index).sensi); structcol->setValue(pp->locallab.spots.at(index).structcol); diff --git a/rtgui/lockablecolorpicker.cc b/rtgui/lockablecolorpicker.cc index ef16df6ec..cb334c7e4 100644 --- a/rtgui/lockablecolorpicker.cc +++ b/rtgui/lockablecolorpicker.cc @@ -21,12 +21,11 @@ #include "options.h" #include "../rtengine/color.h" #include "../rtengine/rt_math.h" +#include "../rtengine/utils.h" #include "imagearea.h" #include "multilangmgr.h" #include "navigator.h" -extern Options options; - LockableColorPicker::LockableColorPicker (CropWindow* cropWindow, Glib::ustring *oProfile, Glib::ustring *wProfile) : cropWindow(cropWindow), displayedValues(ColorPickerType::RGB), position(0, 0), size(Size::S15), outputProfile(oProfile), workingProfile(wProfile), validity(Validity::OUTSIDE), diff --git a/rtgui/lockablecolorpicker.h b/rtgui/lockablecolorpicker.h index f1a63d533..eadf71773 100644 --- a/rtgui/lockablecolorpicker.h +++ b/rtgui/lockablecolorpicker.h @@ -16,13 +16,11 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ +#pragma once -#ifndef __COLORPICKER__ -#define __COLORPICKER__ - +#include "guiutils.h" #include "../rtengine/coord.h" -#include "guiutils.h" class CropWindow; @@ -93,5 +91,3 @@ public: bool cycleRGB (); bool cycleHSV (); }; - -#endif diff --git a/rtgui/lwbutton.cc b/rtgui/lwbutton.cc index b5c10c532..c6c75584d 100644 --- a/rtgui/lwbutton.cc +++ b/rtgui/lwbutton.cc @@ -18,6 +18,7 @@ */ #include "lwbutton.h" #include "guiutils.h" +#include "rtsurface.h" LWButton::LWButton (Cairo::RefPtr i, int aCode, void* aData, Alignment ha, Alignment va, Glib::ustring* tooltip) : xpos(0), ypos(0), halign(ha), valign(va), icon(i), bgr(0.0), bgg(0.0), bgb(0.0), fgr(0.0), fgg(0.0), fgb(0.0), state(Normal), listener(nullptr), actionCode(aCode), actionData(aData), toolTip(tooltip) diff --git a/rtgui/lwbutton.h b/rtgui/lwbutton.h index 16e53a875..a98f1fe46 100644 --- a/rtgui/lwbutton.h +++ b/rtgui/lwbutton.h @@ -16,12 +16,10 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _LWBUTTON_ -#define _LWBUTTON_ +#pragma once #include #include "rtsurface.h" - class LWButton; class LWButtonListener @@ -78,5 +76,3 @@ public: void redraw (Cairo::RefPtr context); }; - -#endif diff --git a/rtgui/lwbuttonset.cc b/rtgui/lwbuttonset.cc index a03b3064b..f475cf0b3 100644 --- a/rtgui/lwbuttonset.cc +++ b/rtgui/lwbuttonset.cc @@ -17,6 +17,8 @@ * along with RawTherapee. If not, see . */ #include "lwbuttonset.h" +#include "lwbutton.h" +#include "rtscalable.h" LWButtonSet::LWButtonSet () : aw(0), ah(0), ax(-1), ay(-1) { diff --git a/rtgui/lwbuttonset.h b/rtgui/lwbuttonset.h index 07d17a135..63bc5a01b 100644 --- a/rtgui/lwbuttonset.h +++ b/rtgui/lwbuttonset.h @@ -19,9 +19,10 @@ #pragma once #include -#include "lwbutton.h" #include +class LWButton; +class LWButtonListener; class LWButtonSet { diff --git a/rtgui/main-cli.cc b/rtgui/main-cli.cc index 09aab1cff..c60cba070 100644 --- a/rtgui/main-cli.cc +++ b/rtgui/main-cli.cc @@ -33,6 +33,7 @@ #include #include "../rtengine/procparams.h" #include "../rtengine/profilestore.h" +#include "../rtengine/rtengine.h" #include "options.h" #include "soundman.h" #include "rtimage.h" @@ -55,8 +56,6 @@ // Set this to 1 to make RT work when started with Eclipse and arguments, at least on Windows platform #define ECLIPSE_ARGS 0 -extern Options options; - // stores path to data files Glib::ustring argv0; Glib::ustring creditsPath; diff --git a/rtgui/main.cc b/rtgui/main.cc index fee6ac380..09008a2f6 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -33,12 +33,17 @@ #include #include #include +#include "cachemanager.h" +#include "editorpanel.h" +#include "filecatalog.h" +#include "filepanel.h" #include "options.h" #include "soundman.h" #include "rtimage.h" #include "version.h" #include "extprog.h" #include "../rtengine/dynamicprofile.h" +#include "../rtengine/procparams.h" #ifndef WIN32 #include @@ -53,8 +58,6 @@ // Set this to 1 to make RT work when started with Eclipse and arguments, at least on Windows platform #define ECLIPSE_ARGS 0 -extern Options options; - // stores path to data files Glib::ustring argv0; Glib::ustring creditsPath; @@ -221,7 +224,7 @@ bool init_rt() extProgStore->init(); SoundManager::init(); - if ( !options.rtSettings.verbose ) { + if (!rtengine::settings->verbose) { TIFFSetWarningHandler (nullptr); // avoid annoying message boxes } diff --git a/rtgui/multilangmgr.h b/rtgui/multilangmgr.h index 0c76b4c01..902161eb2 100644 --- a/rtgui/multilangmgr.h +++ b/rtgui/multilangmgr.h @@ -16,8 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _MULTILANGMGR_ -#define _MULTILANGMGR_ +#pragma once #include #include @@ -45,5 +44,3 @@ inline Glib::ustring M (const std::string& key) { return langMgr.getStr (key); } - -#endif diff --git a/rtgui/mycurve.cc b/rtgui/mycurve.cc index 6c00e3f56..7401570c8 100644 --- a/rtgui/mycurve.cc +++ b/rtgui/mycurve.cc @@ -20,6 +20,7 @@ #include "../rtengine/curves.h" #include #include +#include "rtscalable.h" MyCurve::MyCurve () : pipetteR(-1.f), diff --git a/rtgui/mycurve.h b/rtgui/mycurve.h index 62d8d30f2..6bdfe4b66 100644 --- a/rtgui/mycurve.h +++ b/rtgui/mycurve.h @@ -16,18 +16,18 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _MYCURVE_ -#define _MYCURVE_ +#pragma once + +#include #include -#include -#include "curvelistener.h" -#include "cursormanager.h" + #include "coloredbar.h" #include "coordinateadjuster.h" +#include "cursormanager.h" +#include "curvelistener.h" + #include "../rtengine/LUT.h" -#include "guiutils.h" -#include "options.h" #include "../rtengine/noncopyable.h" #define RADIUS 3.5 /** radius of the control points ; must be x.5 to target the center of a pixel */ @@ -55,6 +55,7 @@ enum SnapToType { class MyCurveIdleHelper; class CurveEditor; +class EditDataProvider; class MyCurve : public Gtk::DrawingArea, public BackBuffer, public ColorCaller, public CoordinateProvider, public rtengine::NonCopyable { @@ -152,5 +153,3 @@ public: myCurve->setDirty(true); } }; - -#endif diff --git a/rtgui/mydiagonalcurve.cc b/rtgui/mydiagonalcurve.cc index d393c7200..9aa52c67e 100644 --- a/rtgui/mydiagonalcurve.cc +++ b/rtgui/mydiagonalcurve.cc @@ -23,6 +23,7 @@ #include "mydiagonalcurve.h" #include "editcallbacks.h" +#include "rtscalable.h" #include "../rtengine/curves.h" diff --git a/rtgui/mydiagonalcurve.h b/rtgui/mydiagonalcurve.h index 33fac6090..a71c0565c 100644 --- a/rtgui/mydiagonalcurve.h +++ b/rtgui/mydiagonalcurve.h @@ -16,28 +16,22 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _MYDIAGONALCURVE_ -#define _MYDIAGONALCURVE_ +#pragma once + +#include #include -#include -#include "curvelistener.h" + #include "cursormanager.h" +#include "curvelistener.h" #include "mycurve.h" -#include "../rtengine/LUT.h" +#include "../rtengine/diagonalcurvetypes.h" -// For compatibility and simplicity reason, order shouldn't change, and must be identical to the order specified in the curveType widget -enum DiagonalCurveType { - DCT_Empty = -1, // Also used for identity curves - DCT_Linear, // 0 - DCT_Spline, // 1 - DCT_Parametric, // 2 - DCT_NURBS, // 3 - DCT_CatumullRom, // 4 - // Insert new curve type above this line - DCT_Unchanged // Must remain the last of the enum -}; +template +class LUT; + +using LUTf = LUT; class DiagonalCurveDescr { @@ -101,5 +95,3 @@ public: void setPos(double pos, int chanIdx) override; void stopNumericalAdjustment() override; }; - -#endif diff --git a/rtgui/myflatcurve.cc b/rtgui/myflatcurve.cc index d9628dc95..afb2c9f09 100644 --- a/rtgui/myflatcurve.cc +++ b/rtgui/myflatcurve.cc @@ -23,6 +23,7 @@ #include "myflatcurve.h" #include "editcallbacks.h" +#include "rtscalable.h" #include "../rtengine/curves.h" diff --git a/rtgui/myflatcurve.h b/rtgui/myflatcurve.h index 088edf193..aaec8eb99 100644 --- a/rtgui/myflatcurve.h +++ b/rtgui/myflatcurve.h @@ -16,24 +16,16 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _MYFLATCURVE_ -#define _MYFLATCURVE_ +#pragma once + +#include #include -#include -#include "curvelistener.h" -#include "cursormanager.h" -#include "mycurve.h" -// For compatibility and simplicity reason, order shouldn't change, and must be identical to the order specified in the curveType widget -enum FlatCurveType { - FCT_Empty = -1, // Also used for identity curves - FCT_Linear, // 0 - FCT_MinMaxCPoints, // 1 - //FCT_Parametric, // 2 - // Insert new curve type above this line - FCT_Unchanged // Must remain the last of the enum -}; +#include "cursormanager.h" +#include "curvelistener.h" +#include "mycurve.h" +#include "../rtengine/flatcurvetypes.h" enum MouseOverAreas { FCT_Area_None = 1 << 0, // over a zone that don't have any @@ -143,5 +135,3 @@ public: void updateLocallabBackground(double ref); }; - -#endif diff --git a/rtgui/navigator.cc b/rtgui/navigator.cc index de07ffcd7..6a8137737 100644 --- a/rtgui/navigator.cc +++ b/rtgui/navigator.cc @@ -19,15 +19,10 @@ #include #include "navigator.h" #include "toolpanel.h" -#include "../rtengine/iccmatrices.h" -#include "../rtengine/iccstore.h" -#include "../rtengine/curves.h" #include "../rtengine/color.h" #include "../rtengine/rt_math.h" #include "options.h" -extern Options options; - using namespace rtengine; Navigator::Navigator () : currentRGBUnit(options.navRGBUnit), currentHSVUnit(options.navHSVUnit) diff --git a/rtgui/navigator.h b/rtgui/navigator.h index eb4584f42..953a0a44b 100644 --- a/rtgui/navigator.h +++ b/rtgui/navigator.h @@ -16,16 +16,17 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _NAVIGATOR_ -#define _NAVIGATOR_ +#pragma once #include -#include "previewwindow.h" -#include "pointermotionlistener.h" -#include "options.h" -#include "../rtengine/iccstore.h" -class Navigator : public Gtk::Frame, public PointerMotionListener +#include "options.h" +#include "pointermotionlistener.h" +#include "previewwindow.h" + +class Navigator : + public Gtk::Frame, + public PointerMotionListener { typedef const double (*TMatrix)[3]; @@ -63,5 +64,3 @@ public: void getLABText (float l, float a, float b, Glib::ustring &sL, Glib::ustring &sA, Glib::ustring &sB) override; }; - -#endif diff --git a/rtgui/options.cc b/rtgui/options.cc index 5214ac236..91886102e 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -19,13 +19,18 @@ #include "options.h" #include #include +#include +#include #include #include "multilangmgr.h" #include "addsetids.h" #include "guiutils.h" +#include "pathutils.h" #include "version.h" #include "../rtengine/procparams.h" +#include "../rtengine/rtengine.h" +#include "../rtengine/utils.h" #ifdef _OPENMP #include diff --git a/rtgui/options.h b/rtgui/options.h index bc2601493..4e1c737e7 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -16,12 +16,12 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _OPTIONS_ -#define _OPTIONS_ +#pragma once #include -#include -#include "../rtengine/rtengine.h" +#include +#include +#include "../rtengine/settings.h" #include #define STARTUPDIR_CURRENT 0 @@ -103,6 +103,13 @@ enum PPLoadLocation {PLL_Cache = 0, PLL_Input = 1}; enum CPBKeyType {CPBKT_TID = 0, CPBKT_NAME = 1, CPBKT_TID_NAME = 2}; enum prevdemo_t {PD_Sidecar = 1, PD_Fast = 0}; +namespace Glib +{ + +class KeyFile; + +} + class Options { public: @@ -448,5 +455,3 @@ extern bool gimpPlugin; extern bool remote; extern Glib::ustring versionString; extern Glib::ustring paramFileExtension; - -#endif diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index e4c860c60..2e288f1eb 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -20,7 +20,19 @@ #include -#include "../rtengine/rtengine.h" +namespace rtengine +{ + +namespace procparams +{ + +class ProcParams; + +class PartialProfile; + +} + +} struct GeneralParamsEdited { bool rank; diff --git a/rtgui/partialpastedlg.h b/rtgui/partialpastedlg.h index 8f909a2ab..4363016ae 100644 --- a/rtgui/partialpastedlg.h +++ b/rtgui/partialpastedlg.h @@ -16,11 +16,21 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _PARTIALPASTEDLG_ -#define _PARTIALPASTEDLG_ +#pragma once #include -#include "../rtengine/rtengine.h" + +namespace rtengine +{ +namespace procparams +{ + +class ProcParams; + + +} + +} struct ParamsEdited; @@ -161,6 +171,3 @@ public: void advancedToggled (); void locallabToggled (); }; - -#endif - diff --git a/rtgui/pathutils.cc b/rtgui/pathutils.cc index 71ff8b0b2..fc47a0e25 100644 --- a/rtgui/pathutils.cc +++ b/rtgui/pathutils.cc @@ -16,6 +16,8 @@ * along with RawTherapee. If not, see . */ +#include + #include "pathutils.h" diff --git a/rtgui/pathutils.h b/rtgui/pathutils.h index ed7d21984..482dfb82f 100644 --- a/rtgui/pathutils.h +++ b/rtgui/pathutils.h @@ -16,19 +16,9 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef __PATH_UTILS_ -#define __PATH_UTILS_ - -#include -#include -#include "../rtengine/rtengine.h" -#include "../rtengine/coord.h" -#include "rtimage.h" -#include -#include +#pragma once +#include // Removed from guiutils because used by rawtherapee-cli Glib::ustring removeExtension (const Glib::ustring& filename); Glib::ustring getExtension (const Glib::ustring& filename); - -#endif diff --git a/rtgui/pcvignette.h b/rtgui/pcvignette.h index ce41ab75f..da0e02dc6 100644 --- a/rtgui/pcvignette.h +++ b/rtgui/pcvignette.h @@ -1,14 +1,17 @@ /* * This file is part of RawTherapee. */ -#ifndef _PCVIGNETTE_H_ -#define _PCVIGNETTE_H_ +#pragma once #include + #include "adjuster.h" #include "toolpanel.h" -class PCVignette : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel +class PCVignette : + public ToolParamBlock, + public AdjusterListener, + public FoldableToolPanel { protected: @@ -30,5 +33,3 @@ public: void setAdjusterBehavior (bool strengthadd, bool featheradd, bool roundnessadd); void trimValues (rtengine::procparams::ProcParams* pp) override; }; - -#endif diff --git a/rtgui/perspective.h b/rtgui/perspective.h index 9b36ed24d..618ad32cf 100644 --- a/rtgui/perspective.h +++ b/rtgui/perspective.h @@ -16,14 +16,17 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _PERSPECTIVE_PANEL_H_ -#define _PERSPECTIVE_PANEL_H_ +#pragma once #include + #include "adjuster.h" #include "toolpanel.h" -class PerspCorrection : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel +class PerspCorrection : + public ToolParamBlock, + public AdjusterListener, + public FoldableToolPanel { protected: @@ -43,5 +46,3 @@ public: void setAdjusterBehavior (bool badd); void trimValues (rtengine::procparams::ProcParams* pp) override; }; - -#endif diff --git a/rtgui/placesbrowser.h b/rtgui/placesbrowser.h index 6325bdb45..78c94969f 100644 --- a/rtgui/placesbrowser.h +++ b/rtgui/placesbrowser.h @@ -16,14 +16,16 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _PLACESBROWSER_ -#define _PLACESBROWSER_ +#pragma once #include + #include + #include "multilangmgr.h" -class PlacesBrowser : public Gtk::VBox +class PlacesBrowser : + public Gtk::VBox { public: typedef sigc::slot DirSelectionSlot; @@ -84,7 +86,3 @@ inline void PlacesBrowser::setDirSelector (const PlacesBrowser::DirSelectionSlot { this->selectDir = selectDir; } - -#endif - - diff --git a/rtgui/pointermotionlistener.h b/rtgui/pointermotionlistener.h index 0a2931262..26ca994b0 100644 --- a/rtgui/pointermotionlistener.h +++ b/rtgui/pointermotionlistener.h @@ -16,8 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _POINTERMOTIONLISTENER_ -#define _POINTERMOTIONLISTENER_ +#pragma once class PointerMotionListener { @@ -26,7 +25,7 @@ protected: sigc::signal sig_cycle_hsv; public: - virtual ~PointerMotionListener() {} + virtual ~PointerMotionListener() = default; virtual void pointerMoved (bool validPos, const Glib::ustring &profile, const Glib::ustring &profileW, int x, int y, int r, int g, int b, bool isRaw = false) = 0; virtual void getRGBText (int r, int g, int b, Glib::ustring &sR, Glib::ustring &sG, Glib::ustring &sB, bool isRaw = false) { sR = "--"; sG = "--"; sB = "--"; } virtual void getHSVText (float h, float s, float v, Glib::ustring &sH, Glib::ustring &sS, Glib::ustring &sV) { sH = "--"; sS = "--"; sV = "--"; } @@ -41,5 +40,3 @@ public: return sig_cycle_hsv; } }; - -#endif diff --git a/rtgui/popupbutton.h b/rtgui/popupbutton.h index fb0b66e0d..87b1b73a6 100644 --- a/rtgui/popupbutton.h +++ b/rtgui/popupbutton.h @@ -18,13 +18,15 @@ * * Class created by Jean-Christophe FRISCH, aka 'Hombre' */ -#ifndef _POPUPBUTTON_ -#define _POPUPBUTTON_ +#pragma once #include + #include "popupcommon.h" -class PopUpButton : public Gtk::Button, public PopUpCommon +class PopUpButton : + public Gtk::Button, + public PopUpCommon { public: @@ -40,5 +42,3 @@ private: bool nextOnClicked; }; - -#endif diff --git a/rtgui/popupcommon.h b/rtgui/popupcommon.h index 44ad0886a..b4cf4d7e0 100644 --- a/rtgui/popupcommon.h +++ b/rtgui/popupcommon.h @@ -18,19 +18,22 @@ * * Class created by Jean-Christophe FRISCH, aka 'Hombre' */ -#ifndef _POPUPCOMMON_ -#define _POPUPCOMMON_ +#pragma once #include + #include + #include namespace Gtk { + class Grid; class Menu; class Button; class ImageMenuItem; + } typedef struct _GdkEventButton GdkEventButton; @@ -101,5 +104,3 @@ inline int PopUpCommon::getSelected () const { return posToIndex(selected); } - -#endif diff --git a/rtgui/popuptogglebutton.h b/rtgui/popuptogglebutton.h index b2949a0b8..a97c75fa2 100644 --- a/rtgui/popuptogglebutton.h +++ b/rtgui/popuptogglebutton.h @@ -18,13 +18,15 @@ * * Class created by Jean-Christophe FRISCH, aka 'Hombre' */ -#ifndef _POPUPTOGGLEBUTTON_ -#define _POPUPTOGGLEBUTTON_ +#pragma once #include + #include "popupcommon.h" -class PopUpToggleButton : public Gtk::ToggleButton, public PopUpCommon +class PopUpToggleButton : + public Gtk::ToggleButton, + public PopUpCommon { public: @@ -32,5 +34,3 @@ public: void show (); void set_tooltip_text (const Glib::ustring &text); }; - -#endif diff --git a/rtgui/pparamschangelistener.h b/rtgui/pparamschangelistener.h index 2c73ea3f6..56ac5f605 100644 --- a/rtgui/pparamschangelistener.h +++ b/rtgui/pparamschangelistener.h @@ -16,12 +16,26 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _PPARAMSCHANGELISTENER_ -#define _PPARAMSCHANGELISTENER_ +#pragma once -#include "../rtengine/rtengine.h" -#include -#include "paramsedited.h" +#include + +struct ParamsEdited; + +namespace rtengine +{ + +class ProcEvent; + +namespace procparams +{ + +class ProcParams; + + +} + +} class PParamsChangeListener { @@ -43,6 +57,3 @@ public: virtual void beginBatchPParamsChange(int numberOfEntries) = 0; virtual void endBatchPParamsChange() = 0; }; - -#endif - diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 29cf9eee1..24a350f15 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -24,8 +24,11 @@ #include "addsetids.h" #include "../rtengine/dfmanager.h" #include "../rtengine/ffmanager.h" +#include "../rtengine/iccstore.h" +#include "../rtengine/procparams.h" #include #include "rtimage.h" +#include "rtwindow.h" #ifdef _OPENMP #include #endif @@ -49,7 +52,6 @@ void placeSpinBox(Gtk::Container* where, Gtk::SpinButton* &spin, const std::stri } } -extern Options options; extern Glib::ustring argv0; Glib::RefPtr themecss; Glib::RefPtr fontcss; diff --git a/rtgui/preferences.h b/rtgui/preferences.h index 47512be9d..6f922bbfc 100644 --- a/rtgui/preferences.h +++ b/rtgui/preferences.h @@ -16,20 +16,27 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef __PREFERENCES_H__ -#define __PREFERENCES_H__ +#pragma once + +#include #include -#include "adjuster.h" -#include "options.h" -#include -#include "rtwindow.h" -#include "dynamicprofilepanel.h" -class Preferences : public Gtk::Dialog, public ProfileStoreListener +#include "adjuster.h" +#include "dynamicprofilepanel.h" +#include "options.h" +#include "../rtengine/profilestore.h" + +class RTWindow; +class Splash; + +class Preferences : + public Gtk::Dialog, + public ProfileStoreListener { - class ExtensionColumns : public Gtk::TreeModel::ColumnRecord + class ExtensionColumns : + public Gtk::TreeModel::ColumnRecord { public: Gtk::TreeModelColumn enabled; @@ -304,5 +311,3 @@ public: // void selectICCProfileDir (); // void selectMonitorProfile (); }; - -#endif diff --git a/rtgui/preprocess.h b/rtgui/preprocess.h index 015fa3650..3b337a450 100644 --- a/rtgui/preprocess.h +++ b/rtgui/preprocess.h @@ -16,17 +16,18 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _PREPROCESS_H_ -#define _PREPROCESS_H_ +#pragma once #include -//#include "adjuster.h" -#include "toolpanel.h" + #include "adjuster.h" #include "guiutils.h" -#include "../rtengine/rawimage.h" +#include "toolpanel.h" -class PreProcess : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel +class PreProcess : + public ToolParamBlock, + public AdjusterListener, + public FoldableToolPanel { protected: @@ -54,5 +55,3 @@ public: //void setAdjusterBehavior (bool linedenoiseadd, bool greenequiladd); //void trimValues (rtengine::procparams::ProcParams* pp); }; - -#endif diff --git a/rtgui/previewhandler.h b/rtgui/previewhandler.h index 7fe7b96f4..d9c91f6ad 100644 --- a/rtgui/previewhandler.h +++ b/rtgui/previewhandler.h @@ -16,19 +16,18 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _PREVIEWHANDLER_ -#define _PREVIEWHANDLER_ +#pragma once #include #include #include -#include "threadutils.h" #include "guiutils.h" +#include "threadutils.h" -#include "../rtengine/rtengine.h" #include "../rtengine/noncopyable.h" +#include "../rtengine/rtengine.h" class PreviewListener { @@ -86,5 +85,3 @@ public: Glib::RefPtr getRoughImage (int desiredW, int desiredH, double& zoom); rtengine::procparams::CropParams getCropParams (); }; - -#endif diff --git a/rtgui/previewloader.cc b/rtgui/previewloader.cc index 67de50113..a808e1f71 100644 --- a/rtgui/previewloader.cc +++ b/rtgui/previewloader.cc @@ -18,6 +18,8 @@ */ #include +#include "cachemanager.h" +#include "filebrowserentry.h" #include "previewloader.h" #include "guiutils.h" #include "threadutils.h" diff --git a/rtgui/previewloader.h b/rtgui/previewloader.h index 52dbee43c..9a74ee2eb 100644 --- a/rtgui/previewloader.h +++ b/rtgui/previewloader.h @@ -16,15 +16,15 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _PREVIEWLOADER_ -#define _PREVIEWLOADER_ +#pragma once #include -#include + +#include #include "../rtengine/noncopyable.h" -#include "filebrowserentry.h" +class FileBrowserEntry; class PreviewLoaderListener { @@ -94,5 +94,3 @@ private: * To use: \c previewLoader->start() , */ #define previewLoader PreviewLoader::getInstance() - -#endif diff --git a/rtgui/previewmodepanel.h b/rtgui/previewmodepanel.h index b43e8484c..98160a5e3 100644 --- a/rtgui/previewmodepanel.h +++ b/rtgui/previewmodepanel.h @@ -15,14 +15,16 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _PREVIEWMODEPANEL_ -#define _PREVIEWMODEPANEL_ +#pragma once #include -#include "adjuster.h"//dev + +#include "adjuster.h" class ImageArea; -class PreviewModePanel : public Gtk::HBox + +class PreviewModePanel : + public Gtk::HBox { protected: @@ -83,5 +85,3 @@ public: int GetbackColor(); }; - -#endif diff --git a/rtgui/previewwindow.cc b/rtgui/previewwindow.cc index 54d785313..6268fe3d2 100644 --- a/rtgui/previewwindow.cc +++ b/rtgui/previewwindow.cc @@ -20,6 +20,8 @@ #include "guiutils.h" #include "imagearea.h" #include "cursormanager.h" +#include "options.h" +#include "rtscalable.h" #include "../rtengine/procparams.h" @@ -88,7 +90,7 @@ void PreviewWindow::updatePreviewImage () cc->fill(); if (previewHandler->getCropParams().enabled) { - rtengine::CropParams cparams = previewHandler->getCropParams(); + rtengine::procparams::CropParams cparams = previewHandler->getCropParams(); switch (options.cropGuides) { case Options::CROP_GUIDE_NONE: cparams.guide = "None"; diff --git a/rtgui/previewwindow.h b/rtgui/previewwindow.h index 64aa84afd..245f4a394 100644 --- a/rtgui/previewwindow.h +++ b/rtgui/previewwindow.h @@ -16,16 +16,19 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _PREVIEWWINDOW_ -#define _PREVIEWWINDOW_ +#pragma once #include -#include "previewhandler.h" -#include "cropwindow.h" -#include "guiutils.h" -#include "cursormanager.h" -class PreviewWindow : public Gtk::DrawingArea, public PreviewListener, public CropWindowListener +#include "cropwindow.h" +#include "cursormanager.h" +#include "guiutils.h" +#include "previewhandler.h" + +class PreviewWindow : + public Gtk::DrawingArea, + public PreviewListener, + public CropWindowListener { private: @@ -71,5 +74,3 @@ public: void cropZoomChanged(CropWindow* w) override; void initialImageArrived() override; }; - -#endif diff --git a/rtgui/profilechangelistener.h b/rtgui/profilechangelistener.h index fa7e1b877..58c565393 100644 --- a/rtgui/profilechangelistener.h +++ b/rtgui/profilechangelistener.h @@ -16,19 +16,19 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _PROFILECHANGELISTENER_ -#define _PROFILECHANGELISTENER_ +#pragma once #include -#include "../rtengine/rtengine.h" namespace rtengine { +class ProcEvent; namespace procparams { +class ProcParams; class PartialProfile; } @@ -48,6 +48,3 @@ public: ) = 0; virtual void setDefaults(const rtengine::procparams::ProcParams* defparams) = 0; }; - -#endif - diff --git a/rtgui/profilepanel.cc b/rtgui/profilepanel.cc index 6687bc64e..91ea1bd2d 100644 --- a/rtgui/profilepanel.cc +++ b/rtgui/profilepanel.cc @@ -22,9 +22,12 @@ #include "multilangmgr.h" #include "options.h" #include "profilestorecombobox.h" +#include "paramsedited.h" +#include "pathutils.h" #include "rtimage.h" #include "../rtengine/procparams.h" +#include "../rtengine/procevents.h" using namespace rtengine; using namespace rtengine::procparams; diff --git a/rtgui/profilepanel.h b/rtgui/profilepanel.h index c5717d523..b3c968682 100644 --- a/rtgui/profilepanel.h +++ b/rtgui/profilepanel.h @@ -16,21 +16,44 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _PROFILEPANEL_ -#define _PROFILEPANEL_ +#pragma once + +#include #include -#include -#include "../rtengine/rtengine.h" + +#include "guiutils.h" +#include "partialpastedlg.h" #include "pparamschangelistener.h" #include "profilechangelistener.h" -#include "partialpastedlg.h" -#include "guiutils.h" -#include "profilestorecombobox.h" -#include "rtimage.h" + +#include "../rtengine/profilestore.h" #include "../rtengine/noncopyable.h" -class ProfilePanel : public Gtk::Grid, public PParamsChangeListener, public ProfileStoreListener, public rtengine::NonCopyable +class ProfileStoreComboBox; + +namespace rtengine +{ + +class ProcEvent; + +namespace procparams +{ + +class ProcParams; + +class PartialProfile; + +} + +} +class RTImage; + +class ProfilePanel : + public Gtk::Grid, + public PParamsChangeListener, + public ProfileStoreListener, + public rtengine::NonCopyable { private: @@ -106,5 +129,3 @@ public: void selection_changed (); void writeOptions(); }; - -#endif diff --git a/rtgui/profilestorecombobox.h b/rtgui/profilestorecombobox.h index 5d04813d6..bfd713235 100644 --- a/rtgui/profilestorecombobox.h +++ b/rtgui/profilestorecombobox.h @@ -16,21 +16,17 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _PROFILESTORECOMBOBOX_ -#define _PROFILESTORECOMBOBOX_ +#pragma once #include #include -#include -#include "../rtengine/rtengine.h" -#include "../rtengine/profilestore.h" +#include -#include "threadutils.h" -#include "paramsedited.h" #include "guiutils.h" +#include "threadutils.h" - +class ProfileStoreEntry; /** * @brief subclass of Gtk::Label with extra fields for Combobox and Menu, to link with a ProfileStoreEntry */ @@ -92,5 +88,3 @@ public: Gtk::TreeIter addRow (const ProfileStoreEntry *profileStoreEntry); void deleteRow (const ProfileStoreEntry *profileStoreEntry); }; - -#endif diff --git a/rtgui/progressconnector.h b/rtgui/progressconnector.h index 012039ba6..eb6eb3a66 100644 --- a/rtgui/progressconnector.h +++ b/rtgui/progressconnector.h @@ -16,13 +16,15 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _PROGRESSCONNECTOR_ -#define _PROGRESSCONNECTOR_ +#pragma once + +#include #include -#include -#include "../rtengine/rtengine.h" + #include "guiutils.h" +#include "multilangmgr.h" +#include "../rtengine/rtengine.h" #undef THREAD_PRIORITY_NORMAL @@ -109,4 +111,3 @@ public: return retval; } }; -#endif diff --git a/rtgui/prsharpening.h b/rtgui/prsharpening.h index 9d37fa8ba..54f2f8063 100644 --- a/rtgui/prsharpening.h +++ b/rtgui/prsharpening.h @@ -16,15 +16,19 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _PRSHARPENING_H_ -#define _PRSHARPENING_H_ +#pragma once #include + #include "adjuster.h" #include "thresholdadjuster.h" #include "toolpanel.h" -class PrSharpening : public ToolParamBlock, public ThresholdAdjusterListener, public AdjusterListener, public FoldableToolPanel +class PrSharpening : + public ToolParamBlock, + public ThresholdAdjusterListener, + public AdjusterListener, + public FoldableToolPanel { protected: @@ -79,5 +83,3 @@ public: void setAdjusterBehavior (bool contrastadd, bool radiusadd, bool amountadd, bool dampingadd, bool iteradd, bool edgetoladd, bool haloctrladd); void trimValues (rtengine::procparams::ProcParams* pp) override; }; - -#endif diff --git a/rtgui/rawcacorrection.h b/rtgui/rawcacorrection.h index d3874d9f9..60c705b19 100644 --- a/rtgui/rawcacorrection.h +++ b/rtgui/rawcacorrection.h @@ -16,15 +16,19 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _RAWCACORRECTION_H_ -#define _RAWCACORRECTION_H_ +#pragma once #include + #include "adjuster.h" #include "checkbox.h" #include "toolpanel.h" -class RAWCACorr : public ToolParamBlock, public AdjusterListener, public CheckBoxListener, public FoldableToolPanel +class RAWCACorr : + public ToolParamBlock, + public AdjusterListener, + public CheckBoxListener, + public FoldableToolPanel { protected: @@ -52,5 +56,3 @@ public: void adjusterChanged (Adjuster* a, double newval) override; void checkBoxToggled (CheckBox* c, CheckValue newval) override; }; - -#endif diff --git a/rtgui/rawexposure.h b/rtgui/rawexposure.h index 1dafd4d64..75b3a9330 100644 --- a/rtgui/rawexposure.h +++ b/rtgui/rawexposure.h @@ -16,15 +16,17 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _RAWEXPOSURE_H_ -#define _RAWEXPOSURE_H_ +#pragma once #include + #include "adjuster.h" #include "toolpanel.h" -#include "../rtengine/rawimage.h" -class RAWExposure : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel +class RAWExposure : + public ToolParamBlock, + public AdjusterListener, + public FoldableToolPanel { protected: @@ -44,5 +46,3 @@ public: void setAdjusterBehavior (bool pexposadd); void trimValues (rtengine::procparams::ProcParams* pp) override; }; - -#endif diff --git a/rtgui/recentbrowser.h b/rtgui/recentbrowser.h index 1ba2c17f4..68a7962f9 100644 --- a/rtgui/recentbrowser.h +++ b/rtgui/recentbrowser.h @@ -16,14 +16,15 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _RECENTBROWSER_ -#define _RECENTBROWSER_ +#pragma once #include -#include "multilangmgr.h" -#include "guiutils.h" -class RecentBrowser : public Gtk::VBox +#include "guiutils.h" +#include "multilangmgr.h" + +class RecentBrowser : + public Gtk::VBox { public: typedef sigc::slot DirSelectionSlot; @@ -47,7 +48,3 @@ inline void RecentBrowser::setDirSelector (const RecentBrowser::DirSelectionSlot { this->selectDir = selectDir; } - -#endif - - diff --git a/rtgui/renamedlg.cc b/rtgui/renamedlg.cc index 8f55b3653..8908d3419 100644 --- a/rtgui/renamedlg.cc +++ b/rtgui/renamedlg.cc @@ -17,8 +17,8 @@ * along with RawTherapee. If not, see . */ #include "renamedlg.h" +#include "cacheimagedata.h" #include "multilangmgr.h" -#include "options.h" #include "rtimage.h" RenameDialog::RenameDialog (Gtk::Window* parent) diff --git a/rtgui/renamedlg.h b/rtgui/renamedlg.h index a3e16ad0a..f9447fbac 100644 --- a/rtgui/renamedlg.h +++ b/rtgui/renamedlg.h @@ -16,16 +16,18 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _RENAMEDLG_ -#define _RENAMEDLG_ +#pragma once #include -#include "cacheimagedata.h" + #include "guiutils.h" #define RESPONSE_ALL 100 -class RenameDialog : public Gtk::Dialog +class CacheImageData; + +class RenameDialog : + public Gtk::Dialog { protected: @@ -43,6 +45,3 @@ public: Glib::ustring getNewName (); }; - -#endif - diff --git a/rtgui/resize.cc b/rtgui/resize.cc index 456b924ef..a65875426 100644 --- a/rtgui/resize.cc +++ b/rtgui/resize.cc @@ -16,6 +16,9 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ + +#include + #include "resize.h" #include "eventmapper.h" diff --git a/rtgui/resize.h b/rtgui/resize.h index 1d38ae674..41b54509e 100644 --- a/rtgui/resize.h +++ b/rtgui/resize.h @@ -16,14 +16,14 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _RESIZE_H_ -#define _RESIZE_H_ +#pragma once #include + #include "adjuster.h" #include "guiutils.h" -#include "toolpanel.h" #include "guiutils.h" +#include "toolpanel.h" class Resize final : public ToolParamBlock, @@ -86,5 +86,3 @@ private: static constexpr int MAX_SCALE = 16; // 16 to match the main preview max scale of 1600% }; - -#endif diff --git a/rtgui/retinex.cc b/rtgui/retinex.cc index e074d7e9c..33f1c2f6a 100644 --- a/rtgui/retinex.cc +++ b/rtgui/retinex.cc @@ -4,6 +4,8 @@ #include "retinex.h" #include "mycurve.h" #include "rtimage.h" +#include "options.h" +#include "../rtengine/color.h" using namespace rtengine; using namespace rtengine::procparams; diff --git a/rtgui/retinex.h b/rtgui/retinex.h index 1be511cb3..c82c01d3e 100644 --- a/rtgui/retinex.h +++ b/rtgui/retinex.h @@ -1,21 +1,25 @@ /* * This file is part of RawTherapee. */ -#ifndef _RETINEX_H_ -#define _RETINEX_H_ +#pragma once #include + #include "adjuster.h" -#include "toolpanel.h" -#include "guiutils.h" +#include "colorprovider.h" #include "curveeditor.h" #include "curveeditorgroup.h" +#include "guiutils.h" #include "thresholdadjuster.h" -#include "colorprovider.h" - -class Retinex : public ToolParamBlock, public FoldableToolPanel, public rtengine::RetinexListener, public CurveListener, - public AdjusterListener, public ColorProvider +#include "toolpanel.h" +class Retinex : + public ToolParamBlock, + public FoldableToolPanel, + public rtengine::RetinexListener, + public CurveListener, + public AdjusterListener, + public ColorProvider { private: IdleRegister idle_register; @@ -141,5 +145,3 @@ private: void foldAllButMe (GdkEventButton* event, MyExpander *expander); }; - -#endif diff --git a/rtgui/rgbcurves.cc b/rtgui/rgbcurves.cc index 2350783e0..7af6cab97 100644 --- a/rtgui/rgbcurves.cc +++ b/rtgui/rgbcurves.cc @@ -18,6 +18,8 @@ */ #include "rgbcurves.h" +#include "options.h" + #include "../rtengine/procparams.h" using namespace rtengine; diff --git a/rtgui/rgbcurves.h b/rtgui/rgbcurves.h index e62fdd7c7..b73aa22b7 100644 --- a/rtgui/rgbcurves.h +++ b/rtgui/rgbcurves.h @@ -16,17 +16,21 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _RGBCURVES_H_ -#define _RGBCURVES_H_ +#pragma once #include + #include "adjuster.h" -#include "toolpanel.h" +#include "colorprovider.h" #include "curveeditor.h" #include "curveeditorgroup.h" -#include "colorprovider.h" +#include "toolpanel.h" -class RGBCurves : public ToolParamBlock, public FoldableToolPanel, public CurveListener, public ColorProvider +class RGBCurves : + public ToolParamBlock, + public FoldableToolPanel, + public CurveListener, + public ColorProvider { protected: @@ -66,5 +70,3 @@ public: void lumamodeChanged (); void enabledChanged() override; }; - -#endif diff --git a/rtgui/rotate.h b/rtgui/rotate.h index bd0613609..5730fd481 100644 --- a/rtgui/rotate.h +++ b/rtgui/rotate.h @@ -16,15 +16,18 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _ROTATE_H_ -#define _ROTATE_H_ +#pragma once #include -#include "adjuster.h" -#include "toolpanel.h" -#include "lensgeomlistener.h" -class Rotate : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel +#include "adjuster.h" +#include "lensgeomlistener.h" +#include "toolpanel.h" + +class Rotate : + public ToolParamBlock, + public AdjusterListener, + public FoldableToolPanel { protected: @@ -52,5 +55,3 @@ public: rlistener = l; } }; - -#endif diff --git a/rtgui/rtimage.cc b/rtgui/rtimage.cc index e35a6d164..44078ed3b 100644 --- a/rtgui/rtimage.cc +++ b/rtgui/rtimage.cc @@ -20,9 +20,10 @@ #include "rtimage.h" +#include #include -#include "options.h" +#include "../rtengine/settings.h" namespace { @@ -214,7 +215,7 @@ Cairo::RefPtr RTImage::createImgSurfFromFile (const Glib::u } */ } catch (const Glib::Exception& exception) { - if (options.rtSettings.verbose) { + if (rtengine::settings->verbose) { std::cerr << "Failed to load image \"" << fileName << "\": " << exception.what() << std::endl; } } diff --git a/rtgui/rtscalable.cc b/rtgui/rtscalable.cc index b37f2276f..a48a95fd2 100644 --- a/rtgui/rtscalable.cc +++ b/rtgui/rtscalable.cc @@ -20,16 +20,17 @@ #include "rtscalable.h" #include #include -#include +#include #include #include + +#include "../rtengine/rt_math.h" #include "options.h" double RTScalable::dpi = 0.; int RTScalable::scale = 0; extern Glib::ustring argv0; -extern Options options; extern unsigned char initialGdkScale; extern float fontScale; Gtk::TextDirection RTScalable::direction = Gtk::TextDirection::TEXT_DIR_NONE; @@ -101,7 +102,7 @@ void RTScalable::deleteDir(const Glib::ustring& path) error |= g_remove (Glib::build_filename (path, *entry).c_str()); } - if (error != 0 && options.rtSettings.verbose) { + if (error != 0 && rtengine::settings->verbose) { std::cerr << "Failed to delete all entries in '" << path << "': " << g_strerror(errno) << std::endl; } diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index 31aecef29..703ddd96a 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -19,12 +19,19 @@ #include #include "rtwindow.h" -#include "options.h" +#include "cachemanager.h" #include "preferences.h" #include "iccprofilecreator.h" #include "cursormanager.h" +#include "editwindow.h" #include "rtimage.h" +#include "thumbnail.h" #include "whitebalance.h" +#include "../rtengine/settings.h" +#include "batchqueuepanel.h" +#include "editorpanel.h" +#include "filepanel.h" +#include "filmsimulation.h" float fontScale = 1.f; Glib::RefPtr cssForced; @@ -170,7 +177,7 @@ RTWindow::RTWindow () if (options.pseudoHiDPISupport) { fontScale = options.fontSize / (float)RTScalable::baseFontSize; } - if (options.rtSettings.verbose) { + if (rtengine::settings->verbose) { printf("\"Non-Default\" font size(%d) * scale(%d) / fontScale(%.3f)\n", options.fontSize, (int)initialGdkScale, fontScale); } } else { @@ -200,14 +207,14 @@ RTWindow::RTWindow () } if ((int)initialGdkScale > 1 || pt != RTScalable::baseFontSize) { css = Glib::ustring::compose ("* { font-size: %1pt}", pt * (int)initialGdkScale); - if (options.rtSettings.verbose) { + if (rtengine::settings->verbose) { printf("\"Default\" font size(%d) * scale(%d) / fontScale(%.3f)\n", pt, (int)initialGdkScale, fontScale); } } } } if (!css.empty()) { - if (options.rtSettings.verbose) { + if (rtengine::settings->verbose) { printf("CSS:\n%s\n\n", css.c_str()); } try { @@ -456,10 +463,9 @@ RTWindow::~RTWindow() g_object_unref (osxApp); #endif - if (fpanel) { - delete fpanel; - } - + delete fpanel; + delete iFullscreen; + delete iFullscreen_exit; RTImage::cleanup(); } @@ -652,8 +658,8 @@ void RTWindow::remEditorPanel (EditorPanel* ep) set_title_decorated (""); } else { - EditorPanel* ep = static_cast (mainNB->get_nth_page (mainNB->get_current_page())); - set_title_decorated (ep->getFileName()); + const EditorPanel* lep = static_cast (mainNB->get_nth_page (mainNB->get_current_page())); + set_title_decorated (lep->getFileName()); } // TODO: ask what to do: close & apply, close & apply selection, close & revert, cancel @@ -1167,3 +1173,8 @@ void RTWindow::createSetmEditor() mainNB->append_page (*epanel, *editorLabelGrid); } + +bool RTWindow::isSingleTabMode() const +{ + return !options.tabbedUI && ! (options.multiDisplayMode > 0); +} diff --git a/rtgui/rtwindow.h b/rtgui/rtwindow.h index 103c610c1..29a833871 100644 --- a/rtgui/rtwindow.h +++ b/rtgui/rtwindow.h @@ -15,23 +15,29 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _RTWINDOW_ -#define _RTWINDOW_ +#pragma once + +#include #include -#include "filepanel.h" -#include "editorpanel.h" -#include "batchqueuepanel.h" -#include -#include "progressconnector.h" -#include "editwindow.h" -#include "splash.h" + #if defined(__APPLE__) #include #endif + +#include "progressconnector.h" +#include "splash.h" + #include "../rtengine/noncopyable.h" -class RTWindow : public Gtk::Window, public rtengine::ProgressListener, public rtengine::NonCopyable +class BatchQueueEntry; +class BatchQueuePanel; +class EditorPanel; +class FilePanel; +class RTWindow : + public Gtk::Window, + public rtengine::ProgressListener, + public rtengine::NonCopyable { private: @@ -49,10 +55,7 @@ private: Gtk::Image *iFullscreen, *iFullscreen_exit; - bool isSingleTabMode() - { - return !options.tabbedUI && ! (options.multiDisplayMode > 0); - }; + bool isSingleTabMode() const; bool on_expose_event_epanel (GdkEventExpose* event); bool on_expose_event_fpanel (GdkEventExpose* event); @@ -126,5 +129,3 @@ public: void writeToolExpandedStatus (std::vector &tpOpen); }; - -#endif diff --git a/rtgui/saveasdlg.cc b/rtgui/saveasdlg.cc index 1b61d7d3d..ebf2f5b4a 100644 --- a/rtgui/saveasdlg.cc +++ b/rtgui/saveasdlg.cc @@ -22,12 +22,11 @@ #include "guiutils.h" #include "multilangmgr.h" +#include "pathutils.h" #include "rtimage.h" #include "../rtengine/utils.h" -extern Options options; - namespace { diff --git a/rtgui/saveasdlg.h b/rtgui/saveasdlg.h index dd120337d..e4567f69b 100644 --- a/rtgui/saveasdlg.h +++ b/rtgui/saveasdlg.h @@ -16,15 +16,16 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _SAVEASDLG_ -#define _SAVEASDLG_ +#pragma once #include + #include "adjuster.h" #include "saveformatpanel.h" -#include "options.h" -class SaveAsDialog : public Gtk::Dialog, public FormatChangeListener +class SaveAsDialog : + public Gtk::Dialog, + public FormatChangeListener { protected: @@ -65,6 +66,3 @@ public: void formatChanged(const Glib::ustring& format) override; bool keyPressed (GdkEventKey* event); }; - - -#endif diff --git a/rtgui/saveformatpanel.h b/rtgui/saveformatpanel.h index ab5ffef3e..af9baa58a 100644 --- a/rtgui/saveformatpanel.h +++ b/rtgui/saveformatpanel.h @@ -16,13 +16,14 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef __SAVEFORMATPANEL_H__ -#define __SAVEFORMATPANEL_H__ +#pragma once #include + #include "adjuster.h" #include "guiutils.h" #include "options.h" + #include "../rtengine/noncopyable.h" class FormatChangeListener @@ -62,5 +63,3 @@ public: void formatChanged (); void adjusterChanged (Adjuster* a, double newval) override; }; - -#endif diff --git a/rtgui/sensorbayer.h b/rtgui/sensorbayer.h index 2d68411ce..3d6018181 100644 --- a/rtgui/sensorbayer.h +++ b/rtgui/sensorbayer.h @@ -16,13 +16,15 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _SENSORBAYER_H_ -#define _SENSORBAYER_H_ +#pragma once #include + #include "toolpanel.h" -class SensorBayer : public ToolParamBlock, public FoldableToolPanel +class SensorBayer : + public ToolParamBlock, + public FoldableToolPanel { protected: @@ -37,5 +39,3 @@ public: return packBox; } }; - -#endif diff --git a/rtgui/sensorxtrans.h b/rtgui/sensorxtrans.h index fbf71b401..c1cacb2f4 100644 --- a/rtgui/sensorxtrans.h +++ b/rtgui/sensorxtrans.h @@ -16,13 +16,15 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _SENSORXTRANS_H_ -#define _SENSORXTRANS_H_ +#pragma once #include + #include "toolpanel.h" -class SensorXTrans : public ToolParamBlock, public FoldableToolPanel +class SensorXTrans : + public ToolParamBlock, + public FoldableToolPanel { protected: @@ -37,5 +39,3 @@ public: return packBox; } }; - -#endif diff --git a/rtgui/shadowshighlights.h b/rtgui/shadowshighlights.h index d675f40d6..4f3ee7577 100644 --- a/rtgui/shadowshighlights.h +++ b/rtgui/shadowshighlights.h @@ -16,14 +16,17 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _SHADOWSHIGHLIGHTS_H_ -#define _SHADOWSHIGHLIGHTS_H_ +#pragma once #include + #include "adjuster.h" #include "toolpanel.h" -class ShadowsHighlights : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel +class ShadowsHighlights : + public ToolParamBlock, + public AdjusterListener, + public FoldableToolPanel { protected: @@ -53,5 +56,3 @@ public: void colorspaceChanged(); }; - -#endif diff --git a/rtgui/sharpenedge.h b/rtgui/sharpenedge.h index b136d8e5e..46a528153 100644 --- a/rtgui/sharpenedge.h +++ b/rtgui/sharpenedge.h @@ -21,14 +21,17 @@ * * */ -#ifndef _SHARPENEDGE_H_ -#define _SHARPENEDGE_H_ +#pragma once #include + #include "adjuster.h" #include "toolpanel.h" -class SharpenEdge : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel +class SharpenEdge : + public ToolParamBlock, + public AdjusterListener, + public FoldableToolPanel { protected: @@ -56,5 +59,3 @@ public: void chanthree_toggled (); }; - -#endif diff --git a/rtgui/sharpening.h b/rtgui/sharpening.h index ac846a2b6..e922e82c7 100644 --- a/rtgui/sharpening.h +++ b/rtgui/sharpening.h @@ -16,15 +16,19 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _SHARPENING_H_ -#define _SHARPENING_H_ +#pragma once #include + #include "adjuster.h" #include "thresholdadjuster.h" #include "toolpanel.h" -class Sharpening : public ToolParamBlock, public ThresholdAdjusterListener, public AdjusterListener, public FoldableToolPanel +class Sharpening : + public ToolParamBlock, + public ThresholdAdjusterListener, + public AdjusterListener, + public FoldableToolPanel { protected: @@ -82,5 +86,3 @@ public: void setAdjusterBehavior (bool contrastadd, bool radiusadd, bool amountadd, bool dampingadd, bool iteradd, bool edgetoladd, bool haloctrladd); void trimValues (rtengine::procparams::ProcParams* pp) override; }; - -#endif diff --git a/rtgui/sharpenmicro.h b/rtgui/sharpenmicro.h index 7c292413b..3120e6e7b 100644 --- a/rtgui/sharpenmicro.h +++ b/rtgui/sharpenmicro.h @@ -21,14 +21,17 @@ * * */ -#ifndef _SHARPENMICRO_H_ -#define _SHARPENMICRO_H_ +#pragma once #include + #include "adjuster.h" #include "toolpanel.h" -class SharpenMicro : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel +class SharpenMicro : + public ToolParamBlock, + public AdjusterListener, + public FoldableToolPanel { protected: @@ -60,5 +63,3 @@ public: }; - -#endif diff --git a/rtgui/shcselector.cc b/rtgui/shcselector.cc index 6137c3ec8..e8aca4071 100644 --- a/rtgui/shcselector.cc +++ b/rtgui/shcselector.cc @@ -17,9 +17,12 @@ * along with RawTherapee. If not, see . */ +#include + #include "shcselector.h" #include "multilangmgr.h" #include "mycurve.h" +#include "rtscalable.h" SHCSelector::SHCSelector() : movingPosition(-1), tmpX(0.0), tmpPos(0.0), wslider(0.0), cl(nullptr), coloredBar(RTO_Left2Right) { diff --git a/rtgui/shcselector.h b/rtgui/shcselector.h index d3ef2adb8..5c4421e0a 100644 --- a/rtgui/shcselector.h +++ b/rtgui/shcselector.h @@ -16,10 +16,10 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _SHCSELECTOR_ -#define _SHCSELECTOR_ +#pragma once #include + #include "coloredbar.h" class SHCListener @@ -82,6 +82,3 @@ public: bool reset (); void refresh(); }; - -#endif - diff --git a/rtgui/soundman.h b/rtgui/soundman.h index 6d065c87a..5eb6883e0 100644 --- a/rtgui/soundman.h +++ b/rtgui/soundman.h @@ -17,13 +17,13 @@ * along with RawTherapee. If not, see . * */ - -#ifndef _SOUNDMAN_ -#define _SOUNDMAN_ +#pragma once namespace Glib { + class ustring; + } class SoundManager @@ -32,5 +32,3 @@ public: static void init(); static void playSoundAsync(const Glib::ustring &sound); }; - -#endif diff --git a/rtgui/splash.h b/rtgui/splash.h index 29dbb62cf..363c51489 100644 --- a/rtgui/splash.h +++ b/rtgui/splash.h @@ -16,12 +16,12 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef __SPLASH__ -#define __SPLASH__ +#pragma once #include -class SplashImage : public Gtk::DrawingArea +class SplashImage : + public Gtk::DrawingArea { private: @@ -59,5 +59,3 @@ public: //virtual bool on_button_release_event (GdkEventButton* event); void closePressed(); }; - -#endif diff --git a/rtgui/threadutils.h b/rtgui/threadutils.h index f8107d74c..eae4a9ad2 100644 --- a/rtgui/threadutils.h +++ b/rtgui/threadutils.h @@ -16,8 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _THREADUTILS_ -#define _THREADUTILS_ +#pragma once // Uncomment this if you want to bypass the CMakeList options and force the values, but do not commit! //#undef TRACE_MYRWMUTEX @@ -307,5 +306,3 @@ inline MyWriterLock::~MyWriterLock () #define MYREADERLOCK_RELEASE(ln) ln.release(); #define MYWRITERLOCK_RELEASE(ln) ln.release(); #endif - -#endif /* _THREADUTILS_ */ diff --git a/rtgui/thresholdadjuster.h b/rtgui/thresholdadjuster.h index ea3822875..b28f68dee 100644 --- a/rtgui/thresholdadjuster.h +++ b/rtgui/thresholdadjuster.h @@ -16,10 +16,10 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _THRESHOLDADJUSTER_H_ -#define _THRESHOLDADJUSTER_H_ +#pragma once #include + #include "editedstate.h" #include "guiutils.h" #include "thresholdselector.h" @@ -160,5 +160,3 @@ public: // this set_tooltip_text method is to set_tooltip_markup, and text can contain markups void set_tooltip_text(const Glib::ustring& text); }; - -#endif diff --git a/rtgui/thresholdselector.cc b/rtgui/thresholdselector.cc index b44425be4..35d08279c 100644 --- a/rtgui/thresholdselector.cc +++ b/rtgui/thresholdselector.cc @@ -24,6 +24,7 @@ #include "multilangmgr.h" #include "mycurve.h" +#include "rtscalable.h" #include "../rtengine/procparams.h" diff --git a/rtgui/thresholdselector.h b/rtgui/thresholdselector.h index 6b9dda3d0..f948b56ad 100644 --- a/rtgui/thresholdselector.h +++ b/rtgui/thresholdselector.h @@ -16,14 +16,15 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _THRESHOLDSELECTOR_ -#define _THRESHOLDSELECTOR_ +#pragma once -#include "guiutils.h" -#include "../rtengine/procparams.h" -#include "coloredbar.h" #include +#include "coloredbar.h" +#include "guiutils.h" + +#include "../rtengine/procparams.h" + class ThresholdSelector; /* @@ -245,6 +246,3 @@ inline void ThresholdSelector::getPositions (Glib::ustring& botto bottomRight = Glib::ustring::format(std::fixed, std::setprecision(precisionBottom), shapePositionValue(TS_BOTTOMRIGHT)); topRight = Glib::ustring::format(std::fixed, std::setprecision(precisionTop), shapePositionValue(TS_TOPRIGHT)); } - -#endif - diff --git a/rtgui/thumbbrowserbase.cc b/rtgui/thumbbrowserbase.cc index adf451f05..9832b5730 100644 --- a/rtgui/thumbbrowserbase.cc +++ b/rtgui/thumbbrowserbase.cc @@ -16,13 +16,13 @@ */ #include -#include +#include #include "multilangmgr.h" #include "options.h" +#include "rtscalable.h" #include "thumbbrowserbase.h" -#include "../rtengine/mytime.h" #include "../rtengine/rt_math.h" using namespace std; diff --git a/rtgui/thumbbrowserbase.h b/rtgui/thumbbrowserbase.h index 890c37c87..a5c51cf5f 100644 --- a/rtgui/thumbbrowserbase.h +++ b/rtgui/thumbbrowserbase.h @@ -16,23 +16,26 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _THUMBNAILBROWSERBASE_ -#define _THUMBNAILBROWSERBASE_ +#pragma once + +#include #include -#include "thumbbrowserentrybase.h" -#include -#include "options.h" + #include "guiutils.h" #include "inspector.h" +#include "options.h" +#include "thumbbrowserentrybase.h" /* * Class handling the list of ThumbBrowserEntry objects and their position in it's allocated space */ -class ThumbBrowserBase : public Gtk::Grid +class ThumbBrowserBase : + public Gtk::Grid { - class Internal : public Gtk::DrawingArea + class Internal : + public Gtk::DrawingArea { //Cairo::RefPtr cc; int ofsX, ofsY; @@ -253,5 +256,3 @@ public: } }; - -#endif diff --git a/rtgui/thumbbrowserentrybase.cc b/rtgui/thumbbrowserentrybase.cc index 9d74fbd79..12059c72e 100644 --- a/rtgui/thumbbrowserentrybase.cc +++ b/rtgui/thumbbrowserentrybase.cc @@ -21,8 +21,6 @@ #include "options.h" #include "thumbbrowserbase.h" -#include "../rtengine/mytime.h" - namespace { diff --git a/rtgui/thumbbrowserentrybase.h b/rtgui/thumbbrowserentrybase.h index 5f018eefd..dbc6cf73e 100644 --- a/rtgui/thumbbrowserentrybase.h +++ b/rtgui/thumbbrowserentrybase.h @@ -26,8 +26,10 @@ #include "guiutils.h" #include "lwbuttonset.h" #include "threadutils.h" -#include "thumbnail.h" +#include "../rtengine/coord2d.h" + +class Thumbnail; class ThumbBrowserBase; class ThumbBrowserEntryBase { diff --git a/rtgui/thumbimageupdater.cc b/rtgui/thumbimageupdater.cc index 182eba704..bf230fe63 100644 --- a/rtgui/thumbimageupdater.cc +++ b/rtgui/thumbimageupdater.cc @@ -26,6 +26,7 @@ #include "guiutils.h" #include "threadutils.h" +#include "thumbnail.h" #include "../rtengine/procparams.h" diff --git a/rtgui/thumbimageupdater.h b/rtgui/thumbimageupdater.h index 0e46b11d7..cdf65bd62 100644 --- a/rtgui/thumbimageupdater.h +++ b/rtgui/thumbimageupdater.h @@ -16,17 +16,26 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _THUMBIMAGEUPDATER_ -#define _THUMBIMAGEUPDATER_ +#pragma once -#include #include -#include "../rtengine/rtengine.h" -#include "../rtengine/noncopyable.h" - #include "thumbbrowserentrybase.h" +#include "../rtengine/noncopyable.h" + +namespace rtengine +{ + class IImage8; + +namespace procparams +{ + + struct CropParams; + +} + +} class ThumbImageUpdateListener { public: @@ -101,5 +110,3 @@ private: * To use: \c thumbImageUpdater->start() , */ #define thumbImageUpdater ThumbImageUpdater::getInstance() - -#endif diff --git a/rtgui/thumbnail.cc b/rtgui/thumbnail.cc index e82f4f7fd..c151ca916 100644 --- a/rtgui/thumbnail.cc +++ b/rtgui/thumbnail.cc @@ -15,25 +15,33 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ +#ifdef WIN32 +#include +#endif + +#include "cachemanager.h" #include "multilangmgr.h" #include "thumbnail.h" #include #include -#include "options.h" -#include "../rtengine/mytime.h" #include #include -#include +#include "../rtengine/colortemp.h" #include "../rtengine/imagedata.h" #include "../rtengine/procparams.h" +#include "../rtengine/rtthumbnail.h" #include #include "../rtengine/dynamicprofile.h" +#include "../rtengine/profilestore.h" +#include "../rtengine/settings.h" +#include "../rtexif/rtexif.h" #include "guiutils.h" #include "batchqueue.h" #include "extprog.h" -#include "profilestorecombobox.h" #include "md5helper.h" +#include "pathutils.h" +#include "paramsedited.h" #include "procparamchangers.h" using namespace rtengine::procparams; @@ -300,7 +308,7 @@ rtengine::procparams::ProcParams* Thumbnail::createProcParamsForUpdate(bool retu // For the filename etc. do NOT use streams, since they are not UTF8 safe Glib::ustring cmdLine = options.CPBPath + Glib::ustring(" \"") + tmpFileName + Glib::ustring("\""); - if (options.rtSettings.verbose) { + if (rtengine::settings->verbose) { printf("Custom profile builder's command line: %s\n", Glib::ustring(cmdLine).c_str()); } @@ -1152,3 +1160,48 @@ bool Thumbnail::imageLoad(bool loading) return false; } + +void Thumbnail::getCamWB(double& temp, double& green) const +{ + if (tpp) { + tpp->getCamWB (temp, green); + } else { + temp = green = -1.0; + } +} + +void Thumbnail::getSpotWB(int x, int y, int rect, double& temp, double& green) +{ + if (tpp) { + tpp->getSpotWB (getProcParams(), x, y, rect, temp, green); + } else { + temp = green = -1.0; + } +} + +void Thumbnail::applyAutoExp (rtengine::procparams::ProcParams& pparams) +{ + if (tpp) { + tpp->applyAutoExp (pparams); + } +} + +const CacheImageData* Thumbnail::getCacheImageData() +{ + return &cfs; +} + +std::string Thumbnail::getMD5() const +{ + return cfs.md5; +} + +bool Thumbnail::isQuick() const +{ + return cfs.thumbImgType == CacheImageData::QUICK_THUMBNAIL; +} + +bool Thumbnail::isPParamsValid() const +{ + return pparamsValid; +} diff --git a/rtgui/thumbnail.h b/rtgui/thumbnail.h index ec5dbd249..aee5ee0a6 100644 --- a/rtgui/thumbnail.h +++ b/rtgui/thumbnail.h @@ -16,22 +16,31 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _THUMBNAIL_ -#define _THUMBNAIL_ +#pragma once #include #include -#include -#include "cachemanager.h" -#include "options.h" -#include "../rtengine/rtengine.h" -#include "../rtengine/rtthumbnail.h" -#include "cacheimagedata.h" -#include "thumbnaillistener.h" -#include "threadutils.h" +#include +#include "cacheimagedata.h" +#include "threadutils.h" +#include "thumbnaillistener.h" + +namespace rtengine +{ +class Thumbnail; + +namespace procparams +{ + +class ProcParams; + +} + +} class CacheManager; + struct ParamsEdited; class Thumbnail @@ -97,14 +106,8 @@ public: void notifylisterners_procParamsChanged(int whoChangedIt); - bool isQuick() const - { - return cfs.thumbImgType == CacheImageData::QUICK_THUMBNAIL; - } - bool isPParamsValid() const - { - return pparamsValid; - } + bool isQuick() const; + bool isPParamsValid() const; bool isRecentlySaved () const; void imageDeveloped (); void imageEnqueued (); @@ -122,29 +125,10 @@ public: const Glib::ustring& getExifString () const; const Glib::ustring& getDateTimeString () const; - void getCamWB (double& temp, double& green) const - { - if (tpp) { - tpp->getCamWB (temp, green); - } else { - temp = green = -1.0; - } - } + void getCamWB (double& temp, double& green) const; void getAutoWB (double& temp, double& green, double equal, double tempBias); - void getSpotWB (int x, int y, int rect, double& temp, double& green) - { - if (tpp) { - tpp->getSpotWB (getProcParams(), x, y, rect, temp, green); - } else { - temp = green = -1.0; - } - } - void applyAutoExp (rtengine::procparams::ProcParams& pparams) - { - if (tpp) { - tpp->applyAutoExp (pparams); - } - } + void getSpotWB (int x, int y, int rect, double& temp, double& green); + void applyAutoExp (rtengine::procparams::ProcParams& pparams); ThFileType getType (); Glib::ustring getFileName () const @@ -155,14 +139,8 @@ public: bool isSupported (); - const CacheImageData* getCacheImageData() - { - return &cfs; - } - std::string getMD5 () const - { - return cfs.md5; - } + const CacheImageData* getCacheImageData(); + std::string getMD5 () const; int getRank () const; void setRank (int rank); @@ -185,7 +163,3 @@ public: bool openDefaultViewer(int destination); bool imageLoad(bool loading); }; - - -#endif - diff --git a/rtgui/thumbnailbrowser.h b/rtgui/thumbnailbrowser.h deleted file mode 100644 index 9d40d1f7d..000000000 --- a/rtgui/thumbnailbrowser.h +++ /dev/null @@ -1,101 +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 _THUMBNAILBROWSER_ -#define _THUMBNAILBROWSER_ - -#include -#include "thumbnail.h" -#include "filecatalog.h" - -class ThumbBrowserEntry -{ - -public: -// set by arrangeFiles(): - int width; // minimal width - int height; // minimal height - int exp_width; // ararnged width - int startx; // x coord. in the widget - int starty; // y coord. in the widget -// thumbnail preview properties: - int prew; // width of the thumbnail - int preh; // height of the thumbnail - guint8* preview; -// file and directory attributes: - Glib::ustring filename; - Glib::ustring shortname; - Glib::ustring dirname; -// the associated thumbnail instance: - Thumbnail* thumbnail; - - ThumbBrowserEntry (Thumbnail* thm, Glib::ustring fname, Glib::ustring sname, Glib::ustring dname, int h) - : thumbnail(thm), filename(fname), shortname(sname), dirname(dname), preh(h) - { - preview = thumbnail ? (guint8*) thumbnail->getThumbnailImage (prew, preh) : NULL; - } - - bool operator< (FileDescr& other) - { - return shortname > other.shortname; - } -}; - -class ThumbBrowser : public Gtk::DrawingArea -{ - -protected: - int dx, dy, w, h; - - Gdk::RGBA black; - Gdk::RGBA white; - Gdk::RGBA blue; - Gdk::RGBA bluew; - - std::vector fd; - std::vector selected; - - int rowHeight; - int numOfRows; - - ThumbBrowserListener* tbl; - - void arrangeFiles (int rows); - -public: - - ThumbBrowser (); - - void addEntry (ThumbBrowserEntry* entry); - void setThumbBrowserListener (ThumbBrowserListener* l) - { - tbl = l; - } - - virtual void on_realize(); - virtual bool on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr); - virtual bool on_button_press_event (GdkEventButton* event); - virtual bool on_button_release_event (GdkEventButton* event); - virtual void previewReady (FileDescr* fdn); - - void resized (Gtk::Allocation& req); - void redraw (); - void styleChanged (const Glib::RefPtr& style); -}; - -#endif diff --git a/rtgui/thumbnaillistener.h b/rtgui/thumbnaillistener.h index 97503c420..18ac99dce 100644 --- a/rtgui/thumbnaillistener.h +++ b/rtgui/thumbnaillistener.h @@ -16,8 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _THUMBNAILLISTENER_ -#define _THUMBNAILLISTENER_ +#pragma once class Thumbnail; @@ -27,6 +26,3 @@ public: virtual ~ThumbnailListener() = default; virtual void procParamsChanged(Thumbnail* thm, int whoChangedIt) = 0; }; - -#endif - diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc index fa1c80ed8..68f3ee4de 100644 --- a/rtgui/tonecurve.cc +++ b/rtgui/tonecurve.cc @@ -25,8 +25,10 @@ #include "adjuster.h" #include "eventmapper.h" #include "ppversion.h" +#include "options.h" #include "../rtengine/procparams.h" +#include "../rtengine/utils.h" #include "editcallbacks.h" using namespace rtengine; diff --git a/rtgui/tonecurve.h b/rtgui/tonecurve.h index fb08c02c2..cba810e15 100644 --- a/rtgui/tonecurve.h +++ b/rtgui/tonecurve.h @@ -16,20 +16,24 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _TONECURVE_H_ -#define _TONECURVE_H_ +#pragma once #include + #include "adjuster.h" -#include "toolpanel.h" #include "curveeditor.h" #include "curveeditorgroup.h" -#include "mycurve.h" #include "guiutils.h" +#include "toolpanel.h" class EditDataProvider; -class ToneCurve : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel, public rtengine::AutoExpListener, public CurveListener +class ToneCurve : + public ToolParamBlock, + public AdjusterListener, + public FoldableToolPanel, + public rtengine::AutoExpListener, + public CurveListener { private: IdleRegister idle_register; @@ -141,5 +145,3 @@ public: void methodChanged (); void clampOOGChanged(); }; - -#endif diff --git a/rtgui/toolbar.cc b/rtgui/toolbar.cc index b80b48791..e7b247f33 100644 --- a/rtgui/toolbar.cc +++ b/rtgui/toolbar.cc @@ -20,6 +20,7 @@ #include "toolbar.h" #include "multilangmgr.h" #include "guiutils.h" +#include "rtimage.h" ToolBar::ToolBar () : showColPickers(true), listener (nullptr), pickerListener(nullptr) { diff --git a/rtgui/toolbar.h b/rtgui/toolbar.h index 4539a865d..55901d3dc 100644 --- a/rtgui/toolbar.h +++ b/rtgui/toolbar.h @@ -16,13 +16,14 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef __TOOLBAR_H__ -#define __TOOLBAR_H__ +#pragma once #include -#include "toolenum.h" -#include "rtimage.h" + #include "lockablecolorpicker.h" +#include "toolenum.h" + +class RTImage; class ToolBarListener { @@ -105,5 +106,3 @@ public: blockEdit = cond; } }; - -#endif diff --git a/rtgui/toolenum.h b/rtgui/toolenum.h index e90a0f685..c3bc873f1 100644 --- a/rtgui/toolenum.h +++ b/rtgui/toolenum.h @@ -16,9 +16,6 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _TOOLENUM_ -#define _TOOLENUM_ +#pragma once enum ToolMode {TMNone = -1, TMHand = 0, TMSpotWB = 1, TMCropSelect = 2, TMStraighten = 3, TMColorPicker = 4}; - -#endif diff --git a/rtgui/toolpanel.cc b/rtgui/toolpanel.cc index 27f68767e..b1282f523 100644 --- a/rtgui/toolpanel.cc +++ b/rtgui/toolpanel.cc @@ -19,6 +19,7 @@ #include "toolpanel.h" #include "toolpanelcoord.h" #include "guiutils.h" +#include "rtimage.h" #include "../rtengine/procparams.h" diff --git a/rtgui/toolpanel.h b/rtgui/toolpanel.h index 8d4a55eab..627200835 100644 --- a/rtgui/toolpanel.h +++ b/rtgui/toolpanel.h @@ -16,20 +16,33 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef __TOOLPANEL__ -#define __TOOLPANEL__ +#pragma once #include -#include -#include "../rtengine/rtengine.h" + +#include + #include "editbuffer.h" #include "guiutils.h" #include "multilangmgr.h" #include "paramsedited.h" -#include "../rtengine/noncopyable.h" -class ToolPanel; +#include "../rtengine/noncopyable.h" +#include "../rtengine/rtengine.h" + +namespace rtengine +{ + class ProcEvent; + +namespace procparams +{ + +class ProcParams; +} +} + class FoldableToolPanel; +class ToolPanel; class ToolPanelListener { @@ -39,20 +52,23 @@ public: }; /// @brief This class control the space around the group of tools inside a tab, as well as the space separating each tool. */ -class ToolVBox : public Gtk::VBox +class ToolVBox : + public Gtk::VBox { public: ToolVBox(); }; /// @brief This class control the space around a tool's block of parameter. */ -class ToolParamBlock : public Gtk::VBox +class ToolParamBlock : + public Gtk::VBox { public: ToolParamBlock(); }; -class ToolPanel : public rtengine::NonCopyable +class ToolPanel : + public rtengine::NonCopyable { protected: @@ -136,7 +152,8 @@ public: } }; -class FoldableToolPanel : public ToolPanel +class FoldableToolPanel : + public ToolPanel { protected: @@ -218,5 +235,3 @@ public: return exp->signal_enabled_toggled(); } }; - -#endif diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index ebfa97a96..504eabc27 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -18,7 +18,9 @@ */ #include "multilangmgr.h" #include "toolpanelcoord.h" +#include "metadatapanel.h" #include "options.h" +#include "rtimage.h" #include "../rtengine/imagesource.h" #include "../rtengine/dfmanager.h" #include "../rtengine/ffmanager.h" diff --git a/rtgui/toolpanelcoord.h b/rtgui/toolpanelcoord.h index ce38bbbd2..a40c7dfcd 100644 --- a/rtgui/toolpanelcoord.h +++ b/rtgui/toolpanelcoord.h @@ -16,78 +16,80 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef __TOOLPANELCCORD__ -#define __TOOLPANELCCORD__ +#pragma once -#include "../rtengine/rtengine.h" -#include "toolpanel.h" #include -#include "pparamschangelistener.h" -#include "profilechangelistener.h" -#include "imageareatoollistener.h" + #include -#include "whitebalance.h" -#include "coarsepanel.h" -#include "tonecurve.h" -#include "vibrance.h" -#include "colorappearance.h" -#include "shadowshighlights.h" -#include "impulsedenoise.h" -#include "defringe.h" -#include "dirpyrdenoise.h" -#include "epd.h" -#include "sharpening.h" -#include "labcurve.h" -#include "metadatapanel.h" -#include "crop.h" -#include "icmpanel.h" -#include "resize.h" -#include "chmixer.h" -#include "blackwhite.h" -#include "cacorrection.h" -#include "lensprofile.h" -#include "distortion.h" -#include "perspective.h" -#include "rotate.h" -#include "vignetting.h" -#include "retinex.h" -#include "gradient.h" -#include "locallab.h" -#include "pcvignette.h" -#include "toolbar.h" -#include "lensgeom.h" -#include "lensgeomlistener.h" -#include "wavelet.h" -#include "dirpyrequalizer.h" -#include "hsvequalizer.h" -#include "preprocess.h" + #include "bayerpreprocess.h" #include "bayerprocess.h" -#include "xtransprocess.h" +#include "bayerrawexposure.h" +#include "blackwhite.h" +#include "cacorrection.h" +#include "chmixer.h" +#include "coarsepanel.h" +#include "colorappearance.h" +#include "colortoning.h" +#include "crop.h" #include "darkframe.h" +#include "defringe.h" +#include "dehaze.h" +#include "dirpyrdenoise.h" +#include "dirpyrequalizer.h" +#include "distortion.h" +#include "epd.h" +#include "fattaltonemap.h" +#include "filmnegative.h" +#include "filmsimulation.h" #include "flatfield.h" -#include "sensorbayer.h" -#include "sensorxtrans.h" +#include "gradient.h" +#include "guiutils.h" +#include "hsvequalizer.h" +#include "icmpanel.h" +#include "imageareatoollistener.h" +#include "impulsedenoise.h" +#include "labcurve.h" +#include "lensgeom.h" +#include "lensgeomlistener.h" +#include "lensprofile.h" +#include "localcontrast.h" +#include "locallab.h" +#include "pcvignette.h" +#include "pdsharpening.h" +#include "perspective.h" +#include "pparamschangelistener.h" +#include "preprocess.h" +#include "profilechangelistener.h" +#include "prsharpening.h" #include "rawcacorrection.h" #include "rawexposure.h" -#include "bayerrawexposure.h" -#include "xtransrawexposure.h" -#include "sharpenmicro.h" -#include "sharpenedge.h" +#include "resize.h" +#include "retinex.h" #include "rgbcurves.h" -#include "colortoning.h" -#include "filmsimulation.h" -#include "prsharpening.h" -#include "pdsharpening.h" -#include "fattaltonemap.h" -#include "localcontrast.h" +#include "rotate.h" +#include "sensorbayer.h" +#include "sensorxtrans.h" +#include "shadowshighlights.h" +#include "sharpenedge.h" +#include "sharpening.h" +#include "sharpenmicro.h" #include "softlight.h" -#include "dehaze.h" -#include "guiutils.h" -#include "filmnegative.h" +#include "tonecurve.h" +#include "toolbar.h" +#include "toolpanel.h" +#include "vibrance.h" +#include "vignetting.h" +#include "wavelet.h" +#include "whitebalance.h" +#include "xtransprocess.h" +#include "xtransrawexposure.h" + #include "../rtengine/noncopyable.h" +#include "../rtengine/rtengine.h" class ImageEditorCoordinator; +class MetaDataPanel; class ToolPanelCoordinator : public ToolPanelListener, @@ -340,5 +342,3 @@ public: private: IdleRegister idle_register; }; - -#endif diff --git a/rtgui/vibrance.cc b/rtgui/vibrance.cc index 461c4a79f..67052785a 100644 --- a/rtgui/vibrance.cc +++ b/rtgui/vibrance.cc @@ -18,6 +18,7 @@ */ #include "vibrance.h" +#include "options.h" #include "../rtengine/color.h" using namespace rtengine; diff --git a/rtgui/vibrance.h b/rtgui/vibrance.h index 606bfa80a..211f631f9 100644 --- a/rtgui/vibrance.h +++ b/rtgui/vibrance.h @@ -16,18 +16,23 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _VIBRANCE_ -#define _VIBRANCE_ +#pragma once #include + #include "adjuster.h" -#include "thresholdadjuster.h" #include "curveeditor.h" #include "curveeditorgroup.h" +#include "thresholdadjuster.h" #include "toolpanel.h" -class Vibrance : public ToolParamBlock, public AdjusterListener, public ThresholdCurveProvider, public ThresholdAdjusterListener, - public FoldableToolPanel, public CurveListener +class Vibrance : + public ToolParamBlock, + public AdjusterListener, + public ThresholdCurveProvider, + public ThresholdAdjusterListener, + public FoldableToolPanel, + public CurveListener { protected: @@ -76,6 +81,3 @@ public: void pastsattog_toggled (); std::vector getCurvePoints(ThresholdSelector* tAdjuster) const override; }; - - -#endif diff --git a/rtgui/vignetting.h b/rtgui/vignetting.h index 094869f67..8cc8c498b 100644 --- a/rtgui/vignetting.h +++ b/rtgui/vignetting.h @@ -16,14 +16,17 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _VIGNETTING_H_ -#define _VIGNETTING_H_ +#pragma once #include + #include "adjuster.h" #include "toolpanel.h" -class Vignetting : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel +class Vignetting : + public ToolParamBlock, + public AdjusterListener, + public FoldableToolPanel { protected: @@ -46,5 +49,3 @@ public: void setAdjusterBehavior (bool amountadd, bool radiusadd, bool strengthadd, bool centeradd); void trimValues (rtengine::procparams::ProcParams* pp) override; }; - -#endif diff --git a/rtgui/wavelet.cc b/rtgui/wavelet.cc index 94f96e0cc..4fd3a7b8f 100644 --- a/rtgui/wavelet.cc +++ b/rtgui/wavelet.cc @@ -23,10 +23,11 @@ #include "editcallbacks.h" #include "guiutils.h" #include "rtimage.h" +#include "options.h" +#include "../rtengine/color.h" using namespace rtengine; using namespace rtengine::procparams; -extern Options options; namespace { diff --git a/rtgui/wavelet.h b/rtgui/wavelet.h index feec85fc9..20a0ba4e5 100644 --- a/rtgui/wavelet.h +++ b/rtgui/wavelet.h @@ -27,7 +27,6 @@ #include "thresholdadjuster.h" #include "colorprovider.h" #include "guiutils.h" -#include "options.h" class EditDataProvider; diff --git a/rtgui/wbprovider.h b/rtgui/wbprovider.h index 31ba8331a..a56d93cd3 100644 --- a/rtgui/wbprovider.h +++ b/rtgui/wbprovider.h @@ -16,9 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _WBPROVIDER_ -#define _WBPROVIDER_ - +#pragma once class WBProvider { @@ -29,5 +27,3 @@ public: virtual void getCamWB (double& temp, double& green) {} virtual void spotWBRequested (int size) {} }; - -#endif diff --git a/rtgui/whitebalance.cc b/rtgui/whitebalance.cc index 109fb7502..2ab09c10a 100644 --- a/rtgui/whitebalance.cc +++ b/rtgui/whitebalance.cc @@ -55,7 +55,7 @@ void WhiteBalance::init () void WhiteBalance::cleanup () { - for (unsigned int i = 0; i < toUnderlying(WBEntry::Type::CUSTOM) + 1; i++) { + for (int i = 0; i < toUnderlying(WBEntry::Type::CUSTOM) + 1; i++) { wbPixbufs[i].reset(); } } diff --git a/rtgui/whitebalance.h b/rtgui/whitebalance.h index fd7efe7ce..528c81d17 100644 --- a/rtgui/whitebalance.h +++ b/rtgui/whitebalance.h @@ -16,15 +16,17 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _WB_H_ -#define _WB_H_ +#pragma once #include -#include "toolpanel.h" + #include "adjuster.h" #include "guiutils.h" +#include "toolpanel.h" #include "wbprovider.h" + #include "../rtengine/procparams.h" +#include "../rtengine/utils.h" class SpotWBListener { @@ -123,5 +125,3 @@ public: void trimValues (rtengine::procparams::ProcParams* pp) override; void enabledChanged() override; }; - -#endif diff --git a/rtgui/xtransprocess.h b/rtgui/xtransprocess.h index dae93822f..b17b56b07 100644 --- a/rtgui/xtransprocess.h +++ b/rtgui/xtransprocess.h @@ -16,17 +16,21 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _XTRANSPROCESS_H_ -#define _XTRANSPROCESS_H_ +#pragma once #include + #include "adjuster.h" #include "checkbox.h" #include "guiutils.h" #include "toolpanel.h" - -class XTransProcess : public ToolParamBlock, public AdjusterListener, public CheckBoxListener, public FoldableToolPanel, public rtengine::AutoContrastListener +class XTransProcess : + public ToolParamBlock, + public AdjusterListener, + public CheckBoxListener, + public FoldableToolPanel, + public rtengine::AutoContrastListener { protected: @@ -64,5 +68,3 @@ public: void checkBoxToggled(CheckBox* c, CheckValue newval) override; void adjusterAutoToggled(Adjuster* a, bool newval) override; }; - -#endif diff --git a/rtgui/xtransrawexposure.h b/rtgui/xtransrawexposure.h index 08cdcc8bf..46c418f2f 100644 --- a/rtgui/xtransrawexposure.h +++ b/rtgui/xtransrawexposure.h @@ -16,15 +16,17 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _XTRANSRAWEXPOSURE_H_ -#define _XTRANSRAWEXPOSURE_H_ +#pragma once #include + #include "adjuster.h" #include "toolpanel.h" -#include "../rtengine/rawimage.h" -class XTransRAWExposure : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel +class XTransRAWExposure : + public ToolParamBlock, + public AdjusterListener, + public FoldableToolPanel { protected: @@ -46,5 +48,3 @@ public: void setAdjusterBehavior (bool pexblackadd); void trimValues (rtengine::procparams::ProcParams* pp) override; }; - -#endif diff --git a/rtgui/zoompanel.h b/rtgui/zoompanel.h index e1cb651e3..49e1e848d 100644 --- a/rtgui/zoompanel.h +++ b/rtgui/zoompanel.h @@ -16,13 +16,14 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _ZOOMPANEL_ -#define _ZOOMPANEL_ +#pragma once #include class ImageArea; -class ZoomPanel : public Gtk::Grid + +class ZoomPanel : + public Gtk::Grid { protected: @@ -48,6 +49,3 @@ public: void newCropClicked (); void refreshZoomLabel (); }; - -#endif -