Whitebalance - Removed GUI Itcwb from whitebalance and preferences (#6710)
* Change Preferences for observer whitebalance * Change label white balance preferences * Added Preferences 2 parameters Whitebalance auto correlation * Add Preference Temperature correlation - sort and tooltip * Change to rtengine cmakelist * Apply patch from Lawrence37 * Small comment code * Change defaut order prefrences wba * Added force extra algoritm to Preferences * Harmonize itcwb sorted * Add fields to Preferences Itcwb * Change settings precision Itcwb in Preferences * Change tooltip Itcwb preferences * First stage Itwcwb settings in main with pp3 and selction in preferences * Second stage Itwcwb settings in main with pp3 and selction in preferences * Third stage Itwcwb settings in main with pp3 and selction in preferences * Add itcwb_fgreen student - green optimize * Add Itcwb green range * Itcwb history msg - first tooltips * Remove force-extra because always used * reused force-extra to use entire CIExy for sampling datas * Removed inwanted text in console * Set sensitive for Itcwbframe * Various change - comment .. * Small code review - chnage tooltips * Remove settings itcwb_delta in Rawimagesource.cc to simplify * Remove Itcwb Observer - put a single observer for everything - general - itcwb * Fixed conflicts in colortemp.cc * Various change - fixed bug - simplify * Fixed limits for settings pp3 - chnage tooltip * Clean unused code * Put itcwb_findgreen in GUI * Added checkbox 'Low sampling' to find the settings of 5.9 * Set Observer to Observer 10° - preferences default * Missing setting Low sampling * Show white balance multipliers * Change default settings - Itcwb_sorted * Move observer from preferences to WB * Make observer selectable for camera WB * Ensure observer checkbox is in sync with PP3 * Set default ITCWB low sampling for PP3s from <=5.9 Ensure temperature correlation white balance algorithm 1 is used when opening edits from versions 5.9 and earlier. * Removed unused White-balance frame in Preferences * Comment some GUI sliders checkbox * Removed all GUI itcwb in preferences and whitebalance * Removed forgotten code in preferences * Remove labels tooltips history Itcwb --------- Co-authored-by: Lawrence Lee <45837045+Lawrence37@users.noreply.github.com>
This commit is contained in:
@@ -489,7 +489,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
|
||||
if (todo & (M_INIT | M_LINDENOISE | M_HDR)) {
|
||||
if (params->wb.method == "autitcgreen") {
|
||||
imgsrc->getrgbloc(0, 0, fh, fw, 0, 0, fh, fw);
|
||||
imgsrc->getrgbloc(0, 0, fh, fw, 0, 0, fh, fw, params->wb);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -522,7 +522,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
printf("Applying white balance, color correction & sRBG conversion...\n");
|
||||
}
|
||||
|
||||
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, params->wb.observer);
|
||||
float studgood = 1000.f;
|
||||
|
||||
if (!params->wb.enabled) {
|
||||
@@ -531,7 +531,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
currWB = imgsrc->getWB();
|
||||
lastAwbauto = ""; //reinitialize auto
|
||||
} else if (autowb) {
|
||||
if (params->wb.method == "autitcgreen" || lastAwbEqual != params->wb.equal || lastAwbTempBias != params->wb.tempBias || lastAwbauto != params->wb.method) {
|
||||
if (params->wb.method == "autitcgreen" || lastAwbEqual != params->wb.equal || lastAwbObserver != params->wb.observer || lastAwbTempBias != params->wb.tempBias || lastAwbauto != params->wb.method) {
|
||||
double rm, gm, bm;
|
||||
double tempitc = 5000.f;
|
||||
double greenitc = 1.;
|
||||
@@ -547,7 +547,9 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
if (params->wb.method == "autitcgreen") {
|
||||
params->wb.temperature = tempitc;
|
||||
params->wb.green = greenitc;
|
||||
currWB = ColorTemp(params->wb.temperature, params->wb.green, 1., params->wb.method);
|
||||
currWB = ColorTemp(params->wb.temperature, params->wb.green, 1., params->wb.method, params->wb.observer);
|
||||
//printf("tempitc=%f greitc=%f\n", tempitc, greenitc);
|
||||
|
||||
currWB.getMultipliers(rm, gm, bm);
|
||||
}
|
||||
|
||||
@@ -558,15 +560,17 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
bias = 0.;
|
||||
}
|
||||
|
||||
autoWB.update(rm, gm, bm, params->wb.equal, bias);
|
||||
autoWB.update(rm, gm, bm, params->wb.equal, params->wb.observer, bias);
|
||||
lastAwbEqual = params->wb.equal;
|
||||
lastAwbObserver = params->wb.observer;
|
||||
lastAwbTempBias = params->wb.tempBias;
|
||||
lastAwbauto = params->wb.method;
|
||||
} else {
|
||||
lastAwbEqual = -1.;
|
||||
lastAwbObserver = ColorTemp::DEFAULT_OBSERVER;
|
||||
lastAwbTempBias = 0.0;
|
||||
lastAwbauto = "";
|
||||
autoWB.useDefaults(params->wb.equal);
|
||||
autoWB.useDefaults(params->wb.equal, params->wb.observer);
|
||||
}
|
||||
|
||||
|
||||
@@ -574,17 +578,24 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
|
||||
currWB = autoWB;
|
||||
}
|
||||
double rw = 1.;
|
||||
double gw = 1.;
|
||||
double bw = 1.;
|
||||
|
||||
if (params->wb.enabled) {
|
||||
params->wb.temperature = currWB.getTemp();
|
||||
currWB = currWB.convertObserver(params->wb.observer);
|
||||
params->wb.temperature = static_cast<int>(currWB.getTemp());
|
||||
params->wb.green = currWB.getGreen();
|
||||
currWB.getMultipliers(rw, gw, bw);
|
||||
imgsrc->wbMul2Camera(rw, gw, bw);
|
||||
// printf("ra=%f ga=%f ba=%f\n", rw, gw, bw);
|
||||
}
|
||||
|
||||
if (autowb && awbListener) {
|
||||
if (awbListener) {
|
||||
if (params->wb.method == "autitcgreen") {
|
||||
awbListener->WBChanged(params->wb.temperature, params->wb.green, studgood);
|
||||
} else if (params->wb.method == "autold") {
|
||||
awbListener->WBChanged(params->wb.temperature, params->wb.green, -1.f);
|
||||
awbListener->WBChanged(params->wb.temperature, params->wb.green, rw, gw, bw, studgood);
|
||||
} else {
|
||||
awbListener->WBChanged(params->wb.temperature, params->wb.green, rw, gw, bw, -1.f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -621,7 +632,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
PreviewProps pp(0, 0, fw, fh, scale);
|
||||
// Tells to the ImProcFunctions' tools what is the preview scale, which may lead to some simplifications
|
||||
ipf.setScale(scale);
|
||||
int inpaintopposed = 1;//force getimage to use inpaint-opposed if enable, only once
|
||||
int inpaintopposed = 1;//force getimage to use inpaint-opposed if enable, only once
|
||||
imgsrc->getImage(currWB, tr, orig_prev, pp, params->toneCurve, params->raw, inpaintopposed);
|
||||
|
||||
if ((todo & M_SPOT) && params->spot.enabled && !params->spot.entries.empty()) {
|
||||
@@ -782,7 +793,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
|
||||
if (params->toneCurve.histmatching) {
|
||||
if (!params->toneCurve.fromHistMatching) {
|
||||
imgsrc->getAutoMatchedToneCurve(params->icm, params->toneCurve.curve);
|
||||
imgsrc->getAutoMatchedToneCurve(params->icm, params->wb.observer, params->toneCurve.curve);
|
||||
}
|
||||
|
||||
if (params->toneCurve.autoexp) {
|
||||
@@ -2452,11 +2463,11 @@ bool ImProcCoordinator::updateWaveforms()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ImProcCoordinator::getAutoWB(double& temp, double& green, double equal, double tempBias)
|
||||
bool ImProcCoordinator::getAutoWB(double& temp, double& green, double equal, StandardObserver observer, double tempBias)
|
||||
{
|
||||
|
||||
if (imgsrc) {
|
||||
if (lastAwbEqual != equal || lastAwbTempBias != tempBias || lastAwbauto != params->wb.method) {
|
||||
if (lastAwbEqual != equal || lastAwbObserver != observer || lastAwbTempBias != tempBias || lastAwbauto != params->wb.method) {
|
||||
// Issue 2500 MyMutex::MyLock lock(minit); // Also used in crop window
|
||||
double rm, gm, bm;
|
||||
params->wb.method = "autold";//same result as before multiple Auto WB
|
||||
@@ -2469,13 +2480,15 @@ bool ImProcCoordinator::getAutoWB(double& temp, double& green, double equal, dou
|
||||
imgsrc->getAutoWBMultipliersitc(tempref, greenref, tempitc, greenitc, studgood, 0, 0, fh, fw, 0, 0, fh, fw, rm, gm, bm, params->wb, params->icm, params->raw, params->toneCurve);
|
||||
|
||||
if (rm != -1) {
|
||||
autoWB.update(rm, gm, bm, equal, tempBias);
|
||||
autoWB.update(rm, gm, bm, equal, observer, tempBias);
|
||||
lastAwbEqual = equal;
|
||||
lastAwbObserver = observer;
|
||||
lastAwbTempBias = tempBias;
|
||||
lastAwbauto = params->wb.method;
|
||||
} else {
|
||||
lastAwbEqual = -1.;
|
||||
autoWB.useDefaults(equal);
|
||||
lastAwbObserver = ColorTemp::DEFAULT_OBSERVER;
|
||||
autoWB.useDefaults(equal, observer);
|
||||
lastAwbauto = "";
|
||||
lastAwbTempBias = 0.0;
|
||||
}
|
||||
@@ -2492,12 +2505,13 @@ bool ImProcCoordinator::getAutoWB(double& temp, double& green, double equal, dou
|
||||
}
|
||||
}
|
||||
|
||||
void ImProcCoordinator::getCamWB(double& temp, double& green)
|
||||
void ImProcCoordinator::getCamWB(double& temp, double& green, StandardObserver observer)
|
||||
{
|
||||
|
||||
if (imgsrc) {
|
||||
temp = imgsrc->getWB().getTemp();
|
||||
green = imgsrc->getWB().getGreen();
|
||||
const ColorTemp color_temp = imgsrc->getWB().convertObserver(observer);
|
||||
temp = color_temp.getTemp();
|
||||
green = color_temp.getGreen();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2519,8 +2533,8 @@ void ImProcCoordinator::getSpotWB(int x, int y, int rect, double& temp, double&
|
||||
|
||||
int tr = getCoarseBitMask(params->coarse);
|
||||
|
||||
ret = imgsrc->getSpotWB(red, green, blue, tr, params->wb.equal);
|
||||
currWB = ColorTemp(params->wb.temperature, params->wb.green, params->wb.equal, params->wb.method);
|
||||
ret = imgsrc->getSpotWB(red, green, blue, tr, params->wb.equal, params->wb.observer);
|
||||
currWB = ColorTemp(params->wb.temperature, params->wb.green, params->wb.equal, params->wb.method, params->wb.observer);
|
||||
//double rr,gg,bb;
|
||||
//currWB.getMultipliers(rr,gg,bb);
|
||||
|
||||
@@ -2626,23 +2640,25 @@ void ImProcCoordinator::saveInputICCReference(const Glib::ustring& fname, bool a
|
||||
imgsrc->preprocess(ppar.raw, ppar.lensProf, ppar.coarse);
|
||||
double dummy = 0.0;
|
||||
imgsrc->demosaic(ppar.raw, false, dummy);
|
||||
ColorTemp currWB = ColorTemp(validParams->wb.temperature, validParams->wb.green, validParams->wb.equal, validParams->wb.method);
|
||||
ColorTemp currWB = ColorTemp(validParams->wb.temperature, validParams->wb.green, validParams->wb.equal, validParams->wb.method, validParams->wb.observer);
|
||||
|
||||
if (validParams->wb.method == "Camera") {
|
||||
currWB = imgsrc->getWB();
|
||||
} else if (validParams->wb.method == "autold") {
|
||||
if (lastAwbEqual != validParams->wb.equal || lastAwbTempBias != validParams->wb.tempBias) {
|
||||
if (lastAwbEqual != validParams->wb.equal || lastAwbObserver != validParams->wb.observer || lastAwbTempBias != validParams->wb.tempBias) {
|
||||
double rm, gm, bm;
|
||||
imgsrc->getAutoWBMultipliers(rm, gm, bm);
|
||||
|
||||
if (rm != -1.) {
|
||||
autoWB.update(rm, gm, bm, validParams->wb.equal, validParams->wb.tempBias);
|
||||
autoWB.update(rm, gm, bm, validParams->wb.equal, validParams->wb.observer, validParams->wb.tempBias);
|
||||
lastAwbEqual = validParams->wb.equal;
|
||||
lastAwbObserver = validParams->wb.observer;
|
||||
lastAwbTempBias = validParams->wb.tempBias;
|
||||
} else {
|
||||
lastAwbEqual = -1.;
|
||||
lastAwbObserver = ColorTemp::DEFAULT_OBSERVER;
|
||||
lastAwbTempBias = 0.0;
|
||||
autoWB.useDefaults(validParams->wb.equal);
|
||||
autoWB.useDefaults(validParams->wb.equal, validParams->wb.observer);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user