Solving issue 1937: "Auto-WB goes green when image is re-opened"
This commit is contained in:
@@ -38,7 +38,7 @@ namespace rtengine {
|
||||
|
||||
extern const Settings* settings;
|
||||
|
||||
static const double cie_colour_match_jd[97][3] = {//350nm to 830nm 5 nm J.Desmis observer 2°
|
||||
static const double cie_colour_match_jd[97][3] = {//350nm to 830nm 5 nm J.Desmis observer 2<EFBFBD>
|
||||
{0.0000000,0.000000,0.000000}, {0.0000000,0.000000,0.000000}, {0.0001299,0.0003917,0.0006061},
|
||||
{0.0002321,0.000006965,0.001086}, {0.0004149,0.00001239,0.001946}, {0.0007416,0.00002202,0.003846},
|
||||
{0.001368,0.000039,0.006450001}, {0.002236,0.000064,0.01054999}, {0.004243,0.000120,0.02005001},
|
||||
@@ -286,7 +286,7 @@ const double ColorTemp::Solux4100_spect[97] = {
|
||||
62.40,61.373,59.75,58.1810,56.25,54.395,51.90,49.496,47.05,44.620
|
||||
};
|
||||
|
||||
//spectral data for Solux lamp : near Daylight (for example "musée d'Orsay..") - 4700K
|
||||
//spectral data for Solux lamp : near Daylight (for example "mus<EFBFBD>e d'Orsay..") - 4700K
|
||||
const double ColorTemp::Solux4700_spect[97] = {
|
||||
0.4590,0.83,1.2011,1.53,1.8647,2.15,2.5338,3.06,3.5809,3.99,4.4137,4.82,5.2228,5.63,6.0387,6.53,6.9944,7.55,8.0266,8.475,8.9276,8.90,9.7840,10.20,10.6390,11.00,11.3600,11.75,12.1340,12.36,12.5880,12.74,12.8790,
|
||||
13.07,13.2560,13.38,13.5220,13.41,13.3070,13.35,13.3990,13.37,13.3420,13.39,13.4220,13.65,13.2710,13.25,13.2330,13.12,13.0110,12.93,12.8470,12.805,12.7630,12.66,12.5760,12.563,12.5490,
|
||||
@@ -2254,7 +2254,7 @@ The next 3 methods are inspired from:
|
||||
|
||||
this values are often called xBar yBar zBar and are characteristics of a color / illuminant
|
||||
|
||||
values cie_colour_match[][3] = Observer 2° x2, y2, z2
|
||||
values cie_colour_match[][3] = Observer 2<EFBFBD> x2, y2, z2
|
||||
E.g. for 380nm: x2=0.001368 y2=0.000039 z2=0.006451 round in J.Walker to 0.0014 0.0000 0.0065 above
|
||||
I have increase precision used by J.Walker and pass to 350nm to 830nm
|
||||
*/
|
||||
@@ -2310,7 +2310,7 @@ void ColorTemp::spectrum_to_xyz_preset(const double* spec_intens, double &x, dou
|
||||
|
||||
this values are often called xBar yBar zBar and are characteristics of a color / illuminant
|
||||
|
||||
values cie_colour_match[][3] = Observer 2° x2, y2, z2
|
||||
values cie_colour_match[][3] = Observer 2<EFBFBD> x2, y2, z2
|
||||
E.g. for 380nm: x2=0.001368 y2=0.000039 z2=0.006451 round in J.Walker to 0.0014 0.0000 0.0065 above
|
||||
I have increased the precision used by J.Walker and pass from 350nm to 830nm
|
||||
*/
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace rtengine {
|
||||
virtual void getSpotWBData (double &reds, double &greens, double &blues, int &rn, int &gn, int &bn,
|
||||
std::vector<Coord2D> &red, std::vector<Coord2D> &green, std::vector<Coord2D> &blue,
|
||||
int tran) {}
|
||||
virtual void getAutoWBMultipliers (double &rm, double &gm, double &bm) { rm=1.0; bm=1.0; gm=1.0; }
|
||||
virtual void getAutoWBMultipliers (double &rm, double &gm, double &bm) { rm=gm=bm=1.0; }
|
||||
virtual const char* getType () const { return "unknown"; }
|
||||
|
||||
};
|
||||
|
||||
@@ -78,7 +78,7 @@ class ImageSource : public InitialImage {
|
||||
virtual bool isWBProviderReady () =0;
|
||||
|
||||
virtual void convertColorSpace (Imagefloat* image, ColorManagementParams cmp, RAWParams raw) =0;// DIRTY HACK: this method is derived in rawimagesource and strimagesource, but (...,RAWParams raw) will be used ONLY for raw images
|
||||
virtual void getAutoWBMultipliers (double &rm, double &bm, double &gm) =0;
|
||||
virtual void getAutoWBMultipliers (double &rm, double &gm, double &bm) =0;
|
||||
virtual ColorTemp getWB () =0;
|
||||
virtual ColorTemp getSpotWB (std::vector<Coord2D> &red, std::vector<Coord2D> &green, std::vector<Coord2D> &blue, int tran, double equal) =0;
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) {
|
||||
double rm, gm, bm;
|
||||
imgsrc->getAutoWBMultipliers(rm, gm, bm);
|
||||
if (rm != -1.) {
|
||||
autoWB.update(rm, bm, gm, params.wb.equal);
|
||||
autoWB.update(rm, gm, bm, params.wb.equal);
|
||||
lastAwbEqual = params.wb.equal;
|
||||
}
|
||||
else {
|
||||
@@ -627,7 +627,7 @@ bool ImProcCoordinator::getAutoWB (double& temp, double& green, double equal) {
|
||||
double rm, gm, bm;
|
||||
imgsrc->getAutoWBMultipliers(rm, gm, bm);
|
||||
if (rm != -1) {
|
||||
autoWB.update(rm, bm, gm, equal);
|
||||
autoWB.update(rm, gm, bm, equal);
|
||||
lastAwbEqual = equal;
|
||||
}
|
||||
else {
|
||||
@@ -739,7 +739,7 @@ void ImProcCoordinator::saveInputICCReference (const Glib::ustring& fname) {
|
||||
double rm, gm, bm;
|
||||
imgsrc->getAutoWBMultipliers(rm, gm, bm);
|
||||
if (rm != -1.) {
|
||||
autoWB.update(rm, bm, gm, params.wb.equal);
|
||||
autoWB.update(rm, gm, bm, params.wb.equal);
|
||||
lastAwbEqual = params.wb.equal;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -2265,7 +2265,7 @@ void RawImageSource::getRowStartEnd (int x, int &start, int &end) {
|
||||
}
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
void RawImageSource::getAutoWBMultipliers (double &rm, double &bm, double &gm) {
|
||||
void RawImageSource::getAutoWBMultipliers (double &rm, double &gm, double &bm) {
|
||||
|
||||
if (redAWBMul != -1.) {
|
||||
rm = redAWBMul;
|
||||
|
||||
@@ -153,7 +153,7 @@ class RawImageSource : public ImageSource {
|
||||
|
||||
void getImage (ColorTemp ctemp, int tran, Imagefloat* image, PreviewProps pp, HRecParams hrp, ColorManagementParams cmp, RAWParams raw);
|
||||
ColorTemp getWB () { return wb; }
|
||||
void getAutoWBMultipliers (double &rm, double &bm, double &gm);
|
||||
void getAutoWBMultipliers (double &rm, double &gm, double &bm);
|
||||
ColorTemp getSpotWB (std::vector<Coord2D> &red, std::vector<Coord2D> &green, std::vector<Coord2D> &blue, int tran, double equal);
|
||||
bool isWBProviderReady () { return rawData; }
|
||||
|
||||
|
||||
@@ -109,9 +109,9 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p
|
||||
if (params.wb.method=="Camera")
|
||||
currWB = imgsrc->getWB ();
|
||||
else if (params.wb.method=="Auto") {
|
||||
double rm, bm, gm;
|
||||
imgsrc->getAutoWBMultipliers(rm, bm, gm);
|
||||
currWB.update(rm, bm, gm, params.wb.equal);
|
||||
double rm, gm, bm;
|
||||
imgsrc->getAutoWBMultipliers(rm, gm, bm);
|
||||
currWB.update(rm, gm, bm, params.wb.equal);
|
||||
}
|
||||
Imagefloat* baseImg = new Imagefloat (fw, fh);
|
||||
imgsrc->getImage (currWB, tr, baseImg, pp, params.hlrecovery, params.icm, params.raw);
|
||||
@@ -218,7 +218,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p
|
||||
if(params.labCurve.contrast !=0) {//only use hist16 for contrast
|
||||
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel shared(hist16,labView, fh, fw)
|
||||
#pragma<EFBFBD>omp<EFBFBD>parallel<EFBFBD>shared(hist16,labView, fh, fw)
|
||||
#endif
|
||||
{
|
||||
#ifdef _OPENMP
|
||||
|
||||
@@ -292,7 +292,7 @@ void StdImageSource::getAutoExpHistogram (LUTu & histogram, int& histcompr) {
|
||||
}
|
||||
}
|
||||
|
||||
void StdImageSource::getAutoWBMultipliers (double &rm, double &bm, double &gm) {
|
||||
void StdImageSource::getAutoWBMultipliers (double &rm, double &gm, double &bm) {
|
||||
if (redAWBMul != -1.) {
|
||||
rm = redAWBMul;
|
||||
gm = greenAWBMul;
|
||||
|
||||
@@ -45,7 +45,7 @@ class StdImageSource : public ImageSource {
|
||||
int load (Glib::ustring fname, bool batch = false);
|
||||
void getImage (ColorTemp ctemp, int tran, Imagefloat* image, PreviewProps pp, HRecParams hrp, ColorManagementParams cmp, RAWParams raw);
|
||||
ColorTemp getWB () { return wb; }
|
||||
void getAutoWBMultipliers (double &rm, double &bm, double &gm);
|
||||
void getAutoWBMultipliers (double &rm, double &gm, double &bm);
|
||||
ColorTemp getSpotWB (std::vector<Coord2D> &red, std::vector<Coord2D> &green, std::vector<Coord2D> &blue, int tran, double equal);
|
||||
|
||||
bool isWBProviderReady () { return true; };
|
||||
|
||||
Reference in New Issue
Block a user