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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 855 additions and 588 deletions

View File

@ -1414,6 +1414,7 @@ HISTORY_MSG_FILMNEGATIVE_COLORSPACE;Film negative color space
HISTORY_MSG_FILMNEGATIVE_ENABLED;Film Negative
HISTORY_MSG_FILMNEGATIVE_REF_SPOT;FN - Reference input
HISTORY_MSG_FILMNEGATIVE_VALUES;Film negative values
HISTORY_MSG_GAMUTMUNSEL;Gamut-Munsell
HISTORY_MSG_HISTMATCHING;Auto-matched tone curve
HISTORY_MSG_HLBL;Color propagation - blur
HISTORY_MSG_ICL_LABGRIDCIEXY;Cie xy
@ -1441,6 +1442,7 @@ HISTORY_MSG_LOCALCONTRAST_DARKNESS;Local Contrast - Darkness
HISTORY_MSG_LOCALCONTRAST_ENABLED;Local Contrast
HISTORY_MSG_LOCALCONTRAST_LIGHTNESS;Local Contrast - Lightness
HISTORY_MSG_LOCALCONTRAST_RADIUS;Local Contrast - Radius
HISTORY_MSG_LOCAL_GAMUTMUNSEL;Local - Gamut-Munsell
HISTORY_MSG_METADATA_MODE;Metadata copy mode
HISTORY_MSG_MICROCONTRAST_CONTRAST;Microcontrast - Contrast threshold
HISTORY_MSG_PDSHARPEN_AUTO_CONTRAST;CS - Auto threshold
@ -2608,8 +2610,6 @@ TP_ICM_WORKING_TRC_SRGB;sRGB g=2.4 s=12.92
TP_ICM_WORKING_TRC_TOOLTIP;Only for built-in profiles.
TP_IMPULSEDENOISE_LABEL;Impulse Noise Reduction
TP_IMPULSEDENOISE_THRESH;Threshold
TP_LABCURVE_AVOIDCOLORSHIFT;Avoid color shift
TP_LABCURVE_AVOIDCOLORSHIFT_TOOLTIP;Fit colors into gamut of the working color space and apply Munsell correction (Uniform Perceptual Lab).
TP_LABCURVE_BRIGHTNESS;Lightness
TP_LABCURVE_CHROMATICITY;Chromaticity
TP_LABCURVE_CHROMA_TOOLTIP;To apply B&W toning, set Chromaticity to -100.
@ -2674,7 +2674,7 @@ TP_LOCALLAB_ARTIF_TOOLTIP;ΔE scope threshold increases the range of ΔE scope.
TP_LOCALLAB_AUTOGRAY;Auto mean luminance (Yb%)
TP_LOCALLAB_AUTOGRAYCIE;Auto
TP_LOCALLAB_AVOID;Avoid color shift
TP_LOCALLAB_AVOIDCOLORSHIFT_TOOLTIP;Fit colors into gamut of the working color space and apply Munsell correction (Uniform Perceptual Lab).\nMunsell correction always disabled when Jz or CAM16 is used.
TP_LOCALLAB_AVOIDCOLORSHIFT_TOOLTIP;Fit colors into gamut of the working color space and apply Munsell correction (Uniform Perceptual Lab).\nMunsell correction always disabled when Jz or CAM16 or Color Appearance and Lighting is used.\n\nDefault: Munsell.\nMunsell correction: fixes Lab mode hue drifts due to non-linearity, when chromaticity is changed (Uniform Perceptual Lab).\nLab: applies a gamut control, in relative colorimetric, Munsell is then applied.\nXYZ Absolute, applies gamut control, in absolute colorimetric, Munsell is then applied.\nXYZ Relative, applies gamut control, in relative colorimetric, Munsell is then applied.
TP_LOCALLAB_AVOIDMUN;Munsell correction only
TP_LOCALLAB_AVOIDMUN_TOOLTIP;Munsell correction always disabled when Jz or CAM16 is used.
TP_LOCALLAB_AVOIDRAD;Soft radius
@ -2904,6 +2904,11 @@ TP_LOCALLAB_GAMM;Gamma
TP_LOCALLAB_GAMMASKCOL;Gamma
TP_LOCALLAB_GAMMASK_TOOLTIP;Adjusting Gamma and Slope can provide a soft and artifact-free transformation of the mask by progressively modifying 'L' to avoid any discontinuities.
TP_LOCALLAB_GAMSH;Gamma
TP_LOCALLAB_GAMUTNON;None
TP_LOCALLAB_GAMUTLABRELA;Lab
TP_LOCALLAB_GAMUTXYZABSO;XYZ Absolute
TP_LOCALLAB_GAMUTXYZRELA;XYZ Relative
TP_LOCALLAB_GAMUTMUNSELL;Munsell only
TP_LOCALLAB_GAMW;Gamma (wavelet pyramids)
TP_LOCALLAB_GRADANG;Gradient angle
TP_LOCALLAB_GRADANG_TOOLTIP;Rotation angle in degrees: -180 0 +180.

View File

