Research and development - WB auto -temperature correlation - tests - finding the optimum settings (#6643)

* Change estimchrom estim hue final

* Itcw observer checkbox

* 8 spectral colors

* 11 spectral colors

* 6 spectral colors

* Small change to correction green

* Fixed various bad behavior - settings itcwb_deltaspec

* 4 spectral colors green

* 3 green spectral colors

* 3 spectral colors green

* 5 spectral colors red green

* 3 spectral colors red green

* 3 spectral colrs green red

* Chnage slider choice deltaE - to size color patch

* display more info in console

* Display more info in console - comment code

* Clean - comment code

* 8 spectral colors green red

* 8 spectral colors blue

* 8 spectral colors blue

* 3 spectral colors

* 6 spectral colors

* 4 spectal colors

* 2 spectral colors

* Eliminate high Y - increse temp iteration - recenter selection inside patch

* compatibility 5.9

* Modify dislay and place selected dats in patch

* Dispaly in console hue chroma image selection

* First optimization

* optimization code - clean unused variables

* Remove sorted in chroma order - some others changes

* 5.9 compatibility

* Clean and optimize code

* Clean code - more display info in console

* More info in console - set itcwb_minsize in option

* Display patch chroma in GUI

* Change some default settings

* Minsize patch GUI

* Display GUI patch size

* Chroma patch variations

* Display in GUI min and max dats found in patch

* Some adjustments

* Remove too low datas in patch

* Various improvment - ponderate

* Clean code colortemp comment spectral datas

* Comment code - correc gren

* Comment and refine code

* Fixed bug in improcoordinator

* fixes a malfunction of AWB bias in improcoordinator

* Various improvments - clean code

* 2 improvments green and find patch

* Allows parametrind ponder and Ypurple in options

* Update autowb - filter on magenta purple

* Clean and optimize code

* Read colors in GUI

* Denoise median 5x5 image datas before Itcwb

* Change to GUI

* Replace median5x5 by 2 median3x3 - clean GUI code

* Work around to recalculate wbauto

* Remove work around - change params->wb related change

* Disabled low_sampling 5.9

* First try for compatibility Low sampling 5.9

* Re-enable WB autogrey

* Change reference image to autogrey if camera settings probably out

* Clean code aand adjust settings camera out

* Format astylert rawimagesource.cc - various small adjustments

* Small correction

* Small green correction

* Change default settings - correction to autowb bias in improccoordinator

* Save provisory work

* Save provisory work 2

* Try to find good tempitc with iterate when temptitc very different 5000K

* Change 2 default settings

* Work around awb temp bias

* Limit work around bias - small other changes

* 3 spectral colors deep blue

* 4 spectral color deep blue

* 4 color spectral yellow

* 5 spectral colors neutral red-magenta

* 5 spectral color neutral red magenta

* Change threshold tempitc

* 5.9 compatibility

* Work around bad claculation Planck's formula

* Fixed bad behavior when using blackbody spectal

* 6 spectral color - checkbutton remove 2 passes

* Fixed various bugs

* Format rawimagesource.cc

* Various improvment before to find the good selection

* First new optimization (perhaps?)

* Display GUI patc deltaE

* Various optimzation and tooltip

* Default observer 2°- Simplify GUI - improve display GUI - remove too low numbers datas

* 4 spectral colors - change 2 settings

* Change calculation threshold 2 passes

* 6 spectral colors magenta

* 13 spectral colors

* Improvment GUI display

* remove checkbutton no_purple

* 2 spectral colors - remove in GUI low sampling 5.9

* Change default setting display in console

* Change behavior when temp near stdA

* 4 spectral colors - settings Itcwb_tempstdA

* Gamut control on image histogram

* Clean code and format rawimagesource.cc

* Comment and format colortemp.cc

* Remove unused fileds from GUI - change tooltips

* Add tooltips

* Various changes

* Change settings when camera temperature is out

* improvment extra and tooltip

* Small change when using auto grey as start reference

* Remove itcwb_fgreen from GUI

* Various change - and 'unsatisfactory' test to take into account Custom

* Change second temp when < 4000 - replace automatic by automatic and refinement

* Neutralize 'Use custom tempertaure and green'

* Green refinement

* Clean code - small changes

* Other clean code

* Added forgotten itcw_green in procparams.cc

* Fixed a bug dispaly deltaE

* Change threshold settings - change code for Custom

* various change in case of using camera settings

* Change way to estimate range green

* clean code and message in console

* Clean and optimize

* Disable 2 passes if custom

* Improve GUI 2 passes

* Increase sampling and number of temperature above 9400K

* Hide AWB temperature bais and green refinement when Custom temerature ans green

* marks out the code with past time markers

* Improve time processing with spectral colors temp calculations

* Replace in console msec by nsec

* Scan temp 5.9

* Change max temp and behavior if temp > 15000k

* Refine temp near 14000K

* Increase sampling temperature 132 to 167

* Increase sampling temperature

* Set in preference choice for itcwb_custom

* White point calculated  with observer instead of table

* More on whitepoint calculation - informations

* Clean and format code with astyle colortemp.cc rawimagesource.cc improccoordinator.cc

* Small change tooltip

* Improve update auto-wb

* Remove 'use custom temperature and tin' - simplify sampling to 2 choice

* Small change to rand AWB bias - green refinement - tooltips

* slightly modify the parameters upstream of the algo - do not use camera in some cases

* Mixed initial green

* Refine init green and temp when no camera

* Refine temp and green in do not use camera settings

* Change tint threshold and various improvments (tooltips, wrong values..)

* Refinment and clean code

* Improve mode No use camera settings

* Init nocam

* Refine use no camera  settings

* Small change

* 5.9 compatibility - and format

* Refine sampling temperature  around 7000 - 8000K

* Format astylert rawimagesource colortemp

* 5.9 settings

* 5.9 settings 2

* Various change - 5.9 - format

* Improve pre and post algorithm

* Fixed correction temp > 8000K

* Fixed bad behavior Tppat.minchroma

* Change sampling choices and tooltip

* Change name wp wp2 wip to wb wb2 iwb to avoid misunderstood

* Small Change settings - limit display studgood to 0.0001

* Improvment display GUI temp

* Change default sampling

* Change ACESP0 to JDCmax

* Improve GUI abstract profile

* Allows dispaly in console xy values thanks to Reffort

* Remove bruce rgb in wp and abstract

* Change wp abstract and save itcwb with dispaly cellxy

* Change prim = 13 improccoordinator iplab2rgb

* remove display datas in console - fixed wrong display Y xyY

* Fixed ifferences in GUI maxhist minhist

* Change limits x y in function sampling

* fixed a dizziness

* Change  after algorithm rule when temp > 6000K

* Harmonize limx limy for oldsampling 5.9

* Added Cam xyz matrix to sampling - thanks to Reffort

* Display in console xyz matrix

* Forgotten instruction when mix camera and autowb grey

* Change rgbloc with Camera matrix Dcraw when no input profile

* Change rep to repref in rgbxyz

* Remove message in console

* 5.9 compat

* 5.9 compat 2

* 5.9 compat 3

* 5.9 compat 4

* 5.9 compat 5 format

* 5.9 compta 6

* Improve code

* Diasble itcwb_sampling in GUI

* Comment code

* Clean and comment code

* 5 spectral colors

* 9 spectral colors

* 2 spectral colors

* Various improvments

* 5 spectral colors

* 5 spectral colors

* First changes review lawrence37

* Second changes review Lawrence37

* 3rd changes review Lawrence37

* 4th changes review Lawrence37

* Change windows and appimage yml

* Re-enable Rtv4_Bruce in procparams.cc

* test for 5.9 compatibility

* Try to fixed crash

* Slightly improve the management of 5.9

* test for 5.9 compatibility by passing parameters via the GUI

* Forgotten parameter

* Change ref_spec limit and remove pac_start for itcwb_sampling

* Puts back the old Planck formula - the same as in dev

* Revert "test for 5.9 compatibility by passing parameters via the GUI"

This reverts commit d6b5a8feda31b93a5574cee6ebf4d3e9d58bbcfb.

* Switch to new ITCWB only when changing WB method

Prevents sudden changing of the white balance if ITCWB is selected and
the image is reopened.

* Fix spelling in comment

* Suggested change from Lawrence37 to whitebalance - small change to improcoordinator

* tempbias Set_sentive(false) if itcwb_smapling - clean whitebalance

* Another clean whitebalance.cc

---------

Co-authored-by: Lawrence Lee <45837045+Lawrence37@users.noreply.github.com>
This commit is contained in:
Desmis
2023-08-06 13:44:48 +02:00
committed by GitHub
parent 00fff386c7
commit 8d0333120e
32 changed files with 6275 additions and 1990 deletions

View File

@@ -247,6 +247,9 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, TOOL_NAME, M("TP_WBALANC
auto m = ProcEventMapper::getInstance();
EvWBObserver10 = m->newEvent(ALLNORAW, "HISTORY_MSG_WBALANCE_OBSERVER10");
EvWBitcwbprim = m->newEvent(ALLNORAW, "HISTORY_MSG_WBITC_PRIM");
EvWBitcwbalg = m->newEvent(ALLNORAW, "HISTORY_MSG_WBITC_OBS");
EvWBitcwgreen = m->newEvent(ALLNORAW, "HISTORY_MSG_WBITC_GREEN");
//Add the model columns to the Combo (which is a kind of view),
@@ -342,6 +345,10 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, TOOL_NAME, M("TP_WBALANC
StudLabel = Gtk::manage(new Gtk::Label("---", Gtk::ALIGN_CENTER));
StudLabel->set_tooltip_text(M("TP_WBALANCE_STUDLABEL_TOOLTIP"));
PatchLabel = Gtk::manage(new Gtk::Label("---", Gtk::ALIGN_CENTER));
PatchLabel->set_tooltip_text(M("TP_WBALANCE_PATCHLABEL_TOOLTIP"));
PatchlevelLabel = Gtk::manage(new Gtk::Label("---", Gtk::ALIGN_CENTER));
PatchlevelLabel->set_tooltip_text(M("TP_WBALANCE_PATCHLEVELLABEL_TOOLTIP"));
mulLabel = Gtk::manage(new Gtk::Label("---", Gtk::ALIGN_CENTER));
mulLabel->set_tooltip_text(M("TP_WBALANCE_MULLABEL_TOOLTIP"));
@@ -350,7 +357,7 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, TOOL_NAME, M("TP_WBALANC
temp = Gtk::manage (new Adjuster (M("TP_WBALANCE_TEMPERATURE"), MINTEMP, MAXTEMP, 5, CENTERTEMP, itempL, itempR, &wbSlider2Temp, &wbTemp2Slider));
green = Gtk::manage (new Adjuster (M("TP_WBALANCE_GREEN"), MINGREEN, MAXGREEN, 0.001, 1.0, igreenL, igreenR));
equal = Gtk::manage (new Adjuster (M("TP_WBALANCE_EQBLUERED"), MINEQUAL, MAXEQUAL, 0.001, 1.0, iblueredL, iblueredR));
tempBias = Gtk::manage (new Adjuster(M("TP_WBALANCE_TEMPBIAS"), -0.5, 0.5, 0.01, 0.0, itempbiasL, itempbiasR));
tempBias = Gtk::manage (new Adjuster(M("TP_WBALANCE_TEMPBIAS"), -1.1, 1.1, 0.005, 0.0, itempbiasL, itempbiasR));
observer10 = Gtk::manage(new CheckBox(M("TP_WBALANCE_OBSERVER10"), multiImage));
cache_customTemp (0);
@@ -364,6 +371,32 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, TOOL_NAME, M("TP_WBALANC
equal->show ();
tempBias->show ();
observer10->show();
itcwbFrame = Gtk::manage(new Gtk::Frame(M("TP_WBALANCE_ITCWB_FRA")));
itcwbFrame->set_label_align(0.025, 0.5);
itcwbFrame->set_tooltip_markup (M("PREFERENCES_WBACORR_TOOLTIP"));
ToolParamBlock* const itcwbBox = Gtk::manage(new ToolParamBlock());
itcwb_green = Gtk::manage (new Adjuster (M("TP_WBALANCE_ITCWGREEN"), -0.35, 0.35, 0.005, 0.));
itcwb_green ->set_tooltip_markup (M("TP_WBALANCE_ITCWGREEN_TOOLTIP"));
itcwb_alg = Gtk::manage (new Gtk::CheckButton (M("TP_WBALANCE_ITCWB_ALG")));
itcwb_alg ->set_tooltip_markup (M("TP_WBALANCE_ITCWALG_TOOLTIP"));
itcwb_alg ->set_active (false);
itcwb_prim = Gtk::manage (new MyComboBoxText ());
itcwb_prim->append(M("TP_WBALANCE_ITCWB_PRIM_SRGB"));
itcwb_prim->append(M("TP_WBALANCE_ITCWB_PRIM_BETA"));
itcwb_prim->append(M("TP_WBALANCE_ITCWB_PRIM_XYZCAM"));
itcwb_prim->append(M("TP_WBALANCE_ITCWB_PRIM_JDCMAX"));
itcwb_prim->set_active(1);
itcwb_primconn = itcwb_prim->signal_changed().connect(sigc::mem_fun(*this, &WhiteBalance::itcwb_prim_changed));
itcwb_prim ->set_tooltip_markup (M("TP_WBALANCE_ITCWPRIM_TOOLTIP"));
/* Gtk::Box* boxgreen = Gtk::manage (new Gtk::Box ());
boxgreen->show ();
@@ -373,6 +406,8 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, TOOL_NAME, M("TP_WBALANC
boxgreen->pack_start(*igreenR);*/
pack_start(*mulLabel);
pack_start(*StudLabel);
pack_start(*PatchLabel);
pack_start(*PatchlevelLabel);
pack_start (*temp);
//pack_start (*boxgreen);
@@ -382,14 +417,33 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, TOOL_NAME, M("TP_WBALANC
pack_start(*observer10);
itcwbBox->pack_start (*itcwb_green);
itcwbBox->pack_start (*itcwb_alg);
itcwbBox->pack_start (*itcwb_prim);
itcwbFrame->add(*itcwbBox);
pack_start(*itcwbFrame);
if(options.rtSettings.itcwb_enable) {
itcwb_green->show();
itcwb_alg->show();
itcwb_prim->show();
itcwbFrame->show();
} else {
itcwb_green->show();
itcwb_alg->hide();
itcwb_prim->hide();
}
temp->setAdjusterListener (this);
green->setAdjusterListener (this);
equal->setAdjusterListener (this);
tempBias->setAdjusterListener (this);
observer10->setCheckBoxListener(this);
itcwb_green->setAdjusterListener (this);
spotbutton->signal_pressed().connect( sigc::mem_fun(*this, &WhiteBalance::spotPressed) );
methconn = method->signal_changed().connect( sigc::mem_fun(*this, &WhiteBalance::optChanged) );
itcwb_algconn = itcwb_alg->signal_toggled().connect( sigc::mem_fun(*this, &WhiteBalance::itcwb_alg_toggled) );
resetButton->signal_pressed().connect( sigc::mem_fun(*this, &WhiteBalance::resetWB) );
spotsize->signal_changed().connect( sigc::mem_fun(*this, &WhiteBalance::spotSizeChanged) );
}
@@ -411,9 +465,36 @@ void WhiteBalance::enabledChanged()
}
}
}
void WhiteBalance::itcwb_prim_changed ()
{
if (listener && getEnabled()) {
listener->panelChanged(EvWBitcwbprim, M("GENERAL_ENABLED"));
}
}
void WhiteBalance::itcwb_alg_toggled ()
{
if (batchMode) {
if (itcwb_alg->get_inconsistent()) {
itcwb_alg->set_inconsistent (false);
itcwb_algconn.block (true);
itcwb_alg->set_active (false);
itcwb_algconn.block (false);
} else if (lastitcwb_alg) {
itcwb_alg->set_inconsistent (true);
}
lastitcwb_alg = itcwb_alg->get_active ();
}
if (listener && getEnabled()) {
if (itcwb_alg->get_active ()) {
listener->panelChanged (EvWBitcwbalg, M("GENERAL_ENABLED"));
} else {
listener->panelChanged (EvWBitcwbalg, M("GENERAL_DISABLED"));
}
}
}
void WhiteBalance::adjusterChanged(Adjuster* a, double newval)
{
@@ -437,6 +518,7 @@ void WhiteBalance::adjusterChanged(Adjuster* a, double newval)
(
a == equal
|| a == tempBias
|| a == itcwb_green
)
&& ppMethod.second.type == WBEntry::Type::AUTO
)
@@ -467,12 +549,16 @@ void WhiteBalance::adjusterChanged(Adjuster* a, double newval)
if (listener && getEnabled()) {
if (a == temp) {
listener->panelChanged (EvWBTemp, Glib::ustring::format ((int)a->getValue()));
itcwbFrame->set_sensitive(false);
} else if (a == green) {
listener->panelChanged (EvWBGreen, Glib::ustring::format (std::setw(4), std::fixed, std::setprecision(3), a->getValue()));
itcwbFrame->set_sensitive(false);
} else if (a == equal) {
listener->panelChanged (EvWBequal, Glib::ustring::format (std::setw(4), std::fixed, std::setprecision(3), a->getValue()));
} else if (a == tempBias) {
listener->panelChanged (EvWBtempBias, Glib::ustring::format (std::setw(4), std::fixed, std::setprecision(2), a->getValue()));
} else if (a == itcwb_green) {
listener->panelChanged (EvWBitcwgreen, Glib::ustring::format (std::setw(4), std::fixed, std::setprecision(2), a->getValue()));
}
}
}
@@ -507,6 +593,7 @@ void WhiteBalance::checkBoxToggled(CheckBox* c, CheckValue newval)
}
}
void WhiteBalance::optChanged ()
{
Gtk::TreeModel::Row row = getActiveMethod();
@@ -524,6 +611,8 @@ void WhiteBalance::optChanged ()
}
StudLabel->hide();
mulLabel->show();
PatchLabel->hide();
PatchlevelLabel->hide();
if (opt != row[methodColumns.colId]) {
@@ -543,8 +632,16 @@ void WhiteBalance::optChanged ()
bool autit = (currMethod.ppLabel == "autitcgreen");
if (autit) {
StudLabel->show();
PatchLabel->show();
PatchlevelLabel->show();
equal->hide();
itcwbFrame->set_sensitive(true);
} else {
StudLabel->hide();
PatchLabel->hide();
PatchlevelLabel->hide();
equal->show();
itcwbFrame->set_sensitive(false);
}
switch (currMethod.type) {
@@ -638,6 +735,8 @@ void WhiteBalance::spotPressed ()
{
StudLabel->hide();
mulLabel->show();
PatchLabel->hide();
PatchlevelLabel->hide();
if (wblistener) {
wblistener->spotWBRequested (getSize());
@@ -663,6 +762,41 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited)
tempBias->setValue (pp->wb.tempBias);
tempBias->set_sensitive(true);
itcwb_algconn.block (true);
itcwb_alg->set_active (pp->wb.itcwb_alg);
itcwb_algconn.block (false);
lastitcwb_alg = pp->wb.itcwb_alg;
itcwb_green->setValue (pp->wb.itcwb_green);
itcwb_primconn.block (true);
if (pp->wb.itcwb_prim == "srgb") {
itcwb_prim->set_active(0);
} else if (pp->wb.itcwb_prim == "beta") {
itcwb_prim->set_active(1);
} else if (pp->wb.itcwb_prim == "XYZcam") {
itcwb_prim->set_active(2);
} else if (pp->wb.itcwb_prim == "jdcmax") {
itcwb_prim->set_active(3);
}
itcwb_primconn.block (false);
if(options.rtSettings.itcwb_enable) {
itcwb_green->show();
itcwb_alg->show();
itcwb_prim->show();
itcwbFrame->show();
} else {
itcwb_green->hide();
itcwb_alg->hide();
itcwb_prim->hide();
itcwbFrame->hide();
}
if (pedited) {
// By default, temperature and green are said "UnEdited", but it may change later
temp->setEditedState (UnEdited);
@@ -670,6 +804,8 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited)
equal->setEditedState (pedited->wb.equal ? Edited : UnEdited);
tempBias->setEditedState (pedited->wb.tempBias ? Edited : UnEdited);
observer10->setEdited(pedited->wb.observer);
itcwb_alg->set_inconsistent (!pedited->wb.itcwb_alg);
itcwb_green->setEditedState (pedited->wb.itcwb_green ? Edited : UnEdited);
}
if (pedited && !pedited->wb.method) {
@@ -780,9 +916,21 @@ void WhiteBalance::read (const ProcParams* pp, const ParamsEdited* pedited)
bool autit = (wbValues.ppLabel == "autitcgreen");
if (autit) {
StudLabel->show();
PatchLabel->show();
PatchlevelLabel->show();
equal->hide();
if(pp->wb.itcwb_sampling) {
tempBias->set_sensitive(false);
}
itcwbFrame->set_sensitive(!pp->wb.itcwb_sampling);
itcwb_prim_changed ();
} else {
StudLabel->hide();
PatchLabel->hide();
PatchlevelLabel->hide();
mulLabel->show();
equal->show();
itcwbFrame->set_sensitive(false);
}
}
@@ -808,16 +956,32 @@ void WhiteBalance::write (ProcParams* pp, ParamsEdited* pedited)
pedited->wb.equal = equal->getEditedState ();
pedited->wb.tempBias = tempBias->getEditedState ();
pedited->wb.observer = observer10->getEdited();
pedited->wb.itcwb_alg = !itcwb_alg->get_inconsistent();
pedited->wb.method = row[methodColumns.colLabel] != M("GENERAL_UNCHANGED");
pedited->wb.enabled = !get_inconsistent();
pedited->wb.itcwb_prim = itcwb_prim->get_active_text() != M("GENERAL_UNCHANGED");
pedited->wb.itcwb_green = itcwb_green->getEditedState ();
}
pp->wb.enabled = getEnabled();
if (itcwb_prim->get_active_row_number() == 0) {
pp->wb.itcwb_prim = "srgb";
} else if (itcwb_prim->get_active_row_number() == 1){
pp->wb.itcwb_prim = "beta";
} else if (itcwb_prim->get_active_row_number() == 2){
pp->wb.itcwb_prim = "XYZcam";
} else if (itcwb_prim->get_active_row_number() == 3){
pp->wb.itcwb_prim = "jdcmax";
}
const std::pair<bool, const WBEntry&> ppMethod = findWBEntry (row[methodColumns.colLabel], WBLT_GUI);
if (ppMethod.first) {
pp->wb.method = ppMethod.second.ppLabel;
if (pp->wb.method != "autitcgreen") {
// Prepare migration to new ITCWB algorithm.
pp->wb.itcwb_sampling = false;
}
}
pp->wb.temperature = temp->getIntValue ();
@@ -829,7 +993,9 @@ void WhiteBalance::write (ProcParams* pp, ParamsEdited* pedited)
: observer10->getValue() == CheckValue::off
? rtengine::StandardObserver::TWO_DEGREES
: pp->wb.observer;
pp->wb.itcwb_alg = itcwb_alg->get_active ();
pp->wb.tempBias = tempBias->getValue ();
pp->wb.itcwb_green = itcwb_green->getValue ();
}
void WhiteBalance::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited)
@@ -837,6 +1003,7 @@ void WhiteBalance::setDefaults (const ProcParams* defParams, const ParamsEdited*
equal->setDefault (defParams->wb.equal);
tempBias->setDefault (defParams->wb.tempBias);
itcwb_green->setDefault (defParams->wb.itcwb_green);
if (wbp && defParams->wb.method == "Camera") {
double ctemp;
@@ -859,11 +1026,13 @@ void WhiteBalance::setDefaults (const ProcParams* defParams, const ParamsEdited*
green->setDefaultEditedState (pedited->wb.green ? Edited : UnEdited);
equal->setDefaultEditedState (pedited->wb.equal ? Edited : UnEdited);
tempBias->setDefaultEditedState (pedited->wb.tempBias ? Edited : UnEdited);
itcwb_green->setDefaultEditedState (pedited->wb.itcwb_green ? Edited : UnEdited);
} else {
temp->setDefaultEditedState (Irrelevant);
green->setDefaultEditedState (Irrelevant);
equal->setDefaultEditedState (Irrelevant);
tempBias->setDefaultEditedState (Irrelevant);
itcwb_green->setDefaultEditedState (Irrelevant);
}
}
@@ -1015,24 +1184,62 @@ inline Gtk::TreeRow WhiteBalance::getActiveMethod ()
return *(method->get_active());
}
void WhiteBalance::WBChanged(double temperature, double greenVal, double rw, double gw, double bw, float studgood)
void WhiteBalance::WBChanged(int met, double temperature, double greenVal, double rw, double gw, double bw, float temp0, float delta, int bia, int dread, float studgood, float minchrom, int kmin, float histmin, float histmax)
{
idle_register.add(
[this, temperature, greenVal, rw, gw, bw, studgood]() -> bool
[this, met, temperature, greenVal, rw, gw, bw, temp0, delta, bia, dread, studgood, minchrom, kmin, histmin, histmax]() -> bool
{
disableListener();
temp->setValue(temperature);
green->setValue(greenVal);
double stud;
stud = studgood;
if(studgood < 0.0001) {
stud = 0.0001;
}
int bia2 = bia;
mulLabel->set_text(
Glib::ustring::compose(M("TP_WBALANCE_MULLABEL"),
Glib::ustring::format(std::fixed, std::setprecision(4), rw),
Glib::ustring::format(std::fixed, std::setprecision(2), gw),
Glib::ustring::format(std::fixed, std::setprecision(4), bw))
);
StudLabel->set_text(
Glib::ustring::compose(M("TP_WBALANCE_STUDLABEL"),
Glib::ustring::format(std::fixed, std::setprecision(4), studgood))
);
if(bia == 3) {
bia2 = bia - 1;
StudLabel->set_text(
Glib::ustring::compose(M("TP_WBALANCE_STUDLABEL"),
Glib::ustring::format(std::fixed, std::setprecision(4), stud),
Glib::ustring::format(std::fixed, std::setprecision(0), bia2),
Glib::ustring::format(std::fixed, std::setprecision(0), temp0))
);
} else if(bia == 2) {
StudLabel->set_text(
Glib::ustring::compose(M("TP_WBALANCE_STUDLABEL1"),
Glib::ustring::format(std::fixed, std::setprecision(4), stud),
Glib::ustring::format(std::fixed, std::setprecision(0), bia),
Glib::ustring::format(std::fixed, std::setprecision(0), temp0))
);
} else {
StudLabel->set_text(
Glib::ustring::compose(M("TP_WBALANCE_STUDLABEL0"),
Glib::ustring::format(std::fixed, std::setprecision(4), stud),
Glib::ustring::format(std::fixed, std::setprecision(0), bia),
Glib::ustring::format(std::fixed, std::setprecision(0), temp0))
);
}
PatchLabel->set_text(
Glib::ustring::compose(M("TP_WBALANCE_PATCHLABEL"),
Glib::ustring::format(std::fixed, std::setprecision(0), dread),
Glib::ustring::format(std::fixed, std::setprecision(4), minchrom),
Glib::ustring::format(std::fixed, std::setprecision(0), kmin))
);
PatchlevelLabel->set_text(
Glib::ustring::compose(M("TP_WBALANCE_PATCHLEVELLABEL"),
Glib::ustring::format(std::fixed, std::setprecision(4), delta),
Glib::ustring::format(std::fixed, std::setprecision(0), histmin),
Glib::ustring::format(std::fixed, std::setprecision(0), histmax))
);
temp->setDefault(temperature);
green->setDefault(greenVal);
enableListener();