Introduce rtengine/noncopyable.hpp
This commit is contained in:
@@ -50,17 +50,19 @@ My email address is my screen name followed by @yahoo.com. I'm also known as ben
|
|||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
#include "opthelper.h"
|
#include "opthelper.h"
|
||||||
|
#include "noncopyable.h"
|
||||||
|
|
||||||
//This is for solving big symmetric positive definite linear problems.
|
//This is for solving big symmetric positive definite linear problems.
|
||||||
float *SparseConjugateGradient(void Ax(float *Product, float *x, void *Pass), float *b, int n, bool OkToModify_b = true, float *x = NULL, float RMSResidual = 0.0f, void *Pass = NULL, int MaximumIterates = 0, void Preconditioner(float *Product, float *x, void *Pass) = NULL);
|
float *SparseConjugateGradient(void Ax(float *Product, float *x, void *Pass), float *b, int n, bool OkToModify_b = true, float *x = NULL, float RMSResidual = 0.0f, void *Pass = NULL, int MaximumIterates = 0, void Preconditioner(float *Product, float *x, void *Pass) = NULL);
|
||||||
|
|
||||||
//Storage and use class for symmetric matrices, the nonzero contents of which are confined to diagonals.
|
//Storage and use class for symmetric matrices, the nonzero contents of which are confined to diagonals.
|
||||||
class MultiDiagonalSymmetricMatrix
|
class MultiDiagonalSymmetricMatrix :
|
||||||
|
public rtengine::NonCopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MultiDiagonalSymmetricMatrix(int Dimension, int NumberOfDiagonalsInLowerTriangle);
|
MultiDiagonalSymmetricMatrix(int Dimension, int NumberOfDiagonalsInLowerTriangle);
|
||||||
MultiDiagonalSymmetricMatrix(const MultiDiagonalSymmetricMatrix&) = delete;
|
|
||||||
~MultiDiagonalSymmetricMatrix();
|
~MultiDiagonalSymmetricMatrix();
|
||||||
|
|
||||||
/* Storage of matrix data, and a function to create memory for Diagonals[index].
|
/* Storage of matrix data, and a function to create memory for Diagonals[index].
|
||||||
@@ -115,11 +117,11 @@ public:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class EdgePreservingDecomposition
|
class EdgePreservingDecomposition :
|
||||||
|
public rtengine::NonCopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
EdgePreservingDecomposition(int width, int height);
|
EdgePreservingDecomposition(int width, int height);
|
||||||
EdgePreservingDecomposition(const EdgePreservingDecomposition&) = delete;
|
|
||||||
~EdgePreservingDecomposition();
|
~EdgePreservingDecomposition();
|
||||||
|
|
||||||
//Create an edge preserving blur of Source. Will create and return, or fill into Blur if not NULL. In place not ok.
|
//Create an edge preserving blur of Source. Will create and return, or fill into Blur if not NULL. In place not ok.
|
||||||
|
@@ -61,13 +61,16 @@
|
|||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
#include <glibmm.h>
|
#include <glibmm.h>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "opthelper.h"
|
#include "opthelper.h"
|
||||||
#include <assert.h>
|
|
||||||
#include "rt_math.h"
|
#include "rt_math.h"
|
||||||
|
#include "noncopyable.h"
|
||||||
|
|
||||||
// Bit representations of flags
|
// Bit representations of flags
|
||||||
enum {
|
enum {
|
||||||
@@ -85,7 +88,8 @@ using LUTd = LUT<double>;
|
|||||||
using LUTuc = LUT<uint8_t>;
|
using LUTuc = LUT<uint8_t>;
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class LUT
|
class LUT :
|
||||||
|
public rtengine::NonCopyable
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
// list of variables ordered to improve cache speed
|
// list of variables ordered to improve cache speed
|
||||||
@@ -167,8 +171,6 @@ public:
|
|||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
LUT(const LUT&) = delete;
|
|
||||||
|
|
||||||
~LUT()
|
~LUT()
|
||||||
{
|
{
|
||||||
if (owner) {
|
if (owner) {
|
||||||
|
@@ -66,8 +66,11 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
|
#include "noncopyable.h"
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class array2D
|
class array2D :
|
||||||
|
public rtengine::NonCopyable
|
||||||
{
|
{
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -167,8 +170,6 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
array2D(const array2D&) = delete;
|
|
||||||
|
|
||||||
// destructor
|
// destructor
|
||||||
~array2D()
|
~array2D()
|
||||||
{
|
{
|
||||||
|
@@ -20,11 +20,13 @@
|
|||||||
#define _CIEIMAGE_H_
|
#define _CIEIMAGE_H_
|
||||||
|
|
||||||
#include "image16.h"
|
#include "image16.h"
|
||||||
|
#include "noncopyable.h"
|
||||||
|
|
||||||
namespace rtengine
|
namespace rtengine
|
||||||
{
|
{
|
||||||
|
|
||||||
class CieImage
|
class CieImage :
|
||||||
|
public NonCopyable
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
bool fromImage;
|
bool fromImage;
|
||||||
@@ -41,8 +43,6 @@ public:
|
|||||||
float** h_p;
|
float** h_p;
|
||||||
|
|
||||||
CieImage (int w, int h);
|
CieImage (int w, int h);
|
||||||
CieImage (const CieImage&) = delete;
|
|
||||||
|
|
||||||
~CieImage ();
|
~CieImage ();
|
||||||
|
|
||||||
//Copies image data in Img into this instance.
|
//Copies image data in Img into this instance.
|
||||||
|
@@ -7,16 +7,16 @@
|
|||||||
|
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "alignedbuffer.h"
|
#include "alignedbuffer.h"
|
||||||
|
#include "noncopyable.h"
|
||||||
|
|
||||||
namespace rtengine
|
namespace rtengine
|
||||||
{
|
{
|
||||||
|
|
||||||
class HaldCLUT
|
class HaldCLUT final :
|
||||||
|
public NonCopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
HaldCLUT();
|
HaldCLUT();
|
||||||
HaldCLUT(const HaldCLUT& other) = delete;
|
|
||||||
HaldCLUT& operator =(const HaldCLUT& other) = delete;
|
|
||||||
~HaldCLUT();
|
~HaldCLUT();
|
||||||
|
|
||||||
bool load(const Glib::ustring& filename);
|
bool load(const Glib::ustring& filename);
|
||||||
@@ -51,14 +51,12 @@ private:
|
|||||||
Glib::ustring clut_profile;
|
Glib::ustring clut_profile;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CLUTStore
|
class CLUTStore final :
|
||||||
|
public NonCopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static CLUTStore& getInstance();
|
static CLUTStore& getInstance();
|
||||||
|
|
||||||
CLUTStore(const CLUTStore& other) = delete;
|
|
||||||
CLUTStore& operator =(const CLUTStore& other) = delete;
|
|
||||||
|
|
||||||
std::shared_ptr<HaldCLUT> getClut(const Glib::ustring& filename);
|
std::shared_ptr<HaldCLUT> getClut(const Glib::ustring& filename);
|
||||||
|
|
||||||
void clearCache();
|
void clearCache();
|
||||||
|
@@ -22,15 +22,17 @@
|
|||||||
#define CPLX_WAVELET_DEC_H_INCLUDED
|
#define CPLX_WAVELET_DEC_H_INCLUDED
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <math.h>
|
#include <cmath>
|
||||||
|
|
||||||
#include "cplx_wavelet_level.h"
|
#include "cplx_wavelet_level.h"
|
||||||
#include "cplx_wavelet_filter_coeffs.h"
|
#include "cplx_wavelet_filter_coeffs.h"
|
||||||
|
#include "noncopyable.h"
|
||||||
|
|
||||||
namespace rtengine
|
namespace rtengine
|
||||||
{
|
{
|
||||||
|
|
||||||
class wavelet_decomposition
|
class wavelet_decomposition :
|
||||||
|
public NonCopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -58,8 +60,6 @@ public:
|
|||||||
template<typename E>
|
template<typename E>
|
||||||
wavelet_decomposition(E * src, int width, int height, int maxlvl, int subsampling, int skipcrop = 1, int numThreads = 1, int Daub4Len = 6);
|
wavelet_decomposition(E * src, int width, int height, int maxlvl, int subsampling, int skipcrop = 1, int numThreads = 1, int Daub4Len = 6);
|
||||||
|
|
||||||
wavelet_decomposition(const wavelet_decomposition&) = delete;
|
|
||||||
|
|
||||||
~wavelet_decomposition();
|
~wavelet_decomposition();
|
||||||
|
|
||||||
internal_type ** level_coeffs(int level) const
|
internal_type ** level_coeffs(int level) const
|
||||||
|
@@ -26,11 +26,12 @@
|
|||||||
|
|
||||||
#include <glibmm.h>
|
#include <glibmm.h>
|
||||||
|
|
||||||
|
#include "../rtgui/threadutils.h"
|
||||||
|
|
||||||
#include "imagefloat.h"
|
#include "imagefloat.h"
|
||||||
#include "curves.h"
|
#include "curves.h"
|
||||||
#include "colortemp.h"
|
#include "colortemp.h"
|
||||||
|
#include "noncopyable.h"
|
||||||
#include "../rtgui/threadutils.h"
|
|
||||||
|
|
||||||
namespace rtengine
|
namespace rtengine
|
||||||
{
|
{
|
||||||
@@ -145,14 +146,12 @@ private:
|
|||||||
AdobeToneCurve tone_curve;
|
AdobeToneCurve tone_curve;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DCPStore final
|
class DCPStore final :
|
||||||
|
public NonCopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static DCPStore* getInstance();
|
static DCPStore* getInstance();
|
||||||
|
|
||||||
DCPStore(const DCPStore& other) = delete;
|
|
||||||
DCPStore& operator =(const DCPStore& other) = delete;
|
|
||||||
|
|
||||||
void init(const Glib::ustring& rt_profile_dir);
|
void init(const Glib::ustring& rt_profile_dir);
|
||||||
|
|
||||||
bool isValidDCPFileName(const Glib::ustring& filename) const;
|
bool isValidDCPFileName(const Glib::ustring& filename) const;
|
||||||
|
@@ -17,8 +17,9 @@
|
|||||||
* 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 <http://www.gnu.org/licenses/>.
|
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#ifndef JAGGEDARRAY_H
|
#pragma once
|
||||||
#define JAGGEDARRAY_H
|
|
||||||
|
#include "noncopyable.h"
|
||||||
|
|
||||||
namespace rtengine
|
namespace rtengine
|
||||||
{
|
{
|
||||||
@@ -50,7 +51,8 @@ inline void freeJaggedArray (T** const a)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
class JaggedArray
|
class JaggedArray :
|
||||||
|
public NonCopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
JaggedArray (const int W, const int H, const bool initZero = false)
|
JaggedArray (const int W, const int H, const bool initZero = false)
|
||||||
@@ -65,10 +67,6 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JaggedArray (const JaggedArray&) = delete;
|
|
||||||
JaggedArray& operator= (const JaggedArray&) = delete;
|
|
||||||
|
|
||||||
public:
|
|
||||||
operator T** const () const
|
operator T** const () const
|
||||||
{
|
{
|
||||||
return a;
|
return a;
|
||||||
@@ -85,5 +83,3 @@ template<class T>
|
|||||||
void freeJaggedArray (JaggedArray<T>&);
|
void freeJaggedArray (JaggedArray<T>&);
|
||||||
|
|
||||||
} // rtengine
|
} // rtengine
|
||||||
|
|
||||||
#endif // JAGGEDARRAY_H
|
|
||||||
|
34
rtengine/noncopyable.h
Normal file
34
rtengine/noncopyable.h
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of RawTherapee.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016 Flössie <floessie.mail@gmail.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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace rtengine
|
||||||
|
{
|
||||||
|
|
||||||
|
class NonCopyable
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NonCopyable() = default;
|
||||||
|
|
||||||
|
explicit NonCopyable(const NonCopyable&) = delete;
|
||||||
|
NonCopyable& operator =(const NonCopyable&) = delete;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
@@ -19,11 +19,13 @@
|
|||||||
#ifndef _PROCPARAMS_H_
|
#ifndef _PROCPARAMS_H_
|
||||||
#define _PROCPARAMS_H_
|
#define _PROCPARAMS_H_
|
||||||
|
|
||||||
#include <glibmm.h>
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
|
#include <glibmm.h>
|
||||||
#include <lcms2.h>
|
#include <lcms2.h>
|
||||||
|
|
||||||
#include "LUT.h"
|
#include "LUT.h"
|
||||||
#include "coord.h"
|
#include "coord.h"
|
||||||
|
|
||||||
@@ -1363,7 +1365,7 @@ class PartialProfile
|
|||||||
public:
|
public:
|
||||||
rtengine::procparams::ProcParams* pparams;
|
rtengine::procparams::ProcParams* pparams;
|
||||||
ParamsEdited* pedited;
|
ParamsEdited* pedited;
|
||||||
PartialProfile& operator=(PartialProfile& rhs)
|
PartialProfile& operator =(const PartialProfile& rhs)
|
||||||
{
|
{
|
||||||
pparams = rhs.pparams;
|
pparams = rhs.pparams;
|
||||||
pedited = rhs.pedited;
|
pedited = rhs.pedited;
|
||||||
|
@@ -20,8 +20,10 @@
|
|||||||
#define __RAWIMAGE_H
|
#define __RAWIMAGE_H
|
||||||
|
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
|
||||||
#include "dcraw.h"
|
#include "dcraw.h"
|
||||||
#include "imageio.h"
|
#include "imageio.h"
|
||||||
|
#include "noncopyable.h"
|
||||||
|
|
||||||
namespace rtengine
|
namespace rtengine
|
||||||
{
|
{
|
||||||
@@ -32,7 +34,8 @@ struct badPix {
|
|||||||
badPix( uint16_t xc, uint16_t yc ): x(xc), y(yc) {}
|
badPix( uint16_t xc, uint16_t yc ): x(xc), y(yc) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class PixelsMap
|
class PixelsMap :
|
||||||
|
public NonCopyable
|
||||||
{
|
{
|
||||||
int w; // line width in base_t units
|
int w; // line width in base_t units
|
||||||
int h; // height
|
int h; // height
|
||||||
@@ -49,8 +52,6 @@ public:
|
|||||||
memset(pm, 0, h * w * base_t_size );
|
memset(pm, 0, h * w * base_t_size );
|
||||||
}
|
}
|
||||||
|
|
||||||
PixelsMap(const PixelsMap&) = delete;
|
|
||||||
|
|
||||||
~PixelsMap()
|
~PixelsMap()
|
||||||
{
|
{
|
||||||
delete [] pm;
|
delete [] pm;
|
||||||
|
@@ -21,11 +21,13 @@
|
|||||||
|
|
||||||
#include "imagefloat.h"
|
#include "imagefloat.h"
|
||||||
#include "image16.h"
|
#include "image16.h"
|
||||||
|
#include "noncopyable.h"
|
||||||
|
|
||||||
namespace rtengine
|
namespace rtengine
|
||||||
{
|
{
|
||||||
|
|
||||||
class SHMap
|
class SHMap :
|
||||||
|
public NonCopyable
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -33,8 +35,6 @@ public:
|
|||||||
float max_f, min_f, avg;
|
float max_f, min_f, avg;
|
||||||
|
|
||||||
SHMap (int w, int h, bool multiThread);
|
SHMap (int w, int h, bool multiThread);
|
||||||
SHMap(const SHMap&) = delete;
|
|
||||||
|
|
||||||
~SHMap ();
|
~SHMap ();
|
||||||
|
|
||||||
void update (Imagefloat* img, double radius, double lumi[3], bool hq, int skip);
|
void update (Imagefloat* img, double radius, double lumi[3], bool hq, int skip);
|
||||||
|
@@ -28,7 +28,9 @@
|
|||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <glibmm.h>
|
#include <glibmm.h>
|
||||||
|
|
||||||
#include "../rtengine/procparams.h"
|
#include "../rtengine/procparams.h"
|
||||||
|
#include "../rtengine/noncopyable.h"
|
||||||
|
|
||||||
class CacheImageData;
|
class CacheImageData;
|
||||||
|
|
||||||
@@ -178,7 +180,8 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// a class representing a single tag
|
// a class representing a single tag
|
||||||
class Tag
|
class Tag :
|
||||||
|
public rtengine::NonCopyable
|
||||||
{
|
{
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -202,7 +205,6 @@ public:
|
|||||||
Tag (TagDirectory* parent, const TagAttrib* attr, unsigned char *data, TagType t);
|
Tag (TagDirectory* parent, const TagAttrib* attr, unsigned char *data, TagType t);
|
||||||
Tag (TagDirectory* parent, const TagAttrib* attr, int data, TagType t); // create a new tag from array (used
|
Tag (TagDirectory* parent, const TagAttrib* attr, int data, TagType t); // create a new tag from array (used
|
||||||
Tag (TagDirectory* parent, const TagAttrib* attr, const char* data); // create a new tag from array (used
|
Tag (TagDirectory* parent, const TagAttrib* attr, const char* data); // create a new tag from array (used
|
||||||
Tag(const Tag&) = delete;
|
|
||||||
|
|
||||||
~Tag ();
|
~Tag ();
|
||||||
void initType (unsigned char *data, TagType type);
|
void initType (unsigned char *data, TagType type);
|
||||||
|
@@ -24,11 +24,14 @@
|
|||||||
|
|
||||||
#include <glibmm/ustring.h>
|
#include <glibmm/ustring.h>
|
||||||
|
|
||||||
|
#include "../rtengine/noncopyable.h"
|
||||||
|
|
||||||
#include "threadutils.h"
|
#include "threadutils.h"
|
||||||
|
|
||||||
class Thumbnail;
|
class Thumbnail;
|
||||||
|
|
||||||
class CacheManager
|
class CacheManager :
|
||||||
|
public rtengine::NonCopyable
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
using Entries = std::map<std::string, Thumbnail*>;
|
using Entries = std::map<std::string, Thumbnail*>;
|
||||||
@@ -41,12 +44,7 @@ private:
|
|||||||
|
|
||||||
void applyCacheSizeLimitation () const;
|
void applyCacheSizeLimitation () const;
|
||||||
|
|
||||||
CacheManager () = default;
|
|
||||||
CacheManager (const CacheManager&) = delete;
|
|
||||||
CacheManager& operator= (const CacheManager&) = delete;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
static CacheManager* getInstance ();
|
static CacheManager* getInstance ();
|
||||||
|
|
||||||
void init ();
|
void init ();
|
||||||
@@ -69,7 +67,6 @@ public:
|
|||||||
const Glib::ustring& fname,
|
const Glib::ustring& fname,
|
||||||
const Glib::ustring& fext,
|
const Glib::ustring& fext,
|
||||||
const Glib::ustring& md5) const;
|
const Glib::ustring& md5) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define cacheMgr CacheManager::getInstance()
|
#define cacheMgr CacheManager::getInstance()
|
||||||
|
@@ -29,7 +29,8 @@
|
|||||||
#define DEBUG(format,args...)
|
#define DEBUG(format,args...)
|
||||||
//#define DEBUG(format,args...) printf("PreviewLoader::%s: " format "\n", __FUNCTION__, ## args)
|
//#define DEBUG(format,args...) printf("PreviewLoader::%s: " format "\n", __FUNCTION__, ## args)
|
||||||
|
|
||||||
class PreviewLoader::Impl
|
class PreviewLoader::Impl :
|
||||||
|
public rtengine::NonCopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
struct Job {
|
struct Job {
|
||||||
@@ -81,8 +82,6 @@ public:
|
|||||||
threadPool_ = new Glib::ThreadPool(threadCount, 0);
|
threadPool_ = new Glib::ThreadPool(threadCount, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
Impl(const Impl&) = delete;
|
|
||||||
|
|
||||||
Glib::ThreadPool* threadPool_;
|
Glib::ThreadPool* threadPool_;
|
||||||
MyMutex mutex_;
|
MyMutex mutex_;
|
||||||
JobSet jobs_;
|
JobSet jobs_;
|
||||||
|
@@ -21,11 +21,17 @@
|
|||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <glibmm.h>
|
#include <glibmm.h>
|
||||||
|
|
||||||
|
#include "../rtengine/noncopyable.h"
|
||||||
|
|
||||||
#include "filebrowserentry.h"
|
#include "filebrowserentry.h"
|
||||||
|
|
||||||
class PreviewLoaderListener
|
class PreviewLoaderListener
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
virtual ~PreviewLoaderListener()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief a preview is ready
|
* @brief a preview is ready
|
||||||
@@ -33,20 +39,22 @@ public:
|
|||||||
* @param dir_id directory ID this is for
|
* @param dir_id directory ID this is for
|
||||||
* @param fd entry
|
* @param fd entry
|
||||||
*/
|
*/
|
||||||
virtual void previewReady (int dir_id, FileBrowserEntry* fd) {}
|
virtual void previewReady(int dir_id, FileBrowserEntry* fd)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief all previews have finished loading
|
* @brief all previews have finished loading
|
||||||
*/
|
*/
|
||||||
virtual void previewsFinished (int dir_id_) {}
|
virtual void previewsFinished(int dir_id_)
|
||||||
|
{
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class PreviewLoader
|
class PreviewLoader :
|
||||||
|
public rtengine::NonCopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
PreviewLoader(const PreviewLoader&) = delete;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Singleton entry point.
|
* @brief Singleton entry point.
|
||||||
*
|
*
|
||||||
|
@@ -21,11 +21,14 @@
|
|||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <glibmm.h>
|
||||||
|
|
||||||
#include "../rtengine/rtengine.h"
|
#include "../rtengine/rtengine.h"
|
||||||
|
#include "../rtengine/noncopyable.h"
|
||||||
|
|
||||||
#include "threadutils.h"
|
#include "threadutils.h"
|
||||||
#include "paramsedited.h"
|
#include "paramsedited.h"
|
||||||
#include "guiutils.h"
|
#include "guiutils.h"
|
||||||
#include <glibmm.h>
|
|
||||||
|
|
||||||
|
|
||||||
/** @brief This will implement callback functions for the ProfileStore
|
/** @brief This will implement callback functions for the ProfileStore
|
||||||
@@ -118,7 +121,8 @@ public:
|
|||||||
* This store can be queried by the GUI to display a Tree of the profiles available
|
* This store can be queried by the GUI to display a Tree of the profiles available
|
||||||
* in the user's and system's profile directory and subdirectories.
|
* in the user's and system's profile directory and subdirectories.
|
||||||
*/
|
*/
|
||||||
class ProfileStore
|
class ProfileStore :
|
||||||
|
public rtengine::NonCopyable
|
||||||
{
|
{
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@@ -176,9 +180,8 @@ private:
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
ProfileStore();
|
ProfileStore();
|
||||||
ProfileStore (const ProfileStore&) = delete;
|
|
||||||
|
|
||||||
~ProfileStore();
|
~ProfileStore();
|
||||||
|
|
||||||
bool init ();
|
bool init ();
|
||||||
void parseProfiles ();
|
void parseProfiles ();
|
||||||
int findFolderId(const Glib::ustring &path);
|
int findFolderId(const Glib::ustring &path);
|
||||||
|
@@ -27,6 +27,8 @@
|
|||||||
|
|
||||||
#include <glibmm/threads.h>
|
#include <glibmm/threads.h>
|
||||||
|
|
||||||
|
#include "../rtengine/noncopyable.h"
|
||||||
|
|
||||||
#if STRICT_MUTEX && NDEBUG
|
#if STRICT_MUTEX && NDEBUG
|
||||||
using MyMutexBase = Glib::Threads::Mutex;
|
using MyMutexBase = Glib::Threads::Mutex;
|
||||||
#else
|
#else
|
||||||
@@ -41,15 +43,13 @@ using MyMutexBase = Glib::Threads::RecMutex;
|
|||||||
* It will behave like Glib::Threads::RecMutex (STRICT_MUTEX=0) or Glib::Threads::Mutex (STRICT_MUTEX=1).
|
* It will behave like Glib::Threads::RecMutex (STRICT_MUTEX=0) or Glib::Threads::Mutex (STRICT_MUTEX=1).
|
||||||
* Debug builds with strict mutexes, will emit a message and crash immediately upon recursive locking.
|
* Debug builds with strict mutexes, will emit a message and crash immediately upon recursive locking.
|
||||||
*/
|
*/
|
||||||
class MyMutex : private MyMutexBase
|
class MyMutex :
|
||||||
|
public rtengine::NonCopyable,
|
||||||
|
private MyMutexBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
class MyLock;
|
class MyLock;
|
||||||
|
|
||||||
MyMutex () = default;
|
|
||||||
MyMutex (const MyMutex&) = delete;
|
|
||||||
MyMutex& operator= (const MyMutex&) = delete;
|
|
||||||
|
|
||||||
void lock ();
|
void lock ();
|
||||||
bool trylock ();
|
bool trylock ();
|
||||||
void unlock ();
|
void unlock ();
|
||||||
@@ -62,7 +62,8 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
class MyMutex::MyLock
|
class MyMutex::MyLock :
|
||||||
|
public rtengine::NonCopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit MyLock (MyMutex& mutex);
|
explicit MyLock (MyMutex& mutex);
|
||||||
@@ -71,9 +72,6 @@ public:
|
|||||||
|
|
||||||
~MyLock ();
|
~MyLock ();
|
||||||
|
|
||||||
MyLock (const MyLock&) = delete;
|
|
||||||
MyLock& operator= (const MyLock&) = delete;
|
|
||||||
|
|
||||||
void acquire ();
|
void acquire ();
|
||||||
bool try_acquire ();
|
bool try_acquire ();
|
||||||
void release ();
|
void release ();
|
||||||
@@ -86,13 +84,10 @@ private:
|
|||||||
/**
|
/**
|
||||||
* @brief Custom implementation to replace Glib::Threads::RWLock
|
* @brief Custom implementation to replace Glib::Threads::RWLock
|
||||||
*/
|
*/
|
||||||
class MyRWMutex
|
class MyRWMutex :
|
||||||
|
public rtengine::NonCopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MyRWMutex () = default;
|
|
||||||
MyRWMutex (const MyRWMutex&) = delete;
|
|
||||||
MyRWMutex& operator= (const MyRWMutex&) = delete;
|
|
||||||
|
|
||||||
friend class MyReaderLock;
|
friend class MyReaderLock;
|
||||||
friend class MyWriterLock;
|
friend class MyWriterLock;
|
||||||
|
|
||||||
@@ -113,14 +108,12 @@ private:
|
|||||||
/**
|
/**
|
||||||
* @brief Custom implementation to replace Glib::Threads::RWLock::ReaderLock
|
* @brief Custom implementation to replace Glib::Threads::RWLock::ReaderLock
|
||||||
*/
|
*/
|
||||||
class MyReaderLock
|
class MyReaderLock :
|
||||||
|
public rtengine::NonCopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
~MyReaderLock ();
|
~MyReaderLock ();
|
||||||
|
|
||||||
MyReaderLock (const MyReaderLock&) = delete;
|
|
||||||
MyReaderLock& operator= (const MyReaderLock&) = delete;
|
|
||||||
|
|
||||||
#if !TRACE_MYRWMUTEX
|
#if !TRACE_MYRWMUTEX
|
||||||
explicit MyReaderLock (MyRWMutex& mutex);
|
explicit MyReaderLock (MyRWMutex& mutex);
|
||||||
|
|
||||||
@@ -141,14 +134,12 @@ private:
|
|||||||
/**
|
/**
|
||||||
* @brief Custom implementation to replace Glib::Threads::RWLock::WriterLock
|
* @brief Custom implementation to replace Glib::Threads::RWLock::WriterLock
|
||||||
*/
|
*/
|
||||||
class MyWriterLock
|
class MyWriterLock :
|
||||||
|
public rtengine::NonCopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
~MyWriterLock ();
|
~MyWriterLock ();
|
||||||
|
|
||||||
MyWriterLock (const MyWriterLock&) = delete;
|
|
||||||
MyWriterLock& operator= (const MyWriterLock&) = delete;
|
|
||||||
|
|
||||||
#if !TRACE_MYRWMUTEX
|
#if !TRACE_MYRWMUTEX
|
||||||
explicit MyWriterLock (MyRWMutex& mutex);
|
explicit MyWriterLock (MyRWMutex& mutex);
|
||||||
|
|
||||||
|
@@ -30,8 +30,8 @@
|
|||||||
#define DEBUG(format,args...)
|
#define DEBUG(format,args...)
|
||||||
//#define DEBUG(format,args...) printf("ThumbImageUpdate::%s: " format "\n", __FUNCTION__, ## args)
|
//#define DEBUG(format,args...) printf("ThumbImageUpdate::%s: " format "\n", __FUNCTION__, ## args)
|
||||||
|
|
||||||
class
|
class ThumbImageUpdater::Impl :
|
||||||
ThumbImageUpdater::Impl
|
public rtengine::NonCopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -78,8 +78,6 @@ public:
|
|||||||
threadPool_ = new Glib::ThreadPool(threadCount, 0);
|
threadPool_ = new Glib::ThreadPool(threadCount, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
Impl(const Impl&) = delete;
|
|
||||||
|
|
||||||
Glib::ThreadPool* threadPool_;
|
Glib::ThreadPool* threadPool_;
|
||||||
|
|
||||||
// Need to be a Glib::Threads::Mutex because used in a Glib::Threads::Cond object...
|
// Need to be a Glib::Threads::Mutex because used in a Glib::Threads::Cond object...
|
||||||
|
@@ -20,14 +20,19 @@
|
|||||||
#define _THUMBIMAGEUPDATER_
|
#define _THUMBIMAGEUPDATER_
|
||||||
|
|
||||||
#include <glibmm.h>
|
#include <glibmm.h>
|
||||||
#include "../rtengine/rtengine.h"
|
|
||||||
#include "thumbbrowserentrybase.h"
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
|
#include "../rtengine/rtengine.h"
|
||||||
|
#include "../rtengine/noncopyable.h"
|
||||||
|
|
||||||
|
#include "thumbbrowserentrybase.h"
|
||||||
|
|
||||||
class ThumbImageUpdateListener
|
class ThumbImageUpdateListener
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
virtual ~ThumbImageUpdateListener()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Called when thumbnail image is update
|
* @brief Called when thumbnail image is update
|
||||||
@@ -38,16 +43,15 @@ public:
|
|||||||
*
|
*
|
||||||
* @note no locks are held when called back
|
* @note no locks are held when called back
|
||||||
*/
|
*/
|
||||||
virtual void updateImage (rtengine::IImage8* img, double scale, rtengine::procparams::CropParams cropParams) {}
|
virtual void updateImage(rtengine::IImage8* img, double scale, rtengine::procparams::CropParams cropParams)
|
||||||
|
{
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class ThumbImageUpdater
|
class ThumbImageUpdater :
|
||||||
|
public rtengine::NonCopyable
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ThumbImageUpdater(const ThumbImageUpdater&) = delete;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Singleton entry point.
|
* @brief Singleton entry point.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user