From 66191609d6206536ee884bc536fb49120796ddde Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Mon, 28 Oct 2019 15:17:25 +0100 Subject: [PATCH 01/40] Forward declare wavelet_decomposition --- rtengine/cplx_wavelet_dec.h | 6 +----- rtengine/cplx_wavelet_filter_coeffs.h | 2 +- rtengine/cplx_wavelet_level.h | 8 ++------ rtengine/improcfun.h | 3 ++- 4 files changed, 6 insertions(+), 13 deletions(-) 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/improcfun.h b/rtengine/improcfun.h index 684927e47..9b8d0f63f 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -31,13 +31,14 @@ #include "lcp.h" #include "dcp.h" #include "curves.h" -#include "cplx_wavelet_dec.h" #include "pipettebuffer.h" #include "gamutwarning.h" namespace rtengine { +class wavelet_decomposition; + namespace procparams { From eaf0eeff4e4020e8afb6e59216c3373e9444177f Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Mon, 28 Oct 2019 15:43:58 +0100 Subject: [PATCH 02/40] Forward declare CieImage --- rtengine/PF_correct_RT.cc | 1 + rtengine/cieimage.cc | 8 +++----- rtengine/cieimage.h | 6 +----- rtengine/dcrop.cc | 2 ++ rtengine/dirpyr_equalizer.cc | 2 ++ rtengine/improccoordinator.cc | 1 + rtengine/improcfun.cc | 1 + rtengine/improcfun.h | 3 +-- rtengine/ipsharpen.cc | 1 + rtengine/rtthumbnail.cc | 1 + rtengine/simpleprocess.cc | 1 + 11 files changed, 15 insertions(+), 12 deletions(-) diff --git a/rtengine/PF_correct_RT.cc b/rtengine/PF_correct_RT.cc index 7df042663..98c399bff 100644 --- a/rtengine/PF_correct_RT.cc +++ b/rtengine/PF_correct_RT.cc @@ -29,6 +29,7 @@ #include "gauss.h" #include "improcfun.h" +#include "cieimage.h" #include "sleef.c" #include "../rtgui/myflatcurve.h" #include "rt_math.h" 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/dcrop.cc b/rtengine/dcrop.cc index 61b96b3a3..41e052b3e 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -17,6 +17,8 @@ * 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 "dcrop.h" #include "mytime.h" diff --git a/rtengine/dirpyr_equalizer.cc b/rtengine/dirpyr_equalizer.cc index e822d8492..79f85a944 100644 --- a/rtengine/dirpyr_equalizer.cc +++ b/rtengine/dirpyr_equalizer.cc @@ -20,6 +20,8 @@ #include #include + +#include "cieimage.h" #include "improcfun.h" #include "array2D.h" #include "rt_math.h" diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 8b9e49124..5633f77fa 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -17,6 +17,7 @@ * along with RawTherapee. If not, see . */ #include "improccoordinator.h" +#include "cieimage.h" #include "curves.h" #include "mytime.h" #include "refreshmap.h" diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 5acf4e15d..56eaeaa55 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -24,6 +24,7 @@ #endif #include "alignedbuffer.h" +#include "cieimage.h" #include "rtengine.h" #include "improcfun.h" #include "curves.h" diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 9b8d0f63f..41e4704b9 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -26,7 +26,6 @@ #include "coord2d.h" #include "color.h" #include "labimage.h" -#include "cieimage.h" #include "LUT.h" #include "lcp.h" #include "dcp.h" @@ -36,7 +35,7 @@ namespace rtengine { - +class CieImage; class wavelet_decomposition; namespace procparams diff --git a/rtengine/ipsharpen.cc b/rtengine/ipsharpen.cc index 0b1332ec9..0ba94a7c4 100644 --- a/rtengine/ipsharpen.cc +++ b/rtengine/ipsharpen.cc @@ -18,6 +18,7 @@ */ #include "improcfun.h" +#include "cieimage.h" #include "gauss.h" #include "bilateral2.h" #include "jaggedarray.h" diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 25f50980d..704721e3f 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -16,6 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ +#include "cieimage.h" #include "rtengine.h" #include "rtthumbnail.h" #include "../rtgui/options.h" diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 6dbb0e649..5a43e0a21 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -16,6 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ +#include "cieimage.h" #include "rtengine.h" #include "colortemp.h" #include "imagesource.h" From 22e5348db7560800a415913818c9b39528adff32 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Mon, 28 Oct 2019 17:17:15 +0100 Subject: [PATCH 03/40] Forward declare LabImage --- rtengine/FTblockDN.cc | 1 + rtengine/PF_correct_RT.cc | 1 + rtengine/color.h | 1 - rtengine/dcrop.cc | 1 + rtengine/imagefloat.cc | 1 + rtengine/imagefloat.h | 1 + rtengine/improccoordinator.cc | 1 + rtengine/improcfun.cc | 1 + rtengine/improcfun.h | 2 +- rtengine/iplab2rgb.cc | 1 + rtengine/iplabregions.cc | 1 + rtengine/iplocalcontrast.cc | 1 + rtengine/ipresize.cc | 1 + rtengine/ipshadowshighlights.cc | 1 + rtengine/ipsharpen.cc | 1 + rtengine/ipsoftlight.cc | 1 + rtengine/ipvibrance.cc | 1 + rtengine/ipwavelet.cc | 1 + rtengine/labimage.cc | 1 - rtengine/labimage.h | 6 +++--- rtengine/pipettebuffer.cc | 1 + rtengine/pipettebuffer.h | 1 + rtengine/rtthumbnail.cc | 1 + rtengine/simpleprocess.cc | 1 + 24 files changed, 24 insertions(+), 6 deletions(-) diff --git a/rtengine/FTblockDN.cc b/rtengine/FTblockDN.cc index 8fd0ba29e..117d8740a 100644 --- a/rtengine/FTblockDN.cc +++ b/rtengine/FTblockDN.cc @@ -30,6 +30,7 @@ #include "LUT.h" #include "array2D.h" #include "iccmatrices.h" +#include "labimage.h" #include "boxblur.h" #include "rt_math.h" #include "mytime.h" diff --git a/rtengine/PF_correct_RT.cc b/rtengine/PF_correct_RT.cc index 98c399bff..eb450dce9 100644 --- a/rtengine/PF_correct_RT.cc +++ b/rtengine/PF_correct_RT.cc @@ -30,6 +30,7 @@ #include "gauss.h" #include "improcfun.h" #include "cieimage.h" +#include "labimage.h" #include "sleef.c" #include "../rtgui/myflatcurve.h" #include "rt_math.h" diff --git a/rtengine/color.h b/rtengine/color.h index 2acf675d4..d0053470e 100644 --- a/rtengine/color.h +++ b/rtengine/color.h @@ -24,7 +24,6 @@ #include "rt_math.h" #include "LUT.h" -#include "labimage.h" #include "iccmatrices.h" #include "lcms2.h" #include "sleef.c" diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 41e052b3e..fe904527e 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -19,6 +19,7 @@ */ #include "cieimage.h" +#include "labimage.h" #include "curves.h" #include "dcrop.h" #include "mytime.h" diff --git a/rtengine/imagefloat.cc b/rtengine/imagefloat.cc index 8a9a511a6..0b67e0785 100644 --- a/rtengine/imagefloat.cc +++ b/rtengine/imagefloat.cc @@ -20,6 +20,7 @@ #include "imagefloat.h" #include "image16.h" #include "image8.h" +#include "labimage.h" #include #include "rtengine.h" #include "mytime.h" diff --git a/rtengine/imagefloat.h b/rtengine/imagefloat.h index 261a0677c..5250e16e8 100644 --- a/rtengine/imagefloat.h +++ b/rtengine/imagefloat.h @@ -31,6 +31,7 @@ using namespace procparams; class Image8; class Image16; +class LabImage; /* * Image type used by most tools; expected range: [0.0 ; 65535.0] diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 5633f77fa..c12e8132c 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -18,6 +18,7 @@ */ #include "improccoordinator.h" #include "cieimage.h" +#include "labimage.h" #include "curves.h" #include "mytime.h" #include "refreshmap.h" diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 56eaeaa55..e446f21a0 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -25,6 +25,7 @@ #include "alignedbuffer.h" #include "cieimage.h" +#include "labimage.h" #include "rtengine.h" #include "improcfun.h" #include "curves.h" diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 41e4704b9..05c06e0ef 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -25,7 +25,6 @@ #include "shmap.h" #include "coord2d.h" #include "color.h" -#include "labimage.h" #include "LUT.h" #include "lcp.h" #include "dcp.h" @@ -36,6 +35,7 @@ namespace rtengine { class CieImage; +class LabImage; class wavelet_decomposition; namespace procparams diff --git a/rtengine/iplab2rgb.cc b/rtengine/iplab2rgb.cc index 14aeb4049..8854331e4 100644 --- a/rtengine/iplab2rgb.cc +++ b/rtengine/iplab2rgb.cc @@ -17,6 +17,7 @@ * along with RawTherapee. If not, see . */ #include "rtengine.h" +#include "labimage.h" #include "improcfun.h" #include #include "iccstore.h" diff --git a/rtengine/iplabregions.cc b/rtengine/iplabregions.cc index af6567c3c..2462959bf 100644 --- a/rtengine/iplabregions.cc +++ b/rtengine/iplabregions.cc @@ -23,6 +23,7 @@ #endif #include "improcfun.h" +#include "labimage.h" #include "guidedfilter.h" #include "procparams.h" //#define BENCHMARK diff --git a/rtengine/iplocalcontrast.cc b/rtengine/iplocalcontrast.cc index 6143f48a3..4e6c32e7e 100644 --- a/rtengine/iplocalcontrast.cc +++ b/rtengine/iplocalcontrast.cc @@ -28,6 +28,7 @@ #include "array2D.h" #include "gauss.h" +#include "labimage.h" #include "improcfun.h" #include "procparams.h" diff --git a/rtengine/ipresize.cc b/rtengine/ipresize.cc index 0c1fb1ad8..601ec146d 100644 --- a/rtengine/ipresize.cc +++ b/rtengine/ipresize.cc @@ -20,6 +20,7 @@ #include "improcfun.h" #include "alignedbuffer.h" +#include "labimage.h" #include "opthelper.h" #include "rt_math.h" #include "procparams.h" diff --git a/rtengine/ipshadowshighlights.cc b/rtengine/ipshadowshighlights.cc index cddc8734b..7680ae6c7 100644 --- a/rtengine/ipshadowshighlights.cc +++ b/rtengine/ipshadowshighlights.cc @@ -22,6 +22,7 @@ #include "gauss.h" #include "guidedfilter.h" +#include "labimage.h" #include "opthelper.h" #include "procparams.h" #include "sleef.c" diff --git a/rtengine/ipsharpen.cc b/rtengine/ipsharpen.cc index 0ba94a7c4..1b3ab6270 100644 --- a/rtengine/ipsharpen.cc +++ b/rtengine/ipsharpen.cc @@ -19,6 +19,7 @@ #include "improcfun.h" #include "cieimage.h" +#include "labimage.h" #include "gauss.h" #include "bilateral2.h" #include "jaggedarray.h" diff --git a/rtengine/ipsoftlight.cc b/rtengine/ipsoftlight.cc index cd49e858f..e0dc6aa40 100644 --- a/rtengine/ipsoftlight.cc +++ b/rtengine/ipsoftlight.cc @@ -20,6 +20,7 @@ */ #include "improcfun.h" +#include "labimage.h" #include "procparams.h" diff --git a/rtengine/ipvibrance.cc b/rtengine/ipvibrance.cc index a7199064a..365dff587 100644 --- a/rtengine/ipvibrance.cc +++ b/rtengine/ipvibrance.cc @@ -23,6 +23,7 @@ #include "rtengine.h" #include "improcfun.h" #include "iccstore.h" +#include "labimage.h" #include "mytime.h" #include "../rtgui/thresholdselector.h" #include "curves.h" diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 6631aae32..078b9d585 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -30,6 +30,7 @@ #include "rtengine.h" #include "improcfun.h" +#include "labimage.h" #include "LUT.h" #include "array2D.h" #include "rt_math.h" diff --git a/rtengine/labimage.cc b/rtengine/labimage.cc index b31bc89a1..153af4c75 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 bcc2484ab..79f003b07 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 { @@ -45,4 +46,3 @@ public: }; } -#endif 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/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 704721e3f..b30bf3eb4 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -17,6 +17,7 @@ * along with RawTherapee. If not, see . */ #include "cieimage.h" +#include "labimage.h" #include "rtengine.h" #include "rtthumbnail.h" #include "../rtgui/options.h" diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 5a43e0a21..2eb640fca 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -17,6 +17,7 @@ * along with RawTherapee. If not, see . */ #include "cieimage.h" +#include "labimage.h" #include "rtengine.h" #include "colortemp.h" #include "imagesource.h" From 20726d5bfe505f206aa36ff8c900dbd0f3da77b0 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Mon, 28 Oct 2019 20:01:16 +0100 Subject: [PATCH 04/40] Forward declare Imagefloat --- rtengine/FTblockDN.cc | 1 + rtengine/dcp.cc | 1 + rtengine/dcp.h | 3 ++- rtengine/dcrop.cc | 1 + rtengine/dual_demosaic_RT.cc | 18 +++++++++--------- rtengine/filmnegativeproc.cc | 2 +- rtengine/image16.h | 2 +- rtengine/image8.cc | 1 + rtengine/image8.h | 2 +- rtengine/imagefloat.h | 5 +---- rtengine/imagesource.h | 10 +++++----- rtengine/improccoordinator.cc | 1 + rtengine/improcfun.h | 10 +++++----- rtengine/ipdehaze.cc | 1 + rtengine/iplab2rgb.cc | 1 + rtengine/ipresize.cc | 1 + rtengine/ipretinex.cc | 2 +- rtengine/ipsharpen.cc | 6 +++--- rtengine/iptransform.cc | 1 + rtengine/lcp.cc | 3 ++- rtengine/lcp.h | 12 ++++++++++-- rtengine/pixelshift.cc | 24 ++++++++++++------------ rtengine/rawimagesource.cc | 1 + rtengine/rawimagesource.h | 16 ++++++++-------- rtengine/rtlensfun.cc | 3 ++- rtengine/rtlensfun.h | 6 ++++-- rtengine/shmap.cc | 1 + rtengine/shmap.h | 4 ++-- rtengine/simpleprocess.cc | 1 + rtengine/stdimagesource.cc | 1 + rtengine/stdimagesource.h | 16 +++++++++++++--- rtengine/tmo_fattal02.cc | 1 + 32 files changed, 96 insertions(+), 62 deletions(-) diff --git a/rtengine/FTblockDN.cc b/rtengine/FTblockDN.cc index 117d8740a..8cd9a4086 100644 --- a/rtengine/FTblockDN.cc +++ b/rtengine/FTblockDN.cc @@ -30,6 +30,7 @@ #include "LUT.h" #include "array2D.h" #include "iccmatrices.h" +#include "imagefloat.h" #include "labimage.h" #include "boxblur.h" #include "rt_math.h" diff --git a/rtengine/dcp.cc b/rtengine/dcp.cc index 8127ebfcb..6376968e6 100644 --- a/rtengine/dcp.cc +++ b/rtengine/dcp.cc @@ -27,6 +27,7 @@ #include "cJSON.h" #include "iccmatrices.h" #include "iccstore.h" +#include "imagefloat.h" #include "improcfun.h" #include "rawimagesource.h" #include "rt_math.h" diff --git a/rtengine/dcp.h b/rtengine/dcp.h index 826f073a5..ba8be93eb 100644 --- a/rtengine/dcp.h +++ b/rtengine/dcp.h @@ -28,7 +28,6 @@ #include "../rtgui/threadutils.h" -#include "imagefloat.h" #include "curves.h" #include "colortemp.h" #include "noncopyable.h" @@ -36,6 +35,8 @@ namespace rtengine { +class Imagefloat; + class DCPProfile final { public: diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index fe904527e..bc09f5348 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -19,6 +19,7 @@ */ #include "cieimage.h" +#include "imagefloat.h" #include "labimage.h" #include "curves.h" #include "dcrop.h" diff --git a/rtengine/dual_demosaic_RT.cc b/rtengine/dual_demosaic_RT.cc index 60cce506b..895d7c6fc 100644 --- a/rtengine/dual_demosaic_RT.cc +++ b/rtengine/dual_demosaic_RT.cc @@ -37,22 +37,22 @@ 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 +70,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/filmnegativeproc.cc b/rtengine/filmnegativeproc.cc index 4293c6b2a..81de775a3 100644 --- a/rtengine/filmnegativeproc.cc +++ b/rtengine/filmnegativeproc.cc @@ -98,7 +98,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/image16.h b/rtengine/image16.h index 07747a172..c16b7dd0d 100644 --- a/rtengine/image16.h +++ b/rtengine/image16.h @@ -24,12 +24,12 @@ #include "imageio.h" #include "rtengine.h" -#include "imagefloat.h" namespace rtengine { class Image8; +class Imagefloat; class Image16 : public IImage16, public ImageIO { diff --git a/rtengine/image8.cc b/rtengine/image8.cc index abcd4efae..fb71e94a4 100644 --- a/rtengine/image8.cc +++ b/rtengine/image8.cc @@ -19,6 +19,7 @@ #include #include #include "image8.h" +#include "imagefloat.h" #include "rtengine.h" using namespace rtengine; diff --git a/rtengine/image8.h b/rtengine/image8.h index 969627f69..2fa2528ed 100644 --- a/rtengine/image8.h +++ b/rtengine/image8.h @@ -24,10 +24,10 @@ #include "imageio.h" #include "rtengine.h" -#include "imagefloat.h" namespace rtengine { +class Imagefloat; class Image8 : public IImage8, public ImageIO { diff --git a/rtengine/imagefloat.h b/rtengine/imagefloat.h index 5250e16e8..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 { @@ -228,4 +226,3 @@ public: }; } -#endif diff --git a/rtengine/imagesource.h b/rtengine/imagesource.h index edc1102c4..065a2e582 100644 --- a/rtengine/imagesource.h +++ b/rtengine/imagesource.h @@ -29,12 +29,12 @@ #include "image16.h" #include "image8.h" #include "imagedata.h" -#include "imagefloat.h" #include "LUT.h" #include "rtengine.h" namespace rtengine { +class Imagefloat; namespace procparams { @@ -47,7 +47,7 @@ struct RAWParams; struct RetinexParams; struct ToneCurveParams; struct CaptureSharpeningParams; -} +}; class ImageMatrices { @@ -82,7 +82,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 +101,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; diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index c12e8132c..d75f515bf 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -18,6 +18,7 @@ */ #include "improccoordinator.h" #include "cieimage.h" +#include "imagefloat.h" #include "labimage.h" #include "curves.h" #include "mytime.h" diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 05c06e0ef..80e750a26 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -19,7 +19,6 @@ #ifndef _IMPROCFUN_H_ #define _IMPROCFUN_H_ -#include "imagefloat.h" #include "image16.h" #include "image8.h" #include "shmap.h" @@ -35,6 +34,7 @@ namespace rtengine { class CieImage; +class Imagefloat; class LabImage; class wavelet_decomposition; @@ -57,7 +57,7 @@ class ImProcFunctions cmsHTRANSFORM monitorTransform; std::unique_ptr gamutWarning; - const ProcParams* params; + const procparams::ProcParams* params; double scale; bool multiThread; @@ -90,7 +90,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() @@ -122,7 +122,7 @@ public: void moyeqt(Imagefloat* working, float &moyS, float &eqty); void luminanceCurve(LabImage* lold, LabImage* lnew, LUTf &curve); - 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); @@ -132,7 +132,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); diff --git a/rtengine/ipdehaze.cc b/rtengine/ipdehaze.cc index e7bf71ba6..e3c86454f 100644 --- a/rtengine/ipdehaze.cc +++ b/rtengine/ipdehaze.cc @@ -33,6 +33,7 @@ #include #include "guidedfilter.h" +#include "imagefloat.h" #include "improcfun.h" #include "procparams.h" #include "rescale.h" diff --git a/rtengine/iplab2rgb.cc b/rtengine/iplab2rgb.cc index 8854331e4..c5c3f97d1 100644 --- a/rtengine/iplab2rgb.cc +++ b/rtengine/iplab2rgb.cc @@ -17,6 +17,7 @@ * along with RawTherapee. If not, see . */ #include "rtengine.h" +#include "imagefloat.h" #include "labimage.h" #include "improcfun.h" #include diff --git a/rtengine/ipresize.cc b/rtengine/ipresize.cc index 601ec146d..b31fcf864 100644 --- a/rtengine/ipresize.cc +++ b/rtengine/ipresize.cc @@ -20,6 +20,7 @@ #include "improcfun.h" #include "alignedbuffer.h" +#include "imagefloat.h" #include "labimage.h" #include "opthelper.h" #include "rt_math.h" diff --git a/rtengine/ipretinex.cc b/rtengine/ipretinex.cc index de6f4960a..e443b5bca 100644 --- a/rtengine/ipretinex.cc +++ b/rtengine/ipretinex.cc @@ -137,7 +137,7 @@ 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 if (!deh.enabled) { diff --git a/rtengine/ipsharpen.cc b/rtengine/ipsharpen.cc index 1b3ab6270..1223ff9ce 100644 --- a/rtengine/ipsharpen.cc +++ b/rtengine/ipsharpen.cc @@ -34,7 +34,7 @@ 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; @@ -160,7 +160,7 @@ 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; @@ -243,7 +243,7 @@ BENCHFUN delete blurbuffer; } -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/iptransform.cc b/rtengine/iptransform.cc index 69b57d0ba..b6338b8d3 100644 --- a/rtengine/iptransform.cc +++ b/rtengine/iptransform.cc @@ -22,6 +22,7 @@ #include #endif +#include "imagefloat.h" #include "improcfun.h" #include "mytime.h" diff --git a/rtengine/lcp.cc b/rtengine/lcp.cc index b456fc478..ddf3e0643 100644 --- a/rtengine/lcp.cc +++ b/rtengine/lcp.cc @@ -31,6 +31,7 @@ #include "procparams.h" #include "settings.h" +#include "utils.h" namespace rtengine { @@ -984,7 +985,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..ebfa350ac 100644 --- a/rtengine/lcp.h +++ b/rtengine/lcp.h @@ -29,12 +29,20 @@ #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 +193,7 @@ public: bool useCADistP, int fullWidth, int fullHeight, - const CoarseTransformParams& coarse, + const procparams::CoarseTransformParams& coarse, int rawRotationDeg ); diff --git a/rtengine/pixelshift.cc b/rtengine/pixelshift.cc index 4b93f3f61..abe6a0536 100644 --- a/rtengine/pixelshift.cc +++ b/rtengine/pixelshift.cc @@ -295,7 +295,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 +303,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 +323,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 +335,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 +362,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/rawimagesource.cc b/rtengine/rawimagesource.cc index ed1e45394..d7e8ac812 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -20,6 +20,7 @@ #include #include "rtengine.h" +#include "imagefloat.h" #include "rawimagesource.h" #include "rawimagesource_i.h" #include "jaggedarray.h" diff --git a/rtengine/rawimagesource.h b/rtengine/rawimagesource.h index 37d927445..ab8459f20 100644 --- a/rtengine/rawimagesource.h +++ b/rtengine/rawimagesource.h @@ -122,7 +122,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,10 +138,10 @@ public: return rgbSourceModified; // tracks whether cached rgb output of demosaic has been modified } - void processFlatField(const RAWParams &raw, RawImage *riFlatFile, unsigned short black[4]); - void copyOriginalPixels(const RAWParams &raw, RawImage *ri, RawImage *riDark, RawImage *riFlatFile, array2D &rawData ); + void processFlatField(const procparams::RAWParams &raw, RawImage *riFlatFile, unsigned short black[4]); + void copyOriginalPixels(const procparams::RAWParams &raw, RawImage *ri, RawImage *riDark, RawImage *riFlatFile, array2D &rawData ); void cfaboxblur (RawImage *riFlatFile, float* cfablur, int boxH, int boxW); - void scaleColors (int winx, int winy, int winw, int winh, const RAWParams &raw, array2D &rawData); // raw for cblack + 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 @@ -195,13 +195,13 @@ public: 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]); @@ -282,7 +282,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(); @@ -307,7 +307,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/rtlensfun.cc b/rtengine/rtlensfun.cc index 8c634eaa8..1fcb5ec26 100644 --- a/rtengine/rtlensfun.cc +++ b/rtengine/rtlensfun.cc @@ -19,6 +19,7 @@ */ #include "rtlensfun.h" +#include "imagedata.h" #include "procparams.h" #include "settings.h" #include @@ -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..2a7571b58 100644 --- a/rtengine/rtlensfun.h +++ b/rtengine/rtlensfun.h @@ -32,11 +32,13 @@ namespace rtengine { +class FramesMetaData; + namespace procparams { +struct CoarseTransformParams; struct LensProfParams; - } class LFModifier final : @@ -119,7 +121,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/shmap.cc b/rtengine/shmap.cc index 368442f2b..f654ab51d 100644 --- a/rtengine/shmap.cc +++ b/rtengine/shmap.cc @@ -18,6 +18,7 @@ */ #include "shmap.h" #include "gauss.h" +#include "imagefloat.h" #include "rtengine.h" #include "rt_math.h" #include "rawimagesource.h" diff --git a/rtengine/shmap.h b/rtengine/shmap.h index 539ef99ff..f07759a2c 100644 --- a/rtengine/shmap.h +++ b/rtengine/shmap.h @@ -19,12 +19,12 @@ #ifndef __SHMAP__ #define __SHMAP__ -#include "imagefloat.h" -#include "image16.h" +#include "LUT.h" #include "noncopyable.h" namespace rtengine { +class Imagefloat; class SHMap : public NonCopyable diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 2eb640fca..71edba62c 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -17,6 +17,7 @@ * along with RawTherapee. If not, see . */ #include "cieimage.h" +#include "imagefloat.h" #include "labimage.h" #include "rtengine.h" #include "colortemp.h" diff --git a/rtengine/stdimagesource.cc b/rtengine/stdimagesource.cc index 2ec1529f7..eddd12ae4 100644 --- a/rtengine/stdimagesource.cc +++ b/rtengine/stdimagesource.cc @@ -21,6 +21,7 @@ #include "color.h" #include "curves.h" #include "iccstore.h" +#include "imagefloat.h" #include "imageio.h" #include "mytime.h" #include "procparams.h" diff --git a/rtengine/stdimagesource.h b/rtengine/stdimagesource.h index 0dffe2fd0..2db2fdf57 100644 --- a/rtengine/stdimagesource.h +++ b/rtengine/stdimagesource.h @@ -23,6 +23,16 @@ namespace rtengine { +namespace procparams +{ + +class ProcParams; + +struct ToneCurveParams; +struct RAWParams; +struct ColorManagementParams; + +} class StdImageSource : public ImageSource { @@ -43,7 +53,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 +97,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 { diff --git a/rtengine/tmo_fattal02.cc b/rtengine/tmo_fattal02.cc index 6b5460ffd..f1822b486 100644 --- a/rtengine/tmo_fattal02.cc +++ b/rtengine/tmo_fattal02.cc @@ -66,6 +66,7 @@ #include #include "array2D.h" +#include "imagefloat.h" #include "improcfun.h" #include "settings.h" #include "iccstore.h" From 54b6b53e128c636b4711801967cc951ff60522b9 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Mon, 28 Oct 2019 21:03:45 +0100 Subject: [PATCH 05/40] Reduce image16.h dependencies --- rtengine/dcrop.h | 1 - rtengine/image16.cc | 5 +++-- rtengine/image16.h | 5 +---- rtengine/imagesource.h | 1 - rtengine/improccoordinator.h | 1 - rtengine/improcfun.h | 1 - rtengine/stdimagesource.cc | 1 + 7 files changed, 5 insertions(+), 10 deletions(-) diff --git a/rtengine/dcrop.h b/rtengine/dcrop.h index 6ce034f3f..ff046dd68 100644 --- a/rtengine/dcrop.h +++ b/rtengine/dcrop.h @@ -22,7 +22,6 @@ #include "rtengine.h" #include "improcfun.h" #include "image8.h" -#include "image16.h" #include "imagesource.h" #include "procevents.h" #include "pipettebuffer.h" diff --git a/rtengine/image16.cc b/rtengine/image16.cc index 0cdcc578f..14ba4964d 100644 --- a/rtengine/image16.cc +++ b/rtengine/image16.cc @@ -16,11 +16,12 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ +#include + #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 c16b7dd0d..d0053cbfc 100644 --- a/rtengine/image16.h +++ b/rtengine/image16.h @@ -19,11 +19,9 @@ // // 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" namespace rtengine { @@ -109,4 +107,3 @@ public: }; } -#endif diff --git a/rtengine/imagesource.h b/rtengine/imagesource.h index 065a2e582..614e7c23c 100644 --- a/rtengine/imagesource.h +++ b/rtengine/imagesource.h @@ -26,7 +26,6 @@ #include "colortemp.h" #include "coord2d.h" #include "dcp.h" -#include "image16.h" #include "image8.h" #include "imagedata.h" #include "LUT.h" diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index 379a3fb20..2969184bc 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -24,7 +24,6 @@ #include "rtengine.h" #include "improcfun.h" #include "image8.h" -#include "image16.h" #include "imagesource.h" #include "procevents.h" #include "dcrop.h" diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 80e750a26..189722846 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -19,7 +19,6 @@ #ifndef _IMPROCFUN_H_ #define _IMPROCFUN_H_ -#include "image16.h" #include "image8.h" #include "shmap.h" #include "coord2d.h" diff --git a/rtengine/stdimagesource.cc b/rtengine/stdimagesource.cc index eddd12ae4..c0befef7f 100644 --- a/rtengine/stdimagesource.cc +++ b/rtengine/stdimagesource.cc @@ -21,6 +21,7 @@ #include "color.h" #include "curves.h" #include "iccstore.h" +#include "image16.h" #include "imagefloat.h" #include "imageio.h" #include "mytime.h" From e92a99350b83ab4ff129b57bcde32ed886dad75c Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Tue, 29 Oct 2019 11:44:00 +0100 Subject: [PATCH 06/40] Forward declare Image8 --- rtengine/dcrop.cc | 1 + rtengine/dcrop.h | 3 ++- rtengine/demosaic_algos.cc | 1 - rtengine/gamutwarning.cc | 4 +++- rtengine/gamutwarning.h | 3 ++- rtengine/image8.h | 5 +---- rtengine/imagesource.h | 1 - rtengine/improccoordinator.cc | 1 + rtengine/improccoordinator.h | 3 ++- rtengine/improcfun.h | 2 +- rtengine/iplab2rgb.cc | 1 + rtengine/stdimagesource.cc | 1 + rtengine/stdimagesource.h | 3 +++ 13 files changed, 18 insertions(+), 11 deletions(-) diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index bc09f5348..85074fd96 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -19,6 +19,7 @@ */ #include "cieimage.h" +#include "image8.h" #include "imagefloat.h" #include "labimage.h" #include "curves.h" diff --git a/rtengine/dcrop.h b/rtengine/dcrop.h index ff046dd68..c65c1e72f 100644 --- a/rtengine/dcrop.h +++ b/rtengine/dcrop.h @@ -21,7 +21,6 @@ #include "improccoordinator.h" #include "rtengine.h" #include "improcfun.h" -#include "image8.h" #include "imagesource.h" #include "procevents.h" #include "pipettebuffer.h" @@ -30,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..52e15be54 100644 --- a/rtengine/demosaic_algos.cc +++ b/rtengine/demosaic_algos.cc @@ -22,7 +22,6 @@ #include "rawimagesource.h" #include "rawimage.h" #include "mytime.h" -#include "image8.h" #include "rt_math.h" #include "color.h" #include "../rtgui/multilangmgr.h" diff --git a/rtengine/gamutwarning.cc b/rtengine/gamutwarning.cc index 3fc20d43a..fe6b7c0dc 100644 --- a/rtengine/gamutwarning.cc +++ b/rtengine/gamutwarning.cc @@ -23,9 +23,11 @@ * also distributed under the GPL V3+ */ -#include "gamutwarning.h" #include +#include "gamutwarning.h" +#include "image8.h" + namespace rtengine { GamutWarning::GamutWarning(cmsHPROFILE iprof, cmsHPROFILE gamutprof, RenderingIntent intent, bool gamutbpc): diff --git a/rtengine/gamutwarning.h b/rtengine/gamutwarning.h index e0aaa98d9..b7ac5e41d 100644 --- a/rtengine/gamutwarning.h +++ b/rtengine/gamutwarning.h @@ -27,10 +27,11 @@ #include "iccstore.h" #include "noncopyable.h" -#include "image8.h" namespace rtengine { +class Image8; + enum RenderingIntent : int; class GamutWarning: public NonCopyable { diff --git a/rtengine/image8.h b/rtengine/image8.h index 2fa2528ed..f125dccf8 100644 --- a/rtengine/image8.h +++ b/rtengine/image8.h @@ -19,11 +19,9 @@ // // A class representing a 8 bit rgb image without alpha channel // -#ifndef _IMAGE8_ -#define _IMAGE8_ +#pragma once #include "imageio.h" -#include "rtengine.h" namespace rtengine { @@ -104,4 +102,3 @@ public: }; } -#endif diff --git a/rtengine/imagesource.h b/rtengine/imagesource.h index 614e7c23c..428027bc0 100644 --- a/rtengine/imagesource.h +++ b/rtengine/imagesource.h @@ -26,7 +26,6 @@ #include "colortemp.h" #include "coord2d.h" #include "dcp.h" -#include "image8.h" #include "imagedata.h" #include "LUT.h" #include "rtengine.h" diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index d75f515bf..0ab015fd3 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -18,6 +18,7 @@ */ #include "improccoordinator.h" #include "cieimage.h" +#include "image8.h" #include "imagefloat.h" #include "labimage.h" #include "curves.h" diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index 2969184bc..e7199565b 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -23,7 +23,6 @@ #include "rtengine.h" #include "improcfun.h" -#include "image8.h" #include "imagesource.h" #include "procevents.h" #include "dcrop.h" @@ -33,6 +32,8 @@ namespace rtengine { +class Image8; + using namespace procparams; class Crop; diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 189722846..b3ba2ccb8 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -19,7 +19,6 @@ #ifndef _IMPROCFUN_H_ #define _IMPROCFUN_H_ -#include "image8.h" #include "shmap.h" #include "coord2d.h" #include "color.h" @@ -33,6 +32,7 @@ namespace rtengine { class CieImage; +class Image8; class Imagefloat; class LabImage; class wavelet_decomposition; diff --git a/rtengine/iplab2rgb.cc b/rtengine/iplab2rgb.cc index c5c3f97d1..451a68a3f 100644 --- a/rtengine/iplab2rgb.cc +++ b/rtengine/iplab2rgb.cc @@ -17,6 +17,7 @@ * along with RawTherapee. If not, see . */ #include "rtengine.h" +#include "image8.h" #include "imagefloat.h" #include "labimage.h" #include "improcfun.h" diff --git a/rtengine/stdimagesource.cc b/rtengine/stdimagesource.cc index c0befef7f..43628e074 100644 --- a/rtengine/stdimagesource.cc +++ b/rtengine/stdimagesource.cc @@ -21,6 +21,7 @@ #include "color.h" #include "curves.h" #include "iccstore.h" +#include "image8.h" #include "image16.h" #include "imagefloat.h" #include "imageio.h" diff --git a/rtengine/stdimagesource.h b/rtengine/stdimagesource.h index 2db2fdf57..632b84ccb 100644 --- a/rtengine/stdimagesource.h +++ b/rtengine/stdimagesource.h @@ -23,6 +23,9 @@ namespace rtengine { + +class ImageIO; + namespace procparams { From 3aa84c48da4d46509ac7c798a8f16c9d021a3cc9 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Tue, 29 Oct 2019 12:33:14 +0100 Subject: [PATCH 07/40] Forward declare ColorTemp --- rtengine/ahd_demosaic_RT.cc | 1 + rtengine/clutstore.cc | 1 + rtengine/colortemp.h | 4 +--- rtengine/dcp.h | 2 +- rtengine/dcrop.cc | 1 + rtengine/image16.cc | 1 + rtengine/image8.cc | 2 ++ rtengine/imagefloat.cc | 2 ++ rtengine/imageio.h | 2 +- rtengine/imagesource.h | 2 +- rtengine/improccoordinator.cc | 1 + rtengine/improccoordinator.h | 1 + rtengine/rawimagesource.h | 1 + rtengine/stdimagesource.h | 1 + rtgui/thumbnail.cc | 1 + 15 files changed, 17 insertions(+), 6 deletions(-) diff --git a/rtengine/ahd_demosaic_RT.cc b/rtengine/ahd_demosaic_RT.cc index b3a34295c..77e342c18 100644 --- a/rtengine/ahd_demosaic_RT.cc +++ b/rtengine/ahd_demosaic_RT.cc @@ -24,6 +24,7 @@ // #include +#include "colortemp.h" #include "rtengine.h" #include "rawimagesource.h" #include "rt_math.h" diff --git a/rtengine/clutstore.cc b/rtengine/clutstore.cc index 10b7a2c38..cd97ed9e9 100644 --- a/rtengine/clutstore.cc +++ b/rtengine/clutstore.cc @@ -2,6 +2,7 @@ #include "clutstore.h" +#include "colortemp.h" #include "iccstore.h" #include "imagefloat.h" #include "opthelper.h" 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/dcp.h b/rtengine/dcp.h index ba8be93eb..062459e42 100644 --- a/rtengine/dcp.h +++ b/rtengine/dcp.h @@ -29,12 +29,12 @@ #include "../rtgui/threadutils.h" #include "curves.h" -#include "colortemp.h" #include "noncopyable.h" namespace rtengine { +class ColorTemp; class Imagefloat; class DCPProfile final diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 85074fd96..6d45d232b 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -18,6 +18,7 @@ * along with RawTherapee. If not, see . */ +#include "colortemp.h" #include "cieimage.h" #include "image8.h" #include "imagefloat.h" diff --git a/rtengine/image16.cc b/rtengine/image16.cc index 14ba4964d..a98d64d51 100644 --- a/rtengine/image16.cc +++ b/rtengine/image16.cc @@ -18,6 +18,7 @@ */ #include +#include "colortemp.h" #include "image16.h" #include "imagefloat.h" #include "image8.h" diff --git a/rtengine/image8.cc b/rtengine/image8.cc index fb71e94a4..3d0a8df06 100644 --- a/rtengine/image8.cc +++ b/rtengine/image8.cc @@ -18,6 +18,8 @@ */ #include #include + +#include "colortemp.h" #include "image8.h" #include "imagefloat.h" #include "rtengine.h" diff --git a/rtengine/imagefloat.cc b/rtengine/imagefloat.cc index 0b67e0785..3e80b617b 100644 --- a/rtengine/imagefloat.cc +++ b/rtengine/imagefloat.cc @@ -17,6 +17,8 @@ * along with RawTherapee. If not, see . */ #include + +#include "colortemp.h" #include "imagefloat.h" #include "image16.h" #include "image8.h" diff --git a/rtengine/imageio.h b/rtengine/imageio.h index 89c482ca3..baf456037 100644 --- a/rtengine/imageio.h +++ b/rtengine/imageio.h @@ -37,11 +37,11 @@ #include "../rtexif/rtexif.h" #include "imagedimensions.h" #include "iimage.h" -#include "colortemp.h" namespace rtengine { +class ColorTemp; class ProgressListener; class Imagefloat; diff --git a/rtengine/imagesource.h b/rtengine/imagesource.h index 428027bc0..0f7a2ff51 100644 --- a/rtengine/imagesource.h +++ b/rtengine/imagesource.h @@ -23,7 +23,6 @@ #include -#include "colortemp.h" #include "coord2d.h" #include "dcp.h" #include "imagedata.h" @@ -32,6 +31,7 @@ namespace rtengine { +class ColorTemp; class Imagefloat; namespace procparams diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 0ab015fd3..b0996c6dd 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -17,6 +17,7 @@ * along with RawTherapee. If not, see . */ #include "improccoordinator.h" + #include "cieimage.h" #include "image8.h" #include "imagefloat.h" diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index e7199565b..14e93b771 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -21,6 +21,7 @@ #include +#include "colortemp.h" #include "rtengine.h" #include "improcfun.h" #include "imagesource.h" diff --git a/rtengine/rawimagesource.h b/rtengine/rawimagesource.h index ab8459f20..6c8dff696 100644 --- a/rtengine/rawimagesource.h +++ b/rtengine/rawimagesource.h @@ -24,6 +24,7 @@ #include "array2D.h" #include "color.h" +#include "colortemp.h" #include "curves.h" #include "dcp.h" #include "iimage.h" diff --git a/rtengine/stdimagesource.h b/rtengine/stdimagesource.h index 632b84ccb..b70c6554b 100644 --- a/rtengine/stdimagesource.h +++ b/rtengine/stdimagesource.h @@ -19,6 +19,7 @@ #ifndef _STDIMAGESOURCE_ #define _STDIMAGESOURCE_ +#include "colortemp.h" #include "imagesource.h" namespace rtengine diff --git a/rtgui/thumbnail.cc b/rtgui/thumbnail.cc index 7ec1fef4e..78928fdf4 100644 --- a/rtgui/thumbnail.cc +++ b/rtgui/thumbnail.cc @@ -24,6 +24,7 @@ #include #include #include +#include "../rtengine/colortemp.h" #include "../rtengine/imagedata.h" #include "../rtengine/procparams.h" #include From c11087c28d6df55330ad4b57880a8ccd5111eb75 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Tue, 29 Oct 2019 14:15:45 +0100 Subject: [PATCH 08/40] Cleanup curves.h includes --- rtengine/capturesharpening.cc | 5 ++--- rtengine/curves.h | 5 +---- rtengine/dcp.cc | 1 - rtengine/imagesource.h | 2 ++ rtengine/improcfun.cc | 1 + rtengine/improcfun.h | 10 +++++++++- rtengine/iplab2rgb.cc | 1 - rtengine/rawimagesource.h | 6 ++++-- rtengine/stdimagesource.cc | 1 - rtgui/navigator.cc | 1 - 10 files changed, 19 insertions(+), 14 deletions(-) diff --git a/rtengine/capturesharpening.cc b/rtengine/capturesharpening.cc index a080b4f36..63c42026e 100644 --- a/rtengine/capturesharpening.cc +++ b/rtengine/capturesharpening.cc @@ -22,7 +22,6 @@ #include "rtengine.h" #include "rawimagesource.h" #include "rt_math.h" -#include "improcfun.h" #include "procparams.h" #include "color.h" #include "gauss.h" @@ -605,13 +604,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/curves.h b/rtengine/curves.h index 25272d44c..b4c1b54d4 100644 --- a/rtengine/curves.h +++ b/rtengine/curves.h @@ -16,8 +16,7 @@ * 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 @@ -1311,5 +1310,3 @@ inline void SatAndValueBlendingToneCurve::Apply (float& ir, float& ig, float& ib } #undef CLIPI - -#endif diff --git a/rtengine/dcp.cc b/rtengine/dcp.cc index 6376968e6..9fac31c99 100644 --- a/rtengine/dcp.cc +++ b/rtengine/dcp.cc @@ -28,7 +28,6 @@ #include "iccmatrices.h" #include "iccstore.h" #include "imagefloat.h" -#include "improcfun.h" #include "rawimagesource.h" #include "rt_math.h" diff --git a/rtengine/imagesource.h b/rtengine/imagesource.h index 0f7a2ff51..8597a8dc3 100644 --- a/rtengine/imagesource.h +++ b/rtengine/imagesource.h @@ -33,6 +33,8 @@ namespace rtengine { class ColorTemp; class Imagefloat; +class RetinextransmissionCurve; +class RetinexgaintransmissionCurve; namespace procparams { diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index e446f21a0..523683002 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -29,6 +29,7 @@ #include "rtengine.h" #include "improcfun.h" #include "curves.h" +#include "dcp.h" #include "mytime.h" #include "iccstore.h" #include "imagesource.h" diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index b3ba2ccb8..16b8e27b0 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -25,12 +25,20 @@ #include "LUT.h" #include "lcp.h" #include "dcp.h" -#include "curves.h" #include "pipettebuffer.h" #include "gamutwarning.h" namespace rtengine { +class ColorGradientCurve; +class OpacityCurve; +class ToneCurve; +class WavCurve; +class WavOpacityCurveRG; +class WavOpacityCurveBY; +class WavOpacityCurveW; +class WavOpacityCurveWL; + class CieImage; class Image8; class Imagefloat; diff --git a/rtengine/iplab2rgb.cc b/rtengine/iplab2rgb.cc index 451a68a3f..4298e41c9 100644 --- a/rtengine/iplab2rgb.cc +++ b/rtengine/iplab2rgb.cc @@ -26,7 +26,6 @@ #include "iccmatrices.h" #include "../rtgui/options.h" #include "settings.h" -#include "curves.h" #include "alignedbuffer.h" #include "color.h" #include "procparams.h" diff --git a/rtengine/rawimagesource.h b/rtengine/rawimagesource.h index 6c8dff696..771398fa0 100644 --- a/rtengine/rawimagesource.h +++ b/rtengine/rawimagesource.h @@ -25,8 +25,6 @@ #include "array2D.h" #include "color.h" #include "colortemp.h" -#include "curves.h" -#include "dcp.h" #include "iimage.h" #include "imagesource.h" #include "pixelsmap.h" @@ -36,6 +34,10 @@ namespace rtengine { +class DiagonalCurve; +class RetinextransmissionCurve; +class RetinexgaintransmissionCurve; + class RawImageSource : public ImageSource { private: diff --git a/rtengine/stdimagesource.cc b/rtengine/stdimagesource.cc index 43628e074..8e4c05ac8 100644 --- a/rtengine/stdimagesource.cc +++ b/rtengine/stdimagesource.cc @@ -19,7 +19,6 @@ #include "stdimagesource.h" #include "color.h" -#include "curves.h" #include "iccstore.h" #include "image8.h" #include "image16.h" diff --git a/rtgui/navigator.cc b/rtgui/navigator.cc index de07ffcd7..2cad9fdc1 100644 --- a/rtgui/navigator.cc +++ b/rtgui/navigator.cc @@ -21,7 +21,6 @@ #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" From ed161c6288c2bd80443e7f5c16e6bb13a344a9f5 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Tue, 29 Oct 2019 15:21:02 +0100 Subject: [PATCH 09/40] Reduce rawimage.h dependencies --- rtengine/badpixels.cc | 1 + rtengine/capturesharpening.cc | 1 + rtengine/dcp.cc | 1 + rtengine/dfmanager.h | 1 + rtengine/eahd_demosaic.cc | 1 + rtengine/ffmanager.cc | 7 +++++++ rtengine/ffmanager.h | 11 +++-------- rtengine/filmnegativeproc.cc | 1 + rtengine/hphd_demosaic_RT.cc | 1 + rtengine/imagedata.h | 1 - rtengine/pdaflinesfilter.cc | 1 + rtengine/pdaflinesfilter.h | 2 ++ rtengine/rawimage.h | 5 +---- rtengine/rawimagesource.cc | 21 +++++++++++++++++++++ rtengine/rawimagesource.h | 24 ++++++------------------ rtengine/vng4_demosaic_RT.cc | 1 + rtengine/xtrans_demosaic.cc | 1 + rtgui/bayerpreprocess.h | 1 - rtgui/preprocess.h | 1 - rtgui/rawexposure.h | 1 - rtgui/xtransrawexposure.h | 1 - 21 files changed, 50 insertions(+), 35 deletions(-) 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/capturesharpening.cc b/rtengine/capturesharpening.cc index 63c42026e..4eeca1f15 100644 --- a/rtengine/capturesharpening.cc +++ b/rtengine/capturesharpening.cc @@ -20,6 +20,7 @@ #include #include "rtengine.h" +#include "rawimage.h" #include "rawimagesource.h" #include "rt_math.h" #include "procparams.h" diff --git a/rtengine/dcp.cc b/rtengine/dcp.cc index 9fac31c99..78655dcf6 100644 --- a/rtengine/dcp.cc +++ b/rtengine/dcp.cc @@ -21,6 +21,7 @@ #include #include #include +#include #include "dcp.h" diff --git a/rtengine/dfmanager.h b/rtengine/dfmanager.h index 23ca97d14..e1fa38f77 100644 --- a/rtengine/dfmanager.h +++ b/rtengine/dfmanager.h @@ -30,6 +30,7 @@ namespace rtengine { +class RawImage; class dfInfo { public: diff --git a/rtengine/eahd_demosaic.cc b/rtengine/eahd_demosaic.cc index aa8fdf485..b87c0771d 100644 --- a/rtengine/eahd_demosaic.cc +++ b/rtengine/eahd_demosaic.cc @@ -20,6 +20,7 @@ #include #include "color.h" +#include "rawimage.h" #include "rawimagesource.h" #include "rawimagesource_i.h" #include "jaggedarray.h" diff --git a/rtengine/ffmanager.cc b/rtengine/ffmanager.cc index e1a9134a8..2dbc95055 100644 --- a/rtengine/ffmanager.cc +++ b/rtengine/ffmanager.cc @@ -50,6 +50,13 @@ inline ffInfo& ffInfo::operator =(const ffInfo &o) return *this; } +ffInfo::~ffInfo() +{ + if( ri ) { + 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 81de775a3..1eae22ad6 100644 --- a/rtengine/filmnegativeproc.cc +++ b/rtengine/filmnegativeproc.cc @@ -23,6 +23,7 @@ #include #endif +#include "rawimage.h" #include "rawimagesource.h" #include "mytime.h" diff --git a/rtengine/hphd_demosaic_RT.cc b/rtengine/hphd_demosaic_RT.cc index 0e56eae48..342cd2b6b 100644 --- a/rtengine/hphd_demosaic_RT.cc +++ b/rtengine/hphd_demosaic_RT.cc @@ -18,6 +18,7 @@ */ #include +#include "rawimage.h" #include "rawimagesource.h" #include "rawimagesource_i.h" #include "jaggedarray.h" diff --git a/rtengine/imagedata.h b/rtengine/imagedata.h index 99caaf361..06c7f4edf 100644 --- a/rtengine/imagedata.h +++ b/rtengine/imagedata.h @@ -21,7 +21,6 @@ #include #include -#include "rawimage.h" #include #include #include "../rtexif/rtexif.h" diff --git a/rtengine/pdaflinesfilter.cc b/rtengine/pdaflinesfilter.cc index d0694fd11..350c6f758 100644 --- a/rtengine/pdaflinesfilter.cc +++ b/rtengine/pdaflinesfilter.cc @@ -19,6 +19,7 @@ */ #include "pdaflinesfilter.h" +#include "rawimage.h" #include "settings.h" #include #include "camconst.h" diff --git a/rtengine/pdaflinesfilter.h b/rtengine/pdaflinesfilter.h index 7f4c7985b..e2904716e 100644 --- a/rtengine/pdaflinesfilter.h +++ b/rtengine/pdaflinesfilter.h @@ -26,6 +26,8 @@ namespace rtengine { +class RawImage; + class PDAFLinesFilter: public rtengine::NonCopyable { public: diff --git a/rtengine/rawimage.h b/rtengine/rawimage.h index 9c6d42969..4537fdcab 100644 --- a/rtengine/rawimage.h +++ b/rtengine/rawimage.h @@ -16,8 +16,7 @@ * 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 @@ -307,5 +306,3 @@ public: }; } - -#endif // __RAWIMAGE_H diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index d7e8ac812..ca324a5c1 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -21,6 +21,7 @@ #include "rtengine.h" #include "imagefloat.h" +#include "rawimage.h" #include "rawimagesource.h" #include "rawimagesource_i.h" #include "jaggedarray.h" @@ -501,6 +502,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) diff --git a/rtengine/rawimagesource.h b/rtengine/rawimagesource.h index 771398fa0..118dcb559 100644 --- a/rtengine/rawimagesource.h +++ b/rtengine/rawimagesource.h @@ -33,7 +33,7 @@ namespace rtengine { - +class RawImage; class DiagonalCurve; class RetinextransmissionCurve; class RetinexgaintransmissionCurve; @@ -110,10 +110,7 @@ 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); - } + 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); @@ -147,15 +144,9 @@ public: 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; } @@ -173,10 +164,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 { diff --git a/rtengine/vng4_demosaic_RT.cc b/rtengine/vng4_demosaic_RT.cc index 66413e4c7..384ec3219 100644 --- a/rtengine/vng4_demosaic_RT.cc +++ b/rtengine/vng4_demosaic_RT.cc @@ -21,6 +21,7 @@ //////////////////////////////////////////////////////////////// #include "rtengine.h" +#include "rawimage.h" #include "rawimagesource.h" #include "procparams.h" #include "../rtgui/multilangmgr.h" diff --git a/rtengine/xtrans_demosaic.cc b/rtengine/xtrans_demosaic.cc index 9a3b341cc..418d369b8 100644 --- a/rtengine/xtrans_demosaic.cc +++ b/rtengine/xtrans_demosaic.cc @@ -20,6 +20,7 @@ //////////////////////////////////////////////////////////////// #include "rtengine.h" +#include "rawimage.h" #include "rawimagesource.h" #include "rt_algo.h" #include "rt_math.h" diff --git a/rtgui/bayerpreprocess.h b/rtgui/bayerpreprocess.h index 5d2b101d9..9114c37d4 100644 --- a/rtgui/bayerpreprocess.h +++ b/rtgui/bayerpreprocess.h @@ -22,7 +22,6 @@ #include #include "adjuster.h" #include "toolpanel.h" -#include "../rtengine/rawimage.h" class BayerPreProcess : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel { diff --git a/rtgui/preprocess.h b/rtgui/preprocess.h index 015fa3650..cf4cc8857 100644 --- a/rtgui/preprocess.h +++ b/rtgui/preprocess.h @@ -24,7 +24,6 @@ #include "toolpanel.h" #include "adjuster.h" #include "guiutils.h" -#include "../rtengine/rawimage.h" class PreProcess : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel { diff --git a/rtgui/rawexposure.h b/rtgui/rawexposure.h index 1dafd4d64..339a054c9 100644 --- a/rtgui/rawexposure.h +++ b/rtgui/rawexposure.h @@ -22,7 +22,6 @@ #include #include "adjuster.h" #include "toolpanel.h" -#include "../rtengine/rawimage.h" class RAWExposure : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel { diff --git a/rtgui/xtransrawexposure.h b/rtgui/xtransrawexposure.h index 08cdcc8bf..4211e3e0c 100644 --- a/rtgui/xtransrawexposure.h +++ b/rtgui/xtransrawexposure.h @@ -22,7 +22,6 @@ #include #include "adjuster.h" #include "toolpanel.h" -#include "../rtengine/rawimage.h" class XTransRAWExposure : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel { From 068847eb5a2cac9478df9ba9a371ae0915d5018b Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Tue, 29 Oct 2019 21:06:27 +0100 Subject: [PATCH 10/40] Further cleanup of include dependencies --- rtengine/CMakeLists.txt | 1 - rtengine/LUT.h | 21 --------------------- rtengine/bilateral2.h | 1 - rtengine/camconst.cc | 3 +++ rtengine/camconst.h | 3 ++- rtengine/clutstore.h | 2 -- rtengine/color.h | 2 +- rtengine/curves.h | 2 +- rtengine/dcp.h | 2 +- rtengine/dfmanager.cc | 1 - rtengine/dynamicprofile.cc | 3 ++- rtengine/dynamicprofile.h | 2 +- rtengine/ffmanager.cc | 4 ++++ rtengine/iccstore.cc | 4 +++- rtengine/iccstore.h | 3 ++- rtengine/iimage.h | 2 +- rtengine/imagedata.h | 2 +- rtengine/imageio.h | 2 +- rtengine/imagesource.h | 2 +- rtengine/improcfun.cc | 3 +-- rtengine/iplab2rgb.cc | 2 +- rtengine/lcp.cc | 2 ++ rtengine/lcp.h | 2 +- rtengine/myfile.cc | 1 - rtengine/previewimage.h | 2 +- rtengine/procparams.h | 3 ++- rtengine/profilestore.cc | 4 ++++ rtengine/profilestore.h | 2 +- rtengine/rtengine.h | 2 +- rtengine/rtlensfun.h | 2 +- rtengine/rtthumbnail.cc | 2 +- rtengine/rtthumbnail.h | 2 +- rtengine/simpleprocess.cc | 2 +- rtexif/rtexif.h | 3 ++- rtgui/batchqueue.cc | 2 +- rtgui/bqentryupdater.h | 3 ++- rtgui/browserfilter.h | 3 ++- rtgui/cacheimagedata.h | 2 +- rtgui/extprog.cc | 2 ++ rtgui/filebrowser.cc | 2 +- rtgui/filmsimulation.h | 2 +- rtgui/histogrampanel.h | 2 +- rtgui/lensprofile.cc | 3 ++- rtgui/mycurve.h | 1 - rtgui/options.cc | 1 + rtgui/options.h | 2 +- rtgui/pathutils.cc | 2 ++ rtgui/pathutils.h | 14 ++------------ rtgui/pparamschangelistener.h | 2 +- rtgui/previewloader.h | 2 +- rtgui/profilestorecombobox.h | 2 +- rtgui/rtscalable.cc | 2 +- rtgui/thumbbrowserbase.cc | 2 +- rtgui/thumbimageupdater.h | 1 - rtgui/thumbnail.cc | 1 - rtgui/thumbnail.h | 2 +- rtgui/toolpanel.h | 2 +- 57 files changed, 70 insertions(+), 83 deletions(-) diff --git a/rtengine/CMakeLists.txt b/rtengine/CMakeLists.txt index e39ccde8e..8ec208a2b 100644 --- a/rtengine/CMakeLists.txt +++ b/rtengine/CMakeLists.txt @@ -121,7 +121,6 @@ set(RTENGINESOURCEFILES rtthumbnail.cc shmap.cc simpleprocess.cc - slicer.cc stdimagesource.cc tmo_fattal02.cc utils.cc diff --git a/rtengine/LUT.h b/rtengine/LUT.h index 34f572f58..f1090eefa 100644 --- a/rtengine/LUT.h +++ b/rtengine/LUT.h @@ -64,7 +64,6 @@ #include #ifndef NDEBUG -#include #include #endif @@ -485,26 +484,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; diff --git a/rtengine/bilateral2.h b/rtengine/bilateral2.h index d0496810d..75fafc3ba 100644 --- a/rtengine/bilateral2.h +++ b/rtengine/bilateral2.h @@ -22,7 +22,6 @@ #include #include #include -#include #include "rtengine.h" #include "rt_math.h" diff --git a/rtengine/camconst.cc b/rtengine/camconst.cc index 43de5d688..93f0057f1 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 diff --git a/rtengine/camconst.h b/rtengine/camconst.h index eb43da483..89180fbb5 100644 --- a/rtengine/camconst.h +++ b/rtengine/camconst.h @@ -4,8 +4,9 @@ #ifndef __CAMCONST__ #define __CAMCONST__ -#include +#include #include +#include namespace rtengine { 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.h b/rtengine/color.h index d0053470e..abe67d906 100644 --- a/rtengine/color.h +++ b/rtengine/color.h @@ -20,7 +20,7 @@ #pragma once #include -#include +#include #include "rt_math.h" #include "LUT.h" diff --git a/rtengine/curves.h b/rtengine/curves.h index b4c1b54d4..ef25ff8d7 100644 --- a/rtengine/curves.h +++ b/rtengine/curves.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include "rt_math.h" #include "../rtgui/mycurve.h" diff --git a/rtengine/dcp.h b/rtengine/dcp.h index 062459e42..922b88142 100644 --- a/rtengine/dcp.h +++ b/rtengine/dcp.h @@ -24,7 +24,7 @@ #include #include -#include +#include #include "../rtgui/threadutils.h" diff --git a/rtengine/dfmanager.cc b/rtengine/dfmanager.cc index 4877aacd8..fbeb2596e 100644 --- a/rtengine/dfmanager.cc +++ b/rtengine/dfmanager.cc @@ -19,7 +19,6 @@ #include "dfmanager.h" #include "../rtgui/options.h" #include -#include "../rtgui/guiutils.h" #include "rawimage.h" #include #include diff --git a/rtengine/dynamicprofile.cc b/rtengine/dynamicprofile.cc index af6ecd2ff..b9f76fa95 100644 --- a/rtengine/dynamicprofile.cc +++ b/rtengine/dynamicprofile.cc @@ -17,10 +17,11 @@ * along with RawTherapee. If not, see . */ -#include "../rtengine/dynamicprofile.h" +#include "dynamicprofile.h" #include #include +#include using namespace rtengine; using namespace rtengine::procparams; diff --git a/rtengine/dynamicprofile.h b/rtengine/dynamicprofile.h index aaffc5c4f..714f526f2 100644 --- a/rtengine/dynamicprofile.h +++ b/rtengine/dynamicprofile.h @@ -19,7 +19,7 @@ #ifndef _DYNAMICPROFILE_H_ #define _DYNAMICPROFILE_H_ -#include +#include #include #include "../rtgui/options.h" diff --git a/rtengine/ffmanager.cc b/rtengine/ffmanager.cc index 2dbc95055..dbbc25b81 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" diff --git a/rtengine/iccstore.cc b/rtengine/iccstore.cc index a8d54b810..7151e244d 100644 --- a/rtengine/iccstore.cc +++ b/rtengine/iccstore.cc @@ -18,7 +18,9 @@ */ #include -#include +#include +#include +#include #include #ifdef WIN32 diff --git a/rtengine/iccstore.h b/rtengine/iccstore.h index 5c76660e5..cc67c6152 100644 --- a/rtengine/iccstore.h +++ b/rtengine/iccstore.h @@ -19,10 +19,11 @@ #pragma once #include +#include #include #include -#include +#include #include diff --git a/rtengine/iimage.h b/rtengine/iimage.h index b04b4bf9a..11eb3e482 100644 --- a/rtengine/iimage.h +++ b/rtengine/iimage.h @@ -19,7 +19,7 @@ #ifndef _IIMAGE_ #define _IIMAGE_ -#include +#include #include #include "rt_math.h" #include "alignedbuffer.h" diff --git a/rtengine/imagedata.h b/rtengine/imagedata.h index 06c7f4edf..ee8a3fc3c 100644 --- a/rtengine/imagedata.h +++ b/rtengine/imagedata.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include "../rtexif/rtexif.h" #include #include "rtengine.h" diff --git a/rtengine/imageio.h b/rtengine/imageio.h index baf456037..c74756614 100644 --- a/rtengine/imageio.h +++ b/rtengine/imageio.h @@ -30,7 +30,7 @@ #include -#include +#include #include #include "rtengine.h" #include "imageformat.h" diff --git a/rtengine/imagesource.h b/rtengine/imagesource.h index 8597a8dc3..4a679f77e 100644 --- a/rtengine/imagesource.h +++ b/rtengine/imagesource.h @@ -21,7 +21,7 @@ #include #include -#include +#include #include "coord2d.h" #include "dcp.h" diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 523683002..90cd438d6 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -18,7 +18,7 @@ */ #include #include -#include +#include #ifdef _OPENMP #include #endif @@ -46,7 +46,6 @@ #include "StopWatch.h" #include "procparams.h" #include "../rtgui/ppversion.h" -#include "../rtgui/guiutils.h" #include "../rtgui/editcallbacks.h" #undef CLIPD diff --git a/rtengine/iplab2rgb.cc b/rtengine/iplab2rgb.cc index 4298e41c9..f2b337e01 100644 --- a/rtengine/iplab2rgb.cc +++ b/rtengine/iplab2rgb.cc @@ -21,7 +21,7 @@ #include "imagefloat.h" #include "labimage.h" #include "improcfun.h" -#include +#include #include "iccstore.h" #include "iccmatrices.h" #include "../rtgui/options.h" diff --git a/rtengine/lcp.cc b/rtengine/lcp.cc index ddf3e0643..e2442e094 100644 --- a/rtengine/lcp.cc +++ b/rtengine/lcp.cc @@ -20,6 +20,8 @@ #include #include +#include +#include #include #ifdef WIN32 diff --git a/rtengine/lcp.h b/rtengine/lcp.h index ebfa350ac..60df289e8 100644 --- a/rtengine/lcp.h +++ b/rtengine/lcp.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include "cache.h" diff --git a/rtengine/myfile.cc b/rtengine/myfile.cc index 259e08565..aab45448a 100644 --- a/rtengine/myfile.cc +++ b/rtengine/myfile.cc @@ -18,7 +18,6 @@ */ #include "myfile.h" #include -#include // get mmap() sorted out #ifdef MYFILE_MMAP diff --git a/rtengine/previewimage.h b/rtengine/previewimage.h index 71ddefe8a..aac5eabe5 100644 --- a/rtengine/previewimage.h +++ b/rtengine/previewimage.h @@ -19,7 +19,7 @@ #ifndef _PREVIEWIMAGE_ #define _PREVIEWIMAGE_ -#include +#include #include namespace rtengine diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 734ca7556..57c27063e 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -23,7 +23,8 @@ #include #include -#include +#include +#include #include #include "noncopyable.h" diff --git a/rtengine/profilestore.cc b/rtengine/profilestore.cc index 5c38cf705..23e4d8321 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" diff --git a/rtengine/profilestore.h b/rtengine/profilestore.h index 384aa2a46..3b7bc7f9d 100644 --- a/rtengine/profilestore.h +++ b/rtengine/profilestore.h @@ -21,7 +21,7 @@ #include #include -#include +#include #include "rtengine.h" #include "noncopyable.h" diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h index c188622af..f2c448805 100644 --- a/rtengine/rtengine.h +++ b/rtengine/rtengine.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include diff --git a/rtengine/rtlensfun.h b/rtengine/rtlensfun.h index 2a7571b58..9c95ca3aa 100644 --- a/rtengine/rtlensfun.h +++ b/rtengine/rtlensfun.h @@ -23,7 +23,7 @@ #include #include -#include +#include #include diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index b30bf3eb4..7f232d8be 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -24,7 +24,7 @@ #include "image8.h" #include #include "curves.h" -#include +#include #include "improcfun.h" #include "colortemp.h" #include "mytime.h" diff --git a/rtengine/rtthumbnail.h b/rtengine/rtthumbnail.h index 8b3f27a8b..a1df25224 100644 --- a/rtengine/rtthumbnail.h +++ b/rtengine/rtthumbnail.h @@ -20,7 +20,7 @@ #define _THUMBPROCESSINGPARAMETERS_ #include "rawmetadatalocation.h" -#include +#include #include #include "image8.h" #include "image16.h" diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 71edba62c..b7bc46cb1 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -28,7 +28,7 @@ #include "clutstore.h" #include "processingjob.h" #include "procparams.h" -#include +#include #include "../rtgui/options.h" #include "rawimagesource.h" #include "../rtgui/multilangmgr.h" diff --git a/rtexif/rtexif.h b/rtexif/rtexif.h index f4b0e089e..e89260932 100644 --- a/rtexif/rtexif.h +++ b/rtexif/rtexif.h @@ -30,7 +30,8 @@ #include #include -#include +#include +#include #include "../rtengine/noncopyable.h" #include "../rtengine/rawmetadatalocation.h" diff --git a/rtgui/batchqueue.cc b/rtgui/batchqueue.cc index abb37b24d..ed9861ad6 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 diff --git a/rtgui/bqentryupdater.h b/rtgui/bqentryupdater.h index efd63f9de..9e3e09a51 100644 --- a/rtgui/bqentryupdater.h +++ b/rtgui/bqentryupdater.h @@ -19,7 +19,8 @@ #ifndef _BQENTRYUPDATER_ #define _BQENTRYUPDATER_ -#include +#include + #include "../rtengine/rtengine.h" #include "threadutils.h" #include "thumbnail.h" diff --git a/rtgui/browserfilter.h b/rtgui/browserfilter.h index f5dac180e..11bfd9920 100644 --- a/rtgui/browserfilter.h +++ b/rtgui/browserfilter.h @@ -19,8 +19,9 @@ #ifndef _BROWSERFILTER_ #define _BROWSERFILTER_ +#include + #include "exiffiltersettings.h" -#include class BrowserFilter { diff --git a/rtgui/cacheimagedata.h b/rtgui/cacheimagedata.h index 72bf55749..56b4ad434 100644 --- a/rtgui/cacheimagedata.h +++ b/rtgui/cacheimagedata.h @@ -19,7 +19,7 @@ #ifndef _CACHEIMAGEDATA_ #define _CACHEIMAGEDATA_ -#include +#include #include "options.h" #include "../rtengine/rtengine.h" #include "../rtengine/imageformat.h" diff --git a/rtgui/extprog.cc b/rtgui/extprog.cc index 00ea07713..a17bcdc6a 100644 --- a/rtgui/extprog.cc +++ b/rtgui/extprog.cc @@ -26,6 +26,8 @@ #include #endif +#include + #include "options.h" #include "multilangmgr.h" diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index f9afcef48..d4f5bb8ca 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -21,7 +21,7 @@ #include #include -#include +#include #include "filebrowser.h" diff --git a/rtgui/filmsimulation.h b/rtgui/filmsimulation.h index b5c9ffa6b..6eb0fd024 100644 --- a/rtgui/filmsimulation.h +++ b/rtgui/filmsimulation.h @@ -2,7 +2,7 @@ #define FILM_SIMULATION_INCLUDED #include -#include +#include #include #include "toolpanel.h" #include "guiutils.h" diff --git a/rtgui/histogrampanel.h b/rtgui/histogrampanel.h index 1515db97a..ef8d9368d 100644 --- a/rtgui/histogrampanel.h +++ b/rtgui/histogrampanel.h @@ -21,7 +21,7 @@ #include -#include +#include #include #include "../rtengine/LUT.h" #include "../rtengine/improccoordinator.h" diff --git a/rtgui/lensprofile.cc b/rtgui/lensprofile.cc index 389f15461..a6694287f 100644 --- a/rtgui/lensprofile.cc +++ b/rtgui/lensprofile.cc @@ -18,9 +18,10 @@ */ #include #include +#include #include -#include +#include #include "lensprofile.h" diff --git a/rtgui/mycurve.h b/rtgui/mycurve.h index 62d8d30f2..fd22660ea 100644 --- a/rtgui/mycurve.h +++ b/rtgui/mycurve.h @@ -26,7 +26,6 @@ #include "coloredbar.h" #include "coordinateadjuster.h" #include "../rtengine/LUT.h" -#include "guiutils.h" #include "options.h" #include "../rtengine/noncopyable.h" diff --git a/rtgui/options.cc b/rtgui/options.cc index 737607bcf..9757fa3b7 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -19,6 +19,7 @@ #include "options.h" #include #include +#include #include #include "multilangmgr.h" #include "addsetids.h" diff --git a/rtgui/options.h b/rtgui/options.h index 3bd83cd5b..990a32228 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -20,7 +20,7 @@ #define _OPTIONS_ #include -#include +#include #include "../rtengine/rtengine.h" #include 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/pparamschangelistener.h b/rtgui/pparamschangelistener.h index 2c73ea3f6..bc3a5600b 100644 --- a/rtgui/pparamschangelistener.h +++ b/rtgui/pparamschangelistener.h @@ -20,7 +20,7 @@ #define _PPARAMSCHANGELISTENER_ #include "../rtengine/rtengine.h" -#include +#include #include "paramsedited.h" class PParamsChangeListener diff --git a/rtgui/previewloader.h b/rtgui/previewloader.h index 52dbee43c..ede509c0a 100644 --- a/rtgui/previewloader.h +++ b/rtgui/previewloader.h @@ -20,7 +20,7 @@ #define _PREVIEWLOADER_ #include -#include +#include #include "../rtengine/noncopyable.h" diff --git a/rtgui/profilestorecombobox.h b/rtgui/profilestorecombobox.h index 5d04813d6..cec67d188 100644 --- a/rtgui/profilestorecombobox.h +++ b/rtgui/profilestorecombobox.h @@ -21,7 +21,7 @@ #include #include -#include +#include #include "../rtengine/rtengine.h" #include "../rtengine/profilestore.h" diff --git a/rtgui/rtscalable.cc b/rtgui/rtscalable.cc index b37f2276f..fa92655ac 100644 --- a/rtgui/rtscalable.cc +++ b/rtgui/rtscalable.cc @@ -20,7 +20,7 @@ #include "rtscalable.h" #include #include -#include +#include #include #include #include "options.h" diff --git a/rtgui/thumbbrowserbase.cc b/rtgui/thumbbrowserbase.cc index adf451f05..f5f4076bb 100644 --- a/rtgui/thumbbrowserbase.cc +++ b/rtgui/thumbbrowserbase.cc @@ -16,7 +16,7 @@ */ #include -#include +#include #include "multilangmgr.h" #include "options.h" diff --git a/rtgui/thumbimageupdater.h b/rtgui/thumbimageupdater.h index 0e46b11d7..81636103e 100644 --- a/rtgui/thumbimageupdater.h +++ b/rtgui/thumbimageupdater.h @@ -19,7 +19,6 @@ #ifndef _THUMBIMAGEUPDATER_ #define _THUMBIMAGEUPDATER_ -#include #include #include "../rtengine/rtengine.h" diff --git a/rtgui/thumbnail.cc b/rtgui/thumbnail.cc index 78928fdf4..531529d5c 100644 --- a/rtgui/thumbnail.cc +++ b/rtgui/thumbnail.cc @@ -23,7 +23,6 @@ #include "../rtengine/mytime.h" #include #include -#include #include "../rtengine/colortemp.h" #include "../rtengine/imagedata.h" #include "../rtengine/procparams.h" diff --git a/rtgui/thumbnail.h b/rtgui/thumbnail.h index ec5dbd249..b1c45fdfa 100644 --- a/rtgui/thumbnail.h +++ b/rtgui/thumbnail.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include "cachemanager.h" #include "options.h" #include "../rtengine/rtengine.h" diff --git a/rtgui/toolpanel.h b/rtgui/toolpanel.h index 8d4a55eab..2c787d937 100644 --- a/rtgui/toolpanel.h +++ b/rtgui/toolpanel.h @@ -20,7 +20,7 @@ #define __TOOLPANEL__ #include -#include +#include #include "../rtengine/rtengine.h" #include "editbuffer.h" #include "guiutils.h" From dfa41d6947fa3e31d9f0f3e275121c4ee232f149 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Tue, 29 Oct 2019 21:09:37 +0100 Subject: [PATCH 11/40] removed rtengine/slicer.* --- rtengine/slicer.cc | 152 --------------------------------------------- rtengine/slicer.h | 63 ------------------- 2 files changed, 215 deletions(-) delete mode 100644 rtengine/slicer.cc delete mode 100644 rtengine/slicer.h 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 From 1acca23fe1e6edd4139b45d50a73608c1d92a52f Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Tue, 29 Oct 2019 22:45:26 +0100 Subject: [PATCH 12/40] Further cleanup of include dependencies --- rtengine/dynamicprofile.cc | 2 ++ rtengine/dynamicprofile.h | 2 +- rtengine/gamutwarning.cc | 1 + rtengine/gamutwarning.h | 3 ++- rtengine/histmatching.cc | 1 - rtengine/ipdehaze.cc | 1 + rtengine/iplabregions.cc | 1 + rtengine/ipshadowshighlights.cc | 1 + rtengine/ipsoftlight.cc | 1 + rtgui/dynamicprofilepanel.cc | 1 + rtgui/histogrampanel.cc | 3 --- rtgui/iccprofilecreator.cc | 1 + rtgui/navigator.cc | 2 -- rtgui/navigator.h | 1 - rtgui/preferences.cc | 1 + 15 files changed, 13 insertions(+), 9 deletions(-) diff --git a/rtengine/dynamicprofile.cc b/rtengine/dynamicprofile.cc index b9f76fa95..607b0b528 100644 --- a/rtengine/dynamicprofile.cc +++ b/rtengine/dynamicprofile.cc @@ -23,6 +23,8 @@ #include #include +#include "../rtgui/options.h" + using namespace rtengine; using namespace rtengine::procparams; diff --git a/rtengine/dynamicprofile.h b/rtengine/dynamicprofile.h index 714f526f2..e23c57b49 100644 --- a/rtengine/dynamicprofile.h +++ b/rtengine/dynamicprofile.h @@ -21,7 +21,7 @@ #include #include -#include "../rtgui/options.h" +#include "../rtengine/rtengine.h" class DynamicProfileRule { diff --git a/rtengine/gamutwarning.cc b/rtengine/gamutwarning.cc index fe6b7c0dc..290800f90 100644 --- a/rtengine/gamutwarning.cc +++ b/rtengine/gamutwarning.cc @@ -26,6 +26,7 @@ #include #include "gamutwarning.h" +#include "iccstore.h" #include "image8.h" namespace rtengine { diff --git a/rtengine/gamutwarning.h b/rtengine/gamutwarning.h index b7ac5e41d..4e34ed431 100644 --- a/rtengine/gamutwarning.h +++ b/rtengine/gamutwarning.h @@ -25,7 +25,8 @@ #pragma once -#include "iccstore.h" +#include + #include "noncopyable.h" namespace rtengine { diff --git a/rtengine/histmatching.cc b/rtengine/histmatching.cc index 212b11d00..e85f5ee13 100644 --- a/rtengine/histmatching.cc +++ b/rtengine/histmatching.cc @@ -23,7 +23,6 @@ #include "curves.h" #include "color.h" #include "rt_math.h" -#include "iccstore.h" #include "procparams.h" #include "../rtgui/mydiagonalcurve.h" #include "improcfun.h" diff --git a/rtengine/ipdehaze.cc b/rtengine/ipdehaze.cc index e3c86454f..7ca4d72ad 100644 --- a/rtengine/ipdehaze.cc +++ b/rtengine/ipdehaze.cc @@ -33,6 +33,7 @@ #include #include "guidedfilter.h" +#include "iccstore.h" #include "imagefloat.h" #include "improcfun.h" #include "procparams.h" diff --git a/rtengine/iplabregions.cc b/rtengine/iplabregions.cc index 2462959bf..d6b7294f6 100644 --- a/rtengine/iplabregions.cc +++ b/rtengine/iplabregions.cc @@ -22,6 +22,7 @@ #include #endif +#include "iccstore.h" #include "improcfun.h" #include "labimage.h" #include "guidedfilter.h" diff --git a/rtengine/ipshadowshighlights.cc b/rtengine/ipshadowshighlights.cc index 7680ae6c7..1e8842cbb 100644 --- a/rtengine/ipshadowshighlights.cc +++ b/rtengine/ipshadowshighlights.cc @@ -22,6 +22,7 @@ #include "gauss.h" #include "guidedfilter.h" +#include "iccstore.h" #include "labimage.h" #include "opthelper.h" #include "procparams.h" diff --git a/rtengine/ipsoftlight.cc b/rtengine/ipsoftlight.cc index e0dc6aa40..ab2e7c8b1 100644 --- a/rtengine/ipsoftlight.cc +++ b/rtengine/ipsoftlight.cc @@ -19,6 +19,7 @@ * along with RawTherapee. If not, see . */ +#include "iccstore.h" #include "improcfun.h" #include "labimage.h" diff --git a/rtgui/dynamicprofilepanel.cc b/rtgui/dynamicprofilepanel.cc index 38029af71..6acad07f9 100644 --- a/rtgui/dynamicprofilepanel.cc +++ b/rtgui/dynamicprofilepanel.cc @@ -18,6 +18,7 @@ */ #include "dynamicprofilepanel.h" +#include "options.h" #include "multilangmgr.h" #include "../rtengine/profilestore.h" #include "../rtengine/rtengine.h" diff --git a/rtgui/histogrampanel.cc b/rtgui/histogrampanel.cc index 36803ddf2..74e473096 100644 --- a/rtgui/histogrampanel.cc +++ b/rtgui/histogrampanel.cc @@ -24,10 +24,7 @@ #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; diff --git a/rtgui/iccprofilecreator.cc b/rtgui/iccprofilecreator.cc index 9efa4360b..2728a7611 100644 --- a/rtgui/iccprofilecreator.cc +++ b/rtgui/iccprofilecreator.cc @@ -19,6 +19,7 @@ */ #include #include "iccprofilecreator.h" +#include "../rtengine/iccstore.h" #include "multilangmgr.h" #include "cachemanager.h" #include "addsetids.h" diff --git a/rtgui/navigator.cc b/rtgui/navigator.cc index 2cad9fdc1..50946f32f 100644 --- a/rtgui/navigator.cc +++ b/rtgui/navigator.cc @@ -19,8 +19,6 @@ #include #include "navigator.h" #include "toolpanel.h" -#include "../rtengine/iccmatrices.h" -#include "../rtengine/iccstore.h" #include "../rtengine/color.h" #include "../rtengine/rt_math.h" #include "options.h" diff --git a/rtgui/navigator.h b/rtgui/navigator.h index eb4584f42..32ad68175 100644 --- a/rtgui/navigator.h +++ b/rtgui/navigator.h @@ -23,7 +23,6 @@ #include "previewwindow.h" #include "pointermotionlistener.h" #include "options.h" -#include "../rtengine/iccstore.h" class Navigator : public Gtk::Frame, public PointerMotionListener { diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index b4447fd44..3c0d1bedc 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -24,6 +24,7 @@ #include "addsetids.h" #include "../rtengine/dfmanager.h" #include "../rtengine/ffmanager.h" +#include "../rtengine/iccstore.h" #include #include "rtimage.h" #ifdef _OPENMP From 81575a6e364da5ed5b65f94ac093c2912cb358aa Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Tue, 29 Oct 2019 23:49:43 +0100 Subject: [PATCH 13/40] Further cleanup of include dependencies --- rtengine/bilateral2.h | 1 - rtengine/cfa_linedn_RT.cc | 1 - rtengine/ciecam02.cc | 2 +- rtengine/colortemp.cc | 6 +++++- rtengine/imagedata.h | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/rtengine/bilateral2.h b/rtengine/bilateral2.h index 75fafc3ba..f4b1a80e9 100644 --- a/rtengine/bilateral2.h +++ b/rtengine/bilateral2.h @@ -23,7 +23,6 @@ #include #include -#include "rtengine.h" #include "rt_math.h" #include "mytime.h" diff --git a/rtengine/cfa_linedn_RT.cc b/rtengine/cfa_linedn_RT.cc index 5f6e46f8f..3aef79133 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" diff --git a/rtengine/ciecam02.cc b/rtengine/ciecam02.cc index dc71fee85..3219884ad 100644 --- a/rtengine/ciecam02.cc +++ b/rtengine/ciecam02.cc @@ -17,7 +17,7 @@ * along with RawTherapee. If not, see . */ #include "ciecam02.h" -#include "rtengine.h" +#include "rt_math.h" #include "curves.h" #include #include "sleef.c" diff --git a/rtengine/colortemp.cc b/rtengine/colortemp.cc index 3ddbdc28a..927d8423d 100644 --- a/rtengine/colortemp.cc +++ b/rtengine/colortemp.cc @@ -16,8 +16,12 @@ * 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 diff --git a/rtengine/imagedata.h b/rtengine/imagedata.h index ee8a3fc3c..66c4285b9 100644 --- a/rtengine/imagedata.h +++ b/rtengine/imagedata.h @@ -23,9 +23,9 @@ #include #include #include +#include "imageio.h" #include "../rtexif/rtexif.h" #include -#include "rtengine.h" namespace rtengine { From d7ec033829068898bd3c790e03ea336955be7627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=B6ssie?= Date: Wed, 30 Oct 2019 09:30:21 +0100 Subject: [PATCH 14/40] Reduce `dcp.h` dependencies --- rtengine/FTblockDN.cc | 31 ++++++++++++-------- rtengine/PF_correct_RT.cc | 1 + rtengine/bilateral2.h | 25 ++++++++--------- rtengine/clutstore.cc | 3 ++ rtengine/dcp.cc | 12 ++++---- rtengine/dcp.h | 33 +++++++++++----------- rtengine/dcrop.cc | 10 ++++--- rtengine/dirpyr_equalizer.cc | 28 +++++++++--------- rtengine/dual_demosaic_RT.cc | 11 +++++--- rtengine/filmnegativeproc.cc | 1 + rtengine/imagedata.cc | 11 ++++++-- rtengine/imagesource.h | 11 ++++++-- rtengine/improccoordinator.cc | 29 +++++++++++-------- rtengine/improccoordinator.h | 13 +++++---- rtengine/improcfun.cc | 4 +-- rtengine/improcfun.h | 18 +++++++++--- rtengine/ipdehaze.cc | 2 +- rtengine/iplabregions.cc | 7 +++-- rtengine/ipretinex.cc | 3 +- rtengine/ipshadowshighlights.cc | 2 ++ rtengine/ipsharpen.cc | 19 +++++++------ rtengine/ipwavelet.cc | 17 +++++------ rtengine/pixelshift.cc | 13 +++++++-- rtengine/rawimagesource.cc | 36 +++++++++++++----------- rtengine/rawimagesource.h | 2 +- rtengine/rtthumbnail.cc | 50 ++++++++++++++++++--------------- rtengine/simpleprocess.cc | 4 +-- 27 files changed, 232 insertions(+), 164 deletions(-) diff --git a/rtengine/FTblockDN.cc b/rtengine/FTblockDN.cc index 8cd9a4086..b708f521a 100644 --- a/rtengine/FTblockDN.cc +++ b/rtengine/FTblockDN.cc @@ -23,27 +23,34 @@ //////////////////////////////////////////////////////////////// #include + #include -#include "../rtgui/threadutils.h" -#include "rtengine.h" -#include "improcfun.h" -#include "LUT.h" + #include "array2D.h" -#include "iccmatrices.h" -#include "imagefloat.h" -#include "labimage.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 "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 "rtengine.h" +#include "sleef.c" + +#include "../rtgui/threadutils.h" +#include "../rtgui/options.h" + #ifdef _OPENMP #include #endif + //#define BENCHMARK #include "StopWatch.h" diff --git a/rtengine/PF_correct_RT.cc b/rtengine/PF_correct_RT.cc index eb450dce9..40b4933ae 100644 --- a/rtengine/PF_correct_RT.cc +++ b/rtengine/PF_correct_RT.cc @@ -30,6 +30,7 @@ #include "gauss.h" #include "improcfun.h" #include "cieimage.h" +#include "curves.h" #include "labimage.h" #include "sleef.c" #include "../rtgui/myflatcurve.h" diff --git a/rtengine/bilateral2.h b/rtengine/bilateral2.h index f4b1a80e9..a431bcecd 100644 --- a/rtengine/bilateral2.h +++ b/rtengine/bilateral2.h @@ -16,17 +16,18 @@ * 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 "rt_math.h" -#include "mytime.h" +#include #include "array2D.h" +#include "LUT.h" +#include "mytime.h" +#include "rt_math.h" + #ifdef _OPENMP #include #endif @@ -571,7 +572,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]++; } @@ -582,12 +583,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]++; } @@ -597,12 +598,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]++; } @@ -641,5 +642,3 @@ template void bilateral (T** src, T** dst, int W, int H, int sigmar, do } #undef BINBIT #undef TRANSBIT - -#endif diff --git a/rtengine/clutstore.cc b/rtengine/clutstore.cc index cd97ed9e9..e3bd9c988 100644 --- a/rtengine/clutstore.cc +++ b/rtengine/clutstore.cc @@ -1,5 +1,8 @@ #include +#include +#include + #include "clutstore.h" #include "colortemp.h" diff --git a/rtengine/dcp.cc b/rtengine/dcp.cc index 78655dcf6..549fcf150 100644 --- a/rtengine/dcp.cc +++ b/rtengine/dcp.cc @@ -433,7 +433,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; @@ -442,14 +442,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), @@ -1149,7 +1147,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; @@ -1193,7 +1191,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) diff --git a/rtengine/dcp.h b/rtengine/dcp.h index 922b88142..573349348 100644 --- a/rtengine/dcp.h +++ b/rtengine/dcp.h @@ -36,24 +36,11 @@ 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; @@ -87,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 { @@ -149,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/dcrop.cc b/rtengine/dcrop.cc index 6d45d232b..819a6d01e 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -18,17 +18,19 @@ * along with RawTherapee. If not, see . */ -#include "colortemp.h" #include "cieimage.h" +#include "colortemp.h" +#include "curves.h" +#include "dcp.h" +#include "dcrop.h" #include "image8.h" #include "imagefloat.h" #include "labimage.h" -#include "curves.h" -#include "dcrop.h" #include "mytime.h" #include "procparams.h" #include "refreshmap.h" #include "rt_math.h" + #include "../rtgui/editcallbacks.h" namespace @@ -830,7 +832,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; diff --git a/rtengine/dirpyr_equalizer.cc b/rtengine/dirpyr_equalizer.cc index 79f85a944..d40f9fce6 100644 --- a/rtengine/dirpyr_equalizer.cc +++ b/rtengine/dirpyr_equalizer.cc @@ -18,14 +18,16 @@ * */ -#include +#include #include +#include +#include "array2D.h" #include "cieimage.h" #include "improcfun.h" -#include "array2D.h" -#include "rt_math.h" #include "opthelper.h" +#include "rt_math.h" +#include "settings.h" namespace { @@ -73,8 +75,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 +109,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 +123,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 +153,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 +186,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 +200,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; diff --git a/rtengine/dual_demosaic_RT.cc b/rtengine/dual_demosaic_RT.cc index 895d7c6fc..8a3564279 100644 --- a/rtengine/dual_demosaic_RT.cc +++ b/rtengine/dual_demosaic_RT.cc @@ -24,13 +24,16 @@ //////////////////////////////////////////////////////////////// #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; diff --git a/rtengine/filmnegativeproc.cc b/rtengine/filmnegativeproc.cc index 1eae22ad6..26c1314f4 100644 --- a/rtengine/filmnegativeproc.cc +++ b/rtengine/filmnegativeproc.cc @@ -26,6 +26,7 @@ #include "rawimage.h" #include "rawimagesource.h" +#include "coord.h" #include "mytime.h" #include "opthelper.h" #include "procparams.h" diff --git a/rtengine/imagedata.cc b/rtengine/imagedata.cc index 403f4708c..184e288e9 100644 --- a/rtengine/imagedata.cc +++ b/rtengine/imagedata.cc @@ -17,15 +17,20 @@ * 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" #pragma GCC diagnostic warning "-Wextra" #define PRINT_HDR_PS_DETECTION 0 diff --git a/rtengine/imagesource.h b/rtengine/imagesource.h index 4a679f77e..6b5a22b63 100644 --- a/rtengine/imagesource.h +++ b/rtengine/imagesource.h @@ -24,17 +24,22 @@ #include #include "coord2d.h" -#include "dcp.h" #include "imagedata.h" #include "LUT.h" #include "rtengine.h" +template +class multi_array2D; + namespace rtengine { + class ColorTemp; +class DCPProfile; +class DCPProfileApplyState; class Imagefloat; -class RetinextransmissionCurve; class RetinexgaintransmissionCurve; +class RetinextransmissionCurve; namespace procparams { @@ -126,7 +131,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 b0996c6dd..b55c6ee75 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -16,27 +16,32 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ +#include +#include +#include + #include "improccoordinator.h" #include "cieimage.h" +#include "color.h" +#include "colortemp.h" +#include "curves.h" +#include "dcp.h" +#include "iccstore.h" #include "image8.h" #include "imagefloat.h" -#include "labimage.h" -#include "curves.h" -#include "mytime.h" -#include "refreshmap.h" -#include "../rtgui/ppversion.h" -#include "colortemp.h" #include "improcfun.h" -#include "iccstore.h" +#include "labimage.h" +#include "mytime.h" #include "procparams.h" -#include -#include -#include -#include "color.h" +#include "refreshmap.h" + +#include "../rtgui/ppversion.h" + #ifdef _OPENMP #include #endif + namespace rtengine { @@ -736,7 +741,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 14e93b771..71bca1d8a 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -21,20 +21,21 @@ #include +#include "array2D.h" #include "colortemp.h" -#include "rtengine.h" -#include "improcfun.h" -#include "imagesource.h" -#include "procevents.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 rtengine { -class Image8; - using namespace procparams; class Crop; diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 90cd438d6..c84027e6a 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -2050,7 +2050,7 @@ 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) + 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); } @@ -2058,7 +2058,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer // 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) + 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 16b8e27b0..a47ba2980 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -24,18 +24,27 @@ #include "color.h" #include "LUT.h" #include "lcp.h" -#include "dcp.h" #include "pipettebuffer.h" #include "gamutwarning.h" +template +class multi_array2D; + namespace rtengine { + +class ColorAppearance; class ColorGradientCurve; +class DCPProfile; +class DCPProfileApplyState; +class FlatCurve; +class FramesMetaData; +class NoiseCurve; class OpacityCurve; class ToneCurve; class WavCurve; -class WavOpacityCurveRG; class WavOpacityCurveBY; +class WavOpacityCurveRG; class WavOpacityCurveW; class WavOpacityCurveWL; @@ -50,6 +59,7 @@ namespace procparams class ProcParams; +struct ColorManagementParams; struct DirPyrDenoiseParams; struct SharpeningParams; struct VignettingParams; @@ -113,11 +123,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); diff --git a/rtengine/ipdehaze.cc b/rtengine/ipdehaze.cc index 7ca4d72ad..ce5843da8 100644 --- a/rtengine/ipdehaze.cc +++ b/rtengine/ipdehaze.cc @@ -40,7 +40,7 @@ #include "rescale.h" #include "rt_math.h" -extern Options options; +#include "../rtgui/options.h" namespace rtengine { diff --git a/rtengine/iplabregions.cc b/rtengine/iplabregions.cc index d6b7294f6..932b7e18d 100644 --- a/rtengine/iplabregions.cc +++ b/rtengine/iplabregions.cc @@ -22,14 +22,17 @@ #include #endif +#include "curves.h" +#include "guidedfilter.h" #include "iccstore.h" #include "improcfun.h" #include "labimage.h" -#include "guidedfilter.h" #include "procparams.h" + +#include "sleef.c" + //#define BENCHMARK #include "StopWatch.h" -#include "sleef.c" namespace { diff --git a/rtengine/ipretinex.cc b/rtengine/ipretinex.cc index e443b5bca..ab3a632da 100644 --- a/rtengine/ipretinex.cc +++ b/rtengine/ipretinex.cc @@ -41,6 +41,7 @@ #include #include +#include "curves.h" #include "gauss.h" #include "improcfun.h" #include "jaggedarray.h" @@ -135,8 +136,6 @@ void mean_stddv2( float **dst, float &mean, float &stddv, int W_L, int H_L, floa 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 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 1e8842cbb..a1e91c4ab 100644 --- a/rtengine/ipshadowshighlights.cc +++ b/rtengine/ipshadowshighlights.cc @@ -20,12 +20,14 @@ #include "improcfun.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" namespace rtengine { diff --git a/rtengine/ipsharpen.cc b/rtengine/ipsharpen.cc index 1223ff9ce..8f63b59f6 100644 --- a/rtengine/ipsharpen.cc +++ b/rtengine/ipsharpen.cc @@ -17,19 +17,22 @@ * along with RawTherapee. If not, see . */ -#include "improcfun.h" -#include "cieimage.h" -#include "labimage.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.c" + //#define BENCHMARK #include "StopWatch.h" -#include "rt_algo.h" + using namespace std; namespace { diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 078b9d585..4cd16f90b 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -28,19 +28,20 @@ #include "../rtgui/threadutils.h" -#include "rtengine.h" +#include "array2D.h" +#include "curves.h" +#include "EdgePreservingDecomposition.h" +#include "iccstore.h" #include "improcfun.h" #include "labimage.h" #include "LUT.h" -#include "array2D.h" -#include "rt_math.h" -#include "mytime.h" -#include "sleef.c" -#include "opthelper.h" #include "median.h" -#include "EdgePreservingDecomposition.h" -#include "iccstore.h" +#include "mytime.h" +#include "opthelper.h" #include "procparams.h" +#include "rt_math.h" +#include "rtengine.h" +#include "sleef.c" #ifdef _OPENMP #include diff --git a/rtengine/pixelshift.cc b/rtengine/pixelshift.cc index abe6a0536..ca5e742fb 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 "../rtgui/multilangmgr.h" +#include "../rtgui/options.h" + //#define BENCHMARK #include "StopWatch.h" + namespace { diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index ca324a5c1..7d101ff5d 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -19,34 +19,38 @@ #include #include -#include "rtengine.h" -#include "imagefloat.h" -#include "rawimage.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 "rawimage.h" +#include "rawimagesource_i.h" +#include "rawimagesource.h" +#include "rt_math.h" +#include "rtengine.h" +#include "rtlensfun.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) @@ -935,7 +939,7 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima } } -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 118dcb559..82e842ad3 100644 --- a/rtengine/rawimagesource.h +++ b/rtengine/rawimagesource.h @@ -182,7 +182,7 @@ 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); diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 7f232d8be..d10e2b1dc 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -16,33 +16,39 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ +#include + +#include + +#include + +#include + #include "cieimage.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/options.h" +#include "../rtgui/ppversion.h" namespace { @@ -1365,7 +1371,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; diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index b7bc46cb1..978479304 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -17,6 +17,7 @@ * along with RawTherapee. If not, see . */ #include "cieimage.h" +#include "dcp.h" #include "imagefloat.h" #include "labimage.h" #include "rtengine.h" @@ -243,7 +244,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 ); @@ -998,7 +998,7 @@ 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; + DCPProfileApplyState as; DCPProfile *dcpProf = imgsrc->getDCP (params.icm, as); LUTu histToneCurve; From 1d51016bdde96e08be9c553967eae87c41f3e223 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Wed, 30 Oct 2019 14:07:49 +0100 Subject: [PATCH 15/40] Fix some lgtm issues --- rtengine/CA_correct_RT.cc | 2 +- rtengine/array2D.h | 2 +- rtengine/capturesharpening.cc | 4 ++-- rtengine/cfa_linedn_RT.cc | 2 +- rtengine/demosaic_algos.cc | 16 ++++++++-------- rtengine/pixelshift.cc | 4 ++-- rtengine/tmo_fattal02.cc | 4 ++-- rtengine/vng4_demosaic_RT.cc | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index a2d68402f..05fd806ca 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -198,7 +198,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/array2D.h b/rtengine/array2D.h index 7713cd55c..d25e20a83 100644 --- a/rtengine/array2D.h +++ b/rtengine/array2D.h @@ -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)); } } diff --git a/rtengine/capturesharpening.cc b/rtengine/capturesharpening.cc index 4eeca1f15..bbc0be50b 100644 --- a/rtengine/capturesharpening.cc +++ b/rtengine/capturesharpening.cc @@ -583,10 +583,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); diff --git a/rtengine/cfa_linedn_RT.cc b/rtengine/cfa_linedn_RT.cc index 3aef79133..ba26740c1 100644 --- a/rtengine/cfa_linedn_RT.cc +++ b/rtengine/cfa_linedn_RT.cc @@ -62,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/demosaic_algos.cc b/rtengine/demosaic_algos.cc index 52e15be54..f1b9cb5e8 100644 --- a/rtengine/demosaic_algos.cc +++ b/rtengine/demosaic_algos.cc @@ -77,7 +77,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++) { @@ -375,9 +375,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 @@ -542,14 +542,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; @@ -1144,7 +1144,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; @@ -2039,7 +2039,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/pixelshift.cc b/rtengine/pixelshift.cc index ca5e742fb..9cb5844c2 100644 --- a/rtengine/pixelshift.cc +++ b/rtengine/pixelshift.cc @@ -114,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(); diff --git a/rtengine/tmo_fattal02.cc b/rtengine/tmo_fattal02.cc index f1822b486..31671bd0c 100644 --- a/rtengine/tmo_fattal02.cc +++ b/rtengine/tmo_fattal02.cc @@ -1094,7 +1094,7 @@ void ImProcFunctions::ToneMapFattal02 (Imagefloat *rgb) float oldMedian; const float percentile = float(LIM(params->fattal.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; @@ -1136,7 +1136,7 @@ void ImProcFunctions::ToneMapFattal02 (Imagefloat *rgb) 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 384ec3219..aaaa1b9a6 100644 --- a/rtengine/vng4_demosaic_RT.cc +++ b/rtengine/vng4_demosaic_RT.cc @@ -103,7 +103,7 @@ void RawImageSource::vng4_demosaic (const array2D &rawData, array2D(height) * width, sizeof * image); int lcode[16][16][32]; float mul[16][16][8]; From ba8dda18365a8eb4db65b372fda5d2c0686c0fb3 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Wed, 30 Oct 2019 16:38:02 +0100 Subject: [PATCH 16/40] Further cleanup of include dependencies --- rtengine/dcp.cc | 1 + rtengine/iccstore.cc | 1 + rtengine/improccoordinator.cc | 2 ++ rtengine/iplab2rgb.cc | 1 - rtengine/ipwavelet.cc | 2 +- rtengine/procparams.h | 2 +- rtengine/rawimagesource.cc | 1 + rtengine/rtthumbnail.cc | 2 -- rtgui/batchqueue.h | 1 - rtgui/batchtoolpanelcoord.h | 3 ++- rtgui/blackwhite.cc | 1 + rtgui/colorappearance.cc | 1 + rtgui/colortoning.cc | 1 + rtgui/crop.cc | 2 -- rtgui/cropwindow.h | 6 +++++- rtgui/cursormanager.cc | 1 - rtgui/curveeditorgroup.cc | 1 + rtgui/defringe.cc | 1 + rtgui/diagonalcurveeditorsubgroup.cc | 1 + rtgui/dirpyrdenoise.cc | 4 ++-- rtgui/dirpyrdenoise.h | 1 - rtgui/filebrowser.cc | 2 -- rtgui/flatcurveeditorsubgroup.cc | 1 + rtgui/histogrampanel.cc | 2 -- rtgui/hsvequalizer.cc | 2 ++ rtgui/iccprofilecreator.cc | 2 -- rtgui/iccprofilecreator.h | 1 - rtgui/icmpanel.cc | 2 -- rtgui/inspector.cc | 2 -- rtgui/labcurve.cc | 2 ++ rtgui/lockablecolorpicker.cc | 2 -- rtgui/main-cli.cc | 2 -- rtgui/main.cc | 2 -- rtgui/mycurve.h | 1 - rtgui/navigator.cc | 2 -- rtgui/options.cc | 1 + rtgui/options.h | 12 +++++++----- rtgui/preferences.cc | 1 - rtgui/renamedlg.cc | 1 - rtgui/retinex.cc | 1 + rtgui/rgbcurves.cc | 2 ++ rtgui/rtimage.cc | 1 + rtgui/rtscalable.cc | 3 ++- rtgui/saveasdlg.cc | 2 -- rtgui/saveasdlg.h | 1 - rtgui/thumbnail.h | 1 - rtgui/tonecurve.cc | 1 + rtgui/vibrance.cc | 1 + rtgui/wavelet.cc | 2 +- rtgui/wavelet.h | 1 - 50 files changed, 44 insertions(+), 48 deletions(-) diff --git a/rtengine/dcp.cc b/rtengine/dcp.cc index 549fcf150..9dbee9375 100644 --- a/rtengine/dcp.cc +++ b/rtengine/dcp.cc @@ -31,6 +31,7 @@ #include "imagefloat.h" #include "rawimagesource.h" #include "rt_math.h" +#include "../rtgui/options.h" namespace rtengine { diff --git a/rtengine/iccstore.cc b/rtengine/iccstore.cc index 7151e244d..02a1fffac 100644 --- a/rtengine/iccstore.cc +++ b/rtengine/iccstore.cc @@ -35,6 +35,7 @@ #include "iccmatrices.h" +#include "../rtgui/guiutils.h" #include "../rtgui/options.h" #include "../rtgui/threadutils.h" #include "lcms2_plugin.h" diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index b55c6ee75..090c3376d 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -36,12 +36,14 @@ #include "procparams.h" #include "refreshmap.h" +#include "../rtgui/options.h" #include "../rtgui/ppversion.h" #ifdef _OPENMP #include #endif + namespace rtengine { diff --git a/rtengine/iplab2rgb.cc b/rtengine/iplab2rgb.cc index f2b337e01..6166c928e 100644 --- a/rtengine/iplab2rgb.cc +++ b/rtengine/iplab2rgb.cc @@ -24,7 +24,6 @@ #include #include "iccstore.h" #include "iccmatrices.h" -#include "../rtgui/options.h" #include "settings.h" #include "alignedbuffer.h" #include "color.h" diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 4cd16f90b..2ba6ec97b 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -42,6 +42,7 @@ #include "rt_math.h" #include "rtengine.h" #include "sleef.c" +#include "../rtgui/options.h" #ifdef _OPENMP #include @@ -56,7 +57,6 @@ #define epsilon 0.001f/(TS*TS) //tolerance - namespace rtengine { diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 57c27063e..015b487ff 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -20,11 +20,11 @@ #include #include +#include #include #include #include -#include #include #include "noncopyable.h" diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 7d101ff5d..347331467 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -40,6 +40,7 @@ #include "rt_math.h" #include "rtengine.h" #include "rtlensfun.h" +#include "../rtgui/options.h" //#define BENCHMARK //#include "StopWatch.h" diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index d10e2b1dc..4a7fb2d11 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -191,8 +191,6 @@ void scale_colors (rtengine::RawImage *ri, float scale_mul[4], float cblack[4], } -extern Options options; - namespace rtengine { diff --git a/rtgui/batchqueue.h b/rtgui/batchqueue.h index f61b7b5c4..7248ac793 100644 --- a/rtgui/batchqueue.h +++ b/rtgui/batchqueue.h @@ -26,7 +26,6 @@ #include "batchqueueentry.h" #include "lwbuttonset.h" -#include "options.h" #include "threadutils.h" #include "thumbbrowserbase.h" #include "../rtengine/noncopyable.h" diff --git a/rtgui/batchtoolpanelcoord.h b/rtgui/batchtoolpanelcoord.h index f03d1d4b2..53741be49 100644 --- a/rtgui/batchtoolpanelcoord.h +++ b/rtgui/batchtoolpanelcoord.h @@ -22,7 +22,8 @@ #include "thumbnail.h" #include "toolpanelcoord.h" #include "fileselectionchangelistener.h" -#include "../rtengine/rtengine.h" +#include "../rtengine/procparams.h" +#include "../rtengine/procevents.h" #include "paramsedited.h" #include "thumbnaillistener.h" diff --git a/rtgui/blackwhite.cc b/rtgui/blackwhite.cc index b5ecb96bd..482bf437f 100644 --- a/rtgui/blackwhite.cc +++ b/rtgui/blackwhite.cc @@ -23,6 +23,7 @@ #include "guiutils.h" #include "rtimage.h" +#include "options.h" #include "../rtengine/color.h" #include "../rtengine/procparams.h" diff --git a/rtgui/colorappearance.cc b/rtgui/colorappearance.cc index f8eb736d4..0d155e97b 100644 --- a/rtgui/colorappearance.cc +++ b/rtgui/colorappearance.cc @@ -21,6 +21,7 @@ #include "colorappearance.h" #include "guiutils.h" +#include "options.h" #include "../rtengine/color.h" #include "../rtengine/procparams.h" diff --git a/rtgui/colortoning.cc b/rtgui/colortoning.cc index e164739e5..f177602a3 100644 --- a/rtgui/colortoning.cc +++ b/rtgui/colortoning.cc @@ -6,6 +6,7 @@ #include "rtimage.h" #include "eventmapper.h" #include "labgrid.h" +#include "options.h" using namespace rtengine; using namespace rtengine::procparams; 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/cropwindow.h b/rtgui/cropwindow.h index 99b0fd897..be07db5c9 100644 --- a/rtgui/cropwindow.h +++ b/rtgui/cropwindow.h @@ -19,7 +19,6 @@ #ifndef _CROPWINDOW_ #define _CROPWINDOW_ -#include "../rtengine/rtengine.h" #include #include "lwbutton.h" #include "lwbuttonset.h" @@ -33,6 +32,11 @@ #include "editcoordsys.h" #include "../rtengine/noncopyable.h" +namespace rtengine { + +class Coord; + +} class CropWindow; class CropWindowListener 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/curveeditorgroup.cc b/rtgui/curveeditorgroup.cc index 0e7205518..edad0349d 100644 --- a/rtgui/curveeditorgroup.cc +++ b/rtgui/curveeditorgroup.cc @@ -25,6 +25,7 @@ #include "flatcurveeditorsubgroup.h" #include "multilangmgr.h" #include "rtimage.h" +#include "options.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/defringe.cc b/rtgui/defringe.cc index 659d41960..8aa79dddd 100644 --- a/rtgui/defringe.cc +++ b/rtgui/defringe.cc @@ -20,6 +20,7 @@ #include #include "defringe.h" +#include "options.h" #include "../rtengine/procparams.h" 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/dirpyrdenoise.cc b/rtgui/dirpyrdenoise.cc index 2a0bba596..dd695eecf 100644 --- a/rtgui/dirpyrdenoise.cc +++ b/rtgui/dirpyrdenoise.cc @@ -21,14 +21,14 @@ #include "dirpyrdenoise.h" +#include "editbuffer.h" #include "guiutils.h" +#include "options.h" #include "../rtengine/procparams.h" -#include "editbuffer.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..05304e4f7 100644 --- a/rtgui/dirpyrdenoise.h +++ b/rtgui/dirpyrdenoise.h @@ -26,7 +26,6 @@ #include "curveeditorgroup.h" #include "colorprovider.h" #include "guiutils.h" -#include "options.h" class EditDataProvider; diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index d4f5bb8ca..5817222dd 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -37,8 +37,6 @@ #include "../rtengine/ffmanager.h" #include "../rtengine/procparams.h" -extern Options options; - namespace { diff --git a/rtgui/flatcurveeditorsubgroup.cc b/rtgui/flatcurveeditorsubgroup.cc index 6dc3a1f5b..b5dc4f726 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/histogrampanel.cc b/rtgui/histogrampanel.cc index 74e473096..ddf60ca75 100644 --- a/rtgui/histogrampanel.cc +++ b/rtgui/histogrampanel.cc @@ -28,8 +28,6 @@ using namespace rtengine; -extern Options options; - // // 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/iccprofilecreator.cc b/rtgui/iccprofilecreator.cc index 2728a7611..0ac0b79f3 100644 --- a/rtgui/iccprofilecreator.cc +++ b/rtgui/iccprofilecreator.cc @@ -29,8 +29,6 @@ #include #endif -extern Options options; - namespace rtengine { diff --git a/rtgui/iccprofilecreator.h b/rtgui/iccprofilecreator.h index b28ac29f2..950fcc01f 100644 --- a/rtgui/iccprofilecreator.h +++ b/rtgui/iccprofilecreator.h @@ -21,7 +21,6 @@ #include #include "adjuster.h" -#include "options.h" #include #include "rtwindow.h" diff --git a/rtgui/icmpanel.cc b/rtgui/icmpanel.cc index 012aeca78..99bd6cfca 100644 --- a/rtgui/icmpanel.cc +++ b/rtgui/icmpanel.cc @@ -32,8 +32,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/inspector.cc b/rtgui/inspector.cc index 8bd9862a7..ad2e424ec 100644 --- a/rtgui/inspector.cc +++ b/rtgui/inspector.cc @@ -24,8 +24,6 @@ #include "options.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/labcurve.cc b/rtgui/labcurve.cc index 237f9ea9b..fd1065269 100644 --- a/rtgui/labcurve.cc +++ b/rtgui/labcurve.cc @@ -20,6 +20,8 @@ #include "labcurve.h" +#include "options.h" + #include "../rtengine/improcfun.h" #include "../rtengine/procparams.h" #include "editcallbacks.h" diff --git a/rtgui/lockablecolorpicker.cc b/rtgui/lockablecolorpicker.cc index ef16df6ec..a4f3dbdab 100644 --- a/rtgui/lockablecolorpicker.cc +++ b/rtgui/lockablecolorpicker.cc @@ -25,8 +25,6 @@ #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/main-cli.cc b/rtgui/main-cli.cc index 09aab1cff..8310867df 100644 --- a/rtgui/main-cli.cc +++ b/rtgui/main-cli.cc @@ -55,8 +55,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 631d3db0a..997f20732 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -53,8 +53,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/mycurve.h b/rtgui/mycurve.h index fd22660ea..b5577e8dd 100644 --- a/rtgui/mycurve.h +++ b/rtgui/mycurve.h @@ -26,7 +26,6 @@ #include "coloredbar.h" #include "coordinateadjuster.h" #include "../rtengine/LUT.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 */ diff --git a/rtgui/navigator.cc b/rtgui/navigator.cc index 50946f32f..6a8137737 100644 --- a/rtgui/navigator.cc +++ b/rtgui/navigator.cc @@ -23,8 +23,6 @@ #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/options.cc b/rtgui/options.cc index 9757fa3b7..8d8d52c83 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -19,6 +19,7 @@ #include "options.h" #include #include +#include #include #include #include "multilangmgr.h" diff --git a/rtgui/options.h b/rtgui/options.h index 990a32228..b2263f59c 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -16,12 +16,11 @@ * 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 "../rtengine/settings.h" #include #define STARTUPDIR_CURRENT 0 @@ -103,6 +102,11 @@ 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: @@ -447,5 +451,3 @@ extern bool gimpPlugin; extern bool remote; extern Glib::ustring versionString; extern Glib::ustring paramFileExtension; - -#endif diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 3c0d1bedc..2676e0940 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -50,7 +50,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/renamedlg.cc b/rtgui/renamedlg.cc index 8f55b3653..81bcd86e5 100644 --- a/rtgui/renamedlg.cc +++ b/rtgui/renamedlg.cc @@ -18,7 +18,6 @@ */ #include "renamedlg.h" #include "multilangmgr.h" -#include "options.h" #include "rtimage.h" RenameDialog::RenameDialog (Gtk::Window* parent) diff --git a/rtgui/retinex.cc b/rtgui/retinex.cc index e074d7e9c..dddf1da20 100644 --- a/rtgui/retinex.cc +++ b/rtgui/retinex.cc @@ -4,6 +4,7 @@ #include "retinex.h" #include "mycurve.h" #include "rtimage.h" +#include "options.h" using namespace rtengine; using namespace rtengine::procparams; 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/rtimage.cc b/rtgui/rtimage.cc index e35a6d164..ff27dbbd3 100644 --- a/rtgui/rtimage.cc +++ b/rtgui/rtimage.cc @@ -20,6 +20,7 @@ #include "rtimage.h" +#include #include #include "options.h" diff --git a/rtgui/rtscalable.cc b/rtgui/rtscalable.cc index fa92655ac..b803ab270 100644 --- a/rtgui/rtscalable.cc +++ b/rtgui/rtscalable.cc @@ -25,11 +25,12 @@ #include #include "options.h" +#include "../rtengine/rt_math.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; diff --git a/rtgui/saveasdlg.cc b/rtgui/saveasdlg.cc index 1b61d7d3d..5516bdf7c 100644 --- a/rtgui/saveasdlg.cc +++ b/rtgui/saveasdlg.cc @@ -26,8 +26,6 @@ #include "../rtengine/utils.h" -extern Options options; - namespace { diff --git a/rtgui/saveasdlg.h b/rtgui/saveasdlg.h index dd120337d..4097a3ae9 100644 --- a/rtgui/saveasdlg.h +++ b/rtgui/saveasdlg.h @@ -22,7 +22,6 @@ #include #include "adjuster.h" #include "saveformatpanel.h" -#include "options.h" class SaveAsDialog : public Gtk::Dialog, public FormatChangeListener { diff --git a/rtgui/thumbnail.h b/rtgui/thumbnail.h index b1c45fdfa..cacffbd58 100644 --- a/rtgui/thumbnail.h +++ b/rtgui/thumbnail.h @@ -24,7 +24,6 @@ #include #include "cachemanager.h" -#include "options.h" #include "../rtengine/rtengine.h" #include "../rtengine/rtthumbnail.h" #include "cacheimagedata.h" diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc index fa1c80ed8..1f660f72a 100644 --- a/rtgui/tonecurve.cc +++ b/rtgui/tonecurve.cc @@ -25,6 +25,7 @@ #include "adjuster.h" #include "eventmapper.h" #include "ppversion.h" +#include "options.h" #include "../rtengine/procparams.h" #include "editcallbacks.h" 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/wavelet.cc b/rtgui/wavelet.cc index 94f96e0cc..6e49d36b9 100644 --- a/rtgui/wavelet.cc +++ b/rtgui/wavelet.cc @@ -23,10 +23,10 @@ #include "editcallbacks.h" #include "guiutils.h" #include "rtimage.h" +#include "options.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; From 4dcee23cb34d5e8b093fb6bf7788505bf0a74451 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Wed, 30 Oct 2019 18:06:30 +0100 Subject: [PATCH 17/40] Fix broken lgtm build --- rtengine/settings.h | 7 ++----- rtgui/options.h | 1 + 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/rtengine/settings.h b/rtengine/settings.h index 8852c05c8..a32a1b7dd 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 { @@ -97,6 +97,3 @@ public: static void destroy(Settings* s); }; } - -#endif - diff --git a/rtgui/options.h b/rtgui/options.h index b2263f59c..33d6b6f90 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -19,6 +19,7 @@ #pragma once #include +#include #include #include "../rtengine/settings.h" #include From 6935faa2583762d0ae383c302f09b75b965beb72 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Wed, 30 Oct 2019 22:12:06 +0100 Subject: [PATCH 18/40] Further cleanup of include dependencies --- rtengine/CA_correct_RT.cc | 5 +---- rtengine/FTblockDN.cc | 4 ---- rtengine/camconst.cc | 2 -- rtengine/ciecam02.cc | 4 ---- rtengine/color.cc | 2 -- rtengine/colortemp.cc | 2 -- rtengine/dcp.cc | 9 +-------- rtengine/dcrop.cc | 2 -- rtengine/demosaic_algos.cc | 2 -- rtengine/dfmanager.cc | 2 -- rtengine/dirpyr_equalizer.cc | 2 -- rtengine/dynamicprofile.cc | 6 +++--- rtengine/ffmanager.cc | 2 -- rtengine/filmnegativeproc.cc | 7 ------- rtengine/filmnegativethumb.cc | 8 -------- rtengine/hilite_recon.cc | 2 -- rtengine/iccstore.cc | 7 +------ rtengine/imageio.cc | 2 +- rtengine/improccoordinator.cc | 2 -- rtengine/improcfun.cc | 2 -- rtengine/init.cc | 2 +- rtengine/ipdehaze.cc | 10 +++++----- rtengine/iplab2rgb.cc | 2 -- rtengine/ipsharpen.cc | 2 -- rtengine/ipwavelet.cc | 2 -- rtengine/lcp.cc | 7 ------- rtengine/profilestore.cc | 12 ++++++------ rtengine/rawimage.cc | 2 -- rtengine/rawimagesource.cc | 1 - rtengine/rtengine.h | 2 +- rtengine/rtthumbnail.cc | 19 ++++++++----------- rtengine/settings.h | 1 + rtengine/shmap.cc | 2 -- rtengine/simpleprocess.cc | 1 - rtengine/stdimagesource.cc | 2 -- rtgui/adjuster.cc | 2 +- rtgui/cacheimagedata.cc | 11 ++++++----- rtgui/cachemanager.cc | 10 +++++----- rtgui/colorappearance.cc | 1 + rtgui/dirbrowser.cc | 4 ++-- rtgui/dynamicprofilepanel.cc | 4 ++-- rtgui/editwindow.h | 1 + rtgui/extprog.cc | 4 ++-- rtgui/fattaltonemap.cc | 1 + rtgui/filecatalog.cc | 4 ++-- rtgui/guiutils.h | 14 ++++++++++++-- rtgui/iccprofilecreator.cc | 7 ------- rtgui/inspector.cc | 1 + rtgui/inspector.h | 2 ++ rtgui/labgrid.cc | 1 + rtgui/lensprofile.cc | 10 +++++----- rtgui/main.cc | 2 +- rtgui/mycurve.cc | 1 + rtgui/mycurve.h | 1 + rtgui/mydiagonalcurve.cc | 1 + rtgui/myflatcurve.cc | 1 + rtgui/options.cc | 1 + rtgui/profilepanel.h | 3 ++- rtgui/rtimage.cc | 4 ++-- rtgui/rtscalable.cc | 4 ++-- rtgui/rtwindow.cc | 8 ++++---- rtgui/shcselector.cc | 3 +++ rtgui/thresholdselector.cc | 1 + rtgui/thumbnail.cc | 4 ++-- rtgui/toolbar.cc | 1 + rtgui/toolbar.h | 3 ++- rtgui/toolpanel.cc | 1 + rtgui/toolpanelcoord.cc | 1 + 68 files changed, 100 insertions(+), 158 deletions(-) diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index 05fd806ca..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; diff --git a/rtengine/FTblockDN.cc b/rtengine/FTblockDN.cc index b708f521a..02164aded 100644 --- a/rtengine/FTblockDN.cc +++ b/rtengine/FTblockDN.cc @@ -78,11 +78,7 @@ namespace rtengine */ -//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -extern const Settings* settings; extern MyMutex *fftwMutex; diff --git a/rtengine/camconst.cc b/rtengine/camconst.cc index 93f0057f1..e8f7b1cbf 100644 --- a/rtengine/camconst.cc +++ b/rtengine/camconst.cc @@ -20,8 +20,6 @@ namespace rtengine { -extern const Settings* settings; - CameraConst::CameraConst() : pdafOffset(0) { memset(dcraw_matrix, 0, sizeof(dcraw_matrix)); diff --git a/rtengine/ciecam02.cc b/rtengine/ciecam02.cc index 3219884ad..0553c129e 100644 --- a/rtengine/ciecam02.cc +++ b/rtengine/ciecam02.cc @@ -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/color.cc b/rtengine/color.cc index 7a91f0073..20b2c7310 100644 --- a/rtengine/color.cc +++ b/rtengine/color.cc @@ -30,8 +30,6 @@ using namespace std; namespace rtengine { -extern const Settings* settings; - cmsToneCurve* Color::linearGammaTRC; LUTf Color::cachef; LUTf Color::cachefy; diff --git a/rtengine/colortemp.cc b/rtengine/colortemp.cc index 927d8423d..413880d49 100644 --- a/rtengine/colortemp.cc +++ b/rtengine/colortemp.cc @@ -31,8 +31,6 @@ 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/dcp.cc b/rtengine/dcp.cc index 9dbee9375..ea4e40514 100644 --- a/rtengine/dcp.cc +++ b/rtengine/dcp.cc @@ -33,13 +33,6 @@ #include "rt_math.h" #include "../rtgui/options.h" -namespace rtengine -{ - -extern const Settings* settings; - -} - using namespace rtengine; using namespace rtexif; @@ -1868,7 +1861,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/dcrop.cc b/rtengine/dcrop.cc index 819a6d01e..06c9d59bd 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -48,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), cropImg (nullptr), transCrop (nullptr), cieCrop (nullptr), diff --git a/rtengine/demosaic_algos.cc b/rtengine/demosaic_algos.cc index f1b9cb5e8..823260129 100644 --- a/rtengine/demosaic_algos.cc +++ b/rtengine/demosaic_algos.cc @@ -40,8 +40,6 @@ using namespace std; namespace rtengine { -extern const Settings* settings; - #undef ABS #define ABS(a) ((a)<0?-(a):(a)) diff --git a/rtengine/dfmanager.cc b/rtengine/dfmanager.cc index fbeb2596e..f5a7686e6 100644 --- a/rtengine/dfmanager.cc +++ b/rtengine/dfmanager.cc @@ -29,8 +29,6 @@ namespace rtengine { -extern const Settings* settings; - // *********************** class dfInfo ************************************** inline dfInfo& dfInfo::operator =(const dfInfo &o) diff --git a/rtengine/dirpyr_equalizer.cc b/rtengine/dirpyr_equalizer.cc index d40f9fce6..6fd4f002c 100644 --- a/rtengine/dirpyr_equalizer.cc +++ b/rtengine/dirpyr_equalizer.cc @@ -350,8 +350,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/dynamicprofile.cc b/rtengine/dynamicprofile.cc index 607b0b528..402610ed1 100644 --- a/rtengine/dynamicprofile.cc +++ b/rtengine/dynamicprofile.cc @@ -179,7 +179,7 @@ bool DynamicProfileRules::loadRules() return false; } - if (options.rtSettings.verbose) { + if (settings->verbose) { printf ("loading dynamic profiles...\n"); } @@ -198,7 +198,7 @@ bool DynamicProfileRules::loadRules() return false; } - if (options.rtSettings.verbose) { + if (settings->verbose) { printf (" loading rule %d\n", serial); } @@ -228,7 +228,7 @@ bool DynamicProfileRules::loadRules() bool DynamicProfileRules::storeRules() { - if (options.rtSettings.verbose) { + if (settings->verbose) { printf ("saving dynamic profiles...\n"); } diff --git a/rtengine/ffmanager.cc b/rtengine/ffmanager.cc index dbbc25b81..d8b082dd1 100644 --- a/rtengine/ffmanager.cc +++ b/rtengine/ffmanager.cc @@ -30,8 +30,6 @@ namespace rtengine { -extern const Settings* settings; - // *********************** class ffInfo ************************************** inline ffInfo& ffInfo::operator =(const ffInfo &o) diff --git a/rtengine/filmnegativeproc.cc b/rtengine/filmnegativeproc.cc index 26c1314f4..f373f8c14 100644 --- a/rtengine/filmnegativeproc.cc +++ b/rtengine/filmnegativeproc.cc @@ -36,13 +36,6 @@ //#define BENCHMARK #include "StopWatch.h" -namespace rtengine -{ - -extern const Settings* settings; - -} - namespace { diff --git a/rtengine/filmnegativethumb.cc b/rtengine/filmnegativethumb.cc index 6a4da31b0..1e52300d4 100644 --- a/rtengine/filmnegativethumb.cc +++ b/rtengine/filmnegativethumb.cc @@ -22,19 +22,11 @@ #include "rtthumbnail.h" #include "opthelper.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/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/iccstore.cc b/rtengine/iccstore.cc index 02a1fffac..02fe4c16d 100644 --- a/rtengine/iccstore.cc +++ b/rtengine/iccstore.cc @@ -34,6 +34,7 @@ #include "iccstore.h" #include "iccmatrices.h" +#include "utils.h" #include "../rtgui/guiutils.h" #include "../rtgui/options.h" @@ -44,12 +45,6 @@ #include "cJSON.h" #define inkc_constant 0x696E6B43 -namespace rtengine -{ - -extern const Settings* settings; - -} namespace { diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index f335f5be8..c586aabaf 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -810,7 +810,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/improccoordinator.cc b/rtengine/improccoordinator.cc index 090c3376d..c61b37341 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -47,8 +47,6 @@ namespace rtengine { -extern const Settings* settings; - ImProcCoordinator::ImProcCoordinator() : orig_prev(nullptr), oprevi(nullptr), diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index c84027e6a..886e49567 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -267,8 +267,6 @@ namespace rtengine using namespace procparams; -extern const Settings* settings; - ImProcFunctions::~ImProcFunctions () { if (monitorTransform) { diff --git a/rtengine/init.cc b/rtengine/init.cc index 8d3ee96cb..453374e3a 100644 --- a/rtengine/init.cc +++ b/rtengine/init.cc @@ -42,7 +42,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 ce5843da8..729282dbe 100644 --- a/rtengine/ipdehaze.cc +++ b/rtengine/ipdehaze.cc @@ -200,7 +200,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; } @@ -284,7 +284,7 @@ void ImProcFunctions::dehaze(Imagefloat *img) const int H = img->getHeight(); const float strength = LIM01(float(params->dehaze.strength) / 100.f * 0.9f); - if (options.rtSettings.verbose) { + if (settings->verbose) { std::cout << "dehaze: strength = " << strength << std::endl; } @@ -326,7 +326,7 @@ void ImProcFunctions::dehaze(Imagefloat *img) } 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); @@ -334,7 +334,7 @@ void ImProcFunctions::dehaze(Imagefloat *img) } 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; @@ -349,7 +349,7 @@ void ImProcFunctions::dehaze(Imagefloat *img) 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; } diff --git a/rtengine/iplab2rgb.cc b/rtengine/iplab2rgb.cc index 6166c928e..1d3f2f494 100644 --- a/rtengine/iplab2rgb.cc +++ b/rtengine/iplab2rgb.cc @@ -34,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/ipsharpen.cc b/rtengine/ipsharpen.cc index 8f63b59f6..0758011bb 100644 --- a/rtengine/ipsharpen.cc +++ b/rtengine/ipsharpen.cc @@ -161,8 +161,6 @@ 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 procparams::SharpeningParams &sharpenParam, double Scale) { if (sharpenParam.deconvamount == 0 && sharpenParam.blurradius < 0.25f) { diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 2ba6ec97b..d550664b9 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -60,8 +60,6 @@ namespace rtengine { -extern const Settings* settings; - struct cont_params { float mul[10]; int chrom; diff --git a/rtengine/lcp.cc b/rtengine/lcp.cc index e2442e094..0b73f6960 100644 --- a/rtengine/lcp.cc +++ b/rtengine/lcp.cc @@ -35,13 +35,6 @@ #include "settings.h" #include "utils.h" -namespace rtengine -{ - -extern const Settings* settings; - -} - class rtengine::LCPProfile::LCPPersModel { public: diff --git a/rtengine/profilestore.cc b/rtengine/profilestore.cc index 23e4d8321..7d937e736 100644 --- a/rtengine/profilestore.cc +++ b/rtengine/profilestore.cc @@ -160,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()); } } @@ -168,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()); } } @@ -220,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()); } @@ -233,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"); } @@ -244,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"); } } @@ -522,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/rawimage.cc b/rtengine/rawimage.cc index 0134d4d16..a69a97ab7 100644 --- a/rtengine/rawimage.cc +++ b/rtengine/rawimage.cc @@ -19,8 +19,6 @@ namespace rtengine { -extern const Settings* settings; - RawImage::RawImage( const Glib::ustring &name ) : data(nullptr) , prefilters(0) diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 347331467..0836a3832 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -426,7 +426,6 @@ void transLineD1x (const float* const red, const float* const green, const float namespace rtengine { -extern const Settings* settings; #undef ABS #undef DIST diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h index f2c448805..389fe8355 100644 --- a/rtengine/rtengine.h +++ b/rtengine/rtengine.h @@ -562,7 +562,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/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 4a7fb2d11..3b6046b4e 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -47,7 +47,6 @@ #include "StopWatch.h" #include "utils.h" -#include "../rtgui/options.h" #include "../rtgui/ppversion.h" namespace @@ -194,8 +193,6 @@ void scale_colors (rtengine::RawImage *ri, float scale_mul[4], float cblack[4], 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) @@ -335,7 +332,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; @@ -434,7 +431,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; @@ -1242,7 +1239,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); @@ -2132,11 +2129,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()); } } @@ -2183,11 +2180,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()); } } @@ -2199,7 +2196,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/settings.h b/rtengine/settings.h index a32a1b7dd..f261444c8 100644 --- a/rtengine/settings.h +++ b/rtengine/settings.h @@ -96,4 +96,5 @@ public: * @param s a pointer to the Settings instance to destroy. */ static void destroy(Settings* s); }; +extern const Settings* settings; } diff --git a/rtengine/shmap.cc b/rtengine/shmap.cc index f654ab51d..36582df39 100644 --- a/rtengine/shmap.cc +++ b/rtengine/shmap.cc @@ -29,8 +29,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/simpleprocess.cc b/rtengine/simpleprocess.cc index 978479304..2953fc34b 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -38,7 +38,6 @@ namespace rtengine { -extern const Settings* settings; namespace { diff --git a/rtengine/stdimagesource.cc b/rtengine/stdimagesource.cc index 8e4c05ac8..2e8846412 100644 --- a/rtengine/stdimagesource.cc +++ b/rtengine/stdimagesource.cc @@ -32,8 +32,6 @@ namespace rtengine { -extern const Settings* settings; - template void freeArray (T** a, int H) { for (int i = 0; i < H; i++) { diff --git a/rtgui/adjuster.cc b/rtgui/adjuster.cc index 5182cd825..91394e18d 100644 --- a/rtgui/adjuster.cc +++ b/rtgui/adjuster.cc @@ -20,7 +20,7 @@ #include #include #include "multilangmgr.h" -#include "../rtengine/rtengine.h" +#include "../rtengine/rt_math.h" #include "options.h" #include "guiutils.h" #include "rtimage.h" diff --git a/rtgui/cacheimagedata.cc b/rtgui/cacheimagedata.cc index d31b6c7a5..114508a95 100644 --- a/rtgui/cacheimagedata.cc +++ b/rtgui/cacheimagedata.cc @@ -23,6 +23,7 @@ #include #include "../rtengine/procparams.h" +#include "../rtengine/settings.h" CacheImageData::CacheImageData() : supported(false), @@ -223,11 +224,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 +306,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 +322,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/cachemanager.cc b/rtgui/cachemanager.cc index 419538656..9f6e111e5 100644 --- a/rtgui/cachemanager.cc +++ b/rtgui/cachemanager.cc @@ -32,8 +32,8 @@ #include "guiutils.h" #include "options.h" -#include "procparamchangers.h" #include "thumbnail.h" +#include "procparamchangers.h" namespace { @@ -64,7 +64,7 @@ void CacheManager::init () } } - if (error != 0 && options.rtSettings.verbose) { + if (error != 0 && rtengine::settings->verbose) { std::cerr << "Failed to create all cache directories: " << g_strerror(errno) << std::endl; } } @@ -191,7 +191,7 @@ 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) { + if (error != 0 && rtengine::settings->verbose) { std::cerr << "Failed to rename all files for cache entry '" << oldfilename << "': " << g_strerror(errno) << std::endl; } @@ -263,7 +263,7 @@ 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) { + if (error != 0 && rtengine::settings->verbose) { std::cerr << "Failed to delete all entries in cache directory '" << dirName << "': " << g_strerror(errno) << std::endl; } @@ -288,7 +288,7 @@ void CacheManager::deleteFiles (const Glib::ustring& fname, const std::string& m error |= g_remove (getCacheFileName ("profiles", fname, paramFileExtension, md5).c_str ()); } - if (error != 0 && options.rtSettings.verbose) { + 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/colorappearance.cc b/rtgui/colorappearance.cc index 0d155e97b..450589fe9 100644 --- a/rtgui/colorappearance.cc +++ b/rtgui/colorappearance.cc @@ -22,6 +22,7 @@ #include "guiutils.h" #include "options.h" +#include "rtimage.h" #include "../rtengine/color.h" #include "../rtengine/procparams.h" 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/dynamicprofilepanel.cc b/rtgui/dynamicprofilepanel.cc index 6acad07f9..d7ed8ee97 100644 --- a/rtgui/dynamicprofilepanel.cc +++ b/rtgui/dynamicprofilepanel.cc @@ -18,11 +18,11 @@ */ #include "dynamicprofilepanel.h" -#include "options.h" #include "multilangmgr.h" #include "../rtengine/profilestore.h" #include "../rtengine/rtengine.h" #include "../rtengine/dynamicprofile.h" +#include "../rtengine/settings.h" #include #include @@ -616,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/editwindow.h b/rtgui/editwindow.h index 8a2ade6ba..04999d149 100644 --- a/rtgui/editwindow.h +++ b/rtgui/editwindow.h @@ -20,6 +20,7 @@ #include #include "filepanel.h" #include "editorpanel.h" +#include "rtimage.h" #include class EditWindow : public Gtk::Window diff --git a/rtgui/extprog.cc b/rtgui/extprog.cc index a17bcdc6a..a7a757c1b 100644 --- a/rtgui/extprog.cc +++ b/rtgui/extprog.cc @@ -213,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; } @@ -232,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/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/filecatalog.cc b/rtgui/filecatalog.cc index 674501322..8e8bcc216 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -602,7 +602,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 +610,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/guiutils.h b/rtgui/guiutils.h index b09e20abb..038131b9b 100644 --- a/rtgui/guiutils.h +++ b/rtgui/guiutils.h @@ -28,13 +28,23 @@ #include "../rtengine/coord.h" #include "../rtengine/noncopyable.h" -#include "../rtengine/rtengine.h" -#include "rtimage.h" +#include "threadutils.h" // for convenience... #include "pathutils.h" +namespace rtengine { +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); diff --git a/rtgui/iccprofilecreator.cc b/rtgui/iccprofilecreator.cc index 0ac0b79f3..e3e1eadb4 100644 --- a/rtgui/iccprofilecreator.cc +++ b/rtgui/iccprofilecreator.cc @@ -29,13 +29,6 @@ #include #endif -namespace rtengine -{ - -extern const Settings* settings; - -} - 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 ICCProfileCreator::ICCProfileCreator(RTWindow *rtwindow) diff --git a/rtgui/inspector.cc b/rtgui/inspector.cc index ad2e424ec..50fa933e1 100644 --- a/rtgui/inspector.cc +++ b/rtgui/inspector.cc @@ -22,6 +22,7 @@ #include "cursormanager.h" #include "guiutils.h" #include "options.h" +#include "rtscalable.h" #include "../rtengine/previewimage.h" InspectorBuffer::InspectorBuffer(const Glib::ustring &imagePath) : currTransform(0), fromRaw(false) diff --git a/rtgui/inspector.h b/rtgui/inspector.h index 681b90aa3..6b3b2350b 100644 --- a/rtgui/inspector.h +++ b/rtgui/inspector.h @@ -22,6 +22,8 @@ #include #include "guiutils.h" #include "../rtengine/coord.h" +#include "../rtengine/coord2d.h" +#include "../rtengine/rt_math.h" class InspectorBuffer { diff --git a/rtgui/labgrid.cc b/rtgui/labgrid.cc index b6393f6f5..fa452815e 100644 --- a/rtgui/labgrid.cc +++ b/rtgui/labgrid.cc @@ -39,6 +39,7 @@ #include "labgrid.h" #include "options.h" +#include "rtimage.h" using rtengine::Color; diff --git a/rtgui/lensprofile.cc b/rtgui/lensprofile.cc index a6694287f..e2cdb5649 100644 --- a/rtgui/lensprofile.cc +++ b/rtgui/lensprofile.cc @@ -587,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 @@ -609,7 +609,7 @@ LensProfilePanel::LFDbHelper::LFDbHelper() void LensProfilePanel::LFDbHelper::fillLensfunCameras() { - if (options.rtSettings.verbose) { + if (settings->verbose) { std::cout << "LENSFUN, scanning cameras:" << std::endl; } @@ -619,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; } } @@ -639,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; } @@ -651,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/main.cc b/rtgui/main.cc index 997f20732..58fdd12dc 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -218,7 +218,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/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 b5577e8dd..73f16d227 100644 --- a/rtgui/mycurve.h +++ b/rtgui/mycurve.h @@ -53,6 +53,7 @@ enum SnapToType { class MyCurveIdleHelper; class CurveEditor; +class EditDataProvider; class MyCurve : public Gtk::DrawingArea, public BackBuffer, public ColorCaller, public CoordinateProvider, public rtengine::NonCopyable { 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/myflatcurve.cc b/rtgui/myflatcurve.cc index ec46908ce..f01fb0066 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/options.cc b/rtgui/options.cc index 8d8d52c83..164637eb2 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -28,6 +28,7 @@ #include "version.h" #include "../rtengine/procparams.h" +#include "../rtengine/rtengine.h" #ifdef _OPENMP #include diff --git a/rtgui/profilepanel.h b/rtgui/profilepanel.h index c5717d523..1efafe10b 100644 --- a/rtgui/profilepanel.h +++ b/rtgui/profilepanel.h @@ -27,9 +27,10 @@ #include "partialpastedlg.h" #include "guiutils.h" #include "profilestorecombobox.h" -#include "rtimage.h" #include "../rtengine/noncopyable.h" +class RTImage; + class ProfilePanel : public Gtk::Grid, public PParamsChangeListener, public ProfileStoreListener, public rtengine::NonCopyable { diff --git a/rtgui/rtimage.cc b/rtgui/rtimage.cc index ff27dbbd3..44078ed3b 100644 --- a/rtgui/rtimage.cc +++ b/rtgui/rtimage.cc @@ -23,7 +23,7 @@ #include #include -#include "options.h" +#include "../rtengine/settings.h" namespace { @@ -215,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 b803ab270..a48a95fd2 100644 --- a/rtgui/rtscalable.cc +++ b/rtgui/rtscalable.cc @@ -23,9 +23,9 @@ #include #include #include -#include "options.h" #include "../rtengine/rt_math.h" +#include "options.h" double RTScalable::dpi = 0.; int RTScalable::scale = 0; @@ -102,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 fc9be32f7..3654e8af6 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -19,12 +19,12 @@ #include #include "rtwindow.h" -#include "options.h" #include "preferences.h" #include "iccprofilecreator.h" #include "cursormanager.h" #include "rtimage.h" #include "whitebalance.h" +#include "../rtengine/settings.h" float fontScale = 1.f; Glib::RefPtr cssForced; @@ -170,7 +170,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 +200,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 { 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/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/thumbnail.cc b/rtgui/thumbnail.cc index 531529d5c..09ffd11f7 100644 --- a/rtgui/thumbnail.cc +++ b/rtgui/thumbnail.cc @@ -19,7 +19,6 @@ #include "thumbnail.h" #include #include -#include "options.h" #include "../rtengine/mytime.h" #include #include @@ -29,6 +28,7 @@ #include #include "../rtengine/dynamicprofile.h" +#include "../rtengine/settings.h" #include "guiutils.h" #include "batchqueue.h" #include "extprog.h" @@ -299,7 +299,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()); } diff --git a/rtgui/toolbar.cc b/rtgui/toolbar.cc index b8e0d64dc..38ade6566 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 52f4dcbd4..958aa80be 100644 --- a/rtgui/toolbar.h +++ b/rtgui/toolbar.h @@ -21,9 +21,10 @@ #include #include "toolenum.h" -#include "rtimage.h" #include "lockablecolorpicker.h" +class RTImage; + class ToolBarListener { 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/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index deea489fe..1da43f6c0 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -19,6 +19,7 @@ #include "multilangmgr.h" #include "toolpanelcoord.h" #include "options.h" +#include "rtimage.h" #include "../rtengine/imagesource.h" #include "../rtengine/dfmanager.h" #include "../rtengine/ffmanager.h" From aacea7046c38c03282347c0d8774b93a473bd394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=B6ssie?= Date: Thu, 31 Oct 2019 08:56:38 +0100 Subject: [PATCH 19/40] Fix Clang warnings plus some cleanups --- rtengine/gamutwarning.cc | 4 ++-- rtengine/gamutwarning.h | 3 ++- rtengine/guidedfilter.cc | 13 ++++++++----- rtengine/guidedfilter.h | 3 ++- rtengine/histmatching.cc | 26 ++++++++++++++------------ rtengine/ipdehaze.cc | 8 ++++---- rtengine/iplabregions.cc | 3 ++- rtengine/iplocalcontrast.cc | 3 ++- rtengine/ipshadowshighlights.cc | 3 ++- rtengine/pdaflinesfilter.cc | 16 +++++++--------- rtengine/pdaflinesfilter.h | 8 +++++--- rtengine/refreshmap.cc | 3 ++- rtengine/refreshmap.h | 9 ++++----- rtengine/rescale.h | 4 ++-- rtengine/rtlensfun.cc | 12 ++++++------ rtengine/rtlensfun.h | 4 +++- rtengine/tmo_fattal02.cc | 21 ++++++++++----------- rtgui/cropwindow.h | 26 ++++++++++++++------------ rtgui/guiutils.h | 17 ++++++++--------- 19 files changed, 99 insertions(+), 87 deletions(-) diff --git a/rtengine/gamutwarning.cc b/rtengine/gamutwarning.cc index 290800f90..569ea3066 100644 --- a/rtengine/gamutwarning.cc +++ b/rtengine/gamutwarning.cc @@ -29,7 +29,8 @@ #include "iccstore.h" #include "image8.h" -namespace rtengine { +namespace rtengine +{ GamutWarning::GamutWarning(cmsHPROFILE iprof, cmsHPROFILE gamutprof, RenderingIntent intent, bool gamutbpc): lab2ref(nullptr), @@ -129,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 4e34ed431..b940b911f 100644 --- a/rtengine/gamutwarning.h +++ b/rtengine/gamutwarning.h @@ -29,7 +29,8 @@ #include "noncopyable.h" -namespace rtengine { +namespace rtengine +{ class Image8; diff --git a/rtengine/guidedfilter.cc b/rtengine/guidedfilter.cc index 70807424a..6b2adb773 100644 --- a/rtengine/guidedfilter.cc +++ b/rtengine/guidedfilter.cc @@ -29,15 +29,19 @@ * available at https://arxiv.org/abs/1505.00996 */ -#include "guidedfilter.h" #include "boxblur.h" -#include "rescale.h" +#include "guidedfilter.h" #include "imagefloat.h" +#include "rescale.h" + #define BENCHMARK #include "StopWatch.h" -namespace rtengine { -namespace { +namespace rtengine +{ + +namespace +{ int calculate_subsampling(int w, int h, int r) { @@ -60,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) { enum Op {MUL, DIVEPSILON, SUBMUL}; diff --git a/rtengine/guidedfilter.h b/rtengine/guidedfilter.h index af8ed0901..d66396c6a 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/histmatching.cc b/rtengine/histmatching.cc index e85f5ee13..622933149 100644 --- a/rtengine/histmatching.cc +++ b/rtengine/histmatching.cc @@ -18,22 +18,24 @@ * along with RawTherapee. If not, see . */ -#include "rawimagesource.h" -#include "rtthumbnail.h" -#include "curves.h" -#include "color.h" -#include "rt_math.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; +#include "../rtgui/mydiagonalcurve.h" + +namespace rtengine +{ namespace { diff --git a/rtengine/ipdehaze.cc b/rtengine/ipdehaze.cc index 729282dbe..c9579cf05 100644 --- a/rtengine/ipdehaze.cc +++ b/rtengine/ipdehaze.cc @@ -42,9 +42,11 @@ #include "../rtgui/options.h" -namespace rtengine { +namespace rtengine +{ -namespace { +namespace +{ float normalize(Imagefloat *rgb, bool multithread) { @@ -271,7 +273,6 @@ void extract_channels(Imagefloat *img, array2D &r, array2D &g, arr } // namespace - void ImProcFunctions::dehaze(Imagefloat *img) { if (!params->dehaze.enabled || params->dehaze.strength == 0.0) { @@ -431,5 +432,4 @@ void ImProcFunctions::dehaze(Imagefloat *img) } } - } // namespace rtengine diff --git a/rtengine/iplabregions.cc b/rtengine/iplabregions.cc index 932b7e18d..cea23bc6b 100644 --- a/rtengine/iplabregions.cc +++ b/rtengine/iplabregions.cc @@ -56,7 +56,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 4e6c32e7e..d6f3ebb5b 100644 --- a/rtengine/iplocalcontrast.cc +++ b/rtengine/iplocalcontrast.cc @@ -32,7 +32,8 @@ #include "improcfun.h" #include "procparams.h" -namespace rtengine { +namespace rtengine +{ void ImProcFunctions::localContrast(LabImage *lab) { diff --git a/rtengine/ipshadowshighlights.cc b/rtengine/ipshadowshighlights.cc index a1e91c4ab..0eceb5a3b 100644 --- a/rtengine/ipshadowshighlights.cc +++ b/rtengine/ipshadowshighlights.cc @@ -30,7 +30,8 @@ #include "sleef.c" -namespace rtengine { +namespace rtengine +{ void ImProcFunctions::shadowsHighlights(LabImage *lab) { diff --git a/rtengine/pdaflinesfilter.cc b/rtengine/pdaflinesfilter.cc index 350c6f758..e788c6c83 100644 --- a/rtengine/pdaflinesfilter.cc +++ b/rtengine/pdaflinesfilter.cc @@ -18,18 +18,18 @@ * along with RawTherapee. If not, see . */ +#include + +#include "camconst.h" #include "pdaflinesfilter.h" #include "rawimage.h" #include "settings.h" -#include -#include "camconst.h" -namespace rtengine { +namespace rtengine +{ -extern const Settings *settings; - - -namespace { +namespace +{ class PDAFGreenEqulibrateThreshold: public RawImageSource::GreenEqulibrateThreshold { static constexpr float BASE_THRESHOLD = 0.5f; @@ -167,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 e2904716e..c3d8b47f4 100644 --- a/rtengine/pdaflinesfilter.h +++ b/rtengine/pdaflinesfilter.h @@ -21,10 +21,12 @@ #pragma once #include -#include "rawimagesource.h" -#include "noncopyable.h" -namespace rtengine { +#include "noncopyable.h" +#include "rawimagesource.h" + +namespace rtengine +{ class RawImage; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 6917d856e..b77eac29c 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -526,7 +526,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { }; -namespace rtengine { +namespace rtengine +{ RefreshMapper::RefreshMapper(): next_event_(rtengine::NUMOFEVENTS) 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/rtlensfun.cc b/rtengine/rtlensfun.cc index 1fcb5ec26..665fbd199 100644 --- a/rtengine/rtlensfun.cc +++ b/rtengine/rtlensfun.cc @@ -18,15 +18,15 @@ * along with RawTherapee. If not, see . */ -#include "rtlensfun.h" -#include "imagedata.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 diff --git a/rtengine/rtlensfun.h b/rtengine/rtlensfun.h index 9c95ca3aa..7dcd96007 100644 --- a/rtengine/rtlensfun.h +++ b/rtengine/rtlensfun.h @@ -30,7 +30,8 @@ #include "lcp.h" #include "noncopyable.h" -namespace rtengine { +namespace rtengine +{ class FramesMetaData; @@ -39,6 +40,7 @@ namespace procparams struct CoarseTransformParams; struct LensProfParams; + } class LFModifier final : diff --git a/rtengine/tmo_fattal02.cc b/rtengine/tmo_fattal02.cc index 31671bd0c..d28606edb 100644 --- a/rtengine/tmo_fattal02.cc +++ b/rtengine/tmo_fattal02.cc @@ -50,32 +50,32 @@ * $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 "iccstore.h" #include "imagefloat.h" #include "improcfun.h" -#include "settings.h" -#include "iccstore.h" -#include "StopWatch.h" -#include "sleef.c" #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.c" +#include "StopWatch.h" namespace rtengine { @@ -84,7 +84,6 @@ namespace rtengine * RT code ******************************************************************************/ -extern const Settings *settings; extern MyMutex *fftwMutex; using namespace std; diff --git a/rtgui/cropwindow.h b/rtgui/cropwindow.h index be07db5c9..db44a2508 100644 --- a/rtgui/cropwindow.h +++ b/rtgui/cropwindow.h @@ -16,27 +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 #include -#include "lwbutton.h" -#include "lwbuttonset.h" -#include "editenums.h" -#include "crophandler.h" -#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 { +namespace rtengine +{ -class Coord; +struct Coord; } + class CropWindow; class CropWindowListener @@ -243,5 +247,3 @@ public: ImageArea* getImageArea(); }; - -#endif diff --git a/rtgui/guiutils.h b/rtgui/guiutils.h index 038131b9b..18b650b82 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,22 +25,24 @@ #include +#include "pathutils.h" +#include "threadutils.h" + #include "../rtengine/coord.h" #include "../rtengine/noncopyable.h" -#include "threadutils.h" +namespace rtengine +{ -// for convenience... -#include "pathutils.h" - -namespace rtengine { namespace procparams { class ProcParams; struct CropParams; + } + } class RTImage; @@ -654,5 +655,3 @@ inline Gtk::Window& getToplevelWindow (Gtk::Widget* widget) { return *static_cast (widget->get_toplevel ()); } - -#endif From add5c790d68b4ad1df9c06226c7a7971ba29a3a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=B6ssie?= Date: Thu, 31 Oct 2019 10:20:50 +0100 Subject: [PATCH 20/40] `#pragma once` for our headers plus drive-by formatting --- rtengine/LUT.h | 7 +- rtengine/alignedbuffer.h | 5 +- rtengine/array2D.h | 5 +- rtengine/calc_distort.h | 5 +- rtengine/camconst.h | 5 +- rtengine/ciecam02.h | 6 +- rtengine/coord.h | 5 +- rtengine/coord2d.h | 5 +- rtengine/dcraw.h | 6 +- rtengine/dynamicprofile.h | 5 +- rtengine/gauss.h | 5 +- rtengine/iccmatrices.h | 4 +- rtengine/iimage.h | 16 ++-- rtengine/imagedata.h | 13 +-- rtengine/imageformat.h | 5 +- rtengine/imageio.h | 35 +++++---- rtengine/improccoordinator.h | 5 +- rtengine/improcfun.h | 15 ++-- rtengine/iptcpairs.h | 7 +- rtengine/jpeg.h | 6 +- rtengine/myfile.h | 11 ++- rtengine/previewimage.h | 6 +- rtengine/processingjob.h | 7 +- rtengine/procevents.h | 20 ++--- rtengine/profilestore.h | 10 +-- rtengine/rawimagesource_i.h | 6 +- rtengine/rawmetadatalocation.h | 6 +- rtengine/rtthumbnail.h | 13 ++- rtengine/shmap.h | 6 +- rtengine/simpleprocess.h | 17 +--- rtengine/stdimagesource.h | 5 +- rtexif/rtexif.h | 5 +- rtgui/addsetids.h | 6 +- rtgui/adjuster.h | 6 +- rtgui/batchqueue.h | 9 +-- rtgui/batchqueuebuttonset.h | 8 +- rtgui/batchqueueentry.h | 13 ++- rtgui/batchqueuepanel.h | 8 +- rtgui/batchtoolpanelcoord.h | 14 ++-- rtgui/bayerpreprocess.h | 6 +- rtgui/bayerprocess.h | 14 ++-- rtgui/bayerrawexposure.h | 28 +++---- rtgui/blackwhite.h | 12 ++- rtgui/bqentryupdater.h | 8 +- rtgui/browserfilter.h | 6 +- rtgui/cacheimagedata.h | 12 +-- rtgui/cachemanager.h | 12 +-- rtgui/cacorrection.h | 11 +-- rtgui/checkbox.h | 6 +- rtgui/chmixer.h | 11 +-- rtgui/clipboard.h | 5 +- rtgui/coarsepanel.h | 10 +-- rtgui/colorappearance.h | 24 +++--- rtgui/coloredbar.h | 5 +- rtgui/colorprovider.h | 8 +- rtgui/colortoning.h | 15 ++-- rtgui/coordinateadjuster.h | 6 +- rtgui/crop.h | 11 ++- rtgui/cropguilistener.h | 5 +- rtgui/crophandler.h | 11 +-- rtgui/cursormanager.h | 6 +- rtgui/curveeditor.h | 12 +-- rtgui/curveeditorgroup.h | 13 ++- rtgui/curvelistener.h | 5 +- rtgui/darkframe.h | 17 ++-- rtgui/defringe.h | 19 +++-- rtgui/diagonalcurveeditorsubgroup.h | 13 +-- rtgui/dirbrowser.h | 6 +- rtgui/dirpyrdenoise.h | 10 +-- rtgui/dirpyrequalizer.h | 21 ++--- rtgui/distortion.h | 17 ++-- rtgui/dynamicprofilepanel.h | 12 +-- rtgui/editedstate.h | 6 +- rtgui/editenums.h | 5 +- rtgui/editid.h | 6 +- rtgui/editorpanel.h | 30 ++++--- rtgui/editwindow.h | 18 ++--- rtgui/epd.h | 11 +-- rtgui/exiffiltersettings.h | 6 +- rtgui/exifpanel.h | 9 +-- rtgui/exportpanel.h | 8 +- rtgui/extprog.h | 10 +-- rtgui/favoritbrowser.h | 16 ++-- rtgui/filebrowser.h | 22 +++--- rtgui/filebrowserentry.h | 10 +-- rtgui/filecatalog.h | 24 +++--- rtgui/filepanel.h | 22 +++--- rtgui/fileselectionchangelistener.h | 6 +- rtgui/fileselectionlistener.h | 8 +- rtgui/filethumbnailbuttonset.h | 12 +-- rtgui/filmsimulation.h | 21 ++--- rtgui/filterpanel.h | 6 +- rtgui/flatcurveeditorsubgroup.h | 11 +-- rtgui/flatfield.h | 12 +-- rtgui/gradient.h | 14 ++-- rtgui/histogrampanel.h | 20 ++--- rtgui/history.h | 11 ++- rtgui/hsvequalizer.h | 20 ++--- rtgui/icmpanel.h | 11 ++- rtgui/ilabel.h | 9 +-- rtgui/imagearea.h | 27 ++++--- rtgui/imageareapanel.h | 9 +-- rtgui/imageareatoollistener.h | 10 +-- rtgui/impulsedenoise.h | 11 +-- rtgui/indclippedpanel.h | 12 +-- rtgui/inspector.h | 7 +- rtgui/iptcpanel.h | 9 +-- rtgui/labcurve.h | 17 ++-- rtgui/lensgeom.h | 14 ++-- rtgui/lensgeomlistener.h | 5 +- rtgui/lockablecolorpicker.h | 8 +- rtgui/lwbutton.h | 6 +- rtgui/multilangmgr.h | 5 +- rtgui/mycurve.h | 14 ++-- rtgui/mydiagonalcurve.h | 17 ++-- rtgui/myflatcurve.h | 11 ++- rtgui/navigator.h | 16 ++-- rtgui/partialpastedlg.h | 7 +- rtgui/pcvignette.h | 11 +-- rtgui/perspective.h | 11 +-- rtgui/placesbrowser.h | 12 ++- rtgui/pointermotionlistener.h | 7 +- rtgui/popupbutton.h | 10 +-- rtgui/popupcommon.h | 9 ++- rtgui/popuptogglebutton.h | 10 +-- rtgui/pparamschangelistener.h | 12 ++- rtgui/preferences.h | 24 +++--- rtgui/preprocess.h | 14 ++-- rtgui/previewhandler.h | 9 +-- rtgui/previewloader.h | 10 +-- rtgui/previewmodepanel.h | 12 +-- rtgui/previewwindow.h | 19 ++--- rtgui/profilechangelistener.h | 6 +- rtgui/profilepanel.h | 22 +++--- rtgui/profilestorecombobox.h | 15 ++-- rtgui/progressconnector.h | 11 +-- rtgui/prsharpening.h | 12 +-- rtgui/rawcacorrection.h | 12 +-- rtgui/rawexposure.h | 11 +-- rtgui/recentbrowser.h | 15 ++-- rtgui/renamedlg.h | 10 +-- rtgui/resize.h | 8 +- rtgui/retinex.h | 22 +++--- rtgui/rgbcurves.h | 16 ++-- rtgui/rotate.h | 17 ++-- rtgui/rtwindow.h | 28 ++++--- rtgui/saveasdlg.h | 11 ++- rtgui/saveformatpanel.h | 7 +- rtgui/sensorbayer.h | 10 +-- rtgui/sensorxtrans.h | 10 +-- rtgui/shadowshighlights.h | 11 +-- rtgui/sharpenedge.h | 11 +-- rtgui/sharpening.h | 12 +-- rtgui/sharpenmicro.h | 11 +-- rtgui/shcselector.h | 7 +- rtgui/soundman.h | 8 +- rtgui/splash.h | 8 +- rtgui/threadutils.h | 5 +- rtgui/thresholdadjuster.h | 6 +- rtgui/thresholdselector.h | 14 ++-- rtgui/thumbbrowserbase.h | 19 ++--- rtgui/thumbimageupdater.h | 9 +-- rtgui/thumbnail.h | 16 ++-- rtgui/thumbnailbrowser.h | 8 +- rtgui/thumbnaillistener.h | 6 +- rtgui/tonecurve.h | 17 ++-- rtgui/toolbar.h | 8 +- rtgui/toolenum.h | 5 +- rtgui/toolpanel.h | 26 +++--- rtgui/toolpanelcoord.h | 118 ++++++++++++++-------------- rtgui/vibrance.h | 18 +++-- rtgui/vignetting.h | 11 +-- rtgui/wbprovider.h | 6 +- rtgui/whitebalance.h | 9 +-- rtgui/xtransprocess.h | 14 ++-- rtgui/xtransrawexposure.h | 11 +-- rtgui/zoompanel.h | 10 +-- 177 files changed, 946 insertions(+), 1158 deletions(-) diff --git a/rtengine/LUT.h b/rtengine/LUT.h index f1090eefa..d1ed67c2b 100644 --- a/rtengine/LUT.h +++ b/rtengine/LUT.h @@ -56,8 +56,7 @@ * LUTuc stands for LUT */ -#ifndef LUT_H_ -#define LUT_H_ +#pragma once #include #include @@ -67,9 +66,9 @@ #include #endif +#include "noncopyable.h" #include "opthelper.h" #include "rt_math.h" -#include "noncopyable.h" // Bit representations of flags enum { @@ -628,5 +627,3 @@ public: }; - -#endif /* LUT_H_ */ 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/array2D.h b/rtengine/array2D.h index d25e20a83..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 @@ -313,4 +313,3 @@ public: return list[index]; } }; -#endif /* array2D_H_ */ 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.h b/rtengine/camconst.h index 89180fbb5..1096e1767 100644 --- a/rtengine/camconst.h +++ b/rtengine/camconst.h @@ -1,8 +1,7 @@ /* * This file is part of RawTherapee. */ -#ifndef __CAMCONST__ -#define __CAMCONST__ +#pragma once #include #include @@ -73,5 +72,3 @@ public: }; } - -#endif diff --git a/rtengine/ciecam02.h b/rtengine/ciecam02.h index fea35ab12..68252f2f6 100644 --- a/rtengine/ciecam02.h +++ b/rtengine/ciecam02.h @@ -16,9 +16,10 @@ * 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 "opthelper.h" @@ -106,4 +107,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/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/dynamicprofile.h b/rtengine/dynamicprofile.h index e23c57b49..9b893fae2 100644 --- a/rtengine/dynamicprofile.h +++ b/rtengine/dynamicprofile.h @@ -16,8 +16,7 @@ * 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 @@ -76,5 +75,3 @@ public: const std::vector &getRules(); void setRules (const std::vector &r); }; - -#endif // _DYNAMICPROFILE_H_ diff --git a/rtengine/gauss.h b/rtengine/gauss.h index f78762df3..e226bbc13 100644 --- a/rtengine/gauss.h +++ b/rtengine/gauss.h @@ -16,11 +16,8 @@ * 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}; 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/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/iimage.h b/rtengine/iimage.h index 11eb3e482..3c39b7659 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 -#include "rt_math.h" + #include "alignedbuffer.h" +#include "color.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 @@ -1808,5 +1810,3 @@ public: }; } - -#endif diff --git a/rtengine/imagedata.h b/rtengine/imagedata.h index 66c4285b9..0b75e263b 100644 --- a/rtengine/imagedata.h +++ b/rtengine/imagedata.h @@ -16,17 +16,21 @@ * 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 +#include + #include -#include "imageio.h" -#include "../rtexif/rtexif.h" + #include +#include "imageio.h" + +#include "../rtexif/rtexif.h" + namespace rtengine { @@ -132,4 +136,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.h b/rtengine/imageio.h index c74756614..251187547 100644 --- a/rtengine/imageio.h +++ b/rtengine/imageio.h @@ -16,27 +16,31 @@ * 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 "rtengine.h" -#include "imageformat.h" -#include "../rtexif/rtexif.h" -#include "imagedimensions.h" + #include "iimage.h" +#include "imagedimensions.h" +#include "imageformat.h" +#include "rtengine.h" + +#include "../rtexif/rtexif.h" + +enum { + IMIO_SUCCESS, + IMIO_CANNOTREADFILE, + IMIO_INVALIDHEADER, + IMIO_HEADERERROR, + IMIO_READERROR, + IMIO_VARIANTNOTSUPPORTED, + IMIO_FILETYPENOTSUPPORTED, + IMIO_CANNOTWRITEFILE +}; namespace rtengine { @@ -111,4 +115,3 @@ public: }; } -#endif diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index 71bca1d8a..c416ebe67 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -16,8 +16,7 @@ * 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 @@ -410,5 +409,5 @@ public: } denoiseInfoStore; }; + } -#endif diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index a47ba2980..a8c3ededb 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -16,16 +16,15 @@ * 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 "shmap.h" -#include "coord2d.h" #include "color.h" -#include "LUT.h" -#include "lcp.h" -#include "pipettebuffer.h" +#include "coord2d.h" #include "gamutwarning.h" +#include "lcp.h" +#include "LUT.h" +#include "pipettebuffer.h" +#include "shmap.h" template class multi_array2D; @@ -272,5 +271,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/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/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/myfile.h b/rtengine/myfile.h index f2ed4150c..69e226b8b 100644 --- a/rtengine/myfile.h +++ b/rtengine/myfile.h @@ -16,13 +16,15 @@ * 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 + #include "rtengine.h" + struct IMFILE { int fd; ssize_t pos; @@ -134,6 +136,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/previewimage.h b/rtengine/previewimage.h index aac5eabe5..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 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 ca098f216..1b00d4218 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, @@ -540,13 +536,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/profilestore.h b/rtengine/profilestore.h index 3b7bc7f9d..08afc88f3 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 "dynamicprofile.h" +#include "noncopyable.h" +#include "rtengine.h" // forward decl namespace rtengine @@ -211,5 +211,3 @@ public: void dumpFolderList(); }; - -#endif 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/rtthumbnail.h b/rtengine/rtthumbnail.h index a1df25224..473c74e7c 100644 --- a/rtengine/rtthumbnail.h +++ b/rtengine/rtthumbnail.h @@ -16,15 +16,17 @@ * 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 "rawmetadatalocation.h" #include + #include -#include "image8.h" + #include "image16.h" +#include "image8.h" #include "imagefloat.h" +#include "rawmetadatalocation.h" + #include "../rtgui/threadutils.h" namespace rtengine @@ -160,6 +162,3 @@ public: } }; } - -#endif - diff --git a/rtengine/shmap.h b/rtengine/shmap.h index f07759a2c..b40e872bb 100644 --- a/rtengine/shmap.h +++ b/rtengine/shmap.h @@ -16,14 +16,14 @@ * 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 "LUT.h" #include "noncopyable.h" namespace rtengine { + class Imagefloat; class SHMap : @@ -49,5 +49,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.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/stdimagesource.h b/rtengine/stdimagesource.h index b70c6554b..b95328c80 100644 --- a/rtengine/stdimagesource.h +++ b/rtengine/stdimagesource.h @@ -16,8 +16,7 @@ * 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" @@ -118,5 +117,5 @@ public: void flushRGB () override; void captureSharpening(const procparams::CaptureSharpeningParams &sharpeningParams, bool showMask, double &conrastThreshold, double &radius) override {}; }; + } -#endif diff --git a/rtexif/rtexif.h b/rtexif/rtexif.h index e89260932..515c7569d 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 @@ -687,5 +686,5 @@ extern const TagAttrib kodakIfdAttribs[]; void parseKodakIfdTextualInfo (Tag *textualInfo, Tag* exif); extern const TagAttrib panasonicAttribs[]; extern const TagAttrib panasonicRawAttribs[]; + } -#endif 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.h b/rtgui/adjuster.h index 52857a3d2..1583bab69 100644 --- a/rtgui/adjuster.h +++ b/rtgui/adjuster.h @@ -16,10 +16,10 @@ * 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 +130,3 @@ public: void trimValue (int &val) const; void setLogScale(double base, double pivot, bool anchorMiddle = false); }; - -#endif diff --git a/rtgui/batchqueue.h b/rtgui/batchqueue.h index 7248ac793..a0c04abee 100644 --- a/rtgui/batchqueue.h +++ b/rtgui/batchqueue.h @@ -15,19 +15,18 @@ * 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 "lwbuttonset.h" #include "threadutils.h" #include "thumbbrowserbase.h" + +#include "../rtengine/rtengine.h" #include "../rtengine/noncopyable.h" class BatchQueueListener @@ -123,5 +122,3 @@ private: IdleRegister idle_register; }; - -#endif diff --git a/rtgui/batchqueuebuttonset.h b/rtgui/batchqueuebuttonset.h index 19479ccc1..17f582168 100644 --- a/rtgui/batchqueuebuttonset.h +++ b/rtgui/batchqueuebuttonset.h @@ -16,12 +16,12 @@ * 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 #include "lwbuttonset.h" #include "rtsurface.h" -#include class BatchQueueEntry; class BatchQueueButtonSet : public LWButtonSet @@ -40,5 +40,3 @@ public: explicit BatchQueueButtonSet (BatchQueueEntry* myEntry); }; - -#endif diff --git a/rtgui/batchqueueentry.h b/rtgui/batchqueueentry.h index 03097e55e..d56c0e340 100644 --- a/rtgui/batchqueueentry.h +++ b/rtgui/batchqueueentry.h @@ -16,17 +16,18 @@ * 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 "bqentryupdater.h" #include "thumbbrowserentrybase.h" #include "thumbnail.h" -#include "bqentryupdater.h" + #include "../rtengine/noncopyable.h" +#include "../rtengine/rtengine.h" class BatchQueueEntry; struct BatchQueueEntryIdleHelper { @@ -77,7 +78,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.h b/rtgui/batchtoolpanelcoord.h index 53741be49..6c64e15ea 100644 --- a/rtgui/batchtoolpanelcoord.h +++ b/rtgui/batchtoolpanelcoord.h @@ -16,16 +16,16 @@ * 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/procparams.h" -#include "../rtengine/procevents.h" #include "paramsedited.h" +#include "thumbnail.h" #include "thumbnaillistener.h" +#include "toolpanelcoord.h" + +#include "../rtengine/procevents.h" +#include "../rtengine/procparams.h" class FilePanel; class BatchToolPanelCoordinator : @@ -85,5 +85,3 @@ public: void optionsChanged (); }; - -#endif diff --git a/rtgui/bayerpreprocess.h b/rtgui/bayerpreprocess.h index 9114c37d4..c07bbcba4 100644 --- a/rtgui/bayerpreprocess.h +++ b/rtgui/bayerpreprocess.h @@ -16,10 +16,10 @@ * 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" @@ -53,5 +53,3 @@ public: void lineDenoiseDirectionChanged(); void pdafLinesFilterChanged(); }; - -#endif 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.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.h b/rtgui/bqentryupdater.h index 9e3e09a51..6dbb4bedf 100644 --- a/rtgui/bqentryupdater.h +++ b/rtgui/bqentryupdater.h @@ -16,15 +16,15 @@ * 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 "../rtengine/rtengine.h" #include "threadutils.h" #include "thumbnail.h" +#include "../rtengine/rtengine.h" + class BQEntryUpdateListener { @@ -62,5 +62,3 @@ public: }; extern BatchQueueEntryUpdater batchQueueEntryUpdater; - -#endif diff --git a/rtgui/browserfilter.h b/rtgui/browserfilter.h index 11bfd9920..df9a94c11 100644 --- a/rtgui/browserfilter.h +++ b/rtgui/browserfilter.h @@ -16,8 +16,7 @@ * 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 @@ -25,7 +24,6 @@ class BrowserFilter { - public: bool showRanked[6]; bool showCLabeled[6]; @@ -42,5 +40,3 @@ public: BrowserFilter (); }; - -#endif diff --git a/rtgui/cacheimagedata.h b/rtgui/cacheimagedata.h index 56b4ad434..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 "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.h b/rtgui/cachemanager.h index 3e987866d..56370e966 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 : @@ -70,6 +69,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.h b/rtgui/clipboard.h index 4c0ec452f..d142808e9 100644 --- a/rtgui/clipboard.h +++ b/rtgui/clipboard.h @@ -16,8 +16,7 @@ * 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 @@ -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.h b/rtgui/colorappearance.h index da2e3c8b9..1f8fdef84 100644 --- a/rtgui/colorappearance.h +++ b/rtgui/colorappearance.h @@ -16,25 +16,25 @@ * 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 "mycurve.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 +173,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..a84b1be27 100644 --- a/rtgui/colorprovider.h +++ b/rtgui/colorprovider.h @@ -16,8 +16,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _COLORPROVIDER_ -#define _COLORPROVIDER_ +#pragma once #include @@ -61,10 +60,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.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/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.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/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 bdd6d6b48..dd61bc910 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/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.h b/rtgui/curveeditorgroup.h index 6f7b98d9b..7c39ab186 100644 --- a/rtgui/curveeditorgroup.h +++ b/rtgui/curveeditorgroup.h @@ -16,18 +16,19 @@ * 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 "myflatcurve.h" #include "shcselector.h" -#include "adjuster.h" class CurveEditor; class DiagonalCurveEditorSubGroup; @@ -169,5 +170,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.h b/rtgui/darkframe.h index c576712a8..58ac904ff 100644 --- a/rtgui/darkframe.h +++ b/rtgui/darkframe.h @@ -16,24 +16,29 @@ * 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" + +#include "../rtengine/rawimage.h" 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 +71,3 @@ public: dfp = p; }; }; - -#endif 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.h b/rtgui/diagonalcurveeditorsubgroup.h index 077ef590e..21784578e 100644 --- a/rtgui/diagonalcurveeditorsubgroup.h +++ b/rtgui/diagonalcurveeditorsubgroup.h @@ -16,16 +16,21 @@ * 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 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 +116,3 @@ protected: void setSubGroupRangeLabels(Glib::ustring r1, Glib::ustring r2, Glib::ustring r3, Glib::ustring r4); void setSubGroupBottomBarBgGradient(); }; - -#endif 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.h b/rtgui/dirpyrdenoise.h index 05304e4f7..424104314 100644 --- a/rtgui/dirpyrdenoise.h +++ b/rtgui/dirpyrdenoise.h @@ -16,16 +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 "toolpanel.h" class EditDataProvider; @@ -137,5 +137,3 @@ private: IdleRegister idle_register; }; - -#endif 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.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/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.h b/rtgui/editorpanel.h index c4349f693..ec59563e0 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -17,24 +17,25 @@ * 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 "thumbnail.h" +#include "thumbnaillistener.h" +#include "toolpanelcoord.h" + #include "../rtengine/noncopyable.h" +#include "../rtengine/rtengine.h" class EditorPanel; class MyProgressBar; @@ -259,6 +260,3 @@ private: IdleRegister idle_register; }; - -#endif - diff --git a/rtgui/editwindow.h b/rtgui/editwindow.h index 04999d149..08e8c0199 100644 --- a/rtgui/editwindow.h +++ b/rtgui/editwindow.h @@ -14,16 +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 "rtimage.h" #include -class EditWindow : public Gtk::Window +#include + +#include "editorpanel.h" +#include "filepanel.h" +#include "rtimage.h" + +class EditWindow : + public Gtk::Window { private: @@ -67,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..2b173c884 100644 --- a/rtgui/exifpanel.h +++ b/rtgui/exifpanel.h @@ -16,8 +16,7 @@ * 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 @@ -25,7 +24,9 @@ #include "toolpanel.h" -class ExifPanel : public Gtk::VBox, public ToolPanel +class ExifPanel : + public Gtk::VBox, + public ToolPanel { private: @@ -114,5 +115,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.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/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.h b/rtgui/filebrowser.h index 6911a944f..74b491957 100644 --- a/rtgui/filebrowser.h +++ b/rtgui/filebrowser.h @@ -16,25 +16,27 @@ * 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 "filebrowserentry.h" +#include "partialpastedlg.h" +#include "pparamschangelistener.h" #include "profilestorecombobox.h" +#include "thumbbrowserbase.h" + #include "../rtengine/noncopyable.h" -class ProfileStoreLabel; class FileBrowser; class FileBrowserEntry; +class ProfileStoreLabel; class FileBrowserListener { @@ -210,5 +212,3 @@ public: type_trash_changed trash_changed(); }; - -#endif diff --git a/rtgui/filebrowserentry.h b/rtgui/filebrowserentry.h index 646e8e67e..c7eebcd44 100644 --- a/rtgui/filebrowserentry.h +++ b/rtgui/filebrowserentry.h @@ -16,16 +16,13 @@ * 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" @@ -34,8 +31,9 @@ #include "thumbimageupdater.h" #include "thumbnail.h" #include "thumbnaillistener.h" -#include "../rtengine/noncopyable.h" +#include "../rtengine/noncopyable.h" +#include "../rtengine/rtengine.h" class FileBrowserEntry; struct FileBrowserEntryIdleHelper { @@ -109,5 +107,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.h b/rtgui/filecatalog.h index 09e2cc1ed..c71658cca 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; @@ -288,5 +290,3 @@ inline void FileCatalog::setDirSelector (const FileCatalog::DirSelectionSlot& se { this->selectDir = selectDir; } - -#endif diff --git a/rtgui/filepanel.h b/rtgui/filepanel.h index bdeb266f4..9ae91be4d 100644 --- a/rtgui/filepanel.h +++ b/rtgui/filepanel.h @@ -16,21 +16,22 @@ * 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 RTWindow; @@ -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.h b/rtgui/filethumbnailbuttonset.h index 102b573c8..f4fbc97ed 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 "lwbuttonset.h" #include "rtsurface.h" class FileBrowserEntry; -class FileThumbnailButtonSet : public LWButtonSet + +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 6eb0fd024..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.h b/rtgui/flatcurveeditorsubgroup.h index e9253cd08..5b14f752a 100644 --- a/rtgui/flatcurveeditorsubgroup.h +++ b/rtgui/flatcurveeditorsubgroup.h @@ -16,16 +16,19 @@ * 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 FlatCurveEditorSubGroup: public CurveEditorSubGroup, public rtengine::NonCopyable +class FlatCurveEditorSubGroup: + public CurveEditorSubGroup, + public rtengine::NonCopyable { friend class FlatCurveEditor; @@ -76,5 +79,3 @@ protected: void editPointToggled(Gtk::ToggleButton *button); void editToggled (Gtk::ToggleButton *button); }; - -#endif diff --git a/rtgui/flatfield.h b/rtgui/flatfield.h index b9997f65e..02cc9963f 100644 --- a/rtgui/flatfield.h +++ b/rtgui/flatfield.h @@ -16,15 +16,17 @@ * 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" + +#include "../rtengine/rawimage.h" class FFProvider { @@ -84,5 +86,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/histogrampanel.h b/rtgui/histogrampanel.h index ef8d9368d..92d0dc7b4 100644 --- a/rtgui/histogrampanel.h +++ b/rtgui/histogrampanel.h @@ -16,21 +16,23 @@ * 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/improccoordinator.h" +#include "../rtengine/LUT.h" #include "../rtengine/noncopyable.h" class HistogramArea; + struct HistogramAreaIdleHelper { HistogramArea* harea; bool destroyed; @@ -252,5 +254,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.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/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.h b/rtgui/ilabel.h index 06da470b1..cb9ca00be 100644 --- a/rtgui/ilabel.h +++ b/rtgui/ilabel.h @@ -16,12 +16,12 @@ * 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 +class ILabel : + public Gtk::DrawingArea { Glib::ustring label; @@ -32,6 +32,3 @@ public: void on_realize() override; void on_style_updated () override; }; - -#endif - diff --git a/rtgui/imagearea.h b/rtgui/imagearea.h index 375e3a536..28b52dcd2 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; @@ -158,7 +163,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..86fdca6a2 100644 --- a/rtgui/imageareatoollistener.h +++ b/rtgui/imageareatoollistener.h @@ -16,12 +16,11 @@ * 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 "thumbnail.h" +#include "toolbar.h" 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.h b/rtgui/inspector.h index 6b3b2350b..bb144834a 100644 --- a/rtgui/inspector.h +++ b/rtgui/inspector.h @@ -16,11 +16,12 @@ * 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" @@ -101,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.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/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/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.h b/rtgui/lwbutton.h index 16e53a875..7a784e693 100644 --- a/rtgui/lwbutton.h +++ b/rtgui/lwbutton.h @@ -16,10 +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; @@ -78,5 +78,3 @@ public: void redraw (Cairo::RefPtr context); }; - -#endif 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.h b/rtgui/mycurve.h index 73f16d227..6bdfe4b66 100644 --- a/rtgui/mycurve.h +++ b/rtgui/mycurve.h @@ -16,15 +16,17 @@ * 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 "../rtengine/noncopyable.h" @@ -151,5 +153,3 @@ public: myCurve->setDirty(true); } }; - -#endif diff --git a/rtgui/mydiagonalcurve.h b/rtgui/mydiagonalcurve.h index 33fac6090..058c11e5a 100644 --- a/rtgui/mydiagonalcurve.h +++ b/rtgui/mydiagonalcurve.h @@ -16,16 +16,17 @@ * 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 "mycurve.h" -#include "../rtengine/LUT.h" +#include "cursormanager.h" +#include "curvelistener.h" +#include "mycurve.h" + +#include "../rtengine/LUT.h" // For compatibility and simplicity reason, order shouldn't change, and must be identical to the order specified in the curveType widget enum DiagonalCurveType { @@ -101,5 +102,3 @@ public: void setPos(double pos, int chanIdx) override; void stopNumericalAdjustment() override; }; - -#endif diff --git a/rtgui/myflatcurve.h b/rtgui/myflatcurve.h index fa4466b8d..c4cbfa291 100644 --- a/rtgui/myflatcurve.h +++ b/rtgui/myflatcurve.h @@ -16,13 +16,14 @@ * 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 "curvelistener.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 @@ -138,5 +139,3 @@ public: void setPos(double pos, int chanIdx) override; void stopNumericalAdjustment() override; }; - -#endif diff --git a/rtgui/navigator.h b/rtgui/navigator.h index 32ad68175..953a0a44b 100644 --- a/rtgui/navigator.h +++ b/rtgui/navigator.h @@ -16,15 +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" -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]; @@ -62,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/partialpastedlg.h b/rtgui/partialpastedlg.h index eebb08705..6c4228061 100644 --- a/rtgui/partialpastedlg.h +++ b/rtgui/partialpastedlg.h @@ -16,10 +16,10 @@ * 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" struct ParamsEdited; @@ -159,6 +159,3 @@ public: void rawToggled (); void advancedToggled (); }; - -#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 bc3a5600b..de590dd9f 100644 --- a/rtgui/pparamschangelistener.h +++ b/rtgui/pparamschangelistener.h @@ -16,12 +16,13 @@ * 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 + +#include "paramsedited.h" #include "../rtengine/rtengine.h" -#include -#include "paramsedited.h" class PParamsChangeListener { @@ -43,6 +44,3 @@ public: virtual void beginBatchPParamsChange(int numberOfEntries) = 0; virtual void endBatchPParamsChange() = 0; }; - -#endif - diff --git a/rtgui/preferences.h b/rtgui/preferences.h index 6ca302fe8..62f7c53c1 100644 --- a/rtgui/preferences.h +++ b/rtgui/preferences.h @@ -16,20 +16,24 @@ * 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 "rtwindow.h" + +class Preferences : + public Gtk::Dialog, + public ProfileStoreListener { - class ExtensionColumns : public Gtk::TreeModel::ColumnRecord + class ExtensionColumns : + public Gtk::TreeModel::ColumnRecord { public: Gtk::TreeModelColumn enabled; @@ -303,5 +307,3 @@ public: // void selectICCProfileDir (); // void selectMonitorProfile (); }; - -#endif diff --git a/rtgui/preprocess.h b/rtgui/preprocess.h index cf4cc8857..3b337a450 100644 --- a/rtgui/preprocess.h +++ b/rtgui/preprocess.h @@ -16,16 +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 "toolpanel.h" -class PreProcess : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel +class PreProcess : + public ToolParamBlock, + public AdjusterListener, + public FoldableToolPanel { protected: @@ -53,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.h b/rtgui/previewloader.h index ede509c0a..3712dc3ff 100644 --- a/rtgui/previewloader.h +++ b/rtgui/previewloader.h @@ -16,16 +16,16 @@ * 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 "../rtengine/noncopyable.h" - #include "filebrowserentry.h" +#include "../rtengine/noncopyable.h" + class PreviewLoaderListener { public: @@ -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.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..c2e3f2654 100644 --- a/rtgui/profilechangelistener.h +++ b/rtgui/profilechangelistener.h @@ -16,8 +16,7 @@ * 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 @@ -48,6 +47,3 @@ public: ) = 0; virtual void setDefaults(const rtengine::procparams::ProcParams* defparams) = 0; }; - -#endif - diff --git a/rtgui/profilepanel.h b/rtgui/profilepanel.h index 1efafe10b..378b2a984 100644 --- a/rtgui/profilepanel.h +++ b/rtgui/profilepanel.h @@ -16,22 +16,28 @@ * 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 "../rtengine/noncopyable.h" +#include "../rtengine/rtengine.h" class RTImage; -class ProfilePanel : public Gtk::Grid, public PParamsChangeListener, public ProfileStoreListener, public rtengine::NonCopyable +class ProfilePanel : + public Gtk::Grid, + public PParamsChangeListener, + public ProfileStoreListener, + public rtengine::NonCopyable { private: @@ -107,5 +113,3 @@ public: void selection_changed (); void writeOptions(); }; - -#endif diff --git a/rtgui/profilestorecombobox.h b/rtgui/profilestorecombobox.h index cec67d188..447d2e157 100644 --- a/rtgui/profilestorecombobox.h +++ b/rtgui/profilestorecombobox.h @@ -16,20 +16,19 @@ * 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 "threadutils.h" -#include "paramsedited.h" #include "guiutils.h" +#include "paramsedited.h" +#include "threadutils.h" +#include "../rtengine/profilestore.h" +#include "../rtengine/rtengine.h" /** * @brief subclass of Gtk::Label with extra fields for Combobox and Menu, to link with a ProfileStoreEntry @@ -92,5 +91,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..32a48473f 100644 --- a/rtgui/progressconnector.h +++ b/rtgui/progressconnector.h @@ -16,14 +16,16 @@ * 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 "../rtengine/rtengine.h" + #undef THREAD_PRIORITY_NORMAL class PLDBridge : @@ -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 339a054c9..75b3a9330 100644 --- a/rtgui/rawexposure.h +++ b/rtgui/rawexposure.h @@ -16,14 +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" -class RAWExposure : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel +class RAWExposure : + public ToolParamBlock, + public AdjusterListener, + public FoldableToolPanel { protected: @@ -43,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.h b/rtgui/renamedlg.h index a3e16ad0a..23f69391f 100644 --- a/rtgui/renamedlg.h +++ b/rtgui/renamedlg.h @@ -16,16 +16,17 @@ * 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 RenameDialog : + public Gtk::Dialog { protected: @@ -43,6 +44,3 @@ public: Glib::ustring getNewName (); }; - -#endif - 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.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.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/rtwindow.h b/rtgui/rtwindow.h index 93e1c31b9..05d0cc231 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 "batchqueuepanel.h" +#include "editorpanel.h" +#include "editwindow.h" +#include "filepanel.h" +#include "progressconnector.h" +#include "splash.h" + #include "../rtengine/noncopyable.h" -class RTWindow : public Gtk::Window, public rtengine::ProgressListener, public rtengine::NonCopyable +class RTWindow : + public Gtk::Window, + public rtengine::ProgressListener, + public rtengine::NonCopyable { private: @@ -125,5 +131,3 @@ public: void writeToolExpandedStatus (std::vector &tpOpen); }; - -#endif diff --git a/rtgui/saveasdlg.h b/rtgui/saveasdlg.h index 4097a3ae9..e4567f69b 100644 --- a/rtgui/saveasdlg.h +++ b/rtgui/saveasdlg.h @@ -16,14 +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" -class SaveAsDialog : public Gtk::Dialog, public FormatChangeListener +class SaveAsDialog : + public Gtk::Dialog, + public FormatChangeListener { protected: @@ -64,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.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.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.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/thumbimageupdater.h b/rtgui/thumbimageupdater.h index 81636103e..6c4171a87 100644 --- a/rtgui/thumbimageupdater.h +++ b/rtgui/thumbimageupdater.h @@ -16,16 +16,15 @@ * 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 "thumbbrowserentrybase.h" + #include "../rtengine/rtengine.h" #include "../rtengine/noncopyable.h" -#include "thumbbrowserentrybase.h" - class ThumbImageUpdateListener { public: @@ -100,5 +99,3 @@ private: * To use: \c thumbImageUpdater->start() , */ #define thumbImageUpdater ThumbImageUpdater::getInstance() - -#endif diff --git a/rtgui/thumbnail.h b/rtgui/thumbnail.h index cacffbd58..1a0f68409 100644 --- a/rtgui/thumbnail.h +++ b/rtgui/thumbnail.h @@ -16,21 +16,23 @@ * 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 "cacheimagedata.h" #include "cachemanager.h" +#include "threadutils.h" +#include "thumbnaillistener.h" + #include "../rtengine/rtengine.h" #include "../rtengine/rtthumbnail.h" -#include "cacheimagedata.h" -#include "thumbnaillistener.h" -#include "threadutils.h" class CacheManager; + struct ParamsEdited; class Thumbnail @@ -184,7 +186,3 @@ public: bool openDefaultViewer(int destination); bool imageLoad(bool loading); }; - - -#endif - diff --git a/rtgui/thumbnailbrowser.h b/rtgui/thumbnailbrowser.h index 9d40d1f7d..ef953c0e9 100644 --- a/rtgui/thumbnailbrowser.h +++ b/rtgui/thumbnailbrowser.h @@ -16,12 +16,12 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _THUMBNAILBROWSER_ -#define _THUMBNAILBROWSER_ +#pragma once #include -#include "thumbnail.h" + #include "filecatalog.h" +#include "thumbnail.h" class ThumbBrowserEntry { @@ -97,5 +97,3 @@ public: 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.h b/rtgui/tonecurve.h index fb08c02c2..b44a7ccab 100644 --- a/rtgui/tonecurve.h +++ b/rtgui/tonecurve.h @@ -16,20 +16,25 @@ * 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 "mycurve.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 +146,3 @@ public: void methodChanged (); void clampOOGChanged(); }; - -#endif diff --git a/rtgui/toolbar.h b/rtgui/toolbar.h index 958aa80be..9f0a2818b 100644 --- a/rtgui/toolbar.h +++ b/rtgui/toolbar.h @@ -16,12 +16,12 @@ * 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 "lockablecolorpicker.h" +#include "toolenum.h" class RTImage; @@ -100,5 +100,3 @@ public: bool handleShortcutKey (GdkEventKey* event); void setBatchMode(); }; - -#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.h b/rtgui/toolpanel.h index 2c787d937..aeb0f60a6 100644 --- a/rtgui/toolpanel.h +++ b/rtgui/toolpanel.h @@ -16,20 +16,22 @@ * 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 "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" + class FoldableToolPanel; +class ToolPanel; class ToolPanelListener { @@ -39,20 +41,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 +141,8 @@ public: } }; -class FoldableToolPanel : public ToolPanel +class FoldableToolPanel : + public ToolPanel { protected: @@ -218,5 +224,3 @@ public: return exp->signal_enabled_toggled(); } }; - -#endif diff --git a/rtgui/toolpanelcoord.h b/rtgui/toolpanelcoord.h index 3a4ddc05f..7b6e23937 100644 --- a/rtgui/toolpanelcoord.h +++ b/rtgui/toolpanelcoord.h @@ -16,75 +16,77 @@ * 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 "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 "metadatapanel.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; @@ -331,5 +333,3 @@ public: private: IdleRegister idle_register; }; - -#endif 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/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.h b/rtgui/whitebalance.h index fd7efe7ce..5c0500b92 100644 --- a/rtgui/whitebalance.h +++ b/rtgui/whitebalance.h @@ -16,14 +16,15 @@ * 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" class SpotWBListener @@ -123,5 +124,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 4211e3e0c..46c418f2f 100644 --- a/rtgui/xtransrawexposure.h +++ b/rtgui/xtransrawexposure.h @@ -16,14 +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" -class XTransRAWExposure : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel +class XTransRAWExposure : + public ToolParamBlock, + public AdjusterListener, + public FoldableToolPanel { protected: @@ -45,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 - From c44e9dfa4448e9c9b89d9b8f5b32b57101be8737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=B6ssie?= Date: Thu, 31 Oct 2019 12:55:12 +0100 Subject: [PATCH 21/40] Add missing includes for latest GCC 9 --- rtengine/lcp.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rtengine/lcp.cc b/rtengine/lcp.cc index 0b73f6960..b42950eb4 100644 --- a/rtengine/lcp.cc +++ b/rtengine/lcp.cc @@ -18,6 +18,7 @@ */ #include +#include #include #include @@ -32,6 +33,7 @@ #include "lcp.h" #include "procparams.h" +#include "rt_math.h" #include "settings.h" #include "utils.h" From 284fe57159da24663c1899e30e4494d132d7985d Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Thu, 31 Oct 2019 13:29:12 +0100 Subject: [PATCH 22/40] Further reduction of include dependencies --- rtengine/FTblockDN.cc | 1 - rtengine/ahd_demosaic_RT.cc | 2 -- rtengine/amaze_demosaic_RT.cc | 1 - rtengine/dcraw.cc | 3 ++- rtengine/dcrop.cc | 1 - rtengine/demosaic_algos.cc | 1 - rtengine/dfmanager.cc | 18 +++++++++++++----- rtengine/dfmanager.h | 10 ++-------- rtengine/eahd_demosaic.cc | 2 -- rtengine/fast_demo.cc | 1 - rtengine/hphd_demosaic_RT.cc | 2 -- rtengine/iccstore.cc | 1 - rtengine/myfile.cc | 2 +- rtengine/myfile.h | 8 +++++++- rtengine/rawimage.cc | 1 + rtengine/rawimage.h | 1 + rtengine/rawimagesource.cc | 1 - rtengine/rcd_demosaic.cc | 1 - rtengine/vng4_demosaic_RT.cc | 1 - rtgui/darkframe.cc | 1 + rtgui/darkframe.h | 5 ++++- rtgui/flatfield.cc | 1 + rtgui/flatfield.h | 5 ++++- 23 files changed, 37 insertions(+), 33 deletions(-) diff --git a/rtengine/FTblockDN.cc b/rtengine/FTblockDN.cc index 02164aded..b6245fbce 100644 --- a/rtengine/FTblockDN.cc +++ b/rtengine/FTblockDN.cc @@ -41,7 +41,6 @@ #include "opthelper.h" #include "procparams.h" #include "rt_math.h" -#include "rtengine.h" #include "sleef.c" #include "../rtgui/threadutils.h" diff --git a/rtengine/ahd_demosaic_RT.cc b/rtengine/ahd_demosaic_RT.cc index 77e342c18..88ab0bf56 100644 --- a/rtengine/ahd_demosaic_RT.cc +++ b/rtengine/ahd_demosaic_RT.cc @@ -24,11 +24,9 @@ // #include -#include "colortemp.h" #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/amaze_demosaic_RT.cc b/rtengine/amaze_demosaic_RT.cc index 43aef0f71..41c60d4ed 100644 --- a/rtengine/amaze_demosaic_RT.cc +++ b/rtengine/amaze_demosaic_RT.cc @@ -33,7 +33,6 @@ #include "sleef.c" #include "opthelper.h" #include "median.h" -#include "procparams.h" #include "StopWatch.h" namespace rtengine 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/dcrop.cc b/rtengine/dcrop.cc index 06c9d59bd..fd3c42f6e 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -19,7 +19,6 @@ */ #include "cieimage.h" -#include "colortemp.h" #include "curves.h" #include "dcp.h" #include "dcrop.h" diff --git a/rtengine/demosaic_algos.cc b/rtengine/demosaic_algos.cc index 823260129..4058534da 100644 --- a/rtengine/demosaic_algos.cc +++ b/rtengine/demosaic_algos.cc @@ -25,7 +25,6 @@ #include "rt_math.h" #include "color.h" #include "../rtgui/multilangmgr.h" -#include "procparams.h" #include "sleef.c" #include "opthelper.h" #include "median.h" diff --git a/rtengine/dfmanager.cc b/rtengine/dfmanager.cc index f5a7686e6..798836edf 100644 --- a/rtengine/dfmanager.cc +++ b/rtengine/dfmanager.cc @@ -16,20 +16,28 @@ * 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 "rawimage.h" + #include #include #include -#include "imagedata.h" +#include #include +#include "dfmanager.h" +#include "../rtgui/options.h" +#include "rawimage.h" +#include "imagedata.h" + namespace rtengine { // *********************** class dfInfo ************************************** +dfInfo::~dfInfo() +{ + if( ri ) { + delete ri; + } +} inline dfInfo& dfInfo::operator =(const dfInfo &o) { diff --git a/rtengine/dfmanager.h b/rtengine/dfmanager.h index e1fa38f77..216dcfc53 100644 --- a/rtengine/dfmanager.h +++ b/rtengine/dfmanager.h @@ -19,13 +19,13 @@ #pragma once #include +#include #include #include #include #include "pixelsmap.h" -#include "rawimage.h" namespace rtengine { @@ -49,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/eahd_demosaic.cc b/rtengine/eahd_demosaic.cc index b87c0771d..c470eb297 100644 --- a/rtengine/eahd_demosaic.cc +++ b/rtengine/eahd_demosaic.cc @@ -24,11 +24,9 @@ #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/hphd_demosaic_RT.cc b/rtengine/hphd_demosaic_RT.cc index 342cd2b6b..2b61bbe07 100644 --- a/rtengine/hphd_demosaic_RT.cc +++ b/rtengine/hphd_demosaic_RT.cc @@ -22,9 +22,7 @@ #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/iccstore.cc b/rtengine/iccstore.cc index 02fe4c16d..aea03664e 100644 --- a/rtengine/iccstore.cc +++ b/rtengine/iccstore.cc @@ -36,7 +36,6 @@ #include "iccmatrices.h" #include "utils.h" -#include "../rtgui/guiutils.h" #include "../rtgui/options.h" #include "../rtgui/threadutils.h" #include "lcms2_plugin.h" diff --git a/rtengine/myfile.cc b/rtengine/myfile.cc index aab45448a..842766dcf 100644 --- a/rtengine/myfile.cc +++ b/rtengine/myfile.cc @@ -18,7 +18,7 @@ */ #include "myfile.h" #include - +#include "rtengine.h" // get mmap() sorted out #ifdef MYFILE_MMAP diff --git a/rtengine/myfile.h b/rtengine/myfile.h index 69e226b8b..88b9fa62a 100644 --- a/rtengine/myfile.h +++ b/rtengine/myfile.h @@ -23,7 +23,13 @@ #include -#include "rtengine.h" +#include "opthelper.h" + +namespace rtengine { + +class ProgressListener; + +} struct IMFILE { int fd; diff --git a/rtengine/rawimage.cc b/rtengine/rawimage.cc index a69a97ab7..4421e4af4 100644 --- a/rtengine/rawimage.cc +++ b/rtengine/rawimage.cc @@ -15,6 +15,7 @@ #include "settings.h" #include "camconst.h" #include "utils.h" +#include "rtengine.h" namespace rtengine { diff --git a/rtengine/rawimage.h b/rtengine/rawimage.h index 4537fdcab..09aaed7ad 100644 --- a/rtengine/rawimage.h +++ b/rtengine/rawimage.h @@ -21,6 +21,7 @@ #include #include #include +#include #include "dcraw.h" #include "imageformat.h" diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 0836a3832..0a36bdee8 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -34,7 +34,6 @@ #include "pdaflinesfilter.h" #include "procparams.h" #include "rawimage.h" -#include "rawimage.h" #include "rawimagesource_i.h" #include "rawimagesource.h" #include "rt_math.h" 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/vng4_demosaic_RT.cc b/rtengine/vng4_demosaic_RT.cc index aaaa1b9a6..95fa58cef 100644 --- a/rtengine/vng4_demosaic_RT.cc +++ b/rtengine/vng4_demosaic_RT.cc @@ -23,7 +23,6 @@ #include "rtengine.h" #include "rawimage.h" #include "rawimagesource.h" -#include "procparams.h" #include "../rtgui/multilangmgr.h" //#define BENCHMARK #include "StopWatch.h" 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 58ac904ff..7bb6ed507 100644 --- a/rtgui/darkframe.h +++ b/rtgui/darkframe.h @@ -25,8 +25,11 @@ #include "guiutils.h" #include "toolpanel.h" -#include "../rtengine/rawimage.h" +namespace rtengine { +class RawImage; + +} class DFProvider { public: diff --git a/rtgui/flatfield.cc b/rtgui/flatfield.cc index 03204c037..932ec641c 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 02cc9963f..8b04a7948 100644 --- a/rtgui/flatfield.h +++ b/rtgui/flatfield.h @@ -26,8 +26,11 @@ #include "guiutils.h" #include "toolpanel.h" -#include "../rtengine/rawimage.h" +namespace rtengine { +class RawImage; + +} class FFProvider { public: From cac2eb53eff29a59793db4c2689693020d80fca8 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Thu, 31 Oct 2019 20:41:08 +0100 Subject: [PATCH 23/40] Further reduction of include dependencies --- rtengine/PF_correct_RT.cc | 2 +- rtengine/curves.h | 5 ++--- rtengine/dcp.cc | 3 +++ rtengine/dfmanager.cc | 5 ++--- rtengine/diagonalcurvetypes.h | 31 +++++++++++++++++++++++++++++ rtengine/dynamicprofile.cc | 1 + rtengine/ffmanager.cc | 4 +--- rtengine/flatcurvetypes.h | 29 +++++++++++++++++++++++++++ rtengine/histmatching.cc | 2 -- rtengine/imagedata.cc | 1 + rtengine/imageio.cc | 1 + rtengine/improccoordinator.cc | 1 + rtengine/improccoordinator.h | 5 +++++ rtengine/ipvibrance.cc | 1 - rtengine/myfile.h | 3 ++- rtengine/procparams.cc | 4 ++++ rtengine/rtengine.h | 1 - rtengine/rtthumbnail.cc | 2 ++ rtengine/simpleprocess.cc | 1 + rtengine/stdimagesource.cc | 1 + rtexif/rtexif.cc | 1 + rtexif/rtexif.h | 5 ++++- rtgui/adjuster.cc | 10 +++++----- rtgui/adjuster.h | 2 -- rtgui/batchqueue.cc | 1 + rtgui/bayerprocess.cc | 1 + rtgui/blackwhite.cc | 1 + rtgui/cacheimagedata.cc | 1 + rtgui/clipboard.h | 4 ++-- rtgui/colorappearance.cc | 1 + rtgui/colorprovider.h | 2 -- rtgui/curveeditor.h | 4 ++-- rtgui/curveeditorgroup.cc | 1 + rtgui/curveeditorgroup.h | 5 +++-- rtgui/darkframe.h | 4 +++- rtgui/diagonalcurveeditorsubgroup.h | 1 + rtgui/editorpanel.cc | 1 + rtgui/filecatalog.cc | 1 + rtgui/flatcurveeditorsubgroup.h | 1 + rtgui/flatfield.h | 4 +++- rtgui/guiutils.h | 1 - rtgui/iccprofilecreator.cc | 1 + rtgui/icmpanel.cc | 1 + rtgui/inspector.cc | 1 + rtgui/lockablecolorpicker.cc | 1 + rtgui/mydiagonalcurve.h | 12 +---------- rtgui/myflatcurve.h | 11 +--------- rtgui/options.cc | 2 ++ rtgui/options.h | 4 +++- rtgui/profilepanel.cc | 1 + rtgui/saveasdlg.cc | 1 + rtgui/thumbnail.cc | 1 + rtgui/tonecurve.cc | 1 + rtgui/whitebalance.h | 1 + 54 files changed, 137 insertions(+), 56 deletions(-) create mode 100644 rtengine/diagonalcurvetypes.h create mode 100644 rtengine/flatcurvetypes.h diff --git a/rtengine/PF_correct_RT.cc b/rtengine/PF_correct_RT.cc index 40b4933ae..e1d6ef808 100644 --- a/rtengine/PF_correct_RT.cc +++ b/rtengine/PF_correct_RT.cc @@ -33,7 +33,7 @@ #include "curves.h" #include "labimage.h" #include "sleef.c" -#include "../rtgui/myflatcurve.h" +#include "curves.h" #include "rt_math.h" #include "opthelper.h" #include "median.h" diff --git a/rtengine/curves.h b/rtengine/curves.h index ef25ff8d7..4d38e9cce 100644 --- a/rtengine/curves.h +++ b/rtengine/curves.h @@ -25,10 +25,9 @@ #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 "noncopyable.h" #include "LUT.h" diff --git a/rtengine/dcp.cc b/rtengine/dcp.cc index ea4e40514..f15ae902f 100644 --- a/rtengine/dcp.cc +++ b/rtengine/dcp.cc @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include "dcp.h" @@ -31,6 +33,7 @@ #include "imagefloat.h" #include "rawimagesource.h" #include "rt_math.h" +#include "utils.h" #include "../rtgui/options.h" using namespace rtengine; diff --git a/rtengine/dfmanager.cc b/rtengine/dfmanager.cc index 798836edf..1fb1d2e1b 100644 --- a/rtengine/dfmanager.cc +++ b/rtengine/dfmanager.cc @@ -27,6 +27,7 @@ #include "../rtgui/options.h" #include "rawimage.h" #include "imagedata.h" +#include "utils.h" namespace rtengine { @@ -34,9 +35,7 @@ namespace rtengine // *********************** class dfInfo ************************************** dfInfo::~dfInfo() { - if( ri ) { - delete ri; - } + delete ri; } inline dfInfo& dfInfo::operator =(const dfInfo &o) 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/dynamicprofile.cc b/rtengine/dynamicprofile.cc index 402610ed1..0e3d75b43 100644 --- a/rtengine/dynamicprofile.cc +++ b/rtengine/dynamicprofile.cc @@ -22,6 +22,7 @@ #include #include #include +#include #include "../rtgui/options.h" diff --git a/rtengine/ffmanager.cc b/rtengine/ffmanager.cc index d8b082dd1..ce60277e1 100644 --- a/rtengine/ffmanager.cc +++ b/rtengine/ffmanager.cc @@ -54,9 +54,7 @@ inline ffInfo& ffInfo::operator =(const ffInfo &o) ffInfo::~ffInfo() { - if( ri ) { - delete ri; - } + delete ri; } bool ffInfo::operator <(const ffInfo &e2) const diff --git a/rtengine/flatcurvetypes.h b/rtengine/flatcurvetypes.h new file mode 100644 index 000000000..9efe0d259 --- /dev/null +++ b/rtengine/flatcurvetypes.h @@ -0,0 +1,29 @@ +/* + * 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 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 +}; diff --git a/rtengine/histmatching.cc b/rtengine/histmatching.cc index 622933149..f5d16866e 100644 --- a/rtengine/histmatching.cc +++ b/rtengine/histmatching.cc @@ -32,8 +32,6 @@ //#define BENCHMARK #include "StopWatch.h" -#include "../rtgui/mydiagonalcurve.h" - namespace rtengine { diff --git a/rtengine/imagedata.cc b/rtengine/imagedata.cc index 184e288e9..d952dc8ba 100644 --- a/rtengine/imagedata.cc +++ b/rtengine/imagedata.cc @@ -31,6 +31,7 @@ #include "iptcpairs.h" #include "procparams.h" #include "rt_math.h" +#include "utils.h" #pragma GCC diagnostic warning "-Wextra" #define PRINT_HDR_PS_DETECTION 0 diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index c586aabaf..5927a23be 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -27,6 +27,7 @@ #include #include "rt_math.h" #include "procparams.h" +#include "utils.h" #include "../rtgui/options.h" #include "../rtgui/version.h" diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index c61b37341..729682b0f 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -19,6 +19,7 @@ #include #include #include +#include #include "improccoordinator.h" diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index c416ebe67..c27cfe76e 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -32,6 +32,11 @@ #include "../rtgui/threadutils.h" +namespace Glib +{ +class Thread; +} + namespace rtengine { diff --git a/rtengine/ipvibrance.cc b/rtengine/ipvibrance.cc index 365dff587..1c5c6c4d5 100644 --- a/rtengine/ipvibrance.cc +++ b/rtengine/ipvibrance.cc @@ -25,7 +25,6 @@ #include "iccstore.h" #include "labimage.h" #include "mytime.h" -#include "../rtgui/thresholdselector.h" #include "curves.h" #include "color.h" #include "procparams.h" diff --git a/rtengine/myfile.h b/rtengine/myfile.h index 88b9fa62a..7c498e556 100644 --- a/rtengine/myfile.h +++ b/rtengine/myfile.h @@ -25,7 +25,8 @@ #include "opthelper.h" -namespace rtengine { +namespace rtengine +{ class ProgressListener; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 8de7e2b55..df5ac40a9 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -22,9 +22,13 @@ #include #include +#include +#include +#include #include "curves.h" #include "procparams.h" +#include "utils.h" #include "../rtgui/multilangmgr.h" #include "../rtgui/options.h" diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h index 389fe8355..d1300f023 100644 --- a/rtengine/rtengine.h +++ b/rtengine/rtengine.h @@ -33,7 +33,6 @@ #include "rawmetadatalocation.h" #include "rt_math.h" #include "settings.h" -#include "utils.h" #include "../rtexif/rtexif.h" diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 3b6046b4e..d6ff53750 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -23,6 +23,8 @@ #include #include +#include +#include #include "cieimage.h" #include "colortemp.h" diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 2953fc34b..3c89fe48d 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -30,6 +30,7 @@ #include "processingjob.h" #include "procparams.h" #include +#include #include "../rtgui/options.h" #include "rawimagesource.h" #include "../rtgui/multilangmgr.h" diff --git a/rtengine/stdimagesource.cc b/rtengine/stdimagesource.cc index 2e8846412..1cb11e94d 100644 --- a/rtengine/stdimagesource.cc +++ b/rtengine/stdimagesource.cc @@ -26,6 +26,7 @@ #include "imageio.h" #include "mytime.h" #include "procparams.h" +#include "utils.h" #undef THREAD_PRIORITY_NORMAL 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 515c7569d..4c5a6cafe 100644 --- a/rtexif/rtexif.h +++ b/rtexif/rtexif.h @@ -29,12 +29,15 @@ #include #include -#include #include #include "../rtengine/noncopyable.h" #include "../rtengine/rawmetadatalocation.h" +namespace Glib +{ + class KeyFile; +} namespace rtengine { diff --git a/rtgui/adjuster.cc b/rtgui/adjuster.cc index 91394e18d..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/rt_math.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 1583bab69..9800dbac8 100644 --- a/rtgui/adjuster.h +++ b/rtgui/adjuster.h @@ -18,8 +18,6 @@ */ #pragma once -#include - #include "editedstate.h" #include "guiutils.h" diff --git a/rtgui/batchqueue.cc b/rtgui/batchqueue.cc index ed9861ad6..9fcaa28d1 100644 --- a/rtgui/batchqueue.cc +++ b/rtgui/batchqueue.cc @@ -34,6 +34,7 @@ #include "filecatalog.h" #include "batchqueuebuttonset.h" #include "guiutils.h" +#include "pathutils.h" #include "rtimage.h" #include 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/blackwhite.cc b/rtgui/blackwhite.cc index 482bf437f..b3ebea28a 100644 --- a/rtgui/blackwhite.cc +++ b/rtgui/blackwhite.cc @@ -27,6 +27,7 @@ #include "../rtengine/color.h" #include "../rtengine/procparams.h" +#include "../rtengine/utils.h" using namespace rtengine; using namespace rtengine::procparams; diff --git a/rtgui/cacheimagedata.cc b/rtgui/cacheimagedata.cc index 114508a95..d44ca28ec 100644 --- a/rtgui/cacheimagedata.cc +++ b/rtgui/cacheimagedata.cc @@ -19,6 +19,7 @@ #include "cacheimagedata.h" #include #include +#include #include "version.h" #include diff --git a/rtgui/clipboard.h b/rtgui/clipboard.h index d142808e9..7d25dd0d5 100644 --- a/rtgui/clipboard.h +++ b/rtgui/clipboard.h @@ -21,10 +21,10 @@ #include #include -#include "mydiagonalcurve.h" -#include "myflatcurve.h" #include "paramsedited.h" +#include "../rtengine/diagonalcurvetypes.h" +#include "../rtengine/flatcurvetypes.h" #include "../rtengine/rtengine.h" namespace rtengine diff --git a/rtgui/colorappearance.cc b/rtgui/colorappearance.cc index 450589fe9..094ffec2f 100644 --- a/rtgui/colorappearance.cc +++ b/rtgui/colorappearance.cc @@ -26,6 +26,7 @@ #include "../rtengine/color.h" #include "../rtengine/procparams.h" +#include "../rtengine/utils.h" #define MINTEMP0 2000 //1200 #define MAXTEMP0 12000 //12000 diff --git a/rtgui/colorprovider.h b/rtgui/colorprovider.h index a84b1be27..988b080bd 100644 --- a/rtgui/colorprovider.h +++ b/rtgui/colorprovider.h @@ -18,8 +18,6 @@ */ #pragma once -#include - class ColorProvider; /* diff --git a/rtgui/curveeditor.h b/rtgui/curveeditor.h index dd61bc910..535c1a86d 100644 --- a/rtgui/curveeditor.h +++ b/rtgui/curveeditor.h @@ -20,10 +20,10 @@ #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" diff --git a/rtgui/curveeditorgroup.cc b/rtgui/curveeditorgroup.cc index edad0349d..06def0a8e 100644 --- a/rtgui/curveeditorgroup.cc +++ b/rtgui/curveeditorgroup.cc @@ -26,6 +26,7 @@ #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 7c39ab186..e3412546f 100644 --- a/rtgui/curveeditorgroup.h +++ b/rtgui/curveeditorgroup.h @@ -26,10 +26,11 @@ #include "adjuster.h" #include "guiutils.h" #include "mycurve.h" -#include "mydiagonalcurve.h" -#include "myflatcurve.h" #include "shcselector.h" +#include "../rtengine/diagonalcurvetypes.h" +#include "../rtengine/flatcurvetypes.h" + class CurveEditor; class DiagonalCurveEditorSubGroup; class FlatCurveEditorSubGroup; diff --git a/rtgui/darkframe.h b/rtgui/darkframe.h index 7bb6ed507..779caf16f 100644 --- a/rtgui/darkframe.h +++ b/rtgui/darkframe.h @@ -25,11 +25,13 @@ #include "guiutils.h" #include "toolpanel.h" -namespace rtengine { +namespace rtengine +{ class RawImage; } + class DFProvider { public: diff --git a/rtgui/diagonalcurveeditorsubgroup.h b/rtgui/diagonalcurveeditorsubgroup.h index 21784578e..184fa576f 100644 --- a/rtgui/diagonalcurveeditorsubgroup.h +++ b/rtgui/diagonalcurveeditorsubgroup.h @@ -25,6 +25,7 @@ #include "../rtengine/noncopyable.h" class DiagonalCurveEditor; +class MyDiagonalCurve; class DiagonalCurveEditorSubGroup : public CurveEditorSubGroup, diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 6aab153a1..3c5182938 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -32,6 +32,7 @@ #include "progressconnector.h" #include "procparamchangers.h" #include "placesbrowser.h" +#include "pathutils.h" using namespace rtengine::procparams; diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index 8e8bcc216..fb8bd4923 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -36,6 +36,7 @@ #include "thumbimageupdater.h" #include "batchqueue.h" #include "placesbrowser.h" +#include "pathutils.h" using namespace std; diff --git a/rtgui/flatcurveeditorsubgroup.h b/rtgui/flatcurveeditorsubgroup.h index 5b14f752a..c358dde3b 100644 --- a/rtgui/flatcurveeditorsubgroup.h +++ b/rtgui/flatcurveeditorsubgroup.h @@ -25,6 +25,7 @@ #include "../rtengine/noncopyable.h" class FlatCurveEditor; +class MyFlatCurve; class FlatCurveEditorSubGroup: public CurveEditorSubGroup, diff --git a/rtgui/flatfield.h b/rtgui/flatfield.h index 8b04a7948..4308e938a 100644 --- a/rtgui/flatfield.h +++ b/rtgui/flatfield.h @@ -26,11 +26,13 @@ #include "guiutils.h" #include "toolpanel.h" -namespace rtengine { +namespace rtengine +{ class RawImage; } + class FFProvider { public: diff --git a/rtgui/guiutils.h b/rtgui/guiutils.h index 18b650b82..8764f4c6a 100644 --- a/rtgui/guiutils.h +++ b/rtgui/guiutils.h @@ -25,7 +25,6 @@ #include -#include "pathutils.h" #include "threadutils.h" #include "../rtengine/coord.h" diff --git a/rtgui/iccprofilecreator.cc b/rtgui/iccprofilecreator.cc index e3e1eadb4..d7f9499f6 100644 --- a/rtgui/iccprofilecreator.cc +++ b/rtgui/iccprofilecreator.cc @@ -24,6 +24,7 @@ #include "cachemanager.h" #include "addsetids.h" #include "../rtengine/color.h" +#include "pathutils.h" #include "rtimage.h" #ifdef _OPENMP #include diff --git a/rtgui/icmpanel.cc b/rtgui/icmpanel.cc index 99bd6cfca..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" diff --git a/rtgui/inspector.cc b/rtgui/inspector.cc index 50fa933e1..d38239cde 100644 --- a/rtgui/inspector.cc +++ b/rtgui/inspector.cc @@ -22,6 +22,7 @@ #include "cursormanager.h" #include "guiutils.h" #include "options.h" +#include "pathutils.h" #include "rtscalable.h" #include "../rtengine/previewimage.h" diff --git a/rtgui/lockablecolorpicker.cc b/rtgui/lockablecolorpicker.cc index a4f3dbdab..cb334c7e4 100644 --- a/rtgui/lockablecolorpicker.cc +++ b/rtgui/lockablecolorpicker.cc @@ -21,6 +21,7 @@ #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" diff --git a/rtgui/mydiagonalcurve.h b/rtgui/mydiagonalcurve.h index 058c11e5a..d9f2518fb 100644 --- a/rtgui/mydiagonalcurve.h +++ b/rtgui/mydiagonalcurve.h @@ -27,18 +27,8 @@ #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 -}; class DiagonalCurveDescr { diff --git a/rtgui/myflatcurve.h b/rtgui/myflatcurve.h index c4cbfa291..88d651a05 100644 --- a/rtgui/myflatcurve.h +++ b/rtgui/myflatcurve.h @@ -25,16 +25,7 @@ #include "cursormanager.h" #include "curvelistener.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 "../rtengine/flatcurvetypes.h" enum MouseOverAreas { FCT_Area_None = 1 << 0, // over a zone that don't have any diff --git a/rtgui/options.cc b/rtgui/options.cc index 164637eb2..f5b6b5b60 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -25,10 +25,12 @@ #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 33d6b6f90..c0ed2138b 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -103,11 +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 { +namespace Glib +{ class KeyFile; } + class Options { public: diff --git a/rtgui/profilepanel.cc b/rtgui/profilepanel.cc index fc418e5b7..723bbfd61 100644 --- a/rtgui/profilepanel.cc +++ b/rtgui/profilepanel.cc @@ -22,6 +22,7 @@ #include "multilangmgr.h" #include "options.h" #include "profilestorecombobox.h" +#include "pathutils.h" #include "rtimage.h" #include "../rtengine/procparams.h" diff --git a/rtgui/saveasdlg.cc b/rtgui/saveasdlg.cc index 5516bdf7c..ebf2f5b4a 100644 --- a/rtgui/saveasdlg.cc +++ b/rtgui/saveasdlg.cc @@ -22,6 +22,7 @@ #include "guiutils.h" #include "multilangmgr.h" +#include "pathutils.h" #include "rtimage.h" #include "../rtengine/utils.h" diff --git a/rtgui/thumbnail.cc b/rtgui/thumbnail.cc index 09ffd11f7..7464244f7 100644 --- a/rtgui/thumbnail.cc +++ b/rtgui/thumbnail.cc @@ -32,6 +32,7 @@ #include "guiutils.h" #include "batchqueue.h" #include "extprog.h" +#include "pathutils.h" #include "profilestorecombobox.h" #include "procparamchangers.h" diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc index 1f660f72a..68f3ee4de 100644 --- a/rtgui/tonecurve.cc +++ b/rtgui/tonecurve.cc @@ -28,6 +28,7 @@ #include "options.h" #include "../rtengine/procparams.h" +#include "../rtengine/utils.h" #include "editcallbacks.h" using namespace rtengine; diff --git a/rtgui/whitebalance.h b/rtgui/whitebalance.h index 5c0500b92..528c81d17 100644 --- a/rtgui/whitebalance.h +++ b/rtgui/whitebalance.h @@ -26,6 +26,7 @@ #include "wbprovider.h" #include "../rtengine/procparams.h" +#include "../rtengine/utils.h" class SpotWBListener { From 785273e7bfa2a079125946d646a4a07fa6177e48 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Fri, 1 Nov 2019 01:03:30 +0100 Subject: [PATCH 24/40] Further reduction of include dependencies --- rtengine/curves.cc | 2 +- rtengine/curves.h | 2 +- rtengine/dynamicprofile.cc | 1 + rtengine/dynamicprofile.h | 6 +++++- rtengine/profilestore.h | 3 ++- rtgui/batchqueueentry.h | 7 ++++++- rtgui/bqentryupdater.h | 10 +++++++++- rtgui/clipboard.h | 2 +- rtgui/main-cli.cc | 1 + rtgui/paramsedited.h | 14 +++++++++++++- rtgui/partialpastedlg.h | 12 +++++++++++- rtgui/pparamschangelistener.h | 15 ++++++++++++++- rtgui/profilechangelistener.h | 3 ++- rtgui/profilepanel.cc | 1 + rtgui/profilepanel.h | 16 +++++++++++++++- rtgui/profilestorecombobox.h | 1 - rtgui/thumbimageupdater.h | 13 ++++++++++++- rtgui/toolpanel.h | 13 +++++++++++++ rtgui/whitebalance.cc | 2 +- 19 files changed, 109 insertions(+), 15 deletions(-) diff --git a/rtengine/curves.cc b/rtengine/curves.cc index a7e3337c8..eb6cc57c3 100644 --- a/rtengine/curves.cc +++ b/rtengine/curves.cc @@ -514,7 +514,7 @@ void CurveFactory::complexCurve (double ecomp, double black, double hlcompr, dou double shcompr, double br, double contr, const std::vector& curvePoints, const std::vector& curvePoints2, - LUTu & histogram, + const LUTu & histogram, LUTf & hlCurve, LUTf & shCurve, LUTf & outCurve, LUTu & outBeforeCCurveHistogram, ToneCurve & customToneCurve1, diff --git a/rtengine/curves.h b/rtengine/curves.h index 4d38e9cce..9c5a84eac 100644 --- a/rtengine/curves.h +++ b/rtengine/curves.h @@ -352,7 +352,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 curveBW (const std::vector& curvePointsbw, const std::vector& curvePointsbw2, const LUTu & histogrambw, LUTu & outBeforeCCurveHistogrambw, diff --git a/rtengine/dynamicprofile.cc b/rtengine/dynamicprofile.cc index 0e3d75b43..617ec2747 100644 --- a/rtengine/dynamicprofile.cc +++ b/rtengine/dynamicprofile.cc @@ -24,6 +24,7 @@ #include #include +#include "rtengine.h" #include "../rtgui/options.h" using namespace rtengine; diff --git a/rtengine/dynamicprofile.h b/rtengine/dynamicprofile.h index 9b893fae2..d91b91aee 100644 --- a/rtengine/dynamicprofile.h +++ b/rtengine/dynamicprofile.h @@ -20,7 +20,11 @@ #include #include -#include "../rtengine/rtengine.h" + +namespace rtengine +{ + class FramesMetaData; +} class DynamicProfileRule { diff --git a/rtengine/profilestore.h b/rtengine/profilestore.h index 08afc88f3..ee913947f 100644 --- a/rtengine/profilestore.h +++ b/rtengine/profilestore.h @@ -25,7 +25,8 @@ #include "dynamicprofile.h" #include "noncopyable.h" -#include "rtengine.h" +#include "procparams.h" +#include "../rtgui/threadutils.h" // forward decl namespace rtengine diff --git a/rtgui/batchqueueentry.h b/rtgui/batchqueueentry.h index d56c0e340..bc93949e0 100644 --- a/rtgui/batchqueueentry.h +++ b/rtgui/batchqueueentry.h @@ -27,7 +27,12 @@ #include "thumbnail.h" #include "../rtengine/noncopyable.h" -#include "../rtengine/rtengine.h" +#include "../rtengine/procparams.h" + +namespace rtengine +{ + class ProcessingJob; +} class BatchQueueEntry; struct BatchQueueEntryIdleHelper { diff --git a/rtgui/bqentryupdater.h b/rtgui/bqentryupdater.h index 6dbb4bedf..1e71c0fc0 100644 --- a/rtgui/bqentryupdater.h +++ b/rtgui/bqentryupdater.h @@ -23,8 +23,16 @@ #include "threadutils.h" #include "thumbnail.h" -#include "../rtengine/rtengine.h" +namespace rtengine +{ +namespace procparams +{ +class ProcParams; + +} + +} class BQEntryUpdateListener { diff --git a/rtgui/clipboard.h b/rtgui/clipboard.h index 7d25dd0d5..5e0c4b67d 100644 --- a/rtgui/clipboard.h +++ b/rtgui/clipboard.h @@ -25,7 +25,6 @@ #include "../rtengine/diagonalcurvetypes.h" #include "../rtengine/flatcurvetypes.h" -#include "../rtengine/rtengine.h" namespace rtengine { @@ -34,6 +33,7 @@ namespace procparams { class PartialProfile; +class IPTCPairs; } diff --git a/rtgui/main-cli.cc b/rtgui/main-cli.cc index 8310867df..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" diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index e435e2291..ec83e82cd 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -20,7 +20,19 @@ #include -#include "../rtengine/rtengine.h" +namespace rtengine +{ + +namespace procparams +{ + +class ProcParams; + +struct PartialProfile; + +} + +} struct GeneralParamsEdited { bool rank; diff --git a/rtgui/partialpastedlg.h b/rtgui/partialpastedlg.h index 6c4228061..da6c9251a 100644 --- a/rtgui/partialpastedlg.h +++ b/rtgui/partialpastedlg.h @@ -20,7 +20,17 @@ #include -#include "../rtengine/rtengine.h" +namespace rtengine +{ +namespace procparams +{ + +class ProcParams; + + +} + +} struct ParamsEdited; diff --git a/rtgui/pparamschangelistener.h b/rtgui/pparamschangelistener.h index de590dd9f..5d457e882 100644 --- a/rtgui/pparamschangelistener.h +++ b/rtgui/pparamschangelistener.h @@ -22,7 +22,20 @@ #include "paramsedited.h" -#include "../rtengine/rtengine.h" +namespace rtengine +{ + +class ProcEvent; + +namespace procparams +{ + +class ProcParams; + + +} + +} class PParamsChangeListener { diff --git a/rtgui/profilechangelistener.h b/rtgui/profilechangelistener.h index c2e3f2654..58c565393 100644 --- a/rtgui/profilechangelistener.h +++ b/rtgui/profilechangelistener.h @@ -20,14 +20,15 @@ #include -#include "../rtengine/rtengine.h" namespace rtengine { +class ProcEvent; namespace procparams { +class ProcParams; class PartialProfile; } diff --git a/rtgui/profilepanel.cc b/rtgui/profilepanel.cc index 723bbfd61..53e1cd583 100644 --- a/rtgui/profilepanel.cc +++ b/rtgui/profilepanel.cc @@ -26,6 +26,7 @@ #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 378b2a984..1e1a249bb 100644 --- a/rtgui/profilepanel.h +++ b/rtgui/profilepanel.h @@ -29,8 +29,22 @@ #include "profilestorecombobox.h" #include "../rtengine/noncopyable.h" -#include "../rtengine/rtengine.h" +namespace rtengine +{ + +class ProcEvent; + +namespace procparams +{ + +class ProcParams; + +struct PartialProfile; + +} + +} class RTImage; class ProfilePanel : diff --git a/rtgui/profilestorecombobox.h b/rtgui/profilestorecombobox.h index 447d2e157..6a74f8f71 100644 --- a/rtgui/profilestorecombobox.h +++ b/rtgui/profilestorecombobox.h @@ -28,7 +28,6 @@ #include "threadutils.h" #include "../rtengine/profilestore.h" -#include "../rtengine/rtengine.h" /** * @brief subclass of Gtk::Label with extra fields for Combobox and Menu, to link with a ProfileStoreEntry diff --git a/rtgui/thumbimageupdater.h b/rtgui/thumbimageupdater.h index 6c4171a87..cdf65bd62 100644 --- a/rtgui/thumbimageupdater.h +++ b/rtgui/thumbimageupdater.h @@ -22,9 +22,20 @@ #include "thumbbrowserentrybase.h" -#include "../rtengine/rtengine.h" #include "../rtengine/noncopyable.h" +namespace rtengine +{ + class IImage8; + +namespace procparams +{ + + struct CropParams; + +} + +} class ThumbImageUpdateListener { public: diff --git a/rtgui/toolpanel.h b/rtgui/toolpanel.h index aeb0f60a6..ee4f00e52 100644 --- a/rtgui/toolpanel.h +++ b/rtgui/toolpanel.h @@ -30,6 +30,19 @@ #include "../rtengine/noncopyable.h" #include "../rtengine/rtengine.h" +class ParamsEdited; + +namespace rtengine +{ + class ProcEvent; + +namespace procparams +{ + +class ProcParams; +} +} + class FoldableToolPanel; class ToolPanel; 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(); } } From 962f81f6bcf6dd96b9362078bf605b5522cb5884 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Fri, 1 Nov 2019 12:51:08 +0100 Subject: [PATCH 25/40] Further reduction of include dependencies --- rtgui/batchqueue.cc | 1 + rtgui/bqentryupdater.cc | 20 ++++++++++++-- rtgui/bqentryupdater.h | 4 +-- rtgui/guiutils.cc | 10 ------- rtgui/guiutils.h | 1 - rtgui/main.cc | 1 + rtgui/previewloader.cc | 2 ++ rtgui/previewloader.h | 4 +-- rtgui/previewwindow.cc | 2 +- rtgui/rtwindow.cc | 1 + rtgui/thumbnail.cc | 47 ++++++++++++++++++++++++++++++++ rtgui/thumbnail.h | 59 +++++++++++++---------------------------- 12 files changed, 93 insertions(+), 59 deletions(-) diff --git a/rtgui/batchqueue.cc b/rtgui/batchqueue.cc index 9fcaa28d1..acb45c266 100644 --- a/rtgui/batchqueue.cc +++ b/rtgui/batchqueue.cc @@ -28,6 +28,7 @@ #include #include +#include "cachemanager.h" #include "thumbnail.h" #include "batchqueue.h" #include "multilangmgr.h" diff --git a/rtgui/bqentryupdater.cc b/rtgui/bqentryupdater.cc index 21a0f5ad0..8f5687b81 100644 --- a/rtgui/bqentryupdater.cc +++ b/rtgui/bqentryupdater.cc @@ -17,8 +17,24 @@ * along with RawTherapee. If not, see . */ #include "bqentryupdater.h" -#include + #include "guiutils.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 +43,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 1e71c0fc0..4cbbf6e59 100644 --- a/rtgui/bqentryupdater.h +++ b/rtgui/bqentryupdater.h @@ -48,7 +48,7 @@ class BatchQueueEntryUpdater guint8* oimg; int ow, oh, newh; BQEntryUpdateListener* listener; - rtengine::ProcParams* pparams; + rtengine::procparams::ProcParams* pparams; Thumbnail* thumbnail; }; @@ -62,7 +62,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 (); 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 8764f4c6a..97c72513b 100644 --- a/rtgui/guiutils.h +++ b/rtgui/guiutils.h @@ -48,7 +48,6 @@ 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); diff --git a/rtgui/main.cc b/rtgui/main.cc index 58fdd12dc..1bb840e1e 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -33,6 +33,7 @@ #include #include #include +#include "cachemanager.h" #include "options.h" #include "soundman.h" #include "rtimage.h" 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 3712dc3ff..9a74ee2eb 100644 --- a/rtgui/previewloader.h +++ b/rtgui/previewloader.h @@ -22,10 +22,10 @@ #include -#include "filebrowserentry.h" - #include "../rtengine/noncopyable.h" +class FileBrowserEntry; + class PreviewLoaderListener { public: diff --git a/rtgui/previewwindow.cc b/rtgui/previewwindow.cc index 54d785313..c813f04a2 100644 --- a/rtgui/previewwindow.cc +++ b/rtgui/previewwindow.cc @@ -88,7 +88,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/rtwindow.cc b/rtgui/rtwindow.cc index 3654e8af6..45d07c4af 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -19,6 +19,7 @@ #include #include "rtwindow.h" +#include "cachemanager.h" #include "preferences.h" #include "iccprofilecreator.h" #include "cursormanager.h" diff --git a/rtgui/thumbnail.cc b/rtgui/thumbnail.cc index 7464244f7..bb911534a 100644 --- a/rtgui/thumbnail.cc +++ b/rtgui/thumbnail.cc @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ +#include "cachemanager.h" #include "multilangmgr.h" #include "thumbnail.h" #include @@ -25,6 +26,7 @@ #include "../rtengine/colortemp.h" #include "../rtengine/imagedata.h" #include "../rtengine/procparams.h" +#include "../rtengine/rtthumbnail.h" #include #include "../rtengine/dynamicprofile.h" @@ -1151,3 +1153,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 1a0f68409..aee5ee0a6 100644 --- a/rtgui/thumbnail.h +++ b/rtgui/thumbnail.h @@ -24,13 +24,21 @@ #include #include "cacheimagedata.h" -#include "cachemanager.h" #include "threadutils.h" #include "thumbnaillistener.h" -#include "../rtengine/rtengine.h" -#include "../rtengine/rtthumbnail.h" +namespace rtengine +{ +class Thumbnail; +namespace procparams +{ + +class ProcParams; + +} + +} class CacheManager; struct ParamsEdited; @@ -98,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 (); @@ -123,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 @@ -156,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); From e682b364b51febfbe7e53f67658d65987b62acdd Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Fri, 1 Nov 2019 14:51:33 +0100 Subject: [PATCH 26/40] Further reduction of include dependencies --- rtengine/bilateral2.h | 1 - rtengine/color.cc | 5 ++++- rtengine/imagefloat.cc | 1 - rtengine/improccoordinator.cc | 1 - rtengine/improcfun.cc | 5 ++++- rtengine/iptransform.cc | 1 - rtengine/ipvibrance.cc | 1 - rtengine/ipwavelet.cc | 1 - rtengine/profilestore.h | 3 ++- rtgui/batchqueueentry.h | 11 +++++++++-- rtgui/clipboard.cc | 1 + rtgui/clipboard.h | 6 +++--- rtgui/cropwindow.cc | 4 +++- rtgui/filebrowser.cc | 1 + rtgui/filebrowser.h | 2 +- rtgui/pparamschangelistener.h | 2 +- rtgui/profilepanel.cc | 1 + rtgui/profilepanel.h | 4 +++- rtgui/profilestorecombobox.h | 4 +--- rtgui/thumbbrowserbase.cc | 1 - rtgui/thumbbrowserentrybase.cc | 2 -- rtgui/thumbnail.cc | 8 ++++++-- rtgui/toolpanel.h | 2 -- 23 files changed, 40 insertions(+), 28 deletions(-) diff --git a/rtengine/bilateral2.h b/rtengine/bilateral2.h index a431bcecd..ecdcc7fe5 100644 --- a/rtengine/bilateral2.h +++ b/rtengine/bilateral2.h @@ -25,7 +25,6 @@ #include "array2D.h" #include "LUT.h" -#include "mytime.h" #include "rt_math.h" #ifdef _OPENMP diff --git a/rtengine/color.cc b/rtengine/color.cc index 20b2c7310..8437a36b1 100644 --- a/rtengine/color.cc +++ b/rtengine/color.cc @@ -20,11 +20,14 @@ #include "rtengine.h" #include "color.h" #include "iccmatrices.h" -#include "mytime.h" #include "sleef.c" #include "opthelper.h" #include "iccstore.h" +#ifdef _DEBUG +#include "mytime.h" +#endif + using namespace std; namespace rtengine diff --git a/rtengine/imagefloat.cc b/rtengine/imagefloat.cc index 3e80b617b..1da91a4b4 100644 --- a/rtengine/imagefloat.cc +++ b/rtengine/imagefloat.cc @@ -25,7 +25,6 @@ #include "labimage.h" #include #include "rtengine.h" -#include "mytime.h" #include "iccstore.h" #include "alignedbuffer.h" #include "rt_math.h" diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 729682b0f..d5242f4df 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -33,7 +33,6 @@ #include "imagefloat.h" #include "improcfun.h" #include "labimage.h" -#include "mytime.h" #include "procparams.h" #include "refreshmap.h" diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 886e49567..b1bff49a0 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -30,7 +30,6 @@ #include "improcfun.h" #include "curves.h" #include "dcp.h" -#include "mytime.h" #include "iccstore.h" #include "imagesource.h" #include "rtthumbnail.h" @@ -48,6 +47,10 @@ #include "../rtgui/ppversion.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) diff --git a/rtengine/iptransform.cc b/rtengine/iptransform.cc index b6338b8d3..640fab2a6 100644 --- a/rtengine/iptransform.cc +++ b/rtengine/iptransform.cc @@ -25,7 +25,6 @@ #include "imagefloat.h" #include "improcfun.h" -#include "mytime.h" #include "procparams.h" #include "rt_math.h" #include "rtengine.h" diff --git a/rtengine/ipvibrance.cc b/rtengine/ipvibrance.cc index 1c5c6c4d5..b46cfb413 100644 --- a/rtengine/ipvibrance.cc +++ b/rtengine/ipvibrance.cc @@ -24,7 +24,6 @@ #include "improcfun.h" #include "iccstore.h" #include "labimage.h" -#include "mytime.h" #include "curves.h" #include "color.h" #include "procparams.h" diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index d550664b9..78a4dd509 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -36,7 +36,6 @@ #include "labimage.h" #include "LUT.h" #include "median.h" -#include "mytime.h" #include "opthelper.h" #include "procparams.h" #include "rt_math.h" diff --git a/rtengine/profilestore.h b/rtengine/profilestore.h index ee913947f..460facb72 100644 --- a/rtengine/profilestore.h +++ b/rtengine/profilestore.h @@ -25,7 +25,6 @@ #include "dynamicprofile.h" #include "noncopyable.h" -#include "procparams.h" #include "../rtgui/threadutils.h" // forward decl @@ -35,6 +34,8 @@ namespace rtengine namespace procparams { +class ProcParams; + class AutoPartialProfile; class PartialProfile; diff --git a/rtgui/batchqueueentry.h b/rtgui/batchqueueentry.h index bc93949e0..3161bded4 100644 --- a/rtgui/batchqueueentry.h +++ b/rtgui/batchqueueentry.h @@ -27,11 +27,18 @@ #include "thumbnail.h" #include "../rtengine/noncopyable.h" -#include "../rtengine/procparams.h" namespace rtengine { - class ProcessingJob; +class ProcessingJob; + +namespace procparams +{ + +class ProcParams; + +} + } class BatchQueueEntry; 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 5e0c4b67d..1faf0b4d3 100644 --- a/rtgui/clipboard.h +++ b/rtgui/clipboard.h @@ -21,17 +21,17 @@ #include #include -#include "paramsedited.h" - #include "../rtengine/diagonalcurvetypes.h" #include "../rtengine/flatcurvetypes.h" +class ParamsEdited; + namespace rtengine { namespace procparams { - +class ProcParams; class PartialProfile; class IPTCPairs; diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index ef682cf1f..f0f4cbcba 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" @@ -32,7 +35,6 @@ #include "editwidgets.h" #include "../rtengine/dcrop.h" -#include "../rtengine/mytime.h" #include "../rtengine/procparams.h" #include "../rtengine/rt_math.h" diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index 5817222dd..bfd614ffd 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -29,6 +29,7 @@ #include "clipboard.h" #include "multilangmgr.h" #include "options.h" +#include "profilestorecombobox.h" #include "procparamchangers.h" #include "rtimage.h" #include "threadutils.h" diff --git a/rtgui/filebrowser.h b/rtgui/filebrowser.h index 74b491957..dc671fe85 100644 --- a/rtgui/filebrowser.h +++ b/rtgui/filebrowser.h @@ -29,7 +29,7 @@ #include "filebrowserentry.h" #include "partialpastedlg.h" #include "pparamschangelistener.h" -#include "profilestorecombobox.h" +#include "../rtengine/profilestore.h" #include "thumbbrowserbase.h" #include "../rtengine/noncopyable.h" diff --git a/rtgui/pparamschangelistener.h b/rtgui/pparamschangelistener.h index 5d457e882..449ebfca5 100644 --- a/rtgui/pparamschangelistener.h +++ b/rtgui/pparamschangelistener.h @@ -20,7 +20,7 @@ #include -#include "paramsedited.h" +class ParamsEdited; namespace rtengine { diff --git a/rtgui/profilepanel.cc b/rtgui/profilepanel.cc index 53e1cd583..4c8e30e44 100644 --- a/rtgui/profilepanel.cc +++ b/rtgui/profilepanel.cc @@ -22,6 +22,7 @@ #include "multilangmgr.h" #include "options.h" #include "profilestorecombobox.h" +#include "paramsedited.h" #include "pathutils.h" #include "rtimage.h" diff --git a/rtgui/profilepanel.h b/rtgui/profilepanel.h index 1e1a249bb..73d3a1949 100644 --- a/rtgui/profilepanel.h +++ b/rtgui/profilepanel.h @@ -26,10 +26,12 @@ #include "partialpastedlg.h" #include "pparamschangelistener.h" #include "profilechangelistener.h" -#include "profilestorecombobox.h" +#include "../rtengine/profilestore.h" #include "../rtengine/noncopyable.h" +class ProfileStoreComboBox; + namespace rtengine { diff --git a/rtgui/profilestorecombobox.h b/rtgui/profilestorecombobox.h index 6a74f8f71..bfd713235 100644 --- a/rtgui/profilestorecombobox.h +++ b/rtgui/profilestorecombobox.h @@ -24,11 +24,9 @@ #include #include "guiutils.h" -#include "paramsedited.h" #include "threadutils.h" -#include "../rtengine/profilestore.h" - +class ProfileStoreEntry; /** * @brief subclass of Gtk::Label with extra fields for Combobox and Menu, to link with a ProfileStoreEntry */ diff --git a/rtgui/thumbbrowserbase.cc b/rtgui/thumbbrowserbase.cc index f5f4076bb..b660afc61 100644 --- a/rtgui/thumbbrowserbase.cc +++ b/rtgui/thumbbrowserbase.cc @@ -22,7 +22,6 @@ #include "options.h" #include "thumbbrowserbase.h" -#include "../rtengine/mytime.h" #include "../rtengine/rt_math.h" using namespace std; 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/thumbnail.cc b/rtgui/thumbnail.cc index bb911534a..d5038bba5 100644 --- a/rtgui/thumbnail.cc +++ b/rtgui/thumbnail.cc @@ -15,12 +15,15 @@ * 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 "../rtengine/mytime.h" #include #include #include "../rtengine/colortemp.h" @@ -30,12 +33,13 @@ #include #include "../rtengine/dynamicprofile.h" +#include "../rtengine/profilestore.h" #include "../rtengine/settings.h" #include "guiutils.h" #include "batchqueue.h" #include "extprog.h" #include "pathutils.h" -#include "profilestorecombobox.h" +#include "paramsedited.h" #include "procparamchangers.h" using namespace rtengine::procparams; diff --git a/rtgui/toolpanel.h b/rtgui/toolpanel.h index ee4f00e52..627200835 100644 --- a/rtgui/toolpanel.h +++ b/rtgui/toolpanel.h @@ -30,8 +30,6 @@ #include "../rtengine/noncopyable.h" #include "../rtengine/rtengine.h" -class ParamsEdited; - namespace rtengine { class ProcEvent; From d731e172c2bdb86c0fb6326cc2bf91856bbb8c56 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Fri, 1 Nov 2019 16:15:59 +0100 Subject: [PATCH 27/40] Further reduction of include dependencies --- rtengine/EdgePreservingDecomposition.cc | 1 - rtengine/LUT.h | 1 - rtengine/dcp.cc | 1 + rtengine/imagedata.cc | 1 + rtengine/imagedata.h | 6 +++++- rtengine/imageio.cc | 1 + rtengine/imageio.h | 16 ++++++++++++++-- rtengine/improccoordinator.cc | 1 + rtengine/improcfun.h | 5 +++-- rtengine/lcp.cc | 1 + rtengine/lcp.h | 1 - rtengine/rtengine.h | 9 +++++++-- rtgui/exifpanel.h | 1 + rtgui/resize.cc | 3 +++ rtgui/thumbnail.cc | 1 + rtgui/toolpanelcoord.cc | 1 + rtgui/toolpanelcoord.h | 2 +- 17 files changed, 41 insertions(+), 11 deletions(-) diff --git a/rtengine/EdgePreservingDecomposition.cc b/rtengine/EdgePreservingDecomposition.cc index 85b7ce243..85770826e 100644 --- a/rtengine/EdgePreservingDecomposition.cc +++ b/rtengine/EdgePreservingDecomposition.cc @@ -5,7 +5,6 @@ #include #endif #include "sleef.c" -#include "opthelper.h" #define DIAGONALS 5 #define DIAGONALSP1 6 diff --git a/rtengine/LUT.h b/rtengine/LUT.h index d1ed67c2b..a80e5996d 100644 --- a/rtengine/LUT.h +++ b/rtengine/LUT.h @@ -66,7 +66,6 @@ #include #endif -#include "noncopyable.h" #include "opthelper.h" #include "rt_math.h" diff --git a/rtengine/dcp.cc b/rtengine/dcp.cc index f15ae902f..d3ab1b3f1 100644 --- a/rtengine/dcp.cc +++ b/rtengine/dcp.cc @@ -34,6 +34,7 @@ #include "rawimagesource.h" #include "rt_math.h" #include "utils.h" +#include "../rtexif/rtexif.h" #include "../rtgui/options.h" using namespace rtengine; diff --git a/rtengine/imagedata.cc b/rtengine/imagedata.cc index d952dc8ba..24cfefde9 100644 --- a/rtengine/imagedata.cc +++ b/rtengine/imagedata.cc @@ -32,6 +32,7 @@ #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 0b75e263b..ff8ed4b86 100644 --- a/rtengine/imagedata.h +++ b/rtengine/imagedata.h @@ -29,7 +29,11 @@ #include "imageio.h" -#include "../rtexif/rtexif.h" +namespace rtexif +{ + +class TagDirectory; +} namespace rtengine { diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index 5927a23be..fce181c3f 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -30,6 +30,7 @@ #include "utils.h" #include "../rtgui/options.h" #include "../rtgui/version.h" +#include "../rtexif/rtexif.h" #ifdef WIN32 #include diff --git a/rtengine/imageio.h b/rtengine/imageio.h index 251187547..d9afa926f 100644 --- a/rtengine/imageio.h +++ b/rtengine/imageio.h @@ -29,8 +29,6 @@ #include "imageformat.h" #include "rtengine.h" -#include "../rtexif/rtexif.h" - enum { IMIO_SUCCESS, IMIO_CANNOTREADFILE, @@ -42,6 +40,13 @@ enum { IMIO_CANNOTWRITEFILE }; +namespace rtexif +{ + +class TagDirectory; + +} + namespace rtengine { @@ -49,6 +54,13 @@ class ColorTemp; class ProgressListener; class Imagefloat; +namespace procparams +{ + +class ExifPairs; + +} + class ImageIO : virtual public ImageDatas { diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index d5242f4df..bed101e0d 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -33,6 +33,7 @@ #include "imagefloat.h" #include "improcfun.h" #include "labimage.h" +#include "lcp.h" #include "procparams.h" #include "refreshmap.h" diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index a8c3ededb..2c4efbfe9 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -18,17 +18,17 @@ */ #pragma once +#include + #include "color.h" #include "coord2d.h" #include "gamutwarning.h" -#include "lcp.h" #include "LUT.h" #include "pipettebuffer.h" #include "shmap.h" template class multi_array2D; - namespace rtengine { @@ -38,6 +38,7 @@ class DCPProfile; class DCPProfileApplyState; class FlatCurve; class FramesMetaData; +class LensCorrection; class NoiseCurve; class OpacityCurve; class ToneCurve; diff --git a/rtengine/lcp.cc b/rtengine/lcp.cc index b42950eb4..57a87c1f1 100644 --- a/rtengine/lcp.cc +++ b/rtengine/lcp.cc @@ -32,6 +32,7 @@ #include "lcp.h" +#include "opthelper.h" #include "procparams.h" #include "rt_math.h" #include "settings.h" diff --git a/rtengine/lcp.h b/rtengine/lcp.h index 60df289e8..69fd43932 100644 --- a/rtengine/lcp.h +++ b/rtengine/lcp.h @@ -29,7 +29,6 @@ #include #include "cache.h" -#include "opthelper.h" namespace rtengine { diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h index d1300f023..287759009 100644 --- a/rtengine/rtengine.h +++ b/rtengine/rtengine.h @@ -21,6 +21,7 @@ #include #include #include +#include #include @@ -34,8 +35,6 @@ #include "rt_math.h" #include "settings.h" -#include "../rtexif/rtexif.h" - #include "../rtgui/threadutils.h" /** @@ -45,6 +44,12 @@ */ class EditDataProvider; +namespace rtexif +{ + +class TagDirectory; + +} namespace rtengine { diff --git a/rtgui/exifpanel.h b/rtgui/exifpanel.h index 2b173c884..0894c21ad 100644 --- a/rtgui/exifpanel.h +++ b/rtgui/exifpanel.h @@ -23,6 +23,7 @@ #include #include "toolpanel.h" +#include "../rtexif/rtexif.h" class ExifPanel : public Gtk::VBox, 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/thumbnail.cc b/rtgui/thumbnail.cc index d5038bba5..cd7470263 100644 --- a/rtgui/thumbnail.cc +++ b/rtgui/thumbnail.cc @@ -35,6 +35,7 @@ #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" diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index 1da43f6c0..e774e3d39 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -18,6 +18,7 @@ */ #include "multilangmgr.h" #include "toolpanelcoord.h" +#include "metadatapanel.h" #include "options.h" #include "rtimage.h" #include "../rtengine/imagesource.h" diff --git a/rtgui/toolpanelcoord.h b/rtgui/toolpanelcoord.h index 7b6e23937..4313f6d12 100644 --- a/rtgui/toolpanelcoord.h +++ b/rtgui/toolpanelcoord.h @@ -54,7 +54,6 @@ #include "lensgeomlistener.h" #include "lensprofile.h" #include "localcontrast.h" -#include "metadatapanel.h" #include "pcvignette.h" #include "pdsharpening.h" #include "perspective.h" @@ -89,6 +88,7 @@ #include "../rtengine/rtengine.h" class ImageEditorCoordinator; +class MetaDataPanel; class ToolPanelCoordinator : public ToolPanelListener, From b58d38fc62787d2141597379ded7498c3f86a4d3 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Fri, 1 Nov 2019 17:17:29 +0100 Subject: [PATCH 28/40] Fix clang warnings --- rtgui/clipboard.h | 2 +- rtgui/paramsedited.h | 2 +- rtgui/pparamschangelistener.h | 2 +- rtgui/profilepanel.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rtgui/clipboard.h b/rtgui/clipboard.h index 1faf0b4d3..0a1c8e2fa 100644 --- a/rtgui/clipboard.h +++ b/rtgui/clipboard.h @@ -24,7 +24,7 @@ #include "../rtengine/diagonalcurvetypes.h" #include "../rtengine/flatcurvetypes.h" -class ParamsEdited; +struct ParamsEdited; namespace rtengine { diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index ec83e82cd..86bffe48d 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -28,7 +28,7 @@ namespace procparams class ProcParams; -struct PartialProfile; +class PartialProfile; } diff --git a/rtgui/pparamschangelistener.h b/rtgui/pparamschangelistener.h index 449ebfca5..56ac5f605 100644 --- a/rtgui/pparamschangelistener.h +++ b/rtgui/pparamschangelistener.h @@ -20,7 +20,7 @@ #include -class ParamsEdited; +struct ParamsEdited; namespace rtengine { diff --git a/rtgui/profilepanel.h b/rtgui/profilepanel.h index 73d3a1949..b3c968682 100644 --- a/rtgui/profilepanel.h +++ b/rtgui/profilepanel.h @@ -42,7 +42,7 @@ namespace procparams class ProcParams; -struct PartialProfile; +class PartialProfile; } From c1f9120ef46c9398c68be3e023cce52edd8a5be1 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Fri, 1 Nov 2019 21:20:52 +0100 Subject: [PATCH 29/40] Further reduction of include dependencies --- rtengine/bilateral2.h | 4 -- rtgui/batchqueueentry.cc | 2 + rtgui/batchqueueentry.h | 4 +- rtgui/batchtoolpanelcoord.cc | 1 + rtgui/batchtoolpanelcoord.h | 2 +- rtgui/bqentryupdater.cc | 2 + rtgui/bqentryupdater.h | 3 +- rtgui/colorappearance.h | 1 - rtgui/editorpanel.cc | 1 + rtgui/editorpanel.h | 2 +- rtgui/filebrowser.cc | 1 + rtgui/filebrowserentry.cc | 1 + rtgui/filebrowserentry.h | 3 +- rtgui/filecatalog.cc | 1 + rtgui/filepanel.cc | 1 + rtgui/histogrampanel.h | 1 - rtgui/imageareatoollistener.h | 2 +- rtgui/previewwindow.cc | 1 + rtgui/rtwindow.cc | 1 + rtgui/thumbbrowserentrybase.h | 4 +- rtgui/thumbimageupdater.cc | 1 + rtgui/thumbnailbrowser.h | 99 ----------------------------------- rtgui/tonecurve.h | 1 - 23 files changed, 26 insertions(+), 113 deletions(-) delete mode 100644 rtgui/thumbnailbrowser.h diff --git a/rtengine/bilateral2.h b/rtengine/bilateral2.h index ecdcc7fe5..53e18fb20 100644 --- a/rtengine/bilateral2.h +++ b/rtengine/bilateral2.h @@ -27,10 +27,6 @@ #include "LUT.h" #include "rt_math.h" -#ifdef _OPENMP -#include -#endif - using namespace rtengine; // This seems ugly, but way faster than any other solutions I tried 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 3161bded4..c4cd48615 100644 --- a/rtgui/batchqueueentry.h +++ b/rtgui/batchqueueentry.h @@ -23,11 +23,13 @@ #include #include "bqentryupdater.h" +#include "options.h" #include "thumbbrowserentrybase.h" -#include "thumbnail.h" #include "../rtengine/noncopyable.h" +class Thumbnail; + namespace rtengine { class ProcessingJob; diff --git a/rtgui/batchtoolpanelcoord.cc b/rtgui/batchtoolpanelcoord.cc index 87320892e..760614d5e 100644 --- a/rtgui/batchtoolpanelcoord.cc +++ b/rtgui/batchtoolpanelcoord.cc @@ -22,6 +22,7 @@ #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 6c64e15ea..7a5fe77ed 100644 --- a/rtgui/batchtoolpanelcoord.h +++ b/rtgui/batchtoolpanelcoord.h @@ -20,7 +20,6 @@ #include "fileselectionchangelistener.h" #include "paramsedited.h" -#include "thumbnail.h" #include "thumbnaillistener.h" #include "toolpanelcoord.h" @@ -28,6 +27,7 @@ #include "../rtengine/procparams.h" class FilePanel; +class Thumbnail; class BatchToolPanelCoordinator : public ToolPanelCoordinator, public FileSelectionChangeListener, diff --git a/rtgui/bqentryupdater.cc b/rtgui/bqentryupdater.cc index 8f5687b81..61683e158 100644 --- a/rtgui/bqentryupdater.cc +++ b/rtgui/bqentryupdater.cc @@ -19,6 +19,8 @@ #include "bqentryupdater.h" #include "guiutils.h" +#include "options.h" +#include "thumbnail.h" #include "../rtengine/utils.h" namespace diff --git a/rtgui/bqentryupdater.h b/rtgui/bqentryupdater.h index 4cbbf6e59..dfd42aff1 100644 --- a/rtgui/bqentryupdater.h +++ b/rtgui/bqentryupdater.h @@ -21,7 +21,8 @@ #include #include "threadutils.h" -#include "thumbnail.h" + +class Thumbnail; namespace rtengine { diff --git a/rtgui/colorappearance.h b/rtgui/colorappearance.h index 1f8fdef84..3d82ee831 100644 --- a/rtgui/colorappearance.h +++ b/rtgui/colorappearance.h @@ -25,7 +25,6 @@ #include "curveeditor.h" #include "curveeditorgroup.h" #include "guiutils.h" -#include "mycurve.h" #include "toolpanel.h" class ColorAppearance final : diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 3c5182938..c7d8436ef 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -33,6 +33,7 @@ #include "procparamchangers.h" #include "placesbrowser.h" #include "pathutils.h" +#include "thumbnail.h" using namespace rtengine::procparams; diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index ec59563e0..00f1a942e 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -30,7 +30,6 @@ #include "profilepanel.h" #include "progressconnector.h" #include "saveasdlg.h" -#include "thumbnail.h" #include "thumbnaillistener.h" #include "toolpanelcoord.h" @@ -39,6 +38,7 @@ class EditorPanel; class MyProgressBar; +class Thumbnail; struct EditorPanelIdleHelper { EditorPanel* epanel; diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index bfd614ffd..3dcb573ca 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -33,6 +33,7 @@ #include "procparamchangers.h" #include "rtimage.h" #include "threadutils.h" +#include "thumbnail.h" #include "../rtengine/dfmanager.h" #include "../rtengine/ffmanager.h" 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 c7eebcd44..1bdbb2ecb 100644 --- a/rtgui/filebrowserentry.h +++ b/rtgui/filebrowserentry.h @@ -29,13 +29,14 @@ #include "imageareatoollistener.h" #include "thumbbrowserentrybase.h" #include "thumbimageupdater.h" -#include "thumbnail.h" #include "thumbnaillistener.h" #include "../rtengine/noncopyable.h" #include "../rtengine/rtengine.h" class FileBrowserEntry; +class Thumbnail; + struct FileBrowserEntryIdleHelper { FileBrowserEntry* fbentry; bool destroyed; diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index fb8bd4923..923a15e8d 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -37,6 +37,7 @@ #include "batchqueue.h" #include "placesbrowser.h" #include "pathutils.h" +#include "thumbnail.h" using namespace std; diff --git a/rtgui/filepanel.cc b/rtgui/filepanel.cc index 3e23cbc5d..0c401a701 100644 --- a/rtgui/filepanel.cc +++ b/rtgui/filepanel.cc @@ -21,6 +21,7 @@ #include "rtwindow.h" #include "inspector.h" #include "placesbrowser.h" +#include "thumbnail.h" FilePanel::FilePanel () : parent(nullptr), error(0) { diff --git a/rtgui/histogrampanel.h b/rtgui/histogrampanel.h index 92d0dc7b4..23b065534 100644 --- a/rtgui/histogrampanel.h +++ b/rtgui/histogrampanel.h @@ -27,7 +27,6 @@ #include "guiutils.h" #include "pointermotionlistener.h" -#include "../rtengine/improccoordinator.h" #include "../rtengine/LUT.h" #include "../rtengine/noncopyable.h" diff --git a/rtgui/imageareatoollistener.h b/rtgui/imageareatoollistener.h index 86fdca6a2..3c753a5e0 100644 --- a/rtgui/imageareatoollistener.h +++ b/rtgui/imageareatoollistener.h @@ -19,9 +19,9 @@ #pragma once #include "cropguilistener.h" -#include "thumbnail.h" #include "toolbar.h" +class Thumbnail; class ImageAreaToolListener { diff --git a/rtgui/previewwindow.cc b/rtgui/previewwindow.cc index c813f04a2..3f787a16b 100644 --- a/rtgui/previewwindow.cc +++ b/rtgui/previewwindow.cc @@ -20,6 +20,7 @@ #include "guiutils.h" #include "imagearea.h" #include "cursormanager.h" +#include "options.h" #include "../rtengine/procparams.h" diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index 45d07c4af..2db0ef192 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -24,6 +24,7 @@ #include "iccprofilecreator.h" #include "cursormanager.h" #include "rtimage.h" +#include "thumbnail.h" #include "whitebalance.h" #include "../rtengine/settings.h" 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/thumbnailbrowser.h b/rtgui/thumbnailbrowser.h deleted file mode 100644 index ef953c0e9..000000000 --- a/rtgui/thumbnailbrowser.h +++ /dev/null @@ -1,99 +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 . - */ -#pragma once - -#include - -#include "filecatalog.h" -#include "thumbnail.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); -}; diff --git a/rtgui/tonecurve.h b/rtgui/tonecurve.h index b44a7ccab..cba810e15 100644 --- a/rtgui/tonecurve.h +++ b/rtgui/tonecurve.h @@ -24,7 +24,6 @@ #include "curveeditor.h" #include "curveeditorgroup.h" #include "guiutils.h" -#include "mycurve.h" #include "toolpanel.h" class EditDataProvider; From f02f5c4a69e5e74ebdd7f02d7c2aea1da09b2687 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Fri, 1 Nov 2019 22:57:20 +0100 Subject: [PATCH 30/40] Fix two lgtm issues --- rtgui/editorpanel.cc | 46 +++++++++++--------------------------------- rtgui/rtwindow.cc | 7 +++---- 2 files changed, 14 insertions(+), 39 deletions(-) diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index c7d8436ef..9ae613ebd 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -891,41 +891,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) diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index 2db0ef192..9f5357644 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -458,10 +458,9 @@ RTWindow::~RTWindow() g_object_unref (osxApp); #endif - if (fpanel) { - delete fpanel; - } - + delete fpanel; + delete iFullscreen; + delete iFullscreen_exit; RTImage::cleanup(); } From afeca7f5f9df5d92327e4cedd7116102a655eef1 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sat, 2 Nov 2019 00:18:48 +0100 Subject: [PATCH 31/40] Fix lgtm issues --- rtgui/editorpanel.cc | 12 ++++++------ rtgui/editorpanel.h | 2 +- rtgui/rtwindow.cc | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 9ae613ebd..3328dcd65 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -1108,7 +1108,7 @@ Glib::ustring EditorPanel::getShortName () } } -Glib::ustring EditorPanel::getFileName () +Glib::ustring EditorPanel::getFileName () const { if (openThm) { return openThm->getFileName (); @@ -2012,9 +2012,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"; @@ -2023,13 +2023,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 00f1a942e..2f6c01a31 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -150,7 +150,7 @@ public: void saveProfile (); Glib::ustring getShortName (); - Glib::ustring getFileName (); + Glib::ustring getFileName () const; bool handleShortcutKey (GdkEventKey* event); bool getIsProcessing() const diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index 9f5357644..ed1ae8d6c 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -653,8 +653,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 From b3b1008270d92fff3b29f1da7351623f836f5107 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sat, 2 Nov 2019 17:29:26 +0100 Subject: [PATCH 32/40] Further reduction of include dependencies --- CMakeLists.txt | 1 + rtgui/CMakeLists.txt | 1 - rtgui/batchqueue.h | 1 + rtgui/batchqueuebuttonset.cc | 2 + rtgui/batchqueuebuttonset.h | 3 +- rtgui/batchtoolpanelcoord.cc | 4 ++ rtgui/cropwindow.cc | 1 + rtgui/editbuffer.h | 4 -- rtgui/editorpanel.cc | 2 + rtgui/editorpanel.h | 2 +- rtgui/editwidgets.cc | 2 + rtgui/editwidgets.h | 4 +- rtgui/editwindow.cc | 1 + rtgui/filebrowser.h | 1 + rtgui/filecatalog.cc | 1 + rtgui/filepanel.cc | 2 + rtgui/filepanel.h | 2 +- rtgui/filethumbnailbuttonset.cc | 2 + rtgui/filethumbnailbuttonset.h | 2 +- rtgui/iccprofilecreator.cc | 10 +++-- rtgui/iccprofilecreator.h | 5 ++- rtgui/ilabel.cc | 66 --------------------------------- rtgui/ilabel.h | 34 ----------------- rtgui/imagearea.cc | 1 + rtgui/lwbutton.cc | 1 + rtgui/lwbutton.h | 2 - rtgui/lwbuttonset.cc | 2 + rtgui/lwbuttonset.h | 3 +- rtgui/main.cc | 4 ++ rtgui/preferences.cc | 2 + rtgui/preferences.h | 5 ++- rtgui/previewwindow.cc | 1 + rtgui/progressconnector.h | 2 +- rtgui/renamedlg.cc | 1 + rtgui/renamedlg.h | 3 +- rtgui/rtwindow.cc | 10 +++++ rtgui/rtwindow.h | 13 +++---- rtgui/thumbbrowserbase.cc | 1 + 38 files changed, 75 insertions(+), 129 deletions(-) delete mode 100644 rtgui/ilabel.cc delete mode 100644 rtgui/ilabel.h 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/rtgui/CMakeLists.txt b/rtgui/CMakeLists.txt index edc2b8202..4b21ce421 100644 --- a/rtgui/CMakeLists.txt +++ b/rtgui/CMakeLists.txt @@ -79,7 +79,6 @@ set(NONCLISOURCEFILES hsvequalizer.cc iccprofilecreator.cc icmpanel.cc - ilabel.cc imagearea.cc imageareapanel.cc impulsedenoise.cc diff --git a/rtgui/batchqueue.h b/rtgui/batchqueue.h index a0c04abee..9ae615965 100644 --- a/rtgui/batchqueue.h +++ b/rtgui/batchqueue.h @@ -22,6 +22,7 @@ #include #include "batchqueueentry.h" +#include "lwbutton.h" #include "lwbuttonset.h" #include "threadutils.h" #include "thumbbrowserbase.h" 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 17f582168..fb45df518 100644 --- a/rtgui/batchqueuebuttonset.h +++ b/rtgui/batchqueuebuttonset.h @@ -21,9 +21,10 @@ #include #include "lwbuttonset.h" -#include "rtsurface.h" class BatchQueueEntry; +class RTSurface; + class BatchQueueButtonSet : public LWButtonSet { diff --git a/rtgui/batchtoolpanelcoord.cc b/rtgui/batchtoolpanelcoord.cc index 760614d5e..8aed3e96f 100644 --- a/rtgui/batchtoolpanelcoord.cc +++ b/rtgui/batchtoolpanelcoord.cc @@ -16,6 +16,10 @@ * 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" diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index f0f4cbcba..f44e78a56 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -33,6 +33,7 @@ #include "editcallbacks.h" #include "editbuffer.h" #include "editwidgets.h" +#include "rtsurface.h" #include "../rtengine/dcrop.h" #include "../rtengine/procparams.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/editorpanel.cc b/rtgui/editorpanel.cc index 3328dcd65..108b11ea3 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" @@ -34,6 +35,7 @@ #include "placesbrowser.h" #include "pathutils.h" #include "thumbnail.h" +#include "toolpanelcoord.h" using namespace rtengine::procparams; diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index 2f6c01a31..b577b858f 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -31,7 +31,6 @@ #include "progressconnector.h" #include "saveasdlg.h" #include "thumbnaillistener.h" -#include "toolpanelcoord.h" #include "../rtengine/noncopyable.h" #include "../rtengine/rtengine.h" @@ -39,6 +38,7 @@ class EditorPanel; class MyProgressBar; class Thumbnail; +class ToolPanelCoordinator; struct EditorPanelIdleHelper { EditorPanel* epanel; diff --git a/rtgui/editwidgets.cc b/rtgui/editwidgets.cc index a7996ee42..f7c748744 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 9154db31f..d31451ecb 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/filebrowser.h b/rtgui/filebrowser.h index dc671fe85..b941ea9df 100644 --- a/rtgui/filebrowser.h +++ b/rtgui/filebrowser.h @@ -27,6 +27,7 @@ #include "exportpanel.h" #include "extprog.h" #include "filebrowserentry.h" +#include "lwbutton.h" #include "partialpastedlg.h" #include "pparamschangelistener.h" #include "../rtengine/profilestore.h" diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index 923a15e8d..5e93631e5 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" diff --git a/rtgui/filepanel.cc b/rtgui/filepanel.cc index 0c401a701..8f45343de 100644 --- a/rtgui/filepanel.cc +++ b/rtgui/filepanel.cc @@ -18,6 +18,8 @@ */ #include "filepanel.h" +#include "batchtoolpanelcoord.h" +#include "editorpanel.h" #include "rtwindow.h" #include "inspector.h" #include "placesbrowser.h" diff --git a/rtgui/filepanel.h b/rtgui/filepanel.h index 9ae91be4d..9db9d99b7 100644 --- a/rtgui/filepanel.h +++ b/rtgui/filepanel.h @@ -20,7 +20,6 @@ #include -#include "batchtoolpanelcoord.h" #include "dirbrowser.h" #include "exportpanel.h" #include "filecatalog.h" @@ -34,6 +33,7 @@ #include "../rtengine/noncopyable.h" +class BatchToolPanelCoordinator; class RTWindow; class FilePanel final : 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 f4fbc97ed..66d5b5f67 100644 --- a/rtgui/filethumbnailbuttonset.h +++ b/rtgui/filethumbnailbuttonset.h @@ -24,9 +24,9 @@ #include "filebrowserentry.h" #include "lwbuttonset.h" -#include "rtsurface.h" class FileBrowserEntry; +class RTSurface; class FileThumbnailButtonSet : public LWButtonSet diff --git a/rtgui/iccprofilecreator.cc b/rtgui/iccprofilecreator.cc index d7f9499f6..a8f9be007 100644 --- a/rtgui/iccprofilecreator.cc +++ b/rtgui/iccprofilecreator.cc @@ -17,18 +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 +#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 950fcc01f..2cd19e14f 100644 --- a/rtgui/iccprofilecreator.h +++ b/rtgui/iccprofilecreator.h @@ -19,10 +19,13 @@ */ #pragma once +#include + #include #include "adjuster.h" #include -#include "rtwindow.h" + +class RTWindow; class ICCProfileCreator : public Gtk::Dialog, public AdjusterListener { 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/ilabel.h b/rtgui/ilabel.h deleted file mode 100644 index cb9ca00be..000000000 --- a/rtgui/ilabel.h +++ /dev/null @@ -1,34 +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 . - */ -#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; -}; diff --git a/rtgui/imagearea.cc b/rtgui/imagearea.cc index b086f8baf..0be6982f9 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/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 7a784e693..a98f1fe46 100644 --- a/rtgui/lwbutton.h +++ b/rtgui/lwbutton.h @@ -19,9 +19,7 @@ #pragma once #include - #include "rtsurface.h" - class LWButton; class LWButtonListener 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.cc b/rtgui/main.cc index 1bb840e1e..ae34fc8d0 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -34,12 +34,16 @@ #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 diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 2676e0940..0bce37af2 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -25,8 +25,10 @@ #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 diff --git a/rtgui/preferences.h b/rtgui/preferences.h index 62f7c53c1..b4b90e669 100644 --- a/rtgui/preferences.h +++ b/rtgui/preferences.h @@ -25,7 +25,10 @@ #include "adjuster.h" #include "dynamicprofilepanel.h" #include "options.h" -#include "rtwindow.h" +#include "../rtengine/profilestore.h" + +class RTWindow; +class Splash; class Preferences : public Gtk::Dialog, diff --git a/rtgui/previewwindow.cc b/rtgui/previewwindow.cc index 3f787a16b..6268fe3d2 100644 --- a/rtgui/previewwindow.cc +++ b/rtgui/previewwindow.cc @@ -21,6 +21,7 @@ #include "imagearea.h" #include "cursormanager.h" #include "options.h" +#include "rtscalable.h" #include "../rtengine/procparams.h" diff --git a/rtgui/progressconnector.h b/rtgui/progressconnector.h index 32a48473f..eb6eb3a66 100644 --- a/rtgui/progressconnector.h +++ b/rtgui/progressconnector.h @@ -23,7 +23,7 @@ #include #include "guiutils.h" - +#include "multilangmgr.h" #include "../rtengine/rtengine.h" #undef THREAD_PRIORITY_NORMAL diff --git a/rtgui/renamedlg.cc b/rtgui/renamedlg.cc index 81bcd86e5..8908d3419 100644 --- a/rtgui/renamedlg.cc +++ b/rtgui/renamedlg.cc @@ -17,6 +17,7 @@ * along with RawTherapee. If not, see . */ #include "renamedlg.h" +#include "cacheimagedata.h" #include "multilangmgr.h" #include "rtimage.h" diff --git a/rtgui/renamedlg.h b/rtgui/renamedlg.h index 23f69391f..f9447fbac 100644 --- a/rtgui/renamedlg.h +++ b/rtgui/renamedlg.h @@ -20,11 +20,12 @@ #include -#include "cacheimagedata.h" #include "guiutils.h" #define RESPONSE_ALL 100 +class CacheImageData; + class RenameDialog : public Gtk::Dialog { diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index ed1ae8d6c..c3d735e8f 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -23,10 +23,15 @@ #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; @@ -1163,3 +1168,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 05d0cc231..39e1581e3 100644 --- a/rtgui/rtwindow.h +++ b/rtgui/rtwindow.h @@ -25,15 +25,15 @@ #include #endif -#include "batchqueuepanel.h" -#include "editorpanel.h" -#include "editwindow.h" -#include "filepanel.h" #include "progressconnector.h" #include "splash.h" #include "../rtengine/noncopyable.h" +class BatchQueueEntry; +class BatchQueuePanel; +class EditorPanel; +class FilePanel; class RTWindow : public Gtk::Window, public rtengine::ProgressListener, @@ -55,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); diff --git a/rtgui/thumbbrowserbase.cc b/rtgui/thumbbrowserbase.cc index b660afc61..9832b5730 100644 --- a/rtgui/thumbbrowserbase.cc +++ b/rtgui/thumbbrowserbase.cc @@ -20,6 +20,7 @@ #include "multilangmgr.h" #include "options.h" +#include "rtscalable.h" #include "thumbbrowserbase.h" #include "../rtengine/rt_math.h" From 6335b68a809f31cf20cbed9982dd87eabda0e02d Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sun, 3 Nov 2019 14:52:42 +0100 Subject: [PATCH 33/40] Further reduction of include dependencies --- rtengine/FTblockDN.cc | 1 + rtengine/PF_correct_RT.cc | 1 + rtengine/ciecam02.h | 7 ++- rtengine/curves.h | 46 +------------------ rtengine/dcp.cc | 1 + rtengine/dirpyr_equalizer.cc | 2 + rtengine/dual_demosaic_RT.cc | 1 + rtengine/filmnegativeproc.cc | 2 +- rtengine/filmnegativethumb.cc | 2 + rtengine/iccstore.h | 2 - rtengine/iimage.cc | 4 ++ rtengine/iimage.h | 27 +++++------ rtengine/imagesource.h | 5 +++ rtengine/improcfun.cc | 1 + rtengine/improcfun.h | 8 +++- rtengine/init.cc | 1 + rtengine/ipdehaze.cc | 1 + rtengine/iplabregions.cc | 1 + rtengine/ipretinex.cc | 1 + rtengine/ipshadowshighlights.cc | 1 + rtengine/ipsoftlight.cc | 1 + rtengine/ipwavelet.cc | 1 + rtengine/pixelshift.cc | 2 +- rtengine/previewimage.cc | 1 + rtengine/procparams.cc | 1 + rtengine/rawimagesource.h | 1 - rtengine/rtengine.h | 6 ++- rtengine/rtthumbnail.cc | 1 + rtengine/rtthumbnail.h | 1 + rtengine/satandvalueblendingcurve.h | 70 +++++++++++++++++++++++++++++ rtengine/shmap.cc | 1 + rtengine/shmap.h | 6 ++- rtengine/tmo_fattal02.cc | 1 + rtengine/xtrans_demosaic.cc | 1 + rtgui/bayerexposre.h | 0 rtgui/bayerexposure.h | 0 rtgui/colortoning.cc | 1 + rtgui/defringe.cc | 1 + rtgui/dirpyrdenoise.cc | 1 + rtgui/dirpyrequalizer.cc | 2 + rtgui/labcurve.cc | 1 + rtgui/labgrid.cc | 1 + rtgui/mydiagonalcurve.h | 5 ++- rtgui/retinex.cc | 1 + rtgui/wavelet.cc | 1 + 45 files changed, 154 insertions(+), 69 deletions(-) create mode 100644 rtengine/satandvalueblendingcurve.h create mode 100644 rtgui/bayerexposre.h create mode 100644 rtgui/bayerexposure.h diff --git a/rtengine/FTblockDN.cc b/rtengine/FTblockDN.cc index b6245fbce..6e1ddf8b4 100644 --- a/rtengine/FTblockDN.cc +++ b/rtengine/FTblockDN.cc @@ -29,6 +29,7 @@ #include "array2D.h" #include "boxblur.h" #include "cplx_wavelet_dec.h" +#include "color.h" #include "curves.h" #include "iccmatrices.h" #include "iccstore.h" diff --git a/rtengine/PF_correct_RT.cc b/rtengine/PF_correct_RT.cc index e1d6ef808..c851d3d09 100644 --- a/rtengine/PF_correct_RT.cc +++ b/rtengine/PF_correct_RT.cc @@ -30,6 +30,7 @@ #include "gauss.h" #include "improcfun.h" #include "cieimage.h" +#include "color.h" #include "curves.h" #include "labimage.h" #include "sleef.c" diff --git a/rtengine/ciecam02.h b/rtengine/ciecam02.h index 68252f2f6..5f5dd9bca 100644 --- a/rtengine/ciecam02.h +++ b/rtengine/ciecam02.h @@ -20,9 +20,14 @@ #include -#include "LUT.h" #include "opthelper.h" +template +class LUT; + +using LUTu = LUT; +using LUTf = LUT; + namespace rtengine { diff --git a/rtengine/curves.h b/rtengine/curves.h index 9c5a84eac..b8b72d0eb 100644 --- a/rtengine/curves.h +++ b/rtengine/curves.h @@ -25,13 +25,12 @@ #include #include "rt_math.h" -#include "color.h" #include "flatcurvetypes.h" #include "diagonalcurvetypes.h" #include "pipettebuffer.h" #include "noncopyable.h" #include "LUT.h" - +#include "sleef.c" #define CURVES_MIN_POLY_POINTS 1000 #include "rt_math.h" @@ -894,12 +893,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: @@ -1269,43 +1262,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 diff --git a/rtengine/dcp.cc b/rtengine/dcp.cc index d3ab1b3f1..11fe306b8 100644 --- a/rtengine/dcp.cc +++ b/rtengine/dcp.cc @@ -28,6 +28,7 @@ #include "dcp.h" #include "cJSON.h" +#include "color.h" #include "iccmatrices.h" #include "iccstore.h" #include "imagefloat.h" diff --git a/rtengine/dirpyr_equalizer.cc b/rtengine/dirpyr_equalizer.cc index 6fd4f002c..1f62badcb 100644 --- a/rtengine/dirpyr_equalizer.cc +++ b/rtengine/dirpyr_equalizer.cc @@ -24,7 +24,9 @@ #include "array2D.h" #include "cieimage.h" +#include "color.h" #include "improcfun.h" +#include "LUT.h" #include "opthelper.h" #include "rt_math.h" #include "settings.h" diff --git a/rtengine/dual_demosaic_RT.cc b/rtengine/dual_demosaic_RT.cc index 8a3564279..b5839ee8b 100644 --- a/rtengine/dual_demosaic_RT.cc +++ b/rtengine/dual_demosaic_RT.cc @@ -23,6 +23,7 @@ // //////////////////////////////////////////////////////////////// +#include "color.h" #include "jaggedarray.h" #include "procparams.h" #include "rawimagesource.h" diff --git a/rtengine/filmnegativeproc.cc b/rtengine/filmnegativeproc.cc index f373f8c14..73156d1e3 100644 --- a/rtengine/filmnegativeproc.cc +++ b/rtengine/filmnegativeproc.cc @@ -32,7 +32,7 @@ #include "procparams.h" #include "rt_algo.h" #include "rtengine.h" - +#include "sleef.c" //#define BENCHMARK #include "StopWatch.h" diff --git a/rtengine/filmnegativethumb.cc b/rtengine/filmnegativethumb.cc index 1e52300d4..fa50e93bf 100644 --- a/rtengine/filmnegativethumb.cc +++ b/rtengine/filmnegativethumb.cc @@ -18,9 +18,11 @@ */ #include +#include "LUT.h" #include "rtengine.h" #include "rtthumbnail.h" #include "opthelper.h" +#include "sleef.c" #include "rt_algo.h" #include "settings.h" #include "procparams.h" diff --git a/rtengine/iccstore.h b/rtengine/iccstore.h index cc67c6152..731a155bb 100644 --- a/rtengine/iccstore.h +++ b/rtengine/iccstore.h @@ -27,8 +27,6 @@ #include -#include "color.h" - namespace rtengine { diff --git a/rtengine/iimage.cc b/rtengine/iimage.cc index a1ec979a1..a8bcf9368 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,6 @@ int rtengine::getCoarseBitMask( const procparams::CoarseTransformParams &coarse) return tr; } +int rtengine::igammasrgb(float in) { + return Color::igamma_srgb(in); +} diff --git a/rtengine/iimage.h b/rtengine/iimage.h index 3c39b7659..73e38b45f 100644 --- a/rtengine/iimage.h +++ b/rtengine/iimage.h @@ -21,9 +21,9 @@ #include #include +#include #include "alignedbuffer.h" -#include "color.h" #include "coord2d.h" #include "imagedimensions.h" #include "LUT.h" @@ -59,6 +59,7 @@ extern const char sImage16[]; extern const char sImagefloat[]; int getCoarseBitMask(const procparams::CoarseTransformParams& coarse); +int igammasrgb(float in); enum TypeInterpolation { TI_Nearest, TI_Bilinear }; @@ -964,9 +965,9 @@ public: 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]++; + histogram[igammasrgb (r_) >> histcompr]++; + histogram[igammasrgb (g_) >> histcompr]++; + histogram[igammasrgb (b_) >> histcompr]++; } } @@ -982,9 +983,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 = igammasrgb (r_); + int gtemp = igammasrgb (g_); + int btemp = igammasrgb (b_); histogram[rtemp >> compression]++; histogram[gtemp >> compression] += 2; @@ -1573,9 +1574,9 @@ public: 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]++; + histogram[igammasrgb (r_) >> histcompr]++; + histogram[igammasrgb (g_) >> histcompr]++; + histogram[igammasrgb (b_) >> histcompr]++; } } @@ -1591,9 +1592,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 = igammasrgb (r_); + int gtemp = igammasrgb (g_); + int btemp = igammasrgb (b_); histogram[rtemp >> compression]++; histogram[gtemp >> compression] += 2; diff --git a/rtengine/imagesource.h b/rtengine/imagesource.h index 6b5a22b63..e0c26aa9f 100644 --- a/rtengine/imagesource.h +++ b/rtengine/imagesource.h @@ -28,6 +28,11 @@ #include "LUT.h" #include "rtengine.h" +template +class LUT; + +using LUTf = LUT; + template class multi_array2D; diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index b1bff49a0..b58c60780 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -42,6 +42,7 @@ #include "improccoordinator.h" #include "clutstore.h" #include "ciecam02.h" +#include "satandvalueblendingcurve.h" #include "StopWatch.h" #include "procparams.h" #include "../rtgui/ppversion.h" diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 2c4efbfe9..2229987a1 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -20,13 +20,17 @@ #include -#include "color.h" #include "coord2d.h" #include "gamutwarning.h" -#include "LUT.h" #include "pipettebuffer.h" #include "shmap.h" +template +class LUT; + +using LUTu = LUT; +using LUTf = LUT; + template class multi_array2D; namespace rtengine diff --git a/rtengine/init.cc b/rtengine/init.cc index 453374e3a..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" diff --git a/rtengine/ipdehaze.cc b/rtengine/ipdehaze.cc index c9579cf05..28a0f2d57 100644 --- a/rtengine/ipdehaze.cc +++ b/rtengine/ipdehaze.cc @@ -32,6 +32,7 @@ #include #include +#include "color.h" #include "guidedfilter.h" #include "iccstore.h" #include "imagefloat.h" diff --git a/rtengine/iplabregions.cc b/rtengine/iplabregions.cc index cea23bc6b..305a449ee 100644 --- a/rtengine/iplabregions.cc +++ b/rtengine/iplabregions.cc @@ -22,6 +22,7 @@ #include #endif +#include "color.h" #include "curves.h" #include "guidedfilter.h" #include "iccstore.h" diff --git a/rtengine/ipretinex.cc b/rtengine/ipretinex.cc index ab3a632da..b5d504a99 100644 --- a/rtengine/ipretinex.cc +++ b/rtengine/ipretinex.cc @@ -41,6 +41,7 @@ #include #include +#include "color.h" #include "curves.h" #include "gauss.h" #include "improcfun.h" diff --git a/rtengine/ipshadowshighlights.cc b/rtengine/ipshadowshighlights.cc index 0eceb5a3b..45031da53 100644 --- a/rtengine/ipshadowshighlights.cc +++ b/rtengine/ipshadowshighlights.cc @@ -20,6 +20,7 @@ #include "improcfun.h" +#include "color.h" #include "curves.h" #include "gauss.h" #include "guidedfilter.h" diff --git a/rtengine/ipsoftlight.cc b/rtengine/ipsoftlight.cc index ab2e7c8b1..41d0d48bf 100644 --- a/rtengine/ipsoftlight.cc +++ b/rtengine/ipsoftlight.cc @@ -19,6 +19,7 @@ * along with RawTherapee. If not, see . */ +#include "color.h" #include "iccstore.h" #include "improcfun.h" #include "labimage.h" diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 78a4dd509..08b317e4c 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -29,6 +29,7 @@ #include "../rtgui/threadutils.h" #include "array2D.h" +#include "color.h" #include "curves.h" #include "EdgePreservingDecomposition.h" #include "iccstore.h" diff --git a/rtengine/pixelshift.cc b/rtengine/pixelshift.cc index 9cb5844c2..7a6b6db41 100644 --- a/rtengine/pixelshift.cc +++ b/rtengine/pixelshift.cc @@ -28,7 +28,7 @@ #include "median.h" #include "procparams.h" #include "rawimagesource.h" - +#include "sleef.c" #include "../rtgui/multilangmgr.h" #include "../rtgui/options.h" 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/procparams.cc b/rtengine/procparams.cc index df5ac40a9..c09da1e84 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -26,6 +26,7 @@ #include #include +#include "color.h" #include "curves.h" #include "procparams.h" #include "utils.h" diff --git a/rtengine/rawimagesource.h b/rtengine/rawimagesource.h index 82e842ad3..f876fecb4 100644 --- a/rtengine/rawimagesource.h +++ b/rtengine/rawimagesource.h @@ -23,7 +23,6 @@ #include #include "array2D.h" -#include "color.h" #include "colortemp.h" #include "iimage.h" #include "imagesource.h" diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h index 287759009..0473622c4 100644 --- a/rtengine/rtengine.h +++ b/rtengine/rtengine.h @@ -29,7 +29,6 @@ #include "iimage.h" #include "imageformat.h" -#include "LUT.h" #include "procevents.h" #include "rawmetadatalocation.h" #include "rt_math.h" @@ -43,6 +42,11 @@ * */ +template +class LUT; + +using LUTu = LUT; + class EditDataProvider; namespace rtexif { diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index d6ff53750..b1953bb3d 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -27,6 +27,7 @@ #include #include "cieimage.h" +#include "color.h" #include "colortemp.h" #include "curves.h" #include "dcp.h" diff --git a/rtengine/rtthumbnail.h b/rtengine/rtthumbnail.h index 473c74e7c..dcc9596f6 100644 --- a/rtengine/rtthumbnail.h +++ b/rtengine/rtthumbnail.h @@ -25,6 +25,7 @@ #include "image16.h" #include "image8.h" #include "imagefloat.h" +#include "LUT.h" #include "rawmetadatalocation.h" #include "../rtgui/threadutils.h" 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/shmap.cc b/rtengine/shmap.cc index 36582df39..d0c34e925 100644 --- a/rtengine/shmap.cc +++ b/rtengine/shmap.cc @@ -22,6 +22,7 @@ #include "rtengine.h" #include "rt_math.h" #include "rawimagesource.h" +#include "sleef.c" #include "jaggedarray.h" #undef THREAD_PRIORITY_NORMAL #include "opthelper.h" diff --git a/rtengine/shmap.h b/rtengine/shmap.h index b40e872bb..5373b8302 100644 --- a/rtengine/shmap.h +++ b/rtengine/shmap.h @@ -18,9 +18,13 @@ */ #pragma once -#include "LUT.h" #include "noncopyable.h" +template +class LUT; + +using LUTf = LUT; + namespace rtengine { diff --git a/rtengine/tmo_fattal02.cc b/rtengine/tmo_fattal02.cc index d28606edb..173171e0e 100644 --- a/rtengine/tmo_fattal02.cc +++ b/rtengine/tmo_fattal02.cc @@ -66,6 +66,7 @@ #include #include "array2D.h" +#include "color.h" #include "iccstore.h" #include "imagefloat.h" #include "improcfun.h" diff --git a/rtengine/xtrans_demosaic.cc b/rtengine/xtrans_demosaic.cc index 418d369b8..c1a526535 100644 --- a/rtengine/xtrans_demosaic.cc +++ b/rtengine/xtrans_demosaic.cc @@ -19,6 +19,7 @@ // //////////////////////////////////////////////////////////////// +#include "color.h" #include "rtengine.h" #include "rawimage.h" #include "rawimagesource.h" diff --git a/rtgui/bayerexposre.h b/rtgui/bayerexposre.h new file mode 100644 index 000000000..e69de29bb diff --git a/rtgui/bayerexposure.h b/rtgui/bayerexposure.h new file mode 100644 index 000000000..e69de29bb diff --git a/rtgui/colortoning.cc b/rtgui/colortoning.cc index f177602a3..1a6a9b918 100644 --- a/rtgui/colortoning.cc +++ b/rtgui/colortoning.cc @@ -7,6 +7,7 @@ #include "eventmapper.h" #include "labgrid.h" #include "options.h" +#include "../rtengine/color.h" using namespace rtengine; using namespace rtengine::procparams; diff --git a/rtgui/defringe.cc b/rtgui/defringe.cc index 8aa79dddd..7114f9a52 100644 --- a/rtgui/defringe.cc +++ b/rtgui/defringe.cc @@ -22,6 +22,7 @@ #include "defringe.h" #include "options.h" +#include "../rtengine/color.h" #include "../rtengine/procparams.h" using namespace rtengine; diff --git a/rtgui/dirpyrdenoise.cc b/rtgui/dirpyrdenoise.cc index dd695eecf..b429dfc9f 100644 --- a/rtgui/dirpyrdenoise.cc +++ b/rtgui/dirpyrdenoise.cc @@ -25,6 +25,7 @@ #include "guiutils.h" #include "options.h" +#include "../rtengine/color.h" #include "../rtengine/procparams.h" using namespace rtengine; 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/labcurve.cc b/rtgui/labcurve.cc index fd1065269..bd4b27f14 100644 --- a/rtgui/labcurve.cc +++ b/rtgui/labcurve.cc @@ -22,6 +22,7 @@ #include "options.h" +#include "../rtengine/color.h" #include "../rtengine/improcfun.h" #include "../rtengine/procparams.h" #include "editcallbacks.h" diff --git a/rtgui/labgrid.cc b/rtgui/labgrid.cc index fa452815e..516dbb825 100644 --- a/rtgui/labgrid.cc +++ b/rtgui/labgrid.cc @@ -38,6 +38,7 @@ #include "labgrid.h" +#include "../rtengine/color.h" #include "options.h" #include "rtimage.h" diff --git a/rtgui/mydiagonalcurve.h b/rtgui/mydiagonalcurve.h index d9f2518fb..a71c0565c 100644 --- a/rtgui/mydiagonalcurve.h +++ b/rtgui/mydiagonalcurve.h @@ -26,9 +26,12 @@ #include "curvelistener.h" #include "mycurve.h" -#include "../rtengine/LUT.h" #include "../rtengine/diagonalcurvetypes.h" +template +class LUT; + +using LUTf = LUT; class DiagonalCurveDescr { diff --git a/rtgui/retinex.cc b/rtgui/retinex.cc index dddf1da20..33f1c2f6a 100644 --- a/rtgui/retinex.cc +++ b/rtgui/retinex.cc @@ -5,6 +5,7 @@ #include "mycurve.h" #include "rtimage.h" #include "options.h" +#include "../rtengine/color.h" using namespace rtengine; using namespace rtengine::procparams; diff --git a/rtgui/wavelet.cc b/rtgui/wavelet.cc index 6e49d36b9..4fd3a7b8f 100644 --- a/rtgui/wavelet.cc +++ b/rtgui/wavelet.cc @@ -24,6 +24,7 @@ #include "guiutils.h" #include "rtimage.h" #include "options.h" +#include "../rtengine/color.h" using namespace rtengine; using namespace rtengine::procparams; From e66ed090a71a3c420944d112d4ff94628eb6282b Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sun, 3 Nov 2019 14:53:57 +0100 Subject: [PATCH 34/40] remove two accidently committed files --- rtgui/bayerexposre.h | 0 rtgui/bayerexposure.h | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 rtgui/bayerexposre.h delete mode 100644 rtgui/bayerexposure.h diff --git a/rtgui/bayerexposre.h b/rtgui/bayerexposre.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/rtgui/bayerexposure.h b/rtgui/bayerexposure.h deleted file mode 100644 index e69de29bb..000000000 From ee6dd7d0d1f88d06ee825f1454bdc4715f226159 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sun, 3 Nov 2019 16:14:16 +0100 Subject: [PATCH 35/40] reduce dependencies --- rtengine/capturesharpening.cc | 3 --- rtengine/curves.cc | 3 --- rtengine/filmnegativeproc.cc | 4 ---- rtengine/iplabregions.cc | 4 ---- rtengine/iplocalcontrast.cc | 4 ---- rtengine/iptransform.cc | 4 ---- rtengine/ipvibrance.cc | 4 ---- 7 files changed, 26 deletions(-) diff --git a/rtengine/capturesharpening.cc b/rtengine/capturesharpening.cc index bbc0be50b..80693c8b7 100644 --- a/rtengine/capturesharpening.cc +++ b/rtengine/capturesharpening.cc @@ -29,9 +29,6 @@ #include "rt_algo.h" //#define BENCHMARK #include "StopWatch.h" -#ifdef _OPENMP -#include -#endif #include "opthelper.h" #include "../rtgui/multilangmgr.h" diff --git a/rtengine/curves.cc b/rtengine/curves.cc index eb6cc57c3..b2105a091 100644 --- a/rtengine/curves.cc +++ b/rtengine/curves.cc @@ -23,9 +23,6 @@ #include #include #include -#ifdef _OPENMP -#include -#endif #include "rt_math.h" diff --git a/rtengine/filmnegativeproc.cc b/rtengine/filmnegativeproc.cc index 73156d1e3..1ceff7e20 100644 --- a/rtengine/filmnegativeproc.cc +++ b/rtengine/filmnegativeproc.cc @@ -19,10 +19,6 @@ #include #include -#ifdef _OPENMP -#include -#endif - #include "rawimage.h" #include "rawimagesource.h" diff --git a/rtengine/iplabregions.cc b/rtengine/iplabregions.cc index 305a449ee..e3755f0fc 100644 --- a/rtengine/iplabregions.cc +++ b/rtengine/iplabregions.cc @@ -18,10 +18,6 @@ * along with RawTherapee. If not, see . */ -#ifdef _OPENMP -#include -#endif - #include "color.h" #include "curves.h" #include "guidedfilter.h" diff --git a/rtengine/iplocalcontrast.cc b/rtengine/iplocalcontrast.cc index d6f3ebb5b..daeb142dd 100644 --- a/rtengine/iplocalcontrast.cc +++ b/rtengine/iplocalcontrast.cc @@ -22,10 +22,6 @@ * along with RawTherapee. If not, see . */ -#ifdef _OPENMP -#include -#endif - #include "array2D.h" #include "gauss.h" #include "labimage.h" diff --git a/rtengine/iptransform.cc b/rtengine/iptransform.cc index 640fab2a6..b6ffcec1c 100644 --- a/rtengine/iptransform.cc +++ b/rtengine/iptransform.cc @@ -18,10 +18,6 @@ */ #include -#ifdef _OPENMP -#include -#endif - #include "imagefloat.h" #include "improcfun.h" diff --git a/rtengine/ipvibrance.cc b/rtengine/ipvibrance.cc index b46cfb413..14e5f3c44 100644 --- a/rtengine/ipvibrance.cc +++ b/rtengine/ipvibrance.cc @@ -28,10 +28,6 @@ #include "color.h" #include "procparams.h" #include "StopWatch.h" -#ifdef _OPENMP -#include -#endif - using namespace std; From ec3ba6d9b8764b8fd728b01ce679bb639862a778 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sun, 3 Nov 2019 17:03:40 +0100 Subject: [PATCH 36/40] renamed sleef.c to sleef.h --- rtengine/EdgePreservingDecomposition.cc | 2 +- rtengine/FTblockDN.cc | 2 +- rtengine/PF_correct_RT.cc | 2 +- rtengine/amaze_demosaic_RT.cc | 2 +- rtengine/ciecam02.cc | 2 +- rtengine/color.cc | 2 +- rtengine/color.h | 2 +- rtengine/colortemp.cc | 2 +- rtengine/curves.h | 2 +- rtengine/demosaic_algos.cc | 2 +- rtengine/filmnegativeproc.cc | 2 +- rtengine/filmnegativethumb.cc | 2 +- rtengine/impulse_denoise.cc | 2 +- rtengine/iplabregions.cc | 3 +-- rtengine/ipresize.cc | 2 +- rtengine/ipshadowshighlights.cc | 3 +-- rtengine/ipsharpen.cc | 2 +- rtengine/iptransform.cc | 2 +- rtengine/ipwavelet.cc | 2 +- rtengine/pixelshift.cc | 2 +- rtengine/rt_algo.cc | 2 +- rtengine/shmap.cc | 2 +- rtengine/{sleef.c => sleef.h} | 6 +----- rtengine/tmo_fattal02.cc | 2 +- 24 files changed, 24 insertions(+), 30 deletions(-) rename rtengine/{sleef.c => sleef.h} (99%) diff --git a/rtengine/EdgePreservingDecomposition.cc b/rtengine/EdgePreservingDecomposition.cc index 85770826e..700181e1d 100644 --- a/rtengine/EdgePreservingDecomposition.cc +++ b/rtengine/EdgePreservingDecomposition.cc @@ -4,7 +4,7 @@ #ifdef _OPENMP #include #endif -#include "sleef.c" +#include "sleef.h" #define DIAGONALS 5 #define DIAGONALSP1 6 diff --git a/rtengine/FTblockDN.cc b/rtengine/FTblockDN.cc index 6e1ddf8b4..ea0565b21 100644 --- a/rtengine/FTblockDN.cc +++ b/rtengine/FTblockDN.cc @@ -42,7 +42,7 @@ #include "opthelper.h" #include "procparams.h" #include "rt_math.h" -#include "sleef.c" +#include "sleef.h" #include "../rtgui/threadutils.h" #include "../rtgui/options.h" diff --git a/rtengine/PF_correct_RT.cc b/rtengine/PF_correct_RT.cc index c851d3d09..9a95b8e2f 100644 --- a/rtengine/PF_correct_RT.cc +++ b/rtengine/PF_correct_RT.cc @@ -33,7 +33,7 @@ #include "color.h" #include "curves.h" #include "labimage.h" -#include "sleef.c" +#include "sleef.h" #include "curves.h" #include "rt_math.h" #include "opthelper.h" diff --git a/rtengine/amaze_demosaic_RT.cc b/rtengine/amaze_demosaic_RT.cc index 41c60d4ed..11ff1f5a0 100644 --- a/rtengine/amaze_demosaic_RT.cc +++ b/rtengine/amaze_demosaic_RT.cc @@ -30,7 +30,7 @@ #include "rawimagesource.h" #include "rt_math.h" #include "../rtgui/multilangmgr.h" -#include "sleef.c" +#include "sleef.h" #include "opthelper.h" #include "median.h" #include "StopWatch.h" diff --git a/rtengine/ciecam02.cc b/rtengine/ciecam02.cc index 0553c129e..8314e5e8f 100644 --- a/rtengine/ciecam02.cc +++ b/rtengine/ciecam02.cc @@ -20,7 +20,7 @@ #include "rt_math.h" #include "curves.h" #include -#include "sleef.c" +#include "sleef.h" #ifdef _DEBUG #include "settings.h" diff --git a/rtengine/color.cc b/rtengine/color.cc index 8437a36b1..8d20fb9ba 100644 --- a/rtengine/color.cc +++ b/rtengine/color.cc @@ -20,7 +20,7 @@ #include "rtengine.h" #include "color.h" #include "iccmatrices.h" -#include "sleef.c" +#include "sleef.h" #include "opthelper.h" #include "iccstore.h" diff --git a/rtengine/color.h b/rtengine/color.h index abe67d906..a89778157 100644 --- a/rtengine/color.h +++ b/rtengine/color.h @@ -26,7 +26,7 @@ #include "LUT.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 413880d49..02d3e0e6d 100644 --- a/rtengine/colortemp.cc +++ b/rtengine/colortemp.cc @@ -25,7 +25,7 @@ #include #include #include -#include "sleef.c" +#include "sleef.h" #include "settings.h" namespace rtengine diff --git a/rtengine/curves.h b/rtengine/curves.h index b8b72d0eb..bc8193b76 100644 --- a/rtengine/curves.h +++ b/rtengine/curves.h @@ -30,7 +30,7 @@ #include "pipettebuffer.h" #include "noncopyable.h" #include "LUT.h" -#include "sleef.c" +#include "sleef.h" #define CURVES_MIN_POLY_POINTS 1000 #include "rt_math.h" diff --git a/rtengine/demosaic_algos.cc b/rtengine/demosaic_algos.cc index 4058534da..45779fc9c 100644 --- a/rtengine/demosaic_algos.cc +++ b/rtengine/demosaic_algos.cc @@ -25,7 +25,7 @@ #include "rt_math.h" #include "color.h" #include "../rtgui/multilangmgr.h" -#include "sleef.c" +#include "sleef.h" #include "opthelper.h" #include "median.h" //#define BENCHMARK diff --git a/rtengine/filmnegativeproc.cc b/rtengine/filmnegativeproc.cc index 1ceff7e20..86bad00f7 100644 --- a/rtengine/filmnegativeproc.cc +++ b/rtengine/filmnegativeproc.cc @@ -28,7 +28,7 @@ #include "procparams.h" #include "rt_algo.h" #include "rtengine.h" -#include "sleef.c" +#include "sleef.h" //#define BENCHMARK #include "StopWatch.h" diff --git a/rtengine/filmnegativethumb.cc b/rtengine/filmnegativethumb.cc index fa50e93bf..b31432a55 100644 --- a/rtengine/filmnegativethumb.cc +++ b/rtengine/filmnegativethumb.cc @@ -22,7 +22,7 @@ #include "rtengine.h" #include "rtthumbnail.h" #include "opthelper.h" -#include "sleef.c" +#include "sleef.h" #include "rt_algo.h" #include "settings.h" #include "procparams.h" 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/iplabregions.cc b/rtengine/iplabregions.cc index e3755f0fc..1768101c8 100644 --- a/rtengine/iplabregions.cc +++ b/rtengine/iplabregions.cc @@ -25,8 +25,7 @@ #include "improcfun.h" #include "labimage.h" #include "procparams.h" - -#include "sleef.c" +#include "sleef.h" //#define BENCHMARK #include "StopWatch.h" diff --git a/rtengine/ipresize.cc b/rtengine/ipresize.cc index b31fcf864..b9e234b63 100644 --- a/rtengine/ipresize.cc +++ b/rtengine/ipresize.cc @@ -25,7 +25,7 @@ #include "opthelper.h" #include "rt_math.h" #include "procparams.h" -#include "sleef.c" +#include "sleef.h" //#define PROFILE diff --git a/rtengine/ipshadowshighlights.cc b/rtengine/ipshadowshighlights.cc index 45031da53..a602c5460 100644 --- a/rtengine/ipshadowshighlights.cc +++ b/rtengine/ipshadowshighlights.cc @@ -28,8 +28,7 @@ #include "labimage.h" #include "opthelper.h" #include "procparams.h" - -#include "sleef.c" +#include "sleef.h" namespace rtengine { diff --git a/rtengine/ipsharpen.cc b/rtengine/ipsharpen.cc index 0758011bb..a35476d3a 100644 --- a/rtengine/ipsharpen.cc +++ b/rtengine/ipsharpen.cc @@ -28,7 +28,7 @@ #include "rt_algo.h" #include "rt_math.h" #include "settings.h" -#include "sleef.c" +#include "sleef.h" //#define BENCHMARK #include "StopWatch.h" diff --git a/rtengine/iptransform.cc b/rtengine/iptransform.cc index b6ffcec1c..a4f304413 100644 --- a/rtengine/iptransform.cc +++ b/rtengine/iptransform.cc @@ -25,7 +25,7 @@ #include "rt_math.h" #include "rtengine.h" #include "rtlensfun.h" -#include "sleef.c" +#include "sleef.h" using namespace std; diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 08b317e4c..91c7d6c44 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -41,7 +41,7 @@ #include "procparams.h" #include "rt_math.h" #include "rtengine.h" -#include "sleef.c" +#include "sleef.h" #include "../rtgui/options.h" #ifdef _OPENMP diff --git a/rtengine/pixelshift.cc b/rtengine/pixelshift.cc index 7a6b6db41..0d83d7af3 100644 --- a/rtengine/pixelshift.cc +++ b/rtengine/pixelshift.cc @@ -28,7 +28,7 @@ #include "median.h" #include "procparams.h" #include "rawimagesource.h" -#include "sleef.c" +#include "sleef.h" #include "../rtgui/multilangmgr.h" #include "../rtgui/options.h" 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/shmap.cc b/rtengine/shmap.cc index d0c34e925..44096d965 100644 --- a/rtengine/shmap.cc +++ b/rtengine/shmap.cc @@ -22,7 +22,7 @@ #include "rtengine.h" #include "rt_math.h" #include "rawimagesource.h" -#include "sleef.c" +#include "sleef.h" #include "jaggedarray.h" #undef THREAD_PRIORITY_NORMAL #include "opthelper.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/tmo_fattal02.cc b/rtengine/tmo_fattal02.cc index 173171e0e..feba5c95f 100644 --- a/rtengine/tmo_fattal02.cc +++ b/rtengine/tmo_fattal02.cc @@ -75,7 +75,7 @@ #include "rescale.h" #include "rt_algo.h" #include "settings.h" -#include "sleef.c" +#include "sleef.h" #include "StopWatch.h" namespace rtengine From 9f3251eb561d750692149d6d0a7f691b7d08e36f Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sun, 3 Nov 2019 23:30:34 +0100 Subject: [PATCH 37/40] fix lgtm issue --- rtengine/rawflatfield.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtengine/rawflatfield.cc b/rtengine/rawflatfield.cc index 04012debf..05b3be408 100644 --- a/rtengine/rawflatfield.cc +++ b/rtengine/rawflatfield.cc @@ -33,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; } From 7ef19b51264191b919da76fb11718ac193b9da32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=B6ssie?= Date: Mon, 4 Nov 2019 14:48:06 +0100 Subject: [PATCH 38/40] Fix GCC 9.2.1 build --- rtengine/ciecam02.h | 1 + 1 file changed, 1 insertion(+) diff --git a/rtengine/ciecam02.h b/rtengine/ciecam02.h index 5f5dd9bca..8b532fba0 100644 --- a/rtengine/ciecam02.h +++ b/rtengine/ciecam02.h @@ -19,6 +19,7 @@ #pragma once #include +#include #include "opthelper.h" From 0544d15b16a1dd9fa4d1ee4eb160e021b77d8f86 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Mon, 4 Nov 2019 15:10:28 +0100 Subject: [PATCH 39/40] Fix slowdown when creating thumb from non-raw file --- rtengine/iimage.cc | 7 ++-- rtengine/iimage.h | 95 +++++++++++++++++++++++++++++++++------------- 2 files changed, 73 insertions(+), 29 deletions(-) diff --git a/rtengine/iimage.cc b/rtengine/iimage.cc index a8bcf9368..f4a2a6523 100644 --- a/rtengine/iimage.cc +++ b/rtengine/iimage.cc @@ -46,6 +46,7 @@ int rtengine::getCoarseBitMask( const procparams::CoarseTransformParams &coarse) return tr; } -int rtengine::igammasrgb(float in) { - return Color::igamma_srgb(in); -} + +const LUTf& rtengine::getigammatab() { + return Color::igammatab_srgb; +} \ No newline at end of file diff --git a/rtengine/iimage.h b/rtengine/iimage.h index 73e38b45f..7309dd91f 100644 --- a/rtengine/iimage.h +++ b/rtengine/iimage.h @@ -59,7 +59,7 @@ extern const char sImage16[]; extern const char sImagefloat[]; int getCoarseBitMask(const procparams::CoarseTransformParams& coarse); -int igammasrgb(float in); +const LUTf& getigammatab(); enum TypeInterpolation { TI_Nearest, TI_Bilinear }; @@ -958,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[igammasrgb (r_) >> histcompr]++; - histogram[igammasrgb (g_) >> histcompr]++; - histogram[igammasrgb (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 @@ -976,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 = igammasrgb (r_); - int gtemp = igammasrgb (g_); - int btemp = igammasrgb (b_); + int rtemp = igammatab[r_]; + int gtemp = igammatab[g_]; + int btemp = igammatab[b_]; histogram[rtemp >> compression]++; histogram[gtemp >> compression] += 2; @@ -1012,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_; @@ -1567,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[igammasrgb (r_) >> histcompr]++; - histogram[igammasrgb (g_) >> histcompr]++; - histogram[igammasrgb (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 @@ -1585,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++) { @@ -1592,9 +1632,9 @@ public: convertTo(r(i, j), r_); convertTo(g(i, j), g_); convertTo(b(i, j), b_); - int rtemp = igammasrgb (r_); - int gtemp = igammasrgb (g_); - int btemp = igammasrgb (b_); + int rtemp = igammatab[r_]; + int gtemp = igammatab[g_]; + int btemp = igammatab[b_]; histogram[rtemp >> compression]++; histogram[gtemp >> compression] += 2; @@ -1621,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_; From 14ef271a3608870cb927bedb2685ee73a67f63e1 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Mon, 4 Nov 2019 15:11:49 +0100 Subject: [PATCH 40/40] Add missing line ending --- rtengine/iimage.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtengine/iimage.cc b/rtengine/iimage.cc index f4a2a6523..7548fc8bf 100644 --- a/rtengine/iimage.cc +++ b/rtengine/iimage.cc @@ -49,4 +49,4 @@ int rtengine::getCoarseBitMask( const procparams::CoarseTransformParams &coarse) const LUTf& rtengine::getigammatab() { return Color::igammatab_srgb; -} \ No newline at end of file +}