Saving of Locallab tool parameters in .pp3 file

- Control spot panel parameters are now saved in .pp3 file
- Control spot curved are now visible when Locallab tool panel is
active, not visible otherwise

Limitations:
- Other Locallab tool parameters aren't saved in .pp3 file yet
- Locallab tools are temporary deactivated (time to end procparam
update)
This commit is contained in:
Pandagrapher 2018-07-26 19:20:33 +02:00
parent 74dd3a6a10
commit a31393adb1
21 changed files with 2913 additions and 2817 deletions

View File

@ -741,6 +741,25 @@ HISTORY_MSG_490;DRC - Amount
HISTORY_MSG_491;White Balance
HISTORY_MSG_492;RGB Curves
HISTORY_MSG_493;L*a*b* Adjustments
HISTORY_MSG_495;L*a*b Spot created
HISTORY_MSG_496;L*a*b Spot deleted
HISTORY_MSG_497;L*a*b Spot selected
HISTORY_MSG_498;L*a*b Spot name
HISTORY_MSG_499;L*a*b Spot visibility
HISTORY_MSG_500;L*a*b Spot shape
HISTORY_MSG_501;L*a*b Spot method
HISTORY_MSG_502;L*a*b Spot shape method
HISTORY_MSG_503;L*a*b Spot locX
HISTORY_MSG_504;L*a*b Spot locXL
HISTORY_MSG_505;L*a*b Spot locY
HISTORY_MSG_506;L*a*b Spot locYT
HISTORY_MSG_507;L*a*b Spot center
HISTORY_MSG_508;L*a*b Spot circrad
HISTORY_MSG_509;L*a*b Spot quality method
HISTORY_MSG_510;L*a*b Spot transit
HISTORY_MSG_511;L*a*b Spot thresh
HISTORY_MSG_512;L*a*b Spot iter
HISTORY_MSG_CLAMPOOG;Out-of-gamut color clipping
HISTORY_MSG_LOCLOCX;Local - Right
HISTORY_MSG_LOCCENTER;Local - Center

View File

