Skip to content

Commit

Permalink
Clean and refine code
Browse files Browse the repository at this point in the history
  • Loading branch information
Desmis committed Jan 13, 2025
1 parent de5d73c commit ee22781
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 38 deletions.
5 changes: 3 additions & 2 deletions rtdata/languages/default
Original file line number Diff line number Diff line change
Expand Up @@ -1488,11 +1488,11 @@ HISTORY_MSG_ICM_WORKING_PRIM_METHOD;Primaries method
HISTORY_MSG_ICM_WORKING_SLOPE;TRC - Slope
HISTORY_MSG_ICM_WORKING_TRC_METHOD;TRC method
HISTORY_MSG_ILLUM;CAL - SC - Illuminant
HISTORY_MSG_LOCAL_BWEVMETHOD11;Local CIECAM - Black Ev & White Ev
HISTORY_MSG_LOCAL_CIE_CONTSIG;Local CIECAM - Sigmoid contrast
HISTORY_MSG_LOCAL_CIE_SKEWSIG;Local CIECAM - Sigmoid skew
HISTORY_MSG_LOCAL_CIE_SMOOTHTH;Local CIECAM - Attenuation threshold
HISTORY_MSG_LOCAL_CIE_SMOOTHLNK;Local CIECAM - Link R G B
HISTORY_MSG_LOCAL_CIE_WEVMETHOD11;Local CIECAM - Black Ev White Ev
HISTORY_MSG_LOCAL_CIE_WHITSIG;Local CIECAM - Sigmoid Display white point
HISTORY_MSG_LOCAL_CIE_SMOOTH_HIGH;Local CIECAM - Highlight Attenuation only
HISTORY_MSG_LOCAL_CIE_SMOOTHTRC;Local CIECAM - Gamma based Highlight attenuation
Expand Down Expand Up @@ -1578,7 +1578,8 @@ HISTORY_MSG_LOCAL_QJMETHOD;Local - CIECAM Tone mapping operator Q and J
HISTORY_MSG_LOCAL_SIGDACIE;Local - CIECAM Contrast 5.11
HISTORY_MSG_LOCAL_SIGTHCIE;Local - CIECAM Threshold 5.11
HISTORY_MSG_LOCAL_SIGBLCIE;Local - CIECAM Blend 5.11
HISTORY_MSG_LOCAL_SIGQ11;Local - CIECAM Sigmoid Q 5.11
HISTORY_MSG_LOCAL_SIGQ11;Local - CIECAM Sigmoid Q - deprecated
HISTORY_MSG_LOCAL_SIGQ12;Local - CIECAM Sigmoid Q and Slope based
HISTORY_MSG_LOCAL_SIGSENSICIE;Local - CIECAM Adaptability 5.11
HISTORY_MSG_LOCAL_SIGJZ11;Local - Jz Sigmoid J 5.11
HISTORY_MSG_LOCAL_SIGFORCEBW;Local - Jz White Ev and Black Ev 5.11
Expand Down
3 changes: 2 additions & 1 deletion rtgui/locallabtools.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ class LocallabTool:
rtengine::ProcEvent Evlocallabcomprcieth;
rtengine::ProcEvent EvlocallabHHhmaskcieshape;
rtengine::ProcEvent EvlocallabbwevMethod12;
rtengine::ProcEvent EvlocallabbwevMethod;
rtengine::ProcEvent Evlocallabgamjcie;
rtengine::ProcEvent Evlocallabslopjcie;
rtengine::ProcEvent Evlocallabmidtcie;
Expand Down Expand Up @@ -146,11 +145,13 @@ class LocallabTool:
rtengine::ProcEvent Evlocallabfeather_mask;
rtengine::ProcEvent Evlocallaboffslc;
rtengine::ProcEvent EvlocallabmodeQJ;
rtengine::ProcEvent EvlocallabbwevMethod;
rtengine::ProcEvent Evlocallabsigmoidldacie;
rtengine::ProcEvent Evlocallabsigmoidthcie;
rtengine::ProcEvent Evlocallabsigmoidblcie;
rtengine::ProcEvent Evlocallabsigmoidsenscie;
rtengine::ProcEvent Evlocallabsigq;
rtengine::ProcEvent Evlocallabsigq_12;
rtengine::ProcEvent Evlocallabsigjz;
rtengine::ProcEvent Evlocallabforcebw;

