Merge branch 'dev' into spot-removal-tool

This commit is contained in:
Hombre
2019-03-18 22:35:11 +01:00
2691 changed files with 93967 additions and 238984 deletions

View File

@@ -19,6 +19,8 @@
#ifndef _IMPROCCOORDINATOR_H_
#define _IMPROCCOORDINATOR_H_
#include <memory>
#include "rtengine.h"
#include "improcfun.h"
#include "image8.h"
@@ -55,7 +57,7 @@ class ImProcCoordinator : public StagedImageProcessor
protected:
Imagefloat *orig_prev;
Imagefloat *oprevi;
Imagefloat *spotprevi;
Imagefloat *spot_prev;
LabImage *oprevl;
LabImage *nprevl;
Imagefloat *fattal_11_dcrop_cache; // global cache for ToneMapFattal02 used in 1:1 detail windows (except when denoise is active)
@@ -65,21 +67,19 @@ protected:
ImageSource* imgsrc;
SHMap* shmap;
ColorTemp currWB;
ColorTemp autoWB;
double lastAwbEqual;
double lastAwbTempBias;
ImProcFunctions ipf;
PreviewProps previewProps;
Glib::ustring monitorProfile;
RenderingIntent monitorIntent;
bool softProof;
bool gamutCheck;
bool sharpMask;
int scale;
bool highDetailPreprocessComputed;
@@ -161,6 +161,9 @@ protected:
AutoCamListener* acListener;
AutoBWListener* abwListener;
AutoWBListener* awbListener;
FlatFieldAutoClipListener *flatFieldAutoClipListener;
AutoContrastListener *bayerAutoContrastListener;
AutoContrastListener *xtransAutoContrastListener;
FrameCountListener *frameCountListener;
ImageTypeListener *imageTypeListener;
@@ -182,10 +185,10 @@ protected:
void reallocAll ();
void updateLRGBHistograms ();
void setScale (int prevscale);
void updatePreviewImage (int todo, Crop* cropCall = nullptr);
void updatePreviewImage (int todo, bool panningRelatedChange);
MyMutex mProcessing;
ProcParams params;
const std::unique_ptr<ProcParams> params;
// for optimization purpose, the output profile, output rendering intent and
// output BPC will trigger a regeneration of the profile on parameter change only
@@ -200,7 +203,7 @@ protected:
MyMutex paramsUpdateMutex;
int changeSinceLast;
bool updaterRunning;
ProcParams nextParams;
const std::unique_ptr<ProcParams> nextParams;
bool destroying;
bool utili;
bool autili;
@@ -214,88 +217,91 @@ protected:
void process ();
float colourToningSatLimit;
float colourToningSatLimitOpacity;
bool highQualityComputed;
cmsHTRANSFORM customTransformIn;
cmsHTRANSFORM customTransformOut;
ImProcFunctions ipf;
public:
ImProcCoordinator ();
~ImProcCoordinator ();
~ImProcCoordinator () override;
void assign (ImageSource* imgsrc);
void getParams (procparams::ProcParams* dst)
{
*dst = params;
}
void getParams (procparams::ProcParams* dst) override;
void startProcessing (int changeCode);
ProcParams* beginUpdateParams ();
void endUpdateParams (ProcEvent change); // must be called after beginUpdateParams, triggers update
void endUpdateParams (int changeFlags);
void stopProcessing ();
void startProcessing (int changeCode) override;
ProcParams* beginUpdateParams () override;
void endUpdateParams (ProcEvent change) override; // must be called after beginUpdateParams, triggers update
void endUpdateParams (int changeFlags) override;
void stopProcessing () override;
void setPreviewScale (int scale)
void setPreviewScale (int scale) override
{
setScale (scale);
}
int getPreviewScale ()
int getPreviewScale () override
{
return scale;
}
//void fullUpdatePreviewImage ();
int getFullWidth ()
int getFullWidth () override
{
return fullw;
}
int getFullHeight ()
int getFullHeight () override
{
return fullh;
}
int getPreviewWidth ()
int getPreviewWidth () override
{
return pW;
}
int getPreviewHeight ()
int getPreviewHeight () override
{
return pH;
}
DetailedCrop* createCrop (::EditDataProvider *editDataProvider, bool isDetailWindow);
DetailedCrop* createCrop (::EditDataProvider *editDataProvider, bool isDetailWindow) override;
bool getAutoWB (double& temp, double& green, double equal, double tempBias);
void getCamWB (double& temp, double& green);
void getSpotWB (int x, int y, int rectSize, double& temp, double& green);
void getAutoCrop (double ratio, int &x, int &y, int &w, int &h);
void setMonitorProfile (const Glib::ustring& profile, RenderingIntent intent);
void getMonitorProfile (Glib::ustring& profile, RenderingIntent& intent) const;
void setSoftProofing (bool softProof, bool gamutCheck);
void getSoftProofing (bool &softProof, bool &gamutCheck);
bool updateTryLock ()
bool getAutoWB (double& temp, double& green, double equal, double tempBias) override;
void getCamWB (double& temp, double& green) override;
void getSpotWB (int x, int y, int rectSize, double& temp, double& green) override;
void getAutoCrop (double ratio, int &x, int &y, int &w, int &h) override;
bool getHighQualComputed() override;
void setHighQualComputed() override;
void setMonitorProfile (const Glib::ustring& profile, RenderingIntent intent) override;
void getMonitorProfile (Glib::ustring& profile, RenderingIntent& intent) const override;
void setSoftProofing (bool softProof, bool gamutCheck) override;
void getSoftProofing (bool &softProof, bool &gamutCheck) override;
void setSharpMask (bool sharpMask) override;
bool updateTryLock () override
{
return updaterThreadStart.trylock();
}
void updateUnLock ()
void updateUnLock () override
{
updaterThreadStart.unlock();
}
void setProgressListener (ProgressListener* pl)
void setProgressListener (ProgressListener* pl) override
{
plistener = pl;
}
void setPreviewImageListener (PreviewImageListener* il)
void setPreviewImageListener (PreviewImageListener* il) override
{
imageListener = il;
}
void setSizeListener (SizeListener* il)
void setSizeListener (SizeListener* il) override
{
sizeListeners.push_back (il);
}
void delSizeListener (SizeListener* il)
void delSizeListener (SizeListener* il) override
{
std::vector<SizeListener*>::iterator it = std::find (sizeListeners.begin(), sizeListeners.end(), il);
@@ -303,60 +309,84 @@ public:
sizeListeners.erase (it);
}
}
void setAutoExpListener (AutoExpListener* ael)
void setAutoExpListener (AutoExpListener* ael) override
{
aeListener = ael;
}
void setHistogramListener (HistogramListener *h)
void setHistogramListener (HistogramListener *h) override
{
hListener = h;
}
void setAutoCamListener (AutoCamListener* acl)
void setAutoCamListener (AutoCamListener* acl) override
{
acListener = acl;
}
void setAutoBWListener (AutoBWListener* abw)
void setAutoBWListener (AutoBWListener* abw) override
{
abwListener = abw;
}
void setAutoWBListener (AutoWBListener* awb)
void setAutoWBListener (AutoWBListener* awb) override
{
awbListener = awb;
}
void setAutoColorTonListener (AutoColorTonListener* bwct)
void setAutoColorTonListener (AutoColorTonListener* bwct) override
{
actListener = bwct;
}
void setAutoChromaListener (AutoChromaListener* adn)
void setAutoChromaListener (AutoChromaListener* adn) override
{
adnListener = adn;
}
void setRetinexListener (RetinexListener* adh)
void setRetinexListener (RetinexListener* adh) override
{
dehaListener = adh;
}
void setWaveletListener (WaveletListener* awa)
void setWaveletListener (WaveletListener* awa) override
{
awavListener = awa;
}
void setFrameCountListener (FrameCountListener* fcl)
void setFrameCountListener (FrameCountListener* fcl) override
{
frameCountListener = fcl;
}
void setImageTypeListener (ImageTypeListener* itl)
void setFlatFieldAutoClipListener (FlatFieldAutoClipListener* ffacl) override
{
flatFieldAutoClipListener = ffacl;
}
void setBayerAutoContrastListener (AutoContrastListener* acl) override
{
bayerAutoContrastListener = acl;
}
void setXtransAutoContrastListener (AutoContrastListener* acl) override
{
xtransAutoContrastListener = acl;
}
void setImageTypeListener (ImageTypeListener* itl) override
{
imageTypeListener = itl;
}
void saveInputICCReference (const Glib::ustring& fname, bool apply_wb);
void saveInputICCReference (const Glib::ustring& fname, bool apply_wb) override;
InitialImage* getInitialImage ()
InitialImage* getInitialImage () override
{
return imgsrc;
}
cmsHTRANSFORM& getCustomTransformIn ()
{
return customTransformIn;
}
cmsHTRANSFORM& getCustomTransformOut ()
{
return customTransformOut;
}
struct DenoiseInfoStore {
DenoiseInfoStore () : chM (0), max_r{}, max_b{}, ch_M{}, valid (false) {}
float chM;