@ -890,6 +890,8 @@ void Crop::update(int todo)
// bool tyty = false;
int maxspot = settings->nspot + 1;
// TODO Locallab
/*
if (needslocal) {
// if (tyty ) {
@ -1775,6 +1777,7 @@ void Crop::update(int todo)
}
}
*/
// int moderetinex;
// parent->ipf.MSR(labnCrop, labnCrop->W, labnCrop->H, 1);
@ -2037,6 +2040,7 @@ void Crop::freeAll()
PipetteBuffer::flush();
}
cropAllocated = false;
}
@ -2229,6 +2233,7 @@ bool Crop::setCropSizes(int rcx, int rcy, int rcw, int rch, int skip, bool inter
if (shbuffer) {
delete [] shbuffer;
}
if (shbuf_real) {
delete [] shbuf_real;
}

View File

@ -280,6 +280,7 @@ DetailedCrop* ImProcCoordinator::createCrop(::EditDataProvider *editDataProvider
// cropCall: calling crop, used to prevent self-updates ...doesn't seem to be used
void ImProcCoordinator::updatePreviewImage(int todo, Crop* cropCall)
{
printf("updatePreviewImage\n");
MyMutex::MyLock processingLock(mProcessing);
int numofphases = 14;
@ -774,7 +775,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, Crop* cropCall)
int maxspot = settings->nspot + 1;
progress("Applying Color Boost...", 100 * readyphase / numofphases);
// TODO Locallab
if (params.locallab.enabled) {
/*
* This file is part of RawTherapee.
@ -796,7 +797,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, Crop* cropCall)
* 2017 2018 Jacques Desmis <jdesmis@gmail.com>
*/
/*
//*********************************************************
//advertissment
//we can probably put all these function outside main process
@ -807,10 +808,21 @@ void ImProcCoordinator::updatePreviewImage(int todo, Crop* cropCall)
//there are probably errors...
//***********************************************************
bool isascii = true;
// Get image file MD5
std::string mdfive = getMD5(imgsrc->getFileName());
// Check if new image file has been loaded
bool newimage = false;
if (prevmdfive == "" || prevmdfive != mdfive) {
printf("New image loaded\n");
newimage = true;
prevmdfive = mdfive;
}
// Check if destination folder is writable and get .mip file path
if (newimage) { // To avoid systematic access to hard disk
bool isascii = true;
Glib::ustring datainterm = imgsrc->getFileName() + ".ii";//extansion ii arbitrary to test if mip file is possible
ofstream finterm(datainterm, ios::out);
@ -834,8 +846,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, Crop* cropCall)
Glib::ustring pop = options.cacheBaseDir + "/mip/";
Glib::ustring datal;
if (options.mip == MI_opt || !isascii) {
datal = pop + Glib::path_get_basename(imgsrc->getFileName() + "." + mdfive + ".mip");
}
@ -843,7 +853,10 @@ void ImProcCoordinator::updatePreviewImage(int todo, Crop* cropCall)
if (options.mip == MI_prev && isascii) {//&& isascii
datal = imgsrc->getFileName() + ".mip";
}
}
printf("mip files in=%s\n", datal.c_str());
*/
/*
//test to see if wofstream and wifstream works with NON ASCII, but it's bad
wofstream test(datal, ios::out);
@ -851,9 +864,9 @@ void ImProcCoordinator::updatePreviewImage(int todo, Crop* cropCall)
else ("ca va bien\n");
test.close();
*/
/*
ifstream fic0(datal, ios::in);
printf("mip files in=%s\n", datal.c_str());
// if(! fic0.fail()) {
float **shbuffer = nullptr;
versionmip = 0;
@ -1223,7 +1236,8 @@ void ImProcCoordinator::updatePreviewImage(int todo, Crop* cropCall)
skinstr = new std::string[maxspot];
pthstr = new std::string[maxspot];
exstr = new std::string[maxspot];
*/
/*
//******************************************************************
//initialize data[xx][0] and Lut cache with params
//******************************************************************
@ -3711,8 +3725,9 @@ void ImProcCoordinator::updatePreviewImage(int todo, Crop* cropCall)
delete [] buffer;
readyphase++;
}
}
*/
}
if (params.dirpyrequalizer.cbdlMethod == "aft") {
if (((params.colorappearance.enabled && !settings->autocielab) || (!params.colorappearance.enabled))) {
progress("Pyramid wavelet...", 100 * readyphase / numofphases);

View File

@ -242,6 +242,8 @@ protected:
bool HHutili;
bool curveutili;
std::string prevmdfive;
Glib::ustring datal;
int **dataspot;
int maxdata;
std::string *retistr;
@ -252,6 +254,7 @@ protected:
std::string *skinstr;
std::string *pthstr;
std::string *exstr;
std::string *name;
LUTi circrads;
LUTi centerx;

View File

@ -47,7 +47,8 @@
#undef CLIPD
#define CLIPD(a) ((a)>0.0f?((a)<1.0f?(a):1.0f):0.0f)
namespace {
namespace
{
using namespace rtengine;
@ -216,11 +217,13 @@ void customToneCurve(const ToneCurve &customToneCurve, ToneCurveParams::TcMode c
if (curveMode == ToneCurveParams::TcMode::STD) { // Standard
const StandardToneCurve& userToneCurve = static_cast<const StandardToneCurve&>(customToneCurve);
for (int i = istart, ti = 0; i < tH; i++, ti++) {
userToneCurve.BatchApply(0, tW - jstart, &rtemp[ti * tileSize], &gtemp[ti * tileSize], &btemp[ti * tileSize]);
}
} else if (curveMode == ToneCurveParams::TcMode::FILMLIKE) { // Adobe like
const AdobeToneCurve& userToneCurve = static_cast<const AdobeToneCurve&>(customToneCurve);
for (int i = istart, ti = 0; i < tH; i++, ti++) {
for (int j = jstart, tj = 0; j < tW; j++, tj++) {
userToneCurve.Apply(rtemp[ti * tileSize + tj], gtemp[ti * tileSize + tj], btemp[ti * tileSize + tj]);
@ -228,6 +231,7 @@ void customToneCurve(const ToneCurve &customToneCurve, ToneCurveParams::TcMode c
}
} else if (curveMode == ToneCurveParams::TcMode::SATANDVALBLENDING) { // apply the curve on the saturation and value channels
const SatAndValueBlendingToneCurve& userToneCurve = static_cast<const SatAndValueBlendingToneCurve&>(customToneCurve);
for (int i = istart, ti = 0; i < tH; i++, ti++) {
for (int j = jstart, tj = 0; j < tW; j++, tj++) {
userToneCurve.Apply(rtemp[ti * tileSize + tj], gtemp[ti * tileSize + tj], btemp[ti * tileSize + tj]);
@ -235,6 +239,7 @@ void customToneCurve(const ToneCurve &customToneCurve, ToneCurveParams::TcMode c
}
} else if (curveMode == ToneCurveParams::TcMode::WEIGHTEDSTD) { // apply the curve to the rgb channels, weighted
const WeightedStdToneCurve& userToneCurve = static_cast<const WeightedStdToneCurve&>(customToneCurve);
for (int i = istart, ti = 0; i < tH; i++, ti++) {
userToneCurve.BatchApply(0, tW - jstart, &rtemp[ti * tileSize], &gtemp[ti * tileSize], &btemp[ti * tileSize]);
}
@ -248,6 +253,7 @@ void customToneCurve(const ToneCurve &customToneCurve, ToneCurveParams::TcMode c
}
} else if (curveMode == ToneCurveParams::TcMode::PERCEPTUAL) { // apply curve while keeping color appearance constant
const PerceptualToneCurve& userToneCurve = static_cast<const PerceptualToneCurve&>(customToneCurve);
for (int i = istart, ti = 0; i < tH; i++, ti++) {
userToneCurve.BatchApply(0, tW - jstart, &rtemp[ti * tileSize], &gtemp[ti * tileSize], &btemp[ti * tileSize], ptcApplyState);
}
@ -295,6 +301,7 @@ void ImProcFunctions::updateColorProfiles(const Glib::ustring& monitorProfile, R
if (monitorTransform) {
cmsDeleteTransform(monitorTransform);
}
gamutWarning.reset(nullptr);
monitorTransform = nullptr;
@ -328,15 +335,19 @@ void ImProcFunctions::updateColorProfiles(const Glib::ustring& monitorProfile, R
if (!settings->printerProfile.empty()) {
oprof = ICCStore::getInstance()->getProfile(settings->printerProfile);
if (settings->printerBPC) {
flags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
}
outIntent = settings->printerIntent;
} else {
oprof = ICCStore::getInstance()->getProfile(params->icm.output);
if (params->icm.outputBPC) {
flags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
}
outIntent = params->icm.outputIntent;
}
@ -361,9 +372,11 @@ void ImProcFunctions::updateColorProfiles(const Glib::ustring& monitorProfile, R
if (gamutCheck) {
gamutprof = oprof;
if (params->icm.outputBPC) {
gamutbpc = cmsFLAGS_BLACKPOINTCOMPENSATION;
}
gamutintent = outIntent;
}
}
@ -379,9 +392,11 @@ void ImProcFunctions::updateColorProfiles(const Glib::ustring& monitorProfile, R
// softProofCreated = true;
// }
gamutprof = monitor;
if (settings->monitorBPC) {
gamutbpc = cmsFLAGS_BLACKPOINTCOMPENSATION;
}
gamutintent = monitorIntent;
}
@ -2464,6 +2479,7 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer
if (OOG(r) || OOG(g) || OOG(b)) {
filmlike_clip(&r, &g, &b);
}
rtemp[ti * TS + tj] = r;
gtemp[ti * TS + tj] = g;
btemp[ti * TS + tj] = b;
@ -2480,6 +2496,7 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer
if (OOG(max(r, g, b)) && !OOG(min(r, g, b))) {
filmlike_clip(&r, &g, &b);
}
setUnlessOOG(rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj], r, g, b);
}
}
@ -2514,6 +2531,7 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer
STVF(tmpr[0], tonecurve(LVF(rtemp[ti * TS + tj])));
STVF(tmpg[0], tonecurve(LVF(gtemp[ti * TS + tj])));
STVF(tmpb[0], tonecurve(LVF(btemp[ti * TS + tj])));
for (int k = 0; k < 4; ++k) {
setUnlessOOG(rtemp[ti * TS + tj + k], gtemp[ti * TS + tj + k], btemp[ti * TS + tj + k], tmpr[k], tmpg[k], tmpb[k]);
}
@ -2679,11 +2697,13 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer
if (sat != 0 || hCurveEnabled || sCurveEnabled || vCurveEnabled) {
const float satby100 = sat / 100.f;
for (int i = istart, ti = 0; i < tH; i++, ti++) {
for (int j = jstart, tj = 0; j < tW; j++, tj++) {
float h, s, v;
Color::rgb2hsvtc(rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj], h, s, v);
h /= 6.f;
if (sat > 0) {
s = std::max(0.f, intp(satby100, 1.f - SQR(SQR(1.f - std::min(s, 1.0f))), s));
} else { /*if (sat < 0)*/
@ -2783,6 +2803,7 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer
const float kbh = bh / (rh + gh + bh);
strProtect = pow_F(strProtect, 0.4f);
constexpr int mode = 0;
for (int i = istart, ti = 0; i < tH; i++, ti++) {
for (int j = jstart, tj = 0; j < tW; j++, tj++) {
toning2col(rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj], rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj], iplow, iphigh, krl, kgl, kbl, krh, kgh, kbh, SatLow, SatHigh, balanS, balanH, reducac, mode, preser, strProtect);
@ -2795,6 +2816,7 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer
constexpr float reducac = 0.3f;
constexpr int mode = 0;
strProtect = pow_F(strProtect, 0.4f);
for (int i = istart, ti = 0; i < tH; i++, ti++) {
for (int j = jstart, tj = 0; j < tW; j++, tj++) {
const float r = rtemp[ti * TS + tj];
@ -3230,6 +3252,7 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer
for (int i = istart, ti = 0; i < tH; i++, ti++) {
Color::RGB2Lab(&rtemp[ti * TS], &gtemp[ti * TS], &btemp[ti * TS], &(lab->L[i][jstart]), &(lab->a[i][jstart]), &(lab->b[i][jstart]), toxyz, tW - jstart);
}
if (hasColorToningLabGrid) {
colorToningLabGrid(lab, jstart, tW, istart, tH, false);
}
@ -3611,6 +3634,7 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer
for (int i = 0; i < tH; i++) {
Color::RGB2Lab(tmpImage->r(i), tmpImage->g(i), tmpImage->b(i), lab->L[i], lab->a[i], lab->b[i], toxyz, tW);
if (hasColorToningLabGrid) {
colorToningLabGrid(lab, 0, tW, i, i + 1, false);
}
@ -3769,6 +3793,7 @@ void ImProcFunctions::toningsmh(float r, float g, float b, float &ro, float &go,
rlob = strProtect; //0.5
rlm = strProtect * 2.2f; //1.1
rlh = strProtect * 2.4f; //1.2
if (v > 0.15f) {
kl = (-1.f / 0.85f) * v + 1.f / 0.85f; //Low light ==> decrease action after v=0.15
}
@ -3776,6 +3801,7 @@ void ImProcFunctions::toningsmh(float r, float g, float b, float &ro, float &go,
{
const float corr = 20000.f * RedLow * kl * rlo;
if (RedLow > 0.f) {
g -= corr;
b -= corr;
@ -3790,6 +3816,7 @@ void ImProcFunctions::toningsmh(float r, float g, float b, float &ro, float &go,
{
const float corr = 20000.f * GreenLow * kl * rlo;
if (GreenLow > 0.f) {
r -= corr;
b -= corr;
@ -3846,6 +3873,7 @@ void ImProcFunctions::toningsmh(float r, float g, float b, float &ro, float &go,
g -= 20000.f * RedM;
b -= 20000.f * RedM;
}
// r = CLIP(r);
// g = CLIP(g);
// b = CLIP(b);
@ -3863,6 +3891,7 @@ void ImProcFunctions::toningsmh(float r, float g, float b, float &ro, float &go,
g += 10000.f * GreenM;
b -= 20000.f * GreenM;
}
// r = CLIP(r);
// g = CLIP(g);
// b = CLIP(b);
@ -3880,6 +3909,7 @@ void ImProcFunctions::toningsmh(float r, float g, float b, float &ro, float &go,
g -= 20000.f * BlueM;
b += 10000.f * BlueM;
}
// r = CLIP(r);
// g = CLIP(g);
// b = CLIP(b);
@ -3891,6 +3921,7 @@ void ImProcFunctions::toningsmh(float r, float g, float b, float &ro, float &go,
secondeg_begin(reducac, v00, aa0, bb0);
float kh;
if (v > v00) { //max action
kh = (1.f - v) / (1.f - v00); //High tones
} else {
@ -3978,12 +4009,15 @@ void ImProcFunctions::toning2col (float r, float g, float b, float &ro, float &g
if (SatLow > 0.f) {
float kl = 1.f;
if (v > iplow) {
kl = aa * v * v + bb * v + cc;
} else if (mode == 0) {
kl = aab * v * v + bbb * v;
}
const float kmgb = min(r, g, b);
if (kmgb < 20000.f) {
//I have tested ...0.85 compromise...
kl *= pow_F((kmgb / 20000.f), 0.85f);
@ -4023,6 +4057,7 @@ void ImProcFunctions::toning2col (float r, float g, float b, float &ro, float &g
if (SatHigh > 0.f) {
float kh = 1.f;
if (v > iphigh) {
kh = (1.f - v) / (1.f - iphigh); //Low light ==> decrease action after iplow
} else {
@ -4030,11 +4065,13 @@ void ImProcFunctions::toning2col (float r, float g, float b, float &ro, float &g
}
const float kmgb = max(r, g, b);
if (kmgb > 45535.f) {
constexpr float cora = 1.f / (45535.f - 65535.f);
constexpr float corb = 1.f - cora * 45535.f;
kh *= kmgb * cora + corb;
}
const float factor = 20000.f * SatHigh * kh * rlh * balanH;
r += factor * (krh > 0.f ? krh : 0.f);
g += factor * (kgh > 0.f ? kgh : 0.f);
@ -4046,6 +4083,7 @@ void ImProcFunctions::toning2col (float r, float g, float b, float &ro, float &g
}
float preserv = 1.f;
if (preser == 1) {
float lumafter = 0.299f * r + 0.587f * g + 0.114f * b;
preserv = lumbefore / lumafter;
@ -4155,6 +4193,7 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW
}
}
}
return;
}
@ -5187,12 +5226,19 @@ void ImProcFunctions::EPDToneMapCIE(CieImage *ncie, float a_w, float c_, int Wid
void ImProcFunctions::EPDToneMaplocal(LabImage *lab, LabImage *tmp1, unsigned int Iterates, int skip)
{
// TODO Locallab
/*
float stren = ((float)params->locallab.stren) / 100.f;
float edgest = ((float)params->locallab.estop) / 100.f;
float sca = ((float)params->locallab.scaltm) / 10.f;
float gamm = ((float)params->locallab.gamma) / 100.f;
float rew = ((float)params->locallab.rewei);
*/
float stren = 0.f;
float edgest = 0.f;
float sca = 0.f;
float gamm = 0.f;
float rew = 0.f;
//Pointers to whole data and size of it.
float *L = lab->L[0];
float *a = lab->a[0];
@ -5879,6 +5925,7 @@ void ImProcFunctions::colorToningLabGrid(LabImage *lab, int xstart, int xend, in
#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;

View File

@ -329,6 +329,8 @@ static void SobelCannyLuma(float **sobelL, float **luma, int bfw, int bfh, float
static void calcLocalParams(int oW, int oH, const LocallabParams& locallab, struct local_params& lp)
{
// TODO Locallab
/*
int w = oW;
int h = oH;
int circr = locallab.circrad;
@ -526,6 +528,7 @@ static void calcLocalParams(int oW, int oH, const LocallabParams& locallab, stru
lp.sensex = local_sensiex;
lp.strucc = local_struc;
lp.war = local_warm;
*/
}
@ -760,11 +763,14 @@ void ImProcFunctions::ciecamloc_02float(LabImage* lab, LabImage* dest)
int tempo;
// TODO Locallab
/*
if (params->locallab.warm > 0) {
tempo = 5000 - 30 * params->locallab.warm;
} else {
tempo = 5000 - 49 * params->locallab.warm;
}
*/
ColorTemp::temp2mulxyz(params->wb.temperature, params->wb.method, Xw, Zw); //compute white Xw Yw Zw : white current WB
ColorTemp::temp2mulxyz(tempo, "Custom", Xwout, Zwout);
@ -1026,6 +1032,8 @@ void ImProcFunctions::ciecamloc_02float(LabImage* lab, LabImage* dest)
void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage* dest, bool & localskutili, LUTf & sklocalcurve)
{
// TODO Locallab
/*
if (!params->locallab.expvibrance) {
return;
}
@ -1185,7 +1193,7 @@ void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage*
//blue: -1.80 -3.14 green = 2.1 3.14 green-yellow=1.4 2.1 red:0 1.4 blue-purple:-0.7 -1.4 purple: 0 -0.7
//these values allow a better and differential response
if (LL < 20.0f) { //more for blue-purple, blue and red modulate
if (/*HH> -3.1415f &&*/ HH < -1.5f) {
if (/*HH> -3.1415f &&*//* HH < -1.5f) {
sathue[0] = 1.3f; //blue
sathue[1] = 1.2f;
sathue[2] = 1.1f;
@ -1195,7 +1203,7 @@ void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage*
sathue2[1] = 1.1f ;
sathue2[2] = 1.05f;
sathue2[3] = 1.0f;
} else if (/*HH>=-1.5f &&*/ HH < -0.7f) {
} else if (/*HH>=-1.5f &&*//* HH < -0.7f) {
sathue[0] = 1.6f; //blue purple 1.2 1.1
sathue[1] = 1.4f;
sathue[2] = 1.3f;
@ -1205,7 +1213,7 @@ void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage*
sathue2[1] = 1.15f;
sathue2[2] = 1.1f ;
sathue2[3] = 1.0f;
} else if (/*HH>=-0.7f &&*/ HH < 0.0f) {
} else if (/*HH>=-0.7f &&*//* HH < 0.0f) {
sathue[0] = 1.2f; //purple
sathue[1] = 1.0f;
sathue[2] = 1.0f;
@ -1217,7 +1225,7 @@ void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage*
sathue2[3] = 1.0f;
}
// else if( HH>= 0.0f && HH<= 1.4f ) {sathue[0]=1.1f;sathue[1]=1.1f;sathue[2]=1.1f;sathue[3]=1.0f ;sathue[4]=0.4f;sathue2[0]=1.0f ;sathue2[1]=1.0f ;sathue2[2]=1.0f ;sathue2[3]=1.0f;}//red 0.8 0.7
else if (/*HH>= 0.0f &&*/ HH <= 1.4f) {
else if (/*HH>= 0.0f &&*//* HH <= 1.4f) {
sathue[0] = 1.3f; //red 0.8 0.7
sathue[1] = 1.2f;
sathue[2] = 1.1f;
@ -1227,7 +1235,7 @@ void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage*
sathue2[1] = 1.0f ;
sathue2[2] = 1.0f ;
sathue2[3] = 1.0f;
} else if (/*HH> 1.4f &&*/ HH <= 2.1f) {
} else if (/*HH> 1.4f &&*//* HH <= 2.1f) {
sathue[0] = 1.0f; //green yellow 1.2 1.1
sathue[1] = 1.0f;
sathue[2] = 1.0f;
@ -1237,7 +1245,7 @@ void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage*
sathue2[1] = 1.0f ;
sathue2[2] = 1.0f ;
sathue2[3] = 1.0f;
} else { /*if(HH> 2.1f && HH<= 3.1415f)*/
} else { /*if(HH> 2.1f && HH<= 3.1415f)*//*
sathue[0] = 1.4f; //green
sathue[1] = 1.3f;
sathue[2] = 1.2f;
@ -1249,7 +1257,7 @@ void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage*
sathue2[3] = 1.0f;
}
} else if (LL < 50.0f) { //more for blue and green, less for red and green-yellow
if (/*HH> -3.1415f &&*/ HH < -1.5f) {
if (/*HH> -3.1415f &&*//* HH < -1.5f) {
sathue[0] = 1.5f; //blue
sathue[1] = 1.4f;
sathue[2] = 1.3f;
@ -1259,7 +1267,7 @@ void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage*
sathue2[1] = 1.1f ;
sathue2[2] = 1.05f;
sathue2[3] = 1.0f;
} else if (/*HH>=-1.5f &&*/ HH < -0.7f) {
} else if (/*HH>=-1.5f &&*//* HH < -0.7f) {
sathue[0] = 1.3f; //blue purple 1.2 1.1
sathue[1] = 1.2f;
sathue[2] = 1.1f;
@ -1269,7 +1277,7 @@ void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage*
sathue2[1] = 1.05f;
sathue2[2] = 1.0f ;
sathue2[3] = 1.0f;
} else if (/*HH>=-0.7f &&*/ HH < 0.0f) {
} else if (/*HH>=-0.7f &&*//* HH < 0.0f) {
sathue[0] = 1.2f; //purple
sathue[1] = 1.0f;
sathue[2] = 1.0f;
@ -1281,7 +1289,7 @@ void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage*
sathue2[3] = 1.0f;
}
// else if( HH>= 0.0f && HH<= 1.4f ) {sathue[0]=0.8f;sathue[1]=0.8f;sathue[2]=0.8f;sathue[3]=0.8f ;sathue[4]=0.4f;sathue2[0]=0.8f ;sathue2[1]=0.8f ;sathue2[2]=0.8f ;sathue2[3]=0.8f;}//red 0.8 0.7
else if (/*HH>= 0.0f &&*/ HH <= 1.4f) {
else if (/*HH>= 0.0f &&*//* HH <= 1.4f) {
sathue[0] = 1.1f; //red 0.8 0.7
sathue[1] = 1.0f;
sathue[2] = 0.9f;
@ -1291,7 +1299,7 @@ void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage*
sathue2[1] = 0.8f ;
sathue2[2] = 0.8f ;
sathue2[3] = 0.8f;
} else if (/*HH> 1.4f &&*/ HH <= 2.1f) {
} else if (/*HH> 1.4f &&*//* HH <= 2.1f) {
sathue[0] = 1.1f; //green yellow 1.2 1.1
sathue[1] = 1.1f;
sathue[2] = 1.1f;
@ -1301,7 +1309,7 @@ void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage*
sathue2[1] = 0.8f ;
sathue2[2] = 0.7f ;
sathue2[3] = 0.6f;
} else { /*if(HH> 2.1f && HH<= 3.1415f)*/
} else { /*if(HH> 2.1f && HH<= 3.1415f)*//*
sathue[0] = 1.5f; //green
sathue[1] = 1.4f;
sathue[2] = 1.3f;
@ -1314,7 +1322,7 @@ void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage*
}
} else if (LL < 80.0f) { //more for green, less for red and green-yellow
if (/*HH> -3.1415f &&*/ HH < -1.5f) {
if (/*HH> -3.1415f &&*//* HH < -1.5f) {
sathue[0] = 1.3f; //blue
sathue[1] = 1.2f;
sathue[2] = 1.15f;
@ -1324,7 +1332,7 @@ void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage*
sathue2[1] = 1.1f ;
sathue2[2] = 1.05f;
sathue2[3] = 1.0f;
} else if (/*HH>=-1.5f &&*/ HH < -0.7f) {
} else if (/*HH>=-1.5f &&*//* HH < -0.7f) {
sathue[0] = 1.3f; //blue purple 1.2 1.1
sathue[1] = 1.2f;
sathue[2] = 1.15f;
@ -1334,7 +1342,7 @@ void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage*
sathue2[1] = 1.05f;
sathue2[2] = 1.0f ;
sathue2[3] = 1.0f;
} else if (/*HH>=-0.7f &&*/ HH < 0.0f) {
} else if (/*HH>=-0.7f &&*//* HH < 0.0f) {
sathue[0] = 1.2f; //purple
sathue[1] = 1.0f;
sathue[2] = 1.0f ;
@ -1346,7 +1354,7 @@ void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage*
sathue2[3] = 1.0f;
}
// else if( HH>= 0.0f && HH<= 1.4f ) {sathue[0]=0.8f;sathue[1]=0.8f;sathue[2]=0.8f ;sathue[3]=0.8f ;sathue[4]=0.3f;sathue2[0]=0.8f ;sathue2[1]=0.8f ;sathue2[2]=0.8f ;sathue2[3]=0.8f;}//red 0.8 0.7
else if (/*HH>= 0.0f &&*/ HH <= 1.4f) {
else if (/*HH>= 0.0f &&*//* HH <= 1.4f) {
sathue[0] = 1.1f; //red 0.8 0.7
sathue[1] = 1.0f;
sathue[2] = 0.9f ;
@ -1356,7 +1364,7 @@ void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage*
sathue2[1] = 0.8f ;
sathue2[2] = 0.8f ;
sathue2[3] = 0.8f;
} else if (/*HH> 1.4f &&*/ HH <= 2.1f) {
} else if (/*HH> 1.4f &&*//* HH <= 2.1f) {
sathue[0] = 1.3f; //green yellow 1.2 1.1
sathue[1] = 1.2f;
sathue[2] = 1.1f ;
@ -1366,7 +1374,7 @@ void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage*
sathue2[1] = 0.9f ;
sathue2[2] = 0.8f ;
sathue2[3] = 0.7f;
} else { /*if(HH> 2.1f && HH<= 3.1415f)*/
} else { /*if(HH> 2.1f && HH<= 3.1415f)*//*
sathue[0] = 1.6f; //green - even with Prophoto green are too "little" 1.5 1.3
sathue[1] = 1.4f;
sathue[2] = 1.3f ;
@ -1377,8 +1385,8 @@ void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage*
sathue2[2] = 1.15f;
sathue2[3] = 1.05f;
}
} else { /*if (LL>=80.0f)*/ //more for green-yellow, less for red and purple
if (/*HH> -3.1415f &&*/ HH < -1.5f) {
} else { /*if (LL>=80.0f)*//* //more for green-yellow, less for red and purple
if (/*HH> -3.1415f &&*//* HH < -1.5f) {
sathue[0] = 1.0f; //blue
sathue[1] = 1.0f;
sathue[2] = 0.9f;
@ -1388,7 +1396,7 @@ void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage*
sathue2[1] = 0.8f ;
sathue2[2] = 0.8f ;
sathue2[3] = 0.8f;
} else if (/*HH>=-1.5f &&*/ HH < -0.7f) {
} else if (/*HH>=-1.5f &&*//* HH < -0.7f) {
sathue[0] = 1.0f; //blue purple 1.2 1.1
sathue[1] = 1.0f;
sathue[2] = 0.9f;
@ -1398,7 +1406,7 @@ void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage*
sathue2[1] = 0.8f ;
sathue2[2] = 0.8f ;
sathue2[3] = 0.8f;
} else if (/*HH>=-0.7f &&*/ HH < 0.0f) {
} else if (/*HH>=-0.7f &&*//* HH < 0.0f) {
sathue[0] = 1.2f; //purple
sathue[1] = 1.0f;
sathue[2] = 1.0f;
@ -1410,7 +1418,7 @@ void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage*
sathue2[3] = 0.8f;
}
// else if( HH>= 0.0f && HH<= 1.4f ) {sathue[0]=0.8f;sathue[1]=0.8f;sathue[2]=0.8f;sathue[3]=0.8f;sathue[4]=0.2f;sathue2[0]=0.8f;sathue2[1]=0.8f ;sathue2[2]=0.8f ;sathue2[3]=0.8f;}//red 0.8 0.7
else if (/*HH>= 0.0f &&*/ HH <= 1.4f) {
else if (/*HH>= 0.0f &&*//* HH <= 1.4f) {
sathue[0] = 1.1f; //red 0.8 0.7
sathue[1] = 1.0f;
sathue[2] = 0.9f;
@ -1420,7 +1428,7 @@ void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage*
sathue2[1] = 0.8f ;
sathue2[2] = 0.8f ;
sathue2[3] = 0.8f;
} else if (/*HH> 1.4f &&*/ HH <= 2.1f) {
} else if (/*HH> 1.4f &&*//* HH <= 2.1f) {
sathue[0] = 1.6f; //green yellow 1.2 1.1
sathue[1] = 1.5f;
sathue[2] = 1.4f;
@ -1430,7 +1438,7 @@ void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage*
sathue2[1] = 1.05f;
sathue2[2] = 1.0f ;
sathue2[3] = 1.0f;
} else { /*if(HH> 2.1f && HH<= 3.1415f)*/
} else { /*if(HH> 2.1f && HH<= 3.1415f)*//*
sathue[0] = 1.4f; //green
sathue[1] = 1.3f;
sathue[2] = 1.2f;
@ -1661,11 +1669,13 @@ void ImProcFunctions::vibrancelocal(int bfw, int bfh, LabImage* lab, LabImage*
}
#endif
*/
}
void ImProcFunctions::exlabLocal(const local_params& lp, int bfh, int bfw, LabImage* bufexporig, LabImage* lab, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve)
{
// TODO Locallab
/*
//exposure local
float maxran = 65536.f; //65536
@ -1761,7 +1771,7 @@ void ImProcFunctions::exlabLocal(const local_params& lp, int bfh, int bfw, LabIm
}
}
}
*/
*//*
bool vasy = true;
@ -1783,7 +1793,7 @@ void ImProcFunctions::exlabLocal(const local_params& lp, int bfh, int bfw, LabIm
}
*/
}
@ -11438,11 +11448,15 @@ void ImProcFunctions::Lab_Local(int call, int maxspot, int sp, LUTf & huerefs, L
// }
//sharpen only square area instaed of all image
// TODO Locallab
/*
ImProcFunctions::deconvsharpeningloc(bufsh, hbuffer, bfw, bfh, loctemp, params->locallab.shardamping, (double)params->locallab.sharradius / 100., params->locallab.shariter, params->locallab.sharamount);
*/
} else { //call from dcrop.cc
// TODO Locallab
/*
ImProcFunctions::deconvsharpeningloc(original->L, shbuffer, bfw, bfh, loctemp, params->locallab.shardamping, (double)params->locallab.sharradius / 100., params->locallab.shariter, params->locallab.sharamount);
*/
}
float hueplus = hueref + dhuesha;
@ -11464,7 +11478,10 @@ void ImProcFunctions::Lab_Local(int call, int maxspot, int sp, LUTf & huerefs, L
int GH = original->H;
JaggedArray<float> loctemp(GW, GH);
// TODO Locallab
/*
ImProcFunctions::deconvsharpeningloc(original->L, shbuffer, GW, GH, loctemp, params->locallab.shardamping, (double)params->locallab.sharradius / 100., params->locallab.shariter, params->locallab.sharamount);
*/
float hueplus = hueref + dhuesha;
float huemoins = hueref - dhuesha;
@ -11628,6 +11645,8 @@ void ImProcFunctions::Lab_Local(int call, int maxspot, int sp, LUTf & huerefs, L
InverseReti_Local(lp, original, transformed, tmpl, cx, cy, 0);
}
// TODO Locallab
/*
if (params->locallab.chrrt > 0) {
if (!lp.invret && call <= 3) {
@ -11713,6 +11732,7 @@ void ImProcFunctions::Lab_Local(int call, int maxspot, int sp, LUTf & huerefs, L
}
}
*/
delete tmpl;
delete [] origBuffer;
@ -11728,6 +11748,8 @@ void ImProcFunctions::Lab_Local(int call, int maxspot, int sp, LUTf & huerefs, L
// Gamut and Munsell control - very important do not desactivated to avoid crash
// TODO Locallab
/*
if (params->locallab.avoid) {
TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix(params->icm.working);
float wip[3][3] = {
@ -11876,6 +11898,7 @@ void ImProcFunctions::Lab_Local(int call, int maxspot, int sp, LUTf & huerefs, L
}
}
}
*/
#ifdef _DEBUG

View File

@ -804,6 +804,8 @@ void RawImageSource::MSR(float** luminance, float** originalLuminance, float **e
void ImProcFunctions::MSRLocal(float** luminance, float** templ, const float* const *originalLuminance, const int width, const int height, const LocallabParams &loc, const int skip, const LocretigainCurve &locRETgainCcurve, const int chrome, const int scall, const float krad, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax)
{
// TODO Locallab
/*
BENCHFUN
bool py = true;
@ -1067,7 +1069,7 @@ void ImProcFunctions::MSRLocal(float** luminance, float** templ, const float* co
// luminance[i][j] *= (-1.f + 4.f * wavRETCcurve[absciss]); //new transmission
}
*/
*//*
// median filter on transmission ==> reduce artifacts
bool ty = false;
@ -1234,6 +1236,6 @@ void ImProcFunctions::MSRLocal(float** luminance, float** templ, const float* co
}
*/
}
}

View File

@ -521,6 +521,24 @@ enum ProcEventCode {
EvRGBEnabled = 491,
EvLEnabled = 492,
// EvPixelShiftOneGreen = 493, can be reused
EvLocallabSpotCreated = 494,
EvLocallabSpotDeleted = 495,
EvLocallabSpotSelected = 496,
EvLocallabSpotName = 497,
EvLocallabSpotVisibility = 498,
EvLocallabSpotShape = 499,
EvLocallabSpotSpotMethod = 500,
EvLocallabSpotShapeMethod = 501,
EvLocallabSpotLocX = 502,
EvLocallabSpotLocXL = 503,
EvLocallabSpotLocY = 504,
EvLocallabSpotLocYT = 505,
EvLocallabSpotCenter = 506,
EvLocallabSpotCircrad = 507,
EvLocallabSpotQualityMethod = 508,
EvLocallabSpotTransit = 509,
EvLocallabSpotThresh = 510,
EvLocallabSpotIter = 511,
NUMOFEVENTS

View File

@ -2261,6 +2261,28 @@ void WaveletParams::getCurves(
}
LocallabParams::LocallabParams() :
enabled(false),
nbspot(0),
selspot(0),
// Control spot settings
id(),
name(),
isvisible(),
shape(),
spotMethod(),
shapeMethod(),
locX(),
locXL(),
locY(),
locYT(),
centerX(),
centerY(),
circrad(),
qualityMethod(),
transit(),
thresh(),
iter(),
llcurve{
DCT_NURBS,
0.0,
@ -2368,7 +2390,8 @@ HHcurve{
},
skintonescurve {
DCT_Linear
},
}
/*
enabled(false),
degree(0),
locY(250),
@ -2477,6 +2500,7 @@ expdenoi(false),
threshold(20),
chromacbdl(0),
spotduplicated(false)
*/
{
}
@ -2485,23 +2509,27 @@ bool LocallabParams::operator ==(const LocallabParams& other) const
return
enabled == other.enabled
&& avoid == other.avoid
&& invers == other.invers
&& spotduplicated == other.spotduplicated
&& cutpast == other.cutpast
&& lastdust == other.lastdust
&& curvactiv == other.curvactiv
&& activlum == other.activlum
&& inversrad == other.inversrad
&& inversret == other.inversret
&& inverssha == other.inverssha
&& degree == other.degree
&& Smethod == other.Smethod
&& Exclumethod == other.Exclumethod
&& shapemethod == other.shapemethod
&& retinexMethod == other.retinexMethod
&& blurMethod == other.blurMethod
&& dustMethod == other.dustMethod
&& nbspot == other.nbspot
&& selspot == other.selspot
// Control spot settings
&& id == other.id
&& name == other.name
&& isvisible == other.isvisible
&& shape == other.shape
&& spotMethod == other.spotMethod
&& shapeMethod == other.shapeMethod
&& locX == other.locX
&& locXL == other.locXL
&& locY == other.locY
&& locYT == other.locYT
&& centerX == other.centerX
&& centerY == other.centerY
&& circrad == other.circrad
&& qualityMethod == other.qualityMethod
&& transit == other.transit
&& thresh == other.thresh
&& iter == other.iter;
/*
&& qualityMethod == other.qualityMethod
&& qualitycurveMethod == other.qualitycurveMethod
&& locY == other.locY
@ -2602,7 +2630,11 @@ bool LocallabParams::operator ==(const LocallabParams& other) const
&& llcurve == other.llcurve
&& cccurve == other.cccurve
&& LHcurve == other.LHcurve
&& HHcurve == other.HHcurve;
&& HHcurve == other.HHcurve
&& id == other.id
&& name == other.name
&& isvisible == other.isvisible;
*/
}
@ -3079,6 +3111,9 @@ void ProcParams::setDefaults()
int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bool fnameAbsolute, ParamsEdited* pedited)
{
// TODO Locallab printf
printf("Save to .pp3 file\n");
if (fname.empty() && fname2.empty()) {
return 0;
}
@ -3473,6 +3508,31 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
// Locallab
saveToKeyfile(!pedited || pedited->locallab.enabled, "Locallab", "Enabled", locallab.enabled, keyFile);
saveToKeyfile(!pedited || pedited->locallab.nbspot, "Locallab", "Nbspot", locallab.nbspot, keyFile);
saveToKeyfile(!pedited || pedited->locallab.selspot, "Locallab", "Selspot", locallab.selspot, keyFile);
for (int i = 0; i < locallab.nbspot; i++) {
// Control spot settings
saveToKeyfile(!pedited || pedited->locallab.id, "Locallab", "Id_" + std::to_string(i), locallab.id.at(i), keyFile);
saveToKeyfile(!pedited || pedited->locallab.name, "Locallab", "Name_" + std::to_string(i), locallab.name.at(i), keyFile);
saveToKeyfile(!pedited || pedited->locallab.isvisible, "Locallab", "Isvisible_" + std::to_string(i), locallab.isvisible.at(i), keyFile);
saveToKeyfile(!pedited || pedited->locallab.shape, "Locallab", "Shape_" + std::to_string(i), locallab.shape.at(i), keyFile);
saveToKeyfile(!pedited || pedited->locallab.spotMethod, "Locallab", "SpotMethod_" + std::to_string(i), locallab.spotMethod.at(i), keyFile);
saveToKeyfile(!pedited || pedited->locallab.shapeMethod, "Locallab", "ShapeMethod_" + std::to_string(i), locallab.shapeMethod.at(i), keyFile);
saveToKeyfile(!pedited || pedited->locallab.locX, "Locallab", "LocX_" + std::to_string(i), locallab.locX.at(i), keyFile);
saveToKeyfile(!pedited || pedited->locallab.locXL, "Locallab", "LocXL_" + std::to_string(i), locallab.locXL.at(i), keyFile);
saveToKeyfile(!pedited || pedited->locallab.locY, "Locallab", "LocY_" + std::to_string(i), locallab.locY.at(i), keyFile);
saveToKeyfile(!pedited || pedited->locallab.locYT, "Locallab", "LocYT_" + std::to_string(i), locallab.locYT.at(i), keyFile);
saveToKeyfile(!pedited || pedited->locallab.centerX, "Locallab", "CenterX_" + std::to_string(i), locallab.centerX.at(i), keyFile);
saveToKeyfile(!pedited || pedited->locallab.centerY, "Locallab", "CenterY_" + std::to_string(i), locallab.centerY.at(i), keyFile);
saveToKeyfile(!pedited || pedited->locallab.circrad, "Locallab", "Circrad_" + std::to_string(i), locallab.circrad.at(i), keyFile);
saveToKeyfile(!pedited || pedited->locallab.qualityMethod, "Locallab", "QualityMethod_" + std::to_string(i), locallab.qualityMethod.at(i), keyFile);
saveToKeyfile(!pedited || pedited->locallab.transit, "Locallab", "Transit_" + std::to_string(i), locallab.transit.at(i), keyFile);
saveToKeyfile(!pedited || pedited->locallab.thresh, "Locallab", "Thresh_" + std::to_string(i), locallab.thresh.at(i), keyFile);
saveToKeyfile(!pedited || pedited->locallab.iter, "Locallab", "Iter_" + std::to_string(i), locallab.iter.at(i), keyFile);
}
/*
saveToKeyfile(!pedited || pedited->locallab.expcolor, "Locallab", "Expcolor", locallab.expcolor, keyFile);
saveToKeyfile(!pedited || pedited->locallab.expexpose, "Locallab", "Expexpose", locallab.expexpose, keyFile);
saveToKeyfile(!pedited || pedited->locallab.expvibrance, "Locallab", "Expvibrance", locallab.expvibrance, keyFile);
@ -3590,8 +3650,10 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
saveToKeyfile(!pedited || pedited->locallab.scaltm, "Locallab", "Scaltm", locallab.scaltm, keyFile);
saveToKeyfile(!pedited || pedited->locallab.rewei, "Locallab", "Rewei", locallab.rewei, keyFile);
saveToKeyfile(!pedited || pedited->locallab.spotduplicated, "Locallab", "Spotduplicated", locallab.spotduplicated, keyFile);
saveToKeyfile(!pedited || pedited->locallab.id, "Locallab", "Id", locallab.id, keyFile);
saveToKeyfile(!pedited || pedited->locallab.name, "Locallab", "Name", locallab.name, keyFile);
saveToKeyfile(!pedited || pedited->locallab.isvisible, "Locallab", "Isvisible", locallab.isvisible, keyFile);
*/
// Post-crop vignette
saveToKeyfile(!pedited || pedited->pcvignette.enabled, "PCVignette", "Enabled", pcvignette.enabled, keyFile);
@ -3998,6 +4060,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "Exposure", "Curve", pedited, toneCurve.curve, pedited->toneCurve.curve);
assignFromKeyfile(keyFile, "Exposure", "Curve2", pedited, toneCurve.curve2, pedited->toneCurve.curve2);
}
assignFromKeyfile(keyFile, "Exposure", "HistogramMatching", pedited, toneCurve.histmatching, pedited->toneCurve.histmatching);
assignFromKeyfile(keyFile, "Exposure", "ClampOOG", pedited, toneCurve.clampOOG, pedited->toneCurve.clampOOG);
}
@ -4204,14 +4267,17 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
if (keyFile.has_group("Sharpening")) {
assignFromKeyfile(keyFile, "Sharpening", "Enabled", pedited, sharpening.enabled, pedited->sharpening.enabled);
if (ppVersion >= 334) {
assignFromKeyfile(keyFile, "Sharpening", "Contrast", pedited, sharpening.contrast, pedited->sharpening.contrast);
} else {
sharpening.contrast = 0;
if (pedited) {
pedited->sharpening.contrast = true;
}
}
assignFromKeyfile(keyFile, "Sharpening", "Radius", pedited, sharpening.radius, pedited->sharpening.radius);
assignFromKeyfile(keyFile, "Sharpening", "Amount", pedited, sharpening.amount, pedited->sharpening.amount);
@ -4255,14 +4321,17 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "SharpenMicro", "Enabled", pedited, sharpenMicro.enabled, pedited->sharpenMicro.enabled);
assignFromKeyfile(keyFile, "SharpenMicro", "Matrix", pedited, sharpenMicro.matrix, pedited->sharpenMicro.matrix);
assignFromKeyfile(keyFile, "SharpenMicro", "Strength", pedited, sharpenMicro.amount, pedited->sharpenMicro.amount);
if (ppVersion >= 334) {
assignFromKeyfile(keyFile, "SharpenMicro", "Contrast", pedited, sharpenMicro.contrast, pedited->sharpenMicro.contrast);
} else {
sharpenMicro.contrast = 0;
if (pedited) {
pedited->sharpenMicro.contrast = true;
}
}
assignFromKeyfile(keyFile, "SharpenMicro", "Uniformity", pedited, sharpenMicro.uniformity, pedited->sharpenMicro.uniformity);
}
@ -4599,6 +4668,52 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
if (keyFile.has_group("Locallab")) {
assignFromKeyfile(keyFile, "Locallab", "Enabled", pedited, locallab.enabled, pedited->locallab.enabled);
assignFromKeyfile(keyFile, "Locallab", "Nbspot", pedited, locallab.nbspot, pedited->locallab.nbspot);
assignFromKeyfile(keyFile, "Locallab", "Selspot", pedited, locallab.selspot, pedited->locallab.selspot);
// Resize locallab settings if required
if (locallab.nbspot > (int)locallab.id.size()) {
locallab.id.resize(locallab.nbspot);
locallab.name.resize(locallab.nbspot);
locallab.isvisible.resize(locallab.nbspot);
locallab.shape.resize(locallab.nbspot);
locallab.spotMethod.resize(locallab.nbspot);
locallab.shapeMethod.resize(locallab.nbspot);
locallab.locX.resize(locallab.nbspot);
locallab.locXL.resize(locallab.nbspot);
locallab.locY.resize(locallab.nbspot);
locallab.locYT.resize(locallab.nbspot);
locallab.centerX.resize(locallab.nbspot);
locallab.centerY.resize(locallab.nbspot);
locallab.circrad.resize(locallab.nbspot);
locallab.qualityMethod.resize(locallab.nbspot);
locallab.transit.resize(locallab.nbspot);
locallab.thresh.resize(locallab.nbspot);
locallab.iter.resize(locallab.nbspot);
}
for (int i = 0; i < locallab.nbspot; i++) {
// Control spot settings
assignFromKeyfile(keyFile, "Locallab", "Id_" + std::to_string(i), pedited, locallab.id.at(i), pedited->locallab.id);
assignFromKeyfile(keyFile, "Locallab", "Name_" + std::to_string(i), pedited, locallab.name.at(i), pedited->locallab.name);
assignFromKeyfile(keyFile, "Locallab", "Isvisible_" + std::to_string(i), pedited, locallab.isvisible.at(i), pedited->locallab.isvisible);
assignFromKeyfile(keyFile, "Locallab", "Shape_" + std::to_string(i), pedited, locallab.shape.at(i), pedited->locallab.shape);
assignFromKeyfile(keyFile, "Locallab", "SpotMethod_" + std::to_string(i), pedited, locallab.spotMethod.at(i), pedited->locallab.spotMethod);
assignFromKeyfile(keyFile, "Locallab", "ShapeMethod_" + std::to_string(i), pedited, locallab.shapeMethod.at(i), pedited->locallab.shapeMethod);
assignFromKeyfile(keyFile, "Locallab", "LocX_" + std::to_string(i), pedited, locallab.locX.at(i), pedited->locallab.locX);
assignFromKeyfile(keyFile, "Locallab", "LocXL_" + std::to_string(i), pedited, locallab.locXL.at(i), pedited->locallab.locXL);
assignFromKeyfile(keyFile, "Locallab", "LocY_" + std::to_string(i), pedited, locallab.locY.at(i), pedited->locallab.locY);
assignFromKeyfile(keyFile, "Locallab", "LocYT_" + std::to_string(i), pedited, locallab.locYT.at(i), pedited->locallab.locYT);
assignFromKeyfile(keyFile, "Locallab", "CenterX_" + std::to_string(i), pedited, locallab.centerX.at(i), pedited->locallab.centerX);
assignFromKeyfile(keyFile, "Locallab", "CenterY_" + std::to_string(i), pedited, locallab.centerY.at(i), pedited->locallab.centerY);
assignFromKeyfile(keyFile, "Locallab", "Circrad_" + std::to_string(i), pedited, locallab.circrad.at(i), pedited->locallab.circrad);
assignFromKeyfile(keyFile, "Locallab", "QualityMethod_" + std::to_string(i), pedited, locallab.qualityMethod.at(i), pedited->locallab.qualityMethod);
assignFromKeyfile(keyFile, "Locallab", "Transit_" + std::to_string(i), pedited, locallab.transit.at(i), pedited->locallab.transit);
assignFromKeyfile(keyFile, "Locallab", "Thresh_" + std::to_string(i), pedited, locallab.thresh.at(i), pedited->locallab.thresh);
assignFromKeyfile(keyFile, "Locallab", "Iter_" + std::to_string(i), pedited, locallab.iter.at(i), pedited->locallab.iter);
}
/*
assignFromKeyfile(keyFile, "Locallab", "Expcolor", pedited, locallab.expcolor, pedited->locallab.expcolor);
assignFromKeyfile(keyFile, "Locallab", "Expcbdl", pedited, locallab.expcbdl, pedited->locallab.expcbdl);
assignFromKeyfile(keyFile, "Locallab", "Expexpose", pedited, locallab.expexpose, pedited->locallab.expexpose);
@ -4733,7 +4848,10 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "Locallab", "Threshold", pedited, locallab.threshold, pedited->locallab.threshold);
assignFromKeyfile(keyFile, "Locallab", "Chromacbdl", pedited, locallab.chromacbdl, pedited->locallab.chromacbdl);
assignFromKeyfile(keyFile, "Locallab", "Spotduplicated", pedited, locallab.spotduplicated, pedited->locallab.spotduplicated);
assignFromKeyfile(keyFile, "Locallab", "Id", pedited, locallab.id, pedited->locallab.id);
assignFromKeyfile(keyFile, "Locallab", "Name", pedited, locallab.name, pedited->locallab.name);
assignFromKeyfile(keyFile, "Locallab", "Isvisible", pedited, locallab.isvisible, pedited->locallab.isvisible);
*/
}
@ -4862,15 +4980,18 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "Wavelet", "Lipst", pedited, wavelet.lipst, pedited->wavelet.lipst);
assignFromKeyfile(keyFile, "Wavelet", "AvoidColorShift", pedited, wavelet.avoid, pedited->wavelet.avoid);
assignFromKeyfile(keyFile, "Wavelet", "TMr", pedited, wavelet.tmr, pedited->wavelet.tmr);
if (ppVersion < 331) { // wavelet.Lmethod was a string before version 331
Glib::ustring temp;
assignFromKeyfile(keyFile, "Wavelet", "LevMethod", pedited, temp, pedited->wavelet.Lmethod);
if (!temp.empty()) {
wavelet.Lmethod = std::stoi(temp);
}
} else {
assignFromKeyfile(keyFile, "Wavelet", "LevMethod", pedited, wavelet.Lmethod, pedited->wavelet.Lmethod);
}
assignFromKeyfile(keyFile, "Wavelet", "ChoiceLevMethod", pedited, wavelet.CLmethod, pedited->wavelet.CLmethod);
assignFromKeyfile(keyFile, "Wavelet", "BackMethod", pedited, wavelet.Backmethod, pedited->wavelet.Backmethod);
assignFromKeyfile(keyFile, "Wavelet", "TilesMethod", pedited, wavelet.Tilesmethod, pedited->wavelet.Tilesmethod);
@ -5337,12 +5458,15 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "RAW Bayer", "PreBlack3", pedited, raw.bayersensor.black3, pedited->raw.bayersensor.exBlack3);
assignFromKeyfile(keyFile, "RAW Bayer", "PreTwoGreen", pedited, raw.bayersensor.twogreen, pedited->raw.bayersensor.exTwoGreen);
assignFromKeyfile(keyFile, "RAW Bayer", "LineDenoise", pedited, raw.bayersensor.linenoise, pedited->raw.bayersensor.linenoise);
if (keyFile.has_key("RAW Bayer", "LineDenoiseDirection")) {
raw.bayersensor.linenoiseDirection = RAWParams::BayerSensor::LineNoiseDirection(keyFile.get_integer("RAW Bayer", "LineDenoiseDirection"));
if (pedited) {
pedited->raw.bayersensor.linenoiseDirection = true;
}
}
assignFromKeyfile(keyFile, "RAW Bayer", "GreenEqThreshold", pedited, raw.bayersensor.greenthresh, pedited->raw.bayersensor.greenEq);
assignFromKeyfile(keyFile, "RAW Bayer", "DCBIterations", pedited, raw.bayersensor.dcb_iterations, pedited->raw.bayersensor.dcbIterations);
assignFromKeyfile(keyFile, "RAW Bayer", "DCBEnhance", pedited, raw.bayersensor.dcb_enhance, pedited->raw.bayersensor.dcbEnhance);
@ -5358,9 +5482,11 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
}
assignFromKeyfile(keyFile, "RAW Bayer", "PixelShiftEperIso", pedited, raw.bayersensor.pixelShiftEperIso, pedited->raw.bayersensor.pixelShiftEperIso);
if (ppVersion < 332) {
raw.bayersensor.pixelShiftEperIso += 1.0;
}
assignFromKeyfile(keyFile, "RAW Bayer", "PixelShiftSigma", pedited, raw.bayersensor.pixelShiftSigma, pedited->raw.bayersensor.pixelShiftSigma);
assignFromKeyfile(keyFile, "RAW Bayer", "PixelShiftShowMotion", pedited, raw.bayersensor.pixelShiftShowMotion, pedited->raw.bayersensor.pixelShiftShowMotion);
assignFromKeyfile(keyFile, "RAW Bayer", "PixelShiftShowMotionMaskOnly", pedited, raw.bayersensor.pixelShiftShowMotionMaskOnly, pedited->raw.bayersensor.pixelShiftShowMotionMaskOnly);
@ -5376,11 +5502,13 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
if (ppVersion < 336) {
if (keyFile.has_key("RAW Bayer", "pixelShiftLmmse")) {
bool useLmmse = keyFile.get_boolean("RAW Bayer", "pixelShiftLmmse");
if (useLmmse) {
raw.bayersensor.pixelShiftDemosaicMethod = raw.bayersensor.getPSDemosaicMethodString(RAWParams::BayerSensor::PSDemosaicMethod::LMMSE);
} else {
raw.bayersensor.pixelShiftDemosaicMethod = raw.bayersensor.getPSDemosaicMethodString(RAWParams::BayerSensor::PSDemosaicMethod::AMAZE);
}
if (pedited) {
pedited->raw.bayersensor.pixelShiftDemosaicMethod = true;
}

View File

@ -899,6 +899,28 @@ struct GradientParams {
* Parameters of the Local Lab
*/
struct LocallabParams {
bool enabled;
int nbspot;
int selspot;
// Control spot settings
std::vector<int> id;
std::vector<Glib::ustring> name;
std::vector<int> isvisible;
std::vector<Glib::ustring> shape; // ELI, RECT
std::vector<Glib::ustring> spotMethod; // norm, exc
std::vector<Glib::ustring> shapeMethod; // IND, SYM, INDSL, SYMSL
std::vector<int> locX;
std::vector<int> locXL;
std::vector<int> locY;
std::vector<int> locYT;
std::vector<int> centerX;
std::vector<int> centerY;
std::vector<int> circrad;
std::vector<Glib::ustring> qualityMethod; // std, enh, enhden
std::vector<int> transit;
std::vector<int> thresh;
std::vector<int> iter;
std::vector<double> llcurve;
std::vector<double> cccurve;
std::vector<double> excurve;
@ -908,6 +930,7 @@ struct LocallabParams {
std::vector<double> HHcurve;
std::vector<double> skintonescurve;
/*
bool enabled;
double degree;
int locY;
@ -1010,6 +1033,10 @@ struct LocallabParams {
double threshold;
int chromacbdl;
bool spotduplicated;
int id;
Glib::ustring name;
bool isvisible;
*/
LocallabParams();

View File

@ -519,7 +519,25 @@ int refreshmap[rtengine::NUMOFEVENTS] = {
HDR, // EvTMFattalAmount
ALLNORAW, // EvWBEnabled
RGBCURVE, // EvRGBEnabled
LUMINANCECURVE // EvLEnabled
LUMINANCECURVE, // EvLEnabled
LUMINANCECURVE, // EvLocallabSpotCreated
LUMINANCECURVE, // EvLocallabSpotDeleted
M_VOID, // EvLocallabSpotSelected
M_VOID, // EvLocallabSpotName
M_VOID, // EvLocallabSpotVisibility
LUMINANCECURVE, // EvLocallabSpotShape
LUMINANCECURVE, // EvLocallabSpotSpotMethod
LUMINANCECURVE, // EvLocallabSpotShapeMethod
LUMINANCECURVE, // EvLocallabSpotLocX
LUMINANCECURVE, // EvLocallabSpotLocXL
LUMINANCECURVE, // EvLocallabSpotLocY
LUMINANCECURVE, // EvLocallabSpotLocYT
LUMINANCECURVE, // EvLocallabSpotCenter
LUMINANCECURVE, // EvLocallabSpotCircrad
LUMINANCECURVE, // EvLocallabSpotQualityMethod
LUMINANCECURVE, // EvLocallabSpotTransit
LUMINANCECURVE, // EvLocallabSpotThresh
LUMINANCECURVE // EvLocallabSpotIter
};

View File

@ -1040,6 +1040,8 @@ private:
// bool localcutili = false;
reservView->CopyFrom(labView);
// TODO Locallab
/*
if (params.locallab.enabled) {
MyTime t1, t2;
t1.set();
@ -2208,6 +2210,7 @@ private:
}
}
*/
delete reservView;
reservView = nullptr;
@ -2382,6 +2385,7 @@ private:
delete labView;
labView = tmplab;
}
cw = labView->W;
ch = labView->H;
@ -2391,6 +2395,7 @@ private:
labView->L[i][j] = labView->L[i][j] < 0.f ? 0.f : labView->L[i][j];
}
}
ipf.sharpening(labView, params.prsharpening);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -16,11 +16,76 @@
class ControlSpotPanel:
public ToolParamBlock,
public AdjusterListener,
public EditSubscriber
public EditSubscriber,
public FoldableToolPanel
{
public:
/** A SpotRow structure allows exchanges from and to ControlSpotClass */
struct SpotRow {
int id; // Control spot id
Glib::ustring name;
bool isvisible;
int shape; // 0 = Ellipse, 1 = Rectangle
int spotMethod; // 0 = Normal, 1 = Excluding
int shapeMethod; // 0 = Independent (mouse), 1 = Symmetrical (mouse), 2 = Independent (mouse + sliders), 3 = Symmetrical (mouse + sliders)
int locX;
int locXL;
int locY;
int locYT;
int centerX;
int centerY;
int circrad;
int qualityMethod; // 0 = Standard, 1 = Enhanced, 2 = Enhanced + chroma denoise
int transit;
int thresh;
int iter;
};
/** A SpotEdited structure allows exchanges of spot panel widgets edited states from and to ControlSpotClass */
struct SpotEdited {
bool addbutton;
bool deletebutton;
bool treeview;
bool name;
bool isvisible;
bool shape;
bool spotMethod;
bool shapeMethod;
bool locX;
bool locXL;
bool locY;
bool locYT;
bool centerX;
bool centerY;
bool circrad;
bool qualityMethod;
bool transit;
bool thresh;
bool iter;
};
// Constructor and management functions
ControlSpotPanel();
void setEditProvider(EditDataProvider* provider);
int getEventType();
SpotRow* getSpot(int id);
std::vector<int>* getSpotIdList();
int getSelectedSpot();
void setSelectedSpot(int id);
// Control spot creation functions
int getNewId();
void addControlSpot(SpotRow* newSpot);
// Control spot update function
int updateControlSpot(SpotRow* spot);
// Control spot delete function
void deleteControlSpot(int id);
// Panel widgets edited states management functions
SpotEdited* getEditedStates();
void setEditedStates(SpotEdited* se);
private:
// cell renderer
@ -40,7 +105,9 @@ private:
void controlspotChanged();
void shapeChanged();
void shapeMethodeChanged();
void spotMethodChanged();
void shapeMethodChanged();
void qualityMethodChanged();
void updateParamVisibility();
void adjusterChanged(Adjuster* a, double newval);
void disableParamlistener(bool cond);
@ -97,12 +164,16 @@ private:
// Child widgets
Gtk::ScrolledWindow scrolledwindow_;
Gtk::TreeView treeview_;
sigc::connection treeviewconn_;
Glib::RefPtr<Gtk::ListStore> treemodel_;
Gtk::ButtonBox buttonbox_;
Gtk::Button button_add_;
sigc::connection buttonaddconn_;
Gtk::Button button_delete_;
sigc::connection buttondeleteconn_;
Gtk::Button button_rename_;
sigc::connection buttonrenameconn_;
MyComboBoxText* const shape_;
sigc::connection shapeconn_;
@ -126,6 +197,8 @@ private:
int lastObject_;
rtengine::Coord* lastCoord_;
int eventType; // 0 = No event, 1 = Spot creation event, 2 = Spot deletion event, 3 = Spot selection event
};
#endif // _CONTROLSPOTPANEL_H_

File diff suppressed because it is too large Load Diff

View File

@ -24,14 +24,12 @@ class Locallab :
public FoldableToolPanel,
public rtengine::localListener,
public CurveListener,
public EditSubscriber,
public ColorProvider,
public ThresholdCurveProvider,
public ThresholdAdjusterListener
{
private:
rtengine::ProcEvent EvLocenacolor;//548
rtengine::ProcEvent EvLocenaexpose;//572
rtengine::ProcEvent EvLocenavibrance;//563
@ -140,7 +138,8 @@ private:
rtengine::ProcEvent Evlocallabbilateral;// = 598,
rtengine::ProcEvent Evlocallabnoiselequal;// = 599,
rtengine::ProcEvent Evlocallabshapemethod;// = 600,
rtengine::ProcEvent Evlocallabspotduplicated;
rtengine::ProcEvent Evlocallabspotduplicated;// = 601
rtengine::ProcEvent Evlocallabspotcreated;// = 602
IdleRegister idle_register;
@ -159,33 +158,14 @@ private:
MyExpander* const expsharp;
MyExpander* const expcbdl;
MyExpander* const expdenoi;
MyExpander* const expsettings;
ControlSpotPanel* const expsettings;
CurveEditorGroup* const LocalcurveEditorgainT;
CurveEditorGroup* const LocalcurveEditorgainTrab;
CurveEditorGroup* const llCurveEditorG;
ControlSpotPanel *spotPanel;
Gtk::HBox *editHBox;
Gtk::ToggleButton* edit;
Adjuster* nbspot;
Adjuster* multiplier[5];
Adjuster* const anbspot;
Adjuster* const locX;
Adjuster* const locXL;
Adjuster* const degree;
Adjuster* const locY;
Adjuster* const locYT;
Adjuster* const centerX;
Adjuster* const centerY;
Adjuster* const circrad;
Adjuster* const sensiexclu;
Adjuster* const struc;
Adjuster* const thres;
Adjuster* const proxi;
Adjuster* const lightness;
Adjuster* const contrast;
Adjuster* const chroma;
@ -196,16 +176,10 @@ private:
Adjuster* const hlcomprthresh;
Adjuster* const black;
Adjuster* const shcompr;
/*
Adjuster* const lightnessex;
Adjuster* const contrastex;
Adjuster* const chromaex;
*/
Adjuster* const sensiex;
Adjuster* const radius;
Adjuster* const strength;
Adjuster* const sensibn;
Adjuster* const transit;
Adjuster* const stren;
Adjuster* const gamma;
Adjuster* const estop;
@ -237,38 +211,24 @@ private:
Adjuster* const sobelref;
Adjuster* const centerXbuf;
Adjuster* const centerYbuf;
// Adjuster* const adjblur;
MyComboBoxText* const shapemethod;
MyComboBoxText* const Smethod;
MyComboBoxText* const Exclumethod;
MyComboBoxText* const retinexMethod;
MyComboBoxText* const qualityMethod;
MyComboBoxText* const qualitycurveMethod;
MyComboBoxText* const blurMethod;
MyComboBoxText* const dustMethod;
Gtk::Frame* const excluFrame;
Gtk::Frame* const artifFrame;
Gtk::Frame* const shapeFrame;
Gtk::Frame* const superFrame;
Gtk::Frame* const dustFrame;
Gtk::Frame* const wavFrame;
Gtk::Label* const labmdh;
Gtk::Label* const labqual;
Gtk::Label* const labqualcurv;
Gtk::Label* const labmS;
Gtk::Label* const labmEx;
Gtk::Label* const labmshape;
Gtk::HBox* const ctboxS;
Gtk::HBox* const ctboxshape;
Gtk::HBox* const ctboxEx;
Gtk::HBox* const dhbox;
Gtk::HBox* const qualbox;
Gtk::HBox* const qualcurvbox;
Gtk::CheckButton* const avoid;
@ -281,7 +241,6 @@ private:
Gtk::CheckButton* const cutpast;
Gtk::CheckButton* const lastdust;
Gtk::CheckButton* spotduplicated;
Gtk::Label* labspotdup;
Gtk::Button* neutral;
@ -328,25 +287,20 @@ private:
sigc::connection ashiftconn;
sigc::connection pastsattogconn;
sigc::connection lumaneutralPressedConn;
sigc::connection lumacontrastPlusPressedConn;
sigc::connection lumacontrastMinusPressedConn;
sigc::connection enablecolorConn, enableexposeConn, enablevibranceConn, enableblurConn, enabletonemapConn;
sigc::connection enableretiConn, enablesharpConn, enablecbdlConn;
sigc::connection enabledenoiConn;
sigc::connection editConn, avoidConn, inversConn, cutpastConn, lastdustConn, curvactivConn, activlumConn, inversradConn, inversretConn, inversshaConn, neutralconn, neutralconn1;
sigc::connection Smethodconn, shapemethodconn, Exclumethodconn, spotduplicatedConn;
sigc::connection avoidConn, inversConn, cutpastConn, lastdustConn, curvactivConn, activlumConn, inversradConn, inversretConn, inversshaConn, neutralconn, neutralconn1;
sigc::connection retinexMethodConn;
sigc::connection qualityMethodConn;
sigc::connection qualitycurveMethodConn;
sigc::connection blurMethodConn;
sigc::connection dustMethodConn;
bool lastspotduplicated;
int nextdatasp[102];
int nextlength;
bool nextspotdup;
@ -367,18 +321,32 @@ private:
std::string nextex_str;
std::string nextex_str2;
double draggedPointOldAngle;
double draggedPointAdjusterAngle;
double draggedFeatherOffset;
double draggedlocYOffset;
double draggedlocXOffset;
double draggedlocYTOffset;
double draggedlocXLOffset;
rtengine::Coord draggedCenter;
bool lastavoid, lastinvers, lastcutpast, lastlastdust, lastinversrad, lastinversret, lastactivlum, lastinverssha, lastcurvactiv;
int lastanbspot;
void editToggled();
// To be deleted
Adjuster* const locX;
Adjuster* const locXL;
Adjuster* const degree;
Adjuster* const locY;
Adjuster* const locYT;
Adjuster* const centerX;
Adjuster* const centerY;
Adjuster* const circrad;
Adjuster* const sensiexclu;
Adjuster* const struc;
Adjuster* nbspot;
MyComboBoxText* const shapemethod;
MyComboBoxText* const Smethod;
MyComboBoxText* const Exclumethod;
Gtk::CheckButton* spotduplicated;
Adjuster* const thres;
Adjuster* const proxi;
Adjuster* const transit;
MyComboBoxText* const qualityMethod;
// To be deleted ??
Adjuster* const anbspot;
public:
@ -391,10 +359,9 @@ public:
void setBatchMode(bool batchMode);
void updateGeometry(const int centerX_, const int centerY_, const int circrad_, const int locY_, const double degree_, const int locX_, const int locYT_, const int locXL_, const int fullWidth = -1, const int fullHeight = -1);
void SmethodChanged();
void shapemethodChanged();
void ExclumethodChanged();
void SmethodChanged(); // TODO To be deleted
void shapemethodChanged(); // TODO To be deleted
void ExclumethodChanged(); // TODO To be deleted
void writeOptions(std::vector<int> &tpOpen);
void updateToolState(std::vector<int> &tpOpen);
@ -424,10 +391,12 @@ public:
bool localComputed_();
bool localretComputed_();
void setEditProvider(EditDataProvider* provider);
void subscribe();
void unsubscribe();
void retinexMethodChanged();
void blurMethodChanged();
void dustMethodChanged();
void qualityMethodChanged();
void qualityMethodChanged(); // TODO To be deleted
void qualitycurveMethodChanged();
void lumaneutralPressed();
void lumacontrastPlusPressed();
@ -439,12 +408,6 @@ public:
void pastsattog_toggled();
std::vector<double> getCurvePoints(ThresholdSelector* tAdjuster) const;
// EditSubscriber interface
CursorShape getCursor(int objectID);
bool mouseOver(int modifierKey);
bool button1Pressed(int modifierKey);
bool button1Released();
bool drag1(int modifierKey);
void switchOffEditMode();
void setListener(ToolPanelListener* tpl);
};

View File

@ -325,6 +325,27 @@ void ParamsEdited::set(bool v)
gradient.centerX = v;
gradient.centerY = v;
locallab.enabled = v;
locallab.nbspot = v;
locallab.selspot = v;
locallab.id = v;
locallab.name = v;
locallab.isvisible = v;
locallab.shape = v;
locallab.spotMethod = v;
locallab.shapeMethod = v;
locallab.locX = v;
locallab.locXL = v;
locallab.locY = v;
locallab.locYT = v;
locallab.centerX = v;
locallab.centerY = v;
locallab.circrad = v;
locallab.qualityMethod = v;
locallab.transit = v;
locallab.thresh = v;
locallab.iter = v;
/*
locallab.expcolor = v;
locallab.expexpose = v;
locallab.expvibrance = v;
@ -439,7 +460,10 @@ void ParamsEdited::set(bool v)
locallab.skintonescurve = v;
locallab.sensiv = v;
locallab.spotduplicated = v;
locallab.id = v;
locallab.name = v;
locallab.isvisible = v;
*/
pcvignette.enabled = v;
pcvignette.strength = v;
@ -994,7 +1018,30 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
gradient.strength = gradient.strength && p.gradient.strength == other.gradient.strength;
gradient.centerX = gradient.centerX && p.gradient.centerX == other.gradient.centerX;
gradient.centerY = gradient.centerY && p.gradient.centerY == other.gradient.centerY;
locallab.enabled = locallab.enabled && p.locallab.enabled == other.locallab.enabled;
locallab.nbspot = locallab.nbspot && p.locallab.nbspot == other.locallab.nbspot;
locallab.selspot = locallab.selspot && p.locallab.selspot == other.locallab.selspot;
// Control spot settings
locallab.id = locallab.id && p.locallab.id == other.locallab.id;
locallab.name = locallab.name && p.locallab.name == other.locallab.name;
locallab.isvisible = locallab.isvisible && p.locallab.isvisible == other.locallab.isvisible;
locallab.shape = locallab.shape && p.locallab.shape == other.locallab.shape;
locallab.spotMethod = locallab.spotMethod && p.locallab.spotMethod == other.locallab.spotMethod;
locallab.shapeMethod = locallab.shapeMethod && p.locallab.shapeMethod == other.locallab.shapeMethod;
locallab.locX = locallab.locX && p.locallab.locX == other.locallab.locX;
locallab.locXL = locallab.locXL && p.locallab.locXL == other.locallab.locXL;
locallab.locY = locallab.locY && p.locallab.locY == other.locallab.locY;
locallab.locYT = locallab.locYT && p.locallab.locYT == other.locallab.locYT;
locallab.centerX = locallab.centerX && p.locallab.centerX == other.locallab.centerX;
locallab.centerY = locallab.centerY && p.locallab.centerY == other.locallab.centerY;
locallab.circrad = locallab.circrad && p.locallab.circrad == other.locallab.circrad;
locallab.qualityMethod = locallab.qualityMethod && p.locallab.qualityMethod == other.locallab.qualityMethod;
locallab.transit = locallab.transit && p.locallab.transit == other.locallab.transit;
locallab.thresh = locallab.thresh && p.locallab.thresh == other.locallab.thresh;
locallab.iter = locallab.iter && p.locallab.iter == other.locallab.iter;
/*
locallab.avoid = locallab.avoid && p.locallab.avoid == other.locallab.avoid;
locallab.invers = locallab.invers && p.locallab.invers == other.locallab.invers;
locallab.cutpast = locallab.cutpast && p.locallab.cutpast == other.locallab.cutpast;
@ -1109,7 +1156,7 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
locallab.skintonescurve = locallab.skintonescurve && p.locallab.skintonescurve == other.locallab.skintonescurve;
locallab.sensiv = locallab.sensiv && p.locallab.sensiv == other.locallab.sensiv;
locallab.spotduplicated = locallab.spotduplicated && p.locallab.spotduplicated == other.locallab.spotduplicated;
*/
pcvignette.enabled = pcvignette.enabled && p.pcvignette.enabled == other.pcvignette.enabled;
pcvignette.strength = pcvignette.strength && p.pcvignette.strength == other.pcvignette.strength;
@ -1770,12 +1817,15 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
if (colorToning.labgridALow) {
toEdit.colorToning.labgridALow = mods.colorToning.labgridALow;
}
if (colorToning.labgridBLow) {
toEdit.colorToning.labgridBLow = mods.colorToning.labgridBLow;
}
if (colorToning.labgridAHigh) {
toEdit.colorToning.labgridAHigh = mods.colorToning.labgridAHigh;
}
if (colorToning.labgridBHigh) {
toEdit.colorToning.labgridBHigh = mods.colorToning.labgridBHigh;
}
@ -2302,6 +2352,7 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
if (fattal.amount) {
toEdit.fattal.amount = mods.fattal.amount;
}
if (fattal.anchor) {
toEdit.fattal.anchor = mods.fattal.anchor;
}
@ -2458,6 +2509,84 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.locallab.enabled = mods.locallab.enabled;
}
if (locallab.nbspot) {
toEdit.locallab.nbspot = mods.locallab.nbspot;
}
if (locallab.selspot) {
toEdit.locallab.selspot = mods.locallab.selspot;
}
// Control spot settings
if (locallab.id) {
toEdit.locallab.id = mods.locallab.id;
}
if (locallab.name) {
toEdit.locallab.name = mods.locallab.name;
}
if (locallab.isvisible) {
toEdit.locallab.isvisible = mods.locallab.isvisible;
}
if (locallab.shape) {
toEdit.locallab.shape = mods.locallab.shape;
}
if (locallab.spotMethod) {
toEdit.locallab.spotMethod = mods.locallab.spotMethod;
}
if (locallab.shapeMethod) {
toEdit.locallab.shapeMethod = mods.locallab.shapeMethod;
}
if (locallab.locX) {
toEdit.locallab.locX = mods.locallab.locX;
}
if (locallab.locXL) {
toEdit.locallab.locXL = mods.locallab.locXL;
}
if (locallab.locY) {
toEdit.locallab.locY = mods.locallab.locY;
}
if (locallab.locYT) {
toEdit.locallab.locYT = mods.locallab.locYT;
}
if (locallab.centerX) {
toEdit.locallab.centerX = mods.locallab.centerX;
}
if (locallab.centerY) {
toEdit.locallab.centerY = mods.locallab.centerY;
}
if (locallab.circrad) {
toEdit.locallab.circrad = mods.locallab.circrad;
}
if (locallab.qualityMethod) {
toEdit.locallab.qualityMethod = mods.locallab.qualityMethod;
}
if (locallab.transit) {
toEdit.locallab.transit = mods.locallab.transit;
}
if (locallab.thresh) {
toEdit.locallab.thresh = mods.locallab.thresh;
}
if (locallab.iter) {
toEdit.locallab.iter = mods.locallab.iter;
}
/*
if (locallab.expcolor) {
toEdit.locallab.expcolor = mods.locallab.expcolor;
}
@ -2895,6 +3024,7 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
if (locallab.chromacbdl) {
toEdit.locallab.chromacbdl = mods.locallab.chromacbdl;
}
*/
if (pcvignette.enabled) {
toEdit.pcvignette.enabled = mods.pcvignette.enabled;

View File

@ -455,9 +455,31 @@ public:
};
class LocallabParamsEdited
{
// TODO To be manage by vector<bool>
public:
bool enabled;
bool nbspot;
bool selspot;
// Control spot settings
bool id;
bool name;
bool isvisible;
bool shape;
bool spotMethod;
bool shapeMethod;
bool locX;
bool locXL;
bool locY;
bool locYT;
bool centerX;
bool centerY;
bool circrad;
bool qualityMethod;
bool transit;
bool thresh;
bool iter;
/*
bool degree;
bool locY;
bool locX;
@ -568,6 +590,10 @@ public:
bool skintonescurve;
bool sensiv;
bool spotduplicated;
bool id;
bool name;
bool isvisible;
*/
};
@ -913,7 +939,8 @@ public:
};
class MetaDataParamsEdited {
class MetaDataParamsEdited
{
public:
bool mode;
};

View File

@ -1,11 +1,13 @@
#pragma once
// This number has to be incremented whenever the PP3 file format is modified or the behaviour of a tool changes
#define PPVERSION 336
#define PPVERSION 337
#define PPVERSION_AEXP 301 //value of PPVERSION when auto exposure algorithm was modified
/*
Log of version changes
337 2018-07-26
Added Locallab tool parameters
336 2018-06-01
new demosaic method combobox for pixelshift
335 2018-05-30

View File

@ -28,7 +28,7 @@
using namespace rtengine::procparams;
ToolPanelCoordinator::ToolPanelCoordinator(bool batch) : ipc(nullptr), hasChanged(false), editDataProvider(nullptr)
ToolPanelCoordinator::ToolPanelCoordinator(bool batch) : ipc(nullptr), hasChanged(false), editDataProvider(nullptr), photoLoadedOnce(false)
{
exposurePanel = Gtk::manage(new ToolVBox());
@ -234,6 +234,9 @@ ToolPanelCoordinator::ToolPanelCoordinator(bool batch) : ipc(nullptr), hasChange
toolPanelNotebook->set_scrollable();
toolPanelNotebook->show_all();
notebookconn = toolPanelNotebook->signal_switch_page().connect(
sigc::mem_fun(*this, &ToolPanelCoordinator::notebookPageChanged));
for (auto toolPanel : toolPanels) {
toolPanel->setListener(this);
}
@ -252,6 +255,19 @@ ToolPanelCoordinator::ToolPanelCoordinator(bool batch) : ipc(nullptr), hasChange
toolBar->setToolBarListener(this);
}
void ToolPanelCoordinator::notebookPageChanged(Gtk::Widget* page, guint page_num)
{
// Locallab spot curves are set visible if at least one photo has been loaded (to avoid
// segfault) and locallab panel is active
if (photoLoadedOnce) {
if (page == locallabPanelSW) {
locallab->subscribe();
} else {
locallab->unsubscribe();
}
}
}
void ToolPanelCoordinator::addPanel(Gtk::Box* where, FoldableToolPanel* panel, int level)
{
@ -269,6 +285,10 @@ ToolPanelCoordinator::~ToolPanelCoordinator()
closeImage();
// When deleting toolPanelNotebook, pages removal activates notebookPageChanged function
// which is responsible of segfault if listener isn't deactivated before
notebookconn.block(true);
delete toolPanelNotebook;
delete toolBar;
}
@ -289,8 +309,7 @@ void ToolPanelCoordinator::imageTypeChanged (bool isRaw, bool isBayer, bool isXt
return FALSE;
};
idle_register.add(func, this);
}
else if (isXtrans) {
} else if (isXtrans) {
const auto func = [](gpointer data) -> gboolean {
ToolPanelCoordinator* const self = static_cast<ToolPanelCoordinator*>(data);
@ -303,8 +322,7 @@ void ToolPanelCoordinator::imageTypeChanged (bool isRaw, bool isBayer, bool isXt
return FALSE;
};
idle_register.add(func, this);
}
else if (isMono) {
} else if (isMono) {
const auto func = [](gpointer data) -> gboolean {
ToolPanelCoordinator* const self = static_cast<ToolPanelCoordinator*>(data);
@ -347,6 +365,9 @@ void ToolPanelCoordinator::imageTypeChanged (bool isRaw, bool isBayer, bool isXt
void ToolPanelCoordinator::panelChanged(rtengine::ProcEvent event, const Glib::ustring& descr)
{
// TODO Locallab printf
printf("panelChanged\n");
printf("panelChanged event: %d\n", (int)event);
if (!ipc) {
return;
@ -385,7 +406,6 @@ void ToolPanelCoordinator::panelChanged(rtengine::ProcEvent event, const Glib::u
int fw, fh;
ipc->getInitialImage()->getImageSource()->getFullSize(fw, fh, tr);
gradient->updateGeometry(params->gradient.centerX, params->gradient.centerY, params->gradient.feather, params->gradient.degree, fw, fh);
locallab->updateGeometry(params->locallab.centerX, params->locallab.centerY, params->locallab.circrad, params->locallab.locY, params->locallab.degree, params->locallab.locX, params->locallab.locYT, params->locallab.locXL, fw, fh);
}
// some transformations make the crop change for convenience
@ -412,10 +432,33 @@ void ToolPanelCoordinator::panelChanged(rtengine::ProcEvent event, const Glib::u
for (auto paramcListener : paramcListeners) {
paramcListener->procParamsChanged(params, event, descr);
}
// Locallab spot curves are set visible if at least one photo has been loaded (to avoid
// segfault) and locallab panel is active
// When a new photo is loaded, Locallab spot curves need to be set visible again
const auto func = [](gpointer data) -> gboolean {
ToolPanelCoordinator* const self = static_cast<ToolPanelCoordinator*>(data);
if (self->photoLoadedOnce && (self->toolPanelNotebook->get_nth_page(self->toolPanelNotebook->get_current_page()) == self->locallabPanelSW))
{
self->locallab->subscribe();
}
return FALSE;
};
if (event == rtengine::EvPhotoLoaded) {
idle_register.add(func, this);
}
photoLoadedOnce = true;
}
void ToolPanelCoordinator::profileChange(const PartialProfile *nparams, rtengine::ProcEvent event, const Glib::ustring& descr, const ParamsEdited* paramsEdited)
{
// TODO Locallab printf
printf("profileChanged\n");
printf("profileChanged event: %d\n", (int)event);
int fw, fh, tr;
@ -480,8 +523,6 @@ void ToolPanelCoordinator::profileChange(const PartialProfile *nparams, rtengine
if (event == rtengine::EvPhotoLoaded || event == rtengine::EvProfileChanged || event == rtengine::EvHistoryBrowsed || event == rtengine::EvCTRotate) {
// updating the "on preview" geometry
gradient->updateGeometry(params->gradient.centerX, params->gradient.centerY, params->gradient.feather, params->gradient.degree, fw, fh);
locallab->updateGeometry(params->locallab.centerX, params->locallab.centerY, params->locallab.circrad, params->locallab.locY, params->locallab.degree, params->locallab.locX, params->locallab.locYT, params->locallab.locXL, fw, fh);
}
// start the IPC processing
@ -496,6 +537,26 @@ void ToolPanelCoordinator::profileChange(const PartialProfile *nparams, rtengine
for (auto paramcListener : paramcListeners) {
paramcListener->procParamsChanged(params, event, descr);
}
// Locallab spot curves are set visible if at least one photo has been loaded (to avoid
// segfault) and locallab panel is active
// When a new photo is loaded, Locallab spot curves need to be set visible again
const auto func = [](gpointer data) -> gboolean {
ToolPanelCoordinator* const self = static_cast<ToolPanelCoordinator*>(data);
if (self->photoLoadedOnce && (self->toolPanelNotebook->get_nth_page(self->toolPanelNotebook->get_current_page()) == self->locallabPanelSW))
{
self->locallab->subscribe();
}
return FALSE;
};
if (event == rtengine::EvPhotoLoaded) {
idle_register.add(func, this);
}
photoLoadedOnce = true;
}
void ToolPanelCoordinator::setDefaults(ProcParams* defparams)
@ -685,6 +746,7 @@ void ToolPanelCoordinator::sharpMaskSelected(bool sharpMask)
if (!ipc) {
return;
}
ipc->beginUpdateParams();
ipc->setSharpMask(sharpMask);
ipc->endUpdateParams(rtengine::EvShrEnabled);

View File

@ -194,10 +194,13 @@ protected:
void foldThemAll(GdkEventButton* event);
void updateVScrollbars(bool hide);
void updateTabsHeader(bool useIcons);
void notebookPageChanged(Gtk::Widget* page, guint page_num);
private:
EditDataProvider *editDataProvider;
sigc::connection notebookconn;
bool photoLoadedOnce; // Used to indicated that a photo has been loaded yet
public: