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;