Further reduction of include dependencies

This commit is contained in:
Ingo Weyrich 2019-11-03 14:52:42 +01:00
parent b3b1008270
commit 6335b68a80
45 changed files with 154 additions and 69 deletions

View File

@ -29,6 +29,7 @@
#include "array2D.h" #include "array2D.h"
#include "boxblur.h" #include "boxblur.h"
#include "cplx_wavelet_dec.h" #include "cplx_wavelet_dec.h"
#include "color.h"
#include "curves.h" #include "curves.h"
#include "iccmatrices.h" #include "iccmatrices.h"
#include "iccstore.h" #include "iccstore.h"

View File

@ -30,6 +30,7 @@
#include "gauss.h" #include "gauss.h"
#include "improcfun.h" #include "improcfun.h"
#include "cieimage.h" #include "cieimage.h"
#include "color.h"
#include "curves.h" #include "curves.h"
#include "labimage.h" #include "labimage.h"
#include "sleef.c" #include "sleef.c"

View File

@ -20,9 +20,14 @@
#include <cmath> #include <cmath>
#include "LUT.h"
#include "opthelper.h" #include "opthelper.h"
template<typename T>
class LUT;
using LUTu = LUT<uint32_t>;
using LUTf = LUT<float>;
namespace rtengine namespace rtengine
{ {

View File

@ -25,13 +25,12 @@
#include <glibmm/ustring.h> #include <glibmm/ustring.h>
#include "rt_math.h" #include "rt_math.h"
#include "color.h"
#include "flatcurvetypes.h" #include "flatcurvetypes.h"
#include "diagonalcurvetypes.h" #include "diagonalcurvetypes.h"
#include "pipettebuffer.h" #include "pipettebuffer.h"
#include "noncopyable.h" #include "noncopyable.h"
#include "LUT.h" #include "LUT.h"
#include "sleef.c"
#define CURVES_MIN_POLY_POINTS 1000 #define CURVES_MIN_POLY_POINTS 1000
#include "rt_math.h" #include "rt_math.h"
@ -894,12 +893,6 @@ public:
float *r, float *g, float *b) const; 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 class WeightedStdToneCurve : public ToneCurve
{ {
private: private:
@ -1269,43 +1262,6 @@ inline void WeightedStdToneCurve::BatchApply(const size_t start, const size_t en
#endif #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 #undef CLIPI

View File

@ -28,6 +28,7 @@
#include "dcp.h" #include "dcp.h"
#include "cJSON.h" #include "cJSON.h"
#include "color.h"
#include "iccmatrices.h" #include "iccmatrices.h"
#include "iccstore.h" #include "iccstore.h"
#include "imagefloat.h" #include "imagefloat.h"

View File

@ -24,7 +24,9 @@
#include "array2D.h" #include "array2D.h"
#include "cieimage.h" #include "cieimage.h"
#include "color.h"
#include "improcfun.h" #include "improcfun.h"
#include "LUT.h"
#include "opthelper.h" #include "opthelper.h"
#include "rt_math.h" #include "rt_math.h"
#include "settings.h" #include "settings.h"

View File

@ -23,6 +23,7 @@
// //
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
#include "color.h"
#include "jaggedarray.h" #include "jaggedarray.h"
#include "procparams.h" #include "procparams.h"
#include "rawimagesource.h" #include "rawimagesource.h"

View File

@ -32,7 +32,7 @@
#include "procparams.h" #include "procparams.h"
#include "rt_algo.h" #include "rt_algo.h"
#include "rtengine.h" #include "rtengine.h"
#include "sleef.c"
//#define BENCHMARK //#define BENCHMARK
#include "StopWatch.h" #include "StopWatch.h"

View File

@ -18,9 +18,11 @@
*/ */
#include <cmath> #include <cmath>
#include "LUT.h"
#include "rtengine.h" #include "rtengine.h"
#include "rtthumbnail.h" #include "rtthumbnail.h"
#include "opthelper.h" #include "opthelper.h"
#include "sleef.c"
#include "rt_algo.h" #include "rt_algo.h"
#include "settings.h" #include "settings.h"
#include "procparams.h" #include "procparams.h"

View File

@ -27,8 +27,6 @@
#include <lcms2.h> #include <lcms2.h>
#include "color.h"
namespace rtengine namespace rtengine
{ {

View File

@ -17,6 +17,7 @@
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>. * along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/ */
#include "color.h"
#include "procparams.h" #include "procparams.h"
#include "rtengine.h" #include "rtengine.h"
@ -45,3 +46,6 @@ int rtengine::getCoarseBitMask( const procparams::CoarseTransformParams &coarse)
return tr; return tr;
} }
int rtengine::igammasrgb(float in) {
return Color::igamma_srgb(in);
}

View File

@ -21,9 +21,9 @@
#include <vector> #include <vector>
#include <glibmm/ustring.h> #include <glibmm/ustring.h>
#include <lcms2.h>
#include "alignedbuffer.h" #include "alignedbuffer.h"
#include "color.h"
#include "coord2d.h" #include "coord2d.h"
#include "imagedimensions.h" #include "imagedimensions.h"
#include "LUT.h" #include "LUT.h"
@ -59,6 +59,7 @@ extern const char sImage16[];
extern const char sImagefloat[]; extern const char sImagefloat[];
int getCoarseBitMask(const procparams::CoarseTransformParams& coarse); int getCoarseBitMask(const procparams::CoarseTransformParams& coarse);
int igammasrgb(float in);
enum TypeInterpolation { TI_Nearest, TI_Bilinear }; enum TypeInterpolation { TI_Nearest, TI_Bilinear };
@ -964,9 +965,9 @@ public:
convertTo<T, float>(r(i, j), r_); convertTo<T, float>(r(i, j), r_);
convertTo<T, float>(g(i, j), g_); convertTo<T, float>(g(i, j), g_);
convertTo<T, float>(b(i, j), b_); convertTo<T, float>(b(i, j), b_);
histogram[(int)Color::igamma_srgb (r_) >> histcompr]++; histogram[igammasrgb (r_) >> histcompr]++;
histogram[(int)Color::igamma_srgb (g_) >> histcompr]++; histogram[igammasrgb (g_) >> histcompr]++;
histogram[(int)Color::igamma_srgb (b_) >> histcompr]++; histogram[igammasrgb (b_) >> histcompr]++;
} }
} }
@ -982,9 +983,9 @@ public:
convertTo<T, float>(r(i, j), r_); convertTo<T, float>(r(i, j), r_);
convertTo<T, float>(g(i, j), g_); convertTo<T, float>(g(i, j), g_);
convertTo<T, float>(b(i, j), b_); convertTo<T, float>(b(i, j), b_);
int rtemp = Color::igamma_srgb (r_); int rtemp = igammasrgb (r_);
int gtemp = Color::igamma_srgb (g_); int gtemp = igammasrgb (g_);
int btemp = Color::igamma_srgb (b_); int btemp = igammasrgb (b_);
histogram[rtemp >> compression]++; histogram[rtemp >> compression]++;
histogram[gtemp >> compression] += 2; histogram[gtemp >> compression] += 2;
@ -1573,9 +1574,9 @@ public:
convertTo<T, float>(r(i, j), r_); convertTo<T, float>(r(i, j), r_);
convertTo<T, float>(g(i, j), g_); convertTo<T, float>(g(i, j), g_);
convertTo<T, float>(b(i, j), b_); convertTo<T, float>(b(i, j), b_);
histogram[(int)Color::igamma_srgb (r_) >> histcompr]++; histogram[igammasrgb (r_) >> histcompr]++;
histogram[(int)Color::igamma_srgb (g_) >> histcompr]++; histogram[igammasrgb (g_) >> histcompr]++;
histogram[(int)Color::igamma_srgb (b_) >> histcompr]++; histogram[igammasrgb (b_) >> histcompr]++;
} }
} }
@ -1591,9 +1592,9 @@ public:
convertTo<T, float>(r(i, j), r_); convertTo<T, float>(r(i, j), r_);
convertTo<T, float>(g(i, j), g_); convertTo<T, float>(g(i, j), g_);
convertTo<T, float>(b(i, j), b_); convertTo<T, float>(b(i, j), b_);
int rtemp = Color::igamma_srgb (r_); int rtemp = igammasrgb (r_);
int gtemp = Color::igamma_srgb (g_); int gtemp = igammasrgb (g_);
int btemp = Color::igamma_srgb (b_); int btemp = igammasrgb (b_);
histogram[rtemp >> compression]++; histogram[rtemp >> compression]++;
histogram[gtemp >> compression] += 2; histogram[gtemp >> compression] += 2;