Expand Down
49 changes: 14 additions & 35 deletions rtgui/locallabtools2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8345,12 +8345,13 @@ Locallabcie::Locallabcie():
EvlocallabenacieMaskall = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_CIE_ENAMASKALL");
Evlocallabsmoothciemet = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_CIE_SMOOTHMET");
Evlocallabfeathercie = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_FEATHERCIE");
EvlocallabbwevMethod = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_BWEVMETHOD11");
EvlocallabmodeQJ = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_QJMETHOD");
EvlocallabbwevMethod = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_CIE_WEVMETHOD11");
Evlocallabsigmoidldacie = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_SIGDACIE");
Evlocallabsigmoidthcie = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_SIGTHCIE");
Evlocallabsigmoidblcie = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_SIGBLCIE");
Evlocallabsigq = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_SIGQ11");
Evlocallabsigq_12 = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_SIGQ12");
Evlocallabsigjz = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_SIGJZ11");
Evlocallabforcebw = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_SIGFORCEBW");
Evlocallabsigmoidldajzcie = m->newEvent(AUTOEXP, "HISTORY_MSG_LOCAL_SIGJZ11CONT");
Expand Down Expand Up @@ -8462,10 +8463,6 @@ Locallabcie::Locallabcie():
sigmoidFrame12->set_label_widget(*sigq12);
sigmoidFrame12->set_tooltip_text(M("TP_LOCALLAB_SIGMOID16_TOOLTIP"));

sigmoidFrame->set_label_align(0.025, 0.5);
sigmoidFrame->set_label_widget(*sigq);
sigmoidnormFrame->set_label_align(0.025, 0.5);
sigmoidnormFrame->set_label_widget(*normcie);

Gtk::Box *TittleVBoxprecam;
TittleVBoxprecam = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL));
Expand Down Expand Up @@ -8674,8 +8671,6 @@ Locallabcie::Locallabcie():
primillFrame->add(*primillBox);
gamcieBox->pack_start(*primillFrame);



expprecam->add(*gamcieBox, false);
ToolParamBlock* const sigfraBox12 = Gtk::manage(new ToolParamBlock());

Expand All @@ -8688,15 +8683,20 @@ Locallabcie::Locallabcie():
sigBox12->pack_start(*sigmoid2Frame12);
sigmoidFrame12->add(*sigBox12);

ToolParamBlock* const signormBox = Gtk::manage(new ToolParamBlock());
sigmoidFrame->set_label_align(0.025, 0.5);
sigmoidFrame->set_label_widget(*sigq);
sigmoidnormFrame->set_label_align(0.025, 0.5);
sigmoidnormFrame->set_label_widget(*normcie);

ToolParamBlock* const sigfraBox = Gtk::manage(new ToolParamBlock());
sigfraBox->pack_start(*modeHBoxbwev);
sigfraBox->pack_start(*sigmoidldacie);
sigfraBox->pack_start(*sigmoidthcie);
sigfraBox->pack_start(*sigmoidsenscie);
sigfraBox->pack_start(*sigmoidsenscie);
sigmoid2Frame->add(*sigfraBox);
sigBox->pack_start(*sigmoid2Frame);

ToolParamBlock* const signormBox = Gtk::manage(new ToolParamBlock());
signormBox->pack_start(*sigmoidblcie);
sigmoidnormFrame->add(*signormBox);
sigBox->pack_start(*sigmoidnormFrame);
Expand Down Expand Up @@ -11222,10 +11222,10 @@ void Locallabcie::sigq12Changed()
if (isLocActivated && exp->getEnabled()) {
if (listener) {
if (sigq12->get_active()) {
listener->panelChanged(Evlocallabsigq12,
listener->panelChanged(Evlocallabsigq_12,
M("GENERAL_ENABLED") + " (" + escapeHtmlChars(getSpotName()) + ")");
} else {
listener->panelChanged(Evlocallabsigq12,
listener->panelChanged(Evlocallabsigq_12,
M("GENERAL_DISABLED") + " (" + escapeHtmlChars(getSpotName()) + ")");
}
}
Expand Down Expand Up @@ -11765,40 +11765,19 @@ void Locallabcie::bwevMethod12Changed()
if (isLocActivated && exp->getEnabled()) {
if (listener) {
listener->panelChanged(EvlocallabbwevMethod12,
bwevMethod12->get_active_text() + " (" + escapeHtmlChars(getSpotName()) + ")");
bwevMethod12->get_active_text());
}
}
}

void Locallabcie::bwevMethodChanged()
{
const LocallabParams::LocallabSpot defSpot;
const int mode = complexity->get_active_row_number();

if (bwevMethod->get_active_row_number() == 2) {// && sigcie->get_active()) {
comprcie->set_sensitive(true);
comprcieth->set_sensitive(true);
comprcieauto->set_sensitive(true);
comprcieauto->set_active(true);

if (mode == Simple) {
comprcieth->set_sensitive(false);
comprcieauto->set_sensitive(false);
}

} else {
comprcieth->set_sensitive(false);
comprcieauto->set_sensitive(false);
}

if (bwevMethod->get_active_row_number() == 2) {
comprcie->setValue(defSpot.comprcie);//to test
}


if (isLocActivated && exp->getEnabled()) {
if (listener) {
listener->panelChanged(EvlocallabbwevMethod,
bwevMethod->get_active_text() + " (" + escapeHtmlChars(getSpotName()) + ")");
bwevMethod->get_active_text());
}
}
}
Expand Down

0 comments on commit ee22781

Please sign in to comment.