Solving issue 2124: "Contrast by Detail Levels - 5 levels"
This commit is contained in:
@@ -328,7 +328,7 @@ HISTORY_MSG_89;Réd. du bruit
|
||||
HISTORY_MSG_90;Réd. de bruit Luminance
|
||||
HISTORY_MSG_91;Réd. de bruit Chrominance
|
||||
HISTORY_MSG_92;Réd. de bruit Gamma
|
||||
HISTORY_MSG_93;Param. de contraste
|
||||
HISTORY_MSG_93;Param. de contraste par niv. de détail
|
||||
HISTORY_MSG_94;Contraste par niveau de détail
|
||||
HISTORY_MSG_95;Chromaticité
|
||||
HISTORY_MSG_96;Courbe 'a'
|
||||
@@ -480,6 +480,7 @@ HISTORY_MSG_242;Effet Vignettage - Circularité
|
||||
HISTORY_MSG_243;Vignettage - Rayon
|
||||
HISTORY_MSG_244;Vignettage - Force
|
||||
HISTORY_MSG_245;Vignettage - Centre
|
||||
HISTORY_MSG_249;Seuil du contraste par niv. de détail
|
||||
HISTORY_NEWSNAPSHOTAS;Sous...
|
||||
HISTORY_NEWSNAPSHOT;Ajouter
|
||||
HISTORY_NEWSNAPSHOT_TOOLTIP;Raccourci: <b>Alt-s</b>
|
||||
|
||||
@@ -482,6 +482,7 @@ HISTORY_MSG_245;Vignetting - Center
|
||||
HISTORY_MSG_246;"CL" curve
|
||||
HISTORY_MSG_247;"LH" curve
|
||||
HISTORY_MSG_248;"HH" curve
|
||||
HISTORY_MSG_249;Contrast by Detail Levels Threshold
|
||||
HISTORY_NEWSNAPSHOTAS;As...
|
||||
HISTORY_NEWSNAPSHOT;Add
|
||||
HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: <b>Alt-s</b>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
namespace rtengine {
|
||||
|
||||
static const int maxlevel = 4;
|
||||
static const int maxlevel = 5;
|
||||
static const float noise = 2000;
|
||||
static const float thresh = 1000;
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace rtengine {
|
||||
//scale is spacing of directional averaging weights
|
||||
|
||||
|
||||
void ImProcFunctions :: dirpyr_equalizer(float ** src, float ** dst, int srcwidth, int srcheight, const double * mult)
|
||||
void ImProcFunctions :: dirpyr_equalizer(float ** src, float ** dst, int srcwidth, int srcheight, const double * mult, const double dirpyrThreshold )
|
||||
{
|
||||
int lastlevel=maxlevel;
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace rtengine {
|
||||
int scale = scales[level];
|
||||
//int thresh = 100 * mult[5];
|
||||
|
||||
dirpyr_channel(src, dirpyrlo[0], srcwidth, srcheight, 0, scale, mult );
|
||||
dirpyr_channel(src, dirpyrlo[0], srcwidth, srcheight, 0, scale );
|
||||
|
||||
level = 1;
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace rtengine {
|
||||
{
|
||||
scale = scales[level];
|
||||
|
||||
dirpyr_channel(dirpyrlo[level-1], dirpyrlo[level], srcwidth, srcheight, level, scale, mult );
|
||||
dirpyr_channel(dirpyrlo[level-1], dirpyrlo[level], srcwidth, srcheight, level, scale );
|
||||
|
||||
level ++;
|
||||
}
|
||||
@@ -99,13 +99,13 @@ namespace rtengine {
|
||||
|
||||
for(int level = lastlevel - 1; level > 0; level--)
|
||||
{
|
||||
idirpyr_eq_channel(dirpyrlo[level], dirpyrlo[level-1], buffer, srcwidth, srcheight, level, mult );
|
||||
idirpyr_eq_channel(dirpyrlo[level], dirpyrlo[level-1], buffer, srcwidth, srcheight, level, mult, dirpyrThreshold );
|
||||
}
|
||||
|
||||
|
||||
scale = scales[0];
|
||||
|
||||
idirpyr_eq_channel(dirpyrlo[0], dst, buffer, srcwidth, srcheight, 0, mult );
|
||||
idirpyr_eq_channel(dirpyrlo[0], dst, buffer, srcwidth, srcheight, 0, mult, dirpyrThreshold );
|
||||
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
@@ -125,7 +125,7 @@ namespace rtengine {
|
||||
|
||||
|
||||
|
||||
void ImProcFunctions :: dirpyr_equalizercam (CieImage *ncie, float ** src, float ** dst, int srcwidth, int srcheight, const double * mult, bool execdir )
|
||||
void ImProcFunctions :: dirpyr_equalizercam (CieImage *ncie, float ** src, float ** dst, int srcwidth, int srcheight, const double * mult, const double dirpyrThreshold, bool execdir )
|
||||
{
|
||||
int lastlevel=maxlevel;
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace rtengine {
|
||||
int scale = scales[level];
|
||||
//int thresh = 100 * mult[5];
|
||||
|
||||
dirpyr_channel(src, dirpyrlo[0], srcwidth, srcheight, 0, scale, mult );
|
||||
dirpyr_channel(src, dirpyrlo[0], srcwidth, srcheight, 0, scale );
|
||||
|
||||
level = 1;
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace rtengine {
|
||||
{
|
||||
scale = scales[level];
|
||||
|
||||
dirpyr_channel(dirpyrlo[level-1], dirpyrlo[level], srcwidth, srcheight, level, scale, mult );
|
||||
dirpyr_channel(dirpyrlo[level-1], dirpyrlo[level], srcwidth, srcheight, level, scale );
|
||||
|
||||
level ++;
|
||||
}
|
||||
@@ -172,13 +172,13 @@ namespace rtengine {
|
||||
|
||||
for(int level = lastlevel - 1; level > 0; level--)
|
||||
{
|
||||
idirpyr_eq_channel(dirpyrlo[level], dirpyrlo[level-1], buffer, srcwidth, srcheight, level, mult );
|
||||
idirpyr_eq_channel(dirpyrlo[level], dirpyrlo[level-1], buffer, srcwidth, srcheight, level, mult, dirpyrThreshold );
|
||||
}
|
||||
|
||||
|
||||
scale = scales[0];
|
||||
|
||||
idirpyr_eq_channel(dirpyrlo[0], dst, buffer, srcwidth, srcheight, 0, mult );
|
||||
idirpyr_eq_channel(dirpyrlo[0], dst, buffer, srcwidth, srcheight, 0, mult, dirpyrThreshold );
|
||||
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
@@ -188,8 +188,10 @@ namespace rtengine {
|
||||
#endif
|
||||
for (int i=0; i<srcheight; i++)
|
||||
for (int j=0; j<srcwidth; j++) {
|
||||
if(ncie->J_p[i][j] > 8.f && ncie->J_p[i][j] < 92.f) dst[i][j] = CLIP((int)( buffer[i][j] )); // TODO: Really a clip necessary?
|
||||
else dst[i][j]=src[i][j];
|
||||
if(ncie->J_p[i][j] > 8.f && ncie->J_p[i][j] < 92.f)
|
||||
dst[i][j] = CLIP((int)( buffer[i][j] )); // TODO: Really a clip necessary?
|
||||
else
|
||||
dst[i][j]=src[i][j];
|
||||
}
|
||||
else
|
||||
for (int i=0; i<srcheight; i++)
|
||||
@@ -201,9 +203,9 @@ namespace rtengine {
|
||||
|
||||
|
||||
#if defined( __SSE2__ ) && defined( WIN32 )
|
||||
__attribute__((force_align_arg_pointer)) void ImProcFunctions::dirpyr_channel(float ** data_fine, float ** data_coarse, int width, int height, int level, int scale, const double * mult )
|
||||
__attribute__((force_align_arg_pointer)) void ImProcFunctions::dirpyr_channel(float ** data_fine, float ** data_coarse, int width, int height, int level, int scale )
|
||||
#else
|
||||
void ImProcFunctions::dirpyr_channel(float ** data_fine, float ** data_coarse, int width, int height, int level, int scale, const double * mult )
|
||||
void ImProcFunctions::dirpyr_channel(float ** data_fine, float ** data_coarse, int width, int height, int level, int scale )
|
||||
#endif
|
||||
{
|
||||
//scale is spacing of directional averaging weights
|
||||
@@ -407,9 +409,9 @@ void ImProcFunctions::dirpyr_channel(float ** data_fine, float ** data_coarse, i
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
void ImProcFunctions::idirpyr_eq_channel(float ** data_coarse, float ** data_fine, float ** buffer, int width, int height, int level, const double * mult )
|
||||
void ImProcFunctions::idirpyr_eq_channel(float ** data_coarse, float ** data_fine, float ** buffer, int width, int height, int level, const double * mult, const double dirpyrThreshold )
|
||||
{
|
||||
float noisehi = 1.33*noise*mult[4]/expf(level*log(3.0)), noiselo = 0.66*noise*mult[4]/expf(level*log(3.0));
|
||||
float noisehi = 1.33*noise*dirpyrThreshold/expf(level*log(3.0)), noiselo = 0.66*noise*dirpyrThreshold/expf(level*log(3.0));
|
||||
LUTf irangefn (0x20000);
|
||||
|
||||
for (int i=0; i<0x20000; i++) {
|
||||
|
||||
@@ -922,7 +922,7 @@ if (params->sharpenMicro.enabled)if(execsharp) ImProcFunctions::MLmicrocontrastc
|
||||
|
||||
if(params->sharpening.enabled) if(execsharp) {ImProcFunctions::sharpeningcam (ncie, (float**)buffer);} //sharpening adapted to CIECAM
|
||||
|
||||
if(params->dirpyrequalizer.enabled) if(execsharp) dirpyr_equalizercam(ncie, ncie->sh_p, ncie->sh_p, ncie->W, ncie->H, params->dirpyrequalizer.mult, true);//contrast by detail adapted to CIECAM
|
||||
if(params->dirpyrequalizer.enabled) if(execsharp) dirpyr_equalizercam(ncie, ncie->sh_p, ncie->sh_p, ncie->W, ncie->H, params->dirpyrequalizer.mult, params->dirpyrequalizer.threshold, true);//contrast by detail adapted to CIECAM
|
||||
|
||||
float Qredi= ( 4.0 / c_) * ( a_w + 4.0 );
|
||||
float co_e=(pow(f_l,0.25f));
|
||||
@@ -1734,7 +1734,7 @@ if (params->sharpenMicro.enabled)if(execsharp) ImProcFunctions::MLmicrocontrastc
|
||||
|
||||
if(params->sharpening.enabled) if(execsharp) {ImProcFunctions::sharpeningcam (ncie, (float**)buffer);} //sharpening adapted to CIECAM
|
||||
|
||||
if(params->dirpyrequalizer.enabled) if(execsharp) dirpyr_equalizercam(ncie, ncie->sh_p, ncie->sh_p, ncie->W, ncie->H, params->dirpyrequalizer.mult, true);//contrast by detail adapted to CIECAM
|
||||
if(params->dirpyrequalizer.enabled) if(execsharp) dirpyr_equalizercam(ncie, ncie->sh_p, ncie->sh_p, ncie->W, ncie->H, params->dirpyrequalizer.mult, params->dirpyrequalizer.threshold, true);//contrast by detail adapted to CIECAM
|
||||
|
||||
float Qredi= ( 4.0f / c_) * ( a_w + 4.0f );
|
||||
float co_e=(pow_F(f_l,0.25f));
|
||||
@@ -3513,7 +3513,7 @@ void ImProcFunctions::colorCurve (LabImage* lold, LabImage* lnew) {
|
||||
if (params->dirpyrequalizer.enabled && lab->W>=8 && lab->H>=8) {
|
||||
|
||||
//dirpyrLab_equalizer(lab, lab, params->dirpyrequalizer.mult);
|
||||
dirpyr_equalizer(lab->L, lab->L, lab->W, lab->H, params->dirpyrequalizer.mult);
|
||||
dirpyr_equalizer(lab->L, lab->L, lab->W, lab->H, params->dirpyrequalizer.mult, params->dirpyrequalizer.threshold);
|
||||
}
|
||||
}
|
||||
void ImProcFunctions::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, int skip){
|
||||
|
||||
@@ -271,10 +271,10 @@ class ImProcFunctions {
|
||||
float MadMax(float * HH_Coeffs, int &max, int datalen);
|
||||
|
||||
// pyramid equalizer
|
||||
void dirpyr_equalizer (float ** src, float ** dst, int srcwidth, int srcheight, const double * mult);//Emil's directional pyramid equalizer
|
||||
void dirpyr_equalizercam (CieImage* ncie, float ** src, float ** dst, int srcwidth, int srcheight, const double * mult, bool execdir );//Emil's directional pyramid equalizer
|
||||
void dirpyr_channel (float ** data_fine, float ** data_coarse, int width, int height, int level, int scale, const double * mult );
|
||||
void idirpyr_eq_channel (float ** data_coarse, float ** data_fine, float ** buffer, int width, int height, int level, const double * mult );
|
||||
void dirpyr_equalizer (float ** src, float ** dst, int srcwidth, int srcheight, const double * mult, const double dirpyrThreshold);//Emil's directional pyramid equalizer
|
||||
void dirpyr_equalizercam (CieImage* ncie, float ** src, float ** dst, int srcwidth, int srcheight, const double * mult, const double dirpyrThreshold, bool execdir );//Emil's directional pyramid equalizer
|
||||
void dirpyr_channel (float ** data_fine, float ** data_coarse, int width, int height, int level, int scale );
|
||||
void idirpyr_eq_channel (float ** data_coarse, float ** data_fine, float ** buffer, int width, int height, int level, const double * mult, const double dirpyrThreshold );
|
||||
|
||||
void defringe (LabImage* lab);
|
||||
void defringecam (CieImage* ncie);
|
||||
|
||||
@@ -271,8 +271,9 @@ enum ProcEvent {
|
||||
EvLCLCurve=245,
|
||||
EvLLHCurve=246,
|
||||
EvLHHCurve=247,
|
||||
EvDirPyrEqualizerThreshold=248,
|
||||
|
||||
NUMOFEVENTS=248
|
||||
NUMOFEVENTS=249
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -420,11 +420,11 @@ void ProcParams::setDefaults () {
|
||||
icm.freegamma = false;
|
||||
|
||||
dirpyrequalizer.enabled = false;
|
||||
for(int i = 0; i < 4; i ++)
|
||||
for(int i = 0; i < 5; i ++)
|
||||
{
|
||||
dirpyrequalizer.mult[i] = 1.0;
|
||||
}
|
||||
dirpyrequalizer.mult[4] = 0.2;
|
||||
dirpyrequalizer.threshold = 0.2;
|
||||
hsvequalizer.hcurve.clear ();
|
||||
hsvequalizer.hcurve.push_back (FCT_Linear);
|
||||
hsvequalizer.scurve.clear ();
|
||||
@@ -953,10 +953,10 @@ int ProcParams::save (Glib::ustring fname, Glib::ustring fname2, bool fnameAbsol
|
||||
if (!pedited || pedited->gradient.centerY) keyFile.set_integer ("Gradient", "CenterY", gradient.centerY);
|
||||
|
||||
// save post-crop vignette
|
||||
if (!pedited || pedited->pcvignette.enabled) keyFile.set_boolean ("PCVignette", "Enabled", pcvignette.enabled);
|
||||
if (!pedited || pedited->pcvignette.strength) keyFile.set_double ("PCVignette", "Strength", pcvignette.strength);
|
||||
if (!pedited || pedited->pcvignette.feather) keyFile.set_integer ("PCVignette", "Feather", pcvignette.feather);
|
||||
if (!pedited || pedited->pcvignette.roundness) keyFile.set_integer ("PCVignette", "Roundness", pcvignette.roundness);
|
||||
if (!pedited || pedited->pcvignette.enabled) keyFile.set_boolean ("PCVignette", "Enabled", pcvignette.enabled);
|
||||
if (!pedited || pedited->pcvignette.strength) keyFile.set_double ("PCVignette", "Strength", pcvignette.strength);
|
||||
if (!pedited || pedited->pcvignette.feather) keyFile.set_integer ("PCVignette", "Feather", pcvignette.feather);
|
||||
if (!pedited || pedited->pcvignette.roundness) keyFile.set_integer ("PCVignette", "Roundness", pcvignette.roundness);
|
||||
|
||||
// save C/A correction
|
||||
if (!pedited || pedited->cacorrection.red) keyFile.set_double ("CACorrection", "Red", cacorrection.red);
|
||||
@@ -982,11 +982,11 @@ int ProcParams::save (Glib::ustring fname, Glib::ustring fname2, bool fnameAbsol
|
||||
if (!pedited || pedited->icm.input) keyFile.set_string ("Color Management", "InputProfile", relativePathIfInside(fname, fnameAbsolute, icm.input));
|
||||
if (!pedited || pedited->icm.toneCurve) keyFile.set_boolean ("Color Management", "ToneCurve", icm.toneCurve);
|
||||
if (!pedited || pedited->icm.blendCMSMatrix) keyFile.set_boolean ("Color Management", "BlendCMSMatrix", icm.blendCMSMatrix);
|
||||
if (!pedited || pedited->icm.dcpIlluminant) keyFile.set_integer ("Color Management", "DCPIlluminant", icm.dcpIlluminant);
|
||||
if (!pedited || pedited->icm.dcpIlluminant) keyFile.set_integer ("Color Management", "DCPIlluminant", icm.dcpIlluminant);
|
||||
if (!pedited || pedited->icm.working) keyFile.set_string ("Color Management", "WorkingProfile", icm.working);
|
||||
if (!pedited || pedited->icm.output) keyFile.set_string ("Color Management", "OutputProfile", icm.output);
|
||||
if (!pedited || pedited->icm.gamma) keyFile.set_string ("Color Management", "Gammafree", icm.gamma);
|
||||
if (!pedited || pedited->icm.freegamma) keyFile.set_boolean ("Color Management", "Freegamma", icm.freegamma);
|
||||
if (!pedited || pedited->icm.freegamma) keyFile.set_boolean ("Color Management", "Freegamma", icm.freegamma);
|
||||
if (!pedited || pedited->icm.gampos) keyFile.set_double ("Color Management", "GammaValue", icm.gampos);
|
||||
if (!pedited || pedited->icm.slpos) keyFile.set_double ("Color Management", "GammaSlope", icm.slpos);
|
||||
|
||||
@@ -998,6 +998,7 @@ int ProcParams::save (Glib::ustring fname, Glib::ustring fname2, bool fnameAbsol
|
||||
ss << "Mult" << i;
|
||||
if (!pedited || pedited->dirpyrequalizer.mult[i]) keyFile.set_double("Directional Pyramid Equalizer", ss.str(), dirpyrequalizer.mult[i]);
|
||||
}
|
||||
if (!pedited || pedited->dirpyrequalizer.threshold) keyFile.set_double ("Directional Pyramid Equalizer", "Threshold", dirpyrequalizer.threshold);
|
||||
|
||||
// save hsv equalizer parameters
|
||||
if (!pedited || pedited->hsvequalizer.hcurve) {
|
||||
@@ -1617,10 +1618,25 @@ if (keyFile.has_group ("Color Management")) {
|
||||
// load directional pyramid equalizer parameters
|
||||
if (keyFile.has_group ("Directional Pyramid Equalizer")) {
|
||||
if (keyFile.has_key ("Directional Pyramid Equalizer", "Enabled")) { dirpyrequalizer.enabled = keyFile.get_boolean ("Directional Pyramid Equalizer", "Enabled"); if (pedited) pedited->dirpyrequalizer.enabled = true; }
|
||||
for(int i = 0; i < 5; i ++) {
|
||||
std::stringstream ss;
|
||||
ss << "Mult" << i;
|
||||
if(keyFile.has_key ("Directional Pyramid Equalizer", ss.str())) { dirpyrequalizer.mult[i] = keyFile.get_double ("Directional Pyramid Equalizer", ss.str()); if (pedited) pedited->dirpyrequalizer.mult[i] = true; }
|
||||
if (ppVersion < 316) {
|
||||
for(int i = 0; i < 5; i ++) {
|
||||
std::stringstream ss;
|
||||
ss << "Mult" << i;
|
||||
if(keyFile.has_key ("Directional Pyramid Equalizer", ss.str())) {
|
||||
if(i==4) { dirpyrequalizer.threshold = keyFile.get_double ("Directional Pyramid Equalizer", ss.str()); if (pedited) pedited->dirpyrequalizer.threshold = true; }
|
||||
else { dirpyrequalizer.mult[i] = keyFile.get_double ("Directional Pyramid Equalizer", ss.str()); if (pedited) pedited->dirpyrequalizer.mult[i] = true; }
|
||||
}
|
||||
}
|
||||
dirpyrequalizer.mult[4] = 1.0;
|
||||
}
|
||||
else {
|
||||
// 5 level equalizer + dedicated threshold parameter
|
||||
for(int i = 0; i < 5; i ++) {
|
||||
std::stringstream ss;
|
||||
ss << "Mult" << i;
|
||||
if(keyFile.has_key ("Directional Pyramid Equalizer", ss.str())) { dirpyrequalizer.mult[i] = keyFile.get_double ("Directional Pyramid Equalizer", ss.str()); if (pedited) pedited->dirpyrequalizer.mult[i] = true; }
|
||||
}
|
||||
if(keyFile.has_key ("Directional Pyramid Equalizer", "Threshold")) { dirpyrequalizer.threshold = keyFile.get_double ("Directional Pyramid Equalizer", "Threshold"); if (pedited) pedited->dirpyrequalizer.threshold = true; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1743,6 +1759,9 @@ bool operator==(const DirPyrEqualizerParams & a, const DirPyrEqualizerParams & b
|
||||
if(a.mult[i] != b.mult[i])
|
||||
return false;
|
||||
}
|
||||
if (a.threshold != b.threshold)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -740,7 +740,8 @@ class DirPyrEqualizerParams {
|
||||
|
||||
public:
|
||||
bool enabled;
|
||||
double mult[8];
|
||||
double mult[5];
|
||||
double threshold;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -267,7 +267,8 @@ TRANSFORM, // EvVignettingStrength
|
||||
TRANSFORM, // EvVignettingCenter
|
||||
LUMINANCECURVE, // EvLCLCurve
|
||||
LUMINANCECURVE, // EvLLHCurve
|
||||
LUMINANCECURVE // EvLHHCurve
|
||||
LUMINANCECURVE, // EvLHHCurve
|
||||
DIRPYREQUALIZER // EvDirPyrEqualizerThreshold
|
||||
|
||||
|
||||
//LUMINANCECURVE // EvCATsharpcie
|
||||
|
||||
@@ -75,8 +75,9 @@
|
||||
#define ADDSET_PCVIGNETTE_ROUNDNESS 67
|
||||
#define ADDSET_BLACKWHITE_HUES 68
|
||||
#define ADDSET_BLACKWHITE_GAMMA 69
|
||||
#define ADDSET_DIRPYREQ_THRESHOLD 70
|
||||
|
||||
// When adding items, make sure to update ADDSET_PARAM_NUM
|
||||
#define ADDSET_PARAM_NUM 70 // THIS IS USED AS A DELIMITER!!
|
||||
#define ADDSET_PARAM_NUM 71 // THIS IS USED AS A DELIMITER!!
|
||||
|
||||
#endif
|
||||
|
||||
@@ -145,7 +145,7 @@ void BatchToolPanelCoordinator::initSession () {
|
||||
blackwhite->setAdjusterBehavior (false,false);
|
||||
|
||||
shadowshighlights->setAdjusterBehavior (false, false, false);
|
||||
dirpyrequalizer->setAdjusterBehavior (false);
|
||||
dirpyrequalizer->setAdjusterBehavior (false, false);
|
||||
dirpyrdenoise->setAdjusterBehavior (false, false,false,false,false,false);
|
||||
preprocess->setAdjusterBehavior (false, false);
|
||||
rawcacorrection->setAdjusterBehavior (false);
|
||||
@@ -176,7 +176,7 @@ void BatchToolPanelCoordinator::initSession () {
|
||||
chmixer->setAdjusterBehavior (options.baBehav[ADDSET_CHMIXER] );
|
||||
blackwhite->setAdjusterBehavior (options.baBehav[ADDSET_BLACKWHITE_HUES],options.baBehav[ADDSET_BLACKWHITE_GAMMA]);
|
||||
shadowshighlights->setAdjusterBehavior (options.baBehav[ADDSET_SH_HIGHLIGHTS], options.baBehav[ADDSET_SH_SHADOWS], options.baBehav[ADDSET_SH_LOCALCONTRAST]);
|
||||
dirpyrequalizer->setAdjusterBehavior (options.baBehav[ADDSET_DIRPYREQ]);
|
||||
dirpyrequalizer->setAdjusterBehavior (options.baBehav[ADDSET_DIRPYREQ], options.baBehav[ADDSET_DIRPYREQ_THRESHOLD]);
|
||||
dirpyrdenoise->setAdjusterBehavior (options.baBehav[ADDSET_DIRPYRDN_LUMA],options.baBehav[ADDSET_DIRPYRDN_LUMDET],options.baBehav[ADDSET_DIRPYRDN_CHROMA],options.baBehav[ADDSET_DIRPYRDN_CHROMARED],options.baBehav[ADDSET_DIRPYRDN_CHROMABLUE], options.baBehav[ADDSET_DIRPYRDN_GAMMA]);
|
||||
preprocess->setAdjusterBehavior (options.baBehav[ADDSET_PREPROCESS_LINEDENOISE], options.baBehav[ADDSET_PREPROCESS_GREENEQUIL]);
|
||||
rawcacorrection->setAdjusterBehavior (options.baBehav[ADDSET_RAWCACORR]);
|
||||
@@ -261,6 +261,8 @@ void BatchToolPanelCoordinator::initSession () {
|
||||
if (options.baBehav[ADDSET_VIGN_CENTER]) pparams.vignetting.centerY = 0;
|
||||
|
||||
if (options.baBehav[ADDSET_DIRPYREQ]) for (int i=0; i<5; i++) pparams.dirpyrequalizer.mult[i] = 0;
|
||||
if (options.baBehav[ADDSET_DIRPYREQ_THRESHOLD]) pparams.dirpyrequalizer.threshold = 0;
|
||||
|
||||
if (options.baBehav[ADDSET_DIRPYRDN_LUMA]) pparams.dirpyrDenoise.luma = 0;
|
||||
|
||||
if (options.baBehav[ADDSET_DIRPYRDN_CHROMA]) pparams.dirpyrDenoise.chroma = 0;
|
||||
|
||||
@@ -30,7 +30,7 @@ DirPyrEqualizer::DirPyrEqualizer () : Gtk::VBox(), FoldableToolPanel(this) {
|
||||
enabled->set_active (true);
|
||||
pack_start(*enabled);
|
||||
enaConn = enabled->signal_toggled().connect( sigc::mem_fun(*this, &DirPyrEqualizer::enabledToggled) );
|
||||
enabled->set_tooltip_markup (M("TP_SHARPENING_TOOLTIP"));
|
||||
enabled->set_tooltip_markup (M("TP_SHARPENING_TOOLTIP"));
|
||||
|
||||
Gtk::HSeparator *separator1 = Gtk::manage (new Gtk::HSeparator());
|
||||
pack_start(*separator1, Gtk::PACK_SHRINK, 2);
|
||||
@@ -55,32 +55,27 @@ DirPyrEqualizer::DirPyrEqualizer () : Gtk::VBox(), FoldableToolPanel(this) {
|
||||
Gtk::HSeparator *separator2 = Gtk::manage (new Gtk::HSeparator());
|
||||
pack_start(*separator2, Gtk::PACK_SHRINK, 2);
|
||||
|
||||
for(int i = 0; i < 4; i++)
|
||||
for(int i = 0; i < 5; i++)
|
||||
{
|
||||
Glib::ustring ss;
|
||||
ss = Glib::ustring::format(i);
|
||||
if(i == 0) {
|
||||
ss += Glib::ustring::compose(" (%1)", M("TP_DIRPYREQUALIZER_LUMAFINEST"));
|
||||
multiplier[i] = Gtk::manage ( new Adjuster (ss, 0, 4, 0.01, 1.0) );
|
||||
} else {
|
||||
if(i == 3)
|
||||
ss += Glib::ustring::compose(" (%1)", M("TP_DIRPYREQUALIZER_LUMACOARSEST"));
|
||||
multiplier[i] = Gtk::manage ( new Adjuster (ss, 0, 4, 0.01, 1.0) );
|
||||
}
|
||||
if (i == 0) ss += Glib::ustring::compose(" (%1)", M("TP_DIRPYREQUALIZER_LUMAFINEST"));
|
||||
else if(i == 4) ss += Glib::ustring::compose(" (%1)", M("TP_DIRPYREQUALIZER_LUMACOARSEST"));
|
||||
multiplier[i] = Gtk::manage ( new Adjuster (ss, 0, 4, 0.01, 1.0) );
|
||||
multiplier[i]->setAdjusterListener(this);
|
||||
pack_start(*multiplier[i]);
|
||||
}
|
||||
|
||||
Gtk::HSeparator *separator3 = Gtk::manage (new Gtk::HSeparator());
|
||||
|
||||
Gtk::HSeparator *separator3 = Gtk::manage (new Gtk::HSeparator());
|
||||
pack_start(*separator3, Gtk::PACK_SHRINK, 2);
|
||||
|
||||
multiplier[4] = Gtk::manage ( new Adjuster (M("TP_DIRPYREQUALIZER_THRESHOLD"), 0, 1, 0.01, 0.2) );
|
||||
multiplier[4]->setAdjusterListener(this);
|
||||
pack_start(*multiplier[4]);
|
||||
|
||||
threshold = Gtk::manage ( new Adjuster (M("TP_DIRPYREQUALIZER_THRESHOLD"), 0, 1, 0.01, 0.2) );
|
||||
threshold->setAdjusterListener(this);
|
||||
pack_start(*threshold);
|
||||
|
||||
show_all_children ();
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
}
|
||||
|
||||
DirPyrEqualizer::~DirPyrEqualizer () {
|
||||
@@ -98,6 +93,7 @@ void DirPyrEqualizer::read (const ProcParams* pp, const ParamsEdited* pedited) {
|
||||
for(int i = 0; i < 5; i++) {
|
||||
multiplier[i]->setEditedState (pedited->dirpyrequalizer.mult[i] ? Edited : UnEdited);
|
||||
}
|
||||
threshold->setEditedState (pedited->dirpyrequalizer.threshold ? Edited : UnEdited);
|
||||
}
|
||||
|
||||
enaConn.block (true);
|
||||
@@ -108,6 +104,7 @@ void DirPyrEqualizer::read (const ProcParams* pp, const ParamsEdited* pedited) {
|
||||
for (int i = 0; i < 5; i++) {
|
||||
multiplier[i]->setValue(pp->dirpyrequalizer.mult[i]);
|
||||
}
|
||||
threshold->setValue(pp->dirpyrequalizer.threshold);
|
||||
|
||||
enableListener ();
|
||||
}
|
||||
@@ -119,6 +116,7 @@ void DirPyrEqualizer::write (ProcParams* pp, ParamsEdited* pedited) {
|
||||
for (int i = 0; i < 5; i++) {
|
||||
pp->dirpyrequalizer.mult[i] = multiplier[i]->getValue();
|
||||
}
|
||||
pp->dirpyrequalizer.threshold = threshold->getValue();
|
||||
|
||||
if (pedited) {
|
||||
|
||||
@@ -127,6 +125,7 @@ void DirPyrEqualizer::write (ProcParams* pp, ParamsEdited* pedited) {
|
||||
for(int i = 0; i < 5; i++) {
|
||||
pedited->dirpyrequalizer.mult[i] = multiplier[i]->getEditedState();
|
||||
}
|
||||
pedited->dirpyrequalizer.threshold = threshold->getEditedState();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,42 +134,51 @@ void DirPyrEqualizer::setDefaults (const ProcParams* defParams, const ParamsEdit
|
||||
for (int i = 0; i < 5; i++) {
|
||||
multiplier[i]->setDefault(defParams->dirpyrequalizer.mult[i]);
|
||||
}
|
||||
threshold->setDefault(defParams->dirpyrequalizer.threshold);
|
||||
|
||||
if (pedited) {
|
||||
for (int i = 0; i < 5; i++) {
|
||||
multiplier[i]->setDefaultEditedState(pedited->dirpyrequalizer.mult[i] ? Edited : UnEdited);
|
||||
}
|
||||
threshold->setDefaultEditedState(pedited->dirpyrequalizer.threshold ? Edited : UnEdited);
|
||||
}
|
||||
else {
|
||||
for (int i = 0; i < 5; i++) {
|
||||
multiplier[i]->setDefaultEditedState(Irrelevant);
|
||||
}
|
||||
threshold->setDefaultEditedState(Irrelevant);
|
||||
}
|
||||
}
|
||||
|
||||
void DirPyrEqualizer::setBatchMode (bool batchMode) {
|
||||
|
||||
ToolPanel::setBatchMode (batchMode);
|
||||
|
||||
|
||||
for (int i = 0; i < 5; i++) {
|
||||
multiplier[i]->showEditedCB();
|
||||
}
|
||||
threshold->showEditedCB();
|
||||
}
|
||||
|
||||
void DirPyrEqualizer::adjusterChanged (Adjuster* a, double newval) {
|
||||
|
||||
|
||||
if (listener && enabled->get_active()) {
|
||||
std::stringstream ss;
|
||||
ss << "(";
|
||||
int i;
|
||||
for (i = 0; i < 5; i++) {
|
||||
if (i > 0) {
|
||||
ss << ", ";
|
||||
}
|
||||
ss << static_cast<int>(multiplier[i]->getValue());
|
||||
if (a == threshold) {
|
||||
listener->panelChanged (EvDirPyrEqualizerThreshold,
|
||||
Glib::ustring::compose("%1",
|
||||
Glib::ustring::format(std::fixed, std::setprecision(2), threshold->getValue()))
|
||||
);
|
||||
}
|
||||
else {
|
||||
listener->panelChanged (EvDirPyrEqualizer,
|
||||
Glib::ustring::compose("%1, %2, %3, %4, %5",
|
||||
Glib::ustring::format(std::fixed, std::setprecision(2), multiplier[0]->getValue()),
|
||||
Glib::ustring::format(std::fixed, std::setprecision(2), multiplier[1]->getValue()),
|
||||
Glib::ustring::format(std::fixed, std::setprecision(2), multiplier[2]->getValue()),
|
||||
Glib::ustring::format(std::fixed, std::setprecision(2), multiplier[3]->getValue()),
|
||||
Glib::ustring::format(std::fixed, std::setprecision(2), multiplier[4]->getValue()))
|
||||
);
|
||||
}
|
||||
ss << ")";
|
||||
listener->panelChanged (EvDirPyrEqualizer, ss.str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,7 +208,7 @@ void DirPyrEqualizer::enabledToggled () {
|
||||
|
||||
void DirPyrEqualizer::lumaneutralPressed () {
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
for (int i = 0; i < 5; i++) {
|
||||
multiplier[i]->setValue(1.0);
|
||||
adjusterChanged(multiplier[i], 1.0);
|
||||
}
|
||||
@@ -209,7 +217,7 @@ void DirPyrEqualizer::lumaneutralPressed () {
|
||||
|
||||
void DirPyrEqualizer::lumacontrastPlusPressed () {
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
for (int i = 0; i < 5; i++) {
|
||||
float inc = 0.05 * (4 - i);
|
||||
multiplier[i]->setValue(multiplier[i]->getValue() + inc);
|
||||
adjusterChanged(multiplier[i], multiplier[i]->getValue());
|
||||
@@ -219,21 +227,23 @@ void DirPyrEqualizer::lumacontrastPlusPressed () {
|
||||
|
||||
void DirPyrEqualizer::lumacontrastMinusPressed () {
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
for (int i = 0; i < 5; i++) {
|
||||
float inc = -0.05 * (4 - i);
|
||||
multiplier[i]->setValue(multiplier[i]->getValue() + inc);
|
||||
adjusterChanged(multiplier[i], multiplier[i]->getValue());
|
||||
}
|
||||
}
|
||||
|
||||
void DirPyrEqualizer::setAdjusterBehavior (bool multiplieradd) {
|
||||
void DirPyrEqualizer::setAdjusterBehavior (bool multiplieradd, bool thresholdadd) {
|
||||
|
||||
for (int i=0; i<5; i++)
|
||||
multiplier[i]->setAddMode(multiplieradd);
|
||||
threshold->setAddMode(thresholdadd);
|
||||
}
|
||||
|
||||
void DirPyrEqualizer::trimValues (rtengine::procparams::ProcParams* pp) {
|
||||
|
||||
for (int i=0; i<5; i++)
|
||||
multiplier[i]->trimValue(pp->dirpyrequalizer.mult[i]);
|
||||
threshold->trimValue(pp->dirpyrequalizer.threshold);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ protected:
|
||||
|
||||
Gtk::CheckButton * enabled;
|
||||
Adjuster* multiplier[5];
|
||||
Adjuster* threshold;
|
||||
|
||||
sigc::connection enaConn;
|
||||
sigc::connection lumaneutralPressedConn;
|
||||
@@ -48,7 +49,7 @@ public:
|
||||
void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited=NULL);
|
||||
void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited=NULL);
|
||||
void setBatchMode (bool batchMode);
|
||||
void setAdjusterBehavior (bool multiplieradd);
|
||||
void setAdjusterBehavior (bool multiplieradd, bool thresholdadd);
|
||||
void trimValues (rtengine::procparams::ProcParams* pp);
|
||||
|
||||
void adjusterChanged (Adjuster* a, double newval);
|
||||
|
||||
@@ -570,9 +570,10 @@ void ParamsEdited::initFrom (const std::vector<rtengine::procparams::ProcParams>
|
||||
raw.exTwoGreen = p.raw.twogreen == other.raw.twogreen;
|
||||
|
||||
dirpyrequalizer.enabled = dirpyrequalizer.enabled && p.dirpyrequalizer.enabled == other.dirpyrequalizer.enabled;
|
||||
for(int i = 0; i < 8; i++) {
|
||||
for(int i = 0; i < 5; i++) {
|
||||
dirpyrequalizer.mult[i] = dirpyrequalizer.mult[i] && p.dirpyrequalizer.mult[i] == other.dirpyrequalizer.mult[i];
|
||||
}
|
||||
}
|
||||
dirpyrequalizer.threshold = dirpyrequalizer.threshold && p.dirpyrequalizer.threshold == other.dirpyrequalizer.threshold;
|
||||
hsvequalizer.hcurve = hsvequalizer.hcurve && p.hsvequalizer.hcurve == other.hsvequalizer.hcurve;
|
||||
hsvequalizer.scurve = hsvequalizer.scurve && p.hsvequalizer.scurve == other.hsvequalizer.scurve;
|
||||
hsvequalizer.vcurve = hsvequalizer.vcurve && p.hsvequalizer.vcurve == other.hsvequalizer.vcurve;
|
||||
@@ -847,15 +848,16 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
|
||||
if (raw.darkFrame) toEdit.raw.dark_frame = mods.raw.dark_frame;
|
||||
if (raw.dfAuto) toEdit.raw.df_autoselect = mods.raw.df_autoselect;
|
||||
|
||||
if (raw.ff_file) toEdit.raw.ff_file = mods.raw.ff_file;
|
||||
if (raw.ff_file) toEdit.raw.ff_file = mods.raw.ff_file;
|
||||
if (raw.ff_AutoSelect) toEdit.raw.ff_AutoSelect = mods.raw.ff_AutoSelect;
|
||||
if (raw.ff_BlurRadius) toEdit.raw.ff_BlurRadius = mods.raw.ff_BlurRadius;
|
||||
if (raw.ff_BlurType) toEdit.raw.ff_BlurType = mods.raw.ff_BlurType;
|
||||
if (raw.ff_BlurType) toEdit.raw.ff_BlurType = mods.raw.ff_BlurType;
|
||||
|
||||
if (dirpyrequalizer.enabled) toEdit.dirpyrequalizer.enabled = mods.dirpyrequalizer.enabled;
|
||||
for(int i = 0; i < 5; i++) {
|
||||
if(dirpyrequalizer.mult[i]) toEdit.dirpyrequalizer.mult[i] = dontforceSet && options.baBehav[ADDSET_DIRPYREQ] ? toEdit.dirpyrequalizer.mult[i] + mods.dirpyrequalizer.mult[i] : mods.dirpyrequalizer.mult[i];
|
||||
}
|
||||
if (dirpyrequalizer.threshold) toEdit.dirpyrequalizer.threshold= dontforceSet && options.baBehav[ADDSET_DIRPYREQ_THRESHOLD] ? toEdit.dirpyrequalizer.threshold + mods.dirpyrequalizer.threshold : mods.dirpyrequalizer.threshold;
|
||||
if (hsvequalizer.hcurve) toEdit.hsvequalizer.hcurve = mods.hsvequalizer.hcurve;
|
||||
if (hsvequalizer.scurve) toEdit.hsvequalizer.scurve = mods.hsvequalizer.scurve;
|
||||
if (hsvequalizer.vcurve) toEdit.hsvequalizer.vcurve = mods.hsvequalizer.vcurve;
|
||||
|
||||
@@ -431,7 +431,8 @@ class DirPyrEqualizerParamsEdited {
|
||||
|
||||
public:
|
||||
bool enabled;
|
||||
bool mult[8];
|
||||
bool mult[5];
|
||||
bool threshold;
|
||||
};
|
||||
|
||||
class HSVEqualizerParamsEdited {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define _PPVERSION_
|
||||
|
||||
// This number have to be incremented whenever the PP3 file format is modified
|
||||
#define PPVERSION 315
|
||||
#define PPVERSION 316
|
||||
#define PPVERSION_AEXP 301 //value of PPVERSION when auto exposure algorithm was modified
|
||||
|
||||
/*
|
||||
|
||||
@@ -279,7 +279,8 @@ Gtk::Widget* Preferences::getBatchProcPanel () {
|
||||
|
||||
mi = behModel->append ();
|
||||
mi->set_value (behavColumns.label, M("TP_DIRPYREQUALIZER_LABEL"));
|
||||
appendBehavList (mi, M("TP_EXPOSURE_CONTRAST")+", "+M("TP_DIRPYREQUALIZER_THRESHOLD"), ADDSET_DIRPYREQ, true);
|
||||
appendBehavList (mi, M("TP_EXPOSURE_CONTRAST"), ADDSET_DIRPYREQ, true);
|
||||
appendBehavList (mi, M("TP_DIRPYREQUALIZER_THRESHOLD"), ADDSET_DIRPYREQ_THRESHOLD, true);
|
||||
|
||||
mi = behModel->append ();
|
||||
mi->set_value (behavColumns.label, M("TP_PREPROCESS_LABEL"));
|
||||
|
||||
Reference in New Issue
Block a user