Fix Clang warnings plus some cleanups

This commit is contained in:
Flössie
2019-10-31 08:56:38 +01:00
parent 6935faa258
commit aacea7046c
19 changed files with 99 additions and 87 deletions

View File

@@ -29,7 +29,8 @@
#include "iccstore.h" #include "iccstore.h"
#include "image8.h" #include "image8.h"
namespace rtengine { namespace rtengine
{
GamutWarning::GamutWarning(cmsHPROFILE iprof, cmsHPROFILE gamutprof, RenderingIntent intent, bool gamutbpc): GamutWarning::GamutWarning(cmsHPROFILE iprof, cmsHPROFILE gamutprof, RenderingIntent intent, bool gamutbpc):
lab2ref(nullptr), lab2ref(nullptr),
@@ -129,5 +130,4 @@ inline void GamutWarning::mark(Image8 *image, int y, int x)
image->b(y, x) = 255; image->b(y, x) = 255;
} }
} // namespace rtengine } // namespace rtengine

View File

@@ -29,7 +29,8 @@
#include "noncopyable.h" #include "noncopyable.h"
namespace rtengine { namespace rtengine
{
class Image8; class Image8;

View File

@@ -29,15 +29,19 @@
* available at https://arxiv.org/abs/1505.00996 * available at https://arxiv.org/abs/1505.00996
*/ */
#include "guidedfilter.h"
#include "boxblur.h" #include "boxblur.h"
#include "rescale.h" #include "guidedfilter.h"
#include "imagefloat.h" #include "imagefloat.h"
#include "rescale.h"
#define BENCHMARK #define BENCHMARK
#include "StopWatch.h" #include "StopWatch.h"
namespace rtengine {
namespace { namespace rtengine
{
namespace
{
int calculate_subsampling(int w, int h, int r) int calculate_subsampling(int w, int h, int r)
{ {
@@ -60,7 +64,6 @@ int calculate_subsampling(int w, int h, int r)
} // namespace } // namespace
void guidedFilter(const array2D<float> &guide, const array2D<float> &src, array2D<float> &dst, int r, float epsilon, bool multithread, int subsampling) void guidedFilter(const array2D<float> &guide, const array2D<float> &src, array2D<float> &dst, int r, float epsilon, bool multithread, int subsampling)
{ {
enum Op {MUL, DIVEPSILON, SUBMUL}; enum Op {MUL, DIVEPSILON, SUBMUL};

View File

@@ -22,7 +22,8 @@
#include "array2D.h" #include "array2D.h"
namespace rtengine { namespace rtengine
{
void guidedFilter(const array2D<float> &guide, const array2D<float> &src, array2D<float> &dst, int r, float epsilon, bool multithread, int subsampling=0); void guidedFilter(const array2D<float> &guide, const array2D<float> &src, array2D<float> &dst, int r, float epsilon, bool multithread, int subsampling=0);

View File

@@ -18,22 +18,24 @@
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>. * along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/ */
#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 <iostream> #include <iostream>
#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 { namespace {

View File

@@ -42,9 +42,11 @@
#include "../rtgui/options.h" #include "../rtgui/options.h"
namespace rtengine { namespace rtengine
{
namespace { namespace
{
float normalize(Imagefloat *rgb, bool multithread) float normalize(Imagefloat *rgb, bool multithread)
{ {
@@ -271,7 +273,6 @@ void extract_channels(Imagefloat *img, array2D<float> &r, array2D<float> &g, arr
} // namespace } // namespace
void ImProcFunctions::dehaze(Imagefloat *img) void ImProcFunctions::dehaze(Imagefloat *img)
{ {
if (!params->dehaze.enabled || params->dehaze.strength == 0.0) { if (!params->dehaze.enabled || params->dehaze.strength == 0.0) {
@@ -431,5 +432,4 @@ void ImProcFunctions::dehaze(Imagefloat *img)
} }
} }
} // namespace rtengine } // namespace rtengine

View File

@@ -56,7 +56,8 @@ void fastlin2log(float *x, float factor, float base, int w)
} }
namespace rtengine { namespace rtengine
{
void ImProcFunctions::labColorCorrectionRegions(LabImage *lab) void ImProcFunctions::labColorCorrectionRegions(LabImage *lab)
{ {

View File

@@ -32,7 +32,8 @@
#include "improcfun.h" #include "improcfun.h"
#include "procparams.h" #include "procparams.h"
namespace rtengine { namespace rtengine
{
void ImProcFunctions::localContrast(LabImage *lab) void ImProcFunctions::localContrast(LabImage *lab)
{ {

View File

@@ -30,7 +30,8 @@
#include "sleef.c" #include "sleef.c"
namespace rtengine { namespace rtengine
{
void ImProcFunctions::shadowsHighlights(LabImage *lab) void ImProcFunctions::shadowsHighlights(LabImage *lab)
{ {

View File

@@ -18,18 +18,18 @@
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>. * along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/ */
#include <iostream>
#include "camconst.h"
#include "pdaflinesfilter.h" #include "pdaflinesfilter.h"
#include "rawimage.h" #include "rawimage.h"
#include "settings.h" #include "settings.h"
#include <iostream>
#include "camconst.h"
namespace rtengine { namespace rtengine
{
extern const Settings *settings; namespace
{
namespace {
class PDAFGreenEqulibrateThreshold: public RawImageSource::GreenEqulibrateThreshold { class PDAFGreenEqulibrateThreshold: public RawImageSource::GreenEqulibrateThreshold {
static constexpr float BASE_THRESHOLD = 0.5f; static constexpr float BASE_THRESHOLD = 0.5f;
@@ -167,8 +167,6 @@ private:
} // namespace } // namespace
PDAFLinesFilter::PDAFLinesFilter(RawImage *ri): PDAFLinesFilter::PDAFLinesFilter(RawImage *ri):
ri_(ri), ri_(ri),
W_(ri->get_width()), W_(ri->get_width()),

View File

@@ -21,10 +21,12 @@
#pragma once #pragma once
#include <vector> #include <vector>
#include "rawimagesource.h"
#include "noncopyable.h"
namespace rtengine { #include "noncopyable.h"
#include "rawimagesource.h"
namespace rtengine
{
class RawImage; class RawImage;

View File

@@ -526,7 +526,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = {
}; };
namespace rtengine { namespace rtengine
{
RefreshMapper::RefreshMapper(): RefreshMapper::RefreshMapper():
next_event_(rtengine::NUMOFEVENTS) next_event_(rtengine::NUMOFEVENTS)

View File

@@ -16,10 +16,10 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>. * along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/ */
#ifndef __REFRESHMAP__ #pragma once
#define __REFRESHMAP__
#include <unordered_map> #include <unordered_map>
#include "procevents.h" #include "procevents.h"
// Use M_VOID if you wish to update the proc params without updating the preview at all ! // Use M_VOID if you wish to update the proc params without updating the preview at all !
@@ -80,7 +80,8 @@
extern int refreshmap[]; extern int refreshmap[];
namespace rtengine { namespace rtengine
{
class RefreshMapper { class RefreshMapper {
public: public:
@@ -97,5 +98,3 @@ private:
}; };
} // namespace rtengine } // namespace rtengine
#endif

View File

@@ -23,7 +23,8 @@
#include "array2D.h" #include "array2D.h"
#include "rt_math.h" #include "rt_math.h"
namespace rtengine { namespace rtengine
{
inline float getBilinearValue(const array2D<float> &src, float x, float y) inline float getBilinearValue(const array2D<float> &src, float x, float y)
{ {
@@ -96,5 +97,4 @@ inline void rescaleNearest(const array2D<float> &src, array2D<float> &dst, bool
} }
} }
} // namespace rtengine } // namespace rtengine

View File

@@ -18,15 +18,15 @@
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>. * along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/ */
#include "rtlensfun.h"
#include "imagedata.h"
#include "procparams.h"
#include "settings.h"
#include <iostream> #include <iostream>
namespace rtengine { #include "imagedata.h"
#include "procparams.h"
#include "rtlensfun.h"
#include "settings.h"
extern const Settings *settings; namespace rtengine
{
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LFModifier // LFModifier

View File

@@ -30,7 +30,8 @@
#include "lcp.h" #include "lcp.h"
#include "noncopyable.h" #include "noncopyable.h"
namespace rtengine { namespace rtengine
{
class FramesMetaData; class FramesMetaData;
@@ -39,6 +40,7 @@ namespace procparams
struct CoarseTransformParams; struct CoarseTransformParams;
struct LensProfParams; struct LensProfParams;
} }
class LFModifier final : class LFModifier final :

View File

@@ -50,32 +50,32 @@
* $Id: tmo_fattal02.cpp,v 1.3 2008/11/04 23:43:08 rafm Exp $ * $Id: tmo_fattal02.cpp,v 1.3 2008/11/04 23:43:08 rafm Exp $
*/ */
#ifdef _OPENMP #ifdef _OPENMP
#include <omp.h> #include <omp.h>
#endif #endif
#include <algorithm>
#include <cstdio> #include <cstdio>
#include <iostream> #include <iostream>
#include <iterator> #include <iterator>
#include <vector>
#include <algorithm>
#include <limits> #include <limits>
#include <vector>
#include <math.h>
#include <assert.h> #include <assert.h>
#include <fftw3.h> #include <fftw3.h>
#include <math.h>
#include "array2D.h" #include "array2D.h"
#include "iccstore.h"
#include "imagefloat.h" #include "imagefloat.h"
#include "improcfun.h" #include "improcfun.h"
#include "settings.h"
#include "iccstore.h"
#include "StopWatch.h"
#include "sleef.c"
#include "opthelper.h" #include "opthelper.h"
#include "rt_algo.h"
#include "rescale.h"
#include "procparams.h" #include "procparams.h"
#include "rescale.h"
#include "rt_algo.h"
#include "settings.h"
#include "sleef.c"
#include "StopWatch.h"
namespace rtengine namespace rtengine
{ {
@@ -84,7 +84,6 @@ namespace rtengine
* RT code * RT code
******************************************************************************/ ******************************************************************************/
extern const Settings *settings;
extern MyMutex *fftwMutex; extern MyMutex *fftwMutex;
using namespace std; using namespace std;

View File

@@ -16,27 +16,31 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>. * along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/ */
#ifndef _CROPWINDOW_ #pragma once
#define _CROPWINDOW_
#include <list>
#include <gtkmm.h> #include <gtkmm.h>
#include "lwbutton.h"
#include "lwbuttonset.h"
#include "editenums.h"
#include "crophandler.h"
#include <list>
#include "cropguilistener.h" #include "cropguilistener.h"
#include "pointermotionlistener.h" #include "crophandler.h"
#include "cursormanager.h" #include "cursormanager.h"
#include "editbuffer.h" #include "editbuffer.h"
#include "editcoordsys.h" #include "editcoordsys.h"
#include "editenums.h"
#include "lwbutton.h"
#include "lwbuttonset.h"
#include "pointermotionlistener.h"
#include "../rtengine/noncopyable.h" #include "../rtengine/noncopyable.h"
namespace rtengine { namespace rtengine
{
class Coord; struct Coord;
} }
class CropWindow; class CropWindow;
class CropWindowListener class CropWindowListener
@@ -243,5 +247,3 @@ public:
ImageArea* getImageArea(); ImageArea* getImageArea();
}; };
#endif

View File

@@ -16,8 +16,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>. * along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/ */
#ifndef __GUI_UTILS_ #pragma once
#define __GUI_UTILS_
#include <functional> #include <functional>
#include <map> #include <map>
@@ -26,22 +25,24 @@
#include <cairomm/cairomm.h> #include <cairomm/cairomm.h>
#include "pathutils.h"
#include "threadutils.h"
#include "../rtengine/coord.h" #include "../rtengine/coord.h"
#include "../rtengine/noncopyable.h" #include "../rtengine/noncopyable.h"
#include "threadutils.h" namespace rtengine
{
// for convenience...
#include "pathutils.h"
namespace rtengine {
namespace procparams namespace procparams
{ {
class ProcParams; class ProcParams;
struct CropParams; struct CropParams;
} }
} }
class RTImage; class RTImage;
@@ -654,5 +655,3 @@ inline Gtk::Window& getToplevelWindow (Gtk::Widget* widget)
{ {
return *static_cast<Gtk::Window*> (widget->get_toplevel ()); return *static_cast<Gtk::Window*> (widget->get_toplevel ());
} }
#endif