View File

@ -28,6 +28,11 @@
#include "LUT.h" #include "LUT.h"
#include "rtengine.h" #include "rtengine.h"
template<typename T>
class LUT;
using LUTf = LUT<float>;
template<typename T, const size_t num> template<typename T, const size_t num>
class multi_array2D; class multi_array2D;

View File

@ -42,6 +42,7 @@
#include "improccoordinator.h" #include "improccoordinator.h"
#include "clutstore.h" #include "clutstore.h"
#include "ciecam02.h" #include "ciecam02.h"
#include "satandvalueblendingcurve.h"
#include "StopWatch.h" #include "StopWatch.h"
#include "procparams.h" #include "procparams.h"
#include "../rtgui/ppversion.h" #include "../rtgui/ppversion.h"

View File

@ -20,13 +20,17 @@
#include <memory> #include <memory>
#include "color.h"
#include "coord2d.h" #include "coord2d.h"
#include "gamutwarning.h" #include "gamutwarning.h"
#include "LUT.h"
#include "pipettebuffer.h" #include "pipettebuffer.h"
#include "shmap.h" #include "shmap.h"
template<typename T>
class LUT;
using LUTu = LUT<uint32_t>;
using LUTf = LUT<float>;
template<typename T, const size_t num> template<typename T, const size_t num>
class multi_array2D; class multi_array2D;
namespace rtengine namespace rtengine

View File

@ -18,6 +18,7 @@
*/ */
#include <fftw3.h> #include <fftw3.h>
#include "../rtgui/profilestorecombobox.h" #include "../rtgui/profilestorecombobox.h"
#include "color.h"
#include "rtengine.h" #include "rtengine.h"
#include "iccstore.h" #include "iccstore.h"
#include "dcp.h" #include "dcp.h"

View File

@ -32,6 +32,7 @@
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include "color.h"
#include "guidedfilter.h" #include "guidedfilter.h"
#include "iccstore.h" #include "iccstore.h"
#include "imagefloat.h" #include "imagefloat.h"

View File

@ -22,6 +22,7 @@
#include <omp.h> #include <omp.h>
#endif #endif
#include "color.h"
#include "curves.h" #include "curves.h"
#include "guidedfilter.h" #include "guidedfilter.h"
#include "iccstore.h" #include "iccstore.h"

View File

@ -41,6 +41,7 @@
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include "color.h"
#include "curves.h" #include "curves.h"
#include "gauss.h" #include "gauss.h"
#include "improcfun.h" #include "improcfun.h"

View File

@ -20,6 +20,7 @@
#include "improcfun.h" #include "improcfun.h"
#include "color.h"
#include "curves.h" #include "curves.h"
#include "gauss.h" #include "gauss.h"
#include "guidedfilter.h" #include "guidedfilter.h"

View File

@ -19,6 +19,7 @@
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>. * along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/ */
#include "color.h"
#include "iccstore.h" #include "iccstore.h"
#include "improcfun.h" #include "improcfun.h"
#include "labimage.h" #include "labimage.h"

View File

@ -29,6 +29,7 @@
#include "../rtgui/threadutils.h" #include "../rtgui/threadutils.h"
#include "array2D.h" #include "array2D.h"
#include "color.h"
#include "curves.h" #include "curves.h"
#include "EdgePreservingDecomposition.h" #include "EdgePreservingDecomposition.h"
#include "iccstore.h" #include "iccstore.h"

View File

@ -28,7 +28,7 @@
#include "median.h" #include "median.h"
#include "procparams.h" #include "procparams.h"
#include "rawimagesource.h" #include "rawimagesource.h"
#include "sleef.c"
#include "../rtgui/multilangmgr.h" #include "../rtgui/multilangmgr.h"
#include "../rtgui/options.h" #include "../rtgui/options.h"

View File

@ -19,6 +19,7 @@
#include "previewimage.h" #include "previewimage.h"
#include "color.h"
#include "iimage.h" #include "iimage.h"
#include "iimage.h" #include "iimage.h"
#include "procparams.h" #include "procparams.h"

View File

@ -26,6 +26,7 @@
#include <glibmm/miscutils.h> #include <glibmm/miscutils.h>
#include <glibmm/keyfile.h> #include <glibmm/keyfile.h>
#include "color.h"
#include "curves.h" #include "curves.h"
#include "procparams.h" #include "procparams.h"
#include "utils.h" #include "utils.h"

View File

@ -23,7 +23,6 @@
#include <memory> #include <memory>
#include "array2D.h" #include "array2D.h"
#include "color.h"
#include "colortemp.h" #include "colortemp.h"
#include "iimage.h" #include "iimage.h"
#include "imagesource.h" #include "imagesource.h"

View File

@ -29,7 +29,6 @@
#include "iimage.h" #include "iimage.h"
#include "imageformat.h" #include "imageformat.h"
#include "LUT.h"
#include "procevents.h" #include "procevents.h"
#include "rawmetadatalocation.h" #include "rawmetadatalocation.h"
#include "rt_math.h" #include "rt_math.h"
@ -43,6 +42,11 @@
* *
*/ */
template<typename T>
class LUT;
using LUTu = LUT<uint32_t>;
class EditDataProvider; class EditDataProvider;
namespace rtexif namespace rtexif
{ {

View File

@ -27,6 +27,7 @@
#include <glibmm/keyfile.h> #include <glibmm/keyfile.h>
#include "cieimage.h" #include "cieimage.h"
#include "color.h"
#include "colortemp.h" #include "colortemp.h"
#include "curves.h" #include "curves.h"
#include "dcp.h" #include "dcp.h"

View File

@ -25,6 +25,7 @@
#include "image16.h" #include "image16.h"
#include "image8.h" #include "image8.h"
#include "imagefloat.h" #include "imagefloat.h"
#include "LUT.h"
#include "rawmetadatalocation.h" #include "rawmetadatalocation.h"
#include "../rtgui/threadutils.h" #include "../rtgui/threadutils.h"

View File

@ -0,0 +1,70 @@
/*
* This file is part of RawTherapee.
*
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
*
* 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 <https://www.gnu.org/licenses/>.
*/
#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);
}
}

