Add Color correction grid to Color and Light
This commit is contained in:
parent
5e66e402fa
commit
711d46bd5d
@ -876,6 +876,7 @@ HISTORY_MSG_620;Local - Blur col
|
||||
HISTORY_MSG_621;Local - Exp inverse
|
||||
HISTORY_MSG_622;Local - Exclude structure
|
||||
HISTORY_MSG_623;Local - Exp Chroma compensation
|
||||
HISTORY_MSG_624;Local - Color correction grid
|
||||
HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors
|
||||
HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction
|
||||
HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction
|
||||
@ -1980,6 +1981,8 @@ TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP;If curves at the top, mask is completely blac
|
||||
TP_LOCALLAB_CURVEMETHOD_TOOLTIP;'Normal', the curve L=f(L) has the same algorithm than slider lightness.\n'Super' the curve L=f(L) has an new improved algorithm, which can leeds in some cases to artifacts.
|
||||
TP_LOCALLAB_EXCLUF;Excluding
|
||||
TP_LOCALLAB_EXCLUF_TOOLTIP;Can be used to exclude this part of datas - move Scope to extend color.\n You can apply all settings to this RT-spot.
|
||||
TP_LOCALLAB_LABGRID_VALUES;HL: a=%1 b=%2\nS: a=%3 b=%4
|
||||
TP_LOCALLAB_LABGRID;Color correction grid
|
||||
TP_LOCALLAB_SENSIDEN;Scope
|
||||
TP_LOCALLAB_SENSIEXCLU;Scope
|
||||
TP_LOCALLAB_SENSIEXCLU_TOOLTIP;Adjust color to include in exclusion!
|
||||
|
@ -6010,7 +6010,7 @@ void ImProcFunctions::colorToningLabGrid(LabImage *lab, int xstart, int xend, in
|
||||
float b_scale = (params->colorToning.labgridBHigh - params->colorToning.labgridBLow) / factor / scaling;
|
||||
float b_base = params->colorToning.labgridBLow / scaling;
|
||||
|
||||
#ifdef _OPENMP
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel for if (multiThread)
|
||||
#endif
|
||||
|
||||
|
@ -167,6 +167,7 @@ struct local_params {
|
||||
float blurexp;
|
||||
float blurcol;
|
||||
float ligh;
|
||||
float lowA, lowB, highA, highB;
|
||||
int shamo, shdamp, shiter, senssha, sensv;
|
||||
float neig;
|
||||
float strng;
|
||||
@ -460,6 +461,11 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall
|
||||
int local_sensicb = locallab.spots.at(sp).sensicb;
|
||||
int local_contrast = locallab.spots.at(sp).contrast;
|
||||
float local_lightness = (float) locallab.spots.at(sp).lightness;
|
||||
float labgridALowloc = locallab.spots.at(sp).labgridALow;
|
||||
float labgridBLowloc = locallab.spots.at(sp).labgridBLow;
|
||||
float labgridBHighloc = locallab.spots.at(sp).labgridBHigh;
|
||||
float labgridAHighloc = locallab.spots.at(sp).labgridAHigh;
|
||||
|
||||
float structcolor = (float) locallab.spots.at(sp).structcol;
|
||||
float blendmaskcolor = ((float) locallab.spots.at(sp).blendmaskcol) / 100.f ;
|
||||
float blendmaskexpo = ((float) locallab.spots.at(sp).blendmaskexp) / 100.f ;
|
||||
@ -513,6 +519,11 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall
|
||||
lp.senscb = local_sensicb;
|
||||
lp.cont = local_contrast;
|
||||
lp.ligh = local_lightness;
|
||||
lp.lowA = labgridALowloc;
|
||||
lp.lowB = labgridBLowloc;
|
||||
lp.highB = labgridBHighloc;
|
||||
lp.highA = labgridAHighloc;
|
||||
|
||||
lp.senssf = local_sensisf;
|
||||
lp.strng = strlight;
|
||||
lp.neig = neigh;
|
||||
@ -1037,8 +1048,28 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, LabImage* dest)
|
||||
|
||||
#endif
|
||||
}
|
||||
/*
|
||||
void ImProcFunctions::colorToningLabGridloc(LabImage *lab, int xs, int xe, int ys, int ye, bool MultiThread)
|
||||
{
|
||||
const float factor = ColorToningParams::LABGRID_CORR_MAX * 3.f;
|
||||
const float scaling = ColorToningParams::LABGRID_CORR_SCALE;
|
||||
float a_scale = (params->colorToning.labgridAHigh - params->colorToning.labgridALow) / factor / scaling;
|
||||
float a_base = params->colorToning.labgridALow / scaling;
|
||||
float b_scale = (params->colorToning.labgridBHigh - params->colorToning.labgridBLow) / factor / scaling;
|
||||
float b_base = params->colorToning.labgridBLow / scaling;
|
||||
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel for if (multiThread)
|
||||
#endif
|
||||
|
||||
for (int y = ystart; y < yend; ++y) {
|
||||
for (int x = xstart; x < xend; ++x) {
|
||||
lab->a[y][x] += lab->L[y][x] * a_scale + a_base;
|
||||
lab->b[y][x] += lab->L[y][x] * b_scale + b_base;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
void ImProcFunctions::vibrancelocal(int sp, int bfw, int bfh, LabImage* lab, LabImage* dest, bool & localskutili, LUTf & sklocalcurve)
|
||||
@ -3941,12 +3972,16 @@ void ImProcFunctions::transit_shapedetect(int senstype, LabImage * bufexporig, L
|
||||
float chra = bufexporig->a[loy - begy][lox - begx];
|
||||
float chrb = bufexporig->b[loy - begy][lox - begx];
|
||||
|
||||
if (senstype == 4 || senstype == 6 || senstype == 2 || senstype == 3 || senstype == 0) {
|
||||
if (senstype == 4 || senstype == 6 || senstype == 2 || senstype == 3) {
|
||||
flia = flib = ((100.f + realstrchdE) / 100.f);
|
||||
} else if (senstype == 1) {
|
||||
// printf("rdE=%f chdE=%f", realstradE, realstrchdE);
|
||||
flia = (100.f + realstradE + 100.f * realstrchdE) / 100.f;
|
||||
flib = (100.f + realstrbdE + 100.f * realstrchdE) / 100.f;
|
||||
} else if (senstype == 0) {
|
||||
// printf("rdE=%f chdE=%f", realstradE, realstrchdE);
|
||||
flia = (100.f + 5.f * realstradE + realstrchdE) / 100.f;
|
||||
flib = (100.f + 5.f * realstrbdE + realstrchdE) / 100.f;
|
||||
}
|
||||
|
||||
difa = chra * flia - original->a[y][x];
|
||||
@ -4030,11 +4065,14 @@ void ImProcFunctions::transit_shapedetect(int senstype, LabImage * bufexporig, L
|
||||
float chra = bufexporig->a[loy - begy][lox - begx];
|
||||
float chrb = bufexporig->b[loy - begy][lox - begx];
|
||||
|
||||
if (senstype == 4 || senstype == 6 || senstype == 2 || senstype == 3 || senstype == 0) {
|
||||
if (senstype == 4 || senstype == 6 || senstype == 2 || senstype == 3) {
|
||||
flia = flib = (100.f + realstrchdE) / 100.f;
|
||||
} else if (senstype == 1) {
|
||||
flia = (100.f + realstradE + 100.f * realstrchdE) / 100.f;
|
||||
flib = (100.f + realstrbdE + 100.f * realstrchdE) / 100.f;
|
||||
} else if (senstype == 0) {
|
||||
flia = (100.f + 5.f * realstradE + realstrchdE) / 100.f;
|
||||
flib = (100.f + 5.f * realstrbdE + realstrchdE) / 100.f;
|
||||
}
|
||||
|
||||
difa = chra * flia - original->a[y][x];
|
||||
@ -7933,8 +7971,14 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
|
||||
|
||||
|
||||
//local color and light
|
||||
|
||||
if (!lp.inv && (lp.chro != 0 || lp.ligh != 0.f || lp.cont != 0 || lp.qualcurvemet != 0 || lp.showmaskcolmet == 2 || lp.enaColorMask || lp.showmaskcolmet == 3 || lp.showmaskcolmet == 4) && lp.colorena) { // || lllocalcurve)) { //interior ellipse renforced lightness and chroma //locallutili
|
||||
const float factor = ColorToningParams::LABGRID_CORR_MAX * 3.f;
|
||||
const float scaling = ColorToningParams::LABGRID_CORR_SCALE;
|
||||
float a_scale = 2.f * (lp.highA - lp.lowA) / factor / scaling;
|
||||
float a_base = lp.lowA / scaling;
|
||||
float b_scale = 2.f * (lp.highB - lp.lowB) / factor / scaling;
|
||||
float b_base = lp.lowB / scaling;
|
||||
bool ctoning = (a_scale != 0.f || b_scale != 0.f || a_base != 0.f || b_base != 0.f);
|
||||
if (!lp.inv && (lp.chro != 0 || lp.ligh != 0.f || lp.cont != 0 || ctoning || lp.qualcurvemet != 0 || lp.showmaskcolmet == 2 || lp.enaColorMask || lp.showmaskcolmet == 3 || lp.showmaskcolmet == 4) && lp.colorena) { // || lllocalcurve)) { //interior ellipse renforced lightness and chroma //locallutili
|
||||
|
||||
|
||||
LabImage *bufcolorig = nullptr;
|
||||
@ -8347,6 +8391,8 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
|
||||
LabImage *bufcolcalc = nullptr;
|
||||
bufcolcalc = new LabImage(bfw, bfh);
|
||||
|
||||
//printf("a_s=%f a_b=%f b_s=%f b_b=%f \n", a_scale, a_base, b_scale, b_base);
|
||||
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel for schedule(dynamic,16)
|
||||
#endif
|
||||
@ -8433,6 +8479,11 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
|
||||
|
||||
}
|
||||
|
||||
if (ctoning) {
|
||||
bufcolcalc->a[loy - begy][lox - begx] = bufcolcalc->a[loy - begy][lox - begx] + bufcolcalc->L[loy - begy][lox - begx] * a_scale + a_base;
|
||||
bufcolcalc->b[loy - begy][lox - begx] = bufcolcalc->b[loy - begy][lox - begx] + bufcolcalc->L[loy - begy][lox - begx] * b_scale + b_base;
|
||||
}
|
||||
|
||||
float rL;
|
||||
rL = CLIPRET((bufcolcalc->L[loy - begy][lox - begx] - bufcolorig->L[loy - begy][lox - begx]) / 328.f);
|
||||
buflight[loy - begy][lox - begx] = rL;
|
||||
|
@ -650,6 +650,7 @@ enum ProcEventCode {
|
||||
Evlocallabinversex = 620,
|
||||
Evlocallabstructexlu = 621,
|
||||
Evlocallabexpchroma = 622,
|
||||
EvLocallabLabGridValue = 623,
|
||||
NUMOFEVENTS
|
||||
};
|
||||
|
||||
|
@ -2362,6 +2362,10 @@ LocallabParams::LocallabSpot::LocallabSpot() :
|
||||
lightness(0),
|
||||
contrast(0),
|
||||
chroma(0),
|
||||
labgridALow(0.0),
|
||||
labgridBLow(0.0),
|
||||
labgridAHigh(0.0),
|
||||
labgridBHigh(0.0),
|
||||
sensi(15),
|
||||
structcol(0),
|
||||
blurcolde(5),
|
||||
@ -2378,7 +2382,7 @@ LocallabParams::LocallabSpot::LocallabSpot() :
|
||||
HHmaskcurve{(double)FCT_MinMaxCPoints, 0.0, 1.0, 0.35, 0.35, 0.50, 1.0, 0.35, 0.35, 1.00, 1.0, 0.35, 0.35 },
|
||||
// Exposure
|
||||
expexpose(false),
|
||||
expcomp(0),
|
||||
expcomp(0.0),
|
||||
hlcompr(60),
|
||||
hlcomprthresh(33),
|
||||
black(0),
|
||||
@ -2507,6 +2511,10 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const
|
||||
&& lightness == other.lightness
|
||||
&& contrast == other.contrast
|
||||
&& chroma == other.chroma
|
||||
&& labgridALow == other.labgridALow
|
||||
&& labgridBLow == other.labgridBLow
|
||||
&& labgridAHigh == other.labgridAHigh
|
||||
&& labgridBHigh == other.labgridBHigh
|
||||
&& sensi == other.sensi
|
||||
&& structcol == other.structcol
|
||||
&& blendmaskcol == other.blendmaskcol
|
||||
@ -3600,11 +3608,16 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
|
||||
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).thresh, "Locallab", "Thresh_" + std::to_string(i), spot.thresh, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).iter, "Locallab", "Iter_" + std::to_string(i), spot.iter, keyFile);
|
||||
// Color & Light
|
||||
saveToKeyfile(!pedited || pedited->colorToning.labgridALow, "ColorToning", "LabGridALow", colorToning.labgridALow, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).expcolor, "Locallab", "Expcolor_" + std::to_string(i), spot.expcolor, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).curvactiv, "Locallab", "Curvactiv_" + std::to_string(i), spot.curvactiv, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).lightness, "Locallab", "Lightness_" + std::to_string(i), spot.lightness, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).contrast, "Locallab", "Contrast_" + std::to_string(i), spot.contrast, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).chroma, "Locallab", "Chroma_" + std::to_string(i), spot.chroma, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).labgridALow, "Locallab", "labgridALow_" + std::to_string(i), spot.labgridALow, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).labgridBLow, "Locallab", "labgridBLow_" + std::to_string(i), spot.labgridBLow, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).labgridAHigh, "Locallab", "labgridAHigh_" + std::to_string(i), spot.labgridAHigh, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).labgridBHigh, "Locallab", "labgridBHigh_" + std::to_string(i), spot.labgridBHigh, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).sensi, "Locallab", "Sensi_" + std::to_string(i), spot.sensi, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).structcol, "Locallab", "Structcol_" + std::to_string(i), spot.structcol, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).blurcolde, "Locallab", "Blurcolde_" + std::to_string(i), spot.blurcolde, keyFile);
|
||||
@ -4835,6 +4848,10 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
|
||||
assignFromKeyfile(keyFile, "Locallab", "Lightness_" + std::to_string(i), pedited, spot.lightness, spotEdited.lightness);
|
||||
assignFromKeyfile(keyFile, "Locallab", "Contrast_" + std::to_string(i), pedited, spot.contrast, spotEdited.contrast);
|
||||
assignFromKeyfile(keyFile, "Locallab", "Chroma_" + std::to_string(i), pedited, spot.chroma, spotEdited.chroma);
|
||||
assignFromKeyfile(keyFile, "Locallab", "labgridALow_" + std::to_string(i), pedited, spot.labgridALow, spotEdited.labgridALow);
|
||||
assignFromKeyfile(keyFile, "Locallab", "labgridBLow_" + std::to_string(i), pedited, spot.labgridBLow, spotEdited.labgridBLow);
|
||||
assignFromKeyfile(keyFile, "Locallab", "labgridAHigh_" + std::to_string(i), pedited, spot.labgridAHigh, spotEdited.labgridAHigh);
|
||||
assignFromKeyfile(keyFile, "Locallab", "labgridBHigh_" + std::to_string(i), pedited, spot.labgridBHigh, spotEdited.labgridBHigh);
|
||||
assignFromKeyfile(keyFile, "Locallab", "Sensi_" + std::to_string(i), pedited, spot.sensi, spotEdited.sensi);
|
||||
assignFromKeyfile(keyFile, "Locallab", "Structcol_" + std::to_string(i), pedited, spot.structcol, spotEdited.structcol);
|
||||
assignFromKeyfile(keyFile, "Locallab", "Blurcolde_" + std::to_string(i), pedited, spot.blurcolde, spotEdited.blurcolde);
|
||||
|
@ -962,6 +962,13 @@ struct LocallabParams {
|
||||
int lightness;
|
||||
int contrast;
|
||||
int chroma;
|
||||
double labgridALow;
|
||||
double labgridBLow;
|
||||
double labgridAHigh;
|
||||
double labgridBHigh;
|
||||
static const double LABGRID_CORR_MAX;
|
||||
static const double LABGRID_CORR_SCALE;
|
||||
|
||||
int sensi;
|
||||
int structcol;
|
||||
int blurcolde;
|
||||
@ -978,7 +985,8 @@ struct LocallabParams {
|
||||
std::vector<double> HHmaskcurve;
|
||||
// Exposure
|
||||
bool expexpose;
|
||||
int expcomp;
|
||||
// int expcomp;
|
||||
double expcomp;
|
||||
int hlcompr;
|
||||
int hlcomprthresh;
|
||||
int black;
|
||||
|
@ -649,7 +649,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = {
|
||||
LUMINANCECURVE, // Evlocallabblurcolde
|
||||
LUMINANCECURVE, // Evlocallabinversex
|
||||
LUMINANCECURVE, // Evlocallabstructexclu
|
||||
LUMINANCECURVE // Evlocallabexpchroma
|
||||
LUMINANCECURVE, // Evlocallabexpchroma
|
||||
LUMINANCECURVE //EvLocallabLabGridValue
|
||||
};
|
||||
|
||||
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include <string>
|
||||
#include <unistd.h>
|
||||
#include "../rtengine/improcfun.h"
|
||||
#include "labgrid.h"
|
||||
|
||||
#define MINCHRO 0.
|
||||
#define MAXCHRO 150
|
||||
@ -49,7 +50,6 @@ Locallab::Locallab():
|
||||
expexpose(new MyExpander(true, M("TP_LOCALLAB_EXPOSE"))),
|
||||
expvibrance(new MyExpander(true, M("TP_LOCALLAB_VIBRANCE"))),
|
||||
expsoft(new MyExpander(true, M("TP_LOCALLAB_SOFT"))),
|
||||
explabregion(new MyExpander(true, M("TP_LOCALLAB_LABREGION"))),
|
||||
expblur(new MyExpander(true, M("TP_LOCALLAB_BLUFR"))),
|
||||
exptonemap(new MyExpander(true, M("TP_LOCALLAB_TM"))),
|
||||
expreti(new MyExpander(true, M("TP_LOCALLAB_RETI"))),
|
||||
@ -78,7 +78,7 @@ Locallab::Locallab():
|
||||
chroma(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMA"), -100, 150, 1, 0))),
|
||||
sensi(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 15))),
|
||||
structcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUCCOL"), 0, 100, 1, 0))),
|
||||
blurcolde(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURDE"), 2, 100, 1, 5))),
|
||||
blurcolde(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURDE"), 2, 100, 1, 5))),
|
||||
blendmaskcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -100, 100, 1, 0))),
|
||||
// Exposure
|
||||
expcomp(Gtk::manage(new Adjuster(M("TP_EXPOSURE_EXPCOMP"), -200, 400, 5, 0))),
|
||||
@ -90,7 +90,7 @@ Locallab::Locallab():
|
||||
warm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_WARM"), -100., 100., 1., 0., Gtk::manage(new RTImage("circle-blue-small.png")), Gtk::manage(new RTImage("circle-orange-small.png"))))),
|
||||
sensiex(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 15))),
|
||||
structexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUCCOL"), 0, 100, 1, 0))),
|
||||
blurexpde(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURDE"), 2, 100, 1, 5))),
|
||||
blurexpde(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURDE"), 2, 100, 1, 5))),
|
||||
blendmaskexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -100, 100, 1, 0))),
|
||||
// Vibrance
|
||||
saturated(Gtk::manage(new Adjuster(M("TP_VIBRANCE_SATURATED"), -100., 100., 1., 0.))),
|
||||
@ -188,10 +188,11 @@ Locallab::Locallab():
|
||||
lumacontrastMinusButton(Gtk::manage(new Gtk::Button(M("TP_DIRPYREQUALIZER_LUMACONTRAST_MINUS")))),
|
||||
lumaneutralButton(Gtk::manage(new Gtk::Button(M("TP_DIRPYREQUALIZER_LUMANEUTRAL")))),
|
||||
lumacontrastPlusButton(Gtk::manage(new Gtk::Button(M("TP_DIRPYREQUALIZER_LUMACONTRAST_PLUS")))),
|
||||
transLabels(Gtk::manage (new Gtk::Label ("---"))),
|
||||
transLabels2(Gtk::manage (new Gtk::Label ("---"))),
|
||||
transLabels(Gtk::manage(new Gtk::Label("---"))),
|
||||
transLabels2(Gtk::manage(new Gtk::Label("---"))),
|
||||
maskcolFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_SHOW")))),
|
||||
maskexpFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_SHOW")))),
|
||||
gridFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LABGRID")))),
|
||||
|
||||
// Others
|
||||
defparams(nullptr),
|
||||
@ -218,12 +219,12 @@ Locallab::Locallab():
|
||||
// Color & Light
|
||||
expcolor->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expcolor));
|
||||
enablecolorConn = expcolor->signal_enabled_toggled().connect(sigc::bind(sigc::mem_fun(this, &Locallab::enableToggled), expcolor));
|
||||
expcolor->set_tooltip_text(M("TP_LOCALLAB_EXPCOLOR_TOOLTIP"));
|
||||
// expcolor->set_tooltip_text(M("TP_LOCALLAB_EXPCOLOR_TOOLTIP"));
|
||||
|
||||
curvactivConn = curvactiv->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::curvactivChanged));
|
||||
|
||||
lightness->setAdjusterListener(this);
|
||||
|
||||
lightness->set_tooltip_text(M("TP_LOCALLAB_EXPCOLOR_TOOLTIP"));
|
||||
contrast->setAdjusterListener(this);
|
||||
|
||||
chroma->setAdjusterListener(this);
|
||||
@ -238,15 +239,10 @@ Locallab::Locallab():
|
||||
|
||||
qualitycurveMethod->append(M("TP_LOCALLAB_CURVNONE"));
|
||||
qualitycurveMethod->append(M("TP_LOCALLAB_CURVCURR"));
|
||||
/* qualitycurveMethod->append(M("TP_LOCALLAB_CURVENH"));
|
||||
qualitycurveMethod->append(M("TP_LOCALLAB_CURVENHSU"));
|
||||
qualitycurveMethod->append(M("TP_LOCALLAB_CURVENCONTRAST"));
|
||||
qualitycurveMethod->append(M("TP_LOCALLAB_CURVENSOB2"));
|
||||
*/
|
||||
qualitycurveMethod->set_active(0);
|
||||
qualitycurveMethod->set_tooltip_markup(M("TP_LOCALLAB_CURVEMETHOD_TOOLTIP"));
|
||||
qualitycurveMethodConn = qualitycurveMethod->signal_changed().connect(sigc::mem_fun(*this, &Locallab::qualitycurveMethodChanged));
|
||||
|
||||
|
||||
llCurveEditorG->setCurveListener(this);
|
||||
|
||||
llshape = static_cast<DiagonalCurveEditor*>(llCurveEditorG->addCurve(CT_Diagonal, "L(L)"));
|
||||
@ -267,7 +263,7 @@ Locallab::Locallab():
|
||||
ccshape->setBottomBarBgGradient(mccshape);
|
||||
ccshape->setLeftBarBgGradient(mccshape);
|
||||
|
||||
// llCurveEditorG->newLine();
|
||||
// llCurveEditorG->newLine();
|
||||
llCurveEditorG->curveListComplete();
|
||||
HCurveEditorG->setCurveListener(this);
|
||||
|
||||
@ -285,7 +281,7 @@ Locallab::Locallab():
|
||||
}
|
||||
|
||||
LHshape->setBottomBarBgGradient(mLHshape);
|
||||
// llCurveEditorG->curveListComplete();
|
||||
// llCurveEditorG->curveListComplete();
|
||||
|
||||
HHshape = static_cast<FlatCurveEditor*>(HCurveEditorG->addCurve(CT_Flat, "H(H)", nullptr, false, true));
|
||||
HHshape->setIdentityValue(0.);
|
||||
@ -342,7 +338,8 @@ Locallab::Locallab():
|
||||
HHmaskshape->setBottomBarColorProvider(this, 6);
|
||||
|
||||
maskCurveEditorG->curveListComplete();
|
||||
|
||||
labgrid = Gtk::manage(new LabGrid(EvLocallabLabGridValue, M("TP_LOCALLAB_LABGRID_VALUES")));
|
||||
|
||||
ToolParamBlock* const colorBox = Gtk::manage(new ToolParamBlock());
|
||||
Gtk::Frame* const superFrame = Gtk::manage(new Gtk::Frame());
|
||||
superFrame->set_label_align(0.025, 0.5);
|
||||
@ -351,6 +348,12 @@ Locallab::Locallab():
|
||||
superBox->pack_start(*lightness);
|
||||
superBox->pack_start(*contrast);
|
||||
superBox->pack_start(*chroma);
|
||||
gridFrame->set_label_align(0.025, 0.5);
|
||||
ToolParamBlock* const gridBox = Gtk::manage(new ToolParamBlock());
|
||||
gridBox->pack_start(*labgrid);
|
||||
gridFrame->add(*gridBox);
|
||||
superBox->pack_start(*gridFrame);
|
||||
|
||||
superFrame->add(*superBox);
|
||||
colorBox->pack_start(*superFrame);
|
||||
colorBox->pack_start(*sensi);
|
||||
@ -441,7 +444,7 @@ Locallab::Locallab():
|
||||
|
||||
LLmaskexpshape = static_cast<FlatCurveEditor*>(maskexpCurveEditorG->addCurve(CT_Flat, "L(L)", nullptr, false, false));
|
||||
LLmaskexpshape->setIdentityValue(0.);
|
||||
LLmaskexpshape->setResetCurve(FlatCurveType(defSpot.LLmaskexpcurve.at(0)), defSpot.LLmaskexpcurve);
|
||||
LLmaskexpshape->setResetCurve(FlatCurveType(defSpot.LLmaskexpcurve.at(0)), defSpot.LLmaskexpcurve);
|
||||
LLmaskexpshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP"));
|
||||
LLmaskexpshape->setBottomBarBgGradient(mllshape);
|
||||
|
||||
@ -451,7 +454,7 @@ Locallab::Locallab():
|
||||
HHmaskexpshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP"));
|
||||
HHmaskexpshape->setCurveColorProvider(this, 6);
|
||||
HHmaskexpshape->setBottomBarColorProvider(this, 6);
|
||||
|
||||
|
||||
maskexpCurveEditorG->curveListComplete();
|
||||
|
||||
ToolParamBlock* const exposeBox = Gtk::manage(new ToolParamBlock());
|
||||
@ -477,7 +480,7 @@ Locallab::Locallab():
|
||||
maskexpBox->pack_start(*blendmaskexp, Gtk::PACK_SHRINK, 0);
|
||||
maskexpFrame->add(*maskexpBox);
|
||||
exposeBox->pack_start(*maskexpFrame);
|
||||
|
||||
|
||||
expexpose->add(*exposeBox);
|
||||
expexpose->setLevel(2);
|
||||
|
||||
@ -552,21 +555,6 @@ Locallab::Locallab():
|
||||
|
||||
panel->pack_start(*expsoft, false, false);
|
||||
|
||||
// Lab Region
|
||||
explabregion->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), explabregion));
|
||||
enablelabregionConn = explabregion->signal_enabled_toggled().connect(sigc::bind(sigc::mem_fun(this, &Locallab::enableToggled), explabregion));
|
||||
|
||||
ToolParamBlock* const labRegionBox = Gtk::manage(new ToolParamBlock());
|
||||
explabregion->add(*labRegionBox);
|
||||
explabregion->setLevel(2);
|
||||
/*
|
||||
labRegionSlope = Gtk::manage(new Adjuster(M("TP_COLORTONING_LABREGION_SLOPE"), 0.1, 4.0, 0.001, 1));
|
||||
labRegionSlope->setLogScale(4, 0.1);
|
||||
labRegionSlope->setAdjusterListener(this);
|
||||
labRegionBox->pack_start(*labRegionSlope);
|
||||
*/
|
||||
// panel->pack_start(*explabregion, false, false);
|
||||
// labRegionSlope->delay = options.adjusterMaxDelay;
|
||||
|
||||
// Blur & Noise
|
||||
expblur->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expblur));
|
||||
@ -864,7 +852,6 @@ void Locallab::foldAllButMe(GdkEventButton* event, MyExpander *expander)
|
||||
expexpose->set_expanded(expexpose == expander);
|
||||
expvibrance->set_expanded(expvibrance == expander);
|
||||
expsoft->set_expanded(expsoft == expander);
|
||||
explabregion->set_expanded(explabregion == expander);
|
||||
expblur->set_expanded(expblur == expander);
|
||||
exptonemap->set_expanded(exptonemap == expander);
|
||||
expreti->set_expanded(expreti == expander);
|
||||
@ -895,9 +882,6 @@ void Locallab::enableToggled(MyExpander *expander)
|
||||
} else if (expander == expsoft) {
|
||||
event = EvLocenasoft;
|
||||
expConn = &enablesoftConn;
|
||||
} else if (expander == explabregion) {
|
||||
event = EvLocenalabregion;
|
||||
expConn = &enablelabregionConn;
|
||||
} else if (expander == expblur) {
|
||||
event = EvLocenablur;
|
||||
expConn = &enableblurConn;
|
||||
@ -950,7 +934,6 @@ void Locallab::writeOptions(std::vector<int> &tpOpen)
|
||||
tpOpen.push_back(expexpose->get_expanded());
|
||||
tpOpen.push_back(expvibrance->get_expanded());
|
||||
tpOpen.push_back(expsoft->get_expanded());
|
||||
tpOpen.push_back(explabregion->get_expanded());
|
||||
tpOpen.push_back(expblur->get_expanded());
|
||||
tpOpen.push_back(exptonemap->get_expanded());
|
||||
tpOpen.push_back(expreti->get_expanded());
|
||||
@ -961,37 +944,38 @@ void Locallab::writeOptions(std::vector<int> &tpOpen)
|
||||
|
||||
}
|
||||
|
||||
void Locallab::refChanged (double huer, double lumar, double chromar)
|
||||
void Locallab::refChanged(double huer, double lumar, double chromar)
|
||||
{
|
||||
nexthuer = huer;
|
||||
nextlumar = lumar / 100.f;
|
||||
nextchromar = chromar / 137.4f;
|
||||
float h = Color::huelab_to_huehsv2(nexthuer);
|
||||
h += 1.f/6.f;
|
||||
h += 1.f / 6.f;
|
||||
|
||||
if (h > 1.f) {
|
||||
h -= 1.f;
|
||||
}
|
||||
|
||||
nexthuer = h;
|
||||
//printf("nh=%f nl=%f nc=%f\n", nexthuer, nextlumar, nextchromar);
|
||||
|
||||
|
||||
idle_register.add(
|
||||
[this]() -> bool
|
||||
{
|
||||
GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected
|
||||
// FIXME: The above can't be true?!
|
||||
disableListener();
|
||||
enableListener();
|
||||
updateLabel();
|
||||
return false;
|
||||
}
|
||||
[this]() -> bool {
|
||||
GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected
|
||||
// FIXME: The above can't be true?!
|
||||
disableListener();
|
||||
enableListener();
|
||||
updateLabel();
|
||||
return false;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Locallab::updateLabel ()
|
||||
void Locallab::updateLabel()
|
||||
{
|
||||
if (!batchMode) {
|
||||
float nX, nY, nZ;
|
||||
@ -1000,17 +984,17 @@ void Locallab::updateLabel ()
|
||||
nX = nextchromar;
|
||||
nZ = nexthuer;
|
||||
{
|
||||
transLabels->set_text (
|
||||
Glib::ustring::compose (M ("TP_LOCALLAB_REFLABEL"),
|
||||
Glib::ustring::format (std::fixed, std::setprecision (3), nX),
|
||||
Glib::ustring::format (std::fixed, std::setprecision (3), nY),
|
||||
Glib::ustring::format (std::fixed, std::setprecision (3), nZ))
|
||||
transLabels->set_text(
|
||||
Glib::ustring::compose(M("TP_LOCALLAB_REFLABEL"),
|
||||
Glib::ustring::format(std::fixed, std::setprecision(3), nX),
|
||||
Glib::ustring::format(std::fixed, std::setprecision(3), nY),
|
||||
Glib::ustring::format(std::fixed, std::setprecision(3), nZ))
|
||||
);
|
||||
transLabels2->set_text (
|
||||
Glib::ustring::compose (M ("TP_LOCALLAB_REFLABEL"),
|
||||
Glib::ustring::format (std::fixed, std::setprecision (3), nX),
|
||||
Glib::ustring::format (std::fixed, std::setprecision (3), nY),
|
||||
Glib::ustring::format (std::fixed, std::setprecision (3), nZ))
|
||||
transLabels2->set_text(
|
||||
Glib::ustring::compose(M("TP_LOCALLAB_REFLABEL"),
|
||||
Glib::ustring::format(std::fixed, std::setprecision(3), nX),
|
||||
Glib::ustring::format(std::fixed, std::setprecision(3), nY),
|
||||
Glib::ustring::format(std::fixed, std::setprecision(3), nZ))
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1024,14 +1008,13 @@ void Locallab::updateToolState(std::vector<int> &tpOpen)
|
||||
expexpose->set_expanded(tpOpen.at(2));
|
||||
expvibrance->set_expanded(tpOpen.at(3));
|
||||
expsoft->set_expanded(tpOpen.at(4));
|
||||
explabregion->set_expanded(tpOpen.at(5));
|
||||
expblur->set_expanded(tpOpen.at(6));
|
||||
exptonemap->set_expanded(tpOpen.at(7));
|
||||
expreti->set_expanded(tpOpen.at(8));
|
||||
expsharp->set_expanded(tpOpen.at(9));
|
||||
expcontrast->set_expanded(tpOpen.at(10));
|
||||
expcbdl->set_expanded(tpOpen.at(11));
|
||||
expdenoi->set_expanded(tpOpen.at(12));
|
||||
expblur->set_expanded(tpOpen.at(5));
|
||||
exptonemap->set_expanded(tpOpen.at(6));
|
||||
expreti->set_expanded(tpOpen.at(7));
|
||||
expsharp->set_expanded(tpOpen.at(8));
|
||||
expcontrast->set_expanded(tpOpen.at(9));
|
||||
expcbdl->set_expanded(tpOpen.at(10));
|
||||
expdenoi->set_expanded(tpOpen.at(11));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1521,6 +1504,11 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited)
|
||||
pp->locallab.spots.at(pp->locallab.selspot).lightness = lightness->getIntValue();
|
||||
pp->locallab.spots.at(pp->locallab.selspot).contrast = contrast->getIntValue();
|
||||
pp->locallab.spots.at(pp->locallab.selspot).chroma = chroma->getIntValue();
|
||||
labgrid->getParams(pp->locallab.spots.at(pp->locallab.selspot).labgridALow, pp->locallab.spots.at(pp->locallab.selspot).labgridBLow, pp->locallab.spots.at(pp->locallab.selspot).labgridAHigh, pp->locallab.spots.at(pp->locallab.selspot).labgridBHigh);
|
||||
pp->locallab.spots.at(pp->locallab.selspot).labgridALow *= ColorToningParams::LABGRID_CORR_MAX;
|
||||
pp->locallab.spots.at(pp->locallab.selspot).labgridAHigh *= ColorToningParams::LABGRID_CORR_MAX;
|
||||
pp->locallab.spots.at(pp->locallab.selspot).labgridBLow *= ColorToningParams::LABGRID_CORR_MAX;
|
||||
pp->locallab.spots.at(pp->locallab.selspot).labgridBHigh *= ColorToningParams::LABGRID_CORR_MAX;
|
||||
pp->locallab.spots.at(pp->locallab.selspot).sensi = sensi->getIntValue();
|
||||
pp->locallab.spots.at(pp->locallab.selspot).structcol = structcol->getIntValue();
|
||||
pp->locallab.spots.at(pp->locallab.selspot).blurcolde = blurcolde->getIntValue();
|
||||
@ -1529,8 +1517,8 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited)
|
||||
pp->locallab.spots.at(pp->locallab.selspot).qualitycurveMethod = "none";
|
||||
} else if (qualitycurveMethod->get_active_row_number() == 1) {
|
||||
pp->locallab.spots.at(pp->locallab.selspot).qualitycurveMethod = "std";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
pp->locallab.spots.at(pp->locallab.selspot).llcurve = llshape->getCurve();
|
||||
pp->locallab.spots.at(pp->locallab.selspot).cccurve = ccshape->getCurve();
|
||||
pp->locallab.spots.at(pp->locallab.selspot).LHcurve = LHshape->getCurve();
|
||||
@ -1543,7 +1531,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited)
|
||||
pp->locallab.spots.at(pp->locallab.selspot).blendmaskcol = blendmaskcol->getIntValue();
|
||||
// Exposure
|
||||
pp->locallab.spots.at(pp->locallab.selspot).expexpose = expexpose->getEnabled();
|
||||
pp->locallab.spots.at(pp->locallab.selspot).expcomp = expcomp->getIntValue();
|
||||
pp->locallab.spots.at(pp->locallab.selspot).expcomp = expcomp->getValue();
|
||||
pp->locallab.spots.at(pp->locallab.selspot).hlcompr = hlcompr->getIntValue();
|
||||
pp->locallab.spots.at(pp->locallab.selspot).hlcomprthresh = hlcomprthresh->getIntValue();
|
||||
pp->locallab.spots.at(pp->locallab.selspot).black = black->getIntValue();
|
||||
@ -1574,8 +1562,6 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited)
|
||||
pp->locallab.spots.at(pp->locallab.selspot).expsoft = expsoft->getEnabled();
|
||||
pp->locallab.spots.at(pp->locallab.selspot).streng = streng->getIntValue();
|
||||
pp->locallab.spots.at(pp->locallab.selspot).sensisf = sensisf->getIntValue();
|
||||
// Lab Region
|
||||
pp->locallab.spots.at(pp->locallab.selspot).explabregion = explabregion->getEnabled();
|
||||
// Blur & Noise
|
||||
pp->locallab.spots.at(pp->locallab.selspot).expblur = expblur->getEnabled();
|
||||
pp->locallab.spots.at(pp->locallab.selspot).radius = radius->getIntValue();
|
||||
@ -1689,7 +1675,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited)
|
||||
pe->locallab.spots.at(pp->locallab.selspot).curvactiv = pe->locallab.spots.at(pp->locallab.selspot).curvactiv || !curvactiv->get_inconsistent();
|
||||
pe->locallab.spots.at(pp->locallab.selspot).lightness = pe->locallab.spots.at(pp->locallab.selspot).lightness || lightness->getEditedState();
|
||||
pe->locallab.spots.at(pp->locallab.selspot).contrast = pe->locallab.spots.at(pp->locallab.selspot).contrast || contrast->getEditedState();
|
||||
pe->locallab.spots.at(pp->locallab.selspot).chroma = pe->locallab.spots.at(pp->locallab.selspot).chroma || chroma->getEditedState();
|
||||
pe->locallab.spots.at(pp->locallab.selspot).labgridALow = pe->locallab.spots.at(pp->locallab.selspot).labgridBLow = pe->locallab.spots.at(pp->locallab.selspot).labgridAHigh = pe->locallab.spots.at(pp->locallab.selspot).labgridBHigh = labgrid->getEdited();
|
||||
pe->locallab.spots.at(pp->locallab.selspot).sensi = pe->locallab.spots.at(pp->locallab.selspot).sensi || sensi->getEditedState();
|
||||
pe->locallab.spots.at(pp->locallab.selspot).structcol = pe->locallab.spots.at(pp->locallab.selspot).structcol || structcol->getEditedState();
|
||||
pe->locallab.spots.at(pp->locallab.selspot).qualitycurveMethod = pe->locallab.spots.at(pp->locallab.selspot).qualitycurveMethod || qualitycurveMethod->get_active_text() != M("GENERAL_UNCHANGED");
|
||||
@ -1737,8 +1723,6 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited)
|
||||
pe->locallab.spots.at(pp->locallab.selspot).expsoft = pe->locallab.spots.at(pp->locallab.selspot).expsoft || !expsoft->get_inconsistent();
|
||||
pe->locallab.spots.at(pp->locallab.selspot).streng = pe->locallab.spots.at(pp->locallab.selspot).streng || streng->getEditedState();
|
||||
pe->locallab.spots.at(pp->locallab.selspot).sensisf = pe->locallab.spots.at(pp->locallab.selspot).sensisf || sensisf->getEditedState();
|
||||
// Lab Region
|
||||
pe->locallab.spots.at(pp->locallab.selspot).explabregion = pe->locallab.spots.at(pp->locallab.selspot).explabregion || !explabregion->get_inconsistent();
|
||||
// Blur & Noise
|
||||
pe->locallab.spots.at(pp->locallab.selspot).expblur = pe->locallab.spots.at(pp->locallab.selspot).expblur || !expblur->get_inconsistent();
|
||||
pe->locallab.spots.at(pp->locallab.selspot).radius = pe->locallab.spots.at(pp->locallab.selspot).radius || radius->getEditedState();
|
||||
@ -1887,8 +1871,6 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited)
|
||||
pedited->locallab.spots.at(pp->locallab.selspot).expsoft = pedited->locallab.spots.at(pp->locallab.selspot).expsoft || !expsoft->get_inconsistent();
|
||||
pedited->locallab.spots.at(pp->locallab.selspot).streng = pedited->locallab.spots.at(pp->locallab.selspot).streng || streng->getEditedState();
|
||||
pedited->locallab.spots.at(pp->locallab.selspot).sensisf = pedited->locallab.spots.at(pp->locallab.selspot).sensisf || sensisf->getEditedState();
|
||||
// Lab Region
|
||||
pedited->locallab.spots.at(pp->locallab.selspot).explabregion = pedited->locallab.spots.at(pp->locallab.selspot).explabregion || !explabregion->get_inconsistent();
|
||||
// Blur & Noise
|
||||
pedited->locallab.spots.at(pp->locallab.selspot).expblur = pedited->locallab.spots.at(pp->locallab.selspot).expblur || !expblur->get_inconsistent();
|
||||
pedited->locallab.spots.at(pp->locallab.selspot).radius = pedited->locallab.spots.at(pp->locallab.selspot).radius || radius->getEditedState();
|
||||
@ -2194,7 +2176,7 @@ void Locallab::qualitycurveMethodChanged()
|
||||
if (listener) {
|
||||
listener->panelChanged(EvlocallabqualitycurveMethod, qualitycurveMethod->get_active_text());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Locallab::showmaskcolMethodChanged()
|
||||
@ -2205,7 +2187,7 @@ void Locallab::showmaskcolMethodChanged()
|
||||
disableListener();
|
||||
showmaskexpMethod->set_active(0);
|
||||
enableListener();
|
||||
|
||||
|
||||
if (listener) {
|
||||
listener->panelChanged(EvlocallabshowmaskcolMethod, "");
|
||||
}
|
||||
@ -2219,7 +2201,7 @@ void Locallab::showmaskexpMethodChanged()
|
||||
disableListener();
|
||||
showmaskcolMethod->set_active(0);
|
||||
enableListener();
|
||||
|
||||
|
||||
if (listener) {
|
||||
listener->panelChanged(EvlocallabshowmaskexpMethod, "");
|
||||
}
|
||||
@ -2317,6 +2299,7 @@ void Locallab::inversChanged()
|
||||
structcol->show();
|
||||
blurcolde->show();
|
||||
showmaskcolMethod->hide(); // Being able to change Color & Light mask visibility is useless in batch mode
|
||||
gridFrame->hide();
|
||||
} else if (invers->get_active()) {
|
||||
sensi->show();
|
||||
llCurveEditorG->show();
|
||||
@ -2327,6 +2310,7 @@ void Locallab::inversChanged()
|
||||
maskcolFrame->hide();
|
||||
structcol->hide();
|
||||
blurcolde->show();
|
||||
gridFrame->hide();
|
||||
|
||||
} else {
|
||||
sensi->show();
|
||||
@ -2338,6 +2322,7 @@ void Locallab::inversChanged()
|
||||
maskcolFrame->show();
|
||||
structcol->show();
|
||||
blurcolde->show();
|
||||
gridFrame->show();
|
||||
|
||||
if (batchMode) {
|
||||
showmaskcolMethod->hide(); // Being able to change Color & Light mask visibility is useless in batch mode
|
||||
@ -2538,8 +2523,6 @@ void Locallab::setParamEditable(bool cond)
|
||||
expvibrance->set_sensitive(cond);
|
||||
// Soft Light
|
||||
expsoft->set_sensitive(cond);
|
||||
// Lab Region
|
||||
explabregion->set_sensitive(cond);
|
||||
// Blur & Noise
|
||||
expblur->set_sensitive(cond);
|
||||
// Tone Mapping
|
||||
@ -2599,12 +2582,14 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe
|
||||
lightness->setDefault((double)defSpot->lightness);
|
||||
contrast->setDefault((double)defSpot->contrast);
|
||||
chroma->setDefault((double)defSpot->chroma);
|
||||
labgrid->setDefault(defSpot->labgridALow / ColorToningParams::LABGRID_CORR_MAX, defSpot->labgridBLow / ColorToningParams::LABGRID_CORR_MAX, defSpot->labgridAHigh / ColorToningParams::LABGRID_CORR_MAX, defSpot->labgridBHigh / ColorToningParams::LABGRID_CORR_MAX);
|
||||
sensi->setDefault((double)defSpot->sensi);
|
||||
structcol->setDefault((double)defSpot->structcol);
|
||||
blurcolde->setDefault((double)defSpot->blurcolde);
|
||||
blendmaskcol->setDefault((double)defSpot->blendmaskcol);
|
||||
// Exposure
|
||||
expcomp->setDefault((double)defSpot->expcomp);
|
||||
// expcomp->setDefault((double)defSpot->expcomp);
|
||||
expcomp->setDefault(defSpot->expcomp);
|
||||
hlcompr->setDefault((double)defSpot->hlcompr);
|
||||
hlcomprthresh->setDefault((double)defSpot->hlcomprthresh);
|
||||
black->setDefault((double)defSpot->black);
|
||||
@ -2655,10 +2640,12 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe
|
||||
lcdarkness->setDefault((double)defSpot->lcdarkness);
|
||||
lclightness->setDefault((double)defSpot->lclightness);
|
||||
sensilc->setDefault((double)defSpot->sensilc);
|
||||
|
||||
// Contrast by detail levels
|
||||
for (int i = 0; i < 5; i++) {
|
||||
multiplier[i]->setDefault(defSpot->mult[i]);
|
||||
}
|
||||
|
||||
chromacbdl->setDefault((double)defSpot->chromacbdl);
|
||||
threshold->setDefault(defSpot->threshold);
|
||||
sensicb->setDefault((double)defSpot->sensicb);
|
||||
@ -2680,6 +2667,7 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe
|
||||
lightness->setDefaultEditedState(Irrelevant);
|
||||
contrast->setDefaultEditedState(Irrelevant);
|
||||
chroma->setDefaultEditedState(Irrelevant);
|
||||
labgrid->setEdited(Edited);
|
||||
sensi->setDefaultEditedState(Irrelevant);
|
||||
structcol->setDefaultEditedState(Irrelevant);
|
||||
blurcolde->setDefaultEditedState(Irrelevant);
|
||||
@ -2736,10 +2724,12 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe
|
||||
lcdarkness->setDefaultEditedState(Irrelevant);
|
||||
lclightness->setDefaultEditedState(Irrelevant);
|
||||
sensilc->setDefaultEditedState(Irrelevant);
|
||||
|
||||
// Contrast by detail levels
|
||||
for (int i = 0; i < 5; i++) {
|
||||
multiplier[i]->setDefaultEditedState(Irrelevant);
|
||||
}
|
||||
|
||||
chromacbdl->setDefaultEditedState(Irrelevant);
|
||||
threshold->setDefaultEditedState(Irrelevant);
|
||||
sensicb->setDefaultEditedState(Irrelevant);
|
||||
@ -2765,6 +2755,7 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe
|
||||
lightness->setDefaultEditedState(defSpotState->lightness ? Edited : UnEdited);
|
||||
contrast->setDefaultEditedState(defSpotState->contrast ? Edited : UnEdited);
|
||||
chroma->setDefaultEditedState(defSpotState->chroma ? Edited : UnEdited);
|
||||
labgrid->setEdited((defSpotState->labgridALow || defSpotState->labgridBLow || defSpotState->labgridAHigh || defSpotState->labgridBHigh) ? Edited : UnEdited);
|
||||
sensi->setDefaultEditedState(defSpotState->sensi ? Edited : UnEdited);
|
||||
structcol->setDefaultEditedState(defSpotState->structcol ? Edited : UnEdited);
|
||||
blurcolde->setDefaultEditedState(defSpotState->blurcolde ? Edited : UnEdited);
|
||||
@ -2821,10 +2812,12 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe
|
||||
lcdarkness->setDefaultEditedState(defSpotState->lcdarkness ? Edited : UnEdited);
|
||||
lclightness->setDefaultEditedState(defSpotState->lclightness ? Edited : UnEdited);
|
||||
sensilc->setDefaultEditedState(defSpotState->sensilc ? Edited : UnEdited);
|
||||
|
||||
// Contrast by detail levels
|
||||
for (int i = 0; i < 5; i++) {
|
||||
multiplier[i]->setDefaultEditedState(defSpotState->mult[i] ? Edited : UnEdited);
|
||||
}
|
||||
|
||||
chromacbdl->setDefaultEditedState(defSpotState->chromacbdl ? Edited : UnEdited);
|
||||
threshold->setDefaultEditedState(defSpotState->threshold ? Edited : UnEdited);
|
||||
sensicb->setDefaultEditedState(defSpotState->sensicb ? Edited : UnEdited);
|
||||
@ -2924,7 +2917,7 @@ void Locallab::adjusterChanged(Adjuster * a, double newval)
|
||||
listener->panelChanged(Evlocallabblendmaskcol, blendmaskcol->getTextValue());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Exposure
|
||||
@ -3046,17 +3039,6 @@ void Locallab::adjusterChanged(Adjuster * a, double newval)
|
||||
}
|
||||
}
|
||||
|
||||
//Lab region
|
||||
/*
|
||||
if (getEnabled() && explabregion->getEnabled()) {
|
||||
if (a == labRegionSlope) {
|
||||
if (listener) {
|
||||
listener->panelChanged(EvlocallablabRegionSlope, labRegionSlope->getTextValue());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
// Blur & Noise
|
||||
if (getEnabled() && expblur->getEnabled()) {
|
||||
@ -3443,6 +3425,7 @@ void Locallab::setBatchMode(bool batchMode)
|
||||
lcdarkness->showEditedCB();
|
||||
lclightness->showEditedCB();
|
||||
sensilc->showEditedCB();
|
||||
|
||||
// Contrast by detail levels
|
||||
for (int i = 0; i < 5; i++) {
|
||||
multiplier[i]->showEditedCB();
|
||||
@ -3577,15 +3560,17 @@ void Locallab::colorForValue(double valX, double valY, enum ColorCaller::ElemTyp
|
||||
Color::hsv2rgb01(h, 0.5f, 0.5f, R, G, B);
|
||||
} else if (callerId == 6) {
|
||||
// TODO
|
||||
float x = valX - 1.f/6.f;
|
||||
float x = valX - 1.f / 6.f;
|
||||
|
||||
if (x < 0.f) {
|
||||
x += 1.f;
|
||||
}
|
||||
|
||||
x = log2lin(x, 3.f);
|
||||
// float x = valX;
|
||||
Color::hsv2rgb01(x, 0.5f, 0.5f, R, G, B);
|
||||
Color::hsv2rgb01(x, 0.5f, 0.5f, R, G, B);
|
||||
} else if (callerId == 7) {
|
||||
Color::hsv2rgb01(float(valY), float(valX), 0.5f, R, G, B);
|
||||
Color::hsv2rgb01(float(valY), float(valX), 0.5f, R, G, B);
|
||||
}
|
||||
|
||||
caller->ccRed = double (R);
|
||||
@ -3596,6 +3581,7 @@ void Locallab::colorForValue(double valX, double valY, enum ColorCaller::ElemTyp
|
||||
void Locallab::setListener(ToolPanelListener* tpl)
|
||||
{
|
||||
this->listener = tpl;
|
||||
labgrid->setListener(tpl);
|
||||
expsettings->setListener(tpl);
|
||||
}
|
||||
|
||||
@ -3623,8 +3609,6 @@ void Locallab::enableListener()
|
||||
pastsattogconn.block(false);
|
||||
// Soft Light
|
||||
enablesoftConn.block(false);
|
||||
// Lab Region
|
||||
enablelabregionConn.block(false);
|
||||
// Blur & Noise
|
||||
enableblurConn.block(false);
|
||||
blurMethodConn.block(false);
|
||||
@ -3672,7 +3656,6 @@ void Locallab::disableListener()
|
||||
// Soft Light
|
||||
enablesoftConn.block(true);
|
||||
// Lab Region
|
||||
enablelabregionConn.block(true);
|
||||
// Blur & Noise
|
||||
enableblurConn.block(true);
|
||||
blurMethodConn.block(true);
|
||||
@ -3707,6 +3690,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con
|
||||
lightness->setValue(pp->locallab.spots.at(index).lightness);
|
||||
contrast->setValue(pp->locallab.spots.at(index).contrast);
|
||||
chroma->setValue(pp->locallab.spots.at(index).chroma);
|
||||
labgrid->setParams(pp->locallab.spots.at(index).labgridALow / ColorToningParams::LABGRID_CORR_MAX, pp->locallab.spots.at(index).labgridBLow / ColorToningParams::LABGRID_CORR_MAX, pp->locallab.spots.at(index).labgridAHigh / ColorToningParams::LABGRID_CORR_MAX, pp->locallab.spots.at(index).labgridBHigh / ColorToningParams::LABGRID_CORR_MAX, false);
|
||||
sensi->setValue(pp->locallab.spots.at(index).sensi);
|
||||
structcol->setValue(pp->locallab.spots.at(index).structcol);
|
||||
|
||||
@ -3714,7 +3698,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con
|
||||
qualitycurveMethod->set_active(0);
|
||||
} else if (pp->locallab.spots.at(index).qualitycurveMethod == "std") {
|
||||
qualitycurveMethod->set_active(1);
|
||||
}
|
||||
}
|
||||
|
||||
llshape->setCurve(pp->locallab.spots.at(index).llcurve);
|
||||
ccshape->setCurve(pp->locallab.spots.at(index).cccurve);
|
||||
@ -3764,8 +3748,6 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con
|
||||
streng->setValue(pp->locallab.spots.at(index).streng);
|
||||
sensisf->setValue(pp->locallab.spots.at(index).sensisf);
|
||||
|
||||
// Lab Region
|
||||
explabregion->setEnabled(pp->locallab.spots.at(index).explabregion);
|
||||
|
||||
// Blur & Noise
|
||||
expblur->setEnabled(pp->locallab.spots.at(index).expblur);
|
||||
@ -3901,6 +3883,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con
|
||||
chroma->setEditedState(spotState->chroma ? Edited : UnEdited);
|
||||
sensi->setEditedState(spotState->sensi ? Edited : UnEdited);
|
||||
structcol->setEditedState(spotState->structcol ? Edited : UnEdited);
|
||||
labgrid->setEdited(spotState->labgridALow || spotState->labgridBLow || spotState->labgridAHigh || spotState->labgridBHigh);
|
||||
|
||||
if (!spotState->qualitycurveMethod) {
|
||||
qualitycurveMethod->set_active_text(M("GENERAL_UNCHANGED"));
|
||||
@ -3954,8 +3937,6 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con
|
||||
streng->setEditedState(spotState->streng ? Edited : UnEdited);
|
||||
sensisf->setEditedState(spotState->sensisf ? Edited : UnEdited);
|
||||
|
||||
// Lab Region
|
||||
explabregion->set_inconsistent(!spotState->explabregion);
|
||||
|
||||
// Blur & Noise
|
||||
expblur->set_inconsistent(!spotState->expblur);
|
||||
@ -4057,6 +4038,7 @@ void Locallab::updateSpecificGUIState()
|
||||
structcol->show();
|
||||
blurcolde->show();
|
||||
showmaskcolMethod->hide(); // Being able to change Color & Light mask visibility is useless in batch mode
|
||||
gridFrame->hide();
|
||||
} else if (invers->get_active()) {
|
||||
sensi->show();
|
||||
llCurveEditorG->show();
|
||||
@ -4067,6 +4049,7 @@ void Locallab::updateSpecificGUIState()
|
||||
maskcolFrame->hide();
|
||||
structcol->hide();
|
||||
blurcolde->show();
|
||||
gridFrame->hide();
|
||||
} else {
|
||||
sensi->show();
|
||||
llCurveEditorG->show();
|
||||
@ -4077,6 +4060,8 @@ void Locallab::updateSpecificGUIState()
|
||||
maskcolFrame->show();
|
||||
structcol->show();
|
||||
blurcolde->show();
|
||||
gridFrame->show();
|
||||
|
||||
if (batchMode) {
|
||||
showmaskcolMethod->hide(); // Being able to change Color & Light mask visibility is useless in batch mode
|
||||
}
|
||||
@ -4102,13 +4087,14 @@ void Locallab::updateSpecificGUIState()
|
||||
maskexpFrame->show();
|
||||
structexp->show();
|
||||
blurexpde->show();
|
||||
|
||||
if (batchMode) {
|
||||
showmaskexpMethod->hide(); // Being able to change Color & Light mask visibility is useless in batch mode
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (multiImage && black->getEditedState() != Edited) {
|
||||
shcompr->set_sensitive(true);
|
||||
} else {
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "options.h"
|
||||
#include "thresholdadjuster.h"
|
||||
#include "controlspotpanel.h"
|
||||
#include "labgrid.h"
|
||||
|
||||
class Locallab :
|
||||
public ToolParamBlock,
|
||||
@ -51,7 +52,6 @@ private:
|
||||
MyExpander* const expexpose;
|
||||
MyExpander* const expvibrance;
|
||||
MyExpander* const expsoft;
|
||||
MyExpander* const explabregion;
|
||||
MyExpander* const expblur;
|
||||
MyExpander* const exptonemap;
|
||||
MyExpander* const expreti;
|
||||
@ -59,7 +59,7 @@ private:
|
||||
MyExpander* const expcontrast;
|
||||
MyExpander* const expcbdl;
|
||||
MyExpander* const expdenoi;
|
||||
sigc::connection enablecolorConn, enableexposeConn, enablevibranceConn, enablesoftConn, enablelabregionConn, enableblurConn, enabletonemapConn, enableretiConn, enablesharpConn, enablecontrastConn, enablecbdlConn, enabledenoiConn;
|
||||
sigc::connection enablecolorConn, enableexposeConn, enablevibranceConn, enablesoftConn, enableblurConn, enabletonemapConn, enableretiConn, enablesharpConn, enablecontrastConn, enablecbdlConn, enabledenoiConn;
|
||||
|
||||
// Curve widgets
|
||||
// Color & Light
|
||||
@ -223,7 +223,8 @@ private:
|
||||
Gtk::Label* transLabels2;
|
||||
Gtk::Frame* maskcolFrame;
|
||||
Gtk::Frame* maskexpFrame;
|
||||
|
||||
Gtk::Frame* gridFrame;
|
||||
LabGrid *labgrid;
|
||||
// Others
|
||||
/**
|
||||
* Used to store the default ProcParams when setDefaults function is called
|
||||
@ -290,43 +291,6 @@ private:
|
||||
double nextlumar;
|
||||
double nextchromar;
|
||||
|
||||
/*
|
||||
void onLabRegionSelectionChanged();
|
||||
void labRegionAddPressed();
|
||||
void labRegionRemovePressed();
|
||||
void labRegionUpPressed();
|
||||
void labRegionDownPressed();
|
||||
void labRegionCopyPressed();
|
||||
void labRegionShowMaskChanged();
|
||||
void labRegionChannelChanged();
|
||||
void labRegionPopulateList();
|
||||
void labRegionShow(int idx, bool list_only=false);
|
||||
void labRegionGet(int idx);
|
||||
|
||||
Gtk::VBox *labRegionBox;
|
||||
Gtk::ListViewText *labRegionList;
|
||||
Gtk::Button *labRegionAdd;
|
||||
Gtk::Button *labRegionRemove;
|
||||
Gtk::Button *labRegionUp;
|
||||
Gtk::Button *labRegionDown;
|
||||
Gtk::Button *labRegionCopy;
|
||||
LabGrid *labRegionAB;
|
||||
Adjuster *labRegionSaturation;
|
||||
*/
|
||||
// Adjuster *labRegionSlope;
|
||||
/*
|
||||
Adjuster *labRegionOffset;
|
||||
Adjuster *labRegionPower;
|
||||
MyComboBoxText *labRegionChannel;
|
||||
FlatCurveEditor *labRegionHueMask;
|
||||
FlatCurveEditor *labRegionChromaticityMask;
|
||||
FlatCurveEditor *labRegionLightnessMask;
|
||||
Adjuster *labRegionMaskBlur;
|
||||
Gtk::CheckButton *labRegionShowMask;
|
||||
std::vector<rtengine::ColorToningParams::LabCorrectionRegion> labRegionData;
|
||||
int labRegionSelected;
|
||||
sigc::connection labRegionSelectionConn;
|
||||
*/
|
||||
|
||||
public:
|
||||
Locallab();
|
||||
|
@ -948,6 +948,10 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
|
||||
locallab.spots.at(j).lightness = locallab.spots.at(j).lightness && pSpot.lightness == otherSpot.lightness;
|
||||
locallab.spots.at(j).contrast = locallab.spots.at(j).contrast && pSpot.contrast == otherSpot.contrast;
|
||||
locallab.spots.at(j).chroma = locallab.spots.at(j).chroma && pSpot.chroma == otherSpot.chroma;
|
||||
locallab.spots.at(j).labgridALow = locallab.spots.at(j).labgridALow && pSpot.labgridALow == otherSpot.labgridALow;
|
||||
locallab.spots.at(j).labgridBLow = locallab.spots.at(j).labgridBLow && pSpot.labgridBLow == otherSpot.labgridBLow;
|
||||
locallab.spots.at(j).labgridAHigh = locallab.spots.at(j).labgridAHigh && pSpot.labgridAHigh == otherSpot.labgridAHigh;
|
||||
locallab.spots.at(j).labgridBHigh = locallab.spots.at(j).labgridBHigh && pSpot.labgridBHigh == otherSpot.labgridBHigh;
|
||||
locallab.spots.at(j).sensi = locallab.spots.at(j).sensi && pSpot.sensi == otherSpot.sensi;
|
||||
locallab.spots.at(j).structcol = locallab.spots.at(j).structcol && pSpot.structcol == otherSpot.structcol;
|
||||
locallab.spots.at(j).blurcolde = locallab.spots.at(j).blurcolde && pSpot.blurcolde == otherSpot.blurcolde;
|
||||
@ -2585,6 +2589,19 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
|
||||
toEdit.locallab.spots.at(i).chroma = mods.locallab.spots.at(i).chroma;
|
||||
}
|
||||
|
||||
if (locallab.spots.at(i).labgridALow) {
|
||||
toEdit.locallab.spots.at(i).labgridALow = mods.locallab.spots.at(i).labgridALow;
|
||||
}
|
||||
if (locallab.spots.at(i).labgridBLow) {
|
||||
toEdit.locallab.spots.at(i).labgridBLow = mods.locallab.spots.at(i).labgridBLow;
|
||||
}
|
||||
if (locallab.spots.at(i).labgridAHigh) {
|
||||
toEdit.locallab.spots.at(i).labgridAHigh = mods.locallab.spots.at(i).labgridAHigh;
|
||||
}
|
||||
if (locallab.spots.at(i).labgridBHigh) {
|
||||
toEdit.locallab.spots.at(i).labgridBHigh = mods.locallab.spots.at(i).labgridBHigh;
|
||||
}
|
||||
|
||||
if (locallab.spots.at(i).sensi) {
|
||||
toEdit.locallab.spots.at(i).sensi = mods.locallab.spots.at(i).sensi;
|
||||
}
|
||||
@ -3961,6 +3978,10 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) :
|
||||
lightness(v),
|
||||
contrast(v),
|
||||
chroma(v),
|
||||
labgridALow(v),
|
||||
labgridBLow(v),
|
||||
labgridAHigh(v),
|
||||
labgridBHigh(v),
|
||||
sensi(v),
|
||||
structcol(v),
|
||||
blurcolde(v),
|
||||
@ -4103,6 +4124,10 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v)
|
||||
lightness = v;
|
||||
contrast = v;
|
||||
chroma = v;
|
||||
labgridALow = v;
|
||||
labgridBLow = v;
|
||||
labgridAHigh = v;
|
||||
labgridBHigh = v;
|
||||
sensi = v;
|
||||
structcol = v;
|
||||
blurcolde = v;
|
||||
|
@ -487,6 +487,10 @@ public:
|
||||
bool lightness;
|
||||
bool contrast;
|
||||
bool chroma;
|
||||
bool labgridALow;
|
||||
bool labgridBLow;
|
||||
bool labgridAHigh;
|
||||
bool labgridBHigh;
|
||||
bool sensi;
|
||||
bool structcol;
|
||||
bool blurcolde;
|
||||
|
Loading…
x
Reference in New Issue
Block a user