Local adjustments - Added Guidedfilter to avoid color shift (#6149)
* Added Guidedfilter to avoid color shift * Various improvment to avoid color shift * Small change to mint maxt * local adjustments avoid color shift: reduce memory usage by width * height * 8 byte if Soft Radius > 0 * Remove StopWatch * local adjustments avoid color shift: speedup for last loop * cleanups * one more cleanup * Added checkbox Munsell correction only - uniform perceptual lab * Refine some settings * Clean-up - other small refinement Co-authored-by: Ingo Weyrich <heckflosse67@gmx.de>
This commit is contained in:
parent
02b86239db
commit
0bf7c4e56c
|
@ -1284,6 +1284,8 @@ HISTORY_MSG_1036;Local - Nlmeans - patch
|
|||
HISTORY_MSG_1037;Local - Nlmeans - radius
|
||||
HISTORY_MSG_1038;Local - Nlmeans - gamma
|
||||
HISTORY_MSG_1039;Local - Grain - gamma
|
||||
HISTORY_MSG_1040;Local - Spot - soft radius
|
||||
HISTORY_MSG_1041;Local - Spot - Munsell
|
||||
HISTORY_MSG_BLSHAPE;Blur by level
|
||||
HISTORY_MSG_BLURCWAV;Blur chroma
|
||||
HISTORY_MSG_BLURWAV;Blur luminance
|
||||
|
@ -2421,7 +2423,7 @@ 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.
|
||||
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.
|
||||
|
@ -2486,6 +2488,8 @@ TP_LOCALLAB_ARTIF;Shape detection
|
|||
TP_LOCALLAB_ARTIF_TOOLTIP;ΔE scope threshold increases the range of deltaE scope. High values are for very wide gamut images.\nIncreasing deltaE decay can improve shape detection, but can also reduce the scope.
|
||||
TP_LOCALLAB_AUTOGRAY;Auto mean luminance (Yb%)
|
||||
TP_LOCALLAB_AVOID;Avoid color shift
|
||||
TP_LOCALLAB_AVOIDRAD;Soft radius
|
||||
TP_LOCALLAB_AVOIDMUN;Munsell correction only
|
||||
TP_LOCALLAB_BALAN;ab-L balance (ΔE)
|
||||
TP_LOCALLAB_BALANEXP;Laplacian balance
|
||||
TP_LOCALLAB_BALANH;C-H balance (ΔE)
|
||||
|
|
|
@ -2183,7 +2183,6 @@ void Color::gamutLchonly (float HH, float &Lprov1, float &Chprov1, float &R, flo
|
|||
const float ClipLevel = 65535.0f;
|
||||
bool inGamut;
|
||||
float2 sincosval = xsincosf(HH);
|
||||
|
||||
do {
|
||||
inGamut = true;
|
||||
|
||||
|
@ -2351,7 +2350,8 @@ void Color::gamutLchonly (float HH, float2 sincosval, float &Lprov1, float &Chpr
|
|||
}
|
||||
}
|
||||
|
||||
Chprov1 *= higherCoef; // decrease the chromaticity value
|
||||
Chprov1 *= higherCoef; // decrease the chromaticity value
|
||||
|
||||
|
||||
if (Chprov1 <= 3.0f) {
|
||||
Lprov1 += lowerCoef;
|
||||
|
|
|
@ -251,7 +251,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);
|
||||
|
||||
void avoidcolshi(struct local_params& lp, int sp, LabImage * original, LabImage *transformed, int cy, int cx);
|
||||
void avoidcolshi(struct local_params& lp, int sp, LabImage * original, LabImage *transformed, 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);
|
||||
|
|
|
@ -10485,17 +10485,25 @@ void clarimerge(struct local_params& lp, float &mL, float &mC, bool &exec, LabIm
|
|||
}
|
||||
}
|
||||
|
||||
void ImProcFunctions::avoidcolshi(struct local_params& lp, int sp, LabImage * original, LabImage *transformed, int cy, int cx)
|
||||
void ImProcFunctions::avoidcolshi(struct local_params& lp, int sp, LabImage * original, LabImage *transformed, int cy, int cx, int sk)
|
||||
{
|
||||
if (params->locallab.spots.at(sp).avoid && lp.islocal) {
|
||||
const float ach = lp.trans / 100.f;
|
||||
|
||||
TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix(params->icm.workingProfile);
|
||||
const float wip[3][3] = {
|
||||
{static_cast<float>(wiprof[0][0]), static_cast<float>(wiprof[0][1]), static_cast<float>(wiprof[0][2])},
|
||||
{static_cast<float>(wiprof[1][0]), static_cast<float>(wiprof[1][1]), static_cast<float>(wiprof[1][2])},
|
||||
{static_cast<float>(wiprof[2][0]), static_cast<float>(wiprof[2][1]), static_cast<float>(wiprof[2][2])}
|
||||
const double wip[3][3] = {//improve precision with double
|
||||
{wiprof[0][0], wiprof[0][1], wiprof[0][2]},
|
||||
{wiprof[1][0], wiprof[1][1], wiprof[1][2]},
|
||||
{wiprof[2][0], wiprof[2][1], wiprof[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
|
||||
//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
|
||||
const float maxt = 0.98f + 0.008f * tr;//between 0.98f and 0.996f
|
||||
|
||||
const bool highlight = params->toneCurve.hrenabled;
|
||||
const bool needHH = true; //always Munsell to avoid bad behavior //(lp.chro != 0.f);
|
||||
#ifdef _OPENMP
|
||||
|
@ -10612,7 +10620,10 @@ void ImProcFunctions::avoidcolshi(struct local_params& lp, int sp, LabImage * or
|
|||
|
||||
Color::pregamutlab(Lprov1, HH, chr);
|
||||
Chprov1 = rtengine::min(Chprov1, chr);
|
||||
Color::gamutLchonly(sincosval, Lprov1, Chprov1, wip, highlight, 0.15f, 0.92f);
|
||||
float R, G, B;
|
||||
if(!muns) {
|
||||
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;
|
||||
|
@ -10626,7 +10637,7 @@ void ImProcFunctions::avoidcolshi(struct local_params& lp, int sp, LabImage * or
|
|||
Color::AllMunsellLch(true, Lprov1, Lprov2, HH, Chprov, memChprov, correctionHue, correctlum);
|
||||
|
||||
if (std::fabs(correctionHue) < 0.015f) {
|
||||
HH += correctlum; // correct only if correct Munsell chroma very little.
|
||||
HH += correctlum; // correct only if correct Munsell chroma very small.
|
||||
}
|
||||
|
||||
sincosval = xsincosf(HH + correctionHue);
|
||||
|
@ -10636,6 +10647,78 @@ void ImProcFunctions::avoidcolshi(struct local_params& lp, int sp, LabImage * or
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Guidedfilter to reduce artifacts in transitions
|
||||
if (softr != 0.f) {//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);
|
||||
|
||||
constexpr float epsilmax = 0.005f;
|
||||
constexpr float epsilmin = 0.00001f;
|
||||
|
||||
constexpr float aepsil = (epsilmax - epsilmin) / 100.f;
|
||||
constexpr float bepsil = epsilmin;
|
||||
const float epsil = softr < 0.f ? 0.001f : aepsil * softr + bepsil;
|
||||
|
||||
const int bw = transformed->W;
|
||||
const int bh = transformed->H;
|
||||
array2D<float> ble(bw, bh);
|
||||
array2D<float> guid(bw, bh);
|
||||
|
||||
#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++) {
|
||||
ble[y][x] = transformed->L[y][x] / 32768.f;
|
||||
guid[y][x] = original->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];
|
||||
}
|
||||
}
|
||||
|
||||
array2D<float> &blechro = ble; // reuse buffer
|
||||
#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++) {
|
||||
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]));
|
||||
float2 sincosval;
|
||||
|
||||
if (Chprov1 == 0.0f) {
|
||||
sincosval.y = 1.f;
|
||||
sincosval.x = 0.0f;
|
||||
} else {
|
||||
sincosval.y = transformed->a[y][x] / Chprov1;
|
||||
sincosval.x = transformed->b[y][x] / Chprov1;
|
||||
}
|
||||
|
||||
transformed->a[y][x] = 32768.f * blechro[y][x] * sincosval.y;
|
||||
transformed->b[y][x] = 32768.f * blechro[y][x] * sincosval.x;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11133,7 +11216,8 @@ void ImProcFunctions::Lab_Local(
|
|||
constexpr int del = 3; // to avoid crash with [loy - begy] and [lox - begx] and bfh bfw // with gtk2 [loy - begy-1] [lox - begx -1 ] and del = 1
|
||||
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, locwavCurveden, locwavdenutili);
|
||||
avoidcolshi(lp, sp, original, transformed, cy, cx);
|
||||
|
||||
avoidcolshi(lp, sp, original, transformed, cy, cx, sk);
|
||||
|
||||
const float radius = lp.rad / (sk * 1.4); //0 to 70 ==> see skip
|
||||
int levred;
|
||||
|
@ -16207,7 +16291,7 @@ void ImProcFunctions::Lab_Local(
|
|||
//end common mask
|
||||
|
||||
// Gamut and Munsell control - very important do not deactivated to avoid crash
|
||||
avoidcolshi(lp, sp, original, transformed, cy, cx);
|
||||
avoidcolshi(lp, sp, original, transformed, cy, cx, sk);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1062,6 +1062,8 @@ enum ProcEventCode {
|
|||
Evlocallabnlrad = 1036,
|
||||
Evlocallabnlgam = 1037,
|
||||
Evlocallabdivgr = 1038,
|
||||
EvLocallabSpotavoidrad = 1039,
|
||||
EvLocallabSpotavoidmun = 1040,
|
||||
NUMOFEVENTS
|
||||
};
|
||||
|
||||
|
|
|
@ -2774,11 +2774,13 @@ LocallabParams::LocallabSpot::LocallabSpot() :
|
|||
balanh(1.0),
|
||||
colorde(5.0),
|
||||
colorscope(30.0),
|
||||
avoidrad(0.7),
|
||||
transitweak(1.0),
|
||||
transitgrad(0.0),
|
||||
hishow(false),
|
||||
activ(true),
|
||||
avoid(false),
|
||||
avoidmun(false),
|
||||
blwh(false),
|
||||
recurs(false),
|
||||
laplac(true),
|
||||
|
@ -4194,11 +4196,13 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const
|
|||
&& balanh == other.balanh
|
||||
&& colorde == other.colorde
|
||||
&& colorscope == other.colorscope
|
||||
&& avoidrad == other.avoidrad
|
||||
&& transitweak == other.transitweak
|
||||
&& transitgrad == other.transitgrad
|
||||
&& hishow == other.hishow
|
||||
&& activ == other.activ
|
||||
&& avoid == other.avoid
|
||||
&& avoidmun == other.avoidmun
|
||||
&& blwh == other.blwh
|
||||
&& recurs == other.recurs
|
||||
&& laplac == other.laplac
|
||||
|
@ -5835,11 +5839,13 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
|
|||
saveToKeyfile(!pedited || spot_edited->balanh, "Locallab", "Balanh_" + index_str, spot.balanh, keyFile);
|
||||
saveToKeyfile(!pedited || spot_edited->colorde, "Locallab", "Colorde_" + index_str, spot.colorde, keyFile);
|
||||
saveToKeyfile(!pedited || spot_edited->colorscope, "Locallab", "Colorscope_" + index_str, spot.colorscope, keyFile);
|
||||
saveToKeyfile(!pedited || spot_edited->avoidrad, "Locallab", "Avoidrad_" + index_str, spot.avoidrad, keyFile);
|
||||
saveToKeyfile(!pedited || spot_edited->transitweak, "Locallab", "Transitweak_" + index_str, spot.transitweak, keyFile);
|
||||
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);
|
||||
|
@ -7651,11 +7657,13 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
|
|||
assignFromKeyfile(keyFile, "Locallab", "Balanh_" + index_str, pedited, spot.balanh, spotEdited.balanh);
|
||||
assignFromKeyfile(keyFile, "Locallab", "Colorde_" + index_str, pedited, spot.colorde, spotEdited.colorde);
|
||||
assignFromKeyfile(keyFile, "Locallab", "Colorscope_" + index_str, pedited, spot.colorscope, spotEdited.colorscope);
|
||||
assignFromKeyfile(keyFile, "Locallab", "Avoidrad_" + index_str, pedited, spot.avoidrad, spotEdited.avoidrad);
|
||||
assignFromKeyfile(keyFile, "Locallab", "Transitweak_" + index_str, pedited, spot.transitweak, spotEdited.transitweak);
|
||||
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);
|
||||
|
|
|
@ -1009,11 +1009,13 @@ struct LocallabParams {
|
|||
double balanh;
|
||||
double colorde;
|
||||
double colorscope;
|
||||
double avoidrad;
|
||||
double transitweak;
|
||||
double transitgrad;
|
||||
bool hishow;
|
||||
bool activ;
|
||||
bool avoid;
|
||||
bool avoidmun;
|
||||
bool blwh;
|
||||
bool recurs;
|
||||
bool laplac;
|
||||
|
|
|
@ -1065,7 +1065,9 @@ int refreshmap[rtengine::NUMOFEVENTS] = {
|
|||
AUTOEXP, // Evlocallabnlpat
|
||||
AUTOEXP, // Evlocallabnlrad
|
||||
AUTOEXP, // Evlocallabnlgam
|
||||
AUTOEXP // Evlocallabdivgr
|
||||
AUTOEXP, // Evlocallabdivgr
|
||||
AUTOEXP, // EvLocallabSpotavoidrad
|
||||
AUTOEXP // EvLocallabSpotavoidmun
|
||||
|
||||
|
||||
};
|
||||
|
|
|
@ -76,12 +76,14 @@ 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))),
|
||||
scopemask_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SCOPEMASK"), 0, 100, 1, 60))),
|
||||
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")))),
|
||||
|
@ -354,6 +356,7 @@ ControlSpotPanel::ControlSpotPanel():
|
|||
balanh_->setAdjusterListener(this);
|
||||
colorde_->setAdjusterListener(this);
|
||||
colorscope_->setAdjusterListener(this);
|
||||
avoidrad_->setAdjusterListener(this);
|
||||
|
||||
preview_->set_active(false);
|
||||
previewConn_ = preview_->signal_clicked().connect(
|
||||
|
@ -393,7 +396,17 @@ ControlSpotPanel::ControlSpotPanel():
|
|||
|
||||
avoidConn_ = avoid_->signal_toggled().connect(
|
||||
sigc::mem_fun(*this, &ControlSpotPanel::avoidChanged));
|
||||
specCaseBox->pack_start(*avoid_);
|
||||
avoidmunConn_ = avoidmun_->signal_toggled().connect(
|
||||
sigc::mem_fun(*this, &ControlSpotPanel::avoidmunChanged));
|
||||
|
||||
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(*avoidrad_);
|
||||
avbox->pack_start(*avoidmun_);
|
||||
avFrame->add(*avbox);
|
||||
specCaseBox->pack_start(*avFrame);
|
||||
|
||||
blwhConn_ = blwh_->signal_toggled().connect(
|
||||
sigc::mem_fun(*this, &ControlSpotPanel::blwhChanged));
|
||||
|
@ -827,9 +840,11 @@ void ControlSpotPanel::load_ControlSpot_param()
|
|||
balanh_->setValue((double)row[spots_.balanh]);
|
||||
colorde_->setValue((double)row[spots_.colorde]);
|
||||
colorscope_->setValue((double)row[spots_.colorscope]);
|
||||
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]);
|
||||
|
@ -1481,6 +1496,14 @@ void ControlSpotPanel::adjusterChanged(Adjuster* a, double newval)
|
|||
}
|
||||
}
|
||||
|
||||
if (a == avoidrad_) {
|
||||
row[spots_.avoidrad] = avoidrad_->getValue();
|
||||
|
||||
if (listener) {
|
||||
listener->panelChanged(EvLocallabSpotavoidrad, avoidrad_->getTextValue());
|
||||
}
|
||||
}
|
||||
|
||||
if (a == scopemask_) {
|
||||
row[spots_.scopemask] = scopemask_->getIntValue();
|
||||
|
||||
|
@ -1570,6 +1593,31 @@ void ControlSpotPanel::avoidChanged()
|
|||
}
|
||||
}
|
||||
|
||||
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");
|
||||
|
@ -1787,9 +1835,11 @@ void ControlSpotPanel::disableParamlistener(bool cond)
|
|||
balanh_->block(cond);
|
||||
colorde_->block(cond);
|
||||
colorscope_->block(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);
|
||||
|
@ -1831,9 +1881,11 @@ void ControlSpotPanel::setParamEditable(bool cond)
|
|||
balanh_->set_sensitive(cond);
|
||||
colorde_->set_sensitive(cond);
|
||||
colorscope_->set_sensitive(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);
|
||||
|
@ -2509,6 +2561,7 @@ ControlSpotPanel::SpotRow* ControlSpotPanel::getSpot(const int index)
|
|||
r->balanh = row[spots_.balanh];
|
||||
r->colorde = row[spots_.colorde];
|
||||
r->colorscope = row[spots_.colorscope];
|
||||
r->avoidrad = row[spots_.avoidrad];
|
||||
r->transitweak = row[spots_.transitweak];
|
||||
r->transitgrad = row[spots_.transitgrad];
|
||||
r->scopemask = row[spots_.scopemask];
|
||||
|
@ -2516,6 +2569,7 @@ ControlSpotPanel::SpotRow* ControlSpotPanel::getSpot(const int index)
|
|||
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];
|
||||
|
@ -2644,9 +2698,11 @@ void ControlSpotPanel::addControlSpot(SpotRow* newSpot)
|
|||
row[spots_.balanh] = newSpot->balanh;
|
||||
row[spots_.colorde] = newSpot->colorde;
|
||||
row[spots_.colorscope] = newSpot->colorscope;
|
||||
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;
|
||||
|
@ -2717,6 +2773,7 @@ void ControlSpotPanel::setDefaults(const rtengine::procparams::ProcParams * defP
|
|||
balanh_->setDefault(defSpot.balanh);
|
||||
colorde_->setDefault(defSpot.colorde);
|
||||
colorscope_->setDefault(defSpot.colorscope);
|
||||
avoidrad_->setDefault(defSpot.avoidrad);
|
||||
scopemask_->setDefault((double)defSpot.scopemask);
|
||||
lumask_->setDefault((double)defSpot.lumask);
|
||||
}
|
||||
|
@ -2759,9 +2816,11 @@ ControlSpotPanel::ControlSpots::ControlSpots()
|
|||
add(balanh);
|
||||
add(colorde);
|
||||
add(colorscope);
|
||||
add(avoidrad);
|
||||
add(hishow);
|
||||
add(activ);
|
||||
add(avoid);
|
||||
add(avoidmun);
|
||||
add(blwh);
|
||||
add(recurs);
|
||||
add(laplac);
|
||||
|
|
|
@ -75,9 +75,11 @@ public:
|
|||
double balanh;
|
||||
double colorde;
|
||||
double colorscope;
|
||||
double avoidrad;
|
||||
bool hishow;
|
||||
bool activ;
|
||||
bool avoid;
|
||||
bool avoidmun;
|
||||
bool blwh;
|
||||
bool recurs;
|
||||
bool laplac;
|
||||
|
@ -249,6 +251,7 @@ private:
|
|||
void hishowChanged();
|
||||
void activChanged();
|
||||
void avoidChanged();
|
||||
void avoidmunChanged();
|
||||
void blwhChanged();
|
||||
void recursChanged();
|
||||
void laplacChanged();
|
||||
|
@ -307,9 +310,11 @@ private:
|
|||
Gtk::TreeModelColumn<double> balanh;
|
||||
Gtk::TreeModelColumn<double> colorde;
|
||||
Gtk::TreeModelColumn<double> colorscope;
|
||||
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;
|
||||
|
@ -394,6 +399,7 @@ private:
|
|||
Adjuster* const balanh_;
|
||||
Adjuster* const colorde_;
|
||||
Adjuster* const colorscope_;
|
||||
Adjuster* const avoidrad_;
|
||||
Adjuster* const scopemask_;
|
||||
Adjuster* const lumask_;
|
||||
|
||||
|
@ -403,6 +409,8 @@ private:
|
|||
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_;
|
||||
|
|
|
@ -316,9 +316,11 @@ void Locallab::read(const rtengine::procparams::ProcParams* pp, const ParamsEdit
|
|||
r->balanh = pp->locallab.spots.at(i).balanh;
|
||||
r->colorde = pp->locallab.spots.at(i).colorde;
|
||||
r->colorscope = pp->locallab.spots.at(i).colorscope;
|
||||
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;
|
||||
|
@ -494,9 +496,11 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
|
|||
r->balanh = newSpot->balanh;
|
||||
r->colorde = newSpot->colorde;
|
||||
r->colorscope = newSpot->colorscope;
|
||||
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;
|
||||
|
@ -781,8 +785,10 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
|
|||
r->balanh = newSpot->balanh;
|
||||
r->colorde = newSpot->colorde;
|
||||
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;
|
||||
|
@ -931,9 +937,11 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
|
|||
pp->locallab.spots.at(pp->locallab.selspot).balanh = r->balanh;
|
||||
pp->locallab.spots.at(pp->locallab.selspot).colorde = r->colorde;
|
||||
pp->locallab.spots.at(pp->locallab.selspot).colorscope = r->colorscope;
|
||||
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;
|
||||
|
|
|
@ -1078,11 +1078,13 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
|
|||
locallab.spots.at(j).balanh = locallab.spots.at(j).balanh && pSpot.balanh == otherSpot.balanh;
|
||||
locallab.spots.at(j).colorde = locallab.spots.at(j).colorde && pSpot.colorde == otherSpot.colorde;
|
||||
locallab.spots.at(j).colorscope = locallab.spots.at(j).colorscope && pSpot.colorscope == otherSpot.colorscope;
|
||||
locallab.spots.at(j).avoidrad = locallab.spots.at(j).avoidrad && pSpot.avoidrad == otherSpot.avoidrad;
|
||||
locallab.spots.at(j).transitweak = locallab.spots.at(j).transitweak && pSpot.transitweak == otherSpot.transitweak;
|
||||
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;
|
||||
|
@ -3313,6 +3315,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
|
|||
toEdit.locallab.spots.at(i).colorscope = mods.locallab.spots.at(i).colorscope;
|
||||
}
|
||||
|
||||
if (locallab.spots.at(i).avoidrad) {
|
||||
toEdit.locallab.spots.at(i).avoidrad = mods.locallab.spots.at(i).avoidrad;
|
||||
}
|
||||
|
||||
if (locallab.spots.at(i).transitweak) {
|
||||
toEdit.locallab.spots.at(i).transitweak = mods.locallab.spots.at(i).transitweak;
|
||||
}
|
||||
|
@ -3333,6 +3339,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
|
|||
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;
|
||||
}
|
||||
|
@ -6659,11 +6669,13 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) :
|
|||
balanh(v),
|
||||
colorde(v),
|
||||
colorscope(v),
|
||||
avoidrad(v),
|
||||
transitweak(v),
|
||||
transitgrad(v),
|
||||
hishow(v),
|
||||
activ(v),
|
||||
avoid(v),
|
||||
avoidmun(v),
|
||||
blwh(v),
|
||||
recurs(v),
|
||||
laplac(v),
|
||||
|
@ -7227,11 +7239,13 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v)
|
|||
balanh = v;
|
||||
colorde = v;
|
||||
colorscope = v;
|
||||
avoidrad = v;
|
||||
transitweak = v;
|
||||
transitgrad = v;
|
||||
hishow = v;
|
||||
activ = v;
|
||||
avoid = v;
|
||||
avoidmun = v;
|
||||
blwh = v;
|
||||
recurs = v;
|
||||
laplac = v;
|
||||
|
|
|
@ -417,11 +417,13 @@ public:
|
|||
bool balanh;
|
||||
bool colorde;
|
||||
bool colorscope;
|
||||
bool avoidrad;
|
||||
bool transitweak;
|
||||
bool transitgrad;
|
||||
bool hishow;
|
||||
bool activ;
|
||||
bool avoid;
|
||||
bool avoidmun;
|
||||
bool blwh;
|
||||
bool recurs;
|
||||
bool laplac;
|
||||
|
|
Loading…
Reference in New Issue