View File

@ -22,6 +22,7 @@
#include "rtengine.h" #include "rtengine.h"
#include "rt_math.h" #include "rt_math.h"
#include "rawimagesource.h" #include "rawimagesource.h"
#include "sleef.c"
#include "jaggedarray.h" #include "jaggedarray.h"
#undef THREAD_PRIORITY_NORMAL #undef THREAD_PRIORITY_NORMAL
#include "opthelper.h" #include "opthelper.h"

View File

@ -18,9 +18,13 @@
*/ */
#pragma once #pragma once
#include "LUT.h"
#include "noncopyable.h" #include "noncopyable.h"
template<typename T>
class LUT;
using LUTf = LUT<float>;
namespace rtengine namespace rtengine
{ {

View File

@ -66,6 +66,7 @@
#include <math.h> #include <math.h>
#include "array2D.h" #include "array2D.h"
#include "color.h"
#include "iccstore.h" #include "iccstore.h"
#include "imagefloat.h" #include "imagefloat.h"
#include "improcfun.h" #include "improcfun.h"

View File

@ -19,6 +19,7 @@
// //
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
#include "color.h"
#include "rtengine.h" #include "rtengine.h"
#include "rawimage.h" #include "rawimage.h"
#include "rawimagesource.h" #include "rawimagesource.h"

0
rtgui/bayerexposre.h Normal file
View File

0
rtgui/bayerexposure.h Normal file
View File

View File

@ -7,6 +7,7 @@
#include "eventmapper.h" #include "eventmapper.h"
#include "labgrid.h" #include "labgrid.h"
#include "options.h" #include "options.h"
#include "../rtengine/color.h"
using namespace rtengine; using namespace rtengine;
using namespace rtengine::procparams; using namespace rtengine::procparams;

View File

@ -22,6 +22,7 @@
#include "defringe.h" #include "defringe.h"
#include "options.h" #include "options.h"
#include "../rtengine/color.h"
#include "../rtengine/procparams.h" #include "../rtengine/procparams.h"
using namespace rtengine; using namespace rtengine;

View File

@ -25,6 +25,7 @@
#include "guiutils.h" #include "guiutils.h"
#include "options.h" #include "options.h"
#include "../rtengine/color.h"
#include "../rtengine/procparams.h" #include "../rtengine/procparams.h"
using namespace rtengine; using namespace rtengine;

View File

@ -19,6 +19,8 @@
#include "dirpyrequalizer.h" #include "dirpyrequalizer.h"
#include "../rtengine/color.h"
using namespace rtengine; using namespace rtengine;
using namespace rtengine::procparams; using namespace rtengine::procparams;

View File

@ -22,6 +22,7 @@
#include "options.h" #include "options.h"
#include "../rtengine/color.h"
#include "../rtengine/improcfun.h" #include "../rtengine/improcfun.h"
#include "../rtengine/procparams.h" #include "../rtengine/procparams.h"
#include "editcallbacks.h" #include "editcallbacks.h"

View File

@ -38,6 +38,7 @@
#include "labgrid.h" #include "labgrid.h"
#include "../rtengine/color.h"
#include "options.h" #include "options.h"
#include "rtimage.h" #include "rtimage.h"

View File

@ -26,9 +26,12 @@
#include "curvelistener.h" #include "curvelistener.h"
#include "mycurve.h" #include "mycurve.h"
#include "../rtengine/LUT.h"
#include "../rtengine/diagonalcurvetypes.h" #include "../rtengine/diagonalcurvetypes.h"
template<typename T>
class LUT;
using LUTf = LUT<float>;
class DiagonalCurveDescr class DiagonalCurveDescr
{ {

View File

@ -5,6 +5,7 @@
#include "mycurve.h" #include "mycurve.h"
#include "rtimage.h" #include "rtimage.h"
#include "options.h" #include "options.h"
#include "../rtengine/color.h"
using namespace rtengine; using namespace rtengine;
using namespace rtengine::procparams; using namespace rtengine::procparams;

View File

@ -24,6 +24,7 @@
#include "guiutils.h" #include "guiutils.h"
#include "rtimage.h" #include "rtimage.h"
#include "options.h" #include "options.h"
#include "../rtengine/color.h"
using namespace rtengine; using namespace rtengine;
using namespace rtengine::procparams; using namespace rtengine::procparams;