Format with astyle 3. changed files

This commit is contained in:
Desmis 2017-08-17 09:38:27 +02:00
parent 986bbaa2cf
commit db17c68f1e
13 changed files with 1419 additions and 1376 deletions

File diff suppressed because it is too large Load Diff

View File

@ -28,12 +28,12 @@ namespace rtengine
class Ciecam02 class Ciecam02
{ {
private: private:
static double d_factor( double f, double la ); static double d_factor ( double f, double la );
static float d_factorfloat( float f, float la ); static float d_factorfloat ( float f, float la );
static double calculate_fl_from_la_ciecam02( double la ); static double calculate_fl_from_la_ciecam02 ( double la );
static float calculate_fl_from_la_ciecam02float( float la ); static float calculate_fl_from_la_ciecam02float ( float la );
static double achromatic_response_to_white( double x, double y, double z, double d, double fl, double nbb, int gamu ); static double achromatic_response_to_white ( double x, double y, double z, double d, double fl, double nbb, int gamu );
static float achromatic_response_to_whitefloat( float x, float y, float z, float d, float fl, float nbb, int gamu ); static float achromatic_response_to_whitefloat ( float x, float y, float z, float d, float fl, float nbb, int gamu );
static void xyz_to_cat02 ( double &r, double &g, double &b, double x, double y, double z, int gamu ); static void xyz_to_cat02 ( double &r, double &g, double &b, double x, double y, double z, int gamu );
static void cat02_to_hpe ( double &rh, double &gh, double &bh, double r, double g, double b, int gamu ); static void cat02_to_hpe ( double &rh, double &gh, double &bh, double r, double g, double b, int gamu );
static void cat02_to_xyz ( double &x, double &y, double &z, double r, double g, double b, int gamu ); static void cat02_to_xyz ( double &x, double &y, double &z, double r, double g, double b, int gamu );
@ -45,97 +45,97 @@ private:
#ifdef __SSE2__ #ifdef __SSE2__
static void xyz_to_cat02float ( vfloat &r, vfloat &g, vfloat &b, vfloat x, vfloat y, vfloat z ); static void xyz_to_cat02float ( vfloat &r, vfloat &g, vfloat &b, vfloat x, vfloat y, vfloat z );
static void cat02_to_hpefloat ( vfloat &rh, vfloat &gh, vfloat &bh, vfloat r, vfloat g, vfloat b ); static void cat02_to_hpefloat ( vfloat &rh, vfloat &gh, vfloat &bh, vfloat r, vfloat g, vfloat b );
static vfloat nonlinear_adaptationfloat( vfloat c, vfloat fl ); static vfloat nonlinear_adaptationfloat ( vfloat c, vfloat fl );
#endif #endif
static void Aab_to_rgb( double &r, double &g, double &b, double A, double aa, double bb, double nbb ); static void Aab_to_rgb ( double &r, double &g, double &b, double A, double aa, double bb, double nbb );
static void calculate_ab( double &aa, double &bb, double h, double e, double t, double nbb, double a ); static void calculate_ab ( double &aa, double &bb, double h, double e, double t, double nbb, double a );
static double nonlinear_adaptation( double c, double fl ); static double nonlinear_adaptation ( double c, double fl );
static float nonlinear_adaptationfloat( float c, float fl ); static float nonlinear_adaptationfloat ( float c, float fl );
static double inverse_nonlinear_adaptation( double c, double fl ); static double inverse_nonlinear_adaptation ( double c, double fl );
static float inverse_nonlinear_adaptationfloat( float c, float fl ); static float inverse_nonlinear_adaptationfloat ( float c, float fl );
static void calculate_abfloat( float &aa, float &bb, float h, float e, float t, float nbb, float a ); static void calculate_abfloat ( float &aa, float &bb, float h, float e, float t, float nbb, float a );
static void Aab_to_rgbfloat( float &r, float &g, float &b, float A, float aa, float bb, float nbb ); static void Aab_to_rgbfloat ( float &r, float &g, float &b, float A, float aa, float bb, float nbb );
static void hpe_to_xyzfloat ( float &x, float &y, float &z, float r, float g, float b ); static void hpe_to_xyzfloat ( float &x, float &y, float &z, float r, float g, float b );
static void cat02_to_xyzfloat ( float &x, float &y, float &z, float r, float g, float b, int gamu ); static void cat02_to_xyzfloat ( float &x, float &y, float &z, float r, float g, float b, int gamu );
#ifdef __SSE2__ #ifdef __SSE2__
static vfloat inverse_nonlinear_adaptationfloat( vfloat c, vfloat fl ); static vfloat inverse_nonlinear_adaptationfloat ( vfloat c, vfloat fl );
static void calculate_abfloat( vfloat &aa, vfloat &bb, vfloat h, vfloat e, vfloat t, vfloat nbb, vfloat a ); static void calculate_abfloat ( vfloat &aa, vfloat &bb, vfloat h, vfloat e, vfloat t, vfloat nbb, vfloat a );
static void Aab_to_rgbfloat( vfloat &r, vfloat &g, vfloat &b, vfloat A, vfloat aa, vfloat bb, vfloat nbb ); static void Aab_to_rgbfloat ( vfloat &r, vfloat &g, vfloat &b, vfloat A, vfloat aa, vfloat bb, vfloat nbb );
static void hpe_to_xyzfloat ( vfloat &x, vfloat &y, vfloat &z, vfloat r, vfloat g, vfloat b ); static void hpe_to_xyzfloat ( vfloat &x, vfloat &y, vfloat &z, vfloat r, vfloat g, vfloat b );
static void cat02_to_xyzfloat ( vfloat &x, vfloat &y, vfloat &z, vfloat r, vfloat g, vfloat b ); static void cat02_to_xyzfloat ( vfloat &x, vfloat &y, vfloat &z, vfloat r, vfloat g, vfloat b );
#endif #endif
public: public:
Ciecam02 () {} Ciecam02 () {}
static void curvecolor(double satind, double satval, double &sres, double parsat); static void curvecolor (double satind, double satval, double &sres, double parsat);
static void curvecolorfloat(float satind, float satval, float &sres, float parsat); static void curvecolorfloat (float satind, float satval, float &sres, float parsat);
static void curveJ (double br, double contr, int db, LUTf & outCurve , LUTu & histogram ) ; static void curveJ (double br, double contr, int db, LUTf & outCurve, LUTu & histogram ) ;
static void curveJfloat (float br, float contr, const LUTu & histogram, LUTf & outCurve ) ; static void curveJfloat (float br, float contr, const LUTu & histogram, LUTf & outCurve ) ;
/** /**
* Inverse transform from CIECAM02 JCh to XYZ. * Inverse transform from CIECAM02 JCh to XYZ.
*/ */
static void jch2xyz_ciecam02( double &x, double &y, double &z, static void jch2xyz_ciecam02 ( double &x, double &y, double &z,
double J, double C, double h, double J, double C, double h,
double xw, double yw, double zw, double xw, double yw, double zw,
double yb, double la, double yb, double la,
double f, double c, double nc, int gamu, double n, double nbb, double ncb, double fl, double cz, double d, double aw); double f, double c, double nc, int gamu, double n, double nbb, double ncb, double fl, double cz, double d, double aw);
static void jch2xyz_ciecam02float( float &x, float &y, float &z, static void jch2xyz_ciecam02float ( float &x, float &y, float &z,
float J, float C, float h, float J, float C, float h,
float xw, float yw, float zw, float xw, float yw, float zw,
float f, float c, float nc, int gamu, float n, float nbb, float ncb, float fl, float cz, float d, float aw ); float f, float c, float nc, int gamu, float n, float nbb, float ncb, float fl, float cz, float d, float aw );
#ifdef __SSE2__ #ifdef __SSE2__
static void jch2xyz_ciecam02float( vfloat &x, vfloat &y, vfloat &z, static void jch2xyz_ciecam02float ( vfloat &x, vfloat &y, vfloat &z,
vfloat J, vfloat C, vfloat h, vfloat J, vfloat C, vfloat h,
vfloat xw, vfloat yw, vfloat zw, vfloat xw, vfloat yw, vfloat zw,
vfloat f, vfloat nc, vfloat n, vfloat nbb, vfloat ncb, vfloat fl, vfloat d, vfloat aw, vfloat reccmcz ); vfloat f, vfloat nc, vfloat n, vfloat nbb, vfloat ncb, vfloat fl, vfloat d, vfloat aw, vfloat reccmcz );
#endif #endif
/** /**
* Forward transform from XYZ to CIECAM02 JCh. * Forward transform from XYZ to CIECAM02 JCh.
*/ */
static void initcam1(double gamu, double yb, double pilotd, double f, double la, double xw, double yw, double zw, double &n, double &d, double &nbb, double &ncb, static void initcam1 (double gamu, double yb, double pilotd, double f, double la, double xw, double yw, double zw, double &n, double &d, double &nbb, double &ncb,
double &cz, double &aw, double &wh, double &pfl, double &fl, double &c); double &cz, double &aw, double &wh, double &pfl, double &fl, double &c);
static void initcam2(double gamu, double yb, double pilotd, double f, double la, double xw, double yw, double zw, double &n, double &d, double &nbb, double &ncb, static void initcam2 (double gamu, double yb, double pilotd, double f, double la, double xw, double yw, double zw, double &n, double &d, double &nbb, double &ncb,
double &cz, double &aw, double &fl); double &cz, double &aw, double &fl);
static void initcam1float(float gamu, float yb, float pilotd, float f, float la, float xw, float yw, float zw, float &n, float &d, float &nbb, float &ncb, static void initcam1float (float gamu, float yb, float pilotd, float f, float la, float xw, float yw, float zw, float &n, float &d, float &nbb, float &ncb,
float &cz, float &aw, float &wh, float &pfl, float &fl, float &c); float &cz, float &aw, float &wh, float &pfl, float &fl, float &c);
static void initcam2float(float gamu, float yb, float pilotd, float f, float la, float xw, float yw, float zw, float &n, float &d, float &nbb, float &ncb, static void initcam2float (float gamu, float yb, float pilotd, float f, float la, float xw, float yw, float zw, float &n, float &d, float &nbb, float &ncb,
float &cz, float &aw, float &fl); float &cz, float &aw, float &fl);
static void xyz2jchqms_ciecam02( double &J, double &C, double &h, static void xyz2jchqms_ciecam02 ( double &J, double &C, double &h,
double &Q, double &M, double &s, double &aw, double &fl, double &wh, double &Q, double &M, double &s, double &aw, double &fl, double &wh,
double x, double y, double z, double x, double y, double z,
double xw, double yw, double zw, double xw, double yw, double zw,
double yb, double la, double yb, double la,
double f, double c, double nc, double pilotd, int gamu , double n, double nbb, double ncb, double pfl, double cz, double d ); double f, double c, double nc, double pilotd, int gamu, double n, double nbb, double ncb, double pfl, double cz, double d );
static void xyz2jch_ciecam02float( float &J, float &C, float &h, static void xyz2jch_ciecam02float ( float &J, float &C, float &h,
float aw, float fl, float aw, float fl,
float x, float y, float z, float x, float y, float z,
float xw, float yw, float zw, float xw, float yw, float zw,
float c, float nc, float n, float nbb, float ncb, float cz, float d ); float c, float nc, float n, float nbb, float ncb, float cz, float d );
static void xyz2jchqms_ciecam02float( float &J, float &C, float &h, static void xyz2jchqms_ciecam02float ( float &J, float &C, float &h,
float &Q, float &M, float &s, float aw, float fl, float wh, float &Q, float &M, float &s, float aw, float fl, float wh,
float x, float y, float z, float x, float y, float z,
float xw, float yw, float zw, float xw, float yw, float zw,
float c, float nc, int gamu, float n, float nbb, float ncb, float pfl, float cz, float d ); float c, float nc, int gamu, float n, float nbb, float ncb, float pfl, float cz, float d );
#ifdef __SSE2__ #ifdef __SSE2__
static void xyz2jchqms_ciecam02float( vfloat &J, vfloat &C, vfloat &h, static void xyz2jchqms_ciecam02float ( vfloat &J, vfloat &C, vfloat &h,
vfloat &Q, vfloat &M, vfloat &s, vfloat aw, vfloat fl, vfloat wh, vfloat &Q, vfloat &M, vfloat &s, vfloat aw, vfloat fl, vfloat wh,
vfloat x, vfloat y, vfloat z, vfloat x, vfloat y, vfloat z,
vfloat xw, vfloat yw, vfloat zw, vfloat xw, vfloat yw, vfloat zw,
vfloat c, vfloat nc, vfloat n, vfloat nbb, vfloat ncb, vfloat pfl, vfloat cz, vfloat d ); vfloat c, vfloat nc, vfloat n, vfloat nbb, vfloat ncb, vfloat pfl, vfloat cz, vfloat d );
#endif #endif

View File

@ -33,48 +33,48 @@ namespace rtengine
extern const Settings* settings; extern const Settings* settings;
ImProcCoordinator::ImProcCoordinator () ImProcCoordinator::ImProcCoordinator ()
: orig_prev(nullptr), oprevi(nullptr), oprevl(nullptr), nprevl(nullptr), previmg(nullptr), workimg(nullptr), : orig_prev (nullptr), oprevi (nullptr), oprevl (nullptr), nprevl (nullptr), previmg (nullptr), workimg (nullptr),
ncie(nullptr), imgsrc(nullptr), shmap(nullptr), lastAwbEqual(0.), lastAwbTempBias(0.0), ipf(&params, true), monitorIntent(RI_RELATIVE), ncie (nullptr), imgsrc (nullptr), shmap (nullptr), lastAwbEqual (0.), lastAwbTempBias (0.0), ipf (&params, true), monitorIntent (RI_RELATIVE),
softProof(false), gamutCheck(false), scale(10), highDetailPreprocessComputed(false), highDetailRawComputed(false), softProof (false), gamutCheck (false), scale (10), highDetailPreprocessComputed (false), highDetailRawComputed (false),
allocated(false), bwAutoR(-9000.f), bwAutoG(-9000.f), bwAutoB(-9000.f), CAMMean(NAN), allocated (false), bwAutoR (-9000.f), bwAutoG (-9000.f), bwAutoB (-9000.f), CAMMean (NAN),
hltonecurve(65536), hltonecurve (65536),
shtonecurve(65536), shtonecurve (65536),
tonecurve(65536, 0), //,1); tonecurve (65536, 0), //,1);
lumacurve(32770, 0), // lumacurve[32768] and lumacurve[32769] will be set to 32768 and 32769 later to allow linear interpolation lumacurve (32770, 0), // lumacurve[32768] and lumacurve[32769] will be set to 32768 and 32769 later to allow linear interpolation
chroma_acurve(65536, 0), chroma_acurve (65536, 0),
chroma_bcurve(65536, 0), chroma_bcurve (65536, 0),
satcurve(65536, 0), satcurve (65536, 0),
lhskcurve(65536, 0), lhskcurve (65536, 0),
clcurve(65536, 0), clcurve (65536, 0),
conversionBuffer(1, 1), conversionBuffer (1, 1),
wavclCurve(65536, 0), wavclCurve (65536, 0),
clToningcurve(65536, 0), clToningcurve (65536, 0),
cl2Toningcurve(65536, 0), cl2Toningcurve (65536, 0),
Noisecurve(65536, 0), Noisecurve (65536, 0),
NoiseCCcurve(65536, 0), NoiseCCcurve (65536, 0),
vhist16(65536), vhist16bw(65536), vhist16 (65536), vhist16bw (65536),
lhist16CAM(65536), lhist16CAM (65536),
lhist16CCAM(65536), lhist16CCAM (65536),
lhist16RETI(), lhist16RETI(),
lhist16LClad(65536), lhist16LClad (65536),
histRed(256), histRedRaw(256), histRed (256), histRedRaw (256),
histGreen(256), histGreenRaw(256), histGreen (256), histGreenRaw (256),
histBlue(256), histBlueRaw(256), histBlue (256), histBlueRaw (256),
histLuma(256), histLuma (256),
histToneCurve(256), histToneCurve (256),
histToneCurveBW(256), histToneCurveBW (256),
histLCurve(256), histLCurve (256),
histCCurve(256), histCCurve (256),
histLLCurve(256), histLLCurve (256),
histLCAM(256), histLCAM (256),
histCCAM(256), histCCAM (256),
histClad(256), histClad (256),
bcabhist(256), bcabhist (256),
histChroma(256), histChroma (256),
histLRETI(256), histLRETI (256),
CAMBrightCurveJ(), CAMBrightCurveQ(), CAMBrightCurveJ(), CAMBrightCurveQ(),
@ -82,15 +82,15 @@ ImProcCoordinator::ImProcCoordinator ()
gCurve(), gCurve(),
bCurve(), bCurve(),
ctColorCurve(), ctColorCurve(),
rcurvehist(256), rcurvehistCropped(256), rbeforehist(256), rcurvehist (256), rcurvehistCropped (256), rbeforehist (256),
gcurvehist(256), gcurvehistCropped(256), gbeforehist(256), gcurvehist (256), gcurvehistCropped (256), gbeforehist (256),
bcurvehist(256), bcurvehistCropped(256), bbeforehist(256), bcurvehist (256), bcurvehistCropped (256), bbeforehist (256),
fw(0), fh(0), tr(0), fw (0), fh (0), tr (0),
fullw(1), fullh(1), fullw (1), fullh (1),
pW(-1), pH(-1), pW (-1), pH (-1),
plistener(nullptr), imageListener(nullptr), aeListener(nullptr), acListener(nullptr), abwListener(nullptr), awbListener(nullptr), frameCountListener(nullptr), imageTypeListener(nullptr), actListener(nullptr), adnListener(nullptr), awavListener(nullptr), dehaListener(nullptr), hListener(nullptr), plistener (nullptr), imageListener (nullptr), aeListener (nullptr), acListener (nullptr), abwListener (nullptr), awbListener (nullptr), frameCountListener (nullptr), imageTypeListener (nullptr), actListener (nullptr), adnListener (nullptr), awavListener (nullptr), dehaListener (nullptr), hListener (nullptr),
resultValid(false), lastOutputProfile("BADFOOD"), lastOutputIntent(RI__COUNT), lastOutputBPC(false), thread(nullptr), changeSinceLast(0), updaterRunning(false), destroying(false), utili(false), autili(false), resultValid (false), lastOutputProfile ("BADFOOD"), lastOutputIntent (RI__COUNT), lastOutputBPC (false), thread (nullptr), changeSinceLast (0), updaterRunning (false), destroying (false), utili (false), autili (false),
butili(false), ccutili(false), cclutili(false), clcutili(false), opautili(false), wavcontlutili(false), colourToningSatLimit(0.f), colourToningSatLimitOpacity(0.f) butili (false), ccutili (false), cclutili (false), clcutili (false), opautili (false), wavcontlutili (false), colourToningSatLimit (0.f), colourToningSatLimitOpacity (0.f)
{} {}
void ImProcCoordinator::assign (ImageSource* imgsrc) void ImProcCoordinator::assign (ImageSource* imgsrc)
@ -134,7 +134,7 @@ DetailedCrop* ImProcCoordinator::createCrop (::EditDataProvider *editDataProvid
void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
{ {
MyMutex::MyLock processingLock(mProcessing); MyMutex::MyLock processingLock (mProcessing);
int numofphases = 14; int numofphases = 14;
int readyphase = 0; int readyphase = 0;
@ -165,15 +165,15 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
ColorManagementParams cmp = params.icm; ColorManagementParams cmp = params.icm;
LCurveParams lcur = params.labCurve; LCurveParams lcur = params.labCurve;
if( !highDetailNeeded ) { if ( !highDetailNeeded ) {
// if below 100% magnification, take a fast path // if below 100% magnification, take a fast path
if(rp.bayersensor.method != RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::none] && rp.bayersensor.method != RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::mono]) { if (rp.bayersensor.method != RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::none] && rp.bayersensor.method != RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::mono]) {
rp.bayersensor.method = RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::fast]; rp.bayersensor.method = RAWParams::BayerSensor::methodstring[RAWParams::BayerSensor::fast];
} }
//bayerrp.all_enhance = false; //bayerrp.all_enhance = false;
if(rp.xtranssensor.method != RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::none] && rp.xtranssensor.method != RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::mono]) { if (rp.xtranssensor.method != RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::none] && rp.xtranssensor.method != RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::mono]) {
rp.xtranssensor.method = RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::fast]; rp.xtranssensor.method = RAWParams::XTransSensor::methodstring[RAWParams::XTransSensor::fast];
} }
@ -184,16 +184,16 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
progress ("Applying white balance, color correction & sRGB conversion...", 100 * readyphase / numofphases); progress ("Applying white balance, color correction & sRGB conversion...", 100 * readyphase / numofphases);
if(frameCountListener) { if (frameCountListener) {
frameCountListener->FrameCountChanged(imgsrc->getFrameCount(), params.raw.bayersensor.imageNum); frameCountListener->FrameCountChanged (imgsrc->getFrameCount(), params.raw.bayersensor.imageNum);
} }
// raw auto CA is bypassed if no high detail is needed, so we have to compute it when high detail is needed // raw auto CA is bypassed if no high detail is needed, so we have to compute it when high detail is needed
if ( (todo & M_PREPROC) || (!highDetailPreprocessComputed && highDetailNeeded)) { if ( (todo & M_PREPROC) || (!highDetailPreprocessComputed && highDetailNeeded)) {
imgsrc->setCurrentFrame(params.raw.bayersensor.imageNum); imgsrc->setCurrentFrame (params.raw.bayersensor.imageNum);
imgsrc->preprocess( rp, params.lensProf, params.coarse ); imgsrc->preprocess ( rp, params.lensProf, params.coarse );
imgsrc->getRAWHistogram( histRedRaw, histGreenRaw, histBlueRaw ); imgsrc->getRAWHistogram ( histRedRaw, histGreenRaw, histBlueRaw );
if (highDetailNeeded) { if (highDetailNeeded) {
highDetailPreprocessComputed = true; highDetailPreprocessComputed = true;
@ -214,8 +214,8 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
*/ */
// If high detail (=100%) is newly selected, do a demosaic update, since the last was just with FAST // If high detail (=100%) is newly selected, do a demosaic update, since the last was just with FAST
if(imageTypeListener) { if (imageTypeListener) {
imageTypeListener->imageTypeChanged(imgsrc->isRAW(), imgsrc->getSensorType() == ST_BAYER, imgsrc->getSensorType() == ST_FUJI_XTRANS); imageTypeListener->imageTypeChanged (imgsrc->isRAW(), imgsrc->getSensorType() == ST_BAYER, imgsrc->getSensorType() == ST_FUJI_XTRANS);
} }
if ( (todo & M_RAW) if ( (todo & M_RAW)
@ -225,13 +225,13 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
if (settings->verbose) { if (settings->verbose) {
if (imgsrc->getSensorType() == ST_BAYER) { if (imgsrc->getSensorType() == ST_BAYER) {
printf("Demosaic Bayer image n.%d using method: %s\n", rp.bayersensor.imageNum + 1, rp.bayersensor.method.c_str()); printf ("Demosaic Bayer image n.%d using method: %s\n", rp.bayersensor.imageNum + 1, rp.bayersensor.method.c_str());
} else if (imgsrc->getSensorType() == ST_FUJI_XTRANS) { } else if (imgsrc->getSensorType() == ST_FUJI_XTRANS) {
printf("Demosaic X-Trans image with using method: %s\n", rp.xtranssensor.method.c_str()); printf ("Demosaic X-Trans image with using method: %s\n", rp.xtranssensor.method.c_str());
} }
} }
imgsrc->demosaic( rp);//enabled demosaic imgsrc->demosaic ( rp); //enabled demosaic
// if a demosaic happened we should also call getimage later, so we need to set the M_INIT flag // if a demosaic happened we should also call getimage later, so we need to set the M_INIT flag
todo |= M_INIT; todo |= M_INIT;
@ -242,10 +242,10 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
} }
if (params.retinex.enabled) { if (params.retinex.enabled) {
lhist16RETI(32768); lhist16RETI (32768);
lhist16RETI.clear(); lhist16RETI.clear();
imgsrc->retinexPrepareBuffers(params.icm, params.retinex, conversionBuffer, lhist16RETI); imgsrc->retinexPrepareBuffers (params.icm, params.retinex, conversionBuffer, lhist16RETI);
} }
} }
@ -256,12 +256,12 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
LUTf cdcurve (65536, 0); LUTf cdcurve (65536, 0);
LUTf mapcurve (65536, 0); LUTf mapcurve (65536, 0);
imgsrc->retinexPrepareCurves(params.retinex, cdcurve, mapcurve, dehatransmissionCurve, dehagaintransmissionCurve, dehacontlutili, mapcontlutili, useHsl, lhist16RETI, histLRETI); imgsrc->retinexPrepareCurves (params.retinex, cdcurve, mapcurve, dehatransmissionCurve, dehagaintransmissionCurve, dehacontlutili, mapcontlutili, useHsl, lhist16RETI, histLRETI);
float minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax; float minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax;
imgsrc->retinex( params.icm, params.retinex, params.toneCurve, cdcurve, mapcurve, dehatransmissionCurve, dehagaintransmissionCurve, conversionBuffer, dehacontlutili, mapcontlutili, useHsl, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax, histLRETI);//enabled Retinex imgsrc->retinex ( params.icm, params.retinex, params.toneCurve, cdcurve, mapcurve, dehatransmissionCurve, dehagaintransmissionCurve, conversionBuffer, dehacontlutili, mapcontlutili, useHsl, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax, histLRETI); //enabled Retinex
if(dehaListener) { if (dehaListener) {
dehaListener->minmaxChanged(maxCD, minCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax); dehaListener->minmaxChanged (maxCD, minCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax);
} }
} }
@ -270,7 +270,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
// It has to be done there, because the next 'if' statement will use the value computed here // It has to be done there, because the next 'if' statement will use the value computed here
if (todo & M_AUTOEXP) { if (todo & M_AUTOEXP) {
if (params.toneCurve.autoexp) {// this enabled HLRecovery if (params.toneCurve.autoexp) {// this enabled HLRecovery
if (ToneCurveParams::HLReconstructionNecessary(histRedRaw, histGreenRaw, histBlueRaw) && !params.toneCurve.hrenabled) { if (ToneCurveParams::HLReconstructionNecessary (histRedRaw, histGreenRaw, histBlueRaw) && !params.toneCurve.hrenabled) {
// switching params.toneCurve.hrenabled to true -> shouting in listener's ears! // switching params.toneCurve.hrenabled to true -> shouting in listener's ears!
params.toneCurve.hrenabled = true; params.toneCurve.hrenabled = true;
@ -281,9 +281,9 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
} }
if (todo & (M_INIT | M_LINDENOISE)) { if (todo & (M_INIT | M_LINDENOISE)) {
MyMutex::MyLock initLock(minit); // Also used in crop window MyMutex::MyLock initLock (minit); // Also used in crop window
imgsrc->HLRecovery_Global( params.toneCurve); // this handles Color HLRecovery imgsrc->HLRecovery_Global ( params.toneCurve); // this handles Color HLRecovery
if (settings->verbose) { if (settings->verbose) {
@ -297,16 +297,16 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
} else if (params.wb.method == "Auto") { } else if (params.wb.method == "Auto") {
if (lastAwbEqual != params.wb.equal || lastAwbTempBias != params.wb.tempBias) { if (lastAwbEqual != params.wb.equal || lastAwbTempBias != params.wb.tempBias) {
double rm, gm, bm; double rm, gm, bm;
imgsrc->getAutoWBMultipliers(rm, gm, bm); imgsrc->getAutoWBMultipliers (rm, gm, bm);
if (rm != -1.) { if (rm != -1.) {
autoWB.update(rm, gm, bm, params.wb.equal, params.wb.tempBias); autoWB.update (rm, gm, bm, params.wb.equal, params.wb.tempBias);
lastAwbEqual = params.wb.equal; lastAwbEqual = params.wb.equal;
lastAwbTempBias = params.wb.tempBias; lastAwbTempBias = params.wb.tempBias;
} else { } else {
lastAwbEqual = -1.; lastAwbEqual = -1.;
lastAwbTempBias = 0.0; lastAwbTempBias = 0.0;
autoWB.useDefaults(params.wb.equal); autoWB.useDefaults (params.wb.equal);
} }
//double rr,gg,bb; //double rr,gg,bb;
@ -318,11 +318,12 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
params.wb.temperature = currWB.getTemp (); params.wb.temperature = currWB.getTemp ();
params.wb.green = currWB.getGreen (); params.wb.green = currWB.getGreen ();
if(params.wb.method == "Auto" && awbListener) {
awbListener->WBChanged(params.wb.temperature, params.wb.green); if (params.wb.method == "Auto" && awbListener) {
awbListener->WBChanged (params.wb.temperature, params.wb.green);
} }
int tr = getCoarseBitMask(params.coarse); int tr = getCoarseBitMask (params.coarse);
imgsrc->getFullSize (fw, fh, tr); imgsrc->getFullSize (fw, fh, tr);
@ -377,7 +378,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
} }
} }
*/ */
imgsrc->convertColorSpace(orig_prev, params.icm, currWB); imgsrc->convertColorSpace (orig_prev, params.icm, currWB);
ipf.firstAnalysis (orig_prev, params, vhist16); ipf.firstAnalysis (orig_prev, params, vhist16);
} }
@ -388,42 +389,45 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
// Remove transformation if unneeded // Remove transformation if unneeded
bool needstransform = ipf.needsTransform(); bool needstransform = ipf.needsTransform();
if (!needstransform && !((todo & (M_TRANSFORM | M_RGBCURVE)) && params.dirpyrequalizer.cbdlMethod == "bef" && params.dirpyrequalizer.enabled && !params.colorappearance.enabled) && orig_prev != oprevi) { if (!needstransform && ! ((todo & (M_TRANSFORM | M_RGBCURVE)) && params.dirpyrequalizer.cbdlMethod == "bef" && params.dirpyrequalizer.enabled && !params.colorappearance.enabled) && orig_prev != oprevi) {
delete oprevi; delete oprevi;
oprevi = orig_prev; oprevi = orig_prev;
} }
if ((needstransform || ((todo & (M_TRANSFORM | M_RGBCURVE)) && params.dirpyrequalizer.cbdlMethod == "bef" && params.dirpyrequalizer.enabled && !params.colorappearance.enabled)) ) { if ((needstransform || ((todo & (M_TRANSFORM | M_RGBCURVE)) && params.dirpyrequalizer.cbdlMethod == "bef" && params.dirpyrequalizer.enabled && !params.colorappearance.enabled)) ) {
if(!oprevi || oprevi == orig_prev) if (!oprevi || oprevi == orig_prev) {
oprevi = new Imagefloat (pW, pH); oprevi = new Imagefloat (pW, pH);
}
if (needstransform) if (needstransform)
ipf.transform (orig_prev, oprevi, 0, 0, 0, 0, pW, pH, fw, fh, imgsrc->getMetaData()->getFocalLen(), ipf.transform (orig_prev, oprevi, 0, 0, 0, 0, pW, pH, fw, fh, imgsrc->getMetaData()->getFocalLen(),
imgsrc->getMetaData()->getFocalLen35mm(), imgsrc->getMetaData()->getFocusDist(), imgsrc->getMetaData()->getFNumber(), imgsrc->getRotateDegree(), false); imgsrc->getMetaData()->getFocalLen35mm(), imgsrc->getMetaData()->getFocusDist(), imgsrc->getMetaData()->getFNumber(), imgsrc->getRotateDegree(), false);
else else {
orig_prev->copyData(oprevi); orig_prev->copyData (oprevi);
}
} }
if ((todo & (M_TRANSFORM | M_RGBCURVE)) && params.dirpyrequalizer.cbdlMethod == "bef" && params.dirpyrequalizer.enabled && !params.colorappearance.enabled) { if ((todo & (M_TRANSFORM | M_RGBCURVE)) && params.dirpyrequalizer.cbdlMethod == "bef" && params.dirpyrequalizer.enabled && !params.colorappearance.enabled) {
const int W = oprevi->getWidth(); const int W = oprevi->getWidth();
const int H = oprevi->getHeight(); const int H = oprevi->getHeight();
LabImage labcbdl(W, H); LabImage labcbdl (W, H);
ipf.rgb2lab(*oprevi, labcbdl, params.icm.working); ipf.rgb2lab (*oprevi, labcbdl, params.icm.working);
ipf.dirpyrequalizer (&labcbdl, scale); ipf.dirpyrequalizer (&labcbdl, scale);
ipf.lab2rgb(labcbdl, *oprevi, params.icm.working); ipf.lab2rgb (labcbdl, *oprevi, params.icm.working);
} }
readyphase++; readyphase++;
progress ("Preparing shadow/highlight map...", 100 * readyphase / numofphases); progress ("Preparing shadow/highlight map...", 100 * readyphase / numofphases);
if ((todo & M_BLURMAP) && params.sh.enabled) { if ((todo & M_BLURMAP) && params.sh.enabled) {
double radius = sqrt (double(pW * pW + pH * pH)) / 2.0; double radius = sqrt (double (pW * pW + pH * pH)) / 2.0;
double shradius = params.sh.radius; double shradius = params.sh.radius;
if (!params.sh.hq) { if (!params.sh.hq) {
shradius *= radius / 1800.0; shradius *= radius / 1800.0;
} }
if(!shmap) { if (!shmap) {
shmap = new SHMap (pW, pH, true); shmap = new SHMap (pW, pH, true);
} }
@ -467,7 +471,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
opautili = false; opautili = false;
if(params.colorToning.enabled) { if (params.colorToning.enabled) {
TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params.icm.working); TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params.icm.working);
double wp[3][3] = { double wp[3][3] = {
{wprof[0][0], wprof[0][1], wprof[0][2]}, {wprof[0][0], wprof[0][1], wprof[0][2]},
@ -480,34 +484,34 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
{wiprof[1][0], wiprof[1][1], wiprof[1][2]}, {wiprof[1][0], wiprof[1][1], wiprof[1][2]},
{wiprof[2][0], wiprof[2][1], wiprof[2][2]} {wiprof[2][0], wiprof[2][1], wiprof[2][2]}
}; };
params.colorToning.getCurves(ctColorCurve, ctOpacityCurve, wp, wip, opautili); params.colorToning.getCurves (ctColorCurve, ctOpacityCurve, wp, wip, opautili);
CurveFactory::curveToning(params.colorToning.clcurve, clToningcurve, scale == 1 ? 1 : 16); CurveFactory::curveToning (params.colorToning.clcurve, clToningcurve, scale == 1 ? 1 : 16);
CurveFactory::curveToning(params.colorToning.cl2curve, cl2Toningcurve, scale == 1 ? 1 : 16); CurveFactory::curveToning (params.colorToning.cl2curve, cl2Toningcurve, scale == 1 ? 1 : 16);
} }
if(params.blackwhite.enabled) { if (params.blackwhite.enabled) {
CurveFactory::curveBW (params.blackwhite.beforeCurve, params.blackwhite.afterCurve, vhist16bw, histToneCurveBW, beforeToneCurveBW, afterToneCurveBW, 1); CurveFactory::curveBW (params.blackwhite.beforeCurve, params.blackwhite.afterCurve, vhist16bw, histToneCurveBW, beforeToneCurveBW, afterToneCurveBW, 1);
} }
colourToningSatLimit = float(params.colorToning.satProtectionThreshold) / 100.f * 0.7f + 0.3f; colourToningSatLimit = float (params.colorToning.satProtectionThreshold) / 100.f * 0.7f + 0.3f;
colourToningSatLimitOpacity = 1.f - (float(params.colorToning.saturatedOpacity) / 100.f); colourToningSatLimitOpacity = 1.f - (float (params.colorToning.saturatedOpacity) / 100.f);
int satTH = 80; int satTH = 80;
int satPR = 30; int satPR = 30;
int indi = 0; int indi = 0;
if(params.colorToning.enabled && params.colorToning.autosat) { //for colortoning evaluation of saturation settings if (params.colorToning.enabled && params.colorToning.autosat) { //for colortoning evaluation of saturation settings
float moyS = 0.f; float moyS = 0.f;
float eqty = 0.f; float eqty = 0.f;
ipf.moyeqt (oprevi, moyS, eqty);//return image : mean saturation and standard dev of saturation ipf.moyeqt (oprevi, moyS, eqty);//return image : mean saturation and standard dev of saturation
//printf("moy=%f ET=%f\n", moyS,eqty); //printf("moy=%f ET=%f\n", moyS,eqty);
float satp = ((moyS + 1.5f * eqty) - 0.3f) / 0.7f; //1.5 sigma ==> 93% pixels with high saturation -0.3 / 0.7 convert to Hombre scale float satp = ((moyS + 1.5f * eqty) - 0.3f) / 0.7f; //1.5 sigma ==> 93% pixels with high saturation -0.3 / 0.7 convert to Hombre scale
if(satp >= 0.92f) { if (satp >= 0.92f) {
satp = 0.92f; //avoid values too high (out of gamut) satp = 0.92f; //avoid values too high (out of gamut)
} }
if(satp <= 0.15f) { if (satp <= 0.15f) {
satp = 0.15f; //avoid too low values satp = 0.15f; //avoid too low values
} }
@ -520,22 +524,22 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
satPR = (int) 100.f * (moyS - 0.85f * eqty); satPR = (int) 100.f * (moyS - 0.85f * eqty);
} }
if(actListener) { if (actListener) {
//if(params.blackwhite.enabled) {actListener->autoColorTonChanged(0, satTH, satPR);} //if(params.blackwhite.enabled) {actListener->autoColorTonChanged(0, satTH, satPR);}
if(params.blackwhite.enabled && params.colorToning.autosat) { if (params.blackwhite.enabled && params.colorToning.autosat) {
actListener->autoColorTonChanged(0, satTH, satPR); //hide sliders only if autosat actListener->autoColorTonChanged (0, satTH, satPR); //hide sliders only if autosat
indi = 0; indi = 0;
} else { } else {
if(params.colorToning.autosat) { if (params.colorToning.autosat) {
if (params.colorToning.method == "Lab") { if (params.colorToning.method == "Lab") {
indi = 1; indi = 1;
} else if(params.colorToning.method == "RGBCurves") { } else if (params.colorToning.method == "RGBCurves") {
indi = 1; indi = 1;
} else if(params.colorToning.method == "RGBSliders") { } else if (params.colorToning.method == "RGBSliders") {
indi = 1; indi = 1;
} else if(params.colorToning.method == "Splico") { } else if (params.colorToning.method == "Splico") {
indi = 2; indi = 2;
} else if(params.colorToning.method == "Splitlr") { } else if (params.colorToning.method == "Splitlr") {
indi = 2; indi = 2;
} }
@ -552,25 +556,25 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
double bbm = 33.; double bbm = 33.;
DCPProfile::ApplyState as; DCPProfile::ApplyState as;
DCPProfile *dcpProf = imgsrc->getDCP(params.icm, currWB, as); DCPProfile *dcpProf = imgsrc->getDCP (params.icm, currWB, as);
ipf.rgbProc (oprevi, oprevl, nullptr, hltonecurve, shtonecurve, tonecurve, shmap, params.toneCurve.saturation, ipf.rgbProc (oprevi, oprevl, nullptr, hltonecurve, shtonecurve, tonecurve, shmap, params.toneCurve.saturation,
rCurve, gCurve, bCurve, colourToningSatLimit , colourToningSatLimitOpacity, ctColorCurve, ctOpacityCurve, opautili, clToningcurve, cl2Toningcurve, customToneCurve1, customToneCurve2, beforeToneCurveBW, afterToneCurveBW, rrm, ggm, bbm, bwAutoR, bwAutoG, bwAutoB, params.toneCurve.expcomp, params.toneCurve.hlcompr, params.toneCurve.hlcomprthresh, dcpProf, as, histToneCurve); rCurve, gCurve, bCurve, colourToningSatLimit, colourToningSatLimitOpacity, ctColorCurve, ctOpacityCurve, opautili, clToningcurve, cl2Toningcurve, customToneCurve1, customToneCurve2, beforeToneCurveBW, afterToneCurveBW, rrm, ggm, bbm, bwAutoR, bwAutoG, bwAutoB, params.toneCurve.expcomp, params.toneCurve.hlcompr, params.toneCurve.hlcomprthresh, dcpProf, as, histToneCurve);
if(params.blackwhite.enabled && params.blackwhite.autoc && abwListener) { if (params.blackwhite.enabled && params.blackwhite.autoc && abwListener) {
if (settings->verbose) { if (settings->verbose) {
printf("ImProcCoordinator / Auto B&W coefs: R=%.2f G=%.2f B=%.2f\n", bwAutoR, bwAutoG, bwAutoB); printf ("ImProcCoordinator / Auto B&W coefs: R=%.2f G=%.2f B=%.2f\n", bwAutoR, bwAutoG, bwAutoB);
} }
abwListener->BWChanged((float) rrm, (float) ggm, (float) bbm); abwListener->BWChanged ((float) rrm, (float) ggm, (float) bbm);
} }
if(params.colorToning.autosat && actListener) { if (params.colorToning.autosat && actListener) {
if (settings->verbose) { if (settings->verbose) {
printf("ImProcCoordinator / Auto CT: indi=%d satH=%d satPR=%d\n", indi, (int)colourToningSatLimit , (int) colourToningSatLimitOpacity); printf ("ImProcCoordinator / Auto CT: indi=%d satH=%d satPR=%d\n", indi, (int)colourToningSatLimit, (int) colourToningSatLimitOpacity);
} }
actListener->autoColorTonChanged(indi, (int) colourToningSatLimit, (int)colourToningSatLimitOpacity);//change sliders autosat actListener->autoColorTonChanged (indi, (int) colourToningSatLimit, (int)colourToningSatLimitOpacity); //change sliders autosat
} }
// correct GUI black and white with value // correct GUI black and white with value
@ -578,20 +582,20 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
// compute L channel histogram // compute L channel histogram
int x1, y1, x2, y2; int x1, y1, x2, y2;
params.crop.mapToResized(pW, pH, scale, x1, x2, y1, y2); params.crop.mapToResized (pW, pH, scale, x1, x2, y1, y2);
} }
readyphase++; readyphase++;
if (todo & (M_LUMACURVE | M_CROP)) { if (todo & (M_LUMACURVE | M_CROP)) {
LUTu lhist16(32768); LUTu lhist16 (32768);
lhist16.clear(); lhist16.clear();
#ifdef _OPENMP #ifdef _OPENMP
const int numThreads = min(max(pW * pH / (int)lhist16.getSize(), 1), omp_get_max_threads()); const int numThreads = min (max (pW * pH / (int)lhist16.getSize(), 1), omp_get_max_threads());
#pragma omp parallel num_threads(numThreads) if(numThreads>1) #pragma omp parallel num_threads(numThreads) if(numThreads>1)
#endif #endif
{ {
LUTu lhist16thr(lhist16.getSize()); LUTu lhist16thr (lhist16.getSize());
lhist16thr.clear(); lhist16thr.clear();
#ifdef _OPENMP #ifdef _OPENMP
#pragma omp for nowait #pragma omp for nowait
@ -599,7 +603,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
for (int x = 0; x < pH; x++) for (int x = 0; x < pH; x++)
for (int y = 0; y < pW; y++) { for (int y = 0; y < pW; y++) {
int pos = (int)(oprevl->L[x][y]); int pos = (int) (oprevl->L[x][y]);
lhist16thr[pos]++; lhist16thr[pos]++;
} }
@ -609,31 +613,31 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
lhist16 += lhist16thr; lhist16 += lhist16thr;
} }
#ifdef _OPENMP #ifdef _OPENMP
static_cast<void>(numThreads); // to silence cppcheck warning static_cast<void> (numThreads); // to silence cppcheck warning
#endif #endif
CurveFactory::complexLCurve (params.labCurve.brightness, params.labCurve.contrast, params.labCurve.lcurve, lhist16, lumacurve, histLCurve, scale == 1 ? 1 : 16, utili); CurveFactory::complexLCurve (params.labCurve.brightness, params.labCurve.contrast, params.labCurve.lcurve, lhist16, lumacurve, histLCurve, scale == 1 ? 1 : 16, utili);
} }
if (todo & M_LUMACURVE) { if (todo & M_LUMACURVE) {
CurveFactory::curveCL(clcutili, params.labCurve.clcurve, clcurve, scale == 1 ? 1 : 16); CurveFactory::curveCL (clcutili, params.labCurve.clcurve, clcurve, scale == 1 ? 1 : 16);
CurveFactory::complexsgnCurve (autili, butili, ccutili, cclutili, params.labCurve.acurve, params.labCurve.bcurve, params.labCurve.cccurve, CurveFactory::complexsgnCurve (autili, butili, ccutili, cclutili, params.labCurve.acurve, params.labCurve.bcurve, params.labCurve.cccurve,
params.labCurve.lccurve, chroma_acurve, chroma_bcurve, satcurve, lhskcurve, scale == 1 ? 1 : 16); params.labCurve.lccurve, chroma_acurve, chroma_bcurve, satcurve, lhskcurve, scale == 1 ? 1 : 16);
} }
if (todo & (M_LUMINANCE + M_COLOR) ) { if (todo & (M_LUMINANCE + M_COLOR) ) {
nprevl->CopyFrom(oprevl); nprevl->CopyFrom (oprevl);
progress ("Applying Color Boost...", 100 * readyphase / numofphases); progress ("Applying Color Boost...", 100 * readyphase / numofphases);
// ipf.MSR(nprevl, nprevl->W, nprevl->H, 1); // ipf.MSR(nprevl, nprevl->W, nprevl->H, 1);
histCCurve.clear(); histCCurve.clear();
histLCurve.clear(); histLCurve.clear();
ipf.chromiLuminanceCurve (nullptr, pW, nprevl, nprevl, chroma_acurve, chroma_bcurve, satcurve, lhskcurve, clcurve, lumacurve, utili, autili, butili, ccutili, cclutili, clcutili, histCCurve, histLCurve); ipf.chromiLuminanceCurve (nullptr, pW, nprevl, nprevl, chroma_acurve, chroma_bcurve, satcurve, lhskcurve, clcurve, lumacurve, utili, autili, butili, ccutili, cclutili, clcutili, histCCurve, histLCurve);
ipf.vibrance(nprevl); ipf.vibrance (nprevl);
if((params.colorappearance.enabled && !params.colorappearance.tonecie) || (!params.colorappearance.enabled)) { if ((params.colorappearance.enabled && !params.colorappearance.tonecie) || (!params.colorappearance.enabled)) {
ipf.EPDToneMap(nprevl, 5, scale); ipf.EPDToneMap (nprevl, 5, scale);
} }
// for all treatments Defringe, Sharpening, Contrast detail , Microcontrast they are activated if "CIECAM" function are disabled // for all treatments Defringe, Sharpening, Contrast detail , Microcontrast they are activated if "CIECAM" function are disabled
@ -679,8 +683,8 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
} }
} }
*/ */
if(params.dirpyrequalizer.cbdlMethod == "aft") { if (params.dirpyrequalizer.cbdlMethod == "aft") {
if(((params.colorappearance.enabled && !settings->autocielab) || (!params.colorappearance.enabled)) ) { if (((params.colorappearance.enabled && !settings->autocielab) || (!params.colorappearance.enabled)) ) {
progress ("Pyramid wavelet...", 100 * readyphase / numofphases); progress ("Pyramid wavelet...", 100 * readyphase / numofphases);
ipf.dirpyrequalizer (nprevl, scale); ipf.dirpyrequalizer (nprevl, scale);
//ipf.Lanczoslab (ip_wavelet(LabImage * lab, LabImage * dst, const procparams::EqualizerParams & eqparams), nprevl, 1.f/scale); //ipf.Lanczoslab (ip_wavelet(LabImage * lab, LabImage * dst, const procparams::EqualizerParams & eqparams), nprevl, 1.f/scale);
@ -691,35 +695,35 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
wavcontlutili = false; wavcontlutili = false;
//CurveFactory::curveWavContL ( wavcontlutili,params.wavelet.lcurve, wavclCurve, LUTu & histogramwavcl, LUTu & outBeforeWavCLurveHistogram,int skip); //CurveFactory::curveWavContL ( wavcontlutili,params.wavelet.lcurve, wavclCurve, LUTu & histogramwavcl, LUTu & outBeforeWavCLurveHistogram,int skip);
CurveFactory::curveWavContL(wavcontlutili, params.wavelet.wavclCurve, wavclCurve, scale == 1 ? 1 : 16); CurveFactory::curveWavContL (wavcontlutili, params.wavelet.wavclCurve, wavclCurve, scale == 1 ? 1 : 16);
if((params.wavelet.enabled)) { if ((params.wavelet.enabled)) {
WaveletParams WaveParams = params.wavelet; WaveletParams WaveParams = params.wavelet;
// WaveParams.getCurves(wavCLVCurve, waOpacityCurveRG, waOpacityCurveBY); // WaveParams.getCurves(wavCLVCurve, waOpacityCurveRG, waOpacityCurveBY);
WaveParams.getCurves(wavCLVCurve, waOpacityCurveRG, waOpacityCurveBY, waOpacityCurveW, waOpacityCurveWL); WaveParams.getCurves (wavCLVCurve, waOpacityCurveRG, waOpacityCurveBY, waOpacityCurveW, waOpacityCurveWL);
int kall = 0; int kall = 0;
progress ("Wavelet...", 100 * readyphase / numofphases); progress ("Wavelet...", 100 * readyphase / numofphases);
// ipf.ip_wavelet(nprevl, nprevl, kall, WaveParams, wavCLVCurve, waOpacityCurveRG, waOpacityCurveBY, scale); // ipf.ip_wavelet(nprevl, nprevl, kall, WaveParams, wavCLVCurve, waOpacityCurveRG, waOpacityCurveBY, scale);
ipf.ip_wavelet(nprevl, nprevl, kall, WaveParams, wavCLVCurve, waOpacityCurveRG, waOpacityCurveBY, waOpacityCurveW, waOpacityCurveWL, wavclCurve, wavcontlutili, scale); ipf.ip_wavelet (nprevl, nprevl, kall, WaveParams, wavCLVCurve, waOpacityCurveRG, waOpacityCurveBY, waOpacityCurveW, waOpacityCurveWL, wavclCurve, wavcontlutili, scale);
} }
if(params.colorappearance.enabled) { if (params.colorappearance.enabled) {
//L histo and Chroma histo for ciecam //L histo and Chroma histo for ciecam
// histogram well be for Lab (Lch) values, because very difficult to do with J,Q, M, s, C // histogram well be for Lab (Lch) values, because very difficult to do with J,Q, M, s, C
int x1, y1, x2, y2; int x1, y1, x2, y2;
params.crop.mapToResized(pW, pH, scale, x1, x2, y1, y2); params.crop.mapToResized (pW, pH, scale, x1, x2, y1, y2);
lhist16CAM.clear(); lhist16CAM.clear();
lhist16CCAM.clear(); lhist16CCAM.clear();
if(!params.colorappearance.datacie) { if (!params.colorappearance.datacie) {
for (int x = 0; x < pH; x++) for (int x = 0; x < pH; x++)
for (int y = 0; y < pW; y++) { for (int y = 0; y < pW; y++) {
int pos = CLIP((int)(nprevl->L[x][y])); int pos = CLIP ((int) (nprevl->L[x][y]));
int posc = CLIP((int)sqrt(nprevl->a[x][y] * nprevl->a[x][y] + nprevl->b[x][y] * nprevl->b[x][y])); int posc = CLIP ((int)sqrt (nprevl->a[x][y] * nprevl->a[x][y] + nprevl->b[x][y] * nprevl->b[x][y]));
lhist16CAM[pos]++; lhist16CAM[pos]++;
lhist16CCAM[posc]++; lhist16CCAM[posc]++;
} }
@ -734,13 +738,13 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
double fcomp = imgsrc->getMetaData()->getExpComp (); // Compensation +/- double fcomp = imgsrc->getMetaData()->getExpComp (); // Compensation +/-
double adap; double adap;
if(fnum < 0.3f || fiso < 5.f || fspeed < 0.00001f) { //if no exif data or wrong if (fnum < 0.3f || fiso < 5.f || fspeed < 0.00001f) { //if no exif data or wrong
adap = 2000.; adap = 2000.;
} else { } else {
double E_V = fcomp + log2 (double((fnum * fnum) / fspeed / (fiso / 100.f))); double E_V = fcomp + log2 (double ((fnum * fnum) / fspeed / (fiso / 100.f)));
E_V += params.toneCurve.expcomp;// exposure compensation in tonecurve ==> direct EV E_V += params.toneCurve.expcomp;// exposure compensation in tonecurve ==> direct EV
E_V += log2(params.raw.expos);// exposure raw white point ; log2 ==> linear to EV E_V += log2 (params.raw.expos); // exposure raw white point ; log2 ==> linear to EV
adap = powf(2.f, E_V - 3.f); // cd / m2 adap = powf (2.f, E_V - 3.f); // cd / m2
// end calculation adaptation scene luminosity // end calculation adaptation scene luminosity
} }
@ -749,16 +753,16 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
float d, dj, yb; float d, dj, yb;
bool execsharp = false; bool execsharp = false;
if(!ncie) { if (!ncie) {
ncie = new CieImage (pW, pH); ncie = new CieImage (pW, pH);
} }
if (!CAMBrightCurveJ && (params.colorappearance.algo == "JC" || params.colorappearance.algo == "JS" || params.colorappearance.algo == "ALL")) { if (!CAMBrightCurveJ && (params.colorappearance.algo == "JC" || params.colorappearance.algo == "JS" || params.colorappearance.algo == "ALL")) {
CAMBrightCurveJ(32768, 0); CAMBrightCurveJ (32768, 0);
} }
if (!CAMBrightCurveQ && (params.colorappearance.algo == "QM" || params.colorappearance.algo == "ALL")) { if (!CAMBrightCurveQ && (params.colorappearance.algo == "QM" || params.colorappearance.algo == "ALL")) {
CAMBrightCurveQ(32768, 0); CAMBrightCurveQ (32768, 0);
} }
// Issue 2785, only float version of ciecam02 for navigator and pan background // Issue 2785, only float version of ciecam02 for navigator and pan background
@ -766,18 +770,18 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
CAMBrightCurveJ.dirty = true; CAMBrightCurveJ.dirty = true;
CAMBrightCurveQ.dirty = true; CAMBrightCurveQ.dirty = true;
ipf.ciecam_02float (ncie, float(adap), begh, endh, pW, 2, nprevl, &params, customColCurve1, customColCurve2, customColCurve3, histLCAM, histCCAM, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, scale, execsharp, d, dj, yb, 1); ipf.ciecam_02float (ncie, float (adap), begh, endh, pW, 2, nprevl, &params, customColCurve1, customColCurve2, customColCurve3, histLCAM, histCCAM, CAMBrightCurveJ, CAMBrightCurveQ, CAMMean, 5, scale, execsharp, d, dj, yb, 1);
if((params.colorappearance.autodegree || params.colorappearance.autodegreeout) && acListener && params.colorappearance.enabled) { if ((params.colorappearance.autodegree || params.colorappearance.autodegreeout) && acListener && params.colorappearance.enabled) {
acListener->autoCamChanged(100.*(double)d, 100.*(double)dj); acListener->autoCamChanged (100.* (double)d, 100.* (double)dj);
} }
if(params.colorappearance.autoadapscen && acListener && params.colorappearance.enabled) { if (params.colorappearance.autoadapscen && acListener && params.colorappearance.enabled) {
acListener->adapCamChanged(adap); //real value of adapt scene acListener->adapCamChanged (adap); //real value of adapt scene
} }
if(params.colorappearance.autoybscen && acListener && params.colorappearance.enabled) { if (params.colorappearance.autoybscen && acListener && params.colorappearance.enabled) {
acListener->ybCamChanged((int) yb); //real value Yb scene acListener->ybCamChanged ((int) yb); //real value Yb scene
} }
readyphase++; readyphase++;
@ -800,11 +804,11 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
} }
// Update the monitor color transform if necessary // Update the monitor color transform if necessary
if ((todo & M_MONITOR) || (lastOutputProfile!=params.icm.output) || lastOutputIntent!=params.icm.outputIntent || lastOutputBPC!=params.icm.outputBPC) { if ((todo & M_MONITOR) || (lastOutputProfile != params.icm.output) || lastOutputIntent != params.icm.outputIntent || lastOutputBPC != params.icm.outputBPC) {
lastOutputProfile = params.icm.output; lastOutputProfile = params.icm.output;
lastOutputIntent = params.icm.outputIntent; lastOutputIntent = params.icm.outputIntent;
lastOutputBPC = params.icm.outputBPC; lastOutputBPC = params.icm.outputBPC;
ipf.updateColorProfiles(monitorProfile, monitorIntent, softProof, gamutCheck); ipf.updateColorProfiles (monitorProfile, monitorIntent, softProof, gamutCheck);
} }
// process crop, if needed // process crop, if needed
@ -816,7 +820,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
progress ("Conversion to RGB...", 100 * readyphase / numofphases); progress ("Conversion to RGB...", 100 * readyphase / numofphases);
if ((todo != CROP && todo != MINUPDATE) || (todo & M_MONITOR)) { if ((todo != CROP && todo != MINUPDATE) || (todo & M_MONITOR)) {
MyMutex::MyLock prevImgLock(previmg->getMutex()); MyMutex::MyLock prevImgLock (previmg->getMutex());
try { try {
// Computing the preview image, i.e. converting from WCS->Monitor color space (soft-proofing disabled) or WCS->Printer profile->Monitor color space (soft-proofing enabled) // Computing the preview image, i.e. converting from WCS->Monitor color space (soft-proofing disabled) or WCS->Printer profile->Monitor color space (soft-proofing enabled)
@ -825,7 +829,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
// Computing the internal image for analysis, i.e. conversion from WCS->Output profile // Computing the internal image for analysis, i.e. conversion from WCS->Output profile
delete workimg; delete workimg;
workimg = ipf.lab2rgb (nprevl, 0, 0, pW, pH, params.icm); workimg = ipf.lab2rgb (nprevl, 0, 0, pW, pH, params.icm);
} catch(char * str) { } catch (char * str) {
progress ("Error converting file...", 0); progress ("Error converting file...", 0);
return; return;
} }
@ -889,7 +893,7 @@ void ImProcCoordinator::freeAll ()
delete workimg; delete workimg;
if(shmap) { if (shmap) {
delete shmap; delete shmap;
} }
@ -913,7 +917,7 @@ void ImProcCoordinator::setScale (int prevscale)
printf ("setscale before lock\n"); printf ("setscale before lock\n");
} }
tr = getCoarseBitMask(params.coarse); tr = getCoarseBitMask (params.coarse);
int nW, nH; int nW, nH;
imgsrc->getFullSize (fw, fh, tr); imgsrc->getFullSize (fw, fh, tr);
@ -924,7 +928,7 @@ void ImProcCoordinator::setScale (int prevscale)
prevscale--; prevscale--;
PreviewProps pp (0, 0, fw, fh, prevscale); PreviewProps pp (0, 0, fw, fh, prevscale);
imgsrc->getSize (pp, nW, nH); imgsrc->getSize (pp, nW, nH);
} while(nH < 400 && prevscale > 1 && (nW * nH < 1000000) ); // sctually hardcoded values, perhaps a better choice is possible } while (nH < 400 && prevscale > 1 && (nW * nH < 1000000) ); // sctually hardcoded values, perhaps a better choice is possible
if (settings->verbose) { if (settings->verbose) {
printf ("setscale starts (%d, %d)\n", nW, nH); printf ("setscale starts (%d, %d)\n", nW, nH);
@ -945,7 +949,7 @@ void ImProcCoordinator::setScale (int prevscale)
previmg = new Image8 (pW, pH); previmg = new Image8 (pW, pH);
workimg = new Image8 (pW, pH); workimg = new Image8 (pW, pH);
if(params.sh.enabled) { if (params.sh.enabled) {
shmap = new SHMap (pW, pH, true); shmap = new SHMap (pW, pH, true);
} }
@ -977,7 +981,7 @@ void ImProcCoordinator::updateLRGBHistograms ()
{ {
int x1, y1, x2, y2; int x1, y1, x2, y2;
params.crop.mapToResized(pW, pH, scale, x1, x2, y1, y2); params.crop.mapToResized (pW, pH, scale, x1, x2, y1, y2);
#pragma omp parallel sections #pragma omp parallel sections
{ {
@ -988,7 +992,7 @@ void ImProcCoordinator::updateLRGBHistograms ()
for (int i = y1; i < y2; i++) for (int i = y1; i < y2; i++)
for (int j = x1; j < x2; j++) for (int j = x1; j < x2; j++)
{ {
histChroma[(int)(sqrtf(SQR(nprevl->a[i][j]) + SQR(nprevl->b[i][j])) / 188.f)]++; //188 = 48000/256 histChroma[ (int) (sqrtf (SQR (nprevl->a[i][j]) + SQR (nprevl->b[i][j])) / 188.f)]++; //188 = 48000/256
} }
} }
#pragma omp section #pragma omp section
@ -998,7 +1002,7 @@ void ImProcCoordinator::updateLRGBHistograms ()
for (int i = y1; i < y2; i++) for (int i = y1; i < y2; i++)
for (int j = x1; j < x2; j++) for (int j = x1; j < x2; j++)
{ {
histLuma[(int)(nprevl->L[i][j] / 128.f)]++; histLuma[ (int) (nprevl->L[i][j] / 128.f)]++;
} }
} }
#pragma omp section #pragma omp section
@ -1042,15 +1046,15 @@ bool ImProcCoordinator::getAutoWB (double& temp, double& green, double equal, do
if (lastAwbEqual != equal || lastAwbTempBias != tempBias) { if (lastAwbEqual != equal || lastAwbTempBias != tempBias) {
// Issue 2500 MyMutex::MyLock lock(minit); // Also used in crop window // Issue 2500 MyMutex::MyLock lock(minit); // Also used in crop window
double rm, gm, bm; double rm, gm, bm;
imgsrc->getAutoWBMultipliers(rm, gm, bm); imgsrc->getAutoWBMultipliers (rm, gm, bm);
if (rm != -1) { if (rm != -1) {
autoWB.update(rm, gm, bm, equal, tempBias); autoWB.update (rm, gm, bm, equal, tempBias);
lastAwbEqual = equal; lastAwbEqual = equal;
lastAwbTempBias = tempBias; lastAwbTempBias = tempBias;
} else { } else {
lastAwbEqual = -1.; lastAwbEqual = -1.;
autoWB.useDefaults(equal); autoWB.useDefaults (equal);
lastAwbTempBias = 0.0; lastAwbTempBias = 0.0;
} }
} }
@ -1081,7 +1085,7 @@ void ImProcCoordinator::getSpotWB (int x, int y, int rect, double& temp, double&
ColorTemp ret; ColorTemp ret;
{ {
MyMutex::MyLock lock(mProcessing); MyMutex::MyLock lock (mProcessing);
std::vector<Coord2D> points, red, green, blue; std::vector<Coord2D> points, red, green, blue;
for (int i = y - rect; i <= y + rect; i++) for (int i = y - rect; i <= y + rect; i++)
@ -1091,7 +1095,7 @@ void ImProcCoordinator::getSpotWB (int x, int y, int rect, double& temp, double&
ipf.transCoord (fw, fh, points, red, green, blue); ipf.transCoord (fw, fh, points, red, green, blue);
int tr = getCoarseBitMask(params.coarse); int tr = getCoarseBitMask (params.coarse);
ret = imgsrc->getSpotWB (red, green, blue, tr, params.wb.equal); ret = imgsrc->getSpotWB (red, green, blue, tr, params.wb.equal);
currWB = ColorTemp (params.wb.temperature, params.wb.green, params.wb.equal, params.wb.method); currWB = ColorTemp (params.wb.temperature, params.wb.green, params.wb.equal, params.wb.method);
@ -1112,15 +1116,15 @@ void ImProcCoordinator::getSpotWB (int x, int y, int rect, double& temp, double&
void ImProcCoordinator::getAutoCrop (double ratio, int &x, int &y, int &w, int &h) void ImProcCoordinator::getAutoCrop (double ratio, int &x, int &y, int &w, int &h)
{ {
MyMutex::MyLock lock(mProcessing); MyMutex::MyLock lock (mProcessing);
LCPMapper *pLCPMap = nullptr; LCPMapper *pLCPMap = nullptr;
if (params.lensProf.lcpFile.length() && imgsrc->getMetaData()->getFocalLen() > 0) { if (params.lensProf.lcpFile.length() && imgsrc->getMetaData()->getFocalLen() > 0) {
LCPProfile *pLCPProf = lcpStore->getProfile(params.lensProf.lcpFile); LCPProfile *pLCPProf = lcpStore->getProfile (params.lensProf.lcpFile);
if (pLCPProf) pLCPMap = new LCPMapper(pLCPProf, imgsrc->getMetaData()->getFocalLen(), imgsrc->getMetaData()->getFocalLen35mm(), imgsrc->getMetaData()->getFocusDist(), if (pLCPProf) pLCPMap = new LCPMapper (pLCPProf, imgsrc->getMetaData()->getFocalLen(), imgsrc->getMetaData()->getFocalLen35mm(), imgsrc->getMetaData()->getFocusDist(),
0, false, params.lensProf.useDist, fullw, fullh, params.coarse, imgsrc->getRotateDegree()); 0, false, params.lensProf.useDist, fullw, fullh, params.coarse, imgsrc->getRotateDegree());
} }
double fillscale = ipf.getTransformAutoFill (fullw, fullh, pLCPMap); double fillscale = ipf.getTransformAutoFill (fullw, fullh, pLCPMap);
@ -1169,11 +1173,11 @@ void ImProcCoordinator::getSoftProofing (bool &softProof, bool &gamutCheck)
void ImProcCoordinator::saveInputICCReference (const Glib::ustring& fname, bool apply_wb) void ImProcCoordinator::saveInputICCReference (const Glib::ustring& fname, bool apply_wb)
{ {
MyMutex::MyLock lock(mProcessing); MyMutex::MyLock lock (mProcessing);
int fW, fH; int fW, fH;
int tr = getCoarseBitMask(params.coarse); int tr = getCoarseBitMask (params.coarse);
imgsrc->getFullSize (fW, fH, tr); imgsrc->getFullSize (fW, fH, tr);
PreviewProps pp (0, 0, fW, fH, 1); PreviewProps pp (0, 0, fW, fH, 1);
@ -1181,8 +1185,8 @@ void ImProcCoordinator::saveInputICCReference (const Glib::ustring& fname, bool
ppar.toneCurve.hrenabled = false; ppar.toneCurve.hrenabled = false;
ppar.icm.input = "(none)"; ppar.icm.input = "(none)";
Imagefloat* im = new Imagefloat (fW, fH); Imagefloat* im = new Imagefloat (fW, fH);
imgsrc->preprocess( ppar.raw, ppar.lensProf, ppar.coarse ); imgsrc->preprocess ( ppar.raw, ppar.lensProf, ppar.coarse );
imgsrc->demosaic(ppar.raw ); imgsrc->demosaic (ppar.raw );
ColorTemp currWB = ColorTemp (params.wb.temperature, params.wb.green, params.wb.equal, params.wb.method); ColorTemp currWB = ColorTemp (params.wb.temperature, params.wb.green, params.wb.equal, params.wb.method);
if (params.wb.method == "Camera") { if (params.wb.method == "Camera") {
@ -1190,16 +1194,16 @@ void ImProcCoordinator::saveInputICCReference (const Glib::ustring& fname, bool
} else if (params.wb.method == "Auto") { } else if (params.wb.method == "Auto") {
if (lastAwbEqual != params.wb.equal || lastAwbTempBias != params.wb.tempBias) { if (lastAwbEqual != params.wb.equal || lastAwbTempBias != params.wb.tempBias) {
double rm, gm, bm; double rm, gm, bm;
imgsrc->getAutoWBMultipliers(rm, gm, bm); imgsrc->getAutoWBMultipliers (rm, gm, bm);
if (rm != -1.) { if (rm != -1.) {
autoWB.update(rm, gm, bm, params.wb.equal, params.wb.tempBias); autoWB.update (rm, gm, bm, params.wb.equal, params.wb.tempBias);
lastAwbEqual = params.wb.equal; lastAwbEqual = params.wb.equal;
lastAwbTempBias = params.wb.tempBias; lastAwbTempBias = params.wb.tempBias;
} else { } else {
lastAwbEqual = -1.; lastAwbEqual = -1.;
lastAwbTempBias = 0.0; lastAwbTempBias = 0.0;
autoWB.useDefaults(params.wb.equal); autoWB.useDefaults (params.wb.equal);
} }
} }
@ -1231,9 +1235,9 @@ void ImProcCoordinator::saveInputICCReference (const Glib::ustring& fname, bool
for (int i = cy; i < cy + ch; i++) { for (int i = cy; i < cy + ch; i++) {
for (int j = cx; j < cx + cw; j++) { for (int j = cx; j < cx + cw; j++) {
tmpim->r(i - cy, j - cx) = im->r(i, j); tmpim->r (i - cy, j - cx) = im->r (i, j);
tmpim->g(i - cy, j - cx) = im->g(i, j); tmpim->g (i - cy, j - cx) = im->g (i, j);
tmpim->b(i - cy, j - cx) = im->b(i, j); tmpim->b (i - cy, j - cx) = im->b (i, j);
} }
} }
@ -1244,11 +1248,11 @@ void ImProcCoordinator::saveInputICCReference (const Glib::ustring& fname, bool
// image may contain out of range samples, clip them to avoid wrap-arounds // image may contain out of range samples, clip them to avoid wrap-arounds
#pragma omp parallel for #pragma omp parallel for
for(int i = 0; i < im->getHeight(); i++) { for (int i = 0; i < im->getHeight(); i++) {
for(int j = 0; j < im->getWidth(); j++) { for (int j = 0; j < im->getWidth(); j++) {
im->r(i, j) = CLIP(im->r(i, j)); im->r (i, j) = CLIP (im->r (i, j));
im->g(i, j) = CLIP(im->g(i, j)); im->g (i, j) = CLIP (im->g (i, j));
im->b(i, j) = CLIP(im->b(i, j)); im->b (i, j) = CLIP (im->b (i, j));
} }
} }
@ -1256,7 +1260,7 @@ void ImProcCoordinator::saveInputICCReference (const Glib::ustring& fname, bool
delete im; delete im;
int imw, imh; int imw, imh;
double tmpScale = ipf.resizeScale(&params, fW, fH, imw, imh); double tmpScale = ipf.resizeScale (&params, fW, fH, imw, imh);
if (tmpScale != 1.0) { if (tmpScale != 1.0) {
Image16* tempImage = new Image16 (imw, imh); Image16* tempImage = new Image16 (imw, imh);
@ -1302,13 +1306,13 @@ void ImProcCoordinator::startProcessing ()
//batchThread->yield(); //the running batch should wait other threads to avoid conflict //batchThread->yield(); //the running batch should wait other threads to avoid conflict
thread = Glib::Thread::create(sigc::mem_fun(*this, &ImProcCoordinator::process), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); thread = Glib::Thread::create (sigc::mem_fun (*this, &ImProcCoordinator::process), 0, true, true, Glib::THREAD_PRIORITY_NORMAL);
} }
} }
} }
void ImProcCoordinator::startProcessing(int changeCode) void ImProcCoordinator::startProcessing (int changeCode)
{ {
paramsUpdateMutex.lock(); paramsUpdateMutex.lock();
changeSinceLast |= changeCode; changeSinceLast |= changeCode;
@ -1356,7 +1360,7 @@ ProcParams* ImProcCoordinator::beginUpdateParams ()
void ImProcCoordinator::endUpdateParams (ProcEvent change) void ImProcCoordinator::endUpdateParams (ProcEvent change)
{ {
endUpdateParams( refreshmap[(int)change] ); endUpdateParams ( refreshmap[ (int)change] );
} }
void ImProcCoordinator::endUpdateParams (int changeFlags) void ImProcCoordinator::endUpdateParams (int changeFlags)

View File

@ -223,7 +223,7 @@ public:
*dst = params; *dst = params;
} }
void startProcessing(int changeCode); void startProcessing (int changeCode);
ProcParams* beginUpdateParams (); ProcParams* beginUpdateParams ();
void endUpdateParams (ProcEvent change); // must be called after beginUpdateParams, triggers update void endUpdateParams (ProcEvent change); // must be called after beginUpdateParams, triggers update
void endUpdateParams (int changeFlags); void endUpdateParams (int changeFlags);
@ -304,7 +304,7 @@ public:
{ {
aeListener = ael; aeListener = ael;
} }
void setHistogramListener(HistogramListener *h) void setHistogramListener (HistogramListener *h)
{ {
hListener = h; hListener = h;
} }
@ -355,7 +355,7 @@ public:
} }
struct DenoiseInfoStore { struct DenoiseInfoStore {
DenoiseInfoStore () : chM(0), max_r{}, max_b{}, ch_M{}, valid(false) {} DenoiseInfoStore () : chM (0), max_r{}, max_b{}, ch_M{}, valid (false) {}
float chM; float chM;
float max_r[9]; float max_r[9];
float max_b[9]; float max_b[9];

View File

@ -269,7 +269,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh
double f = 0., c = 0., nc = 0., yb = 0., la, xw, yw, zw, f2 = 0., c2 = 0., nc2 = 0., yb2 = 0., la2; double f = 0., c = 0., nc = 0., yb = 0., la, xw, yw, zw, f2 = 0., c2 = 0., nc2 = 0., yb2 = 0., la2;
double fl, n, nbb, ncb, aw; double fl, n, nbb, ncb, aw;
double xwd = 0., ywd, zwd = 0.; double xwd = 0., ywd, zwd = 0.;
double xws, yws, zws; double xws, yws, zws;
int alg = 0; int alg = 0;
bool algepd = false; bool algepd = false;
float sum = 0.f; float sum = 0.f;
@ -316,14 +316,15 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh
c2 = 0.41; c2 = 0.41;
nc2 = 0.8; nc2 = 0.8;
} }
/*
//scene condition for surround /*
if (params->colorappearance.surrsource) { //scene condition for surround
f = 0.85; // if user => source image has surround very dark if (params->colorappearance.surrsource) {
c = 0.55; f = 0.85; // if user => source image has surround very dark
nc = 0.85; c = 0.55;
} nc = 0.85;
*/ }
*/
//with which algorithme //with which algorithme
if (params->colorappearance.algo == "JC") { if (params->colorappearance.algo == "JC") {
alg = 0; alg = 0;
@ -527,7 +528,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh
} }
} }
// if (settings->viewinggreySc == 0) { //auto // if (settings->viewinggreySc == 0) { //auto
if (params->colorappearance.autoybscen && pwb == 2) {//auto if (params->colorappearance.autoybscen && pwb == 2) {//auto
if (mean < 15.f) { if (mean < 15.f) {
@ -554,8 +555,8 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh
yb = 90.0; yb = 90.0;
} }
} else { } else {
yb = params->colorappearance.ybscen; yb = params->colorappearance.ybscen;
} }
if (settings->viewinggreySc == 1) { if (settings->viewinggreySc == 1) {
yb = 18.0; yb = 18.0;
@ -571,7 +572,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh
xw = 100.0 * Xw; xw = 100.0 * Xw;
yw = 100.0 * Yw; yw = 100.0 * Yw;
zw = 100.0 * Zw; zw = 100.0 * Zw;
double xw1 =0., yw1 = 0., zw1 = 0., xw2 = 0., yw2 = 0., zw2 = 0.; double xw1 = 0., yw1 = 0., zw1 = 0., xw2 = 0., yw2 = 0., zw2 = 0.;
// settings of WB: scene and viewing // settings of WB: scene and viewing
if (params->colorappearance.wbmodel == "RawT") { if (params->colorappearance.wbmodel == "RawT") {
@ -581,21 +582,21 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh
xw2 = xwd; xw2 = xwd;
yw2 = ywd; yw2 = ywd;
zw2 = zwd; zw2 = zwd;
} else if(params->colorappearance.wbmodel == "RawTCAT02") { } else if (params->colorappearance.wbmodel == "RawTCAT02") {
xw1 = xw; // Settings RT WB are used for CAT02 => mix , CAT02 is use for output device (screen: D50 D65, projector: lamp, LED) see preferences xw1 = xw; // Settings RT WB are used for CAT02 => mix , CAT02 is use for output device (screen: D50 D65, projector: lamp, LED) see preferences
yw1 = yw; yw1 = yw;
zw1 = zw; zw1 = zw;
xw2 = xwd; xw2 = xwd;
yw2 = ywd; yw2 = ywd;
zw2 = zwd; zw2 = zwd;
}else if(params->colorappearance.wbmodel == "free") { } else if (params->colorappearance.wbmodel == "free") {
xw1 = xws; // free temp and green xw1 = xws; // free temp and green
yw1 = yws; yw1 = yws;
zw1 = zws; zw1 = zws;
xw2 = xwd; xw2 = xwd;
yw2 = ywd; yw2 = ywd;
zw2 = zwd; zw2 = zwd;
} }
double cz, wh, pfl; double cz, wh, pfl;
Ciecam02::initcam1 (gamu, yb, pilot, f, la, xw, yw, zw, n, d, nbb, ncb, cz, aw, wh, pfl, fl, c); Ciecam02::initcam1 (gamu, yb, pilot, f, la, xw, yw, zw, n, d, nbb, ncb, cz, aw, wh, pfl, fl, c);
@ -1585,14 +1586,15 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int
c2 = 0.41f; c2 = 0.41f;
nc2 = 0.8f; nc2 = 0.8f;
} }
/*
//scene condition for surround /*
if (params->colorappearance.surrsource) { //scene condition for surround
f = 0.85f; // if user => source image has surround very dark if (params->colorappearance.surrsource) {
c = 0.55f; f = 0.85f; // if user => source image has surround very dark
nc = 0.85f; c = 0.55f;
} nc = 0.85f;
*/ }
*/
//with which algorithm //with which algorithm
if (params->colorappearance.algo == "JC") { if (params->colorappearance.algo == "JC") {
alg = 0; alg = 0;
@ -1868,8 +1870,8 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int
// if (settings->viewinggreySc == 0) { //auto // if (settings->viewinggreySc == 0) { //auto
if (params->colorappearance.autoybscen && pwb == 2) {//auto if (params->colorappearance.autoybscen && pwb == 2) {//auto
if (mean < 15.f) { if (mean < 15.f) {
yb = 3.0f; yb = 3.0f;
@ -1894,8 +1896,9 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int
} else { } else {
yb = 90.0f; yb = 90.0f;
} }
// } else if (settings->viewinggreySc == 1) { // } else if (settings->viewinggreySc == 1) {
} else { } else {
yb = (float) params->colorappearance.ybscen; yb = (float) params->colorappearance.ybscen;
} }
@ -1915,21 +1918,21 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int
xw2 = xwd; xw2 = xwd;
yw2 = ywd; yw2 = ywd;
zw2 = zwd; zw2 = zwd;
} else if(params->colorappearance.wbmodel == "RawTCAT02") { } else if (params->colorappearance.wbmodel == "RawTCAT02") {
xw1 = xw; // Settings RT WB are used for CAT02 => mix , CAT02 is use for output device (screen: D50 D65, projector: lamp, LED) see preferences xw1 = xw; // Settings RT WB are used for CAT02 => mix , CAT02 is use for output device (screen: D50 D65, projector: lamp, LED) see preferences
yw1 = yw; yw1 = yw;
zw1 = zw; zw1 = zw;
xw2 = xwd; xw2 = xwd;
yw2 = ywd; yw2 = ywd;
zw2 = zwd; zw2 = zwd;
} else if(params->colorappearance.wbmodel == "free") { } else if (params->colorappearance.wbmodel == "free") {
xw1 = xws; // free temp and green xw1 = xws; // free temp and green
yw1 = yws; yw1 = yws;
zw1 = zws; zw1 = zws;
xw2 = xwd; xw2 = xwd;
yw2 = ywd; yw2 = ywd;
zw2 = zwd; zw2 = zwd;
} }
float cz, wh, pfl; float cz, wh, pfl;

View File

@ -52,7 +52,7 @@ class ImProcFunctions
double scale; double scale;
bool multiThread; bool multiThread;
void calcVignettingParams(int oW, int oH, const VignettingParams& vignetting, double &w2, double &h2, double& maxRadius, double &v, double &b, double &mul); void calcVignettingParams (int oW, int oH, const VignettingParams& vignetting, double &w2, double &h2, double& maxRadius, double &v, double &b, double &mul);
void transformPreview (Imagefloat* original, Imagefloat* transformed, int cx, int cy, int sx, int sy, int oW, int oH, int fW, int fH, const LCPMapper *pLCPMap); void transformPreview (Imagefloat* original, Imagefloat* transformed, int cx, int cy, int sx, int sy, int oW, int oH, int fW, int fH, const LCPMapper *pLCPMap);
void transformLuminanceOnly (Imagefloat* original, Imagefloat* transformed, int cx, int cy, int oW, int oH, int fW, int fH); void transformLuminanceOnly (Imagefloat* original, Imagefloat* transformed, int cx, int cy, int oW, int oH, int fW, int fH);
@ -95,9 +95,9 @@ class ImProcFunctions
rd = gd = bd = 0.0; rd = gd = bd = 0.0;
for (int i = xs, ix = 0; i < xs + 4; i++, ix++) { for (int i = xs, ix = 0; i < xs + 4; i++, ix++) {
rd += src->r(k, i) * w[ix]; rd += src->r (k, i) * w[ix];
gd += src->g(k, i) * w[ix]; gd += src->g (k, i) * w[ix];
bd += src->b(k, i) * w[ix]; bd += src->b (k, i) * w[ix];
} }
yr[kx] = rd; yr[kx] = rd;
@ -196,7 +196,7 @@ public:
double lumimul[3]; double lumimul[3];
ImProcFunctions (const ProcParams* iparams, bool imultiThread = true) ImProcFunctions (const ProcParams* iparams, bool imultiThread = true)
: monitorTransform(nullptr), lab2outputTransform(nullptr), output2monitorTransform(nullptr), params(iparams), scale(1), multiThread(imultiThread), lumimul{} {} : monitorTransform (nullptr), lab2outputTransform (nullptr), output2monitorTransform (nullptr), params (iparams), scale (1), multiThread (imultiThread), lumimul{} {}
~ImProcFunctions (); ~ImProcFunctions ();
void setScale (double iscale); void setScale (double iscale);
@ -207,10 +207,10 @@ public:
void firstAnalysis (const Imagefloat* const working, const ProcParams &params, LUTu & vhist16); void firstAnalysis (const Imagefloat* const working, const ProcParams &params, LUTu & vhist16);
void updateColorProfiles (const Glib::ustring& monitorProfile, RenderingIntent monitorIntent, bool softProof, bool gamutCheck); 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, void rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve,
SHMap* shmap, 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, SHMap* shmap, 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 ); 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 );
void rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve, void rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve,
SHMap* shmap, 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, SHMap* shmap, 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, 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); double expcomp, int hlcompr, int hlcomprthresh, DCPProfile *dcpProf, const DCPProfile::ApplyState &asIn, LUTu &histToneCurve);
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 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] );
@ -245,9 +245,9 @@ public:
void deconvsharpening (float** luminance, float** buffer, int W, int H, const SharpeningParams &sharpenParam); void deconvsharpening (float** luminance, float** buffer, int W, int H, const SharpeningParams &sharpenParam);
void MLsharpen (LabImage* lab);// Manuel's clarity / sharpening void MLsharpen (LabImage* lab);// Manuel's clarity / sharpening
void MLmicrocontrast(float** luminance, int W, int H ); //Manuel's microcontrast void MLmicrocontrast (float** luminance, int W, int H ); //Manuel's microcontrast
void MLmicrocontrast(LabImage* lab ); //Manuel's microcontrast void MLmicrocontrast (LabImage* lab ); //Manuel's microcontrast
void MLmicrocontrastcam(CieImage* ncie ); //Manuel's microcontrast void MLmicrocontrastcam (CieImage* ncie ); //Manuel's microcontrast
void impulsedenoise (LabImage* lab);//Emil's impulse denoise void impulsedenoise (LabImage* lab);//Emil's impulse denoise
void impulsedenoisecam (CieImage* ncie, float **buffers[3]); void impulsedenoisecam (CieImage* ncie, float **buffers[3]);
@ -258,13 +258,13 @@ public:
void dirpyrequalizer (LabImage* lab, int scale);//Emil's wavelet void dirpyrequalizer (LabImage* lab, int scale);//Emil's wavelet
void EPDToneMapResid(float * WavCoeffs_L0, unsigned int Iterates, int skip, struct cont_params& cp, int W_L, int H_L, float max0, float min0); void EPDToneMapResid (float * WavCoeffs_L0, unsigned int Iterates, int skip, struct cont_params& cp, int W_L, int H_L, float max0, float min0);
float *CompressDR(float *Source, int skip, struct cont_params &cp, int W_L, int H_L, float Compression, float DetailBoost, float max0, float min0, float ave, float ah, float bh, float al, float bl, float factorx, float *Compressed); float *CompressDR (float *Source, int skip, struct cont_params &cp, int W_L, int H_L, float Compression, float DetailBoost, float max0, float min0, float ave, float ah, float bh, float al, float bl, float factorx, float *Compressed);
void ContrastResid(float * WavCoeffs_L0, unsigned int Iterates, int skip, struct cont_params &cp, int W_L, int H_L, float max0, float min0, float ave, float ah, float bh, float al, float bl, float factorx); void ContrastResid (float * WavCoeffs_L0, unsigned int Iterates, int skip, struct cont_params &cp, int W_L, int H_L, float max0, float min0, float ave, float ah, float bh, float al, float bl, float factorx);
float *ContrastDR(float *Source, int skip, struct cont_params &cp, int W_L, int H_L, float Compression, float DetailBoost, float max0, float min0, float ave, float ah, float bh, float al, float bl, float factorx, float *Contrast = nullptr); float *ContrastDR (float *Source, int skip, struct cont_params &cp, int W_L, int H_L, float Compression, float DetailBoost, float max0, float min0, float ave, float ah, float bh, float al, float bl, float factorx, float *Contrast = nullptr);
void EPDToneMap(LabImage *lab, unsigned int Iterates = 0, int skip = 1); void EPDToneMap (LabImage *lab, unsigned int Iterates = 0, int skip = 1);
void EPDToneMapCIE(CieImage *ncie, float a_w, float c_, float w_h, int Wid, int Hei, int begh, int endh, float minQ, float maxQ, unsigned int Iterates = 0, int skip = 1); void EPDToneMapCIE (CieImage *ncie, float a_w, float c_, float w_h, int Wid, int Hei, int begh, int endh, float minQ, float maxQ, unsigned int Iterates = 0, int skip = 1);
// pyramid denoise // pyramid denoise
procparams::DirPyrDenoiseParams dnparams; procparams::DirPyrDenoiseParams dnparams;
@ -274,58 +274,58 @@ public:
int pitch, int scale, const int luma, const int chroma/*, LUTf & Lcurve, LUTf & abcurve*/ ); int pitch, int scale, const int luma, const int chroma/*, LUTf & Lcurve, LUTf & abcurve*/ );
void Tile_calc (int tilesize, int overlap, int kall, int imwidth, int imheight, int &numtiles_W, int &numtiles_H, int &tilewidth, int &tileheight, int &tileWskip, int &tileHskip); void Tile_calc (int tilesize, int overlap, int kall, int imwidth, int imheight, int &numtiles_W, int &numtiles_H, int &tilewidth, int &tileheight, int &tileWskip, int &tileHskip);
void ip_wavelet(LabImage * lab, LabImage * dst, int kall, const procparams::WaveletParams & waparams, const WavCurve & wavCLVCcurve, const WavOpacityCurveRG & waOpacityCurveRG, const WavOpacityCurveBY & waOpacityCurveBY, const WavOpacityCurveW & waOpacityCurveW, const WavOpacityCurveWL & waOpacityCurveWL, LUTf &wavclCurve, bool wavcontlutili, int skip); void ip_wavelet (LabImage * lab, LabImage * dst, int kall, const procparams::WaveletParams & waparams, const WavCurve & wavCLVCcurve, const WavOpacityCurveRG & waOpacityCurveRG, const WavOpacityCurveBY & waOpacityCurveBY, const WavOpacityCurveW & waOpacityCurveW, const WavOpacityCurveWL & waOpacityCurveWL, LUTf &wavclCurve, bool wavcontlutili, int skip);
void WaveletcontAllL(LabImage * lab, float **varhue, float **varchrom, wavelet_decomposition &WaveletCoeffs_L, void WaveletcontAllL (LabImage * lab, float **varhue, float **varchrom, wavelet_decomposition &WaveletCoeffs_L,
struct cont_params &cp, int skip, float *mean, float *meanN, float *sigma, float *sigmaN, float *MaxP, float *MaxN, const WavCurve & wavCLVCcurve, const WavOpacityCurveW & waOpacityCurveW, const WavOpacityCurveWL & waOpacityCurveWL, FlatCurve* ChCurve, bool Chutili); struct cont_params &cp, int skip, float *mean, float *meanN, float *sigma, float *sigmaN, float *MaxP, float *MaxN, const WavCurve & wavCLVCcurve, const WavOpacityCurveW & waOpacityCurveW, const WavOpacityCurveWL & waOpacityCurveWL, FlatCurve* ChCurve, bool Chutili);
void WaveletcontAllLfinal(wavelet_decomposition &WaveletCoeffs_L, struct cont_params &cp, float *mean, float *sigma, float *MaxP, const WavOpacityCurveWL & waOpacityCurveWL); void WaveletcontAllLfinal (wavelet_decomposition &WaveletCoeffs_L, struct cont_params &cp, float *mean, float *sigma, float *MaxP, const WavOpacityCurveWL & waOpacityCurveWL);
void WaveletcontAllAB(LabImage * lab, float **varhue, float **varchrom, wavelet_decomposition &WaveletCoeffs_a, const WavOpacityCurveW & waOpacityCurveW, void WaveletcontAllAB (LabImage * lab, float **varhue, float **varchrom, wavelet_decomposition &WaveletCoeffs_a, const WavOpacityCurveW & waOpacityCurveW,
struct cont_params &cp, const bool useChannelA); struct cont_params &cp, const bool useChannelA);
void WaveletAandBAllAB(LabImage * lab, float **varhue, float **varchrom, wavelet_decomposition &WaveletCoeffs_a, wavelet_decomposition &WaveletCoeffs_b, void WaveletAandBAllAB (LabImage * lab, float **varhue, float **varchrom, wavelet_decomposition &WaveletCoeffs_a, wavelet_decomposition &WaveletCoeffs_b,
struct cont_params &cp, const WavOpacityCurveW & waOpacityCurveW, FlatCurve* hhcurve, bool hhutili); struct cont_params &cp, const WavOpacityCurveW & waOpacityCurveW, FlatCurve* hhcurve, bool hhutili);
void ContAllL (float **koeLi, float *maxkoeLi, bool lipschitz, int maxlvl, LabImage * lab, float **varhue, float **varchrom, float ** WavCoeffs_L, float * WavCoeffs_L0, int level, int dir, struct cont_params &cp, void ContAllL (float **koeLi, float *maxkoeLi, bool lipschitz, int maxlvl, LabImage * lab, float **varhue, float **varchrom, float ** WavCoeffs_L, float * WavCoeffs_L0, int level, int dir, struct cont_params &cp,
int W_L, int H_L, int skip, float *mean, float *meanN, float *sigma, float *sigmaN, float *MaxP, float *MaxN, const WavCurve & wavCLVCcurve, const WavOpacityCurveW & waOpacityCurveW, FlatCurve* ChCurve, bool Chutili); int W_L, int H_L, int skip, float *mean, float *meanN, float *sigma, float *sigmaN, float *MaxP, float *MaxN, const WavCurve & wavCLVCcurve, const WavOpacityCurveW & waOpacityCurveW, FlatCurve* ChCurve, bool Chutili);
void finalContAllL (float ** WavCoeffs_L, float * WavCoeffs_L0, int level, int dir, struct cont_params &cp, void finalContAllL (float ** WavCoeffs_L, float * WavCoeffs_L0, int level, int dir, struct cont_params &cp,
int W_L, int H_L, float *mean, float *sigma, float *MaxP, const WavOpacityCurveWL & waOpacityCurveWL); int W_L, int H_L, float *mean, float *sigma, float *MaxP, const WavOpacityCurveWL & waOpacityCurveWL);
void ContAllAB (LabImage * lab, int maxlvl, float **varhue, float **varchrom, float ** WavCoeffs_a, float * WavCoeffs_a0, int level, int dir, const WavOpacityCurveW & waOpacityCurveW, struct cont_params &cp, void ContAllAB (LabImage * lab, int maxlvl, float **varhue, float **varchrom, float ** WavCoeffs_a, float * WavCoeffs_a0, int level, int dir, const WavOpacityCurveW & waOpacityCurveW, struct cont_params &cp,
int W_ab, int H_ab, const bool useChannelA); int W_ab, int H_ab, const bool useChannelA);
void Evaluate2(wavelet_decomposition &WaveletCoeffs_L, void Evaluate2 (wavelet_decomposition &WaveletCoeffs_L,
const struct cont_params& cp, int ind, float *mean, float *meanN, float *sigma, float *sigmaN, float *MaxP, float *MaxN, float madL[8][3]); const struct cont_params& cp, int ind, float *mean, float *meanN, float *sigma, float *sigmaN, float *MaxP, float *MaxN, float madL[8][3]);
void Eval2 (float ** WavCoeffs_L, int level, const struct cont_params& cp, void Eval2 (float ** WavCoeffs_L, int level, const struct cont_params& cp,
int W_L, int H_L, int skip_L, int ind, float *mean, float *meanN, float *sigma, float *sigmaN, float *MaxP, float *MaxN, float *madL); int W_L, int H_L, int skip_L, int ind, float *mean, float *meanN, float *sigma, float *sigmaN, float *MaxP, float *MaxN, float *madL);
void Aver(float * HH_Coeffs, int datalen, float &averagePlus, float &averageNeg, float &max, float &min); void Aver (float * HH_Coeffs, int datalen, float &averagePlus, float &averageNeg, float &max, float &min);
void Sigma(float * HH_Coeffs, int datalen, float averagePlus, float averageNeg, float &sigmaPlus, float &sigmaNeg); void Sigma (float * HH_Coeffs, int datalen, float averagePlus, float averageNeg, float &sigmaPlus, float &sigmaNeg);
void calckoe(float ** WavCoeffs_LL, const struct cont_params& cp, float ** koeLi, int level, int dir, int W_L, int H_L, float edd, float *maxkoeLi, float **tmC = nullptr); void calckoe (float ** WavCoeffs_LL, const struct cont_params& cp, float ** koeLi, int level, int dir, int W_L, int H_L, float edd, float *maxkoeLi, float **tmC = nullptr);
void Median_Denoise( float **src, float **dst, int width, int height, Median medianType, int iterations, int numThreads, float **buffer = nullptr); void Median_Denoise ( float **src, float **dst, int width, int height, Median medianType, int iterations, int numThreads, float **buffer = nullptr);
void RGB_denoise(int kall, Imagefloat * src, Imagefloat * dst, Imagefloat * calclum, float * ch_M, float *max_r, float *max_b, bool isRAW, const procparams::DirPyrDenoiseParams & dnparams, const double expcomp, const NoiseCurve & noiseLCurve , const NoiseCurve & noiseCCurve , float &chaut, float &redaut, float &blueaut, float &maxredaut, float & maxblueaut, float &nresi, float &highresi); void RGB_denoise (int kall, Imagefloat * src, Imagefloat * dst, Imagefloat * calclum, float * ch_M, float *max_r, float *max_b, bool isRAW, const procparams::DirPyrDenoiseParams & dnparams, const double expcomp, const NoiseCurve & noiseLCurve, const NoiseCurve & noiseCCurve, float &chaut, float &redaut, float &blueaut, float &maxredaut, float & maxblueaut, float &nresi, float &highresi);
void RGB_denoise_infoGamCurve(const procparams::DirPyrDenoiseParams & dnparams, const bool isRAW, LUTf &gamcurve, float &gam, float &gamthresh, float &gamslope); void RGB_denoise_infoGamCurve (const procparams::DirPyrDenoiseParams & dnparams, const bool isRAW, LUTf &gamcurve, float &gam, float &gamthresh, float &gamslope);
void RGB_denoise_info(Imagefloat * src, Imagefloat * provicalc, bool isRAW, LUTf &gamcurve, float gam, float gamthresh, float gamslope, const procparams::DirPyrDenoiseParams & dnparams, const double expcomp, float &chaut, int &Nb, float &redaut, float &blueaut, float &maxredaut, float & maxblueaut, float &minredaut, float & minblueaut, float &chromina, float &sigma, float &lumema, float &sigma_L, float &redyel, float &skinc, float &nsknc, bool multiThread = false); void RGB_denoise_info (Imagefloat * src, Imagefloat * provicalc, bool isRAW, LUTf &gamcurve, float gam, float gamthresh, float gamslope, const procparams::DirPyrDenoiseParams & dnparams, const double expcomp, float &chaut, int &Nb, float &redaut, float &blueaut, float &maxredaut, float & maxblueaut, float &minredaut, float & minblueaut, float &chromina, float &sigma, float &lumema, float &sigma_L, float &redyel, float &skinc, float &nsknc, bool multiThread = false);
void RGBtile_denoise (float * fLblox, int hblproc, float noisevar_Ldetail, float * nbrwt, float * blurbuffer ); //for DCT void RGBtile_denoise (float * fLblox, int hblproc, float noisevar_Ldetail, float * nbrwt, float * blurbuffer ); //for DCT
void RGBoutput_tile_row (float *bloxrow_L, float ** Ldetail, float ** tilemask_out, int height, int width, int top ); void RGBoutput_tile_row (float *bloxrow_L, float ** Ldetail, float ** tilemask_out, int height, int width, int top );
bool WaveletDenoiseAllL(wavelet_decomposition &WaveletCoeffs_L, float *noisevarlum, float madL[8][3], float * vari, int edge); bool WaveletDenoiseAllL (wavelet_decomposition &WaveletCoeffs_L, float *noisevarlum, float madL[8][3], float * vari, int edge);
bool WaveletDenoiseAllAB(wavelet_decomposition &WaveletCoeffs_L, wavelet_decomposition &WaveletCoeffs_ab, float *noisevarchrom, float madL[8][3], float noisevar_ab, const bool useNoiseCCurve, bool autoch, bool denoiseMethodRgb); bool WaveletDenoiseAllAB (wavelet_decomposition &WaveletCoeffs_L, wavelet_decomposition &WaveletCoeffs_ab, float *noisevarchrom, float madL[8][3], float noisevar_ab, const bool useNoiseCCurve, bool autoch, bool denoiseMethodRgb);
void WaveletDenoiseAll_info(int levwav, wavelet_decomposition &WaveletCoeffs_a, void WaveletDenoiseAll_info (int levwav, wavelet_decomposition &WaveletCoeffs_a,
wavelet_decomposition &WaveletCoeffs_b, float **noisevarlum, float **noisevarchrom, float **noisevarhue, int width, int height, float noisevar_abr, float noisevar_abb, LabImage * noi, float &chaut, int &Nb, float &redaut, float &blueaut, float &maxredaut, float &maxblueaut, float &minredaut, float & minblueaut, int schoice, bool autoch, float &chromina, float &sigma, float &lumema, float &sigma_L, float &redyel, float &skinc, float &nsknc, wavelet_decomposition &WaveletCoeffs_b, float **noisevarlum, float **noisevarchrom, float **noisevarhue, int width, int height, float noisevar_abr, float noisevar_abb, LabImage * noi, float &chaut, int &Nb, float &redaut, float &blueaut, float &maxredaut, float &maxblueaut, float &minredaut, float & minblueaut, int schoice, bool autoch, float &chromina, float &sigma, float &lumema, float &sigma_L, float &redyel, float &skinc, float &nsknc,
float &maxchred, float &maxchblue, float &minchred, float &minchblue, int &nb, float &chau, float &chred, float &chblue, bool denoiseMethodRgb, bool multiThread); float &maxchred, float &maxchblue, float &minchred, float &minchblue, int &nb, float &chau, float &chred, float &chblue, bool denoiseMethodRgb, bool multiThread);
bool WaveletDenoiseAll_BiShrinkL(wavelet_decomposition &WaveletCoeffs_L, float *noisevarlum, float madL[8][3]); bool WaveletDenoiseAll_BiShrinkL (wavelet_decomposition &WaveletCoeffs_L, float *noisevarlum, float madL[8][3]);
bool WaveletDenoiseAll_BiShrinkAB(wavelet_decomposition &WaveletCoeffs_L, wavelet_decomposition &WaveletCoeffs_ab, float *noisevarchrom, float madL[8][3], float noisevar_ab, bool WaveletDenoiseAll_BiShrinkAB (wavelet_decomposition &WaveletCoeffs_L, wavelet_decomposition &WaveletCoeffs_ab, float *noisevarchrom, float madL[8][3], float noisevar_ab,
const bool useNoiseCCurve, bool autoch, bool denoiseMethodRgb); const bool useNoiseCCurve, bool autoch, bool denoiseMethodRgb);
void ShrinkAllL(wavelet_decomposition &WaveletCoeffs_L, float **buffer, int level, int dir, float *noisevarlum, float * madL, float * vari, int edge); void ShrinkAllL (wavelet_decomposition &WaveletCoeffs_L, float **buffer, int level, int dir, float *noisevarlum, float * madL, float * vari, int edge);
void ShrinkAllAB(wavelet_decomposition &WaveletCoeffs_L, wavelet_decomposition &WaveletCoeffs_ab, float **buffer, int level, int dir, void ShrinkAllAB (wavelet_decomposition &WaveletCoeffs_L, wavelet_decomposition &WaveletCoeffs_ab, float **buffer, int level, int dir,
float *noisevarchrom, float noisevar_ab, const bool useNoiseCCurve, bool autoch, bool denoiseMethodRgb, float * madL, float * madaab = nullptr, bool madCalculated = false); float *noisevarchrom, float noisevar_ab, const bool useNoiseCCurve, bool autoch, bool denoiseMethodRgb, float * madL, float * madaab = nullptr, bool madCalculated = false);
void ShrinkAll_info(float ** WavCoeffs_a, float ** WavCoeffs_b, int level, void ShrinkAll_info (float ** WavCoeffs_a, float ** WavCoeffs_b, int level,
int W_ab, int H_ab, int skip_ab, float **noisevarlum, float **noisevarchrom, float **noisevarhue, int width, int height, float noisevar_abr, float noisevar_abb, LabImage * noi, float &chaut, int &Nb, float &redaut, float &blueaut, float &maxredaut, float &maxblueaut, float &minredaut, float &minblueaut, bool autoch, int schoice, int lvl, float &chromina, float &sigma, float &lumema, float &sigma_L, float &redyel, float &skinc, float &nsknc, int W_ab, int H_ab, int skip_ab, float **noisevarlum, float **noisevarchrom, float **noisevarhue, int width, int height, float noisevar_abr, float noisevar_abb, LabImage * noi, float &chaut, int &Nb, float &redaut, float &blueaut, float &maxredaut, float &maxblueaut, float &minredaut, float &minblueaut, bool autoch, int schoice, int lvl, float &chromina, float &sigma, float &lumema, float &sigma_L, float &redyel, float &skinc, float &nsknc,
float &maxchred, float &maxchblue, float &minchred, float &minchblue, int &nb, float &chau, float &chred, float &chblue, bool denoiseMethodRgb, bool multiThread); float &maxchred, float &maxchblue, float &minchred, float &minchblue, int &nb, float &chau, float &chred, float &chblue, bool denoiseMethodRgb, bool multiThread);
void Noise_residualAB(wavelet_decomposition &WaveletCoeffs_ab, float &chresid, float &chmaxresid, bool denoiseMethodRgb); void Noise_residualAB (wavelet_decomposition &WaveletCoeffs_ab, float &chresid, float &chmaxresid, bool denoiseMethodRgb);
void calcautodn_info (float &chaut, float &delta, int Nb, int levaut, float maxmax, float lumema, float chromina, int mode, int lissage, float redyel, float skinc, float nsknc); void calcautodn_info (float &chaut, float &delta, int Nb, int levaut, float maxmax, float lumema, float chromina, int mode, int lissage, float redyel, float skinc, float nsknc);
float MadMax(float * DataList, int &max, int datalen); float MadMax (float * DataList, int &max, int datalen);
float Mad(float * DataList, const int datalen); float Mad (float * DataList, const int datalen);
float MadRgb(float * DataList, const int datalen); float MadRgb (float * DataList, const int datalen);
// pyramid wavelet // pyramid wavelet
void dirpyr_equalizer (float ** src, float ** dst, int srcwidth, int srcheight, float ** l_a, float ** l_b, float ** dest_a, float ** dest_b, const double * mult, const double dirpyrThreshold, const double skinprot, const bool gamutlab, float b_l, float t_l, float t_r, float b_r, int choice, int scale);//Emil's directional pyramid wavelet void dirpyr_equalizer (float ** src, float ** dst, int srcwidth, int srcheight, float ** l_a, float ** l_b, float ** dest_a, float ** dest_b, const double * mult, const double dirpyrThreshold, const double skinprot, const bool gamutlab, float b_l, float t_l, float t_r, float b_r, int choice, int scale);//Emil's directional pyramid wavelet
@ -340,11 +340,11 @@ public:
void PF_correct_RT (LabImage * src, LabImage * dst, double radius, int thresh); void PF_correct_RT (LabImage * src, LabImage * dst, double radius, int thresh);
void PF_correct_RTcam (CieImage * src, CieImage * dst, double radius, int thresh); void PF_correct_RTcam (CieImage * src, CieImage * dst, double radius, int thresh);
void Badpixelscam(CieImage * src, CieImage * dst, double radius, int thresh, int mode, float b_l, float t_l, float t_r, float b_r, float skinprot, float chrom, int hotbad); void Badpixelscam (CieImage * src, CieImage * dst, double radius, int thresh, int mode, float b_l, float t_l, float t_r, float b_r, float skinprot, float chrom, int hotbad);
void BadpixelsLab(LabImage * src, LabImage * dst, double radius, int thresh, int mode, float b_l, float t_l, float t_r, float b_r, float skinprot, float chrom); void BadpixelsLab (LabImage * src, LabImage * dst, double radius, int thresh, int mode, float b_l, float t_l, float t_r, float b_r, float skinprot, float chrom);
Image8* lab2rgb (LabImage* lab, int cx, int cy, int cw, int ch, const procparams::ColorManagementParams &icm); Image8* lab2rgb (LabImage* lab, int cx, int cy, int cw, int ch, const procparams::ColorManagementParams &icm);
Image16* lab2rgb16 (LabImage* lab, int cx, int cy, int cw, int ch, const procparams::ColorManagementParams &icm, bool bw, GammaValues *ga=nullptr); Image16* lab2rgb16 (LabImage* lab, int cx, int cy, int cw, int ch, const procparams::ColorManagementParams &icm, bool bw, GammaValues *ga = nullptr);
// CieImage *ciec; // CieImage *ciec;
bool transCoord (int W, int H, int x, int y, int w, int h, int& xv, int& yv, int& wv, int& hv, double ascaleDef = -1, const LCPMapper *pLCPMap = nullptr); bool transCoord (int W, int H, int x, int y, int w, int h, int& xv, int& yv, int& wv, int& hv, double ascaleDef = -1, const LCPMapper *pLCPMap = nullptr);
@ -352,8 +352,8 @@ public:
static void getAutoExp (const LUTu & histogram, int histcompr, double defgain, double clip, double& expcomp, int& bright, int& contr, int& black, int& hlcompr, int& hlcomprthresh); static void getAutoExp (const LUTu & histogram, int histcompr, double defgain, double clip, double& expcomp, int& bright, int& contr, int& black, int& hlcompr, int& hlcomprthresh);
static double getAutoDistor (const Glib::ustring& fname, int thumb_size); static double getAutoDistor (const Glib::ustring& fname, int thumb_size);
double getTransformAutoFill (int oW, int oH, const LCPMapper *pLCPMap = nullptr); double getTransformAutoFill (int oW, int oH, const LCPMapper *pLCPMap = nullptr);
void rgb2lab(const Imagefloat &src, LabImage &dst, const Glib::ustring &workingSpace); void rgb2lab (const Imagefloat &src, LabImage &dst, const Glib::ustring &workingSpace);
void lab2rgb(const LabImage &src, Imagefloat &dst, const Glib::ustring &workingSpace); void lab2rgb (const LabImage &src, Imagefloat &dst, const Glib::ustring &workingSpace);
}; };
} }
#endif #endif

View File

@ -316,21 +316,21 @@ class AutoWBListener
{ {
public : public :
virtual ~AutoWBListener() = default; virtual ~AutoWBListener() = default;
virtual void WBChanged(double temp, double green) = 0; virtual void WBChanged (double temp, double green) = 0;
}; };
class FrameCountListener class FrameCountListener
{ {
public : public :
virtual ~FrameCountListener() = default; virtual ~FrameCountListener() = default;
virtual void FrameCountChanged(int n, int frameNum) = 0; virtual void FrameCountChanged (int n, int frameNum) = 0;
}; };
class ImageTypeListener class ImageTypeListener
{ {
public : public :
virtual ~ImageTypeListener() = default; virtual ~ImageTypeListener() = default;
virtual void imageTypeChanged(bool isRaw, bool isBayer, bool isXtrans) = 0; virtual void imageTypeChanged (bool isRaw, bool isBayer, bool isXtrans) = 0;
}; };
class WaveletListener class WaveletListener
@ -388,7 +388,7 @@ public:
virtual void endUpdateParams (ProcEvent change) = 0; virtual void endUpdateParams (ProcEvent change) = 0;
virtual void endUpdateParams (int changeFlags) = 0; virtual void endUpdateParams (int changeFlags) = 0;
// Starts a minimal update // Starts a minimal update
virtual void startProcessing(int changeCode) = 0; virtual void startProcessing (int changeCode) = 0;
/** Stops image processing. When it returns, the image processing is already stopped. */ /** Stops image processing. When it returns, the image processing is already stopped. */
virtual void stopProcessing () = 0; virtual void stopProcessing () = 0;
/** Sets the scale of the preview image. The larger the number is, the faster the image updates are (typical values are 4-5). /** Sets the scale of the preview image. The larger the number is, the faster the image updates are (typical values are 4-5).
@ -481,7 +481,7 @@ public:
* @param isRaw shall be true if it is a raw file * @param isRaw shall be true if it is a raw file
* @param pparams is a struct containing the processing parameters * @param pparams is a struct containing the processing parameters
* @return an object containing the data above. It can be passed to the functions that do the actual image processing. */ * @return an object containing the data above. It can be passed to the functions that do the actual image processing. */
static ProcessingJob* create (const Glib::ustring& fname, bool isRaw, const procparams::ProcParams& pparams, bool fast=false); static ProcessingJob* create (const Glib::ustring& fname, bool isRaw, const procparams::ProcParams& pparams, bool fast = false);
/** Creates a processing job from a file name. This function always succeeds. It only stores the data into the ProcessingJob class, it does not load /** Creates a processing job from a file name. This function always succeeds. It only stores the data into the ProcessingJob class, it does not load
* the image thus it returns immediately. This function increases the reference count of the initialImage. If you decide not the process the image you * the image thus it returns immediately. This function increases the reference count of the initialImage. If you decide not the process the image you
@ -490,7 +490,7 @@ public:
* @param initialImage is a loaded and pre-processed initial image * @param initialImage is a loaded and pre-processed initial image
* @param pparams is a struct containing the processing parameters * @param pparams is a struct containing the processing parameters
* @return an object containing the data above. It can be passed to the functions that do the actual image processing. */ * @return an object containing the data above. It can be passed to the functions that do the actual image processing. */
static ProcessingJob* create (InitialImage* initialImage, const procparams::ProcParams& pparams, bool fast=false); static ProcessingJob* create (InitialImage* initialImage, const procparams::ProcParams& pparams, bool fast = false);
/** Cancels and destroys a processing job. The reference count of the corresponding initialImage (if any) is decreased. After the call of this function the ProcessingJob instance /** Cancels and destroys a processing job. The reference count of the corresponding initialImage (if any) is decreased. After the call of this function the ProcessingJob instance
* gets invalid, you must not use it any more. Dont call this function while the job is being processed. * gets invalid, you must not use it any more. Dont call this function while the job is being processed.
@ -519,7 +519,7 @@ public:
* @param img is the result of the last ProcessingJob * @param img is the result of the last ProcessingJob
* @return the next ProcessingJob to process */ * @return the next ProcessingJob to process */
virtual ProcessingJob* imageReady (IImage16* img) = 0; virtual ProcessingJob* imageReady (IImage16* img) = 0;
virtual void error(Glib::ustring message) = 0; virtual void error (Glib::ustring message) = 0;
}; };
/** This function performs all the image processinf steps corresponding to the given ProcessingJob. It runs in the background, thus it returns immediately, /** This function performs all the image processinf steps corresponding to the given ProcessingJob. It runs in the background, thus it returns immediately,
* When it finishes, it calls the BatchProcessingListener with the resulting image and asks for the next job. It the listener gives a new job, it goes on * When it finishes, it calls the BatchProcessingListener with the resulting image and asks for the next job. It the listener gives a new job, it goes on

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -70,7 +70,7 @@ static double wbSlider2la (double sval)
if (sval <= 500) { if (sval <= 500) {
// linear below center-temp // linear below center-temp
la= MINLA0 + (sval / 500.0) * (CENTERLA0 - MINLA0); la = MINLA0 + (sval / 500.0) * (CENTERLA0 - MINLA0);
} else { } else {
const double slope = (double) (CENTERLA0 - MINLA0) / (MAXLA0 - CENTERLA0); const double slope = (double) (CENTERLA0 - MINLA0) / (MAXLA0 - CENTERLA0);
double x = (sval - 500) / 500; // x 0..1 double x = (sval - 500) / 500; // x 0..1
@ -234,8 +234,8 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance"
degree->set_tooltip_markup (M ("TP_COLORAPP_DEGREE_TOOLTIP")); degree->set_tooltip_markup (M ("TP_COLORAPP_DEGREE_TOOLTIP"));
p1VBox->pack_start (*degree); p1VBox->pack_start (*degree);
// surrsource = Gtk::manage (new Gtk::CheckButton (M ("TP_COLORAPP_SURSOURCE"))); // surrsource = Gtk::manage (new Gtk::CheckButton (M ("TP_COLORAPP_SURSOURCE")));
// surrsource->set_tooltip_markup (M ("TP_COLORAPP_SURSOURCE_TOOLTIP")); // surrsource->set_tooltip_markup (M ("TP_COLORAPP_SURSOURCE_TOOLTIP"));
Gtk::HBox* surrHBox1 = Gtk::manage (new Gtk::HBox ()); Gtk::HBox* surrHBox1 = Gtk::manage (new Gtk::HBox ());
@ -252,7 +252,7 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance"
surrHBox1->pack_start (*surrsrc); surrHBox1->pack_start (*surrsrc);
p1VBox->pack_start (*surrHBox1); p1VBox->pack_start (*surrHBox1);
// p1VBox->pack_start (*surrsource, Gtk::PACK_SHRINK); // p1VBox->pack_start (*surrsource, Gtk::PACK_SHRINK);
Gtk::HBox* wbmHBox = Gtk::manage (new Gtk::HBox ()); Gtk::HBox* wbmHBox = Gtk::manage (new Gtk::HBox ());
wbmHBox->set_spacing (2); wbmHBox->set_spacing (2);
@ -284,7 +284,7 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance"
p1VBox->pack_start (*greensc); p1VBox->pack_start (*greensc);
// adapscen = Gtk::manage (new Adjuster (M ("TP_COLORAPP_ADAPTSCENE"), 0.01, 16384., 0.001, 2000.)); // EV -7 ==> EV 17 // adapscen = Gtk::manage (new Adjuster (M ("TP_COLORAPP_ADAPTSCENE"), 0.01, 16384., 0.001, 2000.)); // EV -7 ==> EV 17
adapscen = Gtk::manage (new Adjuster (M ("TP_COLORAPP_ADAPTSCENE"), MINLA0, MAXLA0, 0.01, 1997.4, NULL, NULL, &wbSlider2la, &wbla2Slider)); adapscen = Gtk::manage (new Adjuster (M ("TP_COLORAPP_ADAPTSCENE"), MINLA0, MAXLA0, 0.01, 1997.4, NULL, NULL, &wbSlider2la, &wbla2Slider));
if (adapscen->delay < options.adjusterMaxDelay) { if (adapscen->delay < options.adjusterMaxDelay) {
@ -316,17 +316,17 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance"
// Process 1 frame // Process 1 frame
expadjust = Gtk::manage(new MyExpander(false, M ("TP_COLORAPP_LABEL_CAM02"))); expadjust = Gtk::manage (new MyExpander (false, M ("TP_COLORAPP_LABEL_CAM02")));
setExpandAlignProperties (expadjust, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); setExpandAlignProperties (expadjust, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
expadjust->signal_button_release_event().connect_notify ( sigc::bind ( sigc::mem_fun (this, &ColorAppearance::foldAllButMe), expadjust) ); expadjust->signal_button_release_event().connect_notify ( sigc::bind ( sigc::mem_fun (this, &ColorAppearance::foldAllButMe), expadjust) );
/* /*
Gtk::Frame *p2Frame; Gtk::Frame *p2Frame;
// Vertical box container for the content of the Process 1 frame // Vertical box container for the content of the Process 1 frame
Gtk::VBox *p2VBox; Gtk::VBox *p2VBox;
p2Frame = Gtk::manage (new Gtk::Frame (M ("TP_COLORAPP_LABEL_CAM02")) ); p2Frame = Gtk::manage (new Gtk::Frame (M ("TP_COLORAPP_LABEL_CAM02")) );
p2Frame->set_label_align (0.025, 0.5); p2Frame->set_label_align (0.025, 0.5);
*/ */
Gtk::VBox *p2VBox; Gtk::VBox *p2VBox;
p2VBox = Gtk::manage ( new Gtk::VBox()); p2VBox = Gtk::manage ( new Gtk::VBox());
@ -554,8 +554,8 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance"
// p2Frame->add (*p2VBox); // p2Frame->add (*p2VBox);
expadjust->add (*p2VBox, false); expadjust->add (*p2VBox, false);
expadjust->setLevel(2); expadjust->setLevel (2);
pack_start (*expadjust); pack_start (*expadjust);
// pack_start (*p2Frame, Gtk::PACK_EXPAND_WIDGET, 4); // pack_start (*p2Frame, Gtk::PACK_EXPAND_WIDGET, 4);
@ -579,7 +579,7 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance"
Gtk::Image* itempR1 = Gtk::manage (new RTImage ("ajd-wb-temp2.png")); Gtk::Image* itempR1 = Gtk::manage (new RTImage ("ajd-wb-temp2.png"));
Gtk::Image* igreenL1 = Gtk::manage (new RTImage ("ajd-wb-green1.png")); Gtk::Image* igreenL1 = Gtk::manage (new RTImage ("ajd-wb-green1.png"));
Gtk::Image* igreenR1 = Gtk::manage (new RTImage ("ajd-wb-green2.png")); Gtk::Image* igreenR1 = Gtk::manage (new RTImage ("ajd-wb-green2.png"));
// adaplum = Gtk::manage (new Adjuster (M ("TP_COLORAPP_ADAPTVIEWING"), 0.1, 16384., 0.1, 16.)); // adaplum = Gtk::manage (new Adjuster (M ("TP_COLORAPP_ADAPTVIEWING"), 0.1, 16384., 0.1, 16.));
adaplum = Gtk::manage (new Adjuster (M ("TP_COLORAPP_ADAPTVIEWING"), MINLA0, MAXLA0, 0.01, 16, NULL, NULL, &wbSlider2la, &wbla2Slider)); adaplum = Gtk::manage (new Adjuster (M ("TP_COLORAPP_ADAPTVIEWING"), MINLA0, MAXLA0, 0.01, 16, NULL, NULL, &wbSlider2la, &wbla2Slider));
if (adaplum->delay < options.adjusterMaxDelay) { if (adaplum->delay < options.adjusterMaxDelay) {
@ -603,12 +603,12 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance"
degreeout->addAutoButton (M ("TP_COLORAPP_DEGREE_AUTO_TOOLTIP")); degreeout->addAutoButton (M ("TP_COLORAPP_DEGREE_AUTO_TOOLTIP"));
degreeout->set_tooltip_markup (M ("TP_COLORAPP_DEGREE_TOOLTIP")); degreeout->set_tooltip_markup (M ("TP_COLORAPP_DEGREE_TOOLTIP"));
p3VBox->pack_start (*degreeout); p3VBox->pack_start (*degreeout);
/* /*
Gtk::Image* itempL1 = Gtk::manage (new RTImage ("ajd-wb-temp1.png")); Gtk::Image* itempL1 = Gtk::manage (new RTImage ("ajd-wb-temp1.png"));
Gtk::Image* itempR1 = Gtk::manage (new RTImage ("ajd-wb-temp2.png")); Gtk::Image* itempR1 = Gtk::manage (new RTImage ("ajd-wb-temp2.png"));
Gtk::Image* igreenL1 = Gtk::manage (new RTImage ("ajd-wb-green1.png")); Gtk::Image* igreenL1 = Gtk::manage (new RTImage ("ajd-wb-green1.png"));
Gtk::Image* igreenR1 = Gtk::manage (new RTImage ("ajd-wb-green2.png")); Gtk::Image* igreenR1 = Gtk::manage (new RTImage ("ajd-wb-green2.png"));
*/ */
tempout = Gtk::manage (new Adjuster (M ("TP_WBALANCE_TEMPERATURE"), MINTEMP0, MAXTEMP0, 5, CENTERTEMP0, itempR1, itempL1, &wbSlider2Temp, &wbTemp2Slider)); tempout = Gtk::manage (new Adjuster (M ("TP_WBALANCE_TEMPERATURE"), MINTEMP0, MAXTEMP0, 5, CENTERTEMP0, itempR1, itempL1, &wbSlider2Temp, &wbTemp2Slider));
greenout = Gtk::manage (new Adjuster (M ("TP_WBALANCE_GREEN"), MINGREEN0, MAXGREEN0, 0.001, 1.0, igreenR1, igreenL1)); greenout = Gtk::manage (new Adjuster (M ("TP_WBALANCE_GREEN"), MINGREEN0, MAXGREEN0, 0.001, 1.0, igreenR1, igreenL1));
ybout = Gtk::manage (new Adjuster (M ("TP_COLORAPP_YB"), 5, 90, 1, 18)); ybout = Gtk::manage (new Adjuster (M ("TP_COLORAPP_YB"), 5, 90, 1, 18));
@ -666,7 +666,7 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance"
pack_start (*badpixsl, Gtk::PACK_SHRINK); pack_start (*badpixsl, Gtk::PACK_SHRINK);
//reset button //reset button
neutral = Gtk::manage (new Gtk::Button (M ("TP_COLORAPP_NEUTRAL"))); neutral = Gtk::manage (new Gtk::Button (M ("TP_COLORAPP_NEUTRAL")));
setExpandAlignProperties (neutral, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); setExpandAlignProperties (neutral, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
RTImage *resetImg = Gtk::manage (new RTImage ("gtk-undo-ltr-small.png", "gtk-undo-rtl-small.png")); RTImage *resetImg = Gtk::manage (new RTImage ("gtk-undo-ltr-small.png", "gtk-undo-rtl-small.png"));
@ -683,7 +683,7 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance"
// ------------------------ Listening events // ------------------------ Listening events
// surrconn = surrsource->signal_toggled().connect ( sigc::mem_fun (*this, &ColorAppearance::surrsource_toggled) ); // surrconn = surrsource->signal_toggled().connect ( sigc::mem_fun (*this, &ColorAppearance::surrsource_toggled) );
wbmodelconn = wbmodel->signal_changed().connect ( sigc::mem_fun (*this, &ColorAppearance::wbmodelChanged) ); wbmodelconn = wbmodel->signal_changed().connect ( sigc::mem_fun (*this, &ColorAppearance::wbmodelChanged) );
algoconn = algo->signal_changed().connect ( sigc::mem_fun (*this, &ColorAppearance::algoChanged) ); algoconn = algo->signal_changed().connect ( sigc::mem_fun (*this, &ColorAppearance::algoChanged) );
surroundconn = surround->signal_changed().connect ( sigc::mem_fun (*this, &ColorAppearance::surroundChanged) ); surroundconn = surround->signal_changed().connect ( sigc::mem_fun (*this, &ColorAppearance::surroundChanged) );
@ -726,57 +726,57 @@ ColorAppearance::~ColorAppearance ()
void ColorAppearance::foldAllButMe (GdkEventButton* event, MyExpander *expander) void ColorAppearance::foldAllButMe (GdkEventButton* event, MyExpander *expander)
{ {
if (event->button == 3) { if (event->button == 3) {
expadjust->set_expanded(expadjust == expander); expadjust->set_expanded (expadjust == expander);
} }
} }
void ColorAppearance::writeOptions(std::vector<int> &tpOpen) void ColorAppearance::writeOptions (std::vector<int> &tpOpen)
{ {
tpOpen.push_back (expadjust->get_expanded ()); tpOpen.push_back (expadjust->get_expanded ());
} }
void ColorAppearance::updateToolState(std::vector<int> &tpOpen) void ColorAppearance::updateToolState (std::vector<int> &tpOpen)
{ {
if(tpOpen.size() >= 1) { if (tpOpen.size() >= 1) {
expadjust->set_expanded(tpOpen.at(0)); expadjust->set_expanded (tpOpen.at (0));
} }
} }
void ColorAppearance::neutral_pressed () void ColorAppearance::neutral_pressed ()
{ {
jlight->resetValue (false); jlight->resetValue (false);
qbright->resetValue (false); qbright->resetValue (false);
chroma->resetValue (false); chroma->resetValue (false);
schroma->resetValue (false); schroma->resetValue (false);
mchroma->resetValue (false); mchroma->resetValue (false);
rstprotection->resetValue (false); rstprotection->resetValue (false);
contrast->resetValue (false); contrast->resetValue (false);
qcontrast->resetValue (false); qcontrast->resetValue (false);
colorh->resetValue (false); colorh->resetValue (false);
tempout->resetValue (false); tempout->resetValue (false);
greenout->resetValue (false); greenout->resetValue (false);
ybout->resetValue (false); ybout->resetValue (false);
tempsc->resetValue (false); tempsc->resetValue (false);
greensc->resetValue (false); greensc->resetValue (false);
badpixsl->resetValue (false); badpixsl->resetValue (false);
wbmodel->set_active (0); wbmodel->set_active (0);
toneCurveMode->set_active (0); toneCurveMode->set_active (0);
toneCurveMode2->set_active (0); toneCurveMode2->set_active (0);
toneCurveMode3->set_active (0); toneCurveMode3->set_active (0);
shape->reset(); shape->reset();
shape2->reset(); shape2->reset();
shape3->reset(); shape3->reset();
gamutconn.block (true); gamutconn.block (true);
gamut->set_active (true); gamut->set_active (true);
gamutconn.block (false); gamutconn.block (false);
degree->setAutoValue (true); degree->setAutoValue (true);
degree->resetValue (false); degree->resetValue (false);
adapscen->resetValue (false); adapscen->resetValue (false);
adapscen->setAutoValue (true); adapscen->setAutoValue (true);
degreeout->resetValue (false); degreeout->resetValue (false);
degreeout->setAutoValue (true); degreeout->setAutoValue (true);
ybscen->resetValue (false); ybscen->resetValue (false);
ybscen->setAutoValue (true); ybscen->setAutoValue (true);
} }
bool ColorAppearance::bgTTipQuery (int x, int y, bool keyboard_tooltip, const Glib::RefPtr<Gtk::Tooltip>& tooltip) bool ColorAppearance::bgTTipQuery (int x, int y, bool keyboard_tooltip, const Glib::RefPtr<Gtk::Tooltip>& tooltip)
@ -932,9 +932,9 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited)
// Have to be manually called to handle initial state update // Have to be manually called to handle initial state update
algoChanged(); algoChanged();
// surrconn.block (true); // surrconn.block (true);
// surrsource->set_active (pp->colorappearance.surrsource); // surrsource->set_active (pp->colorappearance.surrsource);
// surrconn.block (false); // surrconn.block (false);
gamutconn.block (true); gamutconn.block (true);
gamut->set_active (pp->colorappearance.gamut); gamut->set_active (pp->colorappearance.gamut);
gamutconn.block (false); gamutconn.block (false);
@ -951,7 +951,7 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited)
// sharpcie->set_active (pp->colorappearance.sharpcie); // sharpcie->set_active (pp->colorappearance.sharpcie);
// sharpcieconn.block (false); // sharpcieconn.block (false);
// lastsurr = pp->colorappearance.surrsource; // lastsurr = pp->colorappearance.surrsource;
lastgamut = pp->colorappearance.gamut; lastgamut = pp->colorappearance.gamut;
// lastbadpix=pp->colorappearance.badpix; // lastbadpix=pp->colorappearance.badpix;
lastdatacie = pp->colorappearance.datacie; lastdatacie = pp->colorappearance.datacie;
@ -1026,7 +1026,7 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited)
pp->colorappearance.qcontrast = qcontrast->getValue (); pp->colorappearance.qcontrast = qcontrast->getValue ();
pp->colorappearance.colorh = colorh->getValue (); pp->colorappearance.colorh = colorh->getValue ();
pp->colorappearance.rstprotection = rstprotection->getValue (); pp->colorappearance.rstprotection = rstprotection->getValue ();
// pp->colorappearance.surrsource = surrsource->get_active(); // pp->colorappearance.surrsource = surrsource->get_active();
pp->colorappearance.gamut = gamut->get_active(); pp->colorappearance.gamut = gamut->get_active();
// pp->colorappearance.badpix = badpix->get_active(); // pp->colorappearance.badpix = badpix->get_active();
pp->colorappearance.datacie = datacie->get_active(); pp->colorappearance.datacie = datacie->get_active();
@ -1092,7 +1092,7 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited)
pedited->colorappearance.surrsrc = surrsrc->get_active_text() != M ("GENERAL_UNCHANGED"); pedited->colorappearance.surrsrc = surrsrc->get_active_text() != M ("GENERAL_UNCHANGED");
pedited->colorappearance.wbmodel = wbmodel->get_active_text() != M ("GENERAL_UNCHANGED"); pedited->colorappearance.wbmodel = wbmodel->get_active_text() != M ("GENERAL_UNCHANGED");
pedited->colorappearance.algo = algo->get_active_text() != M ("GENERAL_UNCHANGED"); pedited->colorappearance.algo = algo->get_active_text() != M ("GENERAL_UNCHANGED");
// pedited->colorappearance.surrsource = !surrsource->get_inconsistent(); // pedited->colorappearance.surrsource = !surrsource->get_inconsistent();
pedited->colorappearance.gamut = !gamut->get_inconsistent(); pedited->colorappearance.gamut = !gamut->get_inconsistent();
// pedited->colorappearance.badpix = !badpix->get_inconsistent(); // pedited->colorappearance.badpix = !badpix->get_inconsistent();
pedited->colorappearance.datacie = !datacie->get_inconsistent(); pedited->colorappearance.datacie = !datacie->get_inconsistent();
@ -1452,7 +1452,7 @@ void ColorAppearance::setDefaults (const ProcParams* defParams, const ParamsEdit
void ColorAppearance::autoCamChanged (double ccam, double ccamout) void ColorAppearance::autoCamChanged (double ccam, double ccamout)
{ {
nextCcam = ccam; nextCcam = ccam;
nextCcamout = ccamout; nextCcamout = ccamout;
const auto func = [] (gpointer data) -> gboolean { const auto func = [] (gpointer data) -> gboolean {
static_cast<ColorAppearance*> (data)->autoCamComputed_(); static_cast<ColorAppearance*> (data)->autoCamComputed_();
@ -1468,7 +1468,7 @@ bool ColorAppearance::autoCamComputed_ ()
disableListener (); disableListener ();
// degree->setEnabled (true); // degree->setEnabled (true);
degree->setValue (nextCcam); degree->setValue (nextCcam);
degreeout->setValue (nextCcamout); degreeout->setValue (nextCcamout);
enableListener (); enableListener ();
return false; return false;
@ -1492,7 +1492,7 @@ bool ColorAppearance::adapCamComputed_ ()
disableListener (); disableListener ();
// degree->setEnabled (true); // degree->setEnabled (true);
adapscen->setValue (nextCadap); adapscen->setValue (nextCadap);
// ybscen->setValue (nextYbscn); // ybscen->setValue (nextYbscn);
enableListener (); enableListener ();
return false; return false;
@ -1500,7 +1500,7 @@ bool ColorAppearance::adapCamComputed_ ()
void ColorAppearance::ybCamChanged (int ybsc) void ColorAppearance::ybCamChanged (int ybsc)
{ {
nextYbscn = ybsc; nextYbscn = ybsc;
const auto func = [] (gpointer data) -> gboolean { const auto func = [] (gpointer data) -> gboolean {
static_cast<ColorAppearance*> (data)->ybCamComputed_(); static_cast<ColorAppearance*> (data)->ybCamComputed_();
@ -1516,7 +1516,7 @@ bool ColorAppearance::ybCamComputed_ ()
disableListener (); disableListener ();
// degree->setEnabled (true); // degree->setEnabled (true);
// adapscen->setValue (nextCadap); // adapscen->setValue (nextCadap);
ybscen->setValue (nextYbscn); ybscen->setValue (nextYbscn);
enableListener (); enableListener ();
return false; return false;
@ -1718,13 +1718,14 @@ void ColorAppearance::surroundChanged ()
void ColorAppearance::wbmodelChanged () void ColorAppearance::wbmodelChanged ()
{ {
if (wbmodel->get_active_row_number() == 0 || wbmodel->get_active_row_number() == 1) { if (wbmodel->get_active_row_number() == 0 || wbmodel->get_active_row_number() == 1) {
tempsc->hide(); tempsc->hide();
greensc->hide(); greensc->hide();
} }
if (wbmodel->get_active_row_number() == 2){
tempsc->show(); if (wbmodel->get_active_row_number() == 2) {
greensc->show(); tempsc->show();
} greensc->show();
}
if (listener && (multiImage || getEnabled()) ) { if (listener && (multiImage || getEnabled()) ) {
listener->panelChanged (EvCATMethodWB, wbmodel->get_active_text ()); listener->panelChanged (EvCATMethodWB, wbmodel->get_active_text ());

View File

@ -150,7 +150,7 @@ private:
DiagonalCurveEditor* shape2; DiagonalCurveEditor* shape2;
DiagonalCurveEditor* shape3; DiagonalCurveEditor* shape3;
double nextCcam, nextCcamout, nextCadap; double nextCcam, nextCcamout, nextCadap;
int nextYbscn; int nextYbscn;
bool lastAutoDegree; bool lastAutoDegree;
bool lastAutoAdapscen; bool lastAutoAdapscen;
bool lastAutoDegreeout; bool lastAutoDegreeout;