Avoid Color shift - Gamut and Munsell Review in RT - branch Munsellgamut (#6673)

* Fixed numerous problems with gamut and Munsell in Local adjustments

* change gamut-munsell in lab adjustmnts - gamut in ciecam

* Improve XYZ colorimetry and tooltip

* Change event - format code - change labels tooltips

* Removed avoid_ and avoidmun_

* Removed avoidcolorshift in labcurve

* Push change proposed by Lawrence37 - compatibility with old pp3
This commit is contained in:
Desmis
2023-01-31 12:32:31 +01:00
committed by GitHub
parent ef7676826e
commit 9a245c1acb
16 changed files with 855 additions and 588 deletions

View File

@@ -277,6 +277,18 @@ void Locallab::read(const rtengine::procparams::ProcParams* pp, const ParamsEdit
} else {
r->shapeMethod = 3;
}
if (pp->locallab.spots.at(i).avoidgamutMethod == "NONE") {
r->avoidgamutMethod = 0;
} else if (pp->locallab.spots.at(i).avoidgamutMethod == "LAB") {
r->avoidgamutMethod = 1;
} else if (pp->locallab.spots.at(i).avoidgamutMethod == "XYZ") {
r->avoidgamutMethod= 2;
} else if (pp->locallab.spots.at(i).avoidgamutMethod == "XYZREL") {
r->avoidgamutMethod= 3;
} else if (pp->locallab.spots.at(i).avoidgamutMethod == "MUNS") {
r->avoidgamutMethod= 4;
}
r->locX = pp->locallab.spots.at(i).loc.at(0);
r->locXL = pp->locallab.spots.at(i).loc.at(1);
@@ -306,8 +318,6 @@ void Locallab::read(const rtengine::procparams::ProcParams* pp, const ParamsEdit
r->avoidrad = pp->locallab.spots.at(i).avoidrad;
r->hishow = pp->locallab.spots.at(i).hishow;
r->activ = pp->locallab.spots.at(i).activ;
r->avoid = pp->locallab.spots.at(i).avoid;
r->avoidmun = pp->locallab.spots.at(i).avoidmun;
r->blwh = pp->locallab.spots.at(i).blwh;
r->recurs = pp->locallab.spots.at(i).recurs;
r->laplac = true; //pp->locallab.spots.at(i).laplac;
@@ -441,6 +451,18 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
r->shapeMethod = 3;
}
if (newSpot->avoidgamutMethod == "NONE") {
r->avoidgamutMethod = 0;
} else if (newSpot->avoidgamutMethod == "LAB") {
r->avoidgamutMethod = 1;
} else if (newSpot->avoidgamutMethod == "XYZ") {
r->avoidgamutMethod = 2;
} else if (newSpot->avoidgamutMethod == "XYZREL") {
r->avoidgamutMethod = 3;
} else if (newSpot->avoidgamutMethod == "MUNS") {
r->avoidgamutMethod = 4;
}
// Calculate spot size and center position according to preview area
if (provider && !batchMode) {
provider->getImageSize(imW, imH);
@@ -488,8 +510,6 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
r->avoidrad = newSpot->avoidrad;
r->hishow = newSpot->hishow;
r->activ = newSpot->activ;
r->avoid = newSpot->avoid;
r->avoidmun = newSpot->avoidmun;
r->blwh = newSpot->blwh;
r->recurs = newSpot->recurs;
r->laplac = newSpot->laplac;
@@ -742,6 +762,18 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
r->shapeMethod = 3;
}
//printf("n0=%f n1=%f n2=%f n3=%f\n", (double) newSpot->loc.at(0), (double) newSpot->loc.at(1), (double) newSpot->loc.at(2), (double) newSpot->loc.at(3));
if (newSpot->avoidgamutMethod == "NONE") {
r->avoidgamutMethod = 0;
} else if (newSpot->avoidgamutMethod == "LAB") {
r->avoidgamutMethod = 1;
} else if (newSpot->avoidgamutMethod== "XYZ") {
r->avoidgamutMethod = 2;
} else if (newSpot->avoidgamutMethod== "XYZREL") {
r->avoidgamutMethod = 3;
} else if (newSpot->avoidgamutMethod== "MUNS") {
r->avoidgamutMethod = 4;
}
//printf("n0=%f n1=%f n2=%f n3=%f\n", (double) newSpot->loc.at(0), (double) newSpot->loc.at(1), (double) newSpot->loc.at(2), (double) newSpot->loc.at(3));
// Calculate spot size and center position according to preview area
if (provider && !batchMode) {
@@ -799,8 +831,6 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
r->colorscope = newSpot->colorscope;
r->avoidrad = newSpot->avoidrad;
r->activ = newSpot->activ;
r->avoid = newSpot->avoid;
r->avoidmun = newSpot->avoidmun;
r->blwh = newSpot->blwh;
r->recurs = newSpot->recurs;
r->laplac = newSpot->laplac;
@@ -927,6 +957,18 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
pp->locallab.spots.at(pp->locallab.selspot).shapeMethod = "SYMSL";
}
if (r->avoidgamutMethod == 0) {
pp->locallab.spots.at(pp->locallab.selspot).avoidgamutMethod = "NONE";
} else if (r->avoidgamutMethod == 1) {
pp->locallab.spots.at(pp->locallab.selspot).avoidgamutMethod = "LAB";
} else if (r->avoidgamutMethod == 2) {
pp->locallab.spots.at(pp->locallab.selspot).avoidgamutMethod = "XYZ";
} else if (r->avoidgamutMethod == 3) {
pp->locallab.spots.at(pp->locallab.selspot).avoidgamutMethod = "XYZREL";
} else if (r->avoidgamutMethod == 4) {
pp->locallab.spots.at(pp->locallab.selspot).avoidgamutMethod = "MUNS";
}
pp->locallab.spots.at(pp->locallab.selspot).loc.at(0) = r->locX;
pp->locallab.spots.at(pp->locallab.selspot).loc.at(1) = r->locXL;
pp->locallab.spots.at(pp->locallab.selspot).loc.at(2) = r->locY;
@@ -955,8 +997,6 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
pp->locallab.spots.at(pp->locallab.selspot).avoidrad = r->avoidrad;
pp->locallab.spots.at(pp->locallab.selspot).hishow = r->hishow;
pp->locallab.spots.at(pp->locallab.selspot).activ = r->activ;
pp->locallab.spots.at(pp->locallab.selspot).avoid = r->avoid;
pp->locallab.spots.at(pp->locallab.selspot).avoidmun = r->avoidmun;
pp->locallab.spots.at(pp->locallab.selspot).blwh = r->blwh;
pp->locallab.spots.at(pp->locallab.selspot).recurs = r->recurs;
pp->locallab.spots.at(pp->locallab.selspot).laplac = r->laplac;