Review idle_register.add() calls: wavelets, ciecam02, colortoning
This commit is contained in:
parent
eee6837385
commit
ccc882dbcf
@ -611,7 +611,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
|||||||
|
|
||||||
if (actListener && params.colorToning.enabled) {
|
if (actListener && params.colorToning.enabled) {
|
||||||
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(satTH, satPR); //hide sliders only if autosat
|
||||||
indi = 0;
|
indi = 0;
|
||||||
} else {
|
} else {
|
||||||
if (params.colorToning.autosat) {
|
if (params.colorToning.autosat) {
|
||||||
@ -656,7 +656,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
|||||||
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((int) colourToningSatLimit, (int)colourToningSatLimitOpacity); //change sliders autosat
|
||||||
}
|
}
|
||||||
|
|
||||||
// correct GUI black and white with value
|
// correct GUI black and white with value
|
||||||
|
@ -347,7 +347,7 @@ class AutoColorTonListener
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~AutoColorTonListener() = default;
|
virtual ~AutoColorTonListener() = default;
|
||||||
virtual void autoColorTonChanged(int bwct, int satthres, int satprot) = 0;
|
virtual void autoColorTonChanged(int satthres, int satprot) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class AutoBWListener
|
class AutoBWListener
|
||||||
|
@ -1451,75 +1451,64 @@ void ColorAppearance::setDefaults (const ProcParams* defParams, const ParamsEdit
|
|||||||
|
|
||||||
void ColorAppearance::autoCamChanged (double ccam, double ccamout)
|
void ColorAppearance::autoCamChanged (double ccam, double ccamout)
|
||||||
{
|
{
|
||||||
nextCcam = ccam;
|
struct Data {
|
||||||
nextCcamout = ccamout;
|
ColorAppearance *me;
|
||||||
|
double ccam;
|
||||||
|
double ccamout;
|
||||||
|
};
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func = [](gpointer data) -> gboolean {
|
||||||
static_cast<ColorAppearance*> (data)->autoCamComputed_();
|
Data *d = static_cast<Data *>(data);
|
||||||
|
ColorAppearance *me = d->me;
|
||||||
|
me->disableListener();
|
||||||
|
me->degree->setValue(d->ccam);
|
||||||
|
me->degreeout->setValue(d->ccamout);
|
||||||
|
me->enableListener();
|
||||||
|
delete d;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
};
|
};
|
||||||
|
|
||||||
idle_register.add (func, this);
|
idle_register.add(func, new Data { this, ccam, ccamout });
|
||||||
}
|
|
||||||
|
|
||||||
bool ColorAppearance::autoCamComputed_ ()
|
|
||||||
{
|
|
||||||
|
|
||||||
disableListener ();
|
|
||||||
// degree->setEnabled (true);
|
|
||||||
degree->setValue (nextCcam);
|
|
||||||
degreeout->setValue (nextCcamout);
|
|
||||||
enableListener ();
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorAppearance::adapCamChanged (double cadap)
|
void ColorAppearance::adapCamChanged (double cadap)
|
||||||
{
|
{
|
||||||
nextCadap = cadap;
|
struct Data {
|
||||||
|
ColorAppearance *me;
|
||||||
|
double cadap;
|
||||||
|
};
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func = [](gpointer data) -> gboolean {
|
||||||
static_cast<ColorAppearance*> (data)->adapCamComputed_();
|
Data *d = static_cast<Data *>(data);
|
||||||
|
ColorAppearance *me = d->me;
|
||||||
|
me->disableListener();
|
||||||
|
me->adapscen->setValue(d->cadap);
|
||||||
|
me->enableListener();
|
||||||
|
delete d;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
};
|
};
|
||||||
|
|
||||||
idle_register.add (func, this);
|
idle_register.add(func, new Data { this, cadap });
|
||||||
}
|
|
||||||
|
|
||||||
bool ColorAppearance::adapCamComputed_ ()
|
|
||||||
{
|
|
||||||
|
|
||||||
disableListener ();
|
|
||||||
// degree->setEnabled (true);
|
|
||||||
adapscen->setValue (nextCadap);
|
|
||||||
// ybscen->setValue (nextYbscn);
|
|
||||||
enableListener ();
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorAppearance::ybCamChanged (int ybsc)
|
void ColorAppearance::ybCamChanged (int ybsc)
|
||||||
{
|
{
|
||||||
nextYbscn = ybsc;
|
struct Data {
|
||||||
|
ColorAppearance *me;
|
||||||
|
int ybsc;
|
||||||
|
};
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func = [](gpointer data) -> gboolean {
|
||||||
static_cast<ColorAppearance*> (data)->ybCamComputed_();
|
Data *d = static_cast<Data *>(data);
|
||||||
|
ColorAppearance *me = d->me;
|
||||||
|
me->disableListener();
|
||||||
|
me->ybscen->setValue(d->ybsc);
|
||||||
|
me->enableListener();
|
||||||
|
delete d;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
};
|
};
|
||||||
|
|
||||||
idle_register.add (func, this);
|
idle_register.add(func, new Data { this, ybsc });
|
||||||
}
|
|
||||||
|
|
||||||
bool ColorAppearance::ybCamComputed_ ()
|
|
||||||
{
|
|
||||||
|
|
||||||
disableListener ();
|
|
||||||
// degree->setEnabled (true);
|
|
||||||
// adapscen->setValue (nextCadap);
|
|
||||||
ybscen->setValue (nextYbscn);
|
|
||||||
enableListener ();
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorAppearance::colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller *caller)
|
void ColorAppearance::colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller *caller)
|
||||||
|
@ -59,11 +59,8 @@ public:
|
|||||||
void tonecie_toggled ();
|
void tonecie_toggled ();
|
||||||
// void sharpcie_toggled ();
|
// void sharpcie_toggled ();
|
||||||
void autoCamChanged (double ccam, double ccamout);
|
void autoCamChanged (double ccam, double ccamout);
|
||||||
bool autoCamComputed_ ();
|
|
||||||
void adapCamChanged (double cadap);
|
void adapCamChanged (double cadap);
|
||||||
bool adapCamComputed_ ();
|
|
||||||
void ybCamChanged (int yb);
|
void ybCamChanged (int yb);
|
||||||
bool ybCamComputed_ ();
|
|
||||||
|
|
||||||
void curveChanged (CurveEditor* ce);
|
void curveChanged (CurveEditor* ce);
|
||||||
void curveMode1Changed ();
|
void curveMode1Changed ();
|
||||||
@ -160,8 +157,6 @@ private:
|
|||||||
DiagonalCurveEditor* shape;
|
DiagonalCurveEditor* shape;
|
||||||
DiagonalCurveEditor* shape2;
|
DiagonalCurveEditor* shape2;
|
||||||
DiagonalCurveEditor* shape3;
|
DiagonalCurveEditor* shape3;
|
||||||
double nextCcam, nextCcamout, nextCadap;
|
|
||||||
int nextYbscn;
|
|
||||||
bool lastAutoDegree;
|
bool lastAutoDegree;
|
||||||
bool lastAutoAdapscen;
|
bool lastAutoAdapscen;
|
||||||
bool lastAutoDegreeout;
|
bool lastAutoDegreeout;
|
||||||
|
@ -13,7 +13,6 @@ using namespace rtengine::procparams;
|
|||||||
|
|
||||||
ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLORTONING_LABEL"), false, true)
|
ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLORTONING_LABEL"), false, true)
|
||||||
{
|
{
|
||||||
nextbw = 0;
|
|
||||||
CurveListener::setMulti(true);
|
CurveListener::setMulti(true);
|
||||||
|
|
||||||
//---------------method
|
//---------------method
|
||||||
@ -688,40 +687,26 @@ void ColorToning::setAdjusterBehavior (bool splitAdd, bool satThresholdAdd, bool
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorToning::autoColorTonChanged(int bwct, int satthres, int satprot)
|
void ColorToning::autoColorTonChanged(int satthres, int satprot)
|
||||||
{
|
{
|
||||||
nextbw = bwct;
|
struct Data {
|
||||||
nextsatth = satthres;
|
ColorToning *me;
|
||||||
nextsatpr = satprot;
|
int satthres;
|
||||||
|
int satprot;
|
||||||
|
};
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func = [](gpointer data) -> gboolean {
|
||||||
static_cast<ColorToning*>(data)->CTComp_();
|
Data *d = static_cast<Data *>(data);
|
||||||
|
ColorToning *me = d->me;
|
||||||
|
me->disableListener();
|
||||||
|
me->satProtectionThreshold->setValue(d->satthres);
|
||||||
|
me->saturatedOpacity->setValue(d->satprot);
|
||||||
|
me->enableListener ();
|
||||||
|
delete d;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
};
|
};
|
||||||
|
|
||||||
idle_register.add(func, this);
|
idle_register.add(func, new Data { this, satthres, satprot });
|
||||||
}
|
|
||||||
|
|
||||||
bool ColorToning::CTComp_ ()
|
|
||||||
{
|
|
||||||
|
|
||||||
disableListener ();
|
|
||||||
saturatedOpacity->setValue (nextsatpr);
|
|
||||||
satProtectionThreshold->setValue (nextsatth);
|
|
||||||
/* if(nextbw==1) {
|
|
||||||
saturatedOpacity->show();
|
|
||||||
satProtectionThreshold->show();
|
|
||||||
autosat->show();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
saturatedOpacity->hide();
|
|
||||||
satProtectionThreshold->hide();
|
|
||||||
autosat->hide();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
enableListener ();
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorToning::adjusterChanged (ThresholdAdjuster* a, double newBottom, double newTop)
|
void ColorToning::adjusterChanged (ThresholdAdjuster* a, double newBottom, double newTop)
|
||||||
|
@ -36,8 +36,7 @@ public:
|
|||||||
void setAdjusterBehavior (bool splitAdd, bool satThresholdAdd, bool satOpacityAdd, bool strprotectAdd, bool balanceAdd);
|
void setAdjusterBehavior (bool splitAdd, bool satThresholdAdd, bool satOpacityAdd, bool strprotectAdd, bool balanceAdd);
|
||||||
void neutral_pressed ();
|
void neutral_pressed ();
|
||||||
//void neutralCurves_pressed ();
|
//void neutralCurves_pressed ();
|
||||||
void autoColorTonChanged (int bwct, int satthres, int satprot);
|
void autoColorTonChanged (int satthres, int satprot);
|
||||||
bool CTComp_ ();
|
|
||||||
|
|
||||||
void adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop);
|
void adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop);
|
||||||
void adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight);
|
void adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight);
|
||||||
@ -99,9 +98,6 @@ private:
|
|||||||
|
|
||||||
Gtk::Button* neutral;
|
Gtk::Button* neutral;
|
||||||
Gtk::HBox* neutrHBox;
|
Gtk::HBox* neutrHBox;
|
||||||
int nextbw;
|
|
||||||
int nextsatth;
|
|
||||||
int nextsatpr;
|
|
||||||
Glib::ustring nextbalcolor;
|
Glib::ustring nextbalcolor;
|
||||||
Glib::ustring balcolor;
|
Glib::ustring balcolor;
|
||||||
sigc::connection neutralconn, twocconn; //, neutralcurvesconn;
|
sigc::connection neutralconn, twocconn; //, neutralcurvesconn;
|
||||||
|
@ -144,7 +144,6 @@ Wavelet::Wavelet() :
|
|||||||
neutrHBox(Gtk::manage(new Gtk::HBox()))
|
neutrHBox(Gtk::manage(new Gtk::HBox()))
|
||||||
{
|
{
|
||||||
CurveListener::setMulti(true);
|
CurveListener::setMulti(true);
|
||||||
nextnlevel = 7.;
|
|
||||||
|
|
||||||
expsettings->signal_button_release_event().connect_notify( sigc::bind( sigc::mem_fun(this, &Wavelet::foldAllButMe), expsettings) );
|
expsettings->signal_button_release_event().connect_notify( sigc::bind( sigc::mem_fun(this, &Wavelet::foldAllButMe), expsettings) );
|
||||||
|
|
||||||
@ -887,35 +886,24 @@ Wavelet::~Wavelet ()
|
|||||||
|
|
||||||
void Wavelet::wavChanged (double nlevel)
|
void Wavelet::wavChanged (double nlevel)
|
||||||
{
|
{
|
||||||
nextnlevel = nlevel;
|
if (!batchMode) {
|
||||||
|
struct Data {
|
||||||
|
Wavelet *me;
|
||||||
|
double nlevel;
|
||||||
|
};
|
||||||
|
|
||||||
const auto func = [](gpointer data) -> gboolean {
|
const auto func = [](gpointer data) -> gboolean {
|
||||||
GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected
|
Data *d = static_cast<Data *>(data);
|
||||||
static_cast<Wavelet*>(data)->wavComputed_();
|
Wavelet *me = d->me;
|
||||||
|
me->wavLabels->set_text(
|
||||||
|
Glib::ustring::compose(M("TP_WAVELET_LEVLABEL"),
|
||||||
|
Glib::ustring::format(std::fixed, std::setprecision(0), d->nlevel))
|
||||||
|
);
|
||||||
|
delete d;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
};
|
};
|
||||||
|
|
||||||
idle_register.add(func, this);
|
idle_register.add(func, new Data { this, nlevel });
|
||||||
}
|
|
||||||
|
|
||||||
bool Wavelet::wavComputed_ ()
|
|
||||||
{
|
|
||||||
disableListener ();
|
|
||||||
enableListener ();
|
|
||||||
updatewavLabel ();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Wavelet::updatewavLabel ()
|
|
||||||
{
|
|
||||||
if (!batchMode) {
|
|
||||||
float lv;
|
|
||||||
lv = nextnlevel;
|
|
||||||
wavLabels->set_text(
|
|
||||||
Glib::ustring::compose(M("TP_WAVELET_LEVLABEL"),
|
|
||||||
Glib::ustring::format(std::fixed, std::setprecision(0), lv))
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +93,6 @@ private:
|
|||||||
void neutral_pressed ();
|
void neutral_pressed ();
|
||||||
void neutralchPressed ();
|
void neutralchPressed ();
|
||||||
void tmrToggled ();
|
void tmrToggled ();
|
||||||
void updatewavLabel ();
|
|
||||||
void wavChanged (double nlevel);
|
void wavChanged (double nlevel);
|
||||||
|
|
||||||
void HSmethodUpdateUI();
|
void HSmethodUpdateUI();
|
||||||
@ -252,7 +251,6 @@ private:
|
|||||||
sigc::connection neutralchPressedConn;
|
sigc::connection neutralchPressedConn;
|
||||||
|
|
||||||
bool lastmedian, lastmedianlev, lastlinkedg, lastavoid, lastlipst, lasttmr, lastcbenab;
|
bool lastmedian, lastmedianlev, lastlinkedg, lastavoid, lastlipst, lasttmr, lastcbenab;
|
||||||
int nextnlevel;
|
|
||||||
|
|
||||||
IdleRegister idle_register;
|
IdleRegister idle_register;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user