@ -54,7 +54,8 @@
#pragma GCC diagnostic warning "-Wextra"
#pragma GCC diagnostic warning "-Wdouble-promotion"
namespace {
namespace
{
using namespace rtengine;
@ -218,20 +219,24 @@ void proPhotoBlue(float *rtemp, float *gtemp, float *btemp, int istart, int tH,
}
}
void customToneCurve(const ToneCurve &customToneCurve, ToneCurveMode curveMode, float *rtemp, float *gtemp, float *btemp, int istart, int tH, int jstart, int tW, int tileSize, PerceptualToneCurveState ptcApplyState) {
void customToneCurve(const ToneCurve &customToneCurve, ToneCurveMode curveMode, float *rtemp, float *gtemp, float *btemp, int istart, int tH, int jstart, int tW, int tileSize, PerceptualToneCurveState ptcApplyState)
{
if (curveMode == ToneCurveMode::STD) { // Standard
const StandardToneCurve& userToneCurve = static_cast<const StandardToneCurve&>(customToneCurve);
for (int i = istart, ti = 0; i < tH; i++, ti++) {
userToneCurve.BatchApply(0, tW - jstart, &rtemp[ti * tileSize], &gtemp[ti * tileSize], &btemp[ti * tileSize]);
}
} else if (curveMode == ToneCurveMode::FILMLIKE) { // Adobe like
const AdobeToneCurve& userToneCurve = static_cast<const AdobeToneCurve&>(customToneCurve);
for (int i = istart, ti = 0; i < tH; i++, ti++) {
userToneCurve.BatchApply(0, tW - jstart, &rtemp[ti * tileSize], &gtemp[ti * tileSize], &btemp[ti * tileSize]);
}
} else if (curveMode == ToneCurveMode::SATANDVALBLENDING) { // apply the curve on the saturation and value channels
const SatAndValueBlendingToneCurve& userToneCurve = static_cast<const SatAndValueBlendingToneCurve&>(customToneCurve);
for (int i = istart, ti = 0; i < tH; i++, ti++) {
for (int j = jstart, tj = 0; j < tW; j++, tj++) {
userToneCurve.Apply(rtemp[ti * tileSize + tj], gtemp[ti * tileSize + tj], btemp[ti * tileSize + tj]);
@ -239,6 +244,7 @@ void customToneCurve(const ToneCurve &customToneCurve, ToneCurveMode curveMode,
}
} else if (curveMode == ToneCurveMode::WEIGHTEDSTD) { // apply the curve to the rgb channels, weighted
const WeightedStdToneCurve& userToneCurve = static_cast<const WeightedStdToneCurve&>(customToneCurve);
for (int i = istart, ti = 0; i < tH; i++, ti++) {
userToneCurve.BatchApply(0, tW - jstart, &rtemp[ti * tileSize], &gtemp[ti * tileSize], &btemp[ti * tileSize]);
}
@ -252,6 +258,7 @@ void customToneCurve(const ToneCurve &customToneCurve, ToneCurveMode curveMode,
}
} else if (curveMode == ToneCurveMode::PERCEPTUAL) { // apply curve while keeping color appearance constant
const PerceptualToneCurve& userToneCurve = static_cast<const PerceptualToneCurve&>(customToneCurve);
for (int i = istart, ti = 0; i < tH; i++, ti++) {
userToneCurve.BatchApply(0, tW - jstart, &rtemp[ti * tileSize], &gtemp[ti * tileSize], &btemp[ti * tileSize], ptcApplyState);
}
@ -334,9 +341,11 @@ void ImProcFunctions::updateColorProfiles(const Glib::ustring& monitorProfile, R
if (settings->printerBPC) {
flags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
}
outIntent = RenderingIntent(settings->printerIntent);
} else {
oprof = ICCStore::getInstance()->getProfile(params->icm.outputProfile);
if (params->icm.outputBPC) {
flags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
}
@ -352,12 +361,14 @@ void ImProcFunctions::updateColorProfiles(const Glib::ustring& monitorProfile, R
// }
const auto make_gamma_table =
[](cmsHPROFILE prof, cmsTagSignature tag) -> void
{
[](cmsHPROFILE prof, cmsTagSignature tag) -> void {
cmsToneCurve *tc = static_cast<cmsToneCurve *>(cmsReadTag(prof, tag));
if (tc) {
if (tc)
{
const cmsUInt16Number *table = cmsGetToneCurveEstimatedTable(tc);
cmsToneCurve *tc16 = cmsBuildTabulatedToneCurve16(nullptr, cmsGetToneCurveEstimatedTableEntries(tc), table);
if (tc16) {
cmsWriteTag(prof, tag, tc16);
cmsFreeToneCurve(tc16);
@ -366,6 +377,7 @@ void ImProcFunctions::updateColorProfiles(const Glib::ustring& monitorProfile, R
};
cmsHPROFILE softproof = ProfileContent(oprof).toProfile();
if (softproof) {
make_gamma_table(softproof, cmsSigRedTRCTag);
make_gamma_table(softproof, cmsSigGreenTRCTag);
@ -956,11 +968,13 @@ void ImProcFunctions::ciecam_02float(CieImage* ncie, float adap, int pW, int pwb
float cz, wh, pfl;
int c16 = 1;
if (params->colorappearance.modelmethod == "02") {
c16 = 1;
} else if (params->colorappearance.modelmethod == "16") {
c16 = 16;
} //I don't use PQ here...hence no 21
float plum = 100.f;
Ciecam02::initcam1float(yb, pilot, f, la, xw, yw, zw, n, d, nbb, ncb, cz, aw, wh, pfl, fl, c, c16, plum);
//printf ("wh=%f \n", wh);
@ -1132,6 +1146,7 @@ void ImProcFunctions::ciecam_02float(CieImage* ncie, float adap, int pW, int pwb
Mpro = M;
spro = s;
bool jp = false;
if ((hasColCurve1) && (curveMode == ColorAppearanceParams::TcMode::BRIGHT)) {
jp = true;
float Qq = Qpro * coefQ;
@ -1141,6 +1156,7 @@ void ImProcFunctions::ciecam_02float(CieImage* ncie, float adap, int pW, int pwb
Qq = Qq / coefQ;
Qpro = 0.2f * (Qq - Qold) + Qold;
}
if ((hasColCurve2) && (curveMode2 == ColorAppearanceParams::TcMode::BRIGHT)) {
jp = true;
float Qq2 = Qpro * coefQ;
@ -1150,9 +1166,11 @@ void ImProcFunctions::ciecam_02float(CieImage* ncie, float adap, int pW, int pwb
Qq2 = Qq2 / coefQ;
Qpro = 0.2f * (Qq2 - Qold2) + Qold2;
}
if (jp) {
Jpro = SQR((10.f * Qpro) / wh);
}
// we cannot have all algorithms with all chroma curves
if (alg == 0) {
Jpro = CAMBrightCurveJ[Jpro * 327.68f]; //lightness CIECAM02 + contrast
@ -1456,6 +1474,12 @@ void ImProcFunctions::ciecam_02float(CieImage* ncie, float adap, int pW, int pwb
#else
float xx, yy, zz;
//process normal==> viewing
TMatrix wprofc = ICCStore::getInstance()->workingSpaceMatrix(params->icm.workingProfile);
const double wpc[3][3] = {//improve precision with double
{wprofc[0][0], wprofc[0][1], wprofc[0][2]},
{wprofc[1][0], wprofc[1][1], wprofc[1][2]},
{wprofc[2][0], wprofc[2][1], wprofc[2][2]}
};
Ciecam02::jch2xyz_ciecam02float(xx, yy, zz,
J, C, h,
@ -1466,36 +1490,16 @@ void ImProcFunctions::ciecam_02float(CieImage* ncie, float adap, int pW, int pwb
y = yy * 655.35f;
z = zz * 655.35f;
float Ll, aa, bb;
//convert xyz=>lab
Color::XYZ2Lab(x, y, z, Ll, aa, bb);
// gamut control in Lab mode; I must study how to do with cIECAM only
if (gamu == 1) {
float Lprov1, Chprov1;
Lprov1 = Ll / 327.68f;
Chprov1 = sqrtf(SQR(aa) + SQR(bb)) / 327.68f;
float2 sincosval;
if (Chprov1 == 0.0f) {
sincosval.y = 1.f;
sincosval.x = 0.0f;
} else {
sincosval.y = aa / (Chprov1 * 327.68f);
sincosval.x = bb / (Chprov1 * 327.68f);
Color::gamutmap(x, y, z, wpc);
}
//gamut control : Lab values are in gamut
Color::gamutLchonly(sincosval, Lprov1, Chprov1, wip, highlight, 0.15f, 0.96f);
lab->L[i][j] = Lprov1 * 327.68f;
lab->a[i][j] = 327.68f * Chprov1 * sincosval.y;
lab->b[i][j] = 327.68f * Chprov1 * sincosval.x;
} else {
Color::XYZ2Lab(x, y, z, Ll, aa, bb);
lab->L[i][j] = Ll;
lab->a[i][j] = aa;
lab->b[i][j] = bb;
}
#endif
}
@ -1666,6 +1670,7 @@ void ImProcFunctions::ciecam_02float(CieImage* ncie, float adap, int pW, int pwb
#ifdef _OPENMP
#pragma omp for schedule(dynamic, 10)
#endif
for (int i = 0; i < height; i++) // update CieImages with new values after sharpening, defringe, contrast by detail level
for (int j = 0; j < width; j++) {
float interm = fabsf(ncie->sh_p[i][j] / (32768.f));
@ -2351,6 +2356,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer
}
highlightToneCurve(hltonecurve, rtemp, gtemp, btemp, istart, tH, jstart, tW, TS, exp_scale, comp, hlrange);
if (params->toneCurve.black != 0.0) {
shadowToneCurve(shtonecurve, rtemp, gtemp, btemp, istart, tH, jstart, tW, TS);
}
@ -2683,6 +2689,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer
else if (params->colorToning.method == "Splitco") {
constexpr float reducac = 0.3f;
constexpr int mode = 0;
for (int i = istart, ti = 0; i < tH; i++, ti++) {
for (int j = jstart, tj = 0; j < tW; j++, tj++) {
const float r = rtemp[ti * TS + tj];
@ -4069,7 +4076,8 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW
// !params->labCurve.enabled. It is ugly, but it's the smallest code
// change that I could find
//-------------------------------------------------------------------------
class TempParams {
class TempParams
{
const ProcParams **p_;
const ProcParams *old_;
ProcParams tmp_;
@ -4091,11 +4099,13 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW
bool pipette_for_colortoning_labregions =
editPipette &&
params->colorToning.enabled && params->colorToning.method == "LabRegions";
if (!params->labCurve.enabled && pipette_for_colortoning_labregions) {
utili = autili = butili = ccutili = cclutili = clcutili = false;
tempparams.reset(new TempParams(&params));
curve.makeIdentity();
}
//-------------------------------------------------------------------------
@ -4104,6 +4114,7 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW
// fill pipette buffer with zeros to avoid crashes
editWhatever->fill(0.f);
}
if (params->blackwhite.enabled && !params->colorToning.enabled) {
for (int i = 0; i < lnew->H; ++i) {
for (int j = 0; j < lnew->W; ++j) {
@ -4111,6 +4122,7 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW
}
}
}
return;
}
@ -4203,7 +4215,22 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW
const bool clut = clcutili;
const double rstprotection = 100. - params->labCurve.rstprotection; // Red and Skin Tones Protection
// avoid color shift is disabled when bwToning is activated and enabled if gamut is true in colorappearanace
const bool avoidColorShift = (params->labCurve.avoidcolorshift || (params->colorappearance.gamut && params->colorappearance.enabled)) && !bwToning ;
// const bool avoidColorShift = (params->labCurve.avoidcolorshift || (params->colorappearance.gamut && params->colorappearance.enabled)) && !bwToning ;
//const bool avoidColorS = params->labCurve.avoidcolorshift;
int gamutmuns = 0;
if (params->labCurve.gamutmunselmethod == "NONE") {
gamutmuns = 0;
} else if (params->labCurve.gamutmunselmethod == "LAB") {
gamutmuns = 1;
} else if (params->labCurve.gamutmunselmethod == "XYZ") {
gamutmuns = 2;
} else if (params->labCurve.gamutmunselmethod == "XYZREL") {
gamutmuns = 3;
} else if (params->labCurve.gamutmunselmethod == "MUN") {
gamutmuns = 4;
}
const float protectRed = (float)settings->protectred;
const double protectRedH = settings->protectredh;
const float protect_red = rtengine::LIM<float>(protectRed, 20.f, 180.f); //default=60 chroma: one can put more or less if necessary...in 'option' 40...160
@ -4228,7 +4255,7 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW
const float scaleConst = 100.0f / 100.1f;
const bool gamutLch = settings->gamutLch;
//const bool gamutLch = settings->gamutLch;
const float amountchroma = (float) settings->amchroma;
TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix(params->icm.workingProfile);
@ -4258,12 +4285,12 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW
#endif
for (int i = 0; i < H; i++) {
if (avoidColorShift)
// if (avoidColorShift)
// only if user activate Lab adjustments
if (autili || butili || ccutili || cclutili || chutili || lhutili || hhutili || clcutili || utili || chromaticity) {
Color::LabGamutMunsell(lold->L[i], lold->a[i], lold->b[i], W, /*corMunsell*/true, /*lumaMuns*/false, params->toneCurve.hrenabled, /*gamut*/true, wip);
}
// if (autili || butili || ccutili || cclutili || chutili || lhutili || hhutili || clcutili || utili || chromaticity) {
// Color::LabGamutMunsell(lold->L[i], lold->a[i], lold->b[i], W, /*corMunsell*/true, /*lumaMuns*/false, params->toneCurve.hrenabled, /*gamut*/true, wip);
// }
#ifdef __SSE2__
@ -4704,24 +4731,57 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW
btmp -= lold->b[i][j];
}
if (avoidColorShift) {
lnew->L[i][j] = Lprov1 * 327.68f;
lnew->a[i][j] = 327.68f * Chprov1 * sincosval.y;
lnew->b[i][j] = 327.68f * Chprov1 * sincosval.x;
//gamutmap Lch ==> preserve Hue,but a little slower than gamutbdy for high values...and little faster for low values
if (gamutLch) {
if (gamutmuns == 1) {
float R, G, B;
//gamut control : Lab values are in gamut
Color::gamutLchonly(HH, sincosval, Lprov1, Chprov1, R, G, B, wip, highlight, 0.15f, 0.96f);
lnew->L[i][j] = Lprov1 * 327.68f;
lnew->a[i][j] = 327.68f * Chprov1 * sincosval.y;
lnew->b[i][j] = 327.68f * Chprov1 * sincosval.x;
} else {
//use gamutbdy
//Luv limiter
float Y, u, v;
Color::Lab2Yuv(lnew->L[i][j], atmp, btmp, Y, u, v);
//Yuv2Lab includes gamut restriction map
Color::Yuv2Lab(Y, u, v, lnew->L[i][j], lnew->a[i][j], lnew->b[i][j], wp);
}
if (gamutmuns == 2 || gamutmuns == 3) {
float xg, yg, zg;
Color::Lab2XYZ(lnew->L[i][j], atmp, btmp, xg, yg, zg);
float x0 = xg;
float y0 = yg;
float z0 = zg;
Color::gamutmap(xg, yg, zg, wp);
if (gamutmuns == 3) {//0.5f arbitrary coeff
xg = xg + 0.5f * (x0 - xg);
yg = yg + 0.5f * (y0 - yg);
zg = zg + 0.5f * (z0 - zg);
}
float Lag, aag2, bbg2;
Color::XYZ2Lab(xg, yg, zg, Lag, aag2, bbg2);
Lprov1 = Lag / 327.68f;
HH = xatan2f(bbg2, aag2);
Chprov1 = std::sqrt(SQR(aag2) + SQR(bbg2)) / 327.68f;
if (Chprov1 == 0.0f) {
sincosval.y = 1.f;
sincosval.x = 0.0f;
} else {
sincosval.y = aag2 / (Chprov1 * 327.68f);
sincosval.x = bbg2 / (Chprov1 * 327.68f);
}
lnew->L[i][j] = Lprov1 * 327.68f;
lnew->a[i][j] = 327.68f * Chprov1 * sincosval.y;
lnew->b[i][j] = 327.68f * Chprov1 * sincosval.x;
}
if (gamutmuns > 0) {
if (utili || autili || butili || ccut || clut || cclutili || chutili || lhutili || hhutili || clcutili || chromaticity) {
float correctionHue = 0.f; // Munsell's correction
float correctlum = 0.f;
@ -4747,7 +4807,10 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW
lnew->a[i][j] = 327.68f * Chprov * sincosval.y; // apply Munsell
lnew->b[i][j] = 327.68f * Chprov * sincosval.x;
}
} else {
}
if (gamutmuns == 0) {
// if(Lprov1 > maxlp) maxlp=Lprov1;
// if(Lprov1 < minlp) minlp=Lprov1;
if (!bwToning) {
@ -4940,6 +5003,7 @@ void ImProcFunctions::EPDToneMapCIE(CieImage *ncie, float a_w, float c_, int Wid
if (!params->epd.enabled) {
return;
}
/*
if (params->wavelet.enabled && params->wavelet.tmrs != 0) {
return;
@ -4993,6 +5057,7 @@ void ImProcFunctions::EPDToneMapCIE(CieImage *ncie, float a_w, float c_, int Wid
#ifdef _OPENMP
#pragma omp parallel for schedule(dynamic,10)
#endif
for (int i = 0; i < Hei; i++)
for (int j = 0; j < Wid; j++) {
ncie->Q_p[i][j] = (ncie->Q_p[i][j] * Qpro) / gamm;
@ -5064,6 +5129,7 @@ void ImProcFunctions::EPDToneMaplocal(int sp, LabImage *lab, LabImage *tmp1, uns
#ifdef _OPENMP
#pragma omp parallel for reduction(max:maxL) reduction(min:minL) schedule(dynamic,16)
#endif
for (std::size_t i = 0; i < N; i++) {
minL = rtengine::min(minL, L[i]);
maxL = rtengine::max(maxL, L[i]);
@ -5081,8 +5147,8 @@ void ImProcFunctions::EPDToneMaplocal(int sp, LabImage *lab, LabImage *tmp1, uns
#ifdef _OPENMP
#pragma omp parallel for
#endif
for (std::size_t i = 0; i < N; i++)
{
for (std::size_t i = 0; i < N; i++) {
L[i] = (L[i] - minL) * mult;
}
@ -5111,8 +5177,12 @@ void ImProcFunctions::EPDToneMaplocal(int sp, LabImage *lab, LabImage *tmp1, uns
//Restore past range, also desaturate a bit per Mantiuk's Color correction for tone mapping.
float s = (1.0f + 38.7889f) * powf(Compression, 1.5856f) / (1.0f + 38.7889f * powf(Compression, 1.5856f));
float sat = s + 0.3f * s * satur;
//printf("s=%f sat=%f \n", s, sat);
if(sat == 1.f) sat = 1.001f;
if (sat == 1.f) {
sat = 1.001f;
}
#ifdef _OPENMP
#pragma omp parallel for // removed schedule(dynamic,10)
#endif
@ -5159,6 +5229,7 @@ void ImProcFunctions::EPDToneMap(LabImage *lab, unsigned int Iterates, int skip)
#ifdef _OPENMP
#pragma omp parallel for reduction(min:minL) reduction(max:maxL)
#endif
for (size_t i = 1; i < N; i++) {
minL = std::min(minL, L[i]);
maxL = std::max(maxL, L[i]);
@ -5173,6 +5244,7 @@ void ImProcFunctions::EPDToneMap(LabImage *lab, unsigned int Iterates, int skip)
#ifdef _OPENMP
#pragma omp parallel for
#endif
for (size_t i = 0; i < N; ++i) {
L[i] = (L[i] - minL) * (gamm / maxL);
}
@ -5195,6 +5267,7 @@ void ImProcFunctions::EPDToneMap(LabImage *lab, unsigned int Iterates, int skip)
#ifdef _OPENMP
#pragma omp parallel for
#endif
for (size_t ii = 0; ii < N; ++ii) {
a[ii] *= s;
b[ii] *= s;
@ -5594,7 +5667,8 @@ void ImProcFunctions::rgb2lab(const Imagefloat &src, LabImage &dst, const Glib::
}
void ImProcFunctions::rgb2lab(const Image8 &src, int x, int y, int w, int h, float L[], float a[], float b[], const procparams::ColorManagementParams &icm, bool consider_histogram_settings) const
{ // Adapted from ImProcFunctions::lab2rgb
{
// Adapted from ImProcFunctions::lab2rgb
const int src_width = src.getWidth();
const int src_height = src.getHeight();
@ -5626,6 +5700,7 @@ void ImProcFunctions::rgb2lab(const Image8 &src, int x, int y, int w, int h, flo
if (icm.outputProfile.empty() || icm.outputProfile == ColorManagementParams::NoICMString) {
profile = "sRGB";
}
oprof = ICCStore::getInstance()->getProfile(profile);
}
@ -5691,6 +5766,7 @@ void ImProcFunctions::rgb2lab(const Image8 &src, int x, int y, int w, int h, flo
for (int i = y; i < y2; i++) {
int offset = (i - y) * w;
for (int j = x; j < x2; j++) {
float X, Y, Z;
// lab2rgb uses gamma2curve, which is gammatab_srgb.

View File

@ -257,7 +257,7 @@ enum class BlurType {
int shortcu, bool delt, const float hueref, const float chromaref, const float lumaref,
float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope, bool fftt, float blu_ma, float cont_ma, int indic, float &fab);
void avoidcolshi(const struct local_params& lp, int sp, LabImage * original, LabImage *transformed, int cy, int cx, int sk);
void avoidcolshi(const struct local_params& lp, int sp, LabImage *transformed, LabImage *reserved, int cy, int cx, int sk);
void deltaEforMask(float **rdE, int bfw, int bfh, LabImage* bufcolorig, const float hueref, const float chromaref, const float lumaref,
float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope, float balance, float balanceh);

View File

@ -12540,11 +12540,30 @@ void ImProcFunctions::clarimerge(const struct local_params& lp, float &mL, float
}
}
void ImProcFunctions::avoidcolshi(const struct local_params& lp, int sp, LabImage * original, LabImage *transformed, int cy, int cx, int sk)
void ImProcFunctions::avoidcolshi(const struct local_params& lp, int sp, LabImage *transformed, LabImage *reserved, int cy, int cx, int sk)
{
if (params->locallab.spots.at(sp).avoid && lp.islocal) {
int avoidgamut = 0;
if (params->locallab.spots.at(sp).avoidgamutMethod == "NONE") {
avoidgamut = 0;
} else if (params->locallab.spots.at(sp).avoidgamutMethod == "LAB") {
avoidgamut = 1;
} else if (params->locallab.spots.at(sp).avoidgamutMethod == "XYZ") {
avoidgamut = 2;
} else if (params->locallab.spots.at(sp).avoidgamutMethod == "XYZREL") {
avoidgamut = 3;
} else if (params->locallab.spots.at(sp).avoidgamutMethod == "MUNS") {
avoidgamut = 4;
}
if (avoidgamut == 0) {
return;
}
if (avoidgamut > 0 && lp.islocal) {
const float ach = lp.trans / 100.f;
bool execmunsell = true;
if (params->locallab.spots.at(sp).expcie && (params->locallab.spots.at(sp).modecam == "all" || params->locallab.spots.at(sp).modecam == "jz" || params->locallab.spots.at(sp).modecam == "cam16")) {
execmunsell = false;
}
@ -12556,8 +12575,15 @@ void ImProcFunctions::avoidcolshi(const struct local_params& lp, int sp, LabImag
{wiprof[2][0], wiprof[2][1], wiprof[2][2]}
};
TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix(params->icm.workingProfile);
const double wp[3][3] = {//improve precision with double
{wprof[0][0], wprof[0][1], wprof[0][2]},
{wprof[1][0], wprof[1][1], wprof[1][2]},
{wprof[2][0], wprof[2][1], wprof[2][2]}
};
const float softr = params->locallab.spots.at(sp).avoidrad;//max softr = 30
const bool muns = params->locallab.spots.at(sp).avoidmun;//Munsell control with 200 LUT
// const bool muns = params->locallab.spots.at(sp).avoidmun;//Munsell control with 200 LUT
//improve precision with mint and maxt
const float tr = std::min(2.f, softr);
const float mint = 0.15f - 0.06f * tr;//between 0.15f and 0.03f
@ -12581,6 +12607,7 @@ void ImProcFunctions::avoidcolshi(const struct local_params& lp, int sp, LabImag
#ifdef _OPENMP
#pragma omp for schedule(dynamic,16)
#endif
for (int y = 0; y < transformed->H; y++) {
const int loy = cy + y;
const bool isZone0 = loy > lp.yc + lp.ly || loy < lp.yc - lp.lyT; // whole line is zone 0 => we can skip a lot of processing
@ -12640,7 +12667,7 @@ void ImProcFunctions::avoidcolshi(const struct local_params& lp, int sp, LabImag
if (lp.shapmet == 0) {
calcTransition(lox, loy, ach, lp, zone, localFactor);
} else /*if (lp.shapmet == 1)*/ {
} else { /*if (lp.shapmet == 1)*/
calcTransitionrect(lox, loy, ach, lp, zone, localFactor);
}
@ -12675,42 +12702,103 @@ void ImProcFunctions::avoidcolshi(const struct local_params& lp, int sp, LabImag
sincosval.y = aa / (Chprov1 * 327.68f);
sincosval.x = bb / (Chprov1 * 327.68f);
}
#endif
float lnew = transformed->L[y][x];
float anew = transformed->a[y][x];
float bnew = transformed->b[y][x];
Lprov1 = lnew / 327.68f;
//HH = xatan2f(bnew, anew);
if (avoidgamut == 1) { //Lab correction
Color::pregamutlab(Lprov1, HH, chr);
Chprov1 = rtengine::min(Chprov1, chr);
if(!muns) {
float R, G, B;
Color::gamutLchonly(HH, sincosval, Lprov1, Chprov1, R, G, B, wip, highlight, mint, maxt);//replace for best results
}
transformed->L[y][x] = Lprov1 * 327.68f;
transformed->a[y][x] = 327.68f * Chprov1 * sincosval.y;
transformed->b[y][x] = 327.68f * Chprov1 * sincosval.x;
lnew = Lprov1 * 327.68f;
anew = 327.68f * Chprov1 * sincosval.y;
bnew = 327.68f * Chprov1 * sincosval.x;
//HH = xatan2f(bnew, anew);
transformed->a[y][x] = anew;
transformed->b[y][x] = bnew;
if (needHH) {
const float Lprov2 = original->L[y][x] / 327.68f;
} else if (avoidgamut == 2 || avoidgamut == 3) { //XYZ correction
float xg, yg, zg;
const float aag = transformed->a[y][x];//anew
const float bbg = transformed->b[y][x];//bnew
float Lag = transformed->L[y][x];
Color::Lab2XYZ(Lag, aag, bbg, xg, yg, zg);
float x0 = xg;
float y0 = yg;
float z0 = zg;
Color::gamutmap(xg, yg, zg, wp);
if (avoidgamut == 3) {//0.5f arbitrary coeff
xg = xg + 0.5f * (x0 - xg);
yg = yg + 0.5f * (y0 - yg);
zg = zg + 0.5f * (z0 - zg);
}
//Color::gamutmap(xg, yg, zg, wp);//Put XYZ in gamut wp
float aag2, bbg2;
Color::XYZ2Lab(xg, yg, zg, Lag, aag2, bbg2);
Lprov1 = Lag / 327.68f;
HH = xatan2f(bbg2, aag2);//rebuild HH in case of...absolute colorimetry
Chprov1 = std::sqrt(SQR(aag2) + SQR(bbg2)) / 327.68f;
if (Chprov1 == 0.0f) {
sincosval.y = 1.f;
sincosval.x = 0.0f;
} else {
sincosval.y = aag2 / (Chprov1 * 327.68f);
sincosval.x = bbg2 / (Chprov1 * 327.68f);
}
lnew = Lprov1 * 327.68f;
anew = 327.68f * Chprov1 * sincosval.y;
bnew = 327.68f * Chprov1 * sincosval.x;
transformed->a[y][x] = anew;
transformed->b[y][x] = bnew;
}
if (needHH && avoidgamut <= 4) {//Munsell
Lprov1 = lnew / 327.68f;
float Chprov = sqrt(SQR(anew) + SQR(bnew)) / 327.68f;
const float Lprov2 = reserved->L[y][x] / 327.68f;
float correctionHue = 0.f; // Munsell's correction
float correctlum = 0.f;
const float memChprov = std::sqrt(SQR(original->a[y][x]) + SQR(original->b[y][x])) / 327.68f;
float Chprov = std::sqrt(SQR(transformed->a[y][x]) + SQR(transformed->b[y][x])) / 327.68f;
const float memChprov = std::sqrt(SQR(reserved->a[y][x]) + SQR(reserved->b[y][x])) / 327.68f;
if (execmunsell) {
Color::AllMunsellLch(true, Lprov1, Lprov2, HH, Chprov, memChprov, correctionHue, correctlum);
}
if (correctionHue != 0.f || correctlum != 0.f) {
if (std::fabs(correctionHue) < 0.015f) {
HH += correctlum; // correct only if correct Munsell chroma very small.
}
sincosval = xsincosf(HH + correctionHue);
transformed->a[y][x] = 327.68f * Chprov * sincosval.y; // apply Munsell
transformed->b[y][x] = 327.68f * Chprov * sincosval.x;
}
anew = 327.68f * Chprov * sincosval.y; // apply Munsell
bnew = 327.68f * Chprov * sincosval.x;
transformed->a[y][x] = anew; // apply Munsell
transformed->b[y][x] = bnew;
}
}
}
}
//Guidedfilter to reduce artifacts in transitions
if (softr != 0.f) {//soft for L a b because we change color...
//Guidedfilter to reduce artifacts in transitions : case Lab
if (softr != 0.f && avoidgamut == 1) {//soft for L a b because we change color...
const float tmpblur = softr < 0.f ? -1.f / softr : 1.f + softr;
const int r1 = rtengine::max<int>(6 / sk * tmpblur + 0.5f, 1);
const int r2 = rtengine::max<int>(10 / sk * tmpblur + 0.5f, 1);
@ -12734,13 +12822,15 @@ void ImProcFunctions::avoidcolshi(const struct local_params& lp, int sp, LabImag
for (int y = 0; y < bh ; y++) {
for (int x = 0; x < bw; x++) {
ble[y][x] = transformed->L[y][x] / 32768.f;
guid[y][x] = original->L[y][x] / 32768.f;
guid[y][x] = reserved->L[y][x] / 32768.f;
}
}
rtengine::guidedFilter(guid, ble, ble, r2, 0.2f * epsil, multiThread);
#ifdef _OPENMP
#pragma omp parallel for schedule(dynamic,16) if (multiThread)
#endif
for (int y = 0; y < bh; y++) {
for (int x = 0; x < bw; x++) {
transformed->L[y][x] = 32768.f * ble[y][x];
@ -12757,11 +12847,13 @@ void ImProcFunctions::avoidcolshi(const struct local_params& lp, int sp, LabImag
blechro[y][x] = std::sqrt(SQR(transformed->b[y][x]) + SQR(transformed->a[y][x])) / 32768.f;
}
}
rtengine::guidedFilter(guid, blechro, blechro, r1, epsil, multiThread);
#ifdef _OPENMP
#pragma omp parallel for schedule(dynamic,16) if (multiThread)
#endif
for (int y = 0; y < bh; y++) {
for (int x = 0; x < bw; x++) {
const float Chprov1 = std::sqrt(SQR(transformed->a[y][x]) + SQR(transformed->b[y][x]));
@ -13286,7 +13378,7 @@ void ImProcFunctions::Lab_Local(
struct local_params lp;
calcLocalParams(sp, oW, oH, params->locallab, lp, prevDeltaE, llColorMask, llColorMaskinv, llExpMask, llExpMaskinv, llSHMask, llSHMaskinv, llvibMask, lllcMask, llsharMask, llcbMask, llretiMask, llsoftMask, lltmMask, llblMask, lllogMask, ll_Mask, llcieMask, locwavCurveden, locwavdenutili);
avoidcolshi(lp, sp, original, transformed, cy, cx, sk);
//avoidcolshi(lp, sp, transformed, reserved, cy, cx, sk);
const float radius = lp.rad / (sk * 1.4); //0 to 70 ==> see skip
int levred;
@ -19188,7 +19280,7 @@ void ImProcFunctions::Lab_Local(
// Gamut and Munsell control - very important do not deactivated to avoid crash
avoidcolshi(lp, sp, original, transformed, cy, cx, sk);
avoidcolshi(lp, sp, transformed, reserved, cy, cx, sk);
}
}

View File

@ -137,7 +137,7 @@ enum ProcEventCode {
EvHLComprThreshold = 107,
EvResizeBoundingBox = 108,
EvResizeAppliesTo = 109,
EvLAvoidColorShift = 110,
//EvLAvoidColorShift = 110,
obsolete_111 = 111, // obsolete
EvLRSTProtection = 112,
EvDemosaicDCBIter = 113,
@ -617,7 +617,7 @@ enum ProcEventCode {
Evlocallabadjblur = 587,
Evlocallabbilateral = 588,
Evlocallabsensiden = 589,
Evlocallabavoid = 590,
// Evlocallabavoid = 590,
Evlocallabsharcontrast = 591,
EvLocenacontrast = 592,
Evlocallablcradius = 593,
@ -1067,7 +1067,7 @@ enum ProcEventCode {
Evlocallabnlgam = 1037,
Evlocallabdivgr = 1038,
EvLocallabSpotavoidrad = 1039,
EvLocallabSpotavoidmun = 1040,
//EvLocallabSpotavoidmun = 1040,
Evlocallabcontthres = 1041,
Evlocallabnorm = 1042,
Evlocallabreparw = 1043,

View File

@ -608,7 +608,7 @@ LCurveParams::LCurveParams() :
brightness(0),
contrast(0),
chromaticity(0),
avoidcolorshift(false),
gamutmunselmethod("MUN"),
rstprotection(0),
lcredsk(true)
{
@ -630,7 +630,7 @@ bool LCurveParams::operator ==(const LCurveParams& other) const
&& brightness == other.brightness
&& contrast == other.contrast
&& chromaticity == other.chromaticity
&& avoidcolorshift == other.avoidcolorshift
&& gamutmunselmethod == other.gamutmunselmethod
&& rstprotection == other.rstprotection
&& lcredsk == other.lcredsk;
}
@ -2848,6 +2848,7 @@ LocallabParams::LocallabSpot::LocallabSpot() :
structexclu(0),
struc(4.0),
shapeMethod("IND"),
avoidgamutMethod("MUNS"),
loc{150, 150, 150, 150},
centerX(0),
centerY(0),
@ -2862,13 +2863,11 @@ LocallabParams::LocallabSpot::LocallabSpot() :
balanh(1.0),
colorde(5.0),
colorscope(30.0),
avoidrad(0.7),
avoidrad(0.),
transitweak(1.0),
transitgrad(0.0),
hishow(false),
activ(true),
avoid(false),
avoidmun(false),
blwh(false),
recurs(false),
laplac(true),
@ -4560,6 +4559,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const
&& structexclu == other.structexclu
&& struc == other.struc
&& shapeMethod == other.shapeMethod
&& avoidgamutMethod == other.avoidgamutMethod
&& loc == other.loc
&& centerX == other.centerX
&& centerY == other.centerY
@ -4579,8 +4579,6 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const
&& transitgrad == other.transitgrad
&& hishow == other.hishow
&& activ == other.activ
&& avoid == other.avoid
&& avoidmun == other.avoidmun
&& blwh == other.blwh
&& recurs == other.recurs
&& laplac == other.laplac
@ -6045,7 +6043,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
saveToKeyfile(!pedited || pedited->labCurve.brightness, "Luminance Curve", "Brightness", labCurve.brightness, keyFile);
saveToKeyfile(!pedited || pedited->labCurve.contrast, "Luminance Curve", "Contrast", labCurve.contrast, keyFile);
saveToKeyfile(!pedited || pedited->labCurve.chromaticity, "Luminance Curve", "Chromaticity", labCurve.chromaticity, keyFile);
saveToKeyfile(!pedited || pedited->labCurve.avoidcolorshift, "Luminance Curve", "AvoidColorShift", labCurve.avoidcolorshift, keyFile);
saveToKeyfile(!pedited || pedited->labCurve.gamutmunselmethod, "Luminance Curve", "Gamutmunse", labCurve.gamutmunselmethod, keyFile);
saveToKeyfile(!pedited || pedited->labCurve.rstprotection, "Luminance Curve", "RedAndSkinTonesProtection", labCurve.rstprotection, keyFile);
saveToKeyfile(!pedited || pedited->labCurve.lcredsk, "Luminance Curve", "LCredsk", labCurve.lcredsk, keyFile);
saveToKeyfile(!pedited || pedited->labCurve.lcurve, "Luminance Curve", "LCurve", labCurve.lcurve, keyFile);
@ -6347,6 +6345,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
saveToKeyfile(!pedited || spot_edited->structexclu, "Locallab", "StructExclu_" + index_str, spot.structexclu, keyFile);
saveToKeyfile(!pedited || spot_edited->struc, "Locallab", "Struc_" + index_str, spot.struc, keyFile);
saveToKeyfile(!pedited || spot_edited->shapeMethod, "Locallab", "ShapeMethod_" + index_str, spot.shapeMethod, keyFile);
saveToKeyfile(!pedited || spot_edited->avoidgamutMethod, "Locallab", "AvoidgamutMethod_" + index_str, spot.avoidgamutMethod, keyFile);
saveToKeyfile(!pedited || spot_edited->loc, "Locallab", "Loc_" + index_str, spot.loc, keyFile);
saveToKeyfile(!pedited || spot_edited->centerX, "Locallab", "CenterX_" + index_str, spot.centerX, keyFile);
saveToKeyfile(!pedited || spot_edited->centerY, "Locallab", "CenterY_" + index_str, spot.centerY, keyFile);
@ -6366,8 +6365,6 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
saveToKeyfile(!pedited || spot_edited->transitgrad, "Locallab", "Transitgrad_" + index_str, spot.transitgrad, keyFile);
saveToKeyfile(!pedited || spot_edited->hishow, "Locallab", "Hishow_" + index_str, spot.hishow, keyFile);
saveToKeyfile(!pedited || spot_edited->activ, "Locallab", "Activ_" + index_str, spot.activ, keyFile);
saveToKeyfile(!pedited || spot_edited->avoid, "Locallab", "Avoid_" + index_str, spot.avoid, keyFile);
saveToKeyfile(!pedited || spot_edited->avoidmun, "Locallab", "Avoidmun_" + index_str, spot.avoidmun, keyFile);
saveToKeyfile(!pedited || spot_edited->blwh, "Locallab", "Blwh_" + index_str, spot.blwh, keyFile);
saveToKeyfile(!pedited || spot_edited->recurs, "Locallab", "Recurs_" + index_str, spot.recurs, keyFile);
saveToKeyfile(!pedited || spot_edited->laplac, "Locallab", "Laplac_" + index_str, spot.laplac, keyFile);
@ -7871,7 +7868,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
// if Saturation == 0, should we set BWToning on?
assignFromKeyfile(keyFile, "Luminance Curve", "Saturation", pedited, labCurve.chromaticity, pedited->labCurve.chromaticity);
// transform AvoidColorClipping into AvoidColorShift
assignFromKeyfile(keyFile, "Luminance Curve", "AvoidColorClipping", pedited, labCurve.avoidcolorshift, pedited->labCurve.avoidcolorshift);
// assignFromKeyfile(keyFile, "Luminance Curve", "AvoidColorClipping", pedited, labCurve.avoidcolorshift, pedited->labCurve.avoidcolorshift);
} else {
if (keyFile.has_key("Luminance Curve", "Chromaticity")) {
labCurve.chromaticity = keyFile.get_integer("Luminance Curve", "Chromaticity");
@ -7885,7 +7882,6 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
}
}
assignFromKeyfile(keyFile, "Luminance Curve", "AvoidColorShift", pedited, labCurve.avoidcolorshift, pedited->labCurve.avoidcolorshift);
assignFromKeyfile(keyFile, "Luminance Curve", "RedAndSkinTonesProtection", pedited, labCurve.rstprotection, pedited->labCurve.rstprotection);
}
@ -7914,6 +7910,25 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "Luminance Curve", "hhCurve", pedited, labCurve.hhcurve, pedited->labCurve.hhcurve);
assignFromKeyfile(keyFile, "Luminance Curve", "LcCurve", pedited, labCurve.lccurve, pedited->labCurve.lccurve);
assignFromKeyfile(keyFile, "Luminance Curve", "ClCurve", pedited, labCurve.clcurve, pedited->labCurve.clcurve);
if (keyFile.has_key("Luminance Curve", "Gamutmunse")) {
assignFromKeyfile(keyFile, "Luminance Curve", "Gamutmunse", pedited, labCurve.gamutmunselmethod, pedited->labCurve.gamutmunselmethod);
} else {
if (ppVersion < 303) {
if (keyFile.has_key("Luminance Curve", "AvoidColorClipping")) {
labCurve.gamutmunselmethod =
keyFile.get_boolean("Luminance Curve", "AvoidColorClipping") ? "LAB" : "NONE";
if (pedited) {
pedited->labCurve.gamutmunselmethod = true;
}
}
} else if (keyFile.has_key("Luminance Curve", "AvoidColorShift")) {
labCurve.gamutmunselmethod =
keyFile.get_boolean("Luminance Curve", "AvoidColorShift") ? "LAB" : "NONE";
if (pedited) {
pedited->labCurve.gamutmunselmethod = true;
}
}
}
}
if (keyFile.has_group("Sharpening")) {
@ -8423,6 +8438,16 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "Locallab", "StructExclu_" + index_str, pedited, spot.structexclu, spotEdited.structexclu);
assignFromKeyfile(keyFile, "Locallab", "Struc_" + index_str, pedited, spot.struc, spotEdited.struc);
assignFromKeyfile(keyFile, "Locallab", "ShapeMethod_" + index_str, pedited, spot.shapeMethod, spotEdited.shapeMethod);
if (keyFile.has_key("Locallab", "AvoidgamutMethod_" + index_str)) {
assignFromKeyfile(keyFile, "Locallab", "AvoidgamutMethod_" + index_str, pedited, spot.avoidgamutMethod, spotEdited.avoidgamutMethod);
} else if (keyFile.has_key("Locallab", "Avoid_" + index_str)) {
const bool avoid = keyFile.get_boolean("Locallab", "Avoid_" + index_str);
const bool munsell = keyFile.has_key("Locallab", "Avoidmun_" + index_str) && keyFile.get_boolean("Locallab", "Avoidmun_" + index_str);
spot.avoidgamutMethod = avoid ? (munsell ? "MUNS" : "LAB") : "NONE";
if (pedited) {
spotEdited.avoidgamutMethod = true;
}
}
assignFromKeyfile(keyFile, "Locallab", "Loc_" + index_str, pedited, spot.loc, spotEdited.loc);
assignFromKeyfile(keyFile, "Locallab", "CenterX_" + index_str, pedited, spot.centerX, spotEdited.centerX);
assignFromKeyfile(keyFile, "Locallab", "CenterY_" + index_str, pedited, spot.centerY, spotEdited.centerY);
@ -8442,8 +8467,6 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "Locallab", "Transitgrad_" + index_str, pedited, spot.transitgrad, spotEdited.transitgrad);
assignFromKeyfile(keyFile, "Locallab", "Hishow_" + index_str, pedited, spot.hishow, spotEdited.hishow);
assignFromKeyfile(keyFile, "Locallab", "Activ_" + index_str, pedited, spot.activ, spotEdited.activ);
assignFromKeyfile(keyFile, "Locallab", "Avoid_" + index_str, pedited, spot.avoid, spotEdited.avoid);
assignFromKeyfile(keyFile, "Locallab", "Avoidmun_" + index_str, pedited, spot.avoidmun, spotEdited.avoidmun);
assignFromKeyfile(keyFile, "Locallab", "Blwh_" + index_str, pedited, spot.blwh, spotEdited.blwh);
assignFromKeyfile(keyFile, "Locallab", "Recurs_" + index_str, pedited, spot.recurs, spotEdited.recurs);
assignFromKeyfile(keyFile, "Locallab", "Laplac_" + index_str, pedited, spot.laplac, spotEdited.laplac);

View File

@ -376,7 +376,7 @@ struct LCurveParams {
int brightness;
int contrast;
int chromaticity;
bool avoidcolorshift;
Glib::ustring gamutmunselmethod;
double rstprotection;
bool lcredsk;
@ -1019,6 +1019,8 @@ struct LocallabParams {
int structexclu;
double struc;
Glib::ustring shapeMethod; // IND, SYM, INDSL, SYMSL
Glib::ustring avoidgamutMethod; // NONE, LAB, XYZ
std::vector<int> loc; // For ellipse/rectangle: {locX, locXL, locY, locYT}
int centerX;
int centerY;
@ -1038,8 +1040,6 @@ struct LocallabParams {
double transitgrad;
bool hishow;
bool activ;
bool avoid;
bool avoidmun;
bool blwh;
bool recurs;
bool laplac;

View File

@ -1186,7 +1186,6 @@ int refreshmap[rtengine::NUMOFEVENTS] = {
AUTOEXP, //Evlocallabsigjz
AUTOEXP, //Evlocallabsigq
AUTOEXP //Evlocallablogcie
};

View File

@ -49,6 +49,7 @@ BlackWhite::BlackWhite (): FoldableToolPanel(this, "blackwhite", M("TP_BWMIX_LAB
metHBox->set_spacing (2);
Gtk::Label* metLabel = Gtk::manage (new Gtk::Label (M("TP_BWMIX_MET") + ":"));
metHBox->pack_start (*metLabel, Gtk::PACK_SHRINK);
method = Gtk::manage (new MyComboBoxText ());
method->append (M("TP_BWMIX_MET_DESAT"));
method->append (M("TP_BWMIX_MET_LUMEQUAL"));

View File

@ -24,6 +24,7 @@
#include "options.h"
#include "../rtengine/procparams.h"
#include "rtimage.h"
#include "eventmapper.h"
using namespace rtengine;
using namespace procparams;
@ -55,6 +56,7 @@ ControlSpotPanel::ControlSpotPanel():
qualityMethod_(Gtk::manage(new MyComboBoxText())),
//complexMethod_(Gtk::manage(new MyComboBoxText())),
wavMethod_(Gtk::manage(new MyComboBoxText())),
avoidgamutMethod_(Gtk::manage(new MyComboBoxText())),
sensiexclu_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIEXCLU"), 0, 100, 1, 12))),
structexclu_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUCCOL"), 0, 100, 1, 0))),
@ -76,15 +78,13 @@ ControlSpotPanel::ControlSpotPanel():
balanh_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BALANH"), 0.2, 2.5, 0.1, 1.0, Gtk::manage(new RTImage("rawtherapee-logo-16.png")), Gtk::manage(new RTImage("circle-red-green-small.png"))))),
colorde_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_COLORDE"), -15, 15, 2, 5, Gtk::manage(new RTImage("circle-blue-yellow-small.png")), Gtk::manage(new RTImage("circle-gray-green-small.png"))))),
colorscope_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_COLORSCOPE"), 0., 100.0, 1., 30.))),
avoidrad_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_AVOIDRAD"), 0., 30.0, 0.1, 0.7))),
avoidrad_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_AVOIDRAD"), 0., 30.0, 0.1, 0.))),
scopemask_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SCOPEMASK"), 0, 100, 1, 60))),
denoichmask_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DENOIMASK"), 0., 100., 0.5, 0))),
lumask_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LUMASK"), -50, 30, 1, 10, Gtk::manage(new RTImage("circle-yellow-small.png")), Gtk::manage(new RTImage("circle-gray-small.png")) ))),
hishow_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_PREVSHOW")))),
activ_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ACTIVSPOT")))),
avoid_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_AVOID")))),
avoidmun_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_AVOIDMUN")))),
blwh_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_BLWH")))),
recurs_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_RECURS")))),
laplac_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_LAPLACC")))),
@ -100,6 +100,7 @@ ControlSpotPanel::ControlSpotPanel():
preview_(Gtk::manage(new Gtk::ToggleButton(M("TP_LOCALLAB_PREVIEW")))),
ctboxshape(Gtk::manage(new Gtk::Box())),
ctboxshapemethod(Gtk::manage(new Gtk::Box())),
ctboxgamut(Gtk::manage(new Gtk::Box())),
controlPanelListener(nullptr),
lastObject_(-1),
@ -111,6 +112,8 @@ ControlSpotPanel::ControlSpotPanel():
excluFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_EXCLUF")))),
maskPrevActive(false)
{
auto m = ProcEventMapper::getInstance();
EvLocallabavoidgamutMethod = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_GAMUTMUNSEL");
const bool showtooltip = options.showtooltip;
pack_start(*hishow_);
@ -397,23 +400,30 @@ ControlSpotPanel::ControlSpotPanel():
activConn_ = activ_->signal_toggled().connect(
sigc::mem_fun(*this, &ControlSpotPanel::activChanged));
avoidConn_ = avoid_->signal_toggled().connect(
sigc::mem_fun(*this, &ControlSpotPanel::avoidChanged));
avoidmunConn_ = avoidmun_->signal_toggled().connect(
sigc::mem_fun(*this, &ControlSpotPanel::avoidmunChanged));
Gtk::Label* const labelgamut = Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_AVOID") + ":"));
ctboxgamut->pack_start(*labelgamut, Gtk::PACK_SHRINK, 4);
avoidgamutMethod_->append(M("TP_LOCALLAB_GAMUTNON"));
avoidgamutMethod_->append(M("TP_LOCALLAB_GAMUTLABRELA"));
avoidgamutMethod_->append(M("TP_LOCALLAB_GAMUTXYZABSO"));
avoidgamutMethod_->append(M("TP_LOCALLAB_GAMUTXYZRELA"));
avoidgamutMethod_->append(M("TP_LOCALLAB_GAMUTMUNSELL"));
avoidgamutMethod_->set_active(4);
avoidgamutconn_ = avoidgamutMethod_->signal_changed().connect(
sigc::mem_fun(
*this, &ControlSpotPanel::avoidgamutMethodChanged));
ctboxgamut->pack_start(*avoidgamutMethod_);
if (showtooltip) {
ctboxgamut->set_tooltip_text(M("TP_LOCALLAB_AVOIDCOLORSHIFT_TOOLTIP"));
}
Gtk::Frame* const avFrame = Gtk::manage(new Gtk::Frame());
ToolParamBlock* const avbox = Gtk::manage(new ToolParamBlock());
avFrame->set_label_align(0.025, 0.5);
avFrame->set_label_widget(*avoid_);
avbox->pack_start(*ctboxgamut);
avbox->pack_start(*avoidrad_);
avbox->pack_start(*avoidmun_);
avFrame->add(*avbox);
specCaseBox->pack_start(*avFrame);
if (showtooltip) {
avoidmun_->set_tooltip_text(M("TP_LOCALLAB_AVOIDMUN_TOOLTIP"));
}
blwhConn_ = blwh_->signal_toggled().connect(
sigc::mem_fun(*this, &ControlSpotPanel::blwhChanged));
@ -429,7 +439,6 @@ ControlSpotPanel::ControlSpotPanel():
if (showtooltip) {
recurs_->set_tooltip_text(M("TP_LOCALLAB_RECURS_TOOLTIP"));
avoid_->set_tooltip_text(M("TP_LOCALLAB_AVOIDCOLORSHIFT_TOOLTIP"));
}
specCaseBox->pack_start(*recurs_);
@ -854,8 +863,6 @@ void ControlSpotPanel::load_ControlSpot_param()
avoidrad_->setValue((double)row[spots_.avoidrad]);
hishow_->set_active(row[spots_.hishow]);
activ_->set_active(row[spots_.activ]);
avoid_->set_active(row[spots_.avoid]);
avoidmun_->set_active(row[spots_.avoidmun]);
blwh_->set_active(row[spots_.blwh]);
recurs_->set_active(row[spots_.recurs]);
// laplac_->set_active(row[spots_.laplac]);
@ -868,6 +875,8 @@ void ControlSpotPanel::load_ControlSpot_param()
//savrest_->set_active(row[spots_.savrest]);
//complexMethod_->set_active(row[spots_.complexMethod]);
wavMethod_->set_active(row[spots_.wavMethod]);
avoidgamutMethod_->set_active(row[spots_.avoidgamutMethod]);
}
void ControlSpotPanel::controlspotChanged()
@ -1055,6 +1064,34 @@ void ControlSpotPanel::spotMethodChanged()
}
}
void ControlSpotPanel::avoidgamutMethodChanged()
{
// Get selected control spot
const auto s = treeview_->get_selection();
if (!s->count_selected_rows()) {
return;
}
const int meth = avoidgamutMethod_->get_active_row_number();
avoidrad_->show();
if(meth == 2 || meth == 3 || meth == 4) {
avoidrad_->hide();
}
const auto iter = s->get_selected();
Gtk::TreeModel::Row row = *iter;
row[spots_.avoidgamutMethod] = avoidgamutMethod_->get_active_row_number();
// Raise event
if (listener) {
listener->panelChanged(EvLocallabavoidgamutMethod, avoidgamutMethod_->get_active_text());
}
}
void ControlSpotPanel::shapeMethodChanged()
{
// printf("shapeMethodChanged\n");
@ -1217,6 +1254,7 @@ void ControlSpotPanel::updateParamVisibility()
// Update Control Spot GUI according to shapeMethod_ combobox state (to be compliant with shapeMethodChanged function)
const int method = shapeMethod_->get_active_row_number();
const int meth = avoidgamutMethod_->get_active_row_number();
if (!batchMode) {
if (method == 1 || method == 3) { // Symmetrical cases
@ -1260,6 +1298,12 @@ void ControlSpotPanel::updateParamVisibility()
centerY_->show();
}
if(meth == 1) {
avoidrad_->show();
} else {
avoidrad_->hide();
}
// Update Control Spot GUI according to spotMethod_ combobox state (to be compliant with spotMethodChanged function)
if (multiImage && spotMethod_->get_active_text() == M("GENERAL_UNCHANGED")) {
excluFrame->show();
@ -1588,57 +1632,6 @@ void ControlSpotPanel::hishowChanged()
}
void ControlSpotPanel::avoidChanged()
{
// printf("avoidChanged\n");
// Get selected control spot
const auto s = treeview_->get_selection();
if (!s->count_selected_rows()) {
return;
}
const auto iter = s->get_selected();
Gtk::TreeModel::Row row = *iter;
row[spots_.avoid] = avoid_->get_active();
// Raise event
if (listener) {
if (avoid_->get_active()) {
listener->panelChanged(Evlocallabavoid, M("GENERAL_ENABLED"));
} else {
listener->panelChanged(Evlocallabavoid, M("GENERAL_DISABLED"));
}
}
}
void ControlSpotPanel::avoidmunChanged()
{
// printf("avoidmunChanged\n");
// Get selected control spot
const auto s = treeview_->get_selection();
if (!s->count_selected_rows()) {
return;
}
const auto iter = s->get_selected();
Gtk::TreeModel::Row row = *iter;
row[spots_.avoidmun] = avoidmun_->get_active();
// Raise event
if (listener) {
if (avoidmun_->get_active()) {
listener->panelChanged(EvLocallabSpotavoidmun, M("GENERAL_ENABLED"));
} else {
listener->panelChanged(EvLocallabSpotavoidmun, M("GENERAL_DISABLED"));
}
}
}
void ControlSpotPanel::activChanged()
{
// printf("activChanged\n");
@ -1859,8 +1852,6 @@ void ControlSpotPanel::disableParamlistener(bool cond)
avoidrad_->block(cond);
hishowconn_.block(cond);
activConn_.block(cond);
avoidConn_.block(cond);
avoidmunConn_.block(cond);
blwhConn_.block(cond);
recursConn_.block(cond);
laplacConn_.block(cond);
@ -1872,6 +1863,8 @@ void ControlSpotPanel::disableParamlistener(bool cond)
//savrestConn_.block(cond);
//complexMethodconn_.block(cond);
wavMethodconn_.block(cond);
avoidgamutconn_.block(cond);
}
void ControlSpotPanel::setParamEditable(bool cond)
@ -1906,8 +1899,6 @@ void ControlSpotPanel::setParamEditable(bool cond)
avoidrad_->set_sensitive(cond);
hishow_->set_sensitive(cond);
activ_->set_sensitive(cond);
avoid_->set_sensitive(cond);
avoidmun_->set_sensitive(cond);
blwh_->set_sensitive(cond);
recurs_->set_sensitive(cond);
laplac_->set_sensitive(cond);
@ -1920,6 +1911,7 @@ void ControlSpotPanel::setParamEditable(bool cond)
//complexMethod_->set_sensitive(cond);
wavMethod_->set_sensitive(cond);
preview_->set_sensitive(cond);
avoidgamutMethod_->set_sensitive(cond);
if (!cond) {
// Reset complex parameters visibility to default state
@ -2592,8 +2584,6 @@ ControlSpotPanel::SpotRow* ControlSpotPanel::getSpot(const int index)
r->lumask = row[spots_.lumask];
r->hishow = row[spots_.hishow];
r->activ = row[spots_.activ];
r->avoid = row[spots_.avoid];
r->avoidmun = row[spots_.avoidmun];
r->blwh = row[spots_.blwh];
r->recurs = row[spots_.recurs];
r->laplac = row[spots_.laplac];
@ -2601,6 +2591,7 @@ ControlSpotPanel::SpotRow* ControlSpotPanel::getSpot(const int index)
r->shortc = row[spots_.shortc];
//r->savrest = row[spots_.savrest];
r->wavMethod = row[spots_.wavMethod];
r->avoidgamutMethod = row[spots_.avoidgamutMethod];
return r;
}
@ -2725,8 +2716,6 @@ void ControlSpotPanel::addControlSpot(SpotRow* newSpot)
row[spots_.avoidrad] = newSpot->avoidrad;
row[spots_.hishow] = newSpot->hishow;
row[spots_.activ] = newSpot->activ;
row[spots_.avoid] = newSpot->avoid;
row[spots_.avoidmun] = newSpot->avoidmun;
row[spots_.blwh] = newSpot->blwh;
row[spots_.recurs] = newSpot->recurs;
row[spots_.laplac] = newSpot->laplac;
@ -2738,6 +2727,7 @@ void ControlSpotPanel::addControlSpot(SpotRow* newSpot)
//row[spots_.savrest] = newSpot->savrest;
row[spots_.complexMethod] = newSpot->complexMethod;
row[spots_.wavMethod] = newSpot->wavMethod;
row[spots_.avoidgamutMethod] = newSpot->avoidgamutMethod;
updateParamVisibility();
disableParamlistener(false);
@ -2845,8 +2835,6 @@ ControlSpotPanel::ControlSpots::ControlSpots()
add(avoidrad);
add(hishow);
add(activ);
add(avoid);
add(avoidmun);
add(blwh);
add(recurs);
add(laplac);
@ -2858,6 +2846,7 @@ ControlSpotPanel::ControlSpots::ControlSpots()
//add(savrest);
add(complexMethod);
add(wavMethod);
add(avoidgamutMethod);
}
//-----------------------------------------------------------------------------

View File

@ -57,6 +57,7 @@ public:
int sensiexclu;
int structexclu;
int shapeMethod; // 0 = Independent (mouse), 1 = Symmetrical (mouse), 2 = Independent (mouse + sliders), 3 = Symmetrical (mouse + sliders)
int avoidgamutMethod;
int locX;
int locXL;
int locY;
@ -79,8 +80,6 @@ public:
double avoidrad;
bool hishow;
bool activ;
bool avoid;
bool avoidmun;
bool blwh;
bool recurs;
bool laplac;
@ -243,6 +242,7 @@ private:
void spotMethodChanged();
void shapeMethodChanged();
void qualityMethodChanged();
void avoidgamutMethodChanged();
//void complexMethodChanged();
void wavMethodChanged();
@ -252,8 +252,6 @@ private:
void hishowChanged();
void activChanged();
void avoidChanged();
void avoidmunChanged();
void blwhChanged();
void recursChanged();
void laplacChanged();
@ -293,6 +291,7 @@ private:
Gtk::TreeModelColumn<int> sensiexclu;
Gtk::TreeModelColumn<int> structexclu;
Gtk::TreeModelColumn<int> shapeMethod; // 0 = Independent (mouse), 1 = Symmetrical (mouse), 2 = Independent (mouse + sliders), 3 = Symmetrical (mouse + sliders)
Gtk::TreeModelColumn<int> avoidgamutMethod;
Gtk::TreeModelColumn<int> locX;
Gtk::TreeModelColumn<int> locXL;
Gtk::TreeModelColumn<int> locY;
@ -315,8 +314,6 @@ private:
Gtk::TreeModelColumn<double> avoidrad;
Gtk::TreeModelColumn<bool> hishow;
Gtk::TreeModelColumn<bool> activ;
Gtk::TreeModelColumn<bool> avoid;
Gtk::TreeModelColumn<bool> avoidmun;
Gtk::TreeModelColumn<bool> blwh;
Gtk::TreeModelColumn<bool> recurs;
Gtk::TreeModelColumn<bool> laplac;
@ -347,6 +344,7 @@ private:
};
ControlSpots spots_;
rtengine::ProcEvent EvLocallabavoidgamutMethod;
// Child widgets
Gtk::ScrolledWindow* const scrolledwindow_;
@ -381,6 +379,8 @@ private:
//sigc::connection complexMethodconn_;
MyComboBoxText* const wavMethod_;
sigc::connection wavMethodconn_;
MyComboBoxText* const avoidgamutMethod_;
sigc::connection avoidgamutconn_;
Adjuster* const sensiexclu_;
Adjuster* const structexclu_;
@ -411,10 +411,6 @@ private:
sigc::connection hishowconn_;
Gtk::CheckButton* const activ_;
sigc::connection activConn_;
Gtk::CheckButton* const avoid_;
sigc::connection avoidConn_;
Gtk::CheckButton* const avoidmun_;
sigc::connection avoidmunConn_;
Gtk::CheckButton* const blwh_;
sigc::connection blwhConn_;
Gtk::CheckButton* const recurs_;
@ -438,6 +434,7 @@ private:
Gtk::Box* const ctboxshape;
Gtk::Box* const ctboxshapemethod;
Gtk::Box* const ctboxgamut;
// Internal variables
ControlPanelListener* controlPanelListener;

View File

@ -19,6 +19,7 @@
#include <iomanip>
#include "labcurve.h"
#include "eventmapper.h"
#include "curveeditor.h"
#include "curveeditorgroup.h"
@ -34,6 +35,9 @@ using namespace rtengine::procparams;
LCurve::LCurve() : FoldableToolPanel(this, "labcurves", M("TP_LABCURVE_LABEL"), false, true)
{
auto m = ProcEventMapper::getInstance();
Evgamutmunsell = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_GAMUTMUNSEL");
CurveListener::setMulti(true);
brightness = Gtk::manage(new Adjuster(M("TP_LABCURVE_BRIGHTNESS"), -100., 100., 1., 0.));
contrast = Gtk::manage(new Adjuster(M("TP_LABCURVE_CONTRAST"), -100., 100., 1., 0.));
chromaticity = Gtk::manage(new Adjuster(M("TP_LABCURVE_CHROMATICITY"), -100., 100., 1., 0.));
@ -61,9 +65,26 @@ LCurve::LCurve () : FoldableToolPanel(this, "labcurves", M("TP_LABCURVE_LABEL"),
hsep2->show();
pack_start(*hsep2, Gtk::PACK_EXPAND_WIDGET, 4);
avoidcolorshift = Gtk::manage (new Gtk::CheckButton (M("TP_LABCURVE_AVOIDCOLORSHIFT")));
avoidcolorshift->set_tooltip_text (M("TP_LABCURVE_AVOIDCOLORSHIFT_TOOLTIP"));
pack_start (*avoidcolorshift, Gtk::PACK_SHRINK, 4);
Gtk::Box* metHBox = Gtk::manage(new Gtk::Box());
metHBox->set_spacing(2);
Gtk::Label* metLabel = Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_AVOID") + ":"));
metHBox->pack_start(*metLabel, Gtk::PACK_SHRINK);
gamutmunselmethod = Gtk::manage(new MyComboBoxText());
gamutmunselmethod->append(M("TP_LOCALLAB_GAMUTNON"));
gamutmunselmethod->append(M("TP_LOCALLAB_GAMUTLABRELA"));
gamutmunselmethod->append(M("TP_LOCALLAB_GAMUTXYZABSO"));
gamutmunselmethod->append(M("TP_LOCALLAB_GAMUTXYZRELA"));
gamutmunselmethod->append(M("TP_LOCALLAB_GAMUTMUNSELL"));
gamutmunselmethod->set_active(4);
gamutmunselmethod->set_tooltip_text(M("TP_LOCALLAB_AVOIDCOLORSHIFT_TOOLTIP"));
metHBox->pack_start(*gamutmunselmethod);
pack_start(*metHBox);
gamutmunselmethodconn = gamutmunselmethod->signal_changed().connect(sigc::mem_fun(*this, &LCurve::gamutmunselChanged));
lcredsk = Gtk::manage(new Gtk::CheckButton(M("TP_LABCURVE_LCREDSK")));
lcredsk->set_tooltip_markup(M("TP_LABCURVE_LCREDSK_TOOLTIP"));
@ -76,7 +97,6 @@ LCurve::LCurve () : FoldableToolPanel(this, "labcurves", M("TP_LABCURVE_LABEL"),
rstprotection->setAdjusterListener(this);
rstprotection->set_tooltip_text(M("TP_LABCURVE_RSTPRO_TOOLTIP"));
acconn = avoidcolorshift->signal_toggled().connect( sigc::mem_fun(*this, &LCurve::avoidcolorshift_toggled) );
lcconn = lcredsk->signal_toggled().connect(sigc::mem_fun(*this, &LCurve::lcredsk_toggled));
//%%%%%%%%%%%%%%%%%%%
@ -220,6 +240,7 @@ LCurve::LCurve () : FoldableToolPanel(this, "labcurves", M("TP_LABCURVE_LABEL"),
Gtk::Separator* hsepdh = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL));
hsepdh->show();
pack_start(*hsepdh, Gtk::PACK_EXPAND_WIDGET, 4);
show_all_children();
}
@ -233,6 +254,52 @@ void LCurve::read (const ProcParams* pp, const ParamsEdited* pedited)
{
disableListener();
gamutmunselmethodconn.block(true);
brightness->setValue(pp->labCurve.brightness);
contrast->setValue(pp->labCurve.contrast);
chromaticity->setValue(pp->labCurve.chromaticity);
adjusterChanged(chromaticity, pp->labCurve.chromaticity); // To update the GUI sensitiveness
//%%%%%%%%%%%%%%%%%%%%%%
rstprotection->setValue(pp->labCurve.rstprotection);
bwtconn.block(true);
lcconn.block(true);
lcredsk->set_active(pp->labCurve.lcredsk);
bwtconn.block(false);
lcconn.block(false);
lastLCVal = pp->labCurve.lcredsk;
//%%%%%%%%%%%%%%%%%%%%%%
lshape->setCurve(pp->labCurve.lcurve);
ashape->setCurve(pp->labCurve.acurve);
bshape->setCurve(pp->labCurve.bcurve);
ccshape->setCurve(pp->labCurve.cccurve);
chshape->setCurve(pp->labCurve.chcurve);
lhshape->setCurve(pp->labCurve.lhcurve);
hhshape->setCurve(pp->labCurve.hhcurve);
lcshape->setCurve(pp->labCurve.lccurve);
clshape->setCurve(pp->labCurve.clcurve);
if (pedited && !pedited->labCurve.gamutmunselmethod) {
gamutmunselmethod->set_active(4); // "Unchanged"
} else if (pp->labCurve.gamutmunselmethod == "NONE") {
gamutmunselmethod->set_active(0);
} else if (pp->labCurve.gamutmunselmethod == "LAB") {
gamutmunselmethod->set_active(1);
} else if (pp->labCurve.gamutmunselmethod == "XYZ") {
gamutmunselmethod->set_active(2);
} else if (pp->labCurve.gamutmunselmethod == "XYZREL") {
gamutmunselmethod->set_active(3);
} else if (pp->labCurve.gamutmunselmethod == "MUN") {
gamutmunselmethod->set_active(4);
}
gamutmunselChanged();
if (pedited) {
brightness->setEditedState(pedited->labCurve.brightness ? Edited : UnEdited);
@ -241,7 +308,6 @@ void LCurve::read (const ProcParams* pp, const ParamsEdited* pedited)
//%%%%%%%%%%%%%%%%%%%%%%
rstprotection->setEditedState(pedited->labCurve.rstprotection ? Edited : UnEdited);
avoidcolorshift->set_inconsistent (!pedited->labCurve.avoidcolorshift);
lcredsk->set_inconsistent(!pedited->labCurve.lcredsk);
//%%%%%%%%%%%%%%%%%%%%%%
@ -256,39 +322,15 @@ void LCurve::read (const ProcParams* pp, const ParamsEdited* pedited)
lcshape->setUnChanged(!pedited->labCurve.lccurve);
clshape->setUnChanged(!pedited->labCurve.clcurve);
if (!pedited->labCurve.gamutmunselmethod) {
gamutmunselmethod->set_active_text(M("GENERAL_UNCHANGED"));
}
set_inconsistent(multiImage && !pedited->labCurve.enabled);
}
brightness->setValue (pp->labCurve.brightness);
contrast->setValue (pp->labCurve.contrast);
chromaticity->setValue (pp->labCurve.chromaticity);
adjusterChanged(chromaticity, pp->labCurve.chromaticity); // To update the GUI sensitiveness
//%%%%%%%%%%%%%%%%%%%%%%
rstprotection->setValue (pp->labCurve.rstprotection);
gamutmunselmethodconn.block(false);
bwtconn.block (true);
acconn.block (true);
lcconn.block (true);
avoidcolorshift->set_active (pp->labCurve.avoidcolorshift);
lcredsk->set_active (pp->labCurve.lcredsk);
bwtconn.block (false);
acconn.block (false);
lcconn.block (false);
lastACVal = pp->labCurve.avoidcolorshift;
lastLCVal = pp->labCurve.lcredsk;
//%%%%%%%%%%%%%%%%%%%%%%
lshape->setCurve (pp->labCurve.lcurve);
ashape->setCurve (pp->labCurve.acurve);
bshape->setCurve (pp->labCurve.bcurve);
ccshape->setCurve (pp->labCurve.cccurve);
chshape->setCurve (pp->labCurve.chcurve);
lhshape->setCurve (pp->labCurve.lhcurve);
hhshape->setCurve (pp->labCurve.hhcurve);
lcshape->setCurve (pp->labCurve.lccurve);
clshape->setCurve (pp->labCurve.clcurve);
setEnabled(pp->labCurve.enabled);
@ -297,6 +339,7 @@ void LCurve::read (const ProcParams* pp, const ParamsEdited* pedited)
enableListener();
}
void LCurve::autoOpenCurve()
{
// Open up the first curve if selected
@ -359,7 +402,6 @@ void LCurve::write (ProcParams* pp, ParamsEdited* pedited)
pp->labCurve.contrast = (int)contrast->getValue();
pp->labCurve.chromaticity = (int)chromaticity->getValue();
//%%%%%%%%%%%%%%%%%%%%%%
pp->labCurve.avoidcolorshift = avoidcolorshift->get_active ();
pp->labCurve.lcredsk = lcredsk->get_active();
pp->labCurve.rstprotection = rstprotection->getValue();
@ -375,16 +417,18 @@ void LCurve::write (ProcParams* pp, ParamsEdited* pedited)
pp->labCurve.lccurve = lcshape->getCurve();
pp->labCurve.clcurve = clshape->getCurve();
if (pedited) {
pedited->labCurve.brightness = brightness->getEditedState();
pedited->labCurve.contrast = contrast->getEditedState();
pedited->labCurve.chromaticity = chromaticity->getEditedState();
//%%%%%%%%%%%%%%%%%%%%%%
pedited->labCurve.avoidcolorshift = !avoidcolorshift->get_inconsistent();
pedited->labCurve.lcredsk = !lcredsk->get_inconsistent();
pedited->labCurve.rstprotection = rstprotection->getEditedState();
pedited->labCurve.gamutmunselmethod = gamutmunselmethod->get_active_text() != M("GENERAL_UNCHANGED");
pedited->labCurve.lcurve = !lshape->isUnChanged();
pedited->labCurve.acurve = !ashape->isUnChanged();
@ -397,8 +441,23 @@ void LCurve::write (ProcParams* pp, ParamsEdited* pedited)
pedited->labCurve.clcurve = !clshape->isUnChanged();
pedited->labCurve.enabled = !get_inconsistent();
}
if (gamutmunselmethod->get_active_row_number() == 0) {
pp->labCurve.gamutmunselmethod = "NONE";
} else if (gamutmunselmethod->get_active_row_number() == 1) {
pp->labCurve.gamutmunselmethod = "LAB";
} else if (gamutmunselmethod->get_active_row_number() == 2) {
pp->labCurve.gamutmunselmethod = "XYZ";
} else if (gamutmunselmethod->get_active_row_number() == 3) {
pp->labCurve.gamutmunselmethod = "XYZREL";
} else if (gamutmunselmethod->get_active_row_number() == 4) {
pp->labCurve.gamutmunselmethod = "MUN";
}
}
void LCurve::setDefaults(const ProcParams* defParams, const ParamsEdited* pedited)
@ -423,31 +482,16 @@ void LCurve::setDefaults (const ProcParams* defParams, const ParamsEdited* pedit
}
//%%%%%%%%%%%%%%%%%%%%%%
//Color shift control changed
void LCurve::avoidcolorshift_toggled ()
void LCurve::gamutmunselChanged()
{
if (batchMode) {
if (avoidcolorshift->get_inconsistent()) {
avoidcolorshift->set_inconsistent (false);
acconn.block (true);
avoidcolorshift->set_active (false);
acconn.block (false);
} else if (lastACVal) {
avoidcolorshift->set_inconsistent (true);
if (listener && (multiImage || getEnabled())) {
listener->panelChanged(Evgamutmunsell, gamutmunselmethod->get_active_text());
}
lastACVal = avoidcolorshift->get_active ();
}
if (listener && getEnabled()) {
if (avoidcolorshift->get_active ()) {
listener->panelChanged (EvLAvoidColorShift, M("GENERAL_ENABLED"));
} else {
listener->panelChanged (EvLAvoidColorShift, M("GENERAL_DISABLED"));
}
}
}
void LCurve::lcredsk_toggled()
{
@ -556,12 +600,10 @@ void LCurve::adjusterChanged(Adjuster* a, double newval)
if (multiImage) {
//if chromaticity==-100 (lowest value), we enter the B&W mode and avoid color shift and rstprotection has no effect
rstprotection->set_sensitive(true);
avoidcolorshift->set_sensitive( true );
lcredsk->set_sensitive(true);
} else {
//if chromaticity==-100 (lowest value), we enter the B&W mode and avoid color shift and rstprotection has no effect
rstprotection->set_sensitive(int(newval) > -100); //no reason for grey rstprotection
avoidcolorshift->set_sensitive( int(newval) > -100 );
lcredsk->set_sensitive(int(newval) > -100);
}
@ -590,21 +632,26 @@ void LCurve::colorForValue (double valX, double valY, enum ColorCaller::ElemType
} else if (callerId == 6) { // cc - left bar
float value = (1.f - 0.7f) * float(valX) + 0.7f;
float hue = (1.14056f - 0.92f) * float(valY) + 0.92f;
if (hue > 1.0f) {
hue -= 1.0f;
}
// Y axis / from 0.15 up to 0.75 (arbitrary values; was 0.45 before)
Color::hsv2rgb01(hue, float(valX), value, R, G, B);
} else if (callerId == 3) { // lc - bottom bar
float value = (1.f - 0.7f) * float(valX) + 0.7f;
if (lcredsk->get_active()) {
// skin range
// -0.1 rad < Hue < 1.6 rad
// Y axis / from 0.92 up to 0.14056
float hue = (1.14056f - 0.92f) * float(valY) + 0.92f;
if (hue > 1.0f) {
hue -= 1.0f;
}
// Y axis / from 0.15 up to 0.75 (arbitrary values; was 0.45 before)
Color::hsv2rgb01(hue, float(valX), value, R, G, B);
} else {
@ -616,11 +663,13 @@ void LCurve::colorForValue (double valX, double valY, enum ColorCaller::ElemType
Color::hsv2rgb01(float(valX), 0.5f, float(valY), R, G, B);
} else if (callerId == 5) { // HH - bottom bar
float h = float((valY - 0.5) * 0.3 + valX);
if (h > 1.0f) {
h -= 1.0f;
} else if (h < 0.0f) {
h += 1.0f;
}
Color::hsv2rgb01(h, 0.5f, 0.5f, R, G, B);
} else if (callerId == 7) { // cc and cl - left bar
float value = (1.f - 0.7f) * float(valX) + 0.7f;
@ -645,6 +694,8 @@ void LCurve::setBatchMode (bool batchMode)
curveEditorG->setBatchMode(batchMode);
lcshape->setBottomBarColorProvider(nullptr, -1);
lcshape->setLeftBarColorProvider(nullptr, -1);
gamutmunselmethod->append(M("GENERAL_UNCHANGED"));
}

View File

@ -59,11 +59,14 @@ protected:
DiagonalCurveEditor* cdshape;
//%%%%%%%%%%%%%%%%
Gtk::CheckButton* avoidcolorshift;
Gtk::CheckButton* lcredsk;
MyComboBoxText* gamutmunselmethod;
sigc::connection gamutmunselmethodconn;
rtengine::ProcEvent Evgamutmunsell;
Adjuster* rstprotection;
sigc::connection bwtconn, acconn, lcconn;
sigc::connection bwtconn, lcconn;
bool lastACVal, lastLCVal;
//%%%%%%%%%%%%%%%%
@ -84,8 +87,8 @@ public:
void curveChanged (CurveEditor* ce) override;
void adjusterChanged (Adjuster* a, double newval) override;
void avoidcolorshift_toggled ();
void lcredsk_toggled();
void gamutmunselChanged();
void updateCurveBackgroundHistogram(
const LUTu& histToneCurve,

View File

@ -278,6 +278,18 @@ void Locallab::read(const rtengine::procparams::ProcParams* pp, const ParamsEdit
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);
r->locY = pp->locallab.spots.at(i).loc.at(2);
@ -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;

View File

@ -104,7 +104,7 @@ void ParamsEdited::set(bool v)
labCurve.brightness = v;
labCurve.contrast = v;
labCurve.chromaticity = v;
labCurve.avoidcolorshift = v;
labCurve.gamutmunselmethod = v;
labCurve.rstprotection = v;
labCurve.lcredsk = v;
localContrast.enabled = v;
@ -804,7 +804,7 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
labCurve.brightness = labCurve.brightness && p.labCurve.brightness == other.labCurve.brightness;
labCurve.contrast = labCurve.contrast && p.labCurve.contrast == other.labCurve.contrast;
labCurve.chromaticity = labCurve.chromaticity && p.labCurve.chromaticity == other.labCurve.chromaticity;
labCurve.avoidcolorshift = labCurve.avoidcolorshift && p.labCurve.avoidcolorshift == other.labCurve.avoidcolorshift;
labCurve.gamutmunselmethod = labCurve.gamutmunselmethod && p.labCurve.gamutmunselmethod == other.labCurve.gamutmunselmethod;
labCurve.rstprotection = labCurve.rstprotection && p.labCurve.rstprotection == other.labCurve.rstprotection;
labCurve.lcredsk = labCurve.lcredsk && p.labCurve.lcredsk == other.labCurve.lcredsk;
@ -908,7 +908,6 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
vibrance.avoidcolorshift = vibrance.avoidcolorshift && p.vibrance.avoidcolorshift == other.vibrance.avoidcolorshift;
vibrance.pastsattog = vibrance.pastsattog && p.vibrance.pastsattog == other.vibrance.pastsattog;
vibrance.skintonescurve = vibrance.skintonescurve && p.vibrance.skintonescurve == other.vibrance.skintonescurve;
colorappearance.enabled = colorappearance.enabled && p.colorappearance.enabled == other.colorappearance.enabled;
colorappearance.degree = colorappearance.degree && p.colorappearance.degree == other.colorappearance.degree;
colorappearance.autodegree = colorappearance.autodegree && p.colorappearance.autodegree == other.colorappearance.autodegree;
@ -1090,6 +1089,7 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
locallab.spots.at(j).structexclu = locallab.spots.at(j).structexclu && pSpot.structexclu == otherSpot.structexclu;
locallab.spots.at(j).struc = locallab.spots.at(j).struc && pSpot.struc == otherSpot.struc;
locallab.spots.at(j).shapeMethod = locallab.spots.at(j).shapeMethod && pSpot.shapeMethod == otherSpot.shapeMethod;
locallab.spots.at(j).avoidgamutMethod = locallab.spots.at(j).avoidgamutMethod && pSpot.avoidgamutMethod == otherSpot.avoidgamutMethod;
locallab.spots.at(j).loc = locallab.spots.at(j).loc && pSpot.loc == otherSpot.loc;
locallab.spots.at(j).centerX = locallab.spots.at(j).centerX && pSpot.centerX == otherSpot.centerX;
locallab.spots.at(j).centerY = locallab.spots.at(j).centerY && pSpot.centerY == otherSpot.centerY;
@ -1109,8 +1109,6 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
locallab.spots.at(j).transitgrad = locallab.spots.at(j).transitgrad && pSpot.transitgrad == otherSpot.transitgrad;
locallab.spots.at(j).hishow = locallab.spots.at(j).hishow && pSpot.hishow == otherSpot.hishow;
locallab.spots.at(j).activ = locallab.spots.at(j).activ && pSpot.activ == otherSpot.activ;
locallab.spots.at(j).avoid = locallab.spots.at(j).avoid && pSpot.avoid == otherSpot.avoid;
locallab.spots.at(j).avoidmun = locallab.spots.at(j).avoidmun && pSpot.avoidmun == otherSpot.avoidmun;
locallab.spots.at(j).blwh = locallab.spots.at(j).blwh && pSpot.blwh == otherSpot.blwh;
locallab.spots.at(j).recurs = locallab.spots.at(j).recurs && pSpot.recurs == otherSpot.recurs;
locallab.spots.at(j).laplac = locallab.spots.at(j).laplac && pSpot.laplac == otherSpot.laplac;
@ -2392,8 +2390,8 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.labCurve.chromaticity = dontforceSet && options.baBehav[ADDSET_LC_CHROMATICITY] ? toEdit.labCurve.chromaticity + mods.labCurve.chromaticity : mods.labCurve.chromaticity;
}
if (labCurve.avoidcolorshift) {
toEdit.labCurve.avoidcolorshift = mods.labCurve.avoidcolorshift;
if (labCurve.gamutmunselmethod) {
toEdit.labCurve.gamutmunselmethod = mods.labCurve.gamutmunselmethod;
}
if (labCurve.rstprotection) {
@ -3434,6 +3432,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.locallab.spots.at(i).shapeMethod = mods.locallab.spots.at(i).shapeMethod;
}
if (locallab.spots.at(i).avoidgamutMethod) {
toEdit.locallab.spots.at(i).avoidgamutMethod = mods.locallab.spots.at(i).avoidgamutMethod;
}
if (locallab.spots.at(i).loc) {
toEdit.locallab.spots.at(i).loc = mods.locallab.spots.at(i).loc;
}
@ -3510,14 +3512,6 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.locallab.spots.at(i).activ = mods.locallab.spots.at(i).activ;
}
if (locallab.spots.at(i).avoid) {
toEdit.locallab.spots.at(i).avoid = mods.locallab.spots.at(i).avoid;
}
if (locallab.spots.at(i).avoidmun) {
toEdit.locallab.spots.at(i).avoidmun = mods.locallab.spots.at(i).avoidmun;
}
if (locallab.spots.at(i).blwh) {
toEdit.locallab.spots.at(i).blwh = mods.locallab.spots.at(i).blwh;
}
@ -7412,6 +7406,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) :
structexclu(v),
struc(v),
shapeMethod(v),
avoidgamutMethod(v),
loc(v),
centerX(v),
centerY(v),
@ -7431,8 +7426,6 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) :
transitgrad(v),
hishow(v),
activ(v),
avoid(v),
avoidmun(v),
blwh(v),
recurs(v),
laplac(v),
@ -8104,6 +8097,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v)
structexclu = v;
struc = v;
shapeMethod = v;
avoidgamutMethod = v;
loc = v;
centerX = v;
centerY = v;
@ -8123,8 +8117,6 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v)
transitgrad = v;
hishow = v;
activ = v;
avoid = v;
avoidmun = v;
blwh = v;
recurs = v;
laplac = v;

View File

@ -109,7 +109,7 @@ struct LCurveParamsEdited {
bool brightness;
bool contrast;
bool chromaticity;
bool avoidcolorshift;
bool gamutmunselmethod;
bool rstprotection;
bool lcurve;
bool acurve;
@ -402,6 +402,7 @@ public:
bool structexclu;
bool struc;
bool shapeMethod;
bool avoidgamutMethod;
bool loc;
bool centerX;
bool centerY;
@ -421,8 +422,6 @@ public:
bool transitgrad;
bool hishow;
bool activ;
bool avoid;
bool avoidmun;
bool blwh;
bool recurs;
bool laplac;