From 80c58160840d0a859bba2e211985fb0b5bddaaaa Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Wed, 18 Nov 2020 13:52:07 +0100 Subject: [PATCH 001/129] Improve error logging and memory handling when reading tiff files --- rtengine/imageio.cc | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index aa18f1265..102d53b8e 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -25,6 +25,7 @@ #include #include #include +#include #include "rt_math.h" #include "procparams.h" #include "utils.h" @@ -792,6 +793,8 @@ int ImageIO::loadTIFF (const Glib::ustring &fname) if (!hasTag) { // These are needed TIFFClose(in); + fprintf(stderr, "Error 1 loading %s\n", fname.c_str()); + fflush(stderr); return IMIO_VARIANTNOTSUPPORTED; } @@ -800,6 +803,8 @@ int ImageIO::loadTIFF (const Glib::ustring &fname) if (config != PLANARCONFIG_CONTIG) { TIFFClose(in); + fprintf(stderr, "Error 2 loading %s\n", fname.c_str()); + fflush(stderr); return IMIO_VARIANTNOTSUPPORTED; } @@ -859,32 +864,33 @@ int ImageIO::loadTIFF (const Glib::ustring &fname) allocate (width, height); - unsigned char* linebuffer = new unsigned char[TIFFScanlineSize(in) * (samplesperpixel == 1 ? 3 : 1)]; + std::unique_ptr linebuffer(new unsigned char[TIFFScanlineSize(in) * (samplesperpixel == 1 ? 3 : 1)]); for (int row = 0; row < height; row++) { - if (TIFFReadScanline(in, linebuffer, row, 0) < 0) { + if (TIFFReadScanline(in, linebuffer.get(), row, 0) < 0) { TIFFClose(in); - delete [] linebuffer; + fprintf(stderr, "Error 3 loading %s\n", fname.c_str()); + fflush(stderr); return IMIO_READERROR; } if (samplesperpixel > 3) { for (int i = 0; i < width; i++) { - memcpy (linebuffer + i * 3 * bitspersample / 8, linebuffer + i * samplesperpixel * bitspersample / 8, 3 * bitspersample / 8); + memcpy(linebuffer.get() + i * 3 * bitspersample / 8, linebuffer.get() + i * samplesperpixel * bitspersample / 8, 3 * bitspersample / 8); } } else if (samplesperpixel == 1) { const size_t bytes = bitspersample / 8; for (int i = width - 1; i >= 0; --i) { - const unsigned char* const src = linebuffer + i * bytes; - unsigned char* const dest = linebuffer + i * 3 * bytes; + const unsigned char* const src = linebuffer.get() + i * bytes; + unsigned char* const dest = linebuffer.get() + i * 3 * bytes; memcpy(dest + 2 * bytes, src, bytes); memcpy(dest + 1 * bytes, src, bytes); memcpy(dest + 0 * bytes, src, bytes); } } - setScanline (row, linebuffer, bitspersample); + setScanline (row, linebuffer.get(), bitspersample); if (pl && !(row % 100)) { pl->setProgress ((double)(row + 1) / height); @@ -892,7 +898,6 @@ int ImageIO::loadTIFF (const Glib::ustring &fname) } TIFFClose(in); - delete [] linebuffer; if (pl) { pl->setProgressStr ("PROGRESSBAR_READY"); From aef7872792ff4d65db2cf60aa0e392b7bf163fb7 Mon Sep 17 00:00:00 2001 From: Desmis Date: Wed, 25 Nov 2020 15:10:45 +0100 Subject: [PATCH 002/129] Local adjustments - workaround Retinex Dehaze previewdE --- rtengine/improcfun.h | 2 +- rtengine/iplocallab.cc | 35 +++++++++++++++++++++++++---------- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index e7b6b176d..88b323790 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -360,7 +360,7 @@ public: void transit_shapedetect2(int call, int senstype, const LabImage * bufexporig, const LabImage * bufexpfin, LabImage * originalmask, const float hueref, const float chromaref, const float lumaref, float sobelref, float meansobel, float ** blend2, struct local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk); - void transit_shapedetect_retinex(int call, int senstype, LabImage * bufexporig, LabImage * bufmask, LabImage * buforigmas, float **buflight, float **bufchro, const float hueref, const float chromaref, const float lumaref, const struct local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk); + void transit_shapedetect_retinex(int call, int senstype, LabImage * bufexporig, LabImage * bufexpfin, LabImage * bufmask, LabImage * buforigmas, float **buflight, float **bufchro, const float hueref, const float chromaref, const float lumaref, struct local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk); void transit_shapedetect(int senstype, const LabImage *bufexporig, LabImage * originalmask, float **bufchro, bool HHutili, const float hueref, const float chromaref, const float lumaref, float sobelref, float meansobel, float ** blend2, const struct local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk); void exlabLocal(local_params& lp, int bfh, int bfw, int bfhr, int bfwr, LabImage* bufexporig, LabImage* lab, const LUTf& hltonecurve, const LUTf& shtonecurve, const LUTf& tonecurve, const float hueref, const float lumaref, const float chromaref); void Exclude_Local(float **deltaso, float hueref, float chromaref, float lumaref, float sobelref, float meansobel, const struct local_params & lp, const LabImage * original, LabImage * transformed, const LabImage * rsv, const LabImage * reserv, int cx, int cy, int sk); diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index b80e5fc78..1a25f849c 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -5053,8 +5053,10 @@ void ImProcFunctions::Exclude_Local(float **deltaso, float hueref, float chromar } + + -void ImProcFunctions::transit_shapedetect_retinex(int call, int senstype, LabImage * bufexporig, LabImage * bufmask, LabImage * buforigmas, float **buflight, float **bufchro, const float hueref, const float chromaref, const float lumaref, const struct local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk) +void ImProcFunctions::transit_shapedetect_retinex(int call, int senstype, LabImage * bufexporig, LabImage * bufexpfin, LabImage * bufmask, LabImage * buforigmas, float **buflight, float **bufchro, const float hueref, const float chromaref, const float lumaref, struct local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk) { //BENCHFUN @@ -5085,7 +5087,17 @@ void ImProcFunctions::transit_shapedetect_retinex(int call, int senstype, LabIma const float kab = balancedeltaE(lp.balance) / SQR(327.68f); const float kH = lp.balanceh; const float kch = balancedeltaE(kH); + if (lp.colorde == 0) { + lp.colorde = -1;//to avoid black + } +/* + float ampli = 1.f + std::fabs(lp.colorde); + ampli = 2.f + 0.5f * (ampli - 2.f); + float darklim = 5000.f; + float aadark = -1.f; + float bbdark = darklim; +*/ const bool showmas = lp.showmaskretimet == 3 ; const std::unique_ptr origblur(new LabImage(GW, GH)); @@ -5116,7 +5128,7 @@ void ImProcFunctions::transit_shapedetect_retinex(int call, int senstype, LabIma const float maxdE = 5.f + MAXSCOPE * varsens * (1 + 0.1f * lp.thr); const float mindElim = 2.f + MINSCOPE * limscope * lp.thr; const float maxdElim = 5.f + MAXSCOPE * limscope * (1 + 0.1f * lp.thr); - const float previewint = settings->previewselection; + float previewint = 0.f; //reducdE * 10000.f * lp.colorde; //settings->previewselection; #ifdef _OPENMP #pragma omp for schedule(dynamic,16) @@ -5168,17 +5180,19 @@ void ImProcFunctions::transit_shapedetect_retinex(int call, int senstype, LabIma } float cli, clc; + const float reducdE = calcreducdE(dE, maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, varsens) / 100.f; + previewint = reducdE * 10000.f * lp.colorde; //settings->previewselection; if (call == 2) { cli = buflight[y - ystart][x - xstart]; clc = previewreti ? settings->previewselection * 100.f : bufchro[y - ystart][x - xstart]; } else { cli = buflight[y][x]; - clc = previewreti ? settings->previewselection * 100.f : bufchro[y][x]; + // clc = previewreti ? settings->previewselection * 100.f : bufchro[y][x]; + clc = previewreti ? reducdE * 10000.f * lp.colorde: bufchro[y][x]; } - const float reducdE = calcreducdE(dE, maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, varsens) / 100.f; cli *= reducdE; clc *= reducdE; @@ -5252,7 +5266,8 @@ void ImProcFunctions::transit_shapedetect_retinex(int call, int senstype, LabIma transformed->b[y][x] = clipC(difb); } - if (previewreti) { + if (previewreti || lp.prevdE) { + difb = (bufexpfin->b[y][x] - original->b[y][x]) * localFactor; transformed->a[y][x] = 0.f; transformed->b[y][x] = previewint * difb; } @@ -12460,7 +12475,7 @@ void ImProcFunctions::Lab_Local( } } - if (lp.dehaze != 0 && lp.retiena) { + if ((lp.dehaze != 0 || lp.prevdE) && lp.retiena ) { int ystart = rtengine::max(static_cast(lp.yc - lp.lyT) - cy, 0); int yend = rtengine::min(static_cast(lp.yc + lp.ly) - cy, original->H); int xstart = rtengine::max(static_cast(lp.xc - lp.lxL) - cx, 0); @@ -12684,7 +12699,7 @@ void ImProcFunctions::Lab_Local( } } - transit_shapedetect_retinex(call, 4, bufreti, bufmask, buforigmas, buflight, bufchro, hueref, chromaref, lumaref, lp, original, transformed, cx, cy, sk); + transit_shapedetect_retinex(call, 4, bufreti, tmpl, bufmask, buforigmas, buflight, bufchro, hueref, chromaref, lumaref, lp, original, transformed, cx, cy, sk); if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed, multiThread); @@ -12786,7 +12801,7 @@ void ImProcFunctions::Lab_Local( } } - transit_shapedetect_retinex(call, 5, tmpl, bufmask, buforigmas, buflight, bufchro, hueref, chromaref, lumaref, lp, original, transformed, cx, cy, sk); + transit_shapedetect_retinex(call, 5, tmpl, tmpl, bufmask, buforigmas, buflight, bufchro, hueref, chromaref, lumaref, lp, original, transformed, cx, cy, sk); if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed, multiThread); @@ -13015,7 +13030,7 @@ void ImProcFunctions::Lab_Local( } } - transit_shapedetect_retinex(call, 4, bufreti, bufmask, buforigmas, buflight, bufchro, hueref, chromaref, lumaref, lp, original, transformed, cx, cy, sk); + transit_shapedetect_retinex(call, 4, bufreti, tmpl, bufmask, buforigmas, buflight, bufchro, hueref, chromaref, lumaref, lp, original, transformed, cx, cy, sk); if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed, multiThread); @@ -13112,7 +13127,7 @@ void ImProcFunctions::Lab_Local( } if (!lp.invret) { - transit_shapedetect_retinex(call, 5, tmpl, bufmask, buforigmas, buflight, bufchro, hueref, chromaref, lumaref, lp, original, transformed, cx, cy, sk); + transit_shapedetect_retinex(call, 5, tmpl, tmpl, bufmask, buforigmas, buflight, bufchro, hueref, chromaref, lumaref, lp, original, transformed, cx, cy, sk); if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed, multiThread); From 5c82ed13fb318d27e02bdc5c2646858383fd6f17 Mon Sep 17 00:00:00 2001 From: Desmis Date: Wed, 25 Nov 2020 16:44:20 +0100 Subject: [PATCH 003/129] Fixed previewdE for soft light - original retinex --- rtengine/iplocallab.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 1a25f849c..f1f2567e4 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -11872,7 +11872,7 @@ void ImProcFunctions::Lab_Local( } // soft light and retinex_pde - if (lp.strng > 1.f && call <= 3 && lp.sfena) { + if ((lp.strng > 1.f || lp.prevdE) && call <= 3 && lp.sfena) { int ystart = rtengine::max(static_cast(lp.yc - lp.lyT) - cy, 0); int yend = rtengine::min(static_cast(lp.yc + lp.ly) - cy, original->H); int xstart = rtengine::max(static_cast(lp.xc - lp.lxL) - cx, 0); From b4f4f4c01e1350d47116bc151286457f716c7384 Mon Sep 17 00:00:00 2001 From: Desmis Date: Fri, 27 Nov 2020 06:34:36 +0100 Subject: [PATCH 004/129] LA Changes to exposure response with tonecurve (#6009) --- rtengine/improcfun.h | 2 +- rtengine/iplocallab.cc | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 88b323790..95d14d5ef 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -362,7 +362,7 @@ public: void transit_shapedetect_retinex(int call, int senstype, LabImage * bufexporig, LabImage * bufexpfin, LabImage * bufmask, LabImage * buforigmas, float **buflight, float **bufchro, const float hueref, const float chromaref, const float lumaref, struct local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk); void transit_shapedetect(int senstype, const LabImage *bufexporig, LabImage * originalmask, float **bufchro, bool HHutili, const float hueref, const float chromaref, const float lumaref, float sobelref, float meansobel, float ** blend2, const struct local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk); - void exlabLocal(local_params& lp, int bfh, int bfw, int bfhr, int bfwr, LabImage* bufexporig, LabImage* lab, const LUTf& hltonecurve, const LUTf& shtonecurve, const LUTf& tonecurve, const float hueref, const float lumaref, const float chromaref); + void exlabLocal(local_params& lp, float strlap, int bfh, int bfw, int bfhr, int bfwr, LabImage* bufexporig, LabImage* lab, const LUTf& hltonecurve, const LUTf& shtonecurve, const LUTf& tonecurve, const float hueref, const float lumaref, const float chromaref); void Exclude_Local(float **deltaso, float hueref, float chromaref, float lumaref, float sobelref, float meansobel, const struct local_params & lp, const LabImage * original, LabImage * transformed, const LabImage * rsv, const LabImage * reserv, int cx, int cy, int sk); void DeNoise_Local(int call, const struct local_params& lp, LabImage* originalmask, int levred, float hueref, float lumaref, float chromaref, LabImage* original, LabImage* transformed, const LabImage &tmp1, int cx, int cy, int sk); diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index f1f2567e4..c13300872 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -2711,7 +2711,7 @@ void ImProcFunctions::softprocess(const LabImage* bufcolorig, array2D &bu } } -void ImProcFunctions::exlabLocal(local_params& lp, int bfh, int bfw, int bfhr, int bfwr, LabImage* bufexporig, LabImage* lab, const LUTf& hltonecurve, const LUTf& shtonecurve, const LUTf& tonecurve, const float hueref, const float lumaref, const float chromaref) +void ImProcFunctions::exlabLocal(local_params& lp, float strlap, int bfh, int bfw, int bfhr, int bfwr, LabImage* bufexporig, LabImage* lab, const LUTf& hltonecurve, const LUTf& shtonecurve, const LUTf& tonecurve, const float hueref, const float lumaref, const float chromaref) { //BENCHFUN //exposure local @@ -2746,10 +2746,10 @@ void ImProcFunctions::exlabLocal(local_params& lp, int bfh, int bfw, int bfhr, i deltaEforLaplace(dE.get(), diffde, bfwr, bfhr, bufexporig, hueref, chromaref, lumaref); - constexpr float alap = 600.f; - constexpr float blap = 100.f; - constexpr float aa = (alap - blap) / 50.f; - constexpr float bb = 100.f - 30.f * aa; + float alap = strlap * 600.f; + float blap = strlap * 100.f; + float aa = (alap - blap) / 50.f; + float bb = blap - 30.f * aa; float lap; if (diffde > 80.f) { @@ -5616,7 +5616,7 @@ void ImProcFunctions::InverseColorLight_Local(bool tonequ, bool tonecurv, int sp } } else if (senstype == 1) { //exposure - ImProcFunctions::exlabLocal(lp, GH, GW, GW, GH, original, temp.get(), hltonecurveloc, shtonecurveloc, tonecurveloc, hueref, lumaref, chromaref); + ImProcFunctions::exlabLocal(lp, 1.f, GH, GW, GW, GH, original, temp.get(), hltonecurveloc, shtonecurveloc, tonecurveloc, hueref, lumaref, chromaref); if (exlocalcurve) { #ifdef _OPENMP @@ -13318,19 +13318,21 @@ void ImProcFunctions::Lab_Local( if (exlocalcurve && localexutili) {// L=f(L) curve enhanced + #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif for (int ir = 0; ir < bfh; ir++) for (int jr = 0; jr < bfw; jr++) { - bufexpfin->L[ir][jr] = 0.5f * exlocalcurve[2.f * bufexporig->L[ir][jr]]; + bufexpfin->L[ir][jr] = 0.6f * bufexporig->L[ir][jr] + 0.2f * exlocalcurve[2.f * bufexporig->L[ir][jr]]; } - + if (lp.expcomp == 0.f) { lp.expcomp = 0.001f;// to enabled } - ImProcFunctions::exlabLocal(lp, bfh, bfw, bfhr, bfwr, bufexpfin.get(), bufexpfin.get(), hltonecurveloc, shtonecurveloc, tonecurveloc, hueref, lumaref, chromaref); + ImProcFunctions::exlabLocal(lp, 0.5f, bfh, bfw, bfhr, bfwr, bufexpfin.get(), bufexpfin.get(), hltonecurveloc, shtonecurveloc, tonecurveloc, hueref, lumaref, chromaref); + } else { @@ -13338,7 +13340,7 @@ void ImProcFunctions::Lab_Local( if(lp.laplacexp <= 0.1f) { lp.laplacexp = 0.2f; //force to use Laplacian wth very small values } - ImProcFunctions::exlabLocal(lp, bfh, bfw, bfhr, bfwr, bufexporig.get(), bufexpfin.get(), hltonecurveloc, shtonecurveloc, tonecurveloc, hueref, lumaref, chromaref); + ImProcFunctions::exlabLocal(lp, 1.f, bfh, bfw, bfhr, bfwr, bufexporig.get(), bufexpfin.get(), hltonecurveloc, shtonecurveloc, tonecurveloc, hueref, lumaref, chromaref); } } From 79545293d64551a7e0e7772ae19d333cc5040808 Mon Sep 17 00:00:00 2001 From: Desmis Date: Mon, 30 Nov 2020 08:44:15 +0100 Subject: [PATCH 005/129] Review ipwavelet denoise enable --- rtengine/ipwavelet.cc | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index fe6b7be29..7563ca75d 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -1055,6 +1055,7 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const levwavL = 7; } } + bool isdenoisL = (cp.lev0n > 0.1f || cp.lev1n > 0.1f || cp.lev2n > 0.1f || cp.lev3n > 0.1f || cp.lev4n > 0.1f); if (levwavL < 5 && cp.noiseena) { levwavL = 6; //to allow edge and denoise => I always allocate 3 (4) levels..because if user select wavelet it is to do something !! @@ -1102,7 +1103,7 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const madL[lvl][dir - 1] = SQR(Mad(WavCoeffs_L[dir], Wlvl_L * Hlvl_L)); if (settings->verbose) { - printf("Luminance noise estimate (sqr) madL=%.0f lvl=%i dir=%i\n", madL[lvl][dir - 1], lvl, dir - 1); + // printf("Luminance noise estimate (sqr) madL=%.0f lvl=%i dir=%i\n", madL[lvl][dir - 1], lvl, dir - 1); } } } @@ -1159,7 +1160,6 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const } else { kr4 = 1.f; } - if ((cp.lev0n > 0.1f || cp.lev1n > 0.1f || cp.lev2n > 0.1f || cp.lev3n > 0.1f || cp.lev4n > 0.1f) && cp.noiseena) { int edge = 6; vari[0] = rtengine::max(0.000001f, vari[0]); @@ -1226,12 +1226,12 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const if(cp.quamet == 0) { if (settings->verbose) { - printf("denoise standard\n"); + printf("denoise standard L\n"); } WaveletDenoiseAllL(*Ldecomp, noisevarlum, madL, vari, edge, 1); } else { if (settings->verbose) { - printf("denoise bishrink\n"); + printf("denoise bishrink L\n"); } WaveletDenoiseAll_BiShrinkL(*Ldecomp, noisevarlum, madL, vari, edge, 1); @@ -1792,11 +1792,17 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const if(levwava == 6) { edge = 1; } - if (cp.noiseena && ((cp.chromfi > 0.f || cp.chromco > 0.f) && cp.quamet == 0 )) { + if (cp.noiseena && ((cp.chromfi > 0.f || cp.chromco > 0.f) && cp.quamet == 0 && isdenoisL)) { + if (settings->verbose) { + printf("denoise standard a \n"); + } WaveletDenoiseAllAB(*Ldecomp, *adecomp, noisevarchrom, madL, variC, edge, noisevarab_r, true, false, false, 1); - } else if (cp.noiseena && ((cp.chromfi > 0.f && cp.chromco >= 0.f) && cp.quamet == 1 )){ + } else if (cp.noiseena && ((cp.chromfi > 0.f && cp.chromco >= 0.f) && cp.quamet == 1 && isdenoisL)){ + if (settings->verbose) { + printf("denoise bishrink a \n"); + } WaveletDenoiseAll_BiShrinkAB(*Ldecomp, *adecomp, noisevarchrom, madL, variC, edge, noisevarab_r, true, false, false, 1); WaveletDenoiseAllAB(*Ldecomp, *adecomp, noisevarchrom, madL, variC, edge, noisevarab_r, true, false, false, 1); @@ -1842,17 +1848,17 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const if (!bdecomp->memory_allocation_failed()) { // if (cp.noiseena && ((cp.chromfi > 0.f || cp.chromco > 0.f) && cp.chromco < 2.f )) { - if (cp.noiseena && ((cp.chromfi > 0.f || cp.chromco > 0.f) && cp.quamet == 0)) { + if (cp.noiseena && ((cp.chromfi > 0.f || cp.chromco > 0.f) && cp.quamet == 0 && isdenoisL)) { WaveletDenoiseAllAB(*Ldecomp, *bdecomp, noisevarchrom, madL, variCb, edge, noisevarab_r, true, false, false, 1); if (settings->verbose) { - printf("Denoise ab standard\n"); + printf("Denoise standard b\n"); } - } else if (cp.noiseena && ((cp.chromfi > 0.f && cp.chromco >= 0.f) && cp.quamet == 1 )){ + } else if (cp.noiseena && ((cp.chromfi > 0.f && cp.chromco >= 0.f) && cp.quamet == 1 && isdenoisL)){ WaveletDenoiseAll_BiShrinkAB(*Ldecomp, *bdecomp, noisevarchrom, madL, variCb, edge, noisevarab_r, true, false, false, 1); WaveletDenoiseAllAB(*Ldecomp, *bdecomp, noisevarchrom, madL, variCb, edge, noisevarab_r, true, false, false, 1); if (settings->verbose) { - printf("Denoise ab bishrink\n"); + printf("Denoise bishrink b\n"); } } @@ -1876,18 +1882,24 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const const std::unique_ptr bdecomp(new wavelet_decomposition(labco->data + 2 * datalen, labco->W, labco->H, levwavab, 1, skip, rtengine::max(1, wavNestedLevels), DaubLen)); if (!adecomp->memory_allocation_failed() && !bdecomp->memory_allocation_failed()) { - if (cp.noiseena && ((cp.chromfi > 0.f || cp.chromco > 0.f) && cp.quamet == 0)) { + if (cp.noiseena && ((cp.chromfi > 0.f || cp.chromco > 0.f) && cp.quamet == 0 && isdenoisL)) { WaveletDenoiseAllAB(*Ldecomp, *adecomp, noisevarchrom, madL, variC, edge, noisevarab_r, true, false, false, 1); - } else if (cp.chromfi > 0.f && cp.chromco >= 2.f){ + if (settings->verbose) { + printf("Denoise standard ab\n"); + } + } else if (cp.noiseena && ((cp.chromfi > 0.f || cp.chromco > 0.f) && cp.quamet == 1 && isdenoisL)) { WaveletDenoiseAll_BiShrinkAB(*Ldecomp, *adecomp, noisevarchrom, madL, variC, edge, noisevarab_r, true, false, false, 1); WaveletDenoiseAllAB(*Ldecomp, *adecomp, noisevarchrom, madL, variC, edge, noisevarab_r, true, false, false, 1); + if (settings->verbose) { + printf("Denoise bishrink ab\n"); + } } Evaluate2(*adecomp, meanab, meanNab, sigmaab, sigmaNab, MaxPab, MaxNab, wavNestedLevels); WaveletcontAllAB(labco, varhue, varchro, *adecomp, wavblcurve, waOpacityCurveW, cp, true, skip, meanab, sigmaab); - if (cp.noiseena && ((cp.chromfi > 0.f || cp.chromco > 0.f) && cp.quamet == 0)) { + if (cp.noiseena && ((cp.chromfi > 0.f || cp.chromco > 0.f) && cp.quamet == 0 && isdenoisL)) { WaveletDenoiseAllAB(*Ldecomp, *bdecomp, noisevarchrom, madL, variCb, edge, noisevarab_r, true, false, false, 1); - } else if (cp.chromfi > 0.f && cp.chromco >= 2.f){ + } else if(cp.noiseena && ((cp.chromfi > 0.f || cp.chromco > 0.f) && cp.quamet == 1 && isdenoisL)) { WaveletDenoiseAll_BiShrinkAB(*Ldecomp, *bdecomp, noisevarchrom, madL, variCb, edge, noisevarab_r, true, false, false, 1); WaveletDenoiseAllAB(*Ldecomp, *bdecomp, noisevarchrom, madL, variCb, edge, noisevarab_r, true, false, false, 1); } From 548f2103e2c84352b21fabb69e2f8e2ecfff0e55 Mon Sep 17 00:00:00 2001 From: Desmis Date: Thu, 3 Dec 2020 07:41:19 +0100 Subject: [PATCH 006/129] Change label history msg Lab adjustments --- rtdata/languages/default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 418f42288..3527bee31 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -754,7 +754,7 @@ HISTORY_MSG_489;DRC - Detail HISTORY_MSG_490;DRC - Amount HISTORY_MSG_491;White Balance HISTORY_MSG_492;RGB Curves -HISTORY_MSG_493;Local Adjustments +HISTORY_MSG_493;L*a*b* Adjustments HISTORY_MSG_494;Capture Sharpening HISTORY_MSG_496;Local Spot deleted HISTORY_MSG_497;Local Spot selected From 6f9da688834a166d5dd620122d14a6738d8f0429 Mon Sep 17 00:00:00 2001 From: Desmis Date: Wed, 9 Dec 2020 07:49:54 +0100 Subject: [PATCH 007/129] Ciecam - added cam16 to cam02 (#6017) * First change cat02 cat16 * Enable cat16 and cat02 * Clean comment code - change history msg * Change some labels and tooltips with ciecam0216 * Change default settings * Others default label and tooltip changes --- rtdata/languages/default | 145 ++++++++++---------- rtengine/ciecam02.cc | 281 +++++++++++++++++++++++---------------- rtengine/ciecam02.h | 34 ++--- rtengine/curves.cc | 10 +- rtengine/improcfun.cc | 25 ++-- rtengine/iplocallab.cc | 15 ++- rtengine/procparams.cc | 13 ++ rtengine/procparams.h | 1 + rtgui/colorappearance.cc | 39 +++++- rtgui/colorappearance.h | 5 +- rtgui/paramsedited.cc | 6 + rtgui/paramsedited.h | 1 + 12 files changed, 349 insertions(+), 226 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 3527bee31..00da0fae3 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -436,39 +436,39 @@ HISTORY_MSG_170;Vibrance - HH curve HISTORY_MSG_171;L*a*b* - LC curve HISTORY_MSG_172;L*a*b* - Restrict LC HISTORY_MSG_173;NR - Detail recovery -HISTORY_MSG_174;CIECAM02 -HISTORY_MSG_175;CAM02 - CAT02 adaptation -HISTORY_MSG_176;CAM02 - Viewing surround -HISTORY_MSG_177;CAM02 - Scene luminosity -HISTORY_MSG_178;CAM02 - Viewing luminosity -HISTORY_MSG_179;CAM02 - White-point model -HISTORY_MSG_180;CAM02 - Lightness (J) -HISTORY_MSG_181;CAM02 - Chroma (C) -HISTORY_MSG_182;CAM02 - Automatic CAT02 -HISTORY_MSG_183;CAM02 - Contrast (J) -HISTORY_MSG_184;CAM02 - Scene surround -HISTORY_MSG_185;CAM02 - Gamut control -HISTORY_MSG_186;CAM02 - Algorithm -HISTORY_MSG_187;CAM02 - Red/skin prot. -HISTORY_MSG_188;CAM02 - Brightness (Q) -HISTORY_MSG_189;CAM02 - Contrast (Q) -HISTORY_MSG_190;CAM02 - Saturation (S) -HISTORY_MSG_191;CAM02 - Colorfulness (M) -HISTORY_MSG_192;CAM02 - Hue (h) -HISTORY_MSG_193;CAM02 - Tone curve 1 -HISTORY_MSG_194;CAM02 - Tone curve 2 -HISTORY_MSG_195;CAM02 - Tone curve 1 -HISTORY_MSG_196;CAM02 - Tone curve 2 -HISTORY_MSG_197;CAM02 - Color curve -HISTORY_MSG_198;CAM02 - Color curve -HISTORY_MSG_199;CAM02 - Output histograms -HISTORY_MSG_200;CAM02 - Tone mapping +HISTORY_MSG_174;CIECAM02/16 +HISTORY_MSG_175;CAM02/16 - CAT02/16 adaptation +HISTORY_MSG_176;CAM02/16 - Viewing surround +HISTORY_MSG_177;CAM02/16 - Scene luminosity +HISTORY_MSG_178;CAM02/16 - Viewing luminosity +HISTORY_MSG_179;CAM02/16 - White-point model +HISTORY_MSG_180;CAM02/16 - Lightness (J) +HISTORY_MSG_181;CAM02/16 - Chroma (C) +HISTORY_MSG_182;CAM02/16 - Automatic CAT02/16 +HISTORY_MSG_183;CAM02/16 - Contrast (J) +HISTORY_MSG_184;CAM02/16 - Scene surround +HISTORY_MSG_185;CAM02/16 - Gamut control +HISTORY_MSG_186;CAM02/16 - Algorithm +HISTORY_MSG_187;CAM02/16 - Red/skin prot. +HISTORY_MSG_188;CAM02/16 - Brightness (Q) +HISTORY_MSG_189;CAM02/16 - Contrast (Q) +HISTORY_MSG_190;CAM02/16 - Saturation (S) +HISTORY_MSG_191;CAM02/16 - Colorfulness (M) +HISTORY_MSG_192;CAM02/16 - Hue (h) +HISTORY_MSG_193;CAM02/16 - Tone curve 1 +HISTORY_MSG_194;CAM02/16 - Tone curve 2 +HISTORY_MSG_195;CAM02/16 - Tone curve 1 +HISTORY_MSG_196;CAM02/16 - Tone curve 2 +HISTORY_MSG_197;CAM02/16 - Color curve +HISTORY_MSG_198;CAM02/16 - Color curve +HISTORY_MSG_199;CAM02/16 - Output histograms +HISTORY_MSG_200;CAM02/16 - Tone mapping HISTORY_MSG_201;NR - Chrominance - R&G HISTORY_MSG_202;NR - Chrominance - B&Y HISTORY_MSG_203;NR - Color space HISTORY_MSG_204;LMMSE enhancement steps -HISTORY_MSG_205;CAM02 - Hot/bad pixel filter -HISTORY_MSG_206;CAT02 - Auto scene luminosity +HISTORY_MSG_205;CAT02/16 - Hot/bad pixel filter +HISTORY_MSG_206;CAT02/16 - Auto scene luminosity HISTORY_MSG_207;Defringe - Hue curve HISTORY_MSG_208;WB - B/R equalizer HISTORY_MSG_210;GF - Angle @@ -737,15 +737,15 @@ HISTORY_MSG_472;PS Smooth transitions HISTORY_MSG_473;PS Use lmmse HISTORY_MSG_474;PS Equalize HISTORY_MSG_475;PS Equalize channel -HISTORY_MSG_476;CAM02 - Temp out -HISTORY_MSG_477;CAM02 - Green out -HISTORY_MSG_478;CAM02 - Yb out -HISTORY_MSG_479;CAM02 - CAT02 adaptation out -HISTORY_MSG_480;CAM02 - Automatic CAT02 out -HISTORY_MSG_481;CAM02 - Temp scene -HISTORY_MSG_482;CAM02 - Green scene -HISTORY_MSG_483;CAM02 - Yb scene -HISTORY_MSG_484;CAM02 - Auto Yb scene +HISTORY_MSG_476;CAM02/16 - Temp out +HISTORY_MSG_477;CAM02/16 - Green out +HISTORY_MSG_478;CAM02/16 - Yb out +HISTORY_MSG_479;CAM02/16 - CAT02/16 adaptation out +HISTORY_MSG_480;CAM02/16 - Automatic CAT02/16 out +HISTORY_MSG_481;CAM02/16 - Temp scene +HISTORY_MSG_482;CAM02/16 - Green scene +HISTORY_MSG_483;CAM02/16 - Yb scene +HISTORY_MSG_484;CAM02/16 - Auto Yb scene HISTORY_MSG_485;Lens Correction HISTORY_MSG_486;Lens Correction - Camera HISTORY_MSG_487;Lens Correction - Lens @@ -1205,7 +1205,7 @@ HISTORY_MSG_956;Local - CH Curve HISTORY_MSG_957;Local - Denoise mode HISTORY_MSG_958;Local - Show/hide settings HISTORY_MSG_959;Local - Inverse blur -HISTORY_MSG_960;Local - Log encoding - cat02 +HISTORY_MSG_960;Local - Log encoding - cat16 HISTORY_MSG_961;Local - Log encoding Ciecam HISTORY_MSG_962;Local - Log encoding Absolute luminance source HISTORY_MSG_963;Local - Log encoding Absolute luminance target @@ -1230,8 +1230,9 @@ HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance HISTORY_MSG_BLUWAV;Attenuation response -HISTORY_MSG_CAT02PRESET;Cat02 automatic preset +HISTORY_MSG_CAT02PRESET;Cat02/16 automatic preset HISTORY_MSG_CATCOMPLEX;Ciecam complexity +HISTORY_MSG_CATMODEL;CAM Model HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction @@ -1541,7 +1542,7 @@ PARTIALPASTE_CACORRECTION;Chromatic aberration correction PARTIALPASTE_CHANNELMIXER;Channel mixer PARTIALPASTE_CHANNELMIXERBW;Black-and-white PARTIALPASTE_COARSETRANS;Coarse rotation/flipping -PARTIALPASTE_COLORAPP;CIECAM02 +PARTIALPASTE_COLORAPP;CIECAM02/16 PARTIALPASTE_COLORGROUP;Color Related Settings PARTIALPASTE_COLORTONING;Color toning PARTIALPASTE_COMMONTRANSFORMPARAMS;Auto-fill @@ -1978,34 +1979,34 @@ TP_COLORAPP_ALGO_TOOLTIP;Lets you choose between parameter subsets or all parame TP_COLORAPP_BADPIXSL;Hot/bad pixel filter TP_COLORAPP_BADPIXSL_TOOLTIP;Suppression of hot/bad (brightly colored) pixels.\n0 = No effect\n1 = Median\n2 = Gaussian.\nAlternatively, adjust the image to avoid very dark shadows.\n\nThese artifacts are due to limitations of CIECAM02. TP_COLORAPP_BRIGHT;Brightness (Q) -TP_COLORAPP_BRIGHT_TOOLTIP;Brightness in CIECAM02 is the amount of perceived light emanating from a stimulus and differs from L*a*b* and RGB brightness. +TP_COLORAPP_BRIGHT_TOOLTIP;Brightness in CIECAM02/16 is the amount of perceived light emanating from a stimulus and differs from L*a*b* and RGB brightness. TP_COLORAPP_CAT02ADAPTATION_TOOLTIP;When setting manually, values above 65 are recommended. TP_COLORAPP_CHROMA;Chroma (C) TP_COLORAPP_CHROMA_M;Colorfulness (M) -TP_COLORAPP_CHROMA_M_TOOLTIP;Colorfulness in CIECAM02 is the perceived amount of hue in relation to gray, an indicator that a stimulus appears to be more or less colored. +TP_COLORAPP_CHROMA_M_TOOLTIP;Colorfulness in CIECAM02/16 is the perceived amount of hue in relation to gray, an indicator that a stimulus appears to be more or less colored. TP_COLORAPP_CHROMA_S;Saturation (S) -TP_COLORAPP_CHROMA_S_TOOLTIP;Saturation in CIECAM02 corresponds to the color of a stimulus in relation to its own brightness, differs from L*a*b* and RGB saturation. -TP_COLORAPP_CHROMA_TOOLTIP;Chroma in CIECAM02 corresponds to the color of a stimulus relative to the clarity of a stimulus that appears white under identical conditions, differs from L*a*b* and RGB chroma. -TP_COLORAPP_CIECAT_DEGREE;CAT02 adaptation -TP_COLORAPP_CONTRAST;Contrast (J), +TP_COLORAPP_CHROMA_S_TOOLTIP;Saturation in CIECAM02/16 corresponds to the color of a stimulus in relation to its own brightness, differs from L*a*b* and RGB saturation. +TP_COLORAPP_CHROMA_TOOLTIP;Chroma in CIECAM02/16 corresponds to the color of a stimulus relative to the clarity of a stimulus that appears white under identical conditions, differs from L*a*b* and RGB chroma. +TP_COLORAPP_CIECAT_DEGREE;CAT02/16 adaptation +TP_COLORAPP_CONTRAST;Contrast (J) TP_COLORAPP_CONTRAST_Q;Contrast (Q) -TP_COLORAPP_CONTRAST_Q_TOOLTIP;Contrast (Q) based on brightness, differs from L*a*b* and RGB contrast. -TP_COLORAPP_CONTRAST_TOOLTIP;Contrast (J) based on lightness, differs from L*a*b* and RGB contrast. +TP_COLORAPP_CONTRAST_Q_TOOLTIP;Contrast (Q) in CIECAM02/16 is based on brightness, differs from L*a*b* and RGB contrast. +TP_COLORAPP_CONTRAST_TOOLTIP;Contrast (J) in CIECAM02/16 is based on lightness, differs from L*a*b* and RGB contrast. TP_COLORAPP_CURVEEDITOR1;Tone curve 1 -TP_COLORAPP_CURVEEDITOR1_TOOLTIP;Shows the histogram of L* (L*a*b*) before CIECAM02.\nIf the "CIECAM02 output histograms in curves" checkbox is enabled, shows the histogram of J or Q after CIECAM02.\n\nJ and Q are not shown in the main histogram panel.\n\nFor final output refer to the main histogram panel. +TP_COLORAPP_CURVEEDITOR1_TOOLTIP;Shows the histogram of L* (L*a*b*) before CIECAM02/16.\nIf the "CIECAM02/16 output histograms in curves" checkbox is enabled, shows the histogram of J or Q after CIECAM02/16.\n\nJ and Q are not shown in the main histogram panel.\n\nFor final output refer to the main histogram panel. TP_COLORAPP_CURVEEDITOR2;Tone curve 2 TP_COLORAPP_CURVEEDITOR2_TOOLTIP;Same usage as with the second exposure tone curve. TP_COLORAPP_CURVEEDITOR3;Color curve -TP_COLORAPP_CURVEEDITOR3_TOOLTIP;Adjust either chroma, saturation or colorfulness.\n\nShows the histogram of chromaticity (L*a*b*) before CIECAM02.\nIf the "CIECAM02 output histograms in curves" checkbox is enabled, shows the histogram of C, S or M after CIECAM02.\n\nC, S and M are not shown in the main histogram panel.\nFor final output refer to the main histogram panel. -TP_COLORAPP_DATACIE;CIECAM02 output histograms in curves -TP_COLORAPP_DATACIE_TOOLTIP;When enabled, histograms in CIECAM02 curves show approximate values/ranges for J or Q, and C, s or M after the CIECAM02 adjustments.\nThis selection does not impact the main histogram panel.\n\nWhen disabled, histograms in CIECAM02 curves show L*a*b* values before CIECAM02 adjustments. -TP_COLORAPP_DEGREE_TOOLTIP;CAT02 is a chromatic adaptation, it converts the values of an image whose white point is that of a given illuminant (for example D65), into new values whose white point is that of the new illuminant - see WP Model (for example D50 or D55). -TP_COLORAPP_DEGREOUT_TOOLTIP;CAT02 is a chromatic adaptation, it converts the values of an image whose white point is that of a given illuminant (for example D50), into new values whose white point is that of the new illuminant - see WP model (for example D75). -TP_COLORAPP_FREE;Free temp+green + CAT02 + [output] +TP_COLORAPP_CURVEEDITOR3_TOOLTIP;Adjust either chroma, saturation or colorfulness.\n\nShows the histogram of chromaticity (L*a*b*) before CIECAM02/16.\nIf the "CIECAM02/16 output histograms in curves" checkbox is enabled, shows the histogram of C, S or M after CIECAM02/16.\n\nC, S and M are not shown in the main histogram panel.\nFor final output refer to the main histogram panel. +TP_COLORAPP_DATACIE;CIECAM02/16 output histograms in curves +TP_COLORAPP_DATACIE_TOOLTIP;When enabled, histograms in CIECAM02/16 curves show approximate values/ranges for J or Q, and C, s or M after the CIECAM02/16 adjustments.\nThis selection does not impact the main histogram panel.\n\nWhen disabled, histograms in CIECAM02/16 curves show L*a*b* values before CIECAM02/16 adjustments. +TP_COLORAPP_DEGREE_TOOLTIP;CAT02/16 is a chromatic adaptation, it converts the values of an image whose white point is that of a given illuminant (for example D65), into new values whose white point is that of the new illuminant - see WP Model (for example D50 or D55). +TP_COLORAPP_DEGREOUT_TOOLTIP;CAT02/16 is a chromatic adaptation, it converts the values of an image whose white point is that of a given illuminant (for example D50), into new values whose white point is that of the new illuminant - see WP model (for example D75). +TP_COLORAPP_FREE;Free temp+green + CAT02/16 + [output] TP_COLORAPP_GAMUT;Gamut control (L*a*b*) TP_COLORAPP_GAMUT_TOOLTIP;Allow gamut control in L*a*b* mode. TP_COLORAPP_GEN;Settings - Preset -TP_COLORAPP_GEN_TOOLTIP;This module is based on the CIECAM02 color appearance model, which was designed to better simulate how human vision perceives colors under different lighting conditions, e.g., against different backgrounds.\nIt takes into account the environment of each color and modifies its appearance to get as close as possible to human perception.\nIt also adapts the output to the intended viewing conditions (monitor, TV, projector, printer, etc.) so that the chromatic appearance is preserved across the scene and display environments. +TP_COLORAPP_GEN_TOOLTIP;This module is based on the CIECAM color appearance model, which was designed to better simulate how human vision perceives colors under different lighting conditions, e.g., against different backgrounds.\nIt takes into account the environment of each color and modifies its appearance to get as close as possible to human perception.\nIt also adapts the output to the intended viewing conditions (monitor, TV, projector, printer, etc.) so that the chromatic appearance is preserved across the scene and display environments. TP_COLORAPP_HUE;Hue (h) TP_COLORAPP_HUE_TOOLTIP;Hue (h) is the degree to which a stimulus can be described as similar to a color described as red, green, blue and yellow. TP_COLORAPP_IL41;D41 @@ -2018,19 +2019,23 @@ TP_COLORAPP_ILA;Incandescent StdA 2856K TP_COLORAPP_ILFREE;Free TP_COLORAPP_ILLUM;Illuminant TP_COLORAPP_ILLUM_TOOLTIP;Select the illuminant closest to the shooting conditions.\nIn general D50, but it can change depending on the time and lattitude. -TP_COLORAPP_LABEL;Color Appearance & Lighting (CIECAM02) +TP_COLORAPP_LABEL;Color Appearance & Lighting (CIECAM02/16) TP_COLORAPP_LABEL_CAM02;Image Adjustments TP_COLORAPP_LABEL_SCENE;Scene Conditions TP_COLORAPP_LABEL_VIEWING;Viewing Conditions TP_COLORAPP_LIGHT;Lightness (J) -TP_COLORAPP_LIGHT_TOOLTIP;Lightness in CIECAM02 is the clarity of a stimulus relative to the clarity of a stimulus that appears white under similar viewing conditions, differs from L*a*b* and RGB lightness. +TP_COLORAPP_LIGHT_TOOLTIP;Lightness in CIECAM02/16 is the clarity of a stimulus relative to the clarity of a stimulus that appears white under similar viewing conditions, differs from L*a*b* and RGB lightness. TP_COLORAPP_MEANLUMINANCE;Mean luminance (Yb%) TP_COLORAPP_MODEL;WP Model -TP_COLORAPP_MODEL_TOOLTIP;White-Point Model.\n\nWB [RT] + [output]: RT's white balance is used for the scene, CIECAM02 is set to D50, and the output device's white balance is set in Viewing Conditions.\n\nWB [RT+CAT02] + [output]: RT's white balance settings are used by CAT02 and the output device's white balance is set in Viewing Conditions.\n\nFree temp+green + CAT02 + [output]: temp and green are selected by the user, the output device's white balance is set in Viewing Conditions. +TP_COLORAPP_MODEL_TOOLTIP;White-Point Model.\n\nWB [RT] + [output]: RT's white balance is used for the scene, CIECAM02/16 is set to D50, and the output device's white balance is set in Viewing Conditions.\n\nWB [RT+CAT02/16] + [output]: RT's white balance settings are used by CAT02 and the output device's white balance is set in Viewing Conditions.\n\nFree temp+green + CAT02/16 + [output]: temp and green are selected by the user, the output device's white balance is set in Viewing Conditions. +TP_COLORAPP_MODELCAT;CAM Model +TP_COLORAPP_MODELCAT_TOOLTIP;Allows you to choose between CIECAM02 or CIECAM16.\n CIECAM02 will sometimes be more accurate.\n CIECAM16 should generate fewer artifacts +TP_COLORAPP_MOD02;CIECAM02 +TP_COLORAPP_MOD16;CIECAM16 TP_COLORAPP_NEUTRAL;Reset TP_COLORAPP_NEUTRAL_TIP;Reset all sliders checkbox and curves to their default values -TP_COLORAPP_PRESETCAT02;Preset cat02 automatic - Symetric mode -TP_COLORAPP_PRESETCAT02_TIP;Set combobox, sliders, temp, green so that Cat02 automatic is preset.\nYou can change illuminant shooting conditions.\nYou must change Cat02 adaptation Viewing conditions if needed.\nYou can change Temperature and Tint Viewing conditions if needed, and other settings if needed. +TP_COLORAPP_PRESETCAT02;Preset cat02/16 automatic - Symmetric mode +TP_COLORAPP_PRESETCAT02_TIP;Set combobox, sliders, temp, green so that Cat02/16 automatic is preset.\nYou can change illuminant shooting conditions.\nYou must change Cat02/16 adaptation Viewing conditions if needed.\nYou can change Temperature and Tint Viewing conditions if needed, and other settings if needed. TP_COLORAPP_RSTPRO;Red & skin-tones protection TP_COLORAPP_RSTPRO_TOOLTIP;Red & skin-tones protection affects both sliders and curves. TP_COLORAPP_SOURCEF_TOOLTIP;Corresponds to the shooting conditions and how to bring the conditions and data back to a "normal" area. Normal" means average or standard conditions and data, i.e. without taking into account CIECAM corrections. @@ -2053,11 +2058,11 @@ TP_COLORAPP_TCMODE_SATUR;Saturation TP_COLORAPP_TEMP2_TOOLTIP;Either symmetrical mode temp = White balance.\nEither select illuminant always set Tint=1.\n\nA temp=2856\nD41 temp=4100\nD50 temp=5003\nD55 temp=5503\nD60 temp=6000\nD65 temp=6504\nD75 temp=7504 TP_COLORAPP_TEMPOUT_TOOLTIP;Disable to change temperature and tint TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD41 temp=4100\nD50 temp=5003\nD55 temp=5503\nD60 temp=6000\nD65 temp=6504\nD75 temp=7504 -TP_COLORAPP_TONECIE;Tone mapping using CIECAM02 +TP_COLORAPP_TONECIE;Tone mapping using CIECAM02/16 TP_COLORAPP_TONECIE_TOOLTIP;If this option is disabled, tone mapping is done in L*a*b* space.\nIf this option is enabled, tone mapping is done using CIECAM02.\nThe Tone Mapping tool must be enabled for this setting to take effect. TP_COLORAPP_VIEWINGF_TOOLTIP;Takes into account the support on which the final image will be viewed (monitor, TV, projector, printer, ...), as well as its environment. This process will take the data coming from process "Image Adjustments" and "bring" it to the support in such a way that the viewing conditions and its environment are taken into account. TP_COLORAPP_VIEWING_ABSOLUTELUMINANCE_TOOLTIP;Absolute luminance of the viewing environment\n(usually 16 cd/m²). -TP_COLORAPP_WBCAM;WB [RT+CAT02] + [output] +TP_COLORAPP_WBCAM;WB [RT+CAT02/16] + [output] TP_COLORAPP_WBRT;WB [RT] + [output] TP_COLORAPP_YBOUT_TOOLTIP;Yb is the relative luminance of the background, expressed in % of gray. A gray at 18% corresponds to a background luminance expressed in CIE L of 50%.\nThis data must take into account the average luminance of the image TP_COLORAPP_YBSCEN_TOOLTIP;Yb is the relative luminance of the background, expressed in % of gray. A gray at 18% corresponds to a background luminance expressed in CIE L of 50%.\nThis data is calculated from the average luminance of the image @@ -2457,7 +2462,7 @@ TP_LOCALLAB_BUTTON_DEL;Delete TP_LOCALLAB_BUTTON_DUPL;Duplicate TP_LOCALLAB_BUTTON_REN;Rename TP_LOCALLAB_BUTTON_VIS;Show/Hide -TP_LOCALLAB_CATAD;Chromatic adaptation - Cat02 +TP_LOCALLAB_CATAD;Chromatic adaptation - Cat16 TP_LOCALLAB_CBDL;Contrast by Detail Levels TP_LOCALLAB_CBDLCLARI_TOOLTIP;Enhances local contrast of the midtones. TP_LOCALLAB_CBDL_ADJ_TOOLTIP;Same as wavelets.\nThe first level (0) acts on 2x2 pixel details.\nThe last level (5) acts on 64x64 pixel details. @@ -2476,7 +2481,7 @@ TP_LOCALLAB_CHROMASKCOL;Chroma TP_LOCALLAB_CHROMASK_TOOLTIP;Changes the chroma of the mask if one exists (i.e. C(C) or LC(H) is activated). TP_LOCALLAB_CHRRT;Chroma TP_LOCALLAB_CIEC;Use Ciecam environment parameters -TP_LOCALLAB_CIECAMLOG_TOOLTIP;This module is based on the CIECAM02 color appearance model which was designed to better simulate how human vision perceives colors under different lighting conditions.\nThe first Ciecam process 'Scene conditions' is carried out by Log encoding, it also uses 'Absolute luminance' at the time of shooting.\nThe second Ciecam process 'Image adjustments' is simplified and uses only 3 variables (local contrast, contrast J, saturation s).\nThe third Ciecam process 'Viewing conditions' adapts the output to the intended viewing conditions (monitor, TV, projector, printer, etc.) so that the chromatic and contrast appearance is preserved across the display environment. +TP_LOCALLAB_CIECAMLOG_TOOLTIP;This module is based on the CIECAM color appearance model which was designed to better simulate how human vision perceives colors under different lighting conditions.\nThe first Ciecam process 'Scene conditions' is carried out by Log encoding, it also uses 'Absolute luminance' at the time of shooting.\nThe second Ciecam process 'Image adjustments' is simplified and uses only 3 variables (local contrast, contrast J, saturation s).\nThe third Ciecam process 'Viewing conditions' adapts the output to the intended viewing conditions (monitor, TV, projector, printer, etc.) so that the chromatic and contrast appearance is preserved across the display environment. TP_LOCALLAB_CIRCRADIUS;Spot size TP_LOCALLAB_CIRCRAD_TOOLTIP;Contains the references of the RT-spot, useful for shape detection (hue, luma, chroma, Sobel).\nLow values may be useful for treating foliage.\nHigh values may be useful for treating skin TP_LOCALLAB_CLARICRES;Merge chroma @@ -2709,8 +2714,8 @@ TP_LOCALLAB_LOGCOLORFL;Colorfulness (M) TP_LOCALLAB_LOGCOLORF_TOOLTIP;Perceived amount of hue in relation to gray.\nIndicator that a stimulus appears more or less colored. TP_LOCALLAB_LOGCONQL;Contrast (Q) TP_LOCALLAB_LOGCONTL;Contrast (J) -TP_LOCALLAB_LOGCONTL_TOOLTIP;Contrast (J) in CIECAM02 takes into account the increase in perceived coloration with luminance. -TP_LOCALLAB_LOGCONTQ_TOOLTIP;Contrast (Q) in CIECAM02 takes into account the increase in perceived coloration with brightness. +TP_LOCALLAB_LOGCONTL_TOOLTIP;Contrast (J) in CIECAM16 takes into account the increase in perceived coloration with luminance. +TP_LOCALLAB_LOGCONTQ_TOOLTIP;Contrast (Q) in CIECAM16 takes into account the increase in perceived coloration with brightness. TP_LOCALLAB_LOGDETAIL_TOOLTIP;Acts mainly on high frequencies. TP_LOCALLAB_LOGENCOD_TOOLTIP;Tone Mapping with Logarithmic encoding (ACES).\nUseful for underexposed images or images with high dynamic range.\n\nTwo-step process : 1) Dynamic Range calculation 2) Manual adjustment TP_LOCALLAB_LOGEXP;All tools @@ -2725,7 +2730,7 @@ TP_LOCALLAB_LOGLIN;Logarithm mode TP_LOCALLAB_LOGPFRA;Relative Exposure Levels TP_LOCALLAB_LOGREPART;Strength TP_LOCALLAB_LOGREPART_TOOLTIP;Allows you to adjust the relative strength of the log-encoded image with respect to the original image.\nDoes not affect the Ciecam component. -TP_LOCALLAB_LOGSATURL_TOOLTIP;Saturation (s) in CIECAM02 corresponds to the color of a stimulus in relation to its own brightness.\nActs mainly on medium and highlights tones +TP_LOCALLAB_LOGSATURL_TOOLTIP;Saturation (s) in CIECAM16 corresponds to the color of a stimulus in relation to its own brightness.\nActs mainly on medium and highlights tones TP_LOCALLAB_LOGSCENE_TOOLTIP;Corresponds to the shooting conditions. TP_LOCALLAB_LOGSRCGREY_TOOLTIP;Estimated gray point value of the image. TP_LOCALLAB_LOGSURSOUR_TOOLTIP;Changes tones and colors to take into account the Scene conditions.\n\nAverage: Average light environment (standard). The image will not change.\n\nDim: Dim environment. The image will become slightly bright. @@ -3709,7 +3714,7 @@ ZOOMPANEL_ZOOMFITCROPSCREEN;Fit crop to screen\nShortcut: f ZOOMPANEL_ZOOMFITSCREEN;Fit whole image to screen\nShortcut: Alt-f ZOOMPANEL_ZOOMIN;Zoom In\nShortcut: + ZOOMPANEL_ZOOMOUT;Zoom Out\nShortcut: - -//TP_LOCALLAB_CIECAMLOG_TOOLTIP;This module is based on the CIECAM02 color appearance model which was designed to better simulate how human vision perceives colors under different lighting conditions.\nOnly the third Ciecam process (Viewing conditions - Target) is taken into account, as well as part of the second (contrast J, saturation s) , as well as some data from the first process (Scene conditions - Source) which is used for the Log encoding.\nIt also adapts the output to the intended viewing conditions (monitor, TV, projector, printer, etc.) so that the chromatic and contrast appearance is preserved across the display environment. +//TP_LOCALLAB_CIECAMLOG_TOOLTIP;This module is based on the CIECAM color appearance model which was designed to better simulate how human vision perceives colors under different lighting conditions.\nOnly the third Ciecam process (Viewing conditions - Target) is taken into account, as well as part of the second (contrast J, saturation s) , as well as some data from the first process (Scene conditions - Source) which is used for the Log encoding.\nIt also adapts the output to the intended viewing conditions (monitor, TV, projector, printer, etc.) so that the chromatic and contrast appearance is preserved across the display environment. //TP_WAVELET_DENH;Low levels (1234)- Finest details //TP_WAVELET_DENL;High levels - Coarsest details //TP_WAVELET_DENLH;Guided threshold by detail levels 1-4 diff --git a/rtengine/ciecam02.cc b/rtengine/ciecam02.cc index c591bcb2c..dff12aa02 100644 --- a/rtengine/ciecam02.cc +++ b/rtengine/ciecam02.cc @@ -2,7 +2,7 @@ * This file is part of RawTherapee. * * Copyright (c) 2004-2010 Gabor Horvath - * + * Changes in Ciecam02 with Ciecam16 Jacques Desmis jdesmis@gmail.com 12/2020 * RawTherapee is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or @@ -182,26 +182,30 @@ float Ciecam02::calculate_fl_from_la_ciecam02float ( float la ) return (0.2f * k * la5) + (0.1f * (1.0f - k) * (1.0f - k) * std::cbrt (la5)); } -float Ciecam02::achromatic_response_to_whitefloat ( float x, float y, float z, float d, float fl, float nbb ) +float Ciecam02::achromatic_response_to_whitefloat ( float x, float y, float z, float d, float fl, float nbb, int c16) { float r, g, b; float rc, gc, bc; float rp, gp, bp; float rpa, gpa, bpa; // gamu = 1; - xyz_to_cat02float ( r, g, b, x, y, z); + xyz_to_cat02float ( r, g, b, x, y, z, c16); rc = r * (((y * d) / r) + (1.0f - d)); gc = g * (((y * d) / g) + (1.0f - d)); bc = b * (((y * d) / b) + (1.0f - d)); - cat02_to_hpefloat ( rp, gp, bp, rc, gc, bc); -// if (gamu == 1) { //gamut correction M.H.Brill S.Susstrunk - rp = MAXR (rp, 0.0f); - gp = MAXR (gp, 0.0f); - bp = MAXR (bp, 0.0f); -// } + if(c16 == 1) { + cat02_to_hpefloat ( rp, gp, bp, rc, gc, bc, c16); + rp = MAXR (rp, 0.0f); + gp = MAXR (gp, 0.0f); + bp = MAXR (bp, 0.0f); + } else { + rp = MAXR (rc, 0.0f); + gp = MAXR (gc, 0.0f); + bp = MAXR (bc, 0.0f); + } rpa = nonlinear_adaptationfloat ( rp, fl ); gpa = nonlinear_adaptationfloat ( gp, fl ); @@ -210,97 +214,121 @@ float Ciecam02::achromatic_response_to_whitefloat ( float x, float y, float z, f return ((2.0f * rpa) + gpa + ((1.0f / 20.0f) * bpa) - 0.305f) * nbb; } -void Ciecam02::xyz_to_cat02float ( float &r, float &g, float &b, float x, float y, float z) +void Ciecam02::xyz_to_cat02float ( float &r, float &g, float &b, float x, float y, float z, int c16) { -// gamu = 1; -// -// if (gamu == 0) { -// r = ( 0.7328f * x) + (0.4296f * y) - (0.1624f * z); -// g = (-0.7036f * x) + (1.6975f * y) + (0.0061f * z); -// b = ( 0.0030f * x) + (0.0136f * y) + (0.9834f * z); -// } else if (gamu == 1) { //gamut correction M.H.Brill S.Susstrunk + //original cat02 //r = ( 0.7328 * x) + (0.4296 * y) - (0.1624 * z); //g = (-0.7036 * x) + (1.6975 * y) + (0.0061 * z); //b = ( 0.0000 * x) + (0.0000 * y) + (1.0000 * z); - r = ( 1.007245f * x) + (0.011136f * y) - (0.018381f * z); //Changjun Li - g = (-0.318061f * x) + (1.314589f * y) + (0.003471f * z); - b = ( 0.0000f * x) + (0.0000f * y) + (1.0000f * z); -// } + if(c16 == 1) {//cat02 + r = ( 1.007245f * x) + (0.011136f * y) - (0.018381f * z); //Changjun Li + g = (-0.318061f * x) + (1.314589f * y) + (0.003471f * z); + b = ( 0.0000f * x) + (0.0000f * y) + (1.0000f * z); + } else {//cat16 + r = ( 0.401288f * x) + (0.650173f * y) - (0.051461f * z); //cat16 + g = (-0.250268f * x) + (1.204414f * y) + (0.045854f * z); + b = ( -0.002079f * x) + (0.048952f * y) + (0.953127f * z); + } + } #ifdef __SSE2__ -void Ciecam02::xyz_to_cat02float ( vfloat &r, vfloat &g, vfloat &b, vfloat x, vfloat y, vfloat z ) +void Ciecam02::xyz_to_cat02float ( vfloat &r, vfloat &g, vfloat &b, vfloat x, vfloat y, vfloat z, int c16) { //gamut correction M.H.Brill S.Susstrunk - r = ( F2V (1.007245f) * x) + (F2V (0.011136f) * y) - (F2V (0.018381f) * z); //Changjun Li - g = (F2V (-0.318061f) * x) + (F2V (1.314589f) * y) + (F2V (0.003471f) * z); - b = z; + if(c16 == 1) { + r = ( F2V (1.007245f) * x) + (F2V (0.011136f) * y) - (F2V (0.018381f) * z); //Changjun Li + g = (F2V (-0.318061f) * x) + (F2V (1.314589f) * y) + (F2V (0.003471f) * z); + b = z; + } else { + //cat16 + r = ( F2V (0.401288f) * x) + (F2V (0.650173f) * y) - (F2V (0.051461f) * z); //Changjun Li + g = -(F2V (0.250268f) * x) + (F2V (1.204414f) * y) + (F2V (0.045854f) * z); + b = -(F2V(0.002079f) * x) + (F2V(0.048952f) * y) + (F2V(0.953127f) * z); + } } #endif -void Ciecam02::cat02_to_xyzfloat ( float &x, float &y, float &z, float r, float g, float b) +void Ciecam02::cat02_to_xyzfloat ( float &x, float &y, float &z, float r, float g, float b, int c16) { -// gamu = 1; -// -// if (gamu == 0) { -// x = ( 1.096124f * r) - (0.278869f * g) + (0.182745f * b); -// y = ( 0.454369f * r) + (0.473533f * g) + (0.072098f * b); -// z = (-0.009628f * r) - (0.005698f * g) + (1.015326f * b); -// } else if (gamu == 1) { //gamut correction M.H.Brill S.Susstrunk + //original cat02 //x = ( 1.0978566 * r) - (0.277843 * g) + (0.179987 * b); //y = ( 0.455053 * r) + (0.473938 * g) + (0.0710096* b); //z = ( 0.000000 * r) - (0.000000 * g) + (1.000000 * b); - x = ( 0.99015849f * r) - (0.00838772f * g) + (0.018229217f * b); //Changjun Li - y = ( 0.239565979f * r) + (0.758664642f * g) + (0.001770137f * b); - z = ( 0.000000f * r) - (0.000000f * g) + (1.000000f * b); -// } + if(c16 == 1) { + x = ( 0.99015849f * r) - (0.00838772f * g) + (0.018229217f * b); //Changjun Li + y = ( 0.239565979f * r) + (0.758664642f * g) + (0.001770137f * b); + z = ( 0.000000f * r) - (0.000000f * g) + (1.000000f * b); + } else {//cat16 + x = ( 1.86206786f * r) - (1.01125463f * g) + (0.14918677f * b); //Cat16 + y = ( 0.38752654f * r) + (0.62144744f * g) + (-0.00897398f * b); + z = ( -0.0158415f * r) - (0.03412294f * g) + (1.04996444f * b); + } + } #ifdef __SSE2__ -void Ciecam02::cat02_to_xyzfloat ( vfloat &x, vfloat &y, vfloat &z, vfloat r, vfloat g, vfloat b ) +void Ciecam02::cat02_to_xyzfloat ( vfloat &x, vfloat &y, vfloat &z, vfloat r, vfloat g, vfloat b, int c16 ) { //gamut correction M.H.Brill S.Susstrunk - x = ( F2V (0.99015849f) * r) - (F2V (0.00838772f) * g) + (F2V (0.018229217f) * b); //Changjun Li - y = ( F2V (0.239565979f) * r) + (F2V (0.758664642f) * g) + (F2V (0.001770137f) * b); - z = b; + if(c16 == 1) {//cat02 + x = ( F2V (0.99015849f) * r) - (F2V (0.00838772f) * g) + (F2V (0.018229217f) * b); //Changjun Li + y = ( F2V (0.239565979f) * r) + (F2V (0.758664642f) * g) + (F2V (0.001770137f) * b); + z = b; + } else { + //cat16 + x = ( F2V (1.86206786f) * r) - (F2V (1.01125463f) * g) + (F2V (0.14918677f) * b); + y = ( F2V (0.38752654f) * r) + (F2V (0.621447744f) * g) - (F2V (0.00897398f) * b); + z = -(F2V(0.0158415f) * r) - (F2V(0.03412294f) * g) + (F2V(1.04996444f) * b); + } } #endif -void Ciecam02::hpe_to_xyzfloat ( float &x, float &y, float &z, float r, float g, float b ) +void Ciecam02::hpe_to_xyzfloat ( float &x, float &y, float &z, float r, float g, float b, int c16) { - x = (1.910197f * r) - (1.112124f * g) + (0.201908f * b); - y = (0.370950f * r) + (0.629054f * g) - (0.000008f * b); - z = b; + x = (1.910197f * r) - (1.112124f * g) + (0.201908f * b); + y = (0.370950f * r) + (0.629054f * g) - (0.000008f * b); + z = b; } #ifdef __SSE2__ -void Ciecam02::hpe_to_xyzfloat ( vfloat &x, vfloat &y, vfloat &z, vfloat r, vfloat g, vfloat b ) +void Ciecam02::hpe_to_xyzfloat ( vfloat &x, vfloat &y, vfloat &z, vfloat r, vfloat g, vfloat b, int c16) { - x = (F2V (1.910197f) * r) - (F2V (1.112124f) * g) + (F2V (0.201908f) * b); - y = (F2V (0.370950f) * r) + (F2V (0.629054f) * g) - (F2V (0.000008f) * b); - z = b; + x = (F2V (1.910197f) * r) - (F2V (1.112124f) * g) + (F2V (0.201908f) * b); + y = (F2V (0.370950f) * r) + (F2V (0.629054f) * g) - (F2V (0.000008f) * b); + z = b; } #endif -void Ciecam02::cat02_to_hpefloat ( float &rh, float &gh, float &bh, float r, float g, float b) +void Ciecam02::cat02_to_hpefloat ( float &rh, float &gh, float &bh, float r, float g, float b, int c16) { -// gamu = 1; -// -// if (gamu == 0) { +// original cat02 // rh = ( 0.7409792f * r) + (0.2180250f * g) + (0.0410058f * b); // gh = ( 0.2853532f * r) + (0.6242014f * g) + (0.0904454f * b); // bh = (-0.0096280f * r) - (0.0056980f * g) + (1.0153260f * b); -// } else if (gamu == 1) { //Changjun Li - rh = ( 0.550930835f * r) + (0.519435987f * g) - ( 0.070356303f * b); - gh = ( 0.055954056f * r) + (0.89973132f * g) + (0.044315524f * b); - bh = (0.0f * r) - (0.0f * g) + (1.0f * b); -// } + if(c16 == 1) {//cat02 + rh = ( 0.550930835f * r) + (0.519435987f * g) - ( 0.070356303f * b); + gh = ( 0.055954056f * r) + (0.89973132f * g) + (0.044315524f * b); + bh = (0.0f * r) - (0.0f * g) + (1.0f * b); + } else {//cat16 + rh = ( 1.f * r) + (0.f * g) + ( 0.f * b); + gh = ( 0.f * r) + (1.f * g) + (0.f * b); + bh = (0.0f * r) + (0.0f * g) + (1.0f * b); + } + } #ifdef __SSE2__ -void Ciecam02::cat02_to_hpefloat ( vfloat &rh, vfloat &gh, vfloat &bh, vfloat r, vfloat g, vfloat b) +void Ciecam02::cat02_to_hpefloat ( vfloat &rh, vfloat &gh, vfloat &bh, vfloat r, vfloat g, vfloat b, int c16) { + if(c16 == 1) { //Changjun Li - rh = ( F2V (0.550930835f) * r) + (F2V (0.519435987f) * g) - ( F2V (0.070356303f) * b); - gh = ( F2V (0.055954056f) * r) + (F2V (0.89973132f) * g) + (F2V (0.044315524f) * b); - bh = b; + rh = ( F2V (0.550930835f) * r) + (F2V (0.519435987f) * g) - ( F2V (0.070356303f) * b); + gh = ( F2V (0.055954056f) * r) + (F2V (0.89973132f) * g) + (F2V (0.044315524f) * b); + bh = b; + } else {//cat16 + rh = ( F2V (1.f) * r) + (F2V (0.f) * g) + ( F2V (0.f) * b); + gh = ( F2V (0.f) * r) + (F2V (1.f) * g) + (F2V (0.f) * b); + bh = b; + + } } #endif @@ -399,7 +427,7 @@ void Ciecam02::calculate_abfloat ( vfloat &aa, vfloat &bb, vfloat h, vfloat e, v #endif void Ciecam02::initcam1float (float yb, float pilotd, float f, float la, float xw, float yw, float zw, float &n, float &d, float &nbb, float &ncb, - float &cz, float &aw, float &wh, float &pfl, float &fl, float c) + float &cz, float &aw, float &wh, float &pfl, float &fl, float c, int c16) { n = yb / yw; @@ -412,13 +440,13 @@ void Ciecam02::initcam1float (float yb, float pilotd, float f, float la, float x fl = calculate_fl_from_la_ciecam02float ( la ); nbb = ncb = 0.725f * pow_F ( 1.0f / n, 0.2f ); cz = 1.48f + sqrt ( n ); - aw = achromatic_response_to_whitefloat ( xw, yw, zw, d, fl, nbb); + aw = achromatic_response_to_whitefloat ( xw, yw, zw, d, fl, nbb, c16); wh = ( 4.0f / c ) * ( aw + 4.0f ) * pow_F ( fl, 0.25f ); pfl = pow_F ( fl, 0.25f ); } void Ciecam02::initcam2float (float yb, float pilotd, float f, float la, float xw, float yw, float zw, float &n, float &d, float &nbb, float &ncb, - float &cz, float &aw, float &fl) + float &cz, float &aw, float &fl, int c16) { n = yb / yw; @@ -432,12 +460,12 @@ void Ciecam02::initcam2float (float yb, float pilotd, float f, float la, float x fl = calculate_fl_from_la_ciecam02float ( la ); nbb = ncb = 0.725f * pow_F ( 1.0f / n, 0.2f ); cz = 1.48f + sqrt ( n ); - aw = achromatic_response_to_whitefloat ( xw, yw, zw, d, fl, nbb); + aw = achromatic_response_to_whitefloat ( xw, yw, zw, d, fl, nbb, c16); } void Ciecam02::xyz2jchqms_ciecam02float ( float &J, float &C, float &h, float &Q, float &M, float &s, float aw, float fl, float wh, float x, float y, float z, float xw, float yw, float zw, - float c, float nc, float pow1, float nbb, float ncb, float pfl, float cz, float d) + float c, float nc, float pow1, float nbb, float ncb, float pfl, float cz, float d, int c16) { float r, g, b; @@ -448,20 +476,23 @@ void Ciecam02::xyz2jchqms_ciecam02float ( float &J, float &C, float &h, float &Q float a, ca, cb; float e, t; float myh; -// gamu = 1; - xyz_to_cat02float ( r, g, b, x, y, z); - xyz_to_cat02float ( rw, gw, bw, xw, yw, zw); + xyz_to_cat02float ( r, g, b, x, y, z, c16); + xyz_to_cat02float ( rw, gw, bw, xw, yw, zw, c16); rc = r * (((yw * d) / rw) + (1.f - d)); gc = g * (((yw * d) / gw) + (1.f - d)); bc = b * (((yw * d) / bw) + (1.f - d)); - cat02_to_hpefloat ( rp, gp, bp, rc, gc, bc); + cat02_to_hpefloat ( rp, gp, bp, rc, gc, bc, c16); -// if (gamu == 1) { //gamut correction M.H.Brill S.Susstrunk - rp = MAXR (rp, 0.0f); - gp = MAXR (gp, 0.0f); - bp = MAXR (bp, 0.0f); -// } + if(c16 == 1) {//cat02 + rp = MAXR (rp, 0.0f); + gp = MAXR (gp, 0.0f); + bp = MAXR (bp, 0.0f); + } else {//cat16 + rp = MAXR (rc, 0.0f); + gp = MAXR (gc, 0.0f); + bp = MAXR (bc, 0.0f); + } rpa = nonlinear_adaptationfloat ( rp, fl ); gpa = nonlinear_adaptationfloat ( gp, fl ); @@ -478,9 +509,7 @@ void Ciecam02::xyz2jchqms_ciecam02float ( float &J, float &C, float &h, float &Q a = ((2.0f * rpa) + gpa + (0.05f * bpa) - 0.305f) * nbb; -// if (gamu == 1) { a = MAXR (a, 0.0f); //gamut correction M.H.Brill S.Susstrunk -// } J = pow_F ( a / aw, c * cz * 0.5f); @@ -499,7 +528,7 @@ void Ciecam02::xyz2jchqms_ciecam02float ( float &J, float &C, float &h, float &Q #ifdef __SSE2__ void Ciecam02::xyz2jchqms_ciecam02float ( vfloat &J, vfloat &C, vfloat &h, vfloat &Q, vfloat &M, vfloat &s, vfloat aw, vfloat fl, vfloat wh, vfloat x, vfloat y, vfloat z, vfloat xw, vfloat yw, vfloat zw, - vfloat c, vfloat nc, vfloat pow1, vfloat nbb, vfloat ncb, vfloat pfl, vfloat cz, vfloat d) + vfloat c, vfloat nc, vfloat pow1, vfloat nbb, vfloat ncb, vfloat pfl, vfloat cz, vfloat d, int c16) { vfloat r, g, b; @@ -510,18 +539,26 @@ void Ciecam02::xyz2jchqms_ciecam02float ( vfloat &J, vfloat &C, vfloat &h, vfloa vfloat a, ca, cb; vfloat e, t; - xyz_to_cat02float ( r, g, b, x, y, z); - xyz_to_cat02float ( rw, gw, bw, xw, yw, zw); + xyz_to_cat02float ( r, g, b, x, y, z, c16); + xyz_to_cat02float ( rw, gw, bw, xw, yw, zw, c16); vfloat onev = F2V (1.f); rc = r * (((yw * d) / rw) + (onev - d)); gc = g * (((yw * d) / gw) + (onev - d)); bc = b * (((yw * d) / bw) + (onev - d)); - cat02_to_hpefloat ( rp, gp, bp, rc, gc, bc); + cat02_to_hpefloat ( rp, gp, bp, rc, gc, bc, c16); + //gamut correction M.H.Brill S.Susstrunk - rp = vmaxf (rp, ZEROV); - gp = vmaxf (gp, ZEROV); - bp = vmaxf (bp, ZEROV); + if(c16 == 1) {//cat02 + rp = vmaxf (rp, ZEROV); + gp = vmaxf (gp, ZEROV); + bp = vmaxf (bp, ZEROV); + } else {//cat16 + rp = vmaxf (rc, ZEROV); + gp = vmaxf (gc, ZEROV); + bp = vmaxf (bc, ZEROV); + } + rpa = nonlinear_adaptationfloat ( rp, fl ); gpa = nonlinear_adaptationfloat ( gp, fl ); bpa = nonlinear_adaptationfloat ( bp, fl ); @@ -556,7 +593,7 @@ void Ciecam02::xyz2jchqms_ciecam02float ( vfloat &J, vfloat &C, vfloat &h, vfloa void Ciecam02::xyz2jch_ciecam02float ( float &J, float &C, float &h, float aw, float fl, float x, float y, float z, float xw, float yw, float zw, - float c, float nc, float pow1, float nbb, float ncb, float cz, float d) + float c, float nc, float pow1, float nbb, float ncb, float cz, float d, int c16) { float r, g, b; @@ -567,20 +604,24 @@ void Ciecam02::xyz2jch_ciecam02float ( float &J, float &C, float &h, float aw, f float a, ca, cb; float e, t; float myh; -// int gamu = 1; - xyz_to_cat02float ( r, g, b, x, y, z); - xyz_to_cat02float ( rw, gw, bw, xw, yw, zw); + xyz_to_cat02float ( r, g, b, x, y, z, c16); + xyz_to_cat02float ( rw, gw, bw, xw, yw, zw, c16); rc = r * (((yw * d) / rw) + (1.f - d)); gc = g * (((yw * d) / gw) + (1.f - d)); bc = b * (((yw * d) / bw) + (1.f - d)); - cat02_to_hpefloat ( rp, gp, bp, rc, gc, bc); + cat02_to_hpefloat ( rp, gp, bp, rc, gc, bc, c16); + + if(c16 == 1) {//cat02 + rp = MAXR (rp, 0.0f); + gp = MAXR (gp, 0.0f); + bp = MAXR (bp, 0.0f); + } else {//cat16 + rp = MAXR (rc, 0.0f); + gp = MAXR (gc, 0.0f); + bp = MAXR (bc, 0.0f); + } -// if (gamu == 1) { //gamut correction M.H.Brill S.Susstrunk - rp = MAXR (rp, 0.0f); - gp = MAXR (gp, 0.0f); - bp = MAXR (bp, 0.0f); -// } #ifdef __SSE2__ vfloat pv = _mm_setr_ps(rp, gp, bp, 1.f); @@ -606,9 +647,7 @@ void Ciecam02::xyz2jch_ciecam02float ( float &J, float &C, float &h, float aw, f a = ((2.0f * rpa) + gpa + (0.05f * bpa) - 0.305f) * nbb; -// if (gamu == 1) { a = MAXR (a, 0.0f); //gamut correction M.H.Brill S.Susstrunk -// } J = pow_F ( a / aw, c * cz * 0.5f); @@ -623,7 +662,7 @@ void Ciecam02::xyz2jch_ciecam02float ( float &J, float &C, float &h, float aw, f void Ciecam02::jch2xyz_ciecam02float ( float &x, float &y, float &z, float J, float C, float h, float xw, float yw, float zw, - float c, float nc, float pow1, float nbb, float ncb, float fl, float cz, float d, float aw) + float c, float nc, float pow1, float nbb, float ncb, float fl, float cz, float d, float aw, int c16) { float r, g, b; float rc, gc, bc; @@ -632,8 +671,7 @@ void Ciecam02::jch2xyz_ciecam02float ( float &x, float &y, float &z, float J, fl float rw, gw, bw; float a, ca, cb; float e, t; -// gamu = 1; - xyz_to_cat02float(rw, gw, bw, xw, yw, zw); + xyz_to_cat02float(rw, gw, bw, xw, yw, zw, c16); e = ((961.53846f) * nc * ncb) * (xcosf(h * rtengine::RT_PI_F_180 + 2.0f) + 3.8f); #ifdef __SSE2__ @@ -662,20 +700,27 @@ void Ciecam02::jch2xyz_ciecam02float ( float &x, float &y, float &z, float J, fl gp = inverse_nonlinear_adaptationfloat(gpa, fl); bp = inverse_nonlinear_adaptationfloat(bpa, fl); #endif - hpe_to_xyzfloat(x, y, z, rp, gp, bp); - xyz_to_cat02float(rc, gc, bc, x, y, z); - r = rc / (((yw * d) / rw) + (1.0f - d)); - g = gc / (((yw * d) / gw) + (1.0f - d)); - b = bc / (((yw * d) / bw) + (1.0f - d)); + if(c16 == 1) {//cat02 + hpe_to_xyzfloat(x, y, z, rp, gp, bp, c16); + xyz_to_cat02float(rc, gc, bc, x, y, z, c16); - cat02_to_xyzfloat(x, y, z, r, g, b); + r = rc / (((yw * d) / rw) + (1.0f - d)); + g = gc / (((yw * d) / gw) + (1.0f - d)); + b = bc / (((yw * d) / bw) + (1.0f - d)); + } else {//cat16 + r = rp / (((yw * d) / rw) + (1.0f - d)); + g = gp / (((yw * d) / gw) + (1.0f - d)); + b = bp / (((yw * d) / bw) + (1.0f - d)); + } + + cat02_to_xyzfloat(x, y, z, r, g, b, c16); } #ifdef __SSE2__ void Ciecam02::jch2xyz_ciecam02float ( vfloat &x, vfloat &y, vfloat &z, vfloat J, vfloat C, vfloat h, vfloat xw, vfloat yw, vfloat zw, - vfloat nc, vfloat pow1, vfloat nbb, vfloat ncb, vfloat fl, vfloat d, vfloat aw, vfloat reccmcz) + vfloat nc, vfloat pow1, vfloat nbb, vfloat ncb, vfloat fl, vfloat d, vfloat aw, vfloat reccmcz, int c16) { vfloat r, g, b; vfloat rc, gc, bc; @@ -684,7 +729,7 @@ void Ciecam02::jch2xyz_ciecam02float ( vfloat &x, vfloat &y, vfloat &z, vfloat J vfloat rw, gw, bw; vfloat a, ca, cb; vfloat e, t; - xyz_to_cat02float ( rw, gw, bw, xw, yw, zw); + xyz_to_cat02float ( rw, gw, bw, xw, yw, zw, c16); e = ((F2V (961.53846f)) * nc * ncb) * (xcosf ( ((h * F2V (rtengine::RT_PI)) / F2V (180.0f)) + F2V (2.0f) ) + F2V (3.8f)); a = pow_F ( J / F2V (100.0f), reccmcz ) * aw; t = pow_F ( F2V (10.f) * C / (vsqrtf ( J ) * pow1), F2V (1.1111111f) ); @@ -696,14 +741,20 @@ void Ciecam02::jch2xyz_ciecam02float ( vfloat &x, vfloat &y, vfloat &z, vfloat J gp = inverse_nonlinear_adaptationfloat ( gpa, fl ); bp = inverse_nonlinear_adaptationfloat ( bpa, fl ); - hpe_to_xyzfloat ( x, y, z, rp, gp, bp ); - xyz_to_cat02float ( rc, gc, bc, x, y, z ); + if(c16 == 1) {//cat02 + hpe_to_xyzfloat ( x, y, z, rp, gp, bp, c16); + xyz_to_cat02float ( rc, gc, bc, x, y, z, c16 ); - r = rc / (((yw * d) / rw) + (F2V (1.0f) - d)); - g = gc / (((yw * d) / gw) + (F2V (1.0f) - d)); - b = bc / (((yw * d) / bw) + (F2V (1.0f) - d)); + r = rc / (((yw * d) / rw) + (F2V (1.0f) - d)); + g = gc / (((yw * d) / gw) + (F2V (1.0f) - d)); + b = bc / (((yw * d) / bw) + (F2V (1.0f) - d)); + } else {//cat16 + r = rp / (((yw * d) / rw) + (F2V (1.0f) - d)); + g = gp / (((yw * d) / gw) + (F2V (1.0f) - d)); + b = bp / (((yw * d) / bw) + (F2V (1.0f) - d)); + } - cat02_to_xyzfloat ( x, y, z, r, g, b ); + cat02_to_xyzfloat ( x, y, z, r, g, b, c16 ); } #endif @@ -761,6 +812,4 @@ vfloat Ciecam02::inverse_nonlinear_adaptationfloat ( vfloat c, vfloat fl ) return (F2V (100.0f) / fl) * pow_F ( (F2V (27.13f) * c) / (F2V (400.0f) - c), F2V (2.38095238f) ); } #endif -//end CIECAM Billy Bigg - } diff --git a/rtengine/ciecam02.h b/rtengine/ciecam02.h index 75ccfaa8c..ca967af1c 100644 --- a/rtengine/ciecam02.h +++ b/rtengine/ciecam02.h @@ -33,17 +33,17 @@ namespace rtengine { class Ciecam02 -{ +{//also used with Ciecam16 private: static float d_factorfloat ( float f, float la ); static float calculate_fl_from_la_ciecam02float ( float la ); - static float achromatic_response_to_whitefloat ( float x, float y, float z, float d, float fl, float nbb); - static void xyz_to_cat02float ( float &r, float &g, float &b, float x, float y, float z); - static void cat02_to_hpefloat ( float &rh, float &gh, float &bh, float r, float g, float b); + static float achromatic_response_to_whitefloat ( float x, float y, float z, float d, float fl, float nbb, int c16); + static void xyz_to_cat02float ( float &r, float &g, float &b, float x, float y, float z, int c16); + static void cat02_to_hpefloat ( float &rh, float &gh, float &bh, float r, float g, float b, int c16); #ifdef __SSE2__ - static void xyz_to_cat02float ( vfloat &r, vfloat &g, vfloat &b, vfloat x, vfloat y, vfloat z ); - static void cat02_to_hpefloat ( vfloat &rh, vfloat &gh, vfloat &bh, vfloat r, vfloat g, vfloat b ); + static void xyz_to_cat02float ( vfloat &r, vfloat &g, vfloat &b, vfloat x, vfloat y, vfloat z, int c16); + static void cat02_to_hpefloat ( vfloat &rh, vfloat &gh, vfloat &bh, vfloat r, vfloat g, vfloat b, int c16); static vfloat nonlinear_adaptationfloat ( vfloat c, vfloat fl ); #endif @@ -52,14 +52,14 @@ private: static float inverse_nonlinear_adaptationfloat ( float c, float fl ); static void calculate_abfloat ( float &aa, float &bb, float h, float e, float t, float nbb, float a ); static void Aab_to_rgbfloat ( float &r, float &g, float &b, float A, float aa, float bb, float nbb ); - static void hpe_to_xyzfloat ( float &x, float &y, float &z, float r, float g, float b ); - static void cat02_to_xyzfloat ( float &x, float &y, float &z, float r, float g, float b); + static void hpe_to_xyzfloat ( float &x, float &y, float &z, float r, float g, float b, int c16); + static void cat02_to_xyzfloat ( float &x, float &y, float &z, float r, float g, float b, int c16); #ifdef __SSE2__ static vfloat inverse_nonlinear_adaptationfloat ( vfloat c, vfloat fl ); static void calculate_abfloat ( vfloat &aa, vfloat &bb, vfloat h, vfloat e, vfloat t, vfloat nbb, vfloat a ); static void Aab_to_rgbfloat ( vfloat &r, vfloat &g, vfloat &b, vfloat A, vfloat aa, vfloat bb, vfloat nbb ); - static void hpe_to_xyzfloat ( vfloat &x, vfloat &y, vfloat &z, vfloat r, vfloat g, vfloat b ); - static void cat02_to_xyzfloat ( vfloat &x, vfloat &y, vfloat &z, vfloat r, vfloat g, vfloat b ); + static void hpe_to_xyzfloat ( vfloat &x, vfloat &y, vfloat &z, vfloat r, vfloat g, vfloat b, int c16); + static void cat02_to_xyzfloat ( vfloat &x, vfloat &y, vfloat &z, vfloat r, vfloat g, vfloat b, int c16); #endif public: @@ -73,40 +73,40 @@ public: static void jch2xyz_ciecam02float ( float &x, float &y, float &z, float J, float C, float h, float xw, float yw, float zw, - float c, float nc, float n, float nbb, float ncb, float fl, float cz, float d, float aw ); + float c, float nc, float n, float nbb, float ncb, float fl, float cz, float d, float aw, int c16); #ifdef __SSE2__ static void jch2xyz_ciecam02float ( vfloat &x, vfloat &y, vfloat &z, vfloat J, vfloat C, vfloat h, vfloat xw, vfloat yw, vfloat zw, - vfloat nc, vfloat n, vfloat nbb, vfloat ncb, vfloat fl, vfloat d, vfloat aw, vfloat reccmcz ); + vfloat nc, vfloat n, vfloat nbb, vfloat ncb, vfloat fl, vfloat d, vfloat aw, vfloat reccmcz, int c16 ); #endif /** * Forward transform from XYZ to CIECAM02 JCh. */ static void initcam1float (float yb, float pilotd, float f, float la, float xw, float yw, float zw, float &n, float &d, float &nbb, float &ncb, - float &cz, float &aw, float &wh, float &pfl, float &fl, float c); + float &cz, float &aw, float &wh, float &pfl, float &fl, float c, int c16); static void initcam2float (float yb, float pilotd, float f, float la, float xw, float yw, float zw, float &n, float &d, float &nbb, float &ncb, - float &cz, float &aw, float &fl); + float &cz, float &aw, float &fl, int c16); static void xyz2jch_ciecam02float ( float &J, float &C, float &h, float aw, float fl, float x, float y, float z, float xw, float yw, float zw, - float c, float nc, float n, float nbb, float ncb, float cz, float d ); + float c, float nc, float n, float nbb, float ncb, float cz, float d, int c16); static void xyz2jchqms_ciecam02float ( float &J, float &C, float &h, float &Q, float &M, float &s, float aw, float fl, float wh, float x, float y, float z, float xw, float yw, float zw, - float c, float nc, float n, float nbb, float ncb, float pfl, float cz, float d ); + float c, float nc, float n, float nbb, float ncb, float pfl, float cz, float d, int c16); #ifdef __SSE2__ static void xyz2jchqms_ciecam02float ( vfloat &J, vfloat &C, vfloat &h, vfloat &Q, vfloat &M, vfloat &s, vfloat aw, vfloat fl, vfloat wh, vfloat x, vfloat y, vfloat z, vfloat xw, vfloat yw, vfloat zw, - vfloat c, vfloat nc, vfloat n, vfloat nbb, vfloat ncb, vfloat pfl, vfloat cz, vfloat d ); + vfloat c, vfloat nc, vfloat n, vfloat nbb, vfloat ncb, vfloat pfl, vfloat cz, vfloat d, int c16); #endif diff --git a/rtengine/curves.cc b/rtengine/curves.cc index 640074075..c6bf86954 100644 --- a/rtengine/curves.cc +++ b/rtengine/curves.cc @@ -3460,11 +3460,12 @@ void PerceptualToneCurve::BatchApply(const size_t start, const size_t end, float Color::Prophotoxyz(r, g, b, x, y, z); float J, C, h; + int c16 = 1; Ciecam02::xyz2jch_ciecam02float(J, C, h, aw, fl, x * 0.0015259022f, y * 0.0015259022f, z * 0.0015259022f, xw, yw, zw, - c, nc, pow1, nbb, ncb, cz, d); + c, nc, pow1, nbb, ncb, cz, d, c16); if (!isfinite(J) || !isfinite(C) || !isfinite(h)) { @@ -3579,11 +3580,10 @@ void PerceptualToneCurve::BatchApply(const size_t start, const size_t end, float } C *= cmul; - Ciecam02::jch2xyz_ciecam02float(x, y, z, J, C, h, xw, yw, zw, - c, nc, pow1, nbb, ncb, fl, cz, d, aw); + c, nc, pow1, nbb, ncb, fl, cz, d, aw, c16); if (!isfinite(x) || !isfinite(y) || !isfinite(z)) { // can happen for colours on the rim of being outside gamut, that worked without chroma scaling but not with. Then we return only the curve's result. @@ -3698,9 +3698,9 @@ void PerceptualToneCurve::init() f = 1.00f; c = 0.69f; nc = 1.00f; - + int c16 = 1;//with cat02 for compatibility Ciecam02::initcam1float(yb, 1.f, f, la, xw, yw, zw, n, d, nbb, ncb, - cz, aw, wh, pfl, fl, c); + cz, aw, wh, pfl, fl, c, c16); pow1 = pow_F(1.64f - pow_F(0.29f, n), 0.73f); { diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 05cc115d9..ccb6e0c65 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -952,12 +952,19 @@ void ImProcFunctions::ciecam_02float(CieImage* ncie, float adap, int pW, int pwb float cz, wh, pfl; - Ciecam02::initcam1float (yb, pilot, f, la, xw, yw, zw, n, d, nbb, ncb, cz, aw, wh, pfl, fl, c); + int c16 = 1; + if (params->colorappearance.modelmethod == "02") { + c16 = 1; + }else if (params->colorappearance.modelmethod == "16") { + c16 = 16; + } + + Ciecam02::initcam1float (yb, pilot, f, la, xw, yw, zw, n, d, nbb, ncb, cz, aw, wh, pfl, fl, c, c16); //printf ("wh=%f \n", wh); const float pow1 = pow_F(1.64f - pow_F(0.29f, n), 0.73f); float nj, nbbj, ncbj, czj, awj, flj; - Ciecam02::initcam2float (yb2, pilotout, f2, la2, xw2, yw2, zw2, nj, dj, nbbj, ncbj, czj, awj, flj); + Ciecam02::initcam2float (yb2, pilotout, f2, la2, xw2, yw2, zw2, nj, dj, nbbj, ncbj, czj, awj, flj, c16); #ifdef __SSE2__ const float reccmcz = 1.f / (c2 * czj); #endif @@ -1048,7 +1055,7 @@ void ImProcFunctions::ciecam_02float(CieImage* ncie, float adap, int pW, int pwb Q, M, s, F2V(aw), F2V(fl), F2V(wh), x, y, z, F2V(xw1), F2V(yw1), F2V(zw1), - F2V(c), F2V(nc), F2V(pow1), F2V(nbb), F2V(ncb), F2V(pfl), F2V(cz), F2V(d)); + F2V(c), F2V(nc), F2V(pow1), F2V(nbb), F2V(ncb), F2V(pfl), F2V(cz), F2V(d), c16); STVF(Jbuffer[k], J); STVF(Cbuffer[k], C); STVF(hbuffer[k], h); @@ -1072,7 +1079,7 @@ void ImProcFunctions::ciecam_02float(CieImage* ncie, float adap, int pW, int pwb Q, M, s, aw, fl, wh, x, y, z, xw1, yw1, zw1, - c, nc, pow1, nbb, ncb, pfl, cz, d); + c, nc, pow1, nbb, ncb, pfl, cz, d, c16); Jbuffer[k] = J; Cbuffer[k] = C; hbuffer[k] = h; @@ -1110,7 +1117,7 @@ void ImProcFunctions::ciecam_02float(CieImage* ncie, float adap, int pW, int pwb Q, M, s, aw, fl, wh, x, y, z, xw1, yw1, zw1, - c, nc, pow1, nbb, ncb, pfl, cz, d); + c, nc, pow1, nbb, ncb, pfl, cz, d, c16); #endif float Jpro, Cpro, hpro, Qpro, Mpro, spro; Jpro = J; @@ -1521,7 +1528,7 @@ void ImProcFunctions::ciecam_02float(CieImage* ncie, float adap, int pW, int pwb Ciecam02::jch2xyz_ciecam02float(xx, yy, zz, J, C, h, xw2, yw2, zw2, - c2, nc2, pow1n, nbbj, ncbj, flj, czj, dj, awj); + c2, nc2, pow1n, nbbj, ncbj, flj, czj, dj, awj, c16); float x, y, z; x = xx * 655.35f; y = yy * 655.35f; @@ -1573,7 +1580,7 @@ void ImProcFunctions::ciecam_02float(CieImage* ncie, float adap, int pW, int pwb Ciecam02::jch2xyz_ciecam02float(x, y, z, LVF(Jbuffer[k]), LVF(Cbuffer[k]), LVF(hbuffer[k]), F2V(xw2), F2V(yw2), F2V(zw2), - F2V(nc2), F2V(pow1n), F2V(nbbj), F2V(ncbj), F2V(flj), F2V(dj), F2V(awj), F2V(reccmcz)); + F2V(nc2), F2V(pow1n), F2V(nbbj), F2V(ncbj), F2V(flj), F2V(dj), F2V(awj), F2V(reccmcz), c16); STVF(xbuffer[k], x * c655d35); STVF(ybuffer[k], y * c655d35); STVF(zbuffer[k], z * c655d35); @@ -1830,7 +1837,7 @@ void ImProcFunctions::ciecam_02float(CieImage* ncie, float adap, int pW, int pwb Ciecam02::jch2xyz_ciecam02float(xx, yy, zz, ncie->J_p[i][j], ncie_C_p, ncie->h_p[i][j], xw2, yw2, zw2, - c2, nc2, pow1n, nbbj, ncbj, flj, czj, dj, awj); + c2, nc2, pow1n, nbbj, ncbj, flj, czj, dj, awj, c16); float x = (float)xx * 655.35f; float y = (float)yy * 655.35f; float z = (float)zz * 655.35f; @@ -1878,7 +1885,7 @@ void ImProcFunctions::ciecam_02float(CieImage* ncie, float adap, int pW, int pwb Ciecam02::jch2xyz_ciecam02float(x, y, z, LVF(Jbuffer[k]), LVF(Cbuffer[k]), LVF(hbuffer[k]), F2V(xw2), F2V(yw2), F2V(zw2), - F2V(nc2), F2V(pow1n), F2V(nbbj), F2V(ncbj), F2V(flj), F2V(dj), F2V(awj), F2V(reccmcz)); + F2V(nc2), F2V(pow1n), F2V(nbbj), F2V(ncbj), F2V(flj), F2V(dj), F2V(awj), F2V(reccmcz), c16); x *= c655d35; y *= c655d35; z *= c655d35; diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index c13300872..87726b4fa 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -2378,10 +2378,11 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, int call) zw = 100.0 * Zw; float xw1 = xws, yw1 = yws, zw1 = zws, xw2 = xwd, yw2 = ywd, zw2 = zwd; float cz, wh, pfl; - Ciecam02::initcam1float(yb, pilot, f, la, xw, yw, zw, n, d, nbb, ncb, cz, aw, wh, pfl, fl, c); + int c16 = 16;//always cat16 + Ciecam02::initcam1float(yb, pilot, f, la, xw, yw, zw, n, d, nbb, ncb, cz, aw, wh, pfl, fl, c, c16); const float pow1 = pow_F(1.64f - pow_F(0.29f, n), 0.73f); float nj, nbbj, ncbj, czj, awj, flj; - Ciecam02::initcam2float(yb2, pilotout, f2, la2, xw2, yw2, zw2, nj, dj, nbbj, ncbj, czj, awj, flj); + Ciecam02::initcam2float(yb2, pilotout, f2, la2, xw2, yw2, zw2, nj, dj, nbbj, ncbj, czj, awj, flj, c16); #ifdef __SSE2__ const float reccmcz = 1.f / (c2 * czj); #endif @@ -2428,7 +2429,7 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, int call) Q, M, s, F2V(aw), F2V(fl), F2V(wh), x, y, z, F2V(xw1), F2V(yw1), F2V(zw1), - F2V(c), F2V(nc), F2V(pow1), F2V(nbb), F2V(ncb), F2V(pfl), F2V(cz), F2V(d)); + F2V(c), F2V(nc), F2V(pow1), F2V(nbb), F2V(ncb), F2V(pfl), F2V(cz), F2V(d), c16); STVF(Jbuffer[k], J); STVF(Cbuffer[k], C); STVF(hbuffer[k], h); @@ -2452,7 +2453,7 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, int call) Q, M, s, aw, fl, wh, x, y, z, xw1, yw1, zw1, - c, nc, pow1, nbb, ncb, pfl, cz, d); + c, nc, pow1, nbb, ncb, pfl, cz, d, c16); Jbuffer[k] = J; Cbuffer[k] = C; hbuffer[k] = h; @@ -2490,7 +2491,7 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, int call) Q, M, s, aw, fl, wh, x, y, z, xw1, yw1, zw1, - c, nc, pow1, nbb, ncb, pfl, cz, d); + c, nc, pow1, nbb, ncb, pfl, cz, d, c16); #endif float Jpro, Cpro, hpro, Qpro, Mpro, spro; Jpro = J; @@ -2557,7 +2558,7 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, int call) Ciecam02::jch2xyz_ciecam02float(xx, yy, zz, J, C, h, xw2, yw2, zw2, - c2, nc2, pow1n, nbbj, ncbj, flj, czj, dj, awj); + c2, nc2, pow1n, nbbj, ncbj, flj, czj, dj, awj, c16); x = xx * 655.35f; y = yy * 655.35f; z = zz * 655.35f; @@ -2580,7 +2581,7 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, int call) Ciecam02::jch2xyz_ciecam02float(x, y, z, LVF(Jbuffer[k]), LVF(Cbuffer[k]), LVF(hbuffer[k]), F2V(xw2), F2V(yw2), F2V(zw2), - F2V(nc2), F2V(pow1n), F2V(nbbj), F2V(ncbj), F2V(flj), F2V(dj), F2V(awj), F2V(reccmcz)); + F2V(nc2), F2V(pow1n), F2V(nbbj), F2V(ncbj), F2V(flj), F2V(dj), F2V(awj), F2V(reccmcz), c16); STVF(xbuffer[k], x * c655d35); STVF(ybuffer[k], y * c655d35); STVF(zbuffer[k], z * c655d35); diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index e6f06480d..1fed31dc1 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -1423,6 +1423,7 @@ ColorAppearanceParams::ColorAppearanceParams() : curveMode2(TcMode::LIGHT), curveMode3(CtcMode::CHROMA), complexmethod("normal"), + modelmethod("02"), surround("Average"), surrsrc("Average"), adapscen(2000.0), @@ -1472,6 +1473,7 @@ bool ColorAppearanceParams::operator ==(const ColorAppearanceParams& other) cons && curveMode2 == other.curveMode2 && curveMode3 == other.curveMode3 && complexmethod == other.complexmethod + && modelmethod == other.modelmethod && surround == other.surround && surrsrc == other.surrsrc && adapscen == other.adapscen @@ -5456,6 +5458,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->colorappearance.autodegreeout, "Color appearance", "AutoDegreeout", colorappearance.autodegreeout, keyFile); saveToKeyfile(!pedited || pedited->colorappearance.surround, "Color appearance", "Surround", colorappearance.surround, keyFile); saveToKeyfile(!pedited || pedited->colorappearance.complexmethod, "Color appearance", "complex", colorappearance.complexmethod, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.modelmethod, "Color appearance", "ModelCat", colorappearance.modelmethod, keyFile); saveToKeyfile(!pedited || pedited->colorappearance.surrsrc, "Color appearance", "Surrsrc", colorappearance.surrsrc, keyFile); saveToKeyfile(!pedited || pedited->colorappearance.adaplum, "Color appearance", "AdaptLum", colorappearance.adaplum, keyFile); saveToKeyfile(!pedited || pedited->colorappearance.badpixsl, "Color appearance", "Badpixsl", colorappearance.badpixsl, keyFile); @@ -7087,6 +7090,16 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) pedited->colorappearance.complexmethod = true; } } + + if (keyFile.has_key("Color appearance", "ModelCat")) { + assignFromKeyfile(keyFile, "Color appearance", "ModelCat", pedited, colorappearance.modelmethod, pedited->colorappearance.modelmethod); + } else if (colorappearance.enabled) { + colorappearance.modelmethod = "02"; + if (pedited) { + pedited->colorappearance.modelmethod = true; + } + } + assignFromKeyfile(keyFile, "Color appearance", "Surround", pedited, colorappearance.surround, pedited->colorappearance.surround); assignFromKeyfile(keyFile, "Color appearance", "Surrsrc", pedited, colorappearance.surrsrc, pedited->colorappearance.surrsrc); assignFromKeyfile(keyFile, "Color appearance", "AdaptLum", pedited, colorappearance.adaplum, pedited->colorappearance.adaplum); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 0a3377472..25d39202e 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -673,6 +673,7 @@ struct ColorAppearanceParams { TcMode curveMode2; CtcMode curveMode3; Glib::ustring complexmethod; + Glib::ustring modelmethod; Glib::ustring surround; Glib::ustring surrsrc; diff --git a/rtgui/colorappearance.cc b/rtgui/colorappearance.cc index b4d5459ce..cbcf14b60 100644 --- a/rtgui/colorappearance.cc +++ b/rtgui/colorappearance.cc @@ -223,7 +223,8 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" EvCATAutotempout = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_TEMPOUT"); EvCATillum = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_ILLUM"); EvCATcomplex = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_CATCOMPLEX"); - //preset button cat02 + EvCATmodel = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_CATMODEL"); + //preset button cat02/16 Gtk::Frame *genFrame; Gtk::VBox *genVBox; genFrame = Gtk::manage (new Gtk::Frame (M ("TP_COLORAPP_GEN")) ); @@ -243,6 +244,16 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" complexHBox->pack_start(*complexmethod); genVBox->pack_start (*complexHBox, Gtk::PACK_SHRINK); + modelmethod = Gtk::manage (new MyComboBoxText ()); + modelmethod->append(M("TP_COLORAPP_MOD02")); + modelmethod->append(M("TP_COLORAPP_MOD16")); + modelmethodconn = modelmethod->signal_changed().connect(sigc::mem_fun(*this, &ColorAppearance::modelmethodChanged)); + modelmethod->set_tooltip_text(M("TP_COLORAPP_MODELCAT_TOOLTIP")); + Gtk::HBox* const modelHBox = Gtk::manage(new Gtk::HBox()); + Gtk::Label* const modelLabel = Gtk::manage(new Gtk::Label(M("TP_COLORAPP_MODELCAT") + ":")); + modelHBox->pack_start(*modelLabel, Gtk::PACK_SHRINK, 4); + modelHBox->pack_start(*modelmethod); + genVBox->pack_start (*modelHBox, Gtk::PACK_SHRINK); presetcat02 = Gtk::manage (new Gtk::CheckButton (M ("TP_COLORAPP_PRESETCAT02"))); presetcat02->set_tooltip_markup (M("TP_COLORAPP_PRESETCAT02_TIP")); @@ -842,6 +853,7 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited) disableListener (); complexmethodconn.block(true); + modelmethodconn.block(true); tcmodeconn.block (true); tcmode2conn.block (true); tcmode3conn.block (true); @@ -903,6 +915,9 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited) if (!pedited->colorappearance.complexmethod) { complexmethod->set_active_text(M("GENERAL_UNCHANGED")); } + if (!pedited->colorappearance.modelmethod) { + modelmethod->set_active_text(M("GENERAL_UNCHANGED")); + } if (!pedited->colorappearance.curveMode2) { toneCurveMode2->set_active (2); @@ -923,7 +938,14 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited) } else if (pp->colorappearance.complexmethod == "expert") { complexmethod->set_active(1); } + + modelmethod->set_active(0); + if (pp->colorappearance.modelmethod == "02") { + modelmethod->set_active(0); + } else if (pp->colorappearance.modelmethod == "16") { + modelmethod->set_active(1); + } surrsrcconn.block (true); @@ -1098,6 +1120,7 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited) tcmode3conn.block (false); tcmode2conn.block (false); tcmodeconn.block (false); + modelmethodconn.block(false); complexmethodconn.block(false); enableListener (); } @@ -1178,6 +1201,7 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited) if (pedited) { pedited->colorappearance.complexmethod = complexmethod->get_active_text() != M("GENERAL_UNCHANGED"); + pedited->colorappearance.modelmethod = modelmethod->get_active_text() != M("GENERAL_UNCHANGED"); pedited->colorappearance.degree = degree->getEditedState (); pedited->colorappearance.degreeout = degreeout->getEditedState (); pedited->colorappearance.adapscen = adapscen->getEditedState (); @@ -1231,6 +1255,11 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited) pp->colorappearance.complexmethod = "expert"; } + if (modelmethod->get_active_row_number() == 0) { + pp->colorappearance.modelmethod = "02"; + } else if (modelmethod->get_active_row_number() == 1) { + pp->colorappearance.modelmethod = "16"; + } if (surrsrc->get_active_row_number() == 0) { @@ -1355,6 +1384,13 @@ void ColorAppearance::complexmethodChanged() } } +void ColorAppearance::modelmethodChanged() +{ + + if (listener && (multiImage || getEnabled())) { + listener->panelChanged(EvCATmodel, modelmethod->get_active_text()); + } +} void ColorAppearance::curveChanged (CurveEditor* ce) { @@ -2216,6 +2252,7 @@ void ColorAppearance::setBatchMode (bool batchMode) greensc->showEditedCB (); complexmethod->append(M("GENERAL_UNCHANGED")); + modelmethod->append(M("GENERAL_UNCHANGED")); surround->append (M ("GENERAL_UNCHANGED")); surrsrc->append (M ("GENERAL_UNCHANGED")); wbmodel->append (M ("GENERAL_UNCHANGED")); diff --git a/rtgui/colorappearance.h b/rtgui/colorappearance.h index 6976f4d29..194916cb0 100644 --- a/rtgui/colorappearance.h +++ b/rtgui/colorappearance.h @@ -78,6 +78,7 @@ public: bool curveMode3Changed_ (); void neutral_pressed (); void complexmethodChanged(); + void modelmethodChanged(); void convertParamToNormal(); void updateGUIToMode(int mode); @@ -108,6 +109,7 @@ private: rtengine::ProcEvent EvCATAutotempout; rtengine::ProcEvent EvCATillum; rtengine::ProcEvent EvCATcomplex; + rtengine::ProcEvent EvCATmodel; bool bgTTipQuery (int x, int y, bool keyboard_tooltip, const Glib::RefPtr& tooltip); bool srTTipQuery (int x, int y, bool keyboard_tooltip, const Glib::RefPtr& tooltip); void foldAllButMe (GdkEventButton* event, MyExpander *expander); @@ -144,6 +146,7 @@ private: MyComboBoxText* toneCurveMode2; MyComboBoxText* toneCurveMode3; MyComboBoxText* complexmethod; + MyComboBoxText* modelmethod; //Adjuster* edge; Gtk::CheckButton* surrsource; @@ -170,7 +173,7 @@ private: sigc::connection surrconn; sigc::connection gamutconn, datacieconn, tonecieconn /*,badpixconn , sharpcieconn*/; sigc::connection tcmodeconn, tcmode2conn, tcmode3conn, neutralconn; - sigc::connection complexmethodconn; + sigc::connection complexmethodconn, modelmethodconn; Gtk::HBox* alHBox; Gtk::HBox* wbmHBox; Gtk::HBox* illumHBox; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 611086ef3..08307d325 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -245,6 +245,7 @@ void ParamsEdited::set(bool v) colorappearance.curveMode2 = v; colorappearance.curveMode3 = v; colorappearance.complexmethod = v; + colorappearance.modelmethod = v; colorappearance.tempout = v; colorappearance.autotempout = v; colorappearance.greenout = v; @@ -916,6 +917,7 @@ void ParamsEdited::initFrom(const std::vector& colorappearance.curveMode2 = colorappearance.curveMode2 && p.colorappearance.curveMode2 == other.colorappearance.curveMode2; colorappearance.curveMode3 = colorappearance.curveMode3 && p.colorappearance.curveMode3 == other.colorappearance.curveMode3; colorappearance.complexmethod = colorappearance.complexmethod && p.colorappearance.complexmethod == other.colorappearance.complexmethod; + colorappearance.modelmethod = colorappearance.modelmethod && p.colorappearance.modelmethod == other.colorappearance.modelmethod; colorappearance.tempout = colorappearance.tempout && p.colorappearance.tempout == other.colorappearance.tempout; colorappearance.autotempout = colorappearance.autotempout && p.colorappearance.autotempout == other.colorappearance.autotempout; colorappearance.greenout = colorappearance.greenout && p.colorappearance.greenout == other.colorappearance.greenout; @@ -2638,6 +2640,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.colorappearance.complexmethod = mods.colorappearance.complexmethod; } + if (colorappearance.modelmethod) { + toEdit.colorappearance.modelmethod = mods.colorappearance.modelmethod; + } + if (colorappearance.enabled) { toEdit.colorappearance.enabled = mods.colorappearance.enabled; } diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index bfbc00a25..bf248bbab 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -267,6 +267,7 @@ struct ColorAppearanceParamsEdited { bool curveMode2; bool curveMode3; bool complexmethod; + bool modelmethod; bool enabled; bool degree; bool autodegree; From ad83d396ea9c78e6c2a57fc1f164ab5467692694 Mon Sep 17 00:00:00 2001 From: Desmis Date: Thu, 10 Dec 2020 13:31:38 +0100 Subject: [PATCH 008/129] Fixed bad behavior LA denoise when delimiters outside preview --- rtengine/improcfun.h | 4 +- rtengine/iplocallab.cc | 185 +++++++++++++++++++++++++++++++++++++---- 2 files changed, 173 insertions(+), 16 deletions(-) diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 95d14d5ef..b7b0b5741 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -366,7 +366,9 @@ public: void Exclude_Local(float **deltaso, float hueref, float chromaref, float lumaref, float sobelref, float meansobel, const struct local_params & lp, const LabImage * original, LabImage * transformed, const LabImage * rsv, const LabImage * reserv, int cx, int cy, int sk); void DeNoise_Local(int call, const struct local_params& lp, LabImage* originalmask, int levred, float hueref, float lumaref, float chromaref, LabImage* original, LabImage* transformed, const LabImage &tmp1, int cx, int cy, int sk); - void DeNoise(int call, int del, float * slidL, float * slida, float * slidb, int aut, bool noiscfactiv, const struct local_params& lp, LabImage* originalmaskbl, int levred, float huerefblur, float lumarefblur, float chromarefblur, LabImage* original, LabImage* transformed, int cx, int cy, int sk); + void DeNoise_Local2(const struct local_params& lp, LabImage* originalmask, int levred, float hueref, float lumaref, float chromaref, LabImage* original, LabImage* transformed, const LabImage &tmp1, int cx, int cy, int sk); + + void DeNoise(int call, float * slidL, float * slida, float * slidb, int aut, bool noiscfactiv, const struct local_params& lp, LabImage* originalmaskbl, int levred, float huerefblur, float lumarefblur, float chromarefblur, LabImage* original, LabImage* transformed, int cx, int cy, int sk); void fftw_denoise(int GW, int GH, int max_numblox_W, int min_numblox_W, float **tmp1, array2D *Lin, int numThreads, const struct local_params & lp, int chrom); diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 87726b4fa..9271f0b65 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -3037,6 +3037,159 @@ void ImProcFunctions::DeNoise_Local(int call, const struct local_params& lp, Lab } } +void ImProcFunctions::DeNoise_Local2(const struct local_params& lp, LabImage* originalmask, int levred, float hueref, float lumaref, float chromaref, LabImage* original, LabImage* transformed, const LabImage &tmp1, int cx, int cy, int sk) +{ + //warning, but I hope used it next + // local denoise and impulse + //simple algo , perhaps we can improve as the others, but noise is here and not good for hue detection + // BENCHFUN + const int ystart = rtengine::max(static_cast(lp.yc - lp.lyT) - cy, 0); + const int yend = rtengine::min(static_cast(lp.yc + lp.ly) - cy, original->H); + const int xstart = rtengine::max(static_cast(lp.xc - lp.lxL) - cx, 0); + const int xend = rtengine::min(static_cast(lp.xc + lp.lx) - cx, original->W); + + + lumaref *= 327.68f; + const float ach = lp.trans / 100.f; + + const float factnoise1 = 1.f + (lp.noisecf) / 500.f; + const float factnoise2 = 1.f + (lp.noisecc) / 500.f; + const float factnoise = factnoise1 * factnoise2; + + const int GW = transformed->W; + const int GH = transformed->H; + + const float colorde = lp.colorde == 0 ? -1.f : lp.colorde; // -1.f to avoid black + const float amplabL = 2.f * colorde; + constexpr float darklim = 5000.f; + + const float refa = chromaref * std::cos(hueref) * 327.68f; + const float refb = chromaref * std::sin(hueref) * 327.68f; + const bool usemaskbl = lp.showmaskblmet == 2 || lp.enablMask || lp.showmaskblmet == 4; + const bool blshow = lp.showmaskblmet == 1 || lp.showmaskblmet == 2; + const bool previewbl = lp.showmaskblmet == 4; + + const std::unique_ptr origblur(new LabImage(GW, GH)); + const float radius = 3.f / sk; + + if (usemaskbl) { +#ifdef _OPENMP + #pragma omp parallel if (multiThread) +#endif + { + gaussianBlur(originalmask->L, origblur->L, GW, GH, radius); + gaussianBlur(originalmask->a, origblur->a, GW, GH, radius); + gaussianBlur(originalmask->b, origblur->b, GW, GH, radius); + } + } else { +#ifdef _OPENMP + #pragma omp parallel if (multiThread) +#endif + { + gaussianBlur(original->L, origblur->L, GW, GH, radius); + gaussianBlur(original->a, origblur->a, GW, GH, radius); + gaussianBlur(original->b, origblur->b, GW, GH, radius); + } + } + + // const int begx = lp.xc - lp.lxL; + // const int begy = lp.yc - lp.lyT; + constexpr float r327d68 = 1.f / 327.68f; + +#ifdef _OPENMP + #pragma omp parallel if (multiThread) +#endif + { + const LabImage* maskptr = origblur.get(); + const float mindE = 2.f + MINSCOPE * lp.sensden * lp.thr; + const float maxdE = 5.f + MAXSCOPE * lp.sensden * (1 + 0.1f * lp.thr); + const float mindElim = 2.f + MINSCOPE * limscope * lp.thr; + const float maxdElim = 5.f + MAXSCOPE * limscope * (1 + 0.1f * lp.thr); + +#ifdef _OPENMP + #pragma omp for schedule(dynamic,16) +#endif + + for (int y = ystart; y < yend; y++) { + const int loy = cy + y; +// const bool isZone0 = loy > lp.yc + lp.ly || loy < lp.yc - lp.lyT; // whole line is zone 0 => we can skip a lot of processing + +// if (isZone0) { // outside selection and outside transition zone => no effect, keep original values +// continue; + // } + + for (int x = xstart, lox = cx + x; x < xend; x++, lox++) { + int zone; + float localFactor = 1.f; + + if (lp.shapmet == 0) { + calcTransition(lox, loy, ach, lp, zone, localFactor); + } else { /*if (lp.shapmet == 1)*/ + calcTransitionrect(lox, loy, ach, lp, zone, localFactor); + } + + if (zone == 0) { // outside selection and outside transition zone => no effect, keep original values + continue; + } + + float reducdEL = 1.f; + float reducdEa = 1.f; + float reducdEb = 1.f; + + if (levred == 7) { + const float dEL = std::sqrt(0.9f * SQR(refa - maskptr->a[y][x]) + 0.9f * SQR(refb - maskptr->b[y][x]) + 1.2f * SQR(lumaref - maskptr->L[y][x])) * r327d68; + const float dEa = std::sqrt(1.2f * SQR(refa - maskptr->a[y][x]) + 1.f * SQR(refb - maskptr->b[y][x]) + 0.8f * SQR(lumaref - maskptr->L[y][x])) * r327d68; + const float dEb = std::sqrt(1.f * SQR(refa - maskptr->a[y][x]) + 1.2f * SQR(refb - maskptr->b[y][x]) + 0.8f * SQR(lumaref - maskptr->L[y][x])) * r327d68; + reducdEL = SQR(calcreducdE(dEL, maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, lp.sensden)); + reducdEa = SQR(calcreducdE(dEa, maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, lp.sensden)); + reducdEb = SQR(calcreducdE(dEb, maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, lp.sensden)); + } + + float difL, difa, difb; + + // if (call == 2 /*|| call == 1 || call == 3 */) { //simpleprocess + // difL = tmp1.L[loy - begy][lox - begx] - original->L[y][x]; + // difa = tmp1.a[loy - begy][lox - begx] - original->a[y][x]; + // difb = tmp1.b[loy - begy][lox - begx] - original->b[y][x]; + // } else { //dcrop + + difL = tmp1.L[y-ystart][x-xstart] - original->L[y][x]; + difa = tmp1.a[y-ystart][x-xstart] - original->a[y][x]; + difb = tmp1.b[y-ystart][x-xstart] - original->b[y][x]; + // } + + difL *= localFactor * reducdEL; + difa *= localFactor * reducdEa; + difb *= localFactor * reducdEb; + transformed->L[y][x] = CLIP(original->L[y][x] + difL); + transformed->a[y][x] = clipC((original->a[y][x] + difa) * factnoise); + transformed->b[y][x] = clipC((original->b[y][x] + difb) * factnoise) ; + + if (blshow) { + transformed->L[y][x] = CLIP(12000.f + amplabL * difL);// * 10.f empirical to can visualize modifications + transformed->a[y][x] = clipC(amplabL * difa);// * 10.f empirical to can visualize modifications + transformed->b[y][x] = clipC(amplabL * difb);// * 10.f empirical to can visualize modifications + } else if (previewbl || lp.prevdE) { + const float difbdisp = (reducdEL + reducdEa + reducdEb) * 10000.f * colorde; + + if (transformed->L[y][x] < darklim) { //enhance dark luminance as user can see! + transformed->L[y][x] = darklim - transformed->L[y][x]; + } + + if (colorde <= 0) { + transformed->a[y][x] = 0.f; + transformed->b[y][x] = difbdisp; + } else { + transformed->a[y][x] = -difbdisp; + transformed->b[y][x] = 0.f; + } + } + } + } + } +} + + void ImProcFunctions::InverseReti_Local(const struct local_params & lp, const float hueref, const float chromaref, const float lumaref, LabImage * original, LabImage * transformed, const LabImage * const tmp1, int cx, int cy, int chro, int sk) { // BENCHFUN @@ -8497,7 +8650,7 @@ void ImProcFunctions::fftw_denoise(int GW, int GH, int max_numblox_W, int min_nu } -void ImProcFunctions::DeNoise(int call, int del, float * slidL, float * slida, float * slidb, int aut, bool noiscfactiv, const struct local_params & lp, LabImage * originalmaskbl, int levred, float huerefblur, float lumarefblur, float chromarefblur, LabImage * original, LabImage * transformed, int cx, int cy, int sk) +void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * slidb, int aut, bool noiscfactiv, const struct local_params & lp, LabImage * originalmaskbl, int levred, float huerefblur, float lumarefblur, float chromarefblur, LabImage * original, LabImage * transformed, int cx, int cy, int sk) { //local denoise @@ -9071,8 +9224,12 @@ void ImProcFunctions::DeNoise(int call, int del, float * slidL, float * slida, f } else if (call == 2) { //simpleprocess - int bfh = int (lp.ly + lp.lyT) + del; //bfw bfh real size of square zone - int bfw = int (lp.lx + lp.lxL) + del; + const int ystart = rtengine::max(static_cast(lp.yc - lp.lyT) - cy, 0); + const int yend = rtengine::min(static_cast(lp.yc + lp.ly) - cy, original->H); + const int xstart = rtengine::max(static_cast(lp.xc - lp.lxL) - cx, 0); + const int xend = rtengine::min(static_cast(lp.xc + lp.lx) - cx, original->W); + const int bfh = yend - ystart; + const int bfw = xend - xstart; if (bfh >= mDEN && bfw >= mDEN) { LabImage bufwv(bfw, bfh); @@ -9087,10 +9244,10 @@ void ImProcFunctions::DeNoise(int call, int del, float * slidL, float * slida, f // these are needed only for creation of the plans and will be freed before entering the parallel loop - int begy = lp.yc - lp.lyT; - int begx = lp.xc - lp.lxL; - int yEn = lp.yc + lp.ly; - int xEn = lp.xc + lp.lx; + int begy = ystart; //lp.yc - lp.lyT; + int begx = xstart; //lp.xc - lp.lxL; + int yEn = yend; //lp.yc + lp.ly; + int xEn = xend; //lp.xc + lp.lx; #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) @@ -9609,13 +9766,11 @@ void ImProcFunctions::DeNoise(int call, int del, float * slidL, float * slida, f } } - if(lp.smasktyp != 0) { - DeNoise_Local(call, lp, originalmaskbl, levred, huerefblur, lumarefblur, chromarefblur, original, transformed, bufwv, cx, cy, sk); - } else { - DeNoise_Local(call, lp, original, levred, huerefblur, lumarefblur, chromarefblur, original, transformed, bufwv, cx, cy, sk); - } - - // DeNoise_Local(call, lp, originalmaskbl, levred, huerefblur, lumarefblur, chromarefblur, original, transformed, bufwv, cx, cy, sk); + if (lp.smasktyp != 0) { + DeNoise_Local2(lp, originalmaskbl, levred, huerefblur, lumarefblur, chromarefblur, original, transformed, bufwv, cx, cy, sk); + } else { + DeNoise_Local2(lp, original, levred, huerefblur, lumarefblur, chromarefblur, original, transformed, bufwv, cx, cy, sk); + } } } } @@ -10919,7 +11074,7 @@ void ImProcFunctions::Lab_Local( float slida[8] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; float slidb[8] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; constexpr int aut = 0; - DeNoise(call, del, slidL, slida, slidb, aut, noiscfactiv, lp, originalmaskbl.get(), levred, huerefblur, lumarefblur, chromarefblur, original, transformed, cx, cy, sk); + DeNoise(call, slidL, slida, slidb, aut, noiscfactiv, lp, originalmaskbl.get(), levred, huerefblur, lumarefblur, chromarefblur, original, transformed, cx, cy, sk); if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed, multiThread); From 37f406627696852f7a7d943ffa091211d8563f1a Mon Sep 17 00:00:00 2001 From: Desmis Date: Fri, 11 Dec 2020 07:36:11 +0100 Subject: [PATCH 009/129] LA denoise equalizer hue --- rtdata/languages/default | 3 ++- rtengine/dcrop.cc | 4 +++ rtengine/improccoordinator.cc | 2 ++ rtengine/improccoordinator.h | 1 + rtengine/improcfun.h | 3 ++- rtengine/iplocallab.cc | 46 +++++++++++++++++++++++++++++++++-- rtengine/procevents.h | 2 +- rtengine/procparams.cc | 30 +++++++++++++++++++++++ rtengine/procparams.h | 1 + rtengine/refreshmap.cc | 4 +-- rtengine/simpleprocess.cc | 5 +++- rtgui/locallabtools.cc | 36 +++++++++++++++++++++++++++ rtgui/locallabtools.h | 2 ++ rtgui/paramsedited.cc | 7 ++++++ rtgui/paramsedited.h | 1 + 15 files changed, 139 insertions(+), 8 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 00da0fae3..f04ef1f78 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1226,6 +1226,7 @@ HISTORY_MSG_978;Local - Log encoding Sursource HISTORY_MSG_979;Local - Log encoding Brightness Q HISTORY_MSG_980;Local - Log encoding Colorfulness M HISTORY_MSG_981;Local - Log encoding Strength +HISTORY_MSG_982;Local - Equalizer hue HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance @@ -3021,7 +3022,7 @@ TP_LOCALLAB_VIS_TOOLTIP;Click to show/hide selected Control Spot.\nCtr TP_LOCALLAB_WAMASKCOL;Ψ Mask Wavelet level TP_LOCALLAB_WARM;Warm/Cool & Color artifacts TP_LOCALLAB_WARM_TOOLTIP;This slider uses the CIECAM algorithm and acts as a White Balance control to make the color temperature of the selected area warmer or cooler.\nIt can also reduce color artifacts in some cases. -TP_LOCALLAB_WASDEN_TOOLTIP;Luminance noise reduction: the left-hand side of the curve corresponds to the first 3 levels 0,1 &2 (fine detail). The right hand side of the curve corresponds to the coarser details (level 3 and beyond). +TP_LOCALLAB_WASDEN_TOOLTIP;Luminance noise reduction: the left-hand side of the curve corresponds to the first 3 levels 0,1, 2 (fine detail). The right hand side of the curve corresponds to the coarser details (level 3 and beyond). TP_LOCALLAB_WAT_BALTHRES_TOOLTIP;Balances the action within each level. TP_LOCALLAB_WAT_BLURLC_TOOLTIP;The default blur setting affects all 3 L*a* b* components (luminance and colour).\nWhen checked, only luminance is blurred. TP_LOCALLAB_WAT_CLARIC_TOOLTIP;“Merge chroma” is used to select the intensity of the desired effect on chrominance. diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 64e2d6e60..a787f1300 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -935,6 +935,7 @@ void Crop::update(int todo) auto& loccompwavCurve = parent->loccompwavCurve; auto& loccomprewavCurve = parent->loccomprewavCurve; auto& locedgwavCurve = parent->locedgwavCurve; + auto& locwavCurvehue = parent->locwavCurvehue; auto& locwavCurveden = parent->locwavCurveden; auto& lmasklocal_curve2 = parent->lmasklocal_curve; auto& loclmasCurve_wav = parent->loclmasCurve_wav; @@ -985,6 +986,7 @@ void Crop::update(int todo) const bool llmaslcutili = locllmaslcCurve.Set(params.locallab.spots.at(sp).LLmasklccurve); const bool lhmaslcutili = lochhmaslcCurve.Set(params.locallab.spots.at(sp).HHmasklccurve); const bool locwavutili = locwavCurve.Set(params.locallab.spots.at(sp).locwavcurve); + const bool locwavhueutili = locwavCurvehue.Set(params.locallab.spots.at(sp).locwavcurvehue); const bool locwavdenutili = locwavCurveden.Set(params.locallab.spots.at(sp).locwavcurveden); const bool loclevwavutili = loclevwavCurve.Set(params.locallab.spots.at(sp).loclevwavcurve); const bool locconwavutili = locconwavCurve.Set(params.locallab.spots.at(sp).locconwavcurve); @@ -1080,6 +1082,7 @@ void Crop::update(int todo) locconwavCurve, locconwavutili, loccompwavCurve, loccompwavutili, loccomprewavCurve, loccomprewavutili, + locwavCurvehue, locwavhueutili, locwavCurveden, locwavdenutili, locedgwavCurve, locedgwavutili, loclmasCurve_wav,lmasutili_wav, @@ -1125,6 +1128,7 @@ void Crop::update(int todo) locconwavCurve, locconwavutili, loccompwavCurve, loccompwavutili, loccomprewavCurve, loccomprewavutili, + locwavCurvehue, locwavhueutili, locwavCurveden, locwavdenutili, locedgwavCurve, locedgwavutili, loclmasCurve_wav,lmasutili_wav, diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index e63bb19f4..1bee058c8 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -1119,6 +1119,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) const bool locconwavutili = locconwavCurve.Set(params->locallab.spots.at(sp).locconwavcurve); const bool loccompwavutili = loccompwavCurve.Set(params->locallab.spots.at(sp).loccompwavcurve); const bool loccomprewavutili = loccomprewavCurve.Set(params->locallab.spots.at(sp).loccomprewavcurve); + const bool locwavhueutili = locwavCurvehue.Set(params->locallab.spots.at(sp).locwavcurvehue); const bool locwavdenutili = locwavCurveden.Set(params->locallab.spots.at(sp).locwavcurveden); const bool locedgwavutili = locedgwavCurve.Set(params->locallab.spots.at(sp).locedgwavcurve); const bool lmasutili_wav = loclmasCurve_wav.Set(params->locallab.spots.at(sp).LLmask_curvewav); @@ -1227,6 +1228,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) locconwavCurve, locconwavutili, loccompwavCurve, loccompwavutili, loccomprewavCurve, loccomprewavutili, + locwavCurvehue, locwavhueutili, locwavCurveden, locwavdenutili, locedgwavCurve, locedgwavutili, loclmasCurve_wav, lmasutili_wav, diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index 8097dd9ce..5c17f36b8 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -329,6 +329,7 @@ protected: LocwavCurve locwavCurveden; LocwavCurve locedgwavCurve; LocwavCurve loclmasCurve_wav; + LocwavCurve locwavCurvehue; std::vector huerefs; std::vector huerefblurs; diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index b7b0b5741..a8d168383 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -325,6 +325,7 @@ public: const LocwavCurve& locconwavCurve, bool locconwavutili, const LocwavCurve& loccompwavCurve, bool loccompwavutili, const LocwavCurve& loccomprewavCurve, bool loccomprewavutili, + const LocwavCurve& locwavCurvehue, bool locwavhueutili, const LocwavCurve& locwavCurveden, bool locwavdenutili, const LocwavCurve& locedgwavCurve, bool locedgwavutili, const LocwavCurve& loclmasCurve_wav, bool lmasutili_wav, @@ -368,7 +369,7 @@ public: void DeNoise_Local(int call, const struct local_params& lp, LabImage* originalmask, int levred, float hueref, float lumaref, float chromaref, LabImage* original, LabImage* transformed, const LabImage &tmp1, int cx, int cy, int sk); void DeNoise_Local2(const struct local_params& lp, LabImage* originalmask, int levred, float hueref, float lumaref, float chromaref, LabImage* original, LabImage* transformed, const LabImage &tmp1, int cx, int cy, int sk); - void DeNoise(int call, float * slidL, float * slida, float * slidb, int aut, bool noiscfactiv, const struct local_params& lp, LabImage* originalmaskbl, int levred, float huerefblur, float lumarefblur, float chromarefblur, LabImage* original, LabImage* transformed, int cx, int cy, int sk); + void DeNoise(int call, float * slidL, float * slida, float * slidb, int aut, bool noiscfactiv, const struct local_params& lp, LabImage* originalmaskbl, int levred, float huerefblur, float lumarefblur, float chromarefblur, LabImage* original, LabImage* transformed, int cx, int cy, int sk, const LocwavCurve& locwavCurvehue, bool locwavhueutili); void fftw_denoise(int GW, int GH, int max_numblox_W, int min_numblox_W, float **tmp1, array2D *Lin, int numThreads, const struct local_params & lp, int chrom); diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 9271f0b65..d4cf7041b 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -8650,7 +8650,7 @@ void ImProcFunctions::fftw_denoise(int GW, int GH, int max_numblox_W, int min_nu } -void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * slidb, int aut, bool noiscfactiv, const struct local_params & lp, LabImage * originalmaskbl, int levred, float huerefblur, float lumarefblur, float chromarefblur, LabImage * original, LabImage * transformed, int cx, int cy, int sk) +void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * slidb, int aut, bool noiscfactiv, const struct local_params & lp, LabImage * originalmaskbl, int levred, float huerefblur, float lumarefblur, float chromarefblur, LabImage * original, LabImage * transformed, int cx, int cy, int sk, const LocwavCurve& locwavCurvehue, bool locwavhueutili) { //local denoise @@ -8681,6 +8681,16 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl int GW = transformed->W; int GH = transformed->H; + bool HHhuecurve = false; + + if (locwavCurvehue && locwavhueutili) { + for (int i = 0; i < 500; i++) { + if (locwavCurvehue[i] != 0.5) { + HHhuecurve = true; + break; + } + } + } #ifdef _OPENMP const int numThreads = omp_get_max_threads(); @@ -8817,6 +8827,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } float* noisevarlum = new float[GH * GW]; + float* noisevarhue = new float[GH * GW]; int GW2 = (GW + 1) / 2; float nvlh[13] = {1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 0.7f, 0.5f}; //high value @@ -8844,6 +8855,20 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } } + if(HHhuecurve) { +#ifdef _OPENMP + #pragma omp parallel for +#endif + for (int ir = 0; ir < GH; ir++) + for (int jr = 0; jr < GW; jr++) { + float hueG = xatan2f(tmp1.b[ir][jr], tmp1.a[ir][jr]); + float valparam = float (2.f * (locwavCurvehue[500.f * Color::huelab_to_huehsv2(hueG)] - 0.5f)); //get H=f(H) + noisevarhue[(ir >> 1)*GW2 + (jr >> 1)] = 1.f + valparam; + noisevarlum[(ir >> 1)*GW2 + (jr >> 1)] *= noisevarhue[(ir >> 1)*GW2 + (jr >> 1)]; + } + } + + if ((lp.quamet == 0 && aut == 0) || (mxsl < 1.f && (aut == 1 || aut == 2))) { WaveletDenoiseAllL(Ldecomp, noisevarlum, madL, vari, edge, numThreads); @@ -8856,6 +8881,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } delete[] noisevarlum; + delete[] noisevarhue; } } @@ -9371,6 +9397,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl // float* noisevarlum = nullptr; // we need a dummy to pass it to WaveletDenoiseAllL float* noisevarlum = new float[bfh * bfw]; + float* noisevarhue = new float[bfh * bfw]; int bfw2 = (bfw + 1) / 2; float nvlh[13] = {1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 0.7f, 0.5f}; //high value @@ -9398,6 +9425,19 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } } + if(HHhuecurve) { +#ifdef _OPENMP + #pragma omp parallel for +#endif + for (int ir = 0; ir < bfh; ir++) + for (int jr = 0; jr < bfw; jr++) { + float hueG = xatan2f(bufwv.b[ir][jr], bufwv.a[ir][jr]); + float valparam = float (2.f * (locwavCurvehue[500.f * Color::huelab_to_huehsv2(hueG)] - 0.5f)); //get H=f(H) + noisevarhue[(ir >> 1)* bfw2 + (jr >> 1)] = 1.f + valparam; + noisevarlum[(ir >> 1)* bfw2 + (jr >> 1)] *= noisevarhue[(ir >> 1)* bfw2 + (jr >> 1)]; + } + } + if ((lp.quamet == 0 && aut == 0) || (mxsl < 1.f && (aut == 1 || aut == 2))) { WaveletDenoiseAllL(Ldecomp, noisevarlum, madL, vari, edge, numThreads); @@ -9407,6 +9447,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } delete [] noisevarlum; + delete [] noisevarhue; } } @@ -10129,6 +10170,7 @@ void ImProcFunctions::Lab_Local( const LocwavCurve& locconwavCurve, bool locconwavutili, const LocwavCurve& loccompwavCurve, bool loccompwavutili, const LocwavCurve& loccomprewavCurve, bool loccomprewavutili, + const LocwavCurve& locwavCurvehue, bool locwavhueutili, const LocwavCurve& locwavCurveden, bool locwavdenutili, const LocwavCurve& locedgwavCurve, bool locedgwavutili, const LocwavCurve& loclmasCurve_wav, bool lmasutili_wav, @@ -11074,7 +11116,7 @@ void ImProcFunctions::Lab_Local( float slida[8] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; float slidb[8] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; constexpr int aut = 0; - DeNoise(call, slidL, slida, slidb, aut, noiscfactiv, lp, originalmaskbl.get(), levred, huerefblur, lumarefblur, chromarefblur, original, transformed, cx, cy, sk); + DeNoise(call, slidL, slida, slidb, aut, noiscfactiv, lp, originalmaskbl.get(), levred, huerefblur, lumarefblur, chromarefblur, original, transformed, cx, cy, sk, locwavCurvehue, locwavhueutili); if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed, multiThread); diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 9f4e3e77c..7464152a3 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -1004,7 +1004,7 @@ enum ProcEventCode { Evlocallablightq = 978, Evlocallabcolorfl = 979, Evlocallabrepar = 980, - + EvlocallabwavCurvehue = 981, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 1fed31dc1..8f9567b41 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3336,6 +3336,33 @@ LocallabParams::LocallabSpot::LocallabSpot() : 0.35, 0.35 }, + locwavcurvehue{ + static_cast(FCT_MinMaxCPoints), + 0.0, + 0.50, + 0.35, + 0.35, + 0.166, + 0.50, + 0.35, + 0.35, + 0.333, + 0.50, + 0.35, + 0.35, + 0.50, + 0.50, + 0.35, + 0.35, + 0.666, + 0.50, + 0.35, + 0.35, + 0.833, + 0.50, + 0.35, + 0.35 + }, showmaskblMethodtyp("blur"), CCmaskblcurve{ static_cast(FCT_MinMaxCPoints), @@ -4335,6 +4362,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && sensiden == other.sensiden && detailthr == other.detailthr && locwavcurveden == other.locwavcurveden + && locwavcurvehue == other.locwavcurvehue && showmaskblMethodtyp == other.showmaskblMethodtyp && CCmaskblcurve == other.CCmaskblcurve && LLmaskblcurve == other.LLmaskblcurve @@ -5916,6 +5944,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->sensiden, "Locallab", "Sensiden_" + index_str, spot.sensiden, keyFile); saveToKeyfile(!pedited || spot_edited->detailthr, "Locallab", "Detailthr_" + index_str, spot.detailthr, keyFile); saveToKeyfile(!pedited || spot_edited->locwavcurveden, "Locallab", "LocwavCurveden_" + index_str, spot.locwavcurveden, keyFile); + saveToKeyfile(!pedited || spot_edited->locwavcurvehue, "Locallab", "LocwavCurvehue_" + index_str, spot.locwavcurvehue, keyFile); saveToKeyfile(!pedited || spot_edited->showmaskblMethodtyp, "Locallab", "Showmasktyp_" + index_str, spot.showmaskblMethodtyp, keyFile); saveToKeyfile(!pedited || spot_edited->CCmaskblcurve, "Locallab", "CCmaskblCurve_" + index_str, spot.CCmaskblcurve, keyFile); saveToKeyfile(!pedited || spot_edited->LLmaskblcurve, "Locallab", "LLmaskblCurve_" + index_str, spot.LLmaskblcurve, keyFile); @@ -7713,6 +7742,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Sensiden_" + index_str, pedited, spot.sensiden, spotEdited.sensiden); assignFromKeyfile(keyFile, "Locallab", "Detailthr_" + index_str, pedited, spot.detailthr, spotEdited.detailthr); assignFromKeyfile(keyFile, "Locallab", "LocwavCurveden_" + index_str, pedited, spot.locwavcurveden, spotEdited.locwavcurveden); + assignFromKeyfile(keyFile, "Locallab", "LocwavCurvehue_" + index_str, pedited, spot.locwavcurvehue, spotEdited.locwavcurvehue); assignFromKeyfile(keyFile, "Locallab", "Showmasktyp_" + index_str, pedited, spot.showmaskblMethodtyp, spotEdited.showmaskblMethodtyp); assignFromKeyfile(keyFile, "Locallab", "CCmaskblCurve_" + index_str, pedited, spot.CCmaskblcurve, spotEdited.CCmaskblcurve); assignFromKeyfile(keyFile, "Locallab", "LLmaskblCurve_" + index_str, pedited, spot.LLmaskblcurve, spotEdited.LLmaskblcurve); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 25d39202e..520b12763 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1229,6 +1229,7 @@ struct LocallabParams { int sensiden; int detailthr; std::vector locwavcurveden; + std::vector locwavcurvehue; Glib::ustring showmaskblMethodtyp; std::vector CCmaskblcurve; std::vector LLmaskblcurve; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index e424ef14d..331945848 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -1007,8 +1007,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabsursour LUMINANCECURVE, // Evlocallablightq LUMINANCECURVE, // Evlocallabcolorfl - LUMINANCECURVE // Evlocallabrepar - + LUMINANCECURVE, // Evlocallabrepar + LUMINANCECURVE //EvlocallabwavCurvehue }; diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 57e239b66..7573f70c1 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -1139,6 +1139,7 @@ private: LocwavCurve loccompwavCurve; LocwavCurve loccomprewavCurve; LocwavCurve locedgwavCurve; + LocwavCurve locwavCurvehue; LocwavCurve locwavCurveden; LUTf lllocalcurve(65536, LUT_CLIP_OFF); LUTf lclocalcurve(65536, LUT_CLIP_OFF); @@ -1217,6 +1218,7 @@ private: const bool llmaslcutili = locllmaslcCurve.Set(params.locallab.spots.at(sp).LLmasklccurve); const bool lmasutili_wav = loclmasCurve_wav.Set(params.locallab.spots.at(sp).LLmask_curvewav); const bool locwavutili = locwavCurve.Set(params.locallab.spots.at(sp).locwavcurve); + const bool locwavhueutili = locwavCurvehue.Set(params.locallab.spots.at(sp).locwavcurvehue); const bool locwavdenutili = locwavCurveden.Set(params.locallab.spots.at(sp).locwavcurveden); const bool loclevwavutili = loclevwavCurve.Set(params.locallab.spots.at(sp).loclevwavcurve); const bool locconwavutili = locconwavCurve.Set(params.locallab.spots.at(sp).locconwavcurve); @@ -1301,7 +1303,7 @@ private: locccmasblCurve, lcmasblutili, locllmasblCurve, llmasblutili, lochhmasblCurve, lhmasblutili, locccmaslcCurve, lcmaslcutili, locllmaslcCurve, llmaslcutili, lochhmaslcCurve, lhmaslcutili, locccmaslogCurve, lcmaslogutili, locllmaslogCurve, llmaslogutili, lochhmaslogCurve, lhmaslogutili, - + locccmas_Curve, lcmas_utili, locllmas_Curve, llmas_utili, lochhmas_Curve, lhmas_utili, lochhhmas_Curve, lhhmas_utili, loclmasCurveblwav,lmasutiliblwav, @@ -1311,6 +1313,7 @@ private: locconwavCurve, locconwavutili, loccompwavCurve, loccompwavutili, loccomprewavCurve, loccomprewavutili, + locwavCurvehue, locwavhueutili, locwavCurveden, locwavdenutili, locedgwavCurve, locedgwavutili, loclmasCurve_wav,lmasutili_wav, diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index da5f746dd..d06fa1837 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -5766,6 +5766,8 @@ LocallabBlur::LocallabBlur(): noiselumc(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMCOARSE"), MINCHRO, MAXCHROCC, 0.01, 0.))), noiselumdetail(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMDETAIL"), 0., 100., 0.01, 0.))), noiselequal(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELEQUAL"), -2, 10, 1, 7, Gtk::manage(new RTImage("circle-white-small.png")), Gtk::manage(new RTImage("circle-black-small.png"))))), + LocalcurveEditorwavhue(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_WAVELET_DENOISEHUE"))), + wavhue(static_cast(LocalcurveEditorwavhue->addCurve(CT_Flat, "", nullptr, false, true))), noisechrof(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISECHROFINE"), MINCHRO, MAXCHRO, 0.01, 0.))), noisechroc(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISECHROCOARSE"), MINCHRO, MAXCHROCC, 0.01, 0.))), noisechrodetail(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISECHRODETAIL"), 0., 100., 0.01, 0.))), @@ -5803,6 +5805,14 @@ LocallabBlur::LocallabBlur(): // Parameter Blur, Noise & Denoise specific widgets setExpandAlignProperties(expblnoise, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); + float R, G, B; + std::vector six_shape; + + for (int i = 0; i < 6; i++) { + const float x = static_cast(i) * (1.f / 6.f); + Color::hsv2rgb01(x, 0.5f, 0.5f, R, G, B); + six_shape.emplace_back(x, R, G, B); + } blMethod->append(M("TP_LOCALLAB_BLUR")); blMethod->append(M("TP_LOCALLAB_BLMED")); @@ -5886,6 +5896,19 @@ LocallabBlur::LocallabBlur(): noiselequal->setAdjusterListener(this); + LocalcurveEditorwavhue->setCurveListener(this); + + wavhue->setIdentityValue(0.); + wavhue->setResetCurve(FlatCurveType(defSpot.locwavcurvehue.at(0)), defSpot.locwavcurvehue); + wavhue->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP")); + wavhue->setCurveColorProvider(this, 3); + wavhue->setBottomBarBgGradient(six_shape); + +// wavguid->setIdentityValue(0.); +// wavguid->setResetCurve(FlatCurveType(defSpot.locwavcurveguid.at(0)), defSpot.locwavcurveguid); + + LocalcurveEditorwavhue->curveListComplete(); + noisechrof->setAdjusterListener(this); noisechroc->set_tooltip_text(M("TP_LOCALLAB_NOISECHROC_TOOLTIP")); @@ -6008,6 +6031,7 @@ LocallabBlur::LocallabBlur(): // wavBox->pack_start(*noiselumc); wavBox->pack_start(*noiselumdetail); wavBox->pack_start(*noiselequal); + wavBox->pack_start(*LocalcurveEditorwavhue, Gtk::PACK_SHRINK, 4); wavBox->pack_start(*noisechrof); wavBox->pack_start(*noisechroc); wavBox->pack_start(*noisechrodetail); @@ -6050,6 +6074,7 @@ LocallabBlur::LocallabBlur(): LocallabBlur::~LocallabBlur() { delete LocalcurveEditorwavden; + delete LocalcurveEditorwavhue; delete maskblCurveEditorG; delete mask2blCurveEditorG; delete mask2blCurveEditorGwav; @@ -6091,6 +6116,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) expdenoise->set_tooltip_markup(M("TP_LOCALLAB_DENOI_TOOLTIP")); quamethod->set_tooltip_markup(M("TP_LOCALLAB_DENOIQUA_TOOLTIP")); wavshapeden->setTooltip(M("TP_LOCALLAB_WASDEN_TOOLTIP")); +// wavhue->setTooltip(M("TP_LOCALLAB_WAVHUE_TOOLTIP")); LocalcurveEditorwavden->setTooltip(M("TP_LOCALLAB_WASDEN_TOOLTIP")); noiselequal->set_tooltip_text(M("TP_LOCALLAB_DENOIEQUAL_TOOLTIP")); noiselumdetail->set_tooltip_text(M("TP_LOCALLAB_DENOILUMDETAIL_TOOLTIP")); @@ -6173,6 +6199,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) shadmaskbl->set_tooltip_text(""); shadmaskblsha->set_tooltip_text(""); csThresholdblur->set_tooltip_text(""); +// wavhue->setTooltip(""); sensiden->set_tooltip_text(""); } @@ -6294,6 +6321,7 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params activlum->set_active(spot.activlum); wavshapeden->setCurve(spot.locwavcurveden); + wavhue->setCurve(spot.locwavcurvehue); noiselumf0->setValue(spot.noiselumf0); noiselumf->setValue(spot.noiselumf); noiselumf2->setValue(spot.noiselumf2); @@ -6414,6 +6442,7 @@ void LocallabBlur::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.activlum = activlum->get_active(); spot.locwavcurveden = wavshapeden->getCurve(); + spot.locwavcurvehue = wavhue->getCurve(); spot.noiselumf0 = noiselumf0->getValue(); spot.noiselumf = noiselumf->getValue(); spot.noiselumf2 = noiselumf2->getValue(); @@ -6754,6 +6783,13 @@ void LocallabBlur::curveChanged(CurveEditor* ce) } } + if (ce == wavhue) { + if (listener) { + listener->panelChanged(EvlocallabwavCurvehue, + M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")"); + } + } + if (ce == CCmaskblshape) { if (listener) { listener->panelChanged(EvlocallabCCmaskblshape, diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index c221983c1..e15cd716c 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -665,6 +665,8 @@ private: Adjuster* const noiselumc; Adjuster* const noiselumdetail; Adjuster* const noiselequal; + CurveEditorGroup* const LocalcurveEditorwavhue; + FlatCurveEditor* wavhue; Adjuster* const noisechrof; Adjuster* const noisechroc; Adjuster* const noisechrodetail; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 08307d325..628d07214 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1300,6 +1300,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).sensiden = locallab.spots.at(j).sensiden && pSpot.sensiden == otherSpot.sensiden; locallab.spots.at(j).detailthr = locallab.spots.at(j).detailthr && pSpot.detailthr == otherSpot.detailthr; locallab.spots.at(j).locwavcurveden = locallab.spots.at(j).locwavcurveden && pSpot.locwavcurveden == otherSpot.locwavcurveden; + locallab.spots.at(j).locwavcurvehue = locallab.spots.at(j).locwavcurvehue && pSpot.locwavcurvehue == otherSpot.locwavcurvehue; locallab.spots.at(j).showmaskblMethodtyp = locallab.spots.at(j).showmaskblMethodtyp && pSpot.showmaskblMethodtyp == otherSpot.showmaskblMethodtyp; locallab.spots.at(j).CCmaskblcurve = locallab.spots.at(j).CCmaskblcurve && pSpot.CCmaskblcurve == otherSpot.CCmaskblcurve; locallab.spots.at(j).LLmaskblcurve = locallab.spots.at(j).LLmaskblcurve && pSpot.LLmaskblcurve == otherSpot.LLmaskblcurve; @@ -4115,6 +4116,11 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).locwavcurveden = mods.locallab.spots.at(i).locwavcurveden; } + if (locallab.spots.at(i).locwavcurvehue) { + toEdit.locallab.spots.at(i).locwavcurvehue = mods.locallab.spots.at(i).locwavcurvehue; + } + + if (locallab.spots.at(i).showmaskblMethodtyp) { toEdit.locallab.spots.at(i).showmaskblMethodtyp = mods.locallab.spots.at(i).showmaskblMethodtyp; } @@ -6578,6 +6584,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : sensiden(v), detailthr(v), locwavcurveden(v), + locwavcurvehue(v), showmaskblMethodtyp(v), CCmaskblcurve(v), LLmaskblcurve(v), diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index bf248bbab..ea4ebfdce 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -637,6 +637,7 @@ public: bool sensiden; bool detailthr; bool locwavcurveden; + bool locwavcurvehue; bool showmaskblMethodtyp; bool CCmaskblcurve; bool LLmaskblcurve; From a0edd97ca36c7c16cf144270eb3ab8c071b9c49c Mon Sep 17 00:00:00 2001 From: Desmis Date: Sat, 12 Dec 2020 14:46:11 +0100 Subject: [PATCH 010/129] LA denoise local contrast mask --- rtdata/languages/default | 6 ++++ rtengine/improcfun.h | 2 +- rtengine/iplocallab.cc | 60 +++++++++++++++++++++++++++++++++-- rtengine/procevents.h | 3 ++ rtengine/procparams.cc | 12 +++++++ rtengine/procparams.h | 3 ++ rtengine/refreshmap.cc | 6 +++- rtgui/locallabtools.cc | 67 +++++++++++++++++++++++++++++++++++++++- rtgui/locallabtools.h | 15 ++++++++- rtgui/paramsedited.cc | 21 +++++++++++++ rtgui/paramsedited.h | 3 ++ 11 files changed, 191 insertions(+), 7 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index f04ef1f78..5c29e97d9 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1227,6 +1227,9 @@ HISTORY_MSG_979;Local - Log encoding Brightness Q HISTORY_MSG_980;Local - Log encoding Colorfulness M HISTORY_MSG_981;Local - Log encoding Strength HISTORY_MSG_982;Local - Equalizer hue +HISTORY_MSG_983;Local - denoise threshold mask high +HISTORY_MSG_984;Local - denoise threshold mask low +HISTORY_MSG_985;Local - denoise use mask HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance @@ -2546,6 +2549,7 @@ TP_LOCALLAB_DENOICHRODET_TOOLTIP;Allows you to recover chrominance detail by pro TP_LOCALLAB_DENOICHROF_TOOLTIP;Allows you to adjust fine-detail chrominance noise TP_LOCALLAB_DENOIEQUALCHRO_TOOLTIP;Allows you to direct the chroma noise reduction towards either the blue-yellow or red-green colors. TP_LOCALLAB_DENOIEQUAL_TOOLTIP;Allows you to carry out more or less noise reduction in either the shadows or the highlights. +TP_LOCALLAB_DENOI1_EXP;Denoise using local contrast mask TP_LOCALLAB_DENOILUMDETAIL_TOOLTIP;Allows you to recover luminance detail by progressively applying a Fourier transform (DCT). TP_LOCALLAB_DENOIQUA_TOOLTIP;Conservative mode preserves low frequency detail. “Aggressive” mode removes low frequency detail. TP_LOCALLAB_DENOIS;Ψ Denoise @@ -2755,6 +2759,8 @@ TP_LOCALLAB_MASKCOM_TOOLNAME;Common Color Mask - 13 TP_LOCALLAB_MASKCOM_TOOLTIP;A tool in its own right.\nCan be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope. TP_LOCALLAB_MASKCURVE_TOOLTIP;The 3 curves are set to 1 (maximum) by default:\nC=f(C) the chroma varies according to the chrominance. You can decrease the chroma to improve the selection. By setting this curve close to zero (with a low value of C to activate the curve) you can desaturate the background in Inverse mode.\nL=f(L) the luminance varies according to the luminance, so you can decrease the brightness to improve the selection.\nL and C = f(H) luminance and chroma vary with hue, so you can decrease luminance and chroma to improve selection TP_LOCALLAB_MASKH;Hue curve +TP_LOCALLAB_MASKLCTHR;Threshold luminance mask highlights +TP_LOCALLAB_MASKLCTHRLOW;Threshold luminance mask shadows TP_LOCALLAB_MASK_TOOLTIP;You can enable multiple masks for a tool by activating another tool and using only the mask (set the tool sliders to 0 ).\n\nYou can also duplicate the RT-spot and place it close to the first spot. The small variations in the spot references allows you to make fine adjustments. TP_LOCALLAB_MED;Medium TP_LOCALLAB_MEDIAN;Median Low diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index a8d168383..f9ec00469 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -369,7 +369,7 @@ public: void DeNoise_Local(int call, const struct local_params& lp, LabImage* originalmask, int levred, float hueref, float lumaref, float chromaref, LabImage* original, LabImage* transformed, const LabImage &tmp1, int cx, int cy, int sk); void DeNoise_Local2(const struct local_params& lp, LabImage* originalmask, int levred, float hueref, float lumaref, float chromaref, LabImage* original, LabImage* transformed, const LabImage &tmp1, int cx, int cy, int sk); - void DeNoise(int call, float * slidL, float * slida, float * slidb, int aut, bool noiscfactiv, const struct local_params& lp, LabImage* originalmaskbl, int levred, float huerefblur, float lumarefblur, float chromarefblur, LabImage* original, LabImage* transformed, int cx, int cy, int sk, const LocwavCurve& locwavCurvehue, bool locwavhueutili); + void DeNoise(int call, float * slidL, float * slida, float * slidb, int aut, bool noiscfactiv, const struct local_params& lp, LabImage* originalmaskbl, LabImage * bufmaskblurbl, int levred, float huerefblur, float lumarefblur, float chromarefblur, LabImage* original, LabImage* transformed, int cx, int cy, int sk, const LocwavCurve& locwavCurvehue, bool locwavhueutili); void fftw_denoise(int GW, int GH, int max_numblox_W, int min_numblox_W, float **tmp1, array2D *Lin, int numThreads, const struct local_params & lp, int chrom); diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index d4cf7041b..c8129b801 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -657,6 +657,9 @@ struct local_params { float blurma; float contma; bool activspot; + float thrlow; + float thrhigh; + bool usemask; }; @@ -773,6 +776,11 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.ena_Mask = locallab.spots.at(sp).enamask && lllcMask == 0 && llcbMask == 0 && llsoftMask == 0 && llsharMask == 0 && llColorMask == 0 && llExpMask == 0 && llSHMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && lllogMask == 0 && llvibMask == 0; lp.enaLMask = locallab.spots.at(sp).enaLMask && lllogMask == 0 && llColorMask == 0 && lllcMask == 0 && llsharMask == 0 && llExpMask == 0 && llSHMask == 0 && llcbMask == 0 && llretiMask == 0 && lltmMask == 0 && llblMask == 0 && llvibMask == 0 && ll_Mask == 0;// Exposure mask is deactivated if Color & Light mask is visible + + lp.thrlow = locallab.spots.at(sp).levelthrlow; + lp.thrhigh = locallab.spots.at(sp).levelthr; + lp.usemask = locallab.spots.at(sp).usemask; + // printf("llColorMask=%i lllcMask=%i llExpMask=%i llSHMask=%i llcbMask=%i llretiMask=%i lltmMask=%i llblMask=%i llvibMask=%i\n", llColorMask, lllcMask, llExpMask, llSHMask, llcbMask, llretiMask, lltmMask, llblMask, llvibMask); if (locallab.spots.at(sp).softMethod == "soft") { lp.softmet = 0; @@ -8650,7 +8658,7 @@ void ImProcFunctions::fftw_denoise(int GW, int GH, int max_numblox_W, int min_nu } -void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * slidb, int aut, bool noiscfactiv, const struct local_params & lp, LabImage * originalmaskbl, int levred, float huerefblur, float lumarefblur, float chromarefblur, LabImage * original, LabImage * transformed, int cx, int cy, int sk, const LocwavCurve& locwavCurvehue, bool locwavhueutili) +void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * slidb, int aut, bool noiscfactiv, const struct local_params & lp, LabImage * originalmaskbl, LabImage * bufmaskblurbl, int levred, float huerefblur, float lumarefblur, float chromarefblur, LabImage * original, LabImage * transformed, int cx, int cy, int sk, const LocwavCurve& locwavCurvehue, bool locwavhueutili) { //local denoise @@ -8855,6 +8863,29 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } } + if(lp.enablMask && lp.usemask) { + float hig = lp.thrhigh; + if(lp.thrhigh < lp.thrlow) { + hig = lp.thrlow + 0.01f; + } + +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + for (int ir = 0; ir < GH; ir++) + for (int jr = 0; jr < GW; jr++) { + const float lM = bufmaskblurbl->L[ir][jr]; + if (lM < 327.68f * lp.thrlow) { + noisevarlum[(ir >> 1) * GW2 + (jr >> 1)] *= 3.f; + } else if (lM < 327.68f * hig) { + // do nothing + } else { + noisevarlum[(ir >> 1) * GW2 + (jr >> 1)] *= 0.01f; + } + } + } + + if(HHhuecurve) { #ifdef _OPENMP #pragma omp parallel for @@ -9424,6 +9455,29 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl noisevarlum[(ir >> 1)*bfw2 + (jr >> 1)] = nvll[i]; } } + + if(lp.enablMask && lp.usemask) { + float hig = lp.thrhigh; + if(lp.thrhigh < lp.thrlow) { + hig = lp.thrlow + 0.01f; + } + +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + for (int ir = 0; ir < bfh; ir++) + for (int jr = 0; jr < bfw; jr++) { + const float lM = bufmaskblurbl->L[ir + ystart][jr + xstart]; + if (lM < 327.68f * lp.thrlow) { + noisevarlum[(ir >> 1) * bfw2 + (jr >> 1)] *= 3.f; + } else if (lM < 327.68f * hig) { + // do nothing + } else { + noisevarlum[(ir >> 1) * bfw2 + (jr >> 1)] *= 0.01f; + } + } + } + if(HHhuecurve) { #ifdef _OPENMP @@ -11112,11 +11166,11 @@ void ImProcFunctions::Lab_Local( //local denoise if (lp.denoiena) { - float slidL[8] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; + float slidL[8] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; float slida[8] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; float slidb[8] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; constexpr int aut = 0; - DeNoise(call, slidL, slida, slidb, aut, noiscfactiv, lp, originalmaskbl.get(), levred, huerefblur, lumarefblur, chromarefblur, original, transformed, cx, cy, sk, locwavCurvehue, locwavhueutili); + DeNoise(call, slidL, slida, slidb, aut, noiscfactiv, lp, originalmaskbl.get(), bufmaskblurbl.get(), levred, huerefblur, lumarefblur, chromarefblur, original, transformed, cx, cy, sk, locwavCurvehue, locwavhueutili); if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed, multiThread); diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 7464152a3..159ab9835 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -1005,6 +1005,9 @@ enum ProcEventCode { Evlocallabcolorfl = 979, Evlocallabrepar = 980, EvlocallabwavCurvehue = 981, + Evlocallablevelthr = 982, + Evlocallablevelthrlow = 983, + Evlocallabusemask1 = 984, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 8f9567b41..cc80f582e 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3307,6 +3307,9 @@ LocallabParams::LocallabSpot::LocallabSpot() : quamethod("cons"), blurMethod("norm"), medMethod("33"), + usemask(false), + levelthr(40), + levelthrlow(20), activlum(true), noiselumf(0.), noiselumf0(0.), @@ -4346,6 +4349,9 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && chroMethod == other.chroMethod && quamethod == other.quamethod && blurMethod == other.blurMethod + && usemask == other.usemask + && levelthr == other.levelthr + && levelthrlow == other.levelthrlow && medMethod == other.medMethod && activlum == other.activlum && noiselumf == other.noiselumf @@ -5928,6 +5934,9 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->chroMethod, "Locallab", "ChroMethod_" + index_str, spot.chroMethod, keyFile); saveToKeyfile(!pedited || spot_edited->quamethod, "Locallab", "QuaMethod_" + index_str, spot.quamethod, keyFile); saveToKeyfile(!pedited || spot_edited->blurMethod, "Locallab", "BlurMethod_" + index_str, spot.blurMethod, keyFile); + saveToKeyfile(!pedited || spot_edited->usemask, "Locallab", "Usemaskb_" + index_str, spot.usemask, keyFile); + saveToKeyfile(!pedited || spot_edited->levelthr, "Locallab", "Levelthr_" + index_str, spot.levelthr, keyFile); + saveToKeyfile(!pedited || spot_edited->levelthrlow, "Locallab", "Levelthrlow_" + index_str, spot.levelthrlow, keyFile); saveToKeyfile(!pedited || spot_edited->medMethod, "Locallab", "MedMethod_" + index_str, spot.medMethod, keyFile); saveToKeyfile(!pedited || spot_edited->activlum, "Locallab", "activlum_" + index_str, spot.activlum, keyFile); saveToKeyfile(!pedited || spot_edited->noiselumf, "Locallab", "noiselumf_" + index_str, spot.noiselumf, keyFile); @@ -7726,6 +7735,9 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "ChroMethod_" + index_str, pedited, spot.chroMethod, spotEdited.chroMethod); assignFromKeyfile(keyFile, "Locallab", "QuaMethod_" + index_str, pedited, spot.quamethod, spotEdited.quamethod); assignFromKeyfile(keyFile, "Locallab", "BlurMethod_" + index_str, pedited, spot.blurMethod, spotEdited.blurMethod); + assignFromKeyfile(keyFile, "Locallab", "Usemaskb_" + index_str, pedited, spot.usemask, spotEdited.usemask); + assignFromKeyfile(keyFile, "Locallab", "Levelthr_" + index_str, pedited, spot.levelthr, spotEdited.levelthr); + assignFromKeyfile(keyFile, "Locallab", "Levelthrlow_" + index_str, pedited, spot.levelthrlow, spotEdited.levelthrlow); assignFromKeyfile(keyFile, "Locallab", "MedMethod_" + index_str, pedited, spot.medMethod, spotEdited.medMethod); assignFromKeyfile(keyFile, "Locallab", "activlum_" + index_str, pedited, spot.activlum, spotEdited.activlum); assignFromKeyfile(keyFile, "Locallab", "noiselumf_" + index_str, pedited, spot.noiselumf, spotEdited.noiselumf); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 520b12763..79d7ad0f5 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1214,6 +1214,9 @@ struct LocallabParams { Glib::ustring quamethod; // cons agre Glib::ustring blurMethod; // norm, inv Glib::ustring medMethod; // none, 33, 55, 77, 99 + bool usemask; + double levelthr; + double levelthrlow; bool activlum; double noiselumf; double noiselumf0; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 331945848..7cd1c2547 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -1008,7 +1008,11 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallablightq LUMINANCECURVE, // Evlocallabcolorfl LUMINANCECURVE, // Evlocallabrepar - LUMINANCECURVE //EvlocallabwavCurvehue + LUMINANCECURVE, //EvlocallabwavCurvehue + LUMINANCECURVE, // Evlocallablevelthr + LUMINANCECURVE, // Evlocallablevelthrlow + LUMINANCECURVE //Evlocallabusemask1 + }; diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index d06fa1837..e2bd7728d 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -5760,6 +5760,10 @@ LocallabBlur::LocallabBlur(): quamethod(Gtk::manage(new MyComboBoxText())), LocalcurveEditorwavden(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_WAVDEN"))), wavshapeden(static_cast(LocalcurveEditorwavden->addCurve(CT_Flat, "", nullptr, false, false))), + expdenoise1(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI1_EXP")))), + usemask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_USEMASK")))), + levelthr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 0., 100., 1., 40.))), + levelthrlow(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 0., 100., 1., 20.))), noiselumf0(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMFINEZERO"), MINCHRO, MAXCHRO, 0.01, 0.))), noiselumf(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMFINE"), MINCHRO, MAXCHRO, 0.01, 0.))), noiselumf2(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMFINETWO"), MINCHRO, MAXCHRO, 0.01, 0.))), @@ -5821,6 +5825,7 @@ LocallabBlur::LocallabBlur(): blMethodConn = blMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabBlur::blMethodChanged)); fftwblConn = fftwbl->signal_toggled().connect(sigc::mem_fun(*this, &LocallabBlur::fftwblChanged)); + usemaskConn = usemask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabBlur::usemaskChanged)); invblConn = invbl->signal_toggled().connect(sigc::mem_fun(*this, &LocallabBlur::invblChanged)); radius->setAdjusterListener(this); @@ -5883,6 +5888,11 @@ LocallabBlur::LocallabBlur(): wavshapeden->setResetCurve(FlatCurveType(defSpot.locwavcurveden.at(0)), defSpot.locwavcurveden); LocalcurveEditorwavden->curveListComplete(); + setExpandAlignProperties(expdenoise1, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); + + levelthr->setAdjusterListener(this); + + levelthrlow->setAdjusterListener(this); noiselumf0->setAdjusterListener(this); @@ -6032,6 +6042,12 @@ LocallabBlur::LocallabBlur(): wavBox->pack_start(*noiselumdetail); wavBox->pack_start(*noiselequal); wavBox->pack_start(*LocalcurveEditorwavhue, Gtk::PACK_SHRINK, 4); + ToolParamBlock* const wavBox1 = Gtk::manage(new ToolParamBlock()); + wavBox1->pack_start(*usemask, Gtk::PACK_SHRINK, 0); + wavBox1->pack_start(*levelthrlow, Gtk::PACK_SHRINK, 0); + wavBox1->pack_start(*levelthr, Gtk::PACK_SHRINK, 0); + expdenoise1->add(*wavBox1, false); + wavBox->pack_start(*expdenoise1); wavBox->pack_start(*noisechrof); wavBox->pack_start(*noisechroc); wavBox->pack_start(*noisechrodetail); @@ -6209,6 +6225,7 @@ void LocallabBlur::setDefaultExpanderVisibility() { expblnoise->set_expanded(false); expdenoise->set_expanded(false); + expdenoise1->set_expanded(false); expmaskbl->set_expanded(false); } @@ -6218,6 +6235,7 @@ void LocallabBlur::disableListener() blMethodConn.block(true); fftwblConn.block(true); + usemaskConn.block(true); invblConn.block(true); medMethodConn.block(true); blurMethodConn.block(true); @@ -6236,6 +6254,7 @@ void LocallabBlur::enableListener() blMethodConn.block(false); fftwblConn.block(false); + usemaskConn.block(false); invblConn.block(false); medMethodConn.block(false); blurMethodConn.block(false); @@ -6274,6 +6293,7 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params } fftwbl->set_active(spot.fftwbl); + usemask->set_active(spot.usemask); invbl->set_active(spot.invbl); radius->setValue(spot.radius); strength->setValue(spot.strength); @@ -6327,6 +6347,8 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params noiselumf2->setValue(spot.noiselumf2); noiselumc->setValue(spot.noiselumc); noiselumdetail->setValue(spot.noiselumdetail); + levelthr->setValue(spot.levelthr); + levelthrlow->setValue(spot.levelthrlow); noiselequal->setValue((double)spot.noiselequal); noisechrof->setValue(spot.noisechrof); noisechroc->setValue(spot.noisechroc); @@ -6335,7 +6357,7 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params adjblur->setValue((double)spot.adjblur); bilateral->setValue((double)spot.bilateral); sensiden->setValue((double)spot.sensiden); - + if (spot.showmaskblMethodtyp == "blur") { showmaskblMethodtyp ->set_active(0); } else if (spot.showmaskblMethodtyp == "nois") { @@ -6395,6 +6417,7 @@ void LocallabBlur::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped } spot.fftwbl = fftwbl->get_active(); + spot.usemask = usemask->get_active(); spot.invbl = invbl->get_active(); spot.radius = radius->getValue(); spot.strength = strength->getIntValue(); @@ -6448,6 +6471,8 @@ void LocallabBlur::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.noiselumf2 = noiselumf2->getValue(); spot.noiselumc = noiselumc->getValue(); spot.noiselumdetail = noiselumdetail->getValue(); + spot.levelthr = levelthr->getValue(); + spot.levelthrlow = levelthrlow->getValue(); spot.noiselequal = noiselequal->getIntValue(); spot.noisechrof = noisechrof->getValue(); spot.noisechroc = noisechroc->getValue(); @@ -6482,6 +6507,7 @@ void LocallabBlur::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.Lmaskblcurve = Lmaskblshape->getCurve(); spot.LLmaskblcurvewav = LLmaskblshapewav->getCurve(); spot.csthresholdblur = csThresholdblur->getValue(); + } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -6510,6 +6536,8 @@ void LocallabBlur::setDefaults(const rtengine::procparams::ProcParams* defParams noiselumf2->setDefault(defSpot.noiselumf2); noiselumc->setDefault(defSpot.noiselumc); noiselumdetail->setDefault(defSpot.noiselumdetail); + levelthr->setDefault(defSpot.levelthr); + levelthrlow->setDefault(defSpot.levelthrlow); noiselequal->setDefault((double)defSpot.noiselequal); noisechrof->setDefault(defSpot.noisechrof); noisechroc->setDefault(defSpot.noisechroc); @@ -6648,6 +6676,20 @@ void LocallabBlur::adjusterChanged(Adjuster* a, double newval) } } + if (a == levelthr) { + if (listener) { + listener->panelChanged(Evlocallablevelthr, + levelthr->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == levelthrlow) { + if (listener) { + listener->panelChanged(Evlocallablevelthrlow, + levelthrlow->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + if (a == noisechrof) { if (listener) { listener->panelChanged(Evlocallabnoisechrof, @@ -6763,6 +6805,8 @@ void LocallabBlur::adjusterChanged(Adjuster* a, double newval) } } + + void LocallabBlur::adjusterChanged2(ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR) { if (isLocActivated && exp->getEnabled()) { @@ -6891,6 +6935,9 @@ void LocallabBlur::convertParamToSimple() gammaskbl->setValue(defSpot.gammaskbl); slomaskbl->setValue(defSpot.slomaskbl); Lmaskblshape->setCurve(defSpot.Lmasklccurve); + levelthr->setValue(defSpot.levelthr); + levelthrlow->setValue(defSpot.levelthrlow); + usemask->set_active(defSpot.usemask); // Enable all listeners enableListener(); @@ -6903,6 +6950,7 @@ void LocallabBlur::updateGUIToMode(const modeType new_type) // Expert and Normal mode widgets are hidden in Simple mode fftwbl->hide(); expmaskbl->hide(); + expdenoise1->hide(); break; @@ -6918,6 +6966,7 @@ void LocallabBlur::updateGUIToMode(const modeType new_type) csThresholdblur->hide(); // Specific Simple mode widgets are shown in Normal mode expmaskbl->show(); + expdenoise1->show(); break; @@ -6927,6 +6976,7 @@ void LocallabBlur::updateGUIToMode(const modeType new_type) if (blMethod->get_active_row_number() == 0) { // Keep widget hidden when blMethod is > 0 fftwbl->show(); } + expdenoise1->show(); expmaskbl->show(); strumaskbl->show(); @@ -6997,6 +7047,21 @@ void LocallabBlur::fftwblChanged() } } +void LocallabBlur::usemaskChanged() +{ + if (isLocActivated && exp->getEnabled()) { + if (listener) { + if (usemask->get_active()) { + listener->panelChanged(Evlocallabusemask1, + M("GENERAL_ENABLED") + " (" + escapeHtmlChars(spotName) + ")"); + } else { + listener->panelChanged(Evlocallabusemask1, + M("GENERAL_DISABLED") + " (" + escapeHtmlChars(spotName) + ")"); + } + } + } +} + void LocallabBlur::invblChanged() { const LocallabParams::LocallabSpot defSpot; diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index e15cd716c..ad100baae 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -278,6 +278,7 @@ public: void setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override; void adjusterChanged(Adjuster* a, double newval) override; void adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop) override {}; // Not used +// void adjusterChanged3(ThresholdAdjuster* a, double newBottom, double newTop) override {}; void adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight) override {}; // Not used void adjusterChanged(ThresholdAdjuster* a, int newBottom, int newTop) override {}; // Not used void adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight) override {}; // Not used @@ -558,6 +559,7 @@ public: void setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override; void adjusterChanged(Adjuster* a, double newval) override; void adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop) override {}; // Not used +// void adjusterChanged3(ThresholdAdjuster* a, double newBottom, double newTop) override {}; void adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight) override {}; // Not used void adjusterChanged(ThresholdAdjuster* a, int newBottom, int newTop) override; void adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight) override {}; // Not used @@ -633,6 +635,8 @@ class LocallabBlur: public Gtk::VBox, public LocallabTool, public ThresholdAdjusterListener +// public ThresholdCurveProvider + { private: // Blur & Noise specific widgets @@ -659,6 +663,10 @@ private: MyComboBoxText* const quamethod; CurveEditorGroup* const LocalcurveEditorwavden; FlatCurveEditor* const wavshapeden; + MyExpander* const expdenoise1; + Gtk::CheckButton* const usemask; + Adjuster* const levelthr; + Adjuster* const levelthrlow; Adjuster* const noiselumf0; Adjuster* const noiselumf; Adjuster* const noiselumf2; @@ -701,7 +709,7 @@ private: ThresholdAdjuster* const csThresholdblur; sigc::connection blMethodConn, fftwblConn, invblConn, medMethodConn, blurMethodConn, chroMethodConn, activlumConn, showmaskblMethodConn, showmaskblMethodtypConn, enablMaskConn, toolblConn; - sigc::connection quamethodconn; + sigc::connection quamethodconn, usemaskConn; public: LocallabBlur(); ~LocallabBlur(); @@ -720,6 +728,7 @@ public: void setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override; void adjusterChanged(Adjuster* a, double newval) override; void adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop) override {}; // Not used +// void adjusterChanged3(ThresholdAdjuster* a, double newBotto, double newTo) override; void adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight) override {}; // Not used void adjusterChanged(ThresholdAdjuster* a, int newBottom, int newTop) override {}; // Not used void adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight) override {}; // Not used @@ -736,6 +745,7 @@ private: void blMethodChanged(); void fftwblChanged(); + void usemaskChanged(); void invblChanged(); void medMethodChanged(); void blurMethodChanged(); @@ -969,6 +979,7 @@ class LocallabContrast: public Gtk::VBox, public LocallabTool, public ThresholdAdjusterListener + { private: MyComboBoxText* const localcontMethod; @@ -1077,6 +1088,7 @@ public: void setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override; void adjusterChanged(Adjuster* a, double newval) override; void adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop) override {}; // Not used +// void adjusterChanged3(ThresholdAdjuster* a, double newBottom, double newTop) override {}; void adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight) override {}; // Not used void adjusterChanged(ThresholdAdjuster* a, int newBottom, int newTop) override {}; // Not used void adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight) override {}; // Not used @@ -1347,6 +1359,7 @@ public: void setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override; void adjusterChanged(Adjuster* a, double newval) override; void adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop) override {}; // Not used +// void adjusterChanged3(ThresholdAdjuster* a, double newBottom, double newTop) override {}; void adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight) override {}; // Not used void adjusterChanged(ThresholdAdjuster* a, int newBottom, int newTop) override {}; // Not used void adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight) override {}; // Not used diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 628d07214..59a97234b 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1284,6 +1284,9 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).chroMethod = locallab.spots.at(j).chroMethod && pSpot.chroMethod == otherSpot.chroMethod; locallab.spots.at(j).quamethod = locallab.spots.at(j).quamethod && pSpot.quamethod == otherSpot.quamethod; locallab.spots.at(j).blurMethod = locallab.spots.at(j).blurMethod && pSpot.blurMethod == otherSpot.blurMethod; + locallab.spots.at(j).usemask = locallab.spots.at(j).usemask && pSpot.usemask == otherSpot.usemask; + locallab.spots.at(j).levelthr = locallab.spots.at(j).levelthr && pSpot.levelthr == otherSpot.levelthr; + locallab.spots.at(j).levelthrlow = locallab.spots.at(j).levelthrlow && pSpot.levelthrlow == otherSpot.levelthrlow; locallab.spots.at(j).medMethod = locallab.spots.at(j).medMethod && pSpot.medMethod == otherSpot.medMethod; locallab.spots.at(j).activlum = locallab.spots.at(j).activlum && pSpot.activlum == otherSpot.activlum; locallab.spots.at(j).noiselumf = locallab.spots.at(j).noiselumf && pSpot.noiselumf == otherSpot.noiselumf; @@ -4052,6 +4055,18 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).blurMethod = mods.locallab.spots.at(i).blurMethod; } + if (locallab.spots.at(i).usemask) { + toEdit.locallab.spots.at(i).usemask = mods.locallab.spots.at(i).usemask; + } + + if (locallab.spots.at(i).levelthr) { + toEdit.locallab.spots.at(i).levelthr = mods.locallab.spots.at(i).levelthr; + } + + if (locallab.spots.at(i).levelthrlow) { + toEdit.locallab.spots.at(i).levelthrlow = mods.locallab.spots.at(i).levelthrlow; + } + if (locallab.spots.at(i).medMethod) { toEdit.locallab.spots.at(i).medMethod = mods.locallab.spots.at(i).medMethod; } @@ -6567,6 +6582,9 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : blMethod(v), chroMethod(v), quamethod(v), + usemask(v), + levelthr(v), + levelthrlow(v), blurMethod(v), medMethod(v), activlum(v), @@ -7082,6 +7100,9 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) blMethod = v; chroMethod = v; quamethod = v; + usemask = v; + levelthr = v; + levelthrlow = v; blurMethod = v; medMethod = v; activlum = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index ea4ebfdce..e035b2b13 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -620,6 +620,9 @@ public: bool blMethod; bool chroMethod; bool quamethod; + bool usemask; + bool levelthr; + bool levelthrlow; bool blurMethod; bool medMethod; bool activlum; From 001ea48aac5d48d542b9e983895ac8f3352eb2d6 Mon Sep 17 00:00:00 2001 From: Desmis Date: Sat, 12 Dec 2020 17:50:46 +0100 Subject: [PATCH 011/129] Change label and tooltip --- rtdata/languages/default | 5 +++-- rtengine/procparams.cc | 4 ++-- rtgui/locallabtools.cc | 7 ++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 5c29e97d9..c4ae579b4 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2759,8 +2759,9 @@ TP_LOCALLAB_MASKCOM_TOOLNAME;Common Color Mask - 13 TP_LOCALLAB_MASKCOM_TOOLTIP;A tool in its own right.\nCan be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope. TP_LOCALLAB_MASKCURVE_TOOLTIP;The 3 curves are set to 1 (maximum) by default:\nC=f(C) the chroma varies according to the chrominance. You can decrease the chroma to improve the selection. By setting this curve close to zero (with a low value of C to activate the curve) you can desaturate the background in Inverse mode.\nL=f(L) the luminance varies according to the luminance, so you can decrease the brightness to improve the selection.\nL and C = f(H) luminance and chroma vary with hue, so you can decrease luminance and chroma to improve selection TP_LOCALLAB_MASKH;Hue curve -TP_LOCALLAB_MASKLCTHR;Threshold luminance mask highlights -TP_LOCALLAB_MASKLCTHRLOW;Threshold luminance mask shadows +TP_LOCALLAB_MASKLC_TOOLTIP;Allows you to modulate the denoise according to the mask;\n if the mask is very dark - below the threshold 'dark' - denoise will be increased.\n if the mask is clear - above the threshold 'light' - denoise will be almost cancelled.\n between the two, denoise will be maintained at the settings without mask. +TP_LOCALLAB_MASKLCTHR;Threshold luminance mask "light" +TP_LOCALLAB_MASKLCTHRLOW;Threshold luminance mask "dark" TP_LOCALLAB_MASK_TOOLTIP;You can enable multiple masks for a tool by activating another tool and using only the mask (set the tool sliders to 0 ).\n\nYou can also duplicate the RT-spot and place it close to the first spot. The small variations in the spot references allows you to make fine adjustments. TP_LOCALLAB_MED;Medium TP_LOCALLAB_MEDIAN;Median Low diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index cc80f582e..567dff805 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3308,8 +3308,8 @@ LocallabParams::LocallabSpot::LocallabSpot() : blurMethod("norm"), medMethod("33"), usemask(false), - levelthr(40), - levelthrlow(20), + levelthr(50.), + levelthrlow(25.), activlum(true), noiselumf(0.), noiselumf0(0.), diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index e2bd7728d..c55ecf817 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -5762,8 +5762,8 @@ LocallabBlur::LocallabBlur(): wavshapeden(static_cast(LocalcurveEditorwavden->addCurve(CT_Flat, "", nullptr, false, false))), expdenoise1(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI1_EXP")))), usemask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_USEMASK")))), - levelthr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 0., 100., 1., 40.))), - levelthrlow(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 0., 100., 1., 20.))), + levelthr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 0., 100., 1., 50.))), + levelthrlow(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 0., 100., 1., 25.))), noiselumf0(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMFINEZERO"), MINCHRO, MAXCHRO, 0.01, 0.))), noiselumf(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMFINE"), MINCHRO, MAXCHRO, 0.01, 0.))), noiselumf2(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMFINETWO"), MINCHRO, MAXCHRO, 0.01, 0.))), @@ -6165,7 +6165,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) lapmaskbl->set_tooltip_text(M("TP_LOCALLAB_LAPRAD1_TOOLTIP")); csThresholdblur->set_tooltip_text(M("TP_LOCALLAB_WAVEMASK_LEVEL_TOOLTIP")); sensiden->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP")); - + expdenoise1->set_tooltip_markup(M("TP_LOCALLAB_MASKLC_TOOLTIP")); } else { expblnoise->set_tooltip_markup(""); @@ -6217,6 +6217,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) csThresholdblur->set_tooltip_text(""); // wavhue->setTooltip(""); sensiden->set_tooltip_text(""); + expdenoise1->set_tooltip_markup(""); } } From fd47681fd4413121a466dda7609f51f6b57216be Mon Sep 17 00:00:00 2001 From: Desmis Date: Sun, 13 Dec 2020 08:09:47 +0100 Subject: [PATCH 012/129] Added auto checkbox temperature viewing conditions when preset cat is selected --- rtgui/colorappearance.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rtgui/colorappearance.cc b/rtgui/colorappearance.cc index cbcf14b60..2c64f15e4 100644 --- a/rtgui/colorappearance.cc +++ b/rtgui/colorappearance.cc @@ -1593,6 +1593,8 @@ void ColorAppearance::presetcat02pressed () degreeout->setValue(90); ybout->setValue(18); tempout->setValue (nexttemp); + tempout->setAutoValue (true); + greenout->setValue (nextgreen); enableListener(); } else { From 0f2720774c2cef0e189604e8adb9046d46c58af7 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sun, 13 Dec 2020 17:24:10 +0100 Subject: [PATCH 013/129] RAF images from X-S10 appear massively cropped, fixes #6013 --- rtengine/camconst.json | 2 +- rtengine/dcraw.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rtengine/camconst.json b/rtengine/camconst.json index 22270bfe2..0a34b4436 100644 --- a/rtengine/camconst.json +++ b/rtengine/camconst.json @@ -1433,7 +1433,7 @@ Camera constants: }, { // Quality B - "make_model": [ "FUJIFILM X-T30", "FUJIFILM X100V", "FUJIFILM X-T4" ], + "make_model": [ "FUJIFILM X-T30", "FUJIFILM X100V", "FUJIFILM X-T4", "FUJIFILM X-S10" ], "dcraw_matrix": [ 13426,-6334,-1177,-4244,12136,2371,-580,1303,5980 ], // DNG_v11, standard_v2 d65 "raw_crop": [ 0, 5, 6252, 4176] }, diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index fd9f9211b..300f107aa 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -10045,7 +10045,7 @@ canon_a5: } else if (!strncmp(model, "X-A3", 4) || !strncmp(model, "X-A5", 4)) { width = raw_width = 6016; height = raw_height = 4014; - } else if (!strcmp(model, "X-Pro3") || !strcmp(model, "X-T3") || !strcmp(model, "X-T30") || !strcmp(model, "X-T4") || !strcmp(model, "X100V")) { + } else if (!strcmp(model, "X-Pro3") || !strcmp(model, "X-T3") || !strcmp(model, "X-T30") || !strcmp(model, "X-T4") || !strcmp(model, "X100V") || !strcmp(model, "X-S10")) { width = raw_width = 6384; height = raw_height = 4182; } From dba106580042d36991f37c0bf2f0a5dde0764cb3 Mon Sep 17 00:00:00 2001 From: Desmis Date: Mon, 14 Dec 2020 08:04:37 +0100 Subject: [PATCH 014/129] Added ref to curve denoise equalizer hue --- rtgui/locallabtools.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index d06fa1837..8a400d8fe 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -6950,7 +6950,7 @@ void LocallabBlur::updateMaskBackground(const double normChromar, const double n LLmaskblshape->updateLocallabBackground(normLumar); HHmaskblshape->updateLocallabBackground(normHuer); Lmaskblshape->updateLocallabBackground(normLumar); - + wavhue->updateLocallabBackground(normHuer); return false; } ); From f310836890e56ea95c96f2566bca9563dc73c2b4 Mon Sep 17 00:00:00 2001 From: Desmis Date: Mon, 14 Dec 2020 09:19:27 +0100 Subject: [PATCH 015/129] Improve reinforce denoise local contrast using mask --- rtdata/languages/default | 8 +++++--- rtengine/iplocallab.cc | 26 ++++++++++++++++++++------ rtengine/procevents.h | 1 + rtengine/procparams.cc | 4 ++++ rtengine/procparams.h | 1 + rtengine/refreshmap.cc | 3 ++- rtgui/locallabtools.cc | 16 +++++++++++++++- rtgui/locallabtools.h | 1 + rtgui/paramsedited.cc | 7 +++++++ rtgui/paramsedited.h | 1 + 10 files changed, 57 insertions(+), 11 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index c4ae579b4..8be55df83 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1230,6 +1230,7 @@ HISTORY_MSG_982;Local - Equalizer hue HISTORY_MSG_983;Local - denoise threshold mask high HISTORY_MSG_984;Local - denoise threshold mask low HISTORY_MSG_985;Local - denoise use mask +HISTORY_MSG_986;Local - denoise reinforce HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance @@ -2759,9 +2760,10 @@ TP_LOCALLAB_MASKCOM_TOOLNAME;Common Color Mask - 13 TP_LOCALLAB_MASKCOM_TOOLTIP;A tool in its own right.\nCan be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope. TP_LOCALLAB_MASKCURVE_TOOLTIP;The 3 curves are set to 1 (maximum) by default:\nC=f(C) the chroma varies according to the chrominance. You can decrease the chroma to improve the selection. By setting this curve close to zero (with a low value of C to activate the curve) you can desaturate the background in Inverse mode.\nL=f(L) the luminance varies according to the luminance, so you can decrease the brightness to improve the selection.\nL and C = f(H) luminance and chroma vary with hue, so you can decrease luminance and chroma to improve selection TP_LOCALLAB_MASKH;Hue curve -TP_LOCALLAB_MASKLC_TOOLTIP;Allows you to modulate the denoise according to the mask;\n if the mask is very dark - below the threshold 'dark' - denoise will be increased.\n if the mask is clear - above the threshold 'light' - denoise will be almost cancelled.\n between the two, denoise will be maintained at the settings without mask. -TP_LOCALLAB_MASKLCTHR;Threshold luminance mask "light" -TP_LOCALLAB_MASKLCTHRLOW;Threshold luminance mask "dark" +TP_LOCALLAB_MASKLC_TOOLTIP;Allows you to modulate the denoise according to the mask, generated by the module "Mask and Modifications (Blur and Denoise);\n if the mask is very dark - below the threshold 'dark' - denoise will be increased.\n if the mask is clear - above the threshold 'light' - denoise will be almost cancelled.\n between the two, denoise will be maintained at the settings without mask. +TP_LOCALLAB_MASKLCTHR;Threshold luminance "light area mask" +TP_LOCALLAB_MASKLCTHRLOW;Threshold luminance "dark area mask" +TP_LOCALLAB_MASKLNOISELOW;Reinforce denoise in dark area "mask" TP_LOCALLAB_MASK_TOOLTIP;You can enable multiple masks for a tool by activating another tool and using only the mask (set the tool sliders to 0 ).\n\nYou can also duplicate the RT-spot and place it close to the first spot. The small variations in the spot references allows you to make fine adjustments. TP_LOCALLAB_MED;Medium TP_LOCALLAB_MEDIAN;Median Low diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index c8129b801..38e068a07 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -660,6 +660,7 @@ struct local_params { float thrlow; float thrhigh; bool usemask; + float lnoiselow; }; @@ -780,6 +781,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.thrlow = locallab.spots.at(sp).levelthrlow; lp.thrhigh = locallab.spots.at(sp).levelthr; lp.usemask = locallab.spots.at(sp).usemask; + lp.lnoiselow = locallab.spots.at(sp).lnoiselow; // printf("llColorMask=%i lllcMask=%i llExpMask=%i llSHMask=%i llcbMask=%i llretiMask=%i lltmMask=%i llblMask=%i llvibMask=%i\n", llColorMask, lllcMask, llExpMask, llSHMask, llcbMask, llretiMask, lltmMask, llblMask, llvibMask); if (locallab.spots.at(sp).softMethod == "soft") { @@ -8868,19 +8870,24 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if(lp.thrhigh < lp.thrlow) { hig = lp.thrlow + 0.01f; } - + float alow = -lp.lnoiselow / lp.thrlow; + float blow = lp.lnoiselow; + float ahigh = 0.9999f / (hig - 100.f); + float bhigh = 1.f - hig * ahigh; #ifdef _OPENMP #pragma omp parallel for if (multiThread) #endif for (int ir = 0; ir < GH; ir++) for (int jr = 0; jr < GW; jr++) { const float lM = bufmaskblurbl->L[ir][jr]; + const float lmr = lM / 327.68f; + if (lM < 327.68f * lp.thrlow) { - noisevarlum[(ir >> 1) * GW2 + (jr >> 1)] *= 3.f; + noisevarlum[(ir >> 1) * GW2 + (jr >> 1)] *= alow * lmr + blow; //3.f;//increase denoise } else if (lM < 327.68f * hig) { - // do nothing + // do nothing - denoise not change } else { - noisevarlum[(ir >> 1) * GW2 + (jr >> 1)] *= 0.01f; + noisevarlum[(ir >> 1) * GW2 + (jr >> 1)] *= ahigh * lmr + bhigh; //0.01f;//quasi suppress denoise } } } @@ -9462,18 +9469,25 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl hig = lp.thrlow + 0.01f; } + float alow = -lp.lnoiselow / lp.thrlow; + float blow = lp.lnoiselow; + float ahigh = 0.9999f / (hig - 100.f); + float bhigh = 1.f - hig * ahigh; + + #ifdef _OPENMP #pragma omp parallel for if (multiThread) #endif for (int ir = 0; ir < bfh; ir++) for (int jr = 0; jr < bfw; jr++) { const float lM = bufmaskblurbl->L[ir + ystart][jr + xstart]; + const float lmr = lM / 327.68f; if (lM < 327.68f * lp.thrlow) { - noisevarlum[(ir >> 1) * bfw2 + (jr >> 1)] *= 3.f; + noisevarlum[(ir >> 1) * bfw2 + (jr >> 1)] *= alow * lmr + blow; } else if (lM < 327.68f * hig) { // do nothing } else { - noisevarlum[(ir >> 1) * bfw2 + (jr >> 1)] *= 0.01f; + noisevarlum[(ir >> 1) * bfw2 + (jr >> 1)] *= ahigh * lmr + bhigh; } } } diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 159ab9835..ce98e3fd5 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -1008,6 +1008,7 @@ enum ProcEventCode { Evlocallablevelthr = 982, Evlocallablevelthrlow = 983, Evlocallabusemask1 = 984, + Evlocallablnoiselow = 985, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 567dff805..8b08f6c1b 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3309,6 +3309,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : medMethod("33"), usemask(false), levelthr(50.), + lnoiselow(3.), levelthrlow(25.), activlum(true), noiselumf(0.), @@ -4351,6 +4352,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && blurMethod == other.blurMethod && usemask == other.usemask && levelthr == other.levelthr + && lnoiselow == other.lnoiselow && levelthrlow == other.levelthrlow && medMethod == other.medMethod && activlum == other.activlum @@ -5936,6 +5938,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->blurMethod, "Locallab", "BlurMethod_" + index_str, spot.blurMethod, keyFile); saveToKeyfile(!pedited || spot_edited->usemask, "Locallab", "Usemaskb_" + index_str, spot.usemask, keyFile); saveToKeyfile(!pedited || spot_edited->levelthr, "Locallab", "Levelthr_" + index_str, spot.levelthr, keyFile); + saveToKeyfile(!pedited || spot_edited->lnoiselow, "Locallab", "Lnoiselow_" + index_str, spot.lnoiselow, keyFile); saveToKeyfile(!pedited || spot_edited->levelthrlow, "Locallab", "Levelthrlow_" + index_str, spot.levelthrlow, keyFile); saveToKeyfile(!pedited || spot_edited->medMethod, "Locallab", "MedMethod_" + index_str, spot.medMethod, keyFile); saveToKeyfile(!pedited || spot_edited->activlum, "Locallab", "activlum_" + index_str, spot.activlum, keyFile); @@ -7737,6 +7740,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "BlurMethod_" + index_str, pedited, spot.blurMethod, spotEdited.blurMethod); assignFromKeyfile(keyFile, "Locallab", "Usemaskb_" + index_str, pedited, spot.usemask, spotEdited.usemask); assignFromKeyfile(keyFile, "Locallab", "Levelthr_" + index_str, pedited, spot.levelthr, spotEdited.levelthr); + assignFromKeyfile(keyFile, "Locallab", "Lnoiselow_" + index_str, pedited, spot.lnoiselow, spotEdited.lnoiselow); assignFromKeyfile(keyFile, "Locallab", "Levelthrlow_" + index_str, pedited, spot.levelthrlow, spotEdited.levelthrlow); assignFromKeyfile(keyFile, "Locallab", "MedMethod_" + index_str, pedited, spot.medMethod, spotEdited.medMethod); assignFromKeyfile(keyFile, "Locallab", "activlum_" + index_str, pedited, spot.activlum, spotEdited.activlum); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 79d7ad0f5..b5e241f51 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1216,6 +1216,7 @@ struct LocallabParams { Glib::ustring medMethod; // none, 33, 55, 77, 99 bool usemask; double levelthr; + double lnoiselow; double levelthrlow; bool activlum; double noiselumf; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 7cd1c2547..129afdca9 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -1011,7 +1011,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, //EvlocallabwavCurvehue LUMINANCECURVE, // Evlocallablevelthr LUMINANCECURVE, // Evlocallablevelthrlow - LUMINANCECURVE //Evlocallabusemask1 + LUMINANCECURVE, //Evlocallabusemask1 + LUMINANCECURVE // Evlocallablnoiselow }; diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index c55ecf817..2c8a25606 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -5762,7 +5762,8 @@ LocallabBlur::LocallabBlur(): wavshapeden(static_cast(LocalcurveEditorwavden->addCurve(CT_Flat, "", nullptr, false, false))), expdenoise1(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI1_EXP")))), usemask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_USEMASK")))), - levelthr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 0., 100., 1., 50.))), + lnoiselow(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLNOISELOW"), 0.5, 10., 0.1, 3.))), + levelthr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 1., 100., 1., 50.))), levelthrlow(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 0., 100., 1., 25.))), noiselumf0(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMFINEZERO"), MINCHRO, MAXCHRO, 0.01, 0.))), noiselumf(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMFINE"), MINCHRO, MAXCHRO, 0.01, 0.))), @@ -5891,6 +5892,7 @@ LocallabBlur::LocallabBlur(): setExpandAlignProperties(expdenoise1, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); levelthr->setAdjusterListener(this); + lnoiselow->setAdjusterListener(this); levelthrlow->setAdjusterListener(this); @@ -6044,6 +6046,7 @@ LocallabBlur::LocallabBlur(): wavBox->pack_start(*LocalcurveEditorwavhue, Gtk::PACK_SHRINK, 4); ToolParamBlock* const wavBox1 = Gtk::manage(new ToolParamBlock()); wavBox1->pack_start(*usemask, Gtk::PACK_SHRINK, 0); + wavBox1->pack_start(*lnoiselow, Gtk::PACK_SHRINK, 0); wavBox1->pack_start(*levelthrlow, Gtk::PACK_SHRINK, 0); wavBox1->pack_start(*levelthr, Gtk::PACK_SHRINK, 0); expdenoise1->add(*wavBox1, false); @@ -6349,6 +6352,7 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params noiselumc->setValue(spot.noiselumc); noiselumdetail->setValue(spot.noiselumdetail); levelthr->setValue(spot.levelthr); + lnoiselow->setValue(spot.lnoiselow); levelthrlow->setValue(spot.levelthrlow); noiselequal->setValue((double)spot.noiselequal); noisechrof->setValue(spot.noisechrof); @@ -6473,6 +6477,7 @@ void LocallabBlur::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.noiselumc = noiselumc->getValue(); spot.noiselumdetail = noiselumdetail->getValue(); spot.levelthr = levelthr->getValue(); + spot.lnoiselow = lnoiselow->getValue(); spot.levelthrlow = levelthrlow->getValue(); spot.noiselequal = noiselequal->getIntValue(); spot.noisechrof = noisechrof->getValue(); @@ -6538,6 +6543,7 @@ void LocallabBlur::setDefaults(const rtengine::procparams::ProcParams* defParams noiselumc->setDefault(defSpot.noiselumc); noiselumdetail->setDefault(defSpot.noiselumdetail); levelthr->setDefault(defSpot.levelthr); + lnoiselow->setDefault(defSpot.lnoiselow); levelthrlow->setDefault(defSpot.levelthrlow); noiselequal->setDefault((double)defSpot.noiselequal); noisechrof->setDefault(defSpot.noisechrof); @@ -6684,6 +6690,13 @@ void LocallabBlur::adjusterChanged(Adjuster* a, double newval) } } + if (a == lnoiselow) { + if (listener) { + listener->panelChanged(Evlocallablnoiselow, + lnoiselow->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + if (a == levelthrlow) { if (listener) { listener->panelChanged(Evlocallablevelthrlow, @@ -6937,6 +6950,7 @@ void LocallabBlur::convertParamToSimple() slomaskbl->setValue(defSpot.slomaskbl); Lmaskblshape->setCurve(defSpot.Lmasklccurve); levelthr->setValue(defSpot.levelthr); + lnoiselow->setValue(defSpot.lnoiselow); levelthrlow->setValue(defSpot.levelthrlow); usemask->set_active(defSpot.usemask); diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index ad100baae..b711eae9e 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -665,6 +665,7 @@ private: FlatCurveEditor* const wavshapeden; MyExpander* const expdenoise1; Gtk::CheckButton* const usemask; + Adjuster* const lnoiselow; Adjuster* const levelthr; Adjuster* const levelthrlow; Adjuster* const noiselumf0; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 59a97234b..6cd2c93e5 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1286,6 +1286,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).blurMethod = locallab.spots.at(j).blurMethod && pSpot.blurMethod == otherSpot.blurMethod; locallab.spots.at(j).usemask = locallab.spots.at(j).usemask && pSpot.usemask == otherSpot.usemask; locallab.spots.at(j).levelthr = locallab.spots.at(j).levelthr && pSpot.levelthr == otherSpot.levelthr; + locallab.spots.at(j).lnoiselow = locallab.spots.at(j).lnoiselow && pSpot.lnoiselow == otherSpot.lnoiselow; locallab.spots.at(j).levelthrlow = locallab.spots.at(j).levelthrlow && pSpot.levelthrlow == otherSpot.levelthrlow; locallab.spots.at(j).medMethod = locallab.spots.at(j).medMethod && pSpot.medMethod == otherSpot.medMethod; locallab.spots.at(j).activlum = locallab.spots.at(j).activlum && pSpot.activlum == otherSpot.activlum; @@ -4063,6 +4064,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).levelthr = mods.locallab.spots.at(i).levelthr; } + if (locallab.spots.at(i).lnoiselow) { + toEdit.locallab.spots.at(i).lnoiselow = mods.locallab.spots.at(i).lnoiselow; + } + if (locallab.spots.at(i).levelthrlow) { toEdit.locallab.spots.at(i).levelthrlow = mods.locallab.spots.at(i).levelthrlow; } @@ -6584,6 +6589,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : quamethod(v), usemask(v), levelthr(v), + lnoiselow(v), levelthrlow(v), blurMethod(v), medMethod(v), @@ -7102,6 +7108,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) quamethod = v; usemask = v; levelthr = v; + lnoiselow = v; levelthrlow = v; blurMethod = v; medMethod = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index e035b2b13..41406e3ea 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -622,6 +622,7 @@ public: bool quamethod; bool usemask; bool levelthr; + bool lnoiselow; bool levelthrlow; bool blurMethod; bool medMethod; From 755d70c4023b843cb028fe2d1d6acf48004eebb9 Mon Sep 17 00:00:00 2001 From: Desmis Date: Mon, 14 Dec 2020 13:00:06 +0100 Subject: [PATCH 016/129] Change label tooltip denoise luminance mask --- rtdata/languages/default | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 8be55df83..d025eab36 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2550,7 +2550,7 @@ TP_LOCALLAB_DENOICHRODET_TOOLTIP;Allows you to recover chrominance detail by pro TP_LOCALLAB_DENOICHROF_TOOLTIP;Allows you to adjust fine-detail chrominance noise TP_LOCALLAB_DENOIEQUALCHRO_TOOLTIP;Allows you to direct the chroma noise reduction towards either the blue-yellow or red-green colors. TP_LOCALLAB_DENOIEQUAL_TOOLTIP;Allows you to carry out more or less noise reduction in either the shadows or the highlights. -TP_LOCALLAB_DENOI1_EXP;Denoise using local contrast mask +TP_LOCALLAB_DENOI1_EXP;Denoise based on luminance mask TP_LOCALLAB_DENOILUMDETAIL_TOOLTIP;Allows you to recover luminance detail by progressively applying a Fourier transform (DCT). TP_LOCALLAB_DENOIQUA_TOOLTIP;Conservative mode preserves low frequency detail. “Aggressive” mode removes low frequency detail. TP_LOCALLAB_DENOIS;Ψ Denoise @@ -2760,10 +2760,10 @@ TP_LOCALLAB_MASKCOM_TOOLNAME;Common Color Mask - 13 TP_LOCALLAB_MASKCOM_TOOLTIP;A tool in its own right.\nCan be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope. TP_LOCALLAB_MASKCURVE_TOOLTIP;The 3 curves are set to 1 (maximum) by default:\nC=f(C) the chroma varies according to the chrominance. You can decrease the chroma to improve the selection. By setting this curve close to zero (with a low value of C to activate the curve) you can desaturate the background in Inverse mode.\nL=f(L) the luminance varies according to the luminance, so you can decrease the brightness to improve the selection.\nL and C = f(H) luminance and chroma vary with hue, so you can decrease luminance and chroma to improve selection TP_LOCALLAB_MASKH;Hue curve -TP_LOCALLAB_MASKLC_TOOLTIP;Allows you to modulate the denoise according to the mask, generated by the module "Mask and Modifications (Blur and Denoise);\n if the mask is very dark - below the threshold 'dark' - denoise will be increased.\n if the mask is clear - above the threshold 'light' - denoise will be almost cancelled.\n between the two, denoise will be maintained at the settings without mask. -TP_LOCALLAB_MASKLCTHR;Threshold luminance "light area mask" -TP_LOCALLAB_MASKLCTHRLOW;Threshold luminance "dark area mask" -TP_LOCALLAB_MASKLNOISELOW;Reinforce denoise in dark area "mask" +TP_LOCALLAB_MASKLC_TOOLTIP;This allows you to target the denoise based on the image luminance information contained in the L(L) or LC(H) mask (Mask and Modifications). The L(L) mask or the LC(H) mask must be enabled to use this function. \n if the mask is very dark - below the threshold 'dark' - denoise will be increased.\n if the mask is clear - above the threshold 'light' - denoise will be progressively cancelled.\n between the two, denoise will be maintained at the settings without mask. +TP_LOCALLAB_MASKLCTHR;Light area luminance threshold +TP_LOCALLAB_MASKLCTHRLOW; Dark area luminance threshold +TP_LOCALLAB_MASKLNOISELOW;Reinforce denoise in dark areas TP_LOCALLAB_MASK_TOOLTIP;You can enable multiple masks for a tool by activating another tool and using only the mask (set the tool sliders to 0 ).\n\nYou can also duplicate the RT-spot and place it close to the first spot. The small variations in the spot references allows you to make fine adjustments. TP_LOCALLAB_MED;Medium TP_LOCALLAB_MEDIAN;Median Low From 1f5e072dee8c6185ce0693c86a518ed4ba8f3334 Mon Sep 17 00:00:00 2001 From: Desmis Date: Mon, 14 Dec 2020 17:18:13 +0100 Subject: [PATCH 017/129] Several changes to default values - labels - tooltip --- rtdata/languages/default | 17 ++++++++++------- rtengine/procparams.cc | 6 +++--- rtgui/locallabtools.cc | 10 +++++----- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index d025eab36..f307b1412 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2517,7 +2517,7 @@ TP_LOCALLAB_CONTFRA;Contrast by level TP_LOCALLAB_CONTL;Contrast (J) TP_LOCALLAB_CONTRAST;Contrast TP_LOCALLAB_CONTRASTCURVMASK1_TOOLTIP;Allows you to freely modify the contrast of the mask (gamma & slope), instead of using a continuous & progressive curve. However it can create artifacts that have to be dealt with using the “Smooth radius” or “Laplacian threshold sliders”. -TP_LOCALLAB_CONTRASTCURVMASK_TOOLTIP;Allows you to freely change the contrast of the mask. May create artifacts. +TP_LOCALLAB_CONTRASTCURVMASK_TOOLTIP;Allows you to freely change the contrast of the mask.\n Has a similar function to the Gamma and Slope sliders. It allows you to target certain parts of the image (usually the lightest parts of the mask by using the curve to exclude the darker parts).May create artifacts. TP_LOCALLAB_CONTRESID;Contrast TP_LOCALLAB_CONTTHMASK_TOOLTIP;Allows you to determine which parts of the image will be impacted based on the texture. TP_LOCALLAB_CONTTHR;Contrast Threshold @@ -2698,8 +2698,10 @@ TP_LOCALLAB_LIGHTRETI;Lightness TP_LOCALLAB_LINEAR;Linearity TP_LOCALLAB_LIST_NAME;Add tool to current spot... TP_LOCALLAB_LIST_TOOLTIP;You can select 3 levels of complexity for each tool: Basic, Standard & Advanced.\nThe default setting for all tools is Basic but this can be changed in the Preferences window.\nYou can also change the level of complexity on a per-tool basis while you are editing -TP_LOCALLAB_LMASK_LEVEL_TOOLTIP;Give priority to action on midtones and high lights and by choosing the concerned wavelet levels -TP_LOCALLAB_LMASK_LL_TOOLTIP;Allows you to freely change the contrast of the mask. May create artifacts. +//TP_LOCALLAB_LMASK_LEVEL_TOOLTIP;Give priority to action on midtones and high lights and by choosing the concerned wavelet levels +TP_LOCALLAB_LMASK_LEVEL_TOOLTIP;Allows you to decrease or increase the effect on particular levels of detail in the mask by targeting certain luminance zones (in general the lightest). +//TP_LOCALLAB_LMASK_LL_TOOLTIP;Allows you to freely change the contrast of the mask. May create artifacts. +TP_LOCALLAB_LMASK_LL_TOOLTIP;Allows you to freely change the contrast of the mask.\n Has a similar function to the Gamma and Slope sliders. It allows you to target certain parts of the image (usually the lightest parts of the mask by using the curve to exclude the darker parts).May create artifacts. TP_LOCALLAB_LOCCONT;Unsharp Mask TP_LOCALLAB_LOC_CONTRAST;Local Contrast & Wavelets TP_LOCALLAB_LOC_CONTRASTPYR;Ψ Pyramid 1: @@ -2752,7 +2754,7 @@ TP_LOCALLAB_LUMFRA;L*a*b* standard TP_LOCALLAB_LUMONLY;Luminance only TP_LOCALLAB_MASFRAME;Mask and Merge TP_LOCALLAB_MASFRAME_TOOLTIP;For all masks.\nTakes into account the deltaE image to avoid modifying the selection area when the following Mask Tools are used: Gamma , Slope , Chroma, Contrast curve , Local contrast (by wavelet level), Blur Mask and Structure Mask (if enabled ) .\nDisabled when Inverse mode is used -TP_LOCALLAB_MASK;Mask +TP_LOCALLAB_MASK;Contrast TP_LOCALLAB_MASK2;Contrast curve TP_LOCALLAB_MASKCOL;Mask Curves TP_LOCALLAB_MASKCOM;Common Color Mask @@ -2761,8 +2763,8 @@ TP_LOCALLAB_MASKCOM_TOOLTIP;A tool in its own right.\nCan be used to adjust the TP_LOCALLAB_MASKCURVE_TOOLTIP;The 3 curves are set to 1 (maximum) by default:\nC=f(C) the chroma varies according to the chrominance. You can decrease the chroma to improve the selection. By setting this curve close to zero (with a low value of C to activate the curve) you can desaturate the background in Inverse mode.\nL=f(L) the luminance varies according to the luminance, so you can decrease the brightness to improve the selection.\nL and C = f(H) luminance and chroma vary with hue, so you can decrease luminance and chroma to improve selection TP_LOCALLAB_MASKH;Hue curve TP_LOCALLAB_MASKLC_TOOLTIP;This allows you to target the denoise based on the image luminance information contained in the L(L) or LC(H) mask (Mask and Modifications). The L(L) mask or the LC(H) mask must be enabled to use this function. \n if the mask is very dark - below the threshold 'dark' - denoise will be increased.\n if the mask is clear - above the threshold 'light' - denoise will be progressively cancelled.\n between the two, denoise will be maintained at the settings without mask. -TP_LOCALLAB_MASKLCTHR;Light area luminance threshold -TP_LOCALLAB_MASKLCTHRLOW; Dark area luminance threshold +TP_LOCALLAB_MASKLCTHR;Light area luminance % threshold +TP_LOCALLAB_MASKLCTHRLOW; Dark area luminance % threshold TP_LOCALLAB_MASKLNOISELOW;Reinforce denoise in dark areas TP_LOCALLAB_MASK_TOOLTIP;You can enable multiple masks for a tool by activating another tool and using only the mask (set the tool sliders to 0 ).\n\nYou can also duplicate the RT-spot and place it close to the first spot. The small variations in the spot references allows you to make fine adjustments. TP_LOCALLAB_MED;Medium @@ -3072,6 +3074,7 @@ TP_LOCALLAB_WAVEEDG_TOOLTIP;Improves sharpness by targeting the action of local TP_LOCALLAB_WAVEMASK_LEVEL_TOOLTIP;Range of wavelet levels used in “Local contrast (by wavelet level)” TP_LOCALLAB_WAVGRAD_TOOLTIP;Allows the local contrast to be varied according to a chosen gradient and angle. The variation of the luminance signal is taken into account and not the luminance. TP_LOCALLAB_WAVHIGH;Ψ Wavelet high +TP_LOCALLAB_WAVHUE_TOOLTIP;Allows you to reduce or increase the denoise based on hue. TP_LOCALLAB_WAVLEV;Blur by level TP_LOCALLAB_WAVLOW;Ψ Wavelet low TP_LOCALLAB_WAVMASK;Ψ Local contrast (by wavelet level) @@ -3502,7 +3505,7 @@ TP_WAVELET_DENMIX_TOOLTIP;Balances the action of the guide taking into account t TP_WAVELET_DENOISE;Guide curve based on Local contrast TP_WAVELET_DENOISEGUID;Guided threshold based on hue TP_WAVELET_DENOISEH;High levels Curve Local contrast -TP_WAVELET_DENOISEHUE;Denoise equalizer Hue +TP_WAVELET_DENOISEHUE;Denoise hue equalizer TP_WAVELET_DENQUA;Mode TP_WAVELET_DENSIGMA_TOOLTIP;Adapts the shape of the guide TP_WAVELET_DENSLI;Slider diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 8b08f6c1b..604589e92 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3308,9 +3308,9 @@ LocallabParams::LocallabSpot::LocallabSpot() : blurMethod("norm"), medMethod("33"), usemask(false), - levelthr(50.), - lnoiselow(3.), - levelthrlow(25.), + levelthr(40.), + lnoiselow(1.5), + levelthrlow(12.), activlum(true), noiselumf(0.), noiselumf0(0.), diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 4f1adfd7d..027cb335c 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -5762,9 +5762,9 @@ LocallabBlur::LocallabBlur(): wavshapeden(static_cast(LocalcurveEditorwavden->addCurve(CT_Flat, "", nullptr, false, false))), expdenoise1(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI1_EXP")))), usemask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_USEMASK")))), - lnoiselow(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLNOISELOW"), 0.5, 10., 0.1, 3.))), - levelthr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 1., 100., 1., 50.))), - levelthrlow(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 0., 100., 1., 25.))), + lnoiselow(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLNOISELOW"), 0.5, 4., 0.1, 1.5))), + levelthr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 1., 100., 1., 40.))), + levelthrlow(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 0., 100., 1., 12.))), noiselumf0(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMFINEZERO"), MINCHRO, MAXCHRO, 0.01, 0.))), noiselumf(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMFINE"), MINCHRO, MAXCHRO, 0.01, 0.))), noiselumf2(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMFINETWO"), MINCHRO, MAXCHRO, 0.01, 0.))), @@ -6135,7 +6135,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) expdenoise->set_tooltip_markup(M("TP_LOCALLAB_DENOI_TOOLTIP")); quamethod->set_tooltip_markup(M("TP_LOCALLAB_DENOIQUA_TOOLTIP")); wavshapeden->setTooltip(M("TP_LOCALLAB_WASDEN_TOOLTIP")); -// wavhue->setTooltip(M("TP_LOCALLAB_WAVHUE_TOOLTIP")); + wavhue->setTooltip(M("TP_LOCALLAB_WAVHUE_TOOLTIP")); LocalcurveEditorwavden->setTooltip(M("TP_LOCALLAB_WASDEN_TOOLTIP")); noiselequal->set_tooltip_text(M("TP_LOCALLAB_DENOIEQUAL_TOOLTIP")); noiselumdetail->set_tooltip_text(M("TP_LOCALLAB_DENOILUMDETAIL_TOOLTIP")); @@ -6218,7 +6218,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) shadmaskbl->set_tooltip_text(""); shadmaskblsha->set_tooltip_text(""); csThresholdblur->set_tooltip_text(""); -// wavhue->setTooltip(""); + wavhue->setTooltip(""); sensiden->set_tooltip_text(""); expdenoise1->set_tooltip_markup(""); From 8c927a5bba5c9601cc69a2f950f0a3107e0acef7 Mon Sep 17 00:00:00 2001 From: Desmis Date: Tue, 15 Dec 2020 08:14:47 +0100 Subject: [PATCH 018/129] Change progressivity reinforce - comment code --- rtdata/languages/default | 2 +- rtengine/iplocallab.cc | 14 ++++++++++---- rtengine/procparams.cc | 2 +- rtgui/locallabtools.cc | 8 ++++---- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index f307b1412..aafc33bd5 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2762,7 +2762,7 @@ TP_LOCALLAB_MASKCOM_TOOLNAME;Common Color Mask - 13 TP_LOCALLAB_MASKCOM_TOOLTIP;A tool in its own right.\nCan be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope. TP_LOCALLAB_MASKCURVE_TOOLTIP;The 3 curves are set to 1 (maximum) by default:\nC=f(C) the chroma varies according to the chrominance. You can decrease the chroma to improve the selection. By setting this curve close to zero (with a low value of C to activate the curve) you can desaturate the background in Inverse mode.\nL=f(L) the luminance varies according to the luminance, so you can decrease the brightness to improve the selection.\nL and C = f(H) luminance and chroma vary with hue, so you can decrease luminance and chroma to improve selection TP_LOCALLAB_MASKH;Hue curve -TP_LOCALLAB_MASKLC_TOOLTIP;This allows you to target the denoise based on the image luminance information contained in the L(L) or LC(H) mask (Mask and Modifications). The L(L) mask or the LC(H) mask must be enabled to use this function. \n if the mask is very dark - below the threshold 'dark' - denoise will be increased.\n if the mask is clear - above the threshold 'light' - denoise will be progressively cancelled.\n between the two, denoise will be maintained at the settings without mask. +TP_LOCALLAB_MASKLC_TOOLTIP;This allows you to target the denoise based on the image luminance information contained in the L(L) or LC(H) mask (Mask and Modifications). The L(L) mask or the LC(H) mask must be enabled to use this function. \n if the mask is very dark - below the threshold 'dark' - denoise will be increased if reinforce > 1.\n if the mask is clear - above the threshold 'light' - denoise will be progressively cancelled.\n between the two, denoise will be maintained at the settings without mask. TP_LOCALLAB_MASKLCTHR;Light area luminance % threshold TP_LOCALLAB_MASKLCTHRLOW; Dark area luminance % threshold TP_LOCALLAB_MASKLNOISELOW;Reinforce denoise in dark areas diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 38e068a07..2fde19c61 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -8865,12 +8865,13 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } } - if(lp.enablMask && lp.usemask) { + if(lp.enablMask && lp.lnoiselow !=1.f) { + //this code has been reviewed by Ingo in september 2020 PR5903 float hig = lp.thrhigh; if(lp.thrhigh < lp.thrlow) { hig = lp.thrlow + 0.01f; } - float alow = -lp.lnoiselow / lp.thrlow; + float alow = -(lp.lnoiselow - 1.f) / lp.thrlow; float blow = lp.lnoiselow; float ahigh = 0.9999f / (hig - 100.f); float bhigh = 1.f - hig * ahigh; @@ -8894,6 +8895,8 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if(HHhuecurve) { + //same code as in wavelet levels + #ifdef _OPENMP #pragma omp parallel for #endif @@ -9463,13 +9466,15 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } } - if(lp.enablMask && lp.usemask) { + if(lp.enablMask && lp.lnoiselow != 1.f) { + //this code has been reviewed by Ingo in september 2020 PR5903 + //i just change parameters to better progressivity float hig = lp.thrhigh; if(lp.thrhigh < lp.thrlow) { hig = lp.thrlow + 0.01f; } - float alow = -lp.lnoiselow / lp.thrlow; + float alow = -(lp.lnoiselow - 1.f) / lp.thrlow; float blow = lp.lnoiselow; float ahigh = 0.9999f / (hig - 100.f); float bhigh = 1.f - hig * ahigh; @@ -9494,6 +9499,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if(HHhuecurve) { + //same code as in wavelet levels #ifdef _OPENMP #pragma omp parallel for #endif diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 604589e92..8f08c74bb 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3309,7 +3309,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : medMethod("33"), usemask(false), levelthr(40.), - lnoiselow(1.5), + lnoiselow(1.), levelthrlow(12.), activlum(true), noiselumf(0.), diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 027cb335c..bc5bc0323 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -5762,9 +5762,9 @@ LocallabBlur::LocallabBlur(): wavshapeden(static_cast(LocalcurveEditorwavden->addCurve(CT_Flat, "", nullptr, false, false))), expdenoise1(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI1_EXP")))), usemask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_USEMASK")))), - lnoiselow(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLNOISELOW"), 0.5, 4., 0.1, 1.5))), - levelthr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 1., 100., 1., 40.))), - levelthrlow(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 0., 100., 1., 12.))), + lnoiselow(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLNOISELOW"), 0.7, 2., 0.01, 1.))), + levelthr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 10., 100., 1., 40.))), + levelthrlow(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 100., 1., 12.))), noiselumf0(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMFINEZERO"), MINCHRO, MAXCHRO, 0.01, 0.))), noiselumf(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMFINE"), MINCHRO, MAXCHRO, 0.01, 0.))), noiselumf2(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMFINETWO"), MINCHRO, MAXCHRO, 0.01, 0.))), @@ -6045,7 +6045,7 @@ LocallabBlur::LocallabBlur(): wavBox->pack_start(*noiselequal); wavBox->pack_start(*LocalcurveEditorwavhue, Gtk::PACK_SHRINK, 4); ToolParamBlock* const wavBox1 = Gtk::manage(new ToolParamBlock()); - wavBox1->pack_start(*usemask, Gtk::PACK_SHRINK, 0); + // wavBox1->pack_start(*usemask, Gtk::PACK_SHRINK, 0); wavBox1->pack_start(*lnoiselow, Gtk::PACK_SHRINK, 0); wavBox1->pack_start(*levelthrlow, Gtk::PACK_SHRINK, 0); wavBox1->pack_start(*levelthr, Gtk::PACK_SHRINK, 0); From daf0e0ea14f260b1f333e13be41ba9a632a85315 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Tue, 15 Dec 2020 12:44:20 +0100 Subject: [PATCH 019/129] Fix bad macro usage --- rtengine/rcd_demosaic.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rtengine/rcd_demosaic.cc b/rtengine/rcd_demosaic.cc index ff477281b..c7cf1e68a 100644 --- a/rtengine/rcd_demosaic.cc +++ b/rtengine/rcd_demosaic.cc @@ -196,7 +196,8 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) #else const vfloat VH_Disc = vabsf(zd5v - VH_Central_Value) < vabsf(zd5v - VH_Neighbourhood_Value) ? VH_Neighbourhood_Value : VH_Central_Value; #endif - STC2VFU(rgb[1][indx], vintpf(VH_Disc, H_Est, V_Est)); + const vfloat result = vintpf(VH_Disc, H_Est, V_Est); + STC2VFU(rgb[1][indx], result); } #endif for (; col < tilecols - 4; col += 2, indx += 2) { From e3af94e4998383855fc24b31d1a745dca3156a29 Mon Sep 17 00:00:00 2001 From: Desmis Date: Tue, 15 Dec 2020 22:19:13 +0100 Subject: [PATCH 020/129] Clean code and tooltip --- rtdata/languages/default | 18 ++++++++---------- rtengine/iplocallab.cc | 4 ++-- rtengine/procevents.h | 4 ++-- rtengine/procparams.cc | 8 ++++---- rtengine/procparams.h | 2 +- rtengine/refreshmap.cc | 2 +- rtgui/locallabtools.cc | 24 ++++++++++++------------ rtgui/locallabtools.h | 2 +- rtgui/paramsedited.cc | 12 ++++++------ rtgui/paramsedited.h | 2 +- 10 files changed, 38 insertions(+), 40 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index aafc33bd5..c77438f8f 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2516,8 +2516,8 @@ TP_LOCALLAB_CONTCOL;Contrast threshold TP_LOCALLAB_CONTFRA;Contrast by level TP_LOCALLAB_CONTL;Contrast (J) TP_LOCALLAB_CONTRAST;Contrast -TP_LOCALLAB_CONTRASTCURVMASK1_TOOLTIP;Allows you to freely modify the contrast of the mask (gamma & slope), instead of using a continuous & progressive curve. However it can create artifacts that have to be dealt with using the “Smooth radius” or “Laplacian threshold sliders”. -TP_LOCALLAB_CONTRASTCURVMASK_TOOLTIP;Allows you to freely change the contrast of the mask.\n Has a similar function to the Gamma and Slope sliders. It allows you to target certain parts of the image (usually the lightest parts of the mask by using the curve to exclude the darker parts).May create artifacts. +TP_LOCALLAB_CONTRASTCURVMASK1_TOOLTIP;Allows you to freely modify the contrast of the mask (gamma and slope), instead of using a continuous and progressive curve. However it can create artifacts that have to be dealt with using the “Smooth radius” or “Laplacian threshold sliders”. +TP_LOCALLAB_CONTRASTCURVMASK_TOOLTIP;Allows you to freely change the contrast of the mask.\n Has a similar function to the Gamma and Slope sliders.\n It allows you to target certain parts of the image (usually the lightest parts of the mask by using the curve to exclude the darker parts).May create artifacts. TP_LOCALLAB_CONTRESID;Contrast TP_LOCALLAB_CONTTHMASK_TOOLTIP;Allows you to determine which parts of the image will be impacted based on the texture. TP_LOCALLAB_CONTTHR;Contrast Threshold @@ -2697,11 +2697,9 @@ TP_LOCALLAB_LIGHTN_TOOLTIP;In inverse mode: selection = -100 forces luminance to TP_LOCALLAB_LIGHTRETI;Lightness TP_LOCALLAB_LINEAR;Linearity TP_LOCALLAB_LIST_NAME;Add tool to current spot... -TP_LOCALLAB_LIST_TOOLTIP;You can select 3 levels of complexity for each tool: Basic, Standard & Advanced.\nThe default setting for all tools is Basic but this can be changed in the Preferences window.\nYou can also change the level of complexity on a per-tool basis while you are editing -//TP_LOCALLAB_LMASK_LEVEL_TOOLTIP;Give priority to action on midtones and high lights and by choosing the concerned wavelet levels +TP_LOCALLAB_LIST_TOOLTIP;You can select 3 levels of complexity for each tool: Basic, Standard and Advanced.\nThe default setting for all tools is Basic but this can be changed in the Preferences window.\nYou can also change the level of complexity on a per-tool basis while you are editing TP_LOCALLAB_LMASK_LEVEL_TOOLTIP;Allows you to decrease or increase the effect on particular levels of detail in the mask by targeting certain luminance zones (in general the lightest). -//TP_LOCALLAB_LMASK_LL_TOOLTIP;Allows you to freely change the contrast of the mask. May create artifacts. -TP_LOCALLAB_LMASK_LL_TOOLTIP;Allows you to freely change the contrast of the mask.\n Has a similar function to the Gamma and Slope sliders. It allows you to target certain parts of the image (usually the lightest parts of the mask by using the curve to exclude the darker parts).May create artifacts. +TP_LOCALLAB_LMASK_LL_TOOLTIP;Allows you to freely change the contrast of the mask.\n Has a similar function to the Gamma and Slope sliders.\n It allows you to target certain parts of the image (usually the lightest parts of the mask by using the curve to exclude the darker parts). May create artifacts. TP_LOCALLAB_LOCCONT;Unsharp Mask TP_LOCALLAB_LOC_CONTRAST;Local Contrast & Wavelets TP_LOCALLAB_LOC_CONTRASTPYR;Ψ Pyramid 1: @@ -2762,7 +2760,7 @@ TP_LOCALLAB_MASKCOM_TOOLNAME;Common Color Mask - 13 TP_LOCALLAB_MASKCOM_TOOLTIP;A tool in its own right.\nCan be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope. TP_LOCALLAB_MASKCURVE_TOOLTIP;The 3 curves are set to 1 (maximum) by default:\nC=f(C) the chroma varies according to the chrominance. You can decrease the chroma to improve the selection. By setting this curve close to zero (with a low value of C to activate the curve) you can desaturate the background in Inverse mode.\nL=f(L) the luminance varies according to the luminance, so you can decrease the brightness to improve the selection.\nL and C = f(H) luminance and chroma vary with hue, so you can decrease luminance and chroma to improve selection TP_LOCALLAB_MASKH;Hue curve -TP_LOCALLAB_MASKLC_TOOLTIP;This allows you to target the denoise based on the image luminance information contained in the L(L) or LC(H) mask (Mask and Modifications). The L(L) mask or the LC(H) mask must be enabled to use this function. \n if the mask is very dark - below the threshold 'dark' - denoise will be increased if reinforce > 1.\n if the mask is clear - above the threshold 'light' - denoise will be progressively cancelled.\n between the two, denoise will be maintained at the settings without mask. +TP_LOCALLAB_MASKLC_TOOLTIP;This allows you to target the denoise based on the image luminance information contained in the L(L) or LC(H) mask (Mask and Modifications.\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n if the mask is very dark - below the threshold 'dark' - denoise will be increased if reinforce > 1.\n if the mask is clear - above the threshold 'light' - denoise will be progressively cancelled.\n between the two, denoise will be maintained at the settings without mask. TP_LOCALLAB_MASKLCTHR;Light area luminance % threshold TP_LOCALLAB_MASKLCTHRLOW; Dark area luminance % threshold TP_LOCALLAB_MASKLNOISELOW;Reinforce denoise in dark areas @@ -2899,7 +2897,7 @@ TP_LOCALLAB_SCOPEMASK_TOOLTIP;Enabled if DeltaE Image Mask is enabled.\nLow valu TP_LOCALLAB_SENSI;Scope TP_LOCALLAB_SENSIEXCLU;Scope TP_LOCALLAB_SENSIEXCLU_TOOLTIP;Adjust the colors to be excluded -TP_LOCALLAB_SENSIMASK_TOOLTIP;Scope adjustment specific to common mask tool.\nActs on the difference between the original image and the mask.\nUses the luma, chroma & hue references from the center of the RT-spot\n\nYou can also adjust the deltaE of the mask itself by using 'Scope (deltaE image mask)' in 'Settings' > ‘Mask & Merge’ +TP_LOCALLAB_SENSIMASK_TOOLTIP;Scope adjustment specific to common mask tool.\nActs on the difference between the original image and the mask.\nUses the luma, chroma and hue references from the center of the RT-spot\n\nYou can also adjust the deltaE of the mask itself by using 'Scope (deltaE image mask)' in 'Settings' > ‘Mask and Merge’ TP_LOCALLAB_SENSI_TOOLTIP;Adjusts the scope of the action:\nSmall values limit the action to colors similar to those in the center of the spot.\nHigh values let the tool act on a wider range of colors TP_LOCALLAB_SETTINGS;Settings TP_LOCALLAB_SH1;Shadows Highlights @@ -2909,7 +2907,7 @@ TP_LOCALLAB_SHADEXCOMP;Shadow compression & tonal width TP_LOCALLAB_SHADHIGH;Shadows/Highlights & Tone equalizer TP_LOCALLAB_SHADHMASK_TOOLTIP;Lowers the highlights of the mask in the same way as the shadows/highlights algorithm TP_LOCALLAB_SHADMASK_TOOLTIP;Lifts the shadows of the mask in the same way as the shadows/highlights algorithm -TP_LOCALLAB_SHADOWHIGHLIGHT_TOOLTIP;Adjust shadows & highlights either with shadows & highlights sliders or with a tone equalizer.\nCan be used instead of, or in conjunction with the Exposure module.\nCan also be used as a graduated filter. +TP_LOCALLAB_SHADOWHIGHLIGHT_TOOLTIP;Adjust shadows and highlights either with shadows & highlights sliders or with a tone equalizer.\nCan be used instead of, or in conjunction with the Exposure module.\nCan also be used as a graduated filter. TP_LOCALLAB_SHAMASKCOL;Shadows TP_LOCALLAB_SHAPETYPE;RT-spot shape TP_LOCALLAB_SHAPE_TOOLTIP;”Ellipse” is the normal mode.\n “Rectangle” can be used in certain cases, for example to work in full-image mode by placing the delimiters outside the preview area. In this case, set transition = 100.\n\nFuture developments will include polygon shapes and Bezier curves. @@ -3024,7 +3022,7 @@ TP_LOCALLAB_TRANSIT_TOOLTIP;Adjust smoothness of transition between affected and TP_LOCALLAB_TRANSMISSIONGAIN;Transmission gain TP_LOCALLAB_TRANSMISSIONMAP;Transmission map TP_LOCALLAB_TRANSMISSION_TOOLTIP;Transmission according to transmission.\nAbscissa: transmission from negative values (min), mean, and positive values (max).\nOrdinate: amplification or reduction.\nYou can adjust this curve to change the Transmission and reduce artifacts -TP_LOCALLAB_USEMASK;Use mask +//TP_LOCALLAB_USEMASK;Use mask TP_LOCALLAB_VART;Variance (contrast) TP_LOCALLAB_VIBRANCE;Vibrance & Warm/Cool TP_LOCALLAB_VIBRA_TOOLTIP;Adjusts vibrance (essentially the same as the global adjustment).\nCarries out the equivalent of a white-balance adjustment using a CIECAM algorithm. diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 2fde19c61..e256fda80 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -659,7 +659,7 @@ struct local_params { bool activspot; float thrlow; float thrhigh; - bool usemask; + // bool usemask; float lnoiselow; }; @@ -780,7 +780,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.thrlow = locallab.spots.at(sp).levelthrlow; lp.thrhigh = locallab.spots.at(sp).levelthr; - lp.usemask = locallab.spots.at(sp).usemask; + // lp.usemask = locallab.spots.at(sp).usemask; lp.lnoiselow = locallab.spots.at(sp).lnoiselow; // printf("llColorMask=%i lllcMask=%i llExpMask=%i llSHMask=%i llcbMask=%i llretiMask=%i lltmMask=%i llblMask=%i llvibMask=%i\n", llColorMask, lllcMask, llExpMask, llSHMask, llcbMask, llretiMask, lltmMask, llblMask, llvibMask); diff --git a/rtengine/procevents.h b/rtengine/procevents.h index ce98e3fd5..7da7d1d98 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -1007,8 +1007,8 @@ enum ProcEventCode { EvlocallabwavCurvehue = 981, Evlocallablevelthr = 982, Evlocallablevelthrlow = 983, - Evlocallabusemask1 = 984, - Evlocallablnoiselow = 985, + // Evlocallabusemask1 = 984, + Evlocallablnoiselow = 984, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 8f08c74bb..cdf48cef0 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3307,7 +3307,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : quamethod("cons"), blurMethod("norm"), medMethod("33"), - usemask(false), + // usemask(false), levelthr(40.), lnoiselow(1.), levelthrlow(12.), @@ -4350,7 +4350,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && chroMethod == other.chroMethod && quamethod == other.quamethod && blurMethod == other.blurMethod - && usemask == other.usemask + // && usemask == other.usemask && levelthr == other.levelthr && lnoiselow == other.lnoiselow && levelthrlow == other.levelthrlow @@ -5936,7 +5936,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->chroMethod, "Locallab", "ChroMethod_" + index_str, spot.chroMethod, keyFile); saveToKeyfile(!pedited || spot_edited->quamethod, "Locallab", "QuaMethod_" + index_str, spot.quamethod, keyFile); saveToKeyfile(!pedited || spot_edited->blurMethod, "Locallab", "BlurMethod_" + index_str, spot.blurMethod, keyFile); - saveToKeyfile(!pedited || spot_edited->usemask, "Locallab", "Usemaskb_" + index_str, spot.usemask, keyFile); + // saveToKeyfile(!pedited || spot_edited->usemask, "Locallab", "Usemaskb_" + index_str, spot.usemask, keyFile); saveToKeyfile(!pedited || spot_edited->levelthr, "Locallab", "Levelthr_" + index_str, spot.levelthr, keyFile); saveToKeyfile(!pedited || spot_edited->lnoiselow, "Locallab", "Lnoiselow_" + index_str, spot.lnoiselow, keyFile); saveToKeyfile(!pedited || spot_edited->levelthrlow, "Locallab", "Levelthrlow_" + index_str, spot.levelthrlow, keyFile); @@ -7738,7 +7738,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "ChroMethod_" + index_str, pedited, spot.chroMethod, spotEdited.chroMethod); assignFromKeyfile(keyFile, "Locallab", "QuaMethod_" + index_str, pedited, spot.quamethod, spotEdited.quamethod); assignFromKeyfile(keyFile, "Locallab", "BlurMethod_" + index_str, pedited, spot.blurMethod, spotEdited.blurMethod); - assignFromKeyfile(keyFile, "Locallab", "Usemaskb_" + index_str, pedited, spot.usemask, spotEdited.usemask); + // assignFromKeyfile(keyFile, "Locallab", "Usemaskb_" + index_str, pedited, spot.usemask, spotEdited.usemask); assignFromKeyfile(keyFile, "Locallab", "Levelthr_" + index_str, pedited, spot.levelthr, spotEdited.levelthr); assignFromKeyfile(keyFile, "Locallab", "Lnoiselow_" + index_str, pedited, spot.lnoiselow, spotEdited.lnoiselow); assignFromKeyfile(keyFile, "Locallab", "Levelthrlow_" + index_str, pedited, spot.levelthrlow, spotEdited.levelthrlow); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index b5e241f51..295099098 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1214,7 +1214,7 @@ struct LocallabParams { Glib::ustring quamethod; // cons agre Glib::ustring blurMethod; // norm, inv Glib::ustring medMethod; // none, 33, 55, 77, 99 - bool usemask; + // bool usemask; double levelthr; double lnoiselow; double levelthrlow; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 129afdca9..923763770 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -1011,7 +1011,7 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, //EvlocallabwavCurvehue LUMINANCECURVE, // Evlocallablevelthr LUMINANCECURVE, // Evlocallablevelthrlow - LUMINANCECURVE, //Evlocallabusemask1 + // LUMINANCECURVE, //Evlocallabusemask1 LUMINANCECURVE // Evlocallablnoiselow }; diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index bc5bc0323..1bf32a84b 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -5761,7 +5761,7 @@ LocallabBlur::LocallabBlur(): LocalcurveEditorwavden(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_WAVDEN"))), wavshapeden(static_cast(LocalcurveEditorwavden->addCurve(CT_Flat, "", nullptr, false, false))), expdenoise1(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI1_EXP")))), - usemask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_USEMASK")))), + // usemask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_USEMASK")))), lnoiselow(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLNOISELOW"), 0.7, 2., 0.01, 1.))), levelthr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 10., 100., 1., 40.))), levelthrlow(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 100., 1., 12.))), @@ -5826,7 +5826,7 @@ LocallabBlur::LocallabBlur(): blMethodConn = blMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabBlur::blMethodChanged)); fftwblConn = fftwbl->signal_toggled().connect(sigc::mem_fun(*this, &LocallabBlur::fftwblChanged)); - usemaskConn = usemask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabBlur::usemaskChanged)); + // usemaskConn = usemask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabBlur::usemaskChanged)); invblConn = invbl->signal_toggled().connect(sigc::mem_fun(*this, &LocallabBlur::invblChanged)); radius->setAdjusterListener(this); @@ -6136,6 +6136,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) quamethod->set_tooltip_markup(M("TP_LOCALLAB_DENOIQUA_TOOLTIP")); wavshapeden->setTooltip(M("TP_LOCALLAB_WASDEN_TOOLTIP")); wavhue->setTooltip(M("TP_LOCALLAB_WAVHUE_TOOLTIP")); + expdenoise1->set_tooltip_markup(M("TP_LOCALLAB_MASKLC_TOOLTIP")); LocalcurveEditorwavden->setTooltip(M("TP_LOCALLAB_WASDEN_TOOLTIP")); noiselequal->set_tooltip_text(M("TP_LOCALLAB_DENOIEQUAL_TOOLTIP")); noiselumdetail->set_tooltip_text(M("TP_LOCALLAB_DENOILUMDETAIL_TOOLTIP")); @@ -6168,7 +6169,6 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) lapmaskbl->set_tooltip_text(M("TP_LOCALLAB_LAPRAD1_TOOLTIP")); csThresholdblur->set_tooltip_text(M("TP_LOCALLAB_WAVEMASK_LEVEL_TOOLTIP")); sensiden->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP")); - expdenoise1->set_tooltip_markup(M("TP_LOCALLAB_MASKLC_TOOLTIP")); } else { expblnoise->set_tooltip_markup(""); @@ -6184,6 +6184,8 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) epsbl->set_tooltip_text(""); blurMethod->set_tooltip_markup(""); quamethod->set_tooltip_markup(""); + wavhue->setTooltip(""); + expdenoise1->set_tooltip_markup(""); LocalcurveEditorwavden->setTooltip(""); noiselequal->set_tooltip_text(""); noiselumdetail->set_tooltip_text(""); @@ -6218,9 +6220,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) shadmaskbl->set_tooltip_text(""); shadmaskblsha->set_tooltip_text(""); csThresholdblur->set_tooltip_text(""); - wavhue->setTooltip(""); sensiden->set_tooltip_text(""); - expdenoise1->set_tooltip_markup(""); } } @@ -6239,7 +6239,7 @@ void LocallabBlur::disableListener() blMethodConn.block(true); fftwblConn.block(true); - usemaskConn.block(true); + // usemaskConn.block(true); invblConn.block(true); medMethodConn.block(true); blurMethodConn.block(true); @@ -6258,7 +6258,7 @@ void LocallabBlur::enableListener() blMethodConn.block(false); fftwblConn.block(false); - usemaskConn.block(false); + // usemaskConn.block(false); invblConn.block(false); medMethodConn.block(false); blurMethodConn.block(false); @@ -6297,7 +6297,7 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params } fftwbl->set_active(spot.fftwbl); - usemask->set_active(spot.usemask); + // usemask->set_active(spot.usemask); invbl->set_active(spot.invbl); radius->setValue(spot.radius); strength->setValue(spot.strength); @@ -6422,7 +6422,7 @@ void LocallabBlur::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped } spot.fftwbl = fftwbl->get_active(); - spot.usemask = usemask->get_active(); + // spot.usemask = usemask->get_active(); spot.invbl = invbl->get_active(); spot.radius = radius->getValue(); spot.strength = strength->getIntValue(); @@ -6952,7 +6952,7 @@ void LocallabBlur::convertParamToSimple() levelthr->setValue(defSpot.levelthr); lnoiselow->setValue(defSpot.lnoiselow); levelthrlow->setValue(defSpot.levelthrlow); - usemask->set_active(defSpot.usemask); + // usemask->set_active(defSpot.usemask); // Enable all listeners enableListener(); @@ -7061,7 +7061,7 @@ void LocallabBlur::fftwblChanged() } } } - +/* void LocallabBlur::usemaskChanged() { if (isLocActivated && exp->getEnabled()) { @@ -7076,7 +7076,7 @@ void LocallabBlur::usemaskChanged() } } } - +*/ void LocallabBlur::invblChanged() { const LocallabParams::LocallabSpot defSpot; diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index b711eae9e..7b8409524 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -664,7 +664,7 @@ private: CurveEditorGroup* const LocalcurveEditorwavden; FlatCurveEditor* const wavshapeden; MyExpander* const expdenoise1; - Gtk::CheckButton* const usemask; +// Gtk::CheckButton* const usemask; Adjuster* const lnoiselow; Adjuster* const levelthr; Adjuster* const levelthrlow; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 6cd2c93e5..6c3716a91 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1284,7 +1284,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).chroMethod = locallab.spots.at(j).chroMethod && pSpot.chroMethod == otherSpot.chroMethod; locallab.spots.at(j).quamethod = locallab.spots.at(j).quamethod && pSpot.quamethod == otherSpot.quamethod; locallab.spots.at(j).blurMethod = locallab.spots.at(j).blurMethod && pSpot.blurMethod == otherSpot.blurMethod; - locallab.spots.at(j).usemask = locallab.spots.at(j).usemask && pSpot.usemask == otherSpot.usemask; + // locallab.spots.at(j).usemask = locallab.spots.at(j).usemask && pSpot.usemask == otherSpot.usemask; locallab.spots.at(j).levelthr = locallab.spots.at(j).levelthr && pSpot.levelthr == otherSpot.levelthr; locallab.spots.at(j).lnoiselow = locallab.spots.at(j).lnoiselow && pSpot.lnoiselow == otherSpot.lnoiselow; locallab.spots.at(j).levelthrlow = locallab.spots.at(j).levelthrlow && pSpot.levelthrlow == otherSpot.levelthrlow; @@ -4056,9 +4056,9 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).blurMethod = mods.locallab.spots.at(i).blurMethod; } - if (locallab.spots.at(i).usemask) { - toEdit.locallab.spots.at(i).usemask = mods.locallab.spots.at(i).usemask; - } + // if (locallab.spots.at(i).usemask) { + // toEdit.locallab.spots.at(i).usemask = mods.locallab.spots.at(i).usemask; + // } if (locallab.spots.at(i).levelthr) { toEdit.locallab.spots.at(i).levelthr = mods.locallab.spots.at(i).levelthr; @@ -6587,7 +6587,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : blMethod(v), chroMethod(v), quamethod(v), - usemask(v), + // usemask(v), levelthr(v), lnoiselow(v), levelthrlow(v), @@ -7106,7 +7106,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) blMethod = v; chroMethod = v; quamethod = v; - usemask = v; +// usemask = v; levelthr = v; lnoiselow = v; levelthrlow = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 41406e3ea..897c8b16b 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -620,7 +620,7 @@ public: bool blMethod; bool chroMethod; bool quamethod; - bool usemask; + // bool usemask; bool levelthr; bool lnoiselow; bool levelthrlow; From 10cc600277d82c3b2aa32d432847bafbd7e189d6 Mon Sep 17 00:00:00 2001 From: Desmis Date: Wed, 16 Dec 2020 07:54:47 +0100 Subject: [PATCH 021/129] Improvment selection GUI mask denoise --- rtengine/iplocallab.cc | 4 ++-- rtengine/procparams.cc | 2 +- rtgui/locallabtools.cc | 26 ++++++++++++++++++++++++-- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index e256fda80..203efacad 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -8865,7 +8865,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } } - if(lp.enablMask && lp.lnoiselow !=1.f) { + if(lp.enablMask && lp.lnoiselow !=1.f && lp.smasktyp != 0) { //this code has been reviewed by Ingo in september 2020 PR5903 float hig = lp.thrhigh; if(lp.thrhigh < lp.thrlow) { @@ -9466,7 +9466,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } } - if(lp.enablMask && lp.lnoiselow != 1.f) { + if(lp.enablMask && lp.lnoiselow != 1.f && lp.smasktyp != 0) { //this code has been reviewed by Ingo in september 2020 PR5903 //i just change parameters to better progressivity float hig = lp.thrhigh; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index cdf48cef0..52478bfd3 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3367,7 +3367,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : 0.35, 0.35 }, - showmaskblMethodtyp("blur"), + showmaskblMethodtyp("nois"), CCmaskblcurve{ static_cast(FCT_MinMaxCPoints), 0.0, diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 1bf32a84b..cb4fc3312 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -5949,7 +5949,7 @@ LocallabBlur::LocallabBlur(): showmaskblMethodtyp->append(M("TP_LOCALLAB_SHOWMASKTYP1")); showmaskblMethodtyp->append(M("TP_LOCALLAB_SHOWMASKTYP2")); showmaskblMethodtyp->append(M("TP_LOCALLAB_SHOWMASKTYP3")); - showmaskblMethodtyp->set_active(0); + showmaskblMethodtyp->set_active(1); showmaskblMethodtypConn = showmaskblMethodtyp->signal_changed().connect(sigc::mem_fun(*this, &LocallabBlur::showmaskblMethodtypChanged)); enablMaskConn = enablMask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabBlur::enablMaskChanged)); @@ -6691,6 +6691,11 @@ void LocallabBlur::adjusterChanged(Adjuster* a, double newval) } if (a == lnoiselow) { + if(lnoiselow->getValue()!= 1.) { + if (showmaskblMethodtyp->get_active_row_number() == 0) { + showmaskblMethodtyp->set_active(2); + } + } if (listener) { listener->panelChanged(Evlocallablnoiselow, lnoiselow->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); @@ -6938,7 +6943,7 @@ void LocallabBlur::convertParamToSimple() } else if (defSpot.showmaskblMethodtyp == "all") { showmaskblMethodtyp->set_active(2); } - + lnoiselow->setValue(defSpot.lnoiselow); enablMask->set_active(defSpot.enablMask); CCmaskblshape->setCurve(defSpot.CCmaskblcurve); LLmaskblshape->setCurve(defSpot.LLmaskblcurve); @@ -6982,6 +6987,11 @@ void LocallabBlur::updateGUIToMode(const modeType new_type) // Specific Simple mode widgets are shown in Normal mode expmaskbl->show(); expdenoise1->show(); + if(lnoiselow->getValue()!= 1.) { + if (showmaskblMethodtyp->get_active_row_number() == 0) { + showmaskblMethodtyp->set_active(2); + } + } break; @@ -7001,6 +7011,12 @@ void LocallabBlur::updateGUIToMode(const modeType new_type) shadmaskblsha->show(); mask2blCurveEditorGwav->show(); csThresholdblur->show(); + if(lnoiselow->getValue()!= 1.) { + if (showmaskblMethodtyp->get_active_row_number() == 0) { + showmaskblMethodtyp->set_active(2); + } + } + } } @@ -7177,6 +7193,12 @@ void LocallabBlur::showmaskblMethodChanged() void LocallabBlur::showmaskblMethodtypChanged() { + if(lnoiselow->getValue()!= 1.) { + if (showmaskblMethodtyp->get_active_row_number() == 0) { + showmaskblMethodtyp->set_active(2); + } + } + // If mask preview is activated, deactivate all other tool mask preview if (locToolListener) { locToolListener->resetOtherMaskView(this); From 0148c5a112a4a7b8d1f560c94d81d307fdacd9a6 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Wed, 16 Dec 2020 12:17:50 +0100 Subject: [PATCH 022/129] Raised max ISO to 819200 for better Pentax KP and Pentax K-1 II support --- rtengine/dynamicprofile.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtengine/dynamicprofile.cc b/rtengine/dynamicprofile.cc index 617ec2747..28516a1ee 100644 --- a/rtengine/dynamicprofile.cc +++ b/rtengine/dynamicprofile.cc @@ -33,7 +33,7 @@ using namespace rtengine::procparams; namespace { -const int ISO_MAX = 512000; +const int ISO_MAX = 819200; const double FNUMBER_MAX = 100.0; const double FOCALLEN_MAX = 10000.0; const double SHUTTERSPEED_MAX = 1000.0; From a4ab8f9fbafcf48961e15a26b15c6c80a0fd7efa Mon Sep 17 00:00:00 2001 From: Desmis Date: Wed, 16 Dec 2020 12:39:20 +0100 Subject: [PATCH 023/129] Display status enable mask for denoise --- rtdata/languages/default | 2 ++ rtgui/locallabtools.cc | 30 +++++++++++++++++++++++++++++- rtgui/locallabtools.h | 3 +++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index c77438f8f..93fba3260 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2764,6 +2764,8 @@ TP_LOCALLAB_MASKLC_TOOLTIP;This allows you to target the denoise based on the im TP_LOCALLAB_MASKLCTHR;Light area luminance % threshold TP_LOCALLAB_MASKLCTHRLOW; Dark area luminance % threshold TP_LOCALLAB_MASKLNOISELOW;Reinforce denoise in dark areas +TP_LOCALLAB_MASKUSABLE;Mask usable +TP_LOCALLAB_MASKUNUSABLE;No mask TP_LOCALLAB_MASK_TOOLTIP;You can enable multiple masks for a tool by activating another tool and using only the mask (set the tool sliders to 0 ).\n\nYou can also duplicate the RT-spot and place it close to the first spot. The small variations in the spot references allows you to make fine adjustments. TP_LOCALLAB_MED;Medium TP_LOCALLAB_MEDIAN;Median Low diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index cb4fc3312..817ad926b 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -5761,7 +5761,9 @@ LocallabBlur::LocallabBlur(): LocalcurveEditorwavden(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_WAVDEN"))), wavshapeden(static_cast(LocalcurveEditorwavden->addCurve(CT_Flat, "", nullptr, false, false))), expdenoise1(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI1_EXP")))), - // usemask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_USEMASK")))), + maskusable(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUSABLE")))), + maskunusable(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUNUSABLE")))), +// usemask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_USEMASK")))), lnoiselow(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLNOISELOW"), 0.7, 2., 0.01, 1.))), levelthr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 10., 100., 1., 40.))), levelthrlow(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 100., 1., 12.))), @@ -6046,6 +6048,8 @@ LocallabBlur::LocallabBlur(): wavBox->pack_start(*LocalcurveEditorwavhue, Gtk::PACK_SHRINK, 4); ToolParamBlock* const wavBox1 = Gtk::manage(new ToolParamBlock()); // wavBox1->pack_start(*usemask, Gtk::PACK_SHRINK, 0); + wavBox1->pack_start(*maskusable, Gtk::PACK_SHRINK, 0); + wavBox1->pack_start(*maskunusable, Gtk::PACK_SHRINK, 0); wavBox1->pack_start(*lnoiselow, Gtk::PACK_SHRINK, 0); wavBox1->pack_start(*levelthrlow, Gtk::PACK_SHRINK, 0); wavBox1->pack_start(*levelthr, Gtk::PACK_SHRINK, 0); @@ -6971,6 +6975,8 @@ void LocallabBlur::updateGUIToMode(const modeType new_type) fftwbl->hide(); expmaskbl->hide(); expdenoise1->hide(); + maskusable->hide(); + maskunusable->hide(); break; @@ -6992,6 +6998,13 @@ void LocallabBlur::updateGUIToMode(const modeType new_type) showmaskblMethodtyp->set_active(2); } } + if (enablMask->get_active()) { + maskusable->show(); + maskunusable->hide(); + } else { + maskusable->hide(); + maskunusable->show(); + } break; @@ -7016,6 +7029,13 @@ void LocallabBlur::updateGUIToMode(const modeType new_type) showmaskblMethodtyp->set_active(2); } } + if (enablMask->get_active()) { + maskusable->show(); + maskunusable->hide(); + } else { + maskusable->hide(); + maskunusable->show(); + } } } @@ -7212,6 +7232,14 @@ void LocallabBlur::showmaskblMethodtypChanged() void LocallabBlur::enablMaskChanged() { + if (enablMask->get_active()) { + maskusable->show(); + maskunusable->hide(); + } else { + maskusable->hide(); + maskunusable->show(); + } + if (isLocActivated && exp->getEnabled()) { if (listener) { if (enablMask->get_active()) { diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index 7b8409524..c8463fa31 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -664,6 +664,9 @@ private: CurveEditorGroup* const LocalcurveEditorwavden; FlatCurveEditor* const wavshapeden; MyExpander* const expdenoise1; + Gtk::Label* const maskusable; + Gtk::Label* const maskunusable; + // Gtk::CheckButton* const usemask; Adjuster* const lnoiselow; Adjuster* const levelthr; From 977fd771e6e0b7e5c6b2e5d11a9667398393d79e Mon Sep 17 00:00:00 2001 From: Desmis Date: Wed, 16 Dec 2020 13:53:11 +0100 Subject: [PATCH 024/129] Reset button for LA denoise --- rtgui/locallabtools.cc | 33 +++++++++++++++++++++++++++++++++ rtgui/locallabtools.h | 4 +++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 817ad926b..774ef2576 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -5782,6 +5782,7 @@ LocallabBlur::LocallabBlur(): adjblur(Gtk::manage(new Adjuster(M("TP_LOCALLAB_ADJ"), -100., 100., 1., 0., Gtk::manage(new RTImage("circle-blue-yellow-small.png")), Gtk::manage(new RTImage("circle-red-green-small.png"))))), bilateral(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BILATERAL"), 0, 100, 1, 0))), sensiden(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 60))), + neutral(Gtk::manage (new Gtk::Button (M ("TP_RETINEX_NEUTRAL")))), expmaskbl(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_SHOWPLUS")))), showmaskblMethod(Gtk::manage(new MyComboBoxText())), showmaskblMethodtyp(Gtk::manage(new MyComboBoxText())), @@ -5938,6 +5939,15 @@ LocallabBlur::LocallabBlur(): sensiden->setAdjusterListener(this); + + setExpandAlignProperties (neutral, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); + RTImage *resetImg = Gtk::manage (new RTImage ("undo-small.png", "redo-small.png")); + setExpandAlignProperties (resetImg, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); + neutral->set_image (*resetImg); + neutral->set_tooltip_text (M ("TP_RETINEX_NEUTRAL_TIP")); + neutralconn = neutral->signal_pressed().connect ( sigc::mem_fun (*this, &LocallabBlur::neutral_pressed) ); + neutral->show(); + setExpandAlignProperties(expmaskbl, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); showmaskblMethod->append(M("TP_LOCALLAB_SHOWMNONE")); @@ -6064,6 +6074,8 @@ LocallabBlur::LocallabBlur(): denoisebox->pack_start(*wavFrame); denoisebox->pack_start(*bilateral); denoisebox->pack_start(*sensiden); + denoisebox->pack_start(*neutral); + expdenoise->add(*denoisebox, false); pack_start(*expdenoise); ToolParamBlock* const maskblBox = Gtk::manage(new ToolParamBlock()); @@ -6229,6 +6241,27 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) } } +void LocallabBlur::neutral_pressed () +{ + const LocallabParams::LocallabSpot defSpot; + lnoiselow->setValue(defSpot.lnoiselow); + levelthr->setValue(defSpot.levelthr); + levelthrlow->setValue(defSpot.levelthrlow); + noiselumf0->setValue(defSpot.noiselumf0); + noiselumdetail->setValue(defSpot.noiselumdetail); + noiselequal->setValue(defSpot.noiselequal); + noisechrof->setValue(defSpot.noisechrof); + noisechroc->setValue(defSpot.noisechroc); + noisechrodetail->setValue(defSpot.noisechrodetail); + detailthr->setValue(defSpot.detailthr);; + adjblur->setValue(defSpot.adjblur); + bilateral->setValue(defSpot.bilateral); + sensiden->setValue(defSpot.sensiden); + quamethod->set_active (0); + wavshapeden->setCurve(defSpot.locwavcurveden); + wavhue->setCurve(defSpot.locwavcurvehue); +} + void LocallabBlur::setDefaultExpanderVisibility() { expblnoise->set_expanded(false); diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index c8463fa31..1eaaa94bd 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -686,6 +686,7 @@ private: Adjuster* const adjblur; Adjuster* const bilateral; Adjuster* const sensiden; + Gtk::Button* neutral; MyExpander* const expmaskbl; MyComboBoxText* const showmaskblMethod; MyComboBoxText* const showmaskblMethodtyp; @@ -713,7 +714,7 @@ private: ThresholdAdjuster* const csThresholdblur; sigc::connection blMethodConn, fftwblConn, invblConn, medMethodConn, blurMethodConn, chroMethodConn, activlumConn, showmaskblMethodConn, showmaskblMethodtypConn, enablMaskConn, toolblConn; - sigc::connection quamethodconn, usemaskConn; + sigc::connection quamethodconn, usemaskConn, neutralconn; public: LocallabBlur(); ~LocallabBlur(); @@ -723,6 +724,7 @@ public: void getMaskView(int &colorMask, int &colorMaskinv, int &expMask, int &expMaskinv, int &shMask, int &shMaskinv, int &vibMask, int &softMask, int &blMask, int &tmMask, int &retiMask, int &sharMask, int &lcMask, int &cbMask, int &logMask, int &maskMask) override; void updateAdviceTooltips(const bool showTooltips) override; + void neutral_pressed(); void setDefaultExpanderVisibility() override; void disableListener() override; From a4e154c975ef073dae5f42609c1056a17f70bdba Mon Sep 17 00:00:00 2001 From: Desmis Date: Wed, 16 Dec 2020 17:11:22 +0100 Subject: [PATCH 025/129] Change labels info mask --- rtdata/languages/default | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 93fba3260..126b94f01 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2764,8 +2764,8 @@ TP_LOCALLAB_MASKLC_TOOLTIP;This allows you to target the denoise based on the im TP_LOCALLAB_MASKLCTHR;Light area luminance % threshold TP_LOCALLAB_MASKLCTHRLOW; Dark area luminance % threshold TP_LOCALLAB_MASKLNOISELOW;Reinforce denoise in dark areas -TP_LOCALLAB_MASKUSABLE;Mask usable -TP_LOCALLAB_MASKUNUSABLE;No mask +TP_LOCALLAB_MASKUSABLE;Mask enabled (Mask & modifications) +TP_LOCALLAB_MASKUNUSABLE;Mask disabled (Mask & modifications) TP_LOCALLAB_MASK_TOOLTIP;You can enable multiple masks for a tool by activating another tool and using only the mask (set the tool sliders to 0 ).\n\nYou can also duplicate the RT-spot and place it close to the first spot. The small variations in the spot references allows you to make fine adjustments. TP_LOCALLAB_MED;Medium TP_LOCALLAB_MEDIAN;Median Low From 183b20110b10fd254f0060c21e026f011215a3a7 Mon Sep 17 00:00:00 2001 From: Desmis Date: Wed, 16 Dec 2020 20:13:00 +0100 Subject: [PATCH 026/129] Change default values DCT denoise LA --- rtengine/procparams.cc | 6 +++--- rtgui/locallabtools.cc | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 52478bfd3..e4d2852d3 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3316,15 +3316,15 @@ LocallabParams::LocallabSpot::LocallabSpot() : noiselumf0(0.), noiselumf2(0.), noiselumc(0.), - noiselumdetail(0.), + noiselumdetail(50.), noiselequal(7), noisechrof(0.), noisechroc(0.), - noisechrodetail(0.), + noisechrodetail(50.), adjblur(0), bilateral(0), sensiden(60), - detailthr(0), + detailthr(50), locwavcurveden{ static_cast(FCT_MinMaxCPoints), 0.0, diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 774ef2576..7bb65348a 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -5771,14 +5771,14 @@ LocallabBlur::LocallabBlur(): noiselumf(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMFINE"), MINCHRO, MAXCHRO, 0.01, 0.))), noiselumf2(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMFINETWO"), MINCHRO, MAXCHRO, 0.01, 0.))), noiselumc(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMCOARSE"), MINCHRO, MAXCHROCC, 0.01, 0.))), - noiselumdetail(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMDETAIL"), 0., 100., 0.01, 0.))), + noiselumdetail(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMDETAIL"), 0., 100., 0.01, 50.))), noiselequal(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELEQUAL"), -2, 10, 1, 7, Gtk::manage(new RTImage("circle-white-small.png")), Gtk::manage(new RTImage("circle-black-small.png"))))), LocalcurveEditorwavhue(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_WAVELET_DENOISEHUE"))), wavhue(static_cast(LocalcurveEditorwavhue->addCurve(CT_Flat, "", nullptr, false, true))), noisechrof(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISECHROFINE"), MINCHRO, MAXCHRO, 0.01, 0.))), noisechroc(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISECHROCOARSE"), MINCHRO, MAXCHROCC, 0.01, 0.))), - noisechrodetail(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISECHRODETAIL"), 0., 100., 0.01, 0.))), - detailthr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DETAILTHR"), 0, 100, 1, 0))), + noisechrodetail(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISECHRODETAIL"), 0., 100., 0.01, 50.))), + detailthr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DETAILTHR"), 0, 100, 1, 50))), adjblur(Gtk::manage(new Adjuster(M("TP_LOCALLAB_ADJ"), -100., 100., 1., 0., Gtk::manage(new RTImage("circle-blue-yellow-small.png")), Gtk::manage(new RTImage("circle-red-green-small.png"))))), bilateral(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BILATERAL"), 0, 100, 1, 0))), sensiden(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 60))), From 36cd2bc8ba12f3ff049c2b83152fffe8afe876a8 Mon Sep 17 00:00:00 2001 From: Desmis Date: Sat, 19 Dec 2020 07:46:12 +0100 Subject: [PATCH 027/129] Local adjustment denoise - added Laplacian to detail threshold DCT (#6027) * Comment code * Change GUI place edge detection * added usemask in reset * Added sk gaussian blur edge DCT * Improve Laplacian threshold detail DCT --- rtdata/languages/default | 5 +- rtengine/boxblural.h | 889 +++++++++++++++++++++++++++++++++++++++ rtengine/improcfun.h | 2 +- rtengine/iplocallab.cc | 114 +++-- rtengine/procevents.h | 4 +- rtengine/procparams.cc | 8 +- rtengine/procparams.h | 2 +- rtengine/refreshmap.cc | 2 +- rtgui/locallabtools.cc | 28 +- rtgui/locallabtools.h | 3 +- rtgui/paramsedited.cc | 12 +- rtgui/paramsedited.h | 2 +- 12 files changed, 1017 insertions(+), 54 deletions(-) create mode 100644 rtengine/boxblural.h diff --git a/rtdata/languages/default b/rtdata/languages/default index 126b94f01..33d260c31 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1229,7 +1229,7 @@ HISTORY_MSG_981;Local - Log encoding Strength HISTORY_MSG_982;Local - Equalizer hue HISTORY_MSG_983;Local - denoise threshold mask high HISTORY_MSG_984;Local - denoise threshold mask low -HISTORY_MSG_985;Local - denoise use mask +HISTORY_MSG_985;Local - denoise Laplacian HISTORY_MSG_986;Local - denoise reinforce HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma @@ -2559,6 +2559,7 @@ TP_LOCALLAB_DENOI_EXP;Denoise TP_LOCALLAB_DENOI_TOOLTIP;This module can be used for noise reduction either on its own (at the end of the processing pipeline) or in addition to the Noise Reduction module in the Detail tab (which works at the beginning of the pipeline).\n Scope allows you to differentiate the action based on color (deltaE).\n\n You can refine the result with a "Median filter" or a "Guided Filter" (Soft radius). TP_LOCALLAB_DEPTH;Depth TP_LOCALLAB_DETAIL;Local contrast +TP_LOCALLAB_DETAILFRA;Edge detection TP_LOCALLAB_DETAILSH;Details TP_LOCALLAB_DETAILTHR;Luminance & chroma detail threshold (DCT ƒ) TP_LOCALLAB_DUPLSPOTNAME;Copy @@ -3024,7 +3025,7 @@ TP_LOCALLAB_TRANSIT_TOOLTIP;Adjust smoothness of transition between affected and TP_LOCALLAB_TRANSMISSIONGAIN;Transmission gain TP_LOCALLAB_TRANSMISSIONMAP;Transmission map TP_LOCALLAB_TRANSMISSION_TOOLTIP;Transmission according to transmission.\nAbscissa: transmission from negative values (min), mean, and positive values (max).\nOrdinate: amplification or reduction.\nYou can adjust this curve to change the Transmission and reduce artifacts -//TP_LOCALLAB_USEMASK;Use mask +TP_LOCALLAB_USEMASK;Laplacian TP_LOCALLAB_VART;Variance (contrast) TP_LOCALLAB_VIBRANCE;Vibrance & Warm/Cool TP_LOCALLAB_VIBRA_TOOLTIP;Adjusts vibrance (essentially the same as the global adjustment).\nCarries out the equivalent of a white-balance adjustment using a CIECAM algorithm. diff --git a/rtengine/boxblural.h b/rtengine/boxblural.h new file mode 100644 index 000000000..3504e92ab --- /dev/null +++ b/rtengine/boxblural.h @@ -0,0 +1,889 @@ +/* -*- C++ -*- + * + * This file is part of RawTherapee. + * + * Copyright (C) 2010 Emil Martinec + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ +#ifndef _BOXBLURAL_H_ +#define _BOXBLURAL_H_ + +#include +#include +#include +#include +#include +#include "alignedbuffer.h" +#include "rt_math.h" +#include "opthelper.h" +#include "StopWatch.h" + + +namespace rtengine +{ + +// classical filtering if the support window is small: + +template void boxblur (T** src, A** dst, int radx, int rady, int W, int H) +{ + //box blur image; box range = (radx,rady) + assert(2*radx+1 < W); + assert(2*rady+1 < H); + + AlignedBuffer* buffer = new AlignedBuffer (W * H); + float* temp = buffer->data; + + if (radx == 0) { +#ifdef _OPENMP + #pragma omp parallel for +#endif + + for (int row = 0; row < H; row++) + for (int col = 0; col < W; col++) { + temp[row * W + col] = (float)src[row][col]; + } + } else { + //horizontal blur +#ifdef _OPENMP + #pragma omp parallel for +#endif + + for (int row = 0; row < H; row++) { + int len = radx + 1; + temp[row * W + 0] = (float)src[row][0] / len; + + for (int j = 1; j <= radx; j++) { + temp[row * W + 0] += (float)src[row][j] / len; + } + + for (int col = 1; col <= radx; col++) { + temp[row * W + col] = (temp[row * W + col - 1] * len + (float)src[row][col + radx]) / (len + 1); + len ++; + } + + for (int col = radx + 1; col < W - radx; col++) { + temp[row * W + col] = temp[row * W + col - 1] + ((float)(src[row][col + radx] - src[row][col - radx - 1])) / len; + } + + for (int col = W - radx; col < W; col++) { + temp[row * W + col] = (temp[row * W + col - 1] * len - src[row][col - radx - 1]) / (len - 1); + len --; + } + } + } + + if (rady == 0) { +#ifdef _OPENMP + #pragma omp parallel for +#endif + + for (int row = 0; row < H; row++) + for (int col = 0; col < W; col++) { + dst[row][col] = temp[row * W + col]; + } + } else { + //vertical blur +#ifdef _OPENMP + #pragma omp parallel for +#endif + + for (int col = 0; col < W; col++) { + int len = rady + 1; + dst[0][col] = temp[0 * W + col] / len; + + for (int i = 1; i <= rady; i++) { + dst[0][col] += temp[i * W + col] / len; + } + + for (int row = 1; row <= rady; row++) { + dst[row][col] = (dst[(row - 1)][col] * len + temp[(row + rady) * W + col]) / (len + 1); + len ++; + } + + for (int row = rady + 1; row < H - rady; row++) { + dst[row][col] = dst[(row - 1)][col] + (temp[(row + rady) * W + col] - temp[(row - rady - 1) * W + col]) / len; + } + + for (int row = H - rady; row < H; row++) { + dst[row][col] = (dst[(row - 1)][col] * len - temp[(row - rady - 1) * W + col]) / (len - 1); + len --; + } + } + } + + delete buffer; + +} + +template void boxblur (T** src, A** dst, T* buffer, int radx, int rady, int W, int H) +{ + //box blur image; box range = (radx,rady) + + float* temp = buffer; + + if (radx == 0) { +#ifdef _OPENMP + #pragma omp for +#endif + + for (int row = 0; row < H; row++) + for (int col = 0; col < W; col++) { + temp[row * W + col] = (float)src[row][col]; + } + } else { + //horizontal blur +#ifdef _OPENMP + #pragma omp for +#endif + + for (int row = 0; row < H; row++) { + float len = radx + 1; + float tempval = (float)src[row][0]; + + for (int j = 1; j <= radx; j++) { + tempval += (float)src[row][j]; + } + + tempval /= len; + temp[row * W + 0] = tempval; + + for (int col = 1; col <= radx; col++) { + temp[row * W + col] = tempval = (tempval * len + (float)src[row][col + radx]) / (len + 1); + len ++; + } + + for (int col = radx + 1; col < W - radx; col++) { + temp[row * W + col] = tempval = tempval + ((float)(src[row][col + radx] - src[row][col - radx - 1])) / len; + } + + for (int col = W - radx; col < W; col++) { + temp[row * W + col] = tempval = (tempval * len - src[row][col - radx - 1]) / (len - 1); + len --; + } + } + } + + if (rady == 0) { +#ifdef _OPENMP + #pragma omp for +#endif + + for (int row = 0; row < H; row++) + for (int col = 0; col < W; col++) { + dst[row][col] = temp[row * W + col]; + } + } else { + const int numCols = 8; // process numCols columns at once for better usage of L1 cpu cache +#ifdef __SSE2__ + vfloat leninitv = F2V( (float)(rady + 1)); + vfloat onev = F2V( 1.f ); + vfloat tempv, temp1v, lenv, lenp1v, lenm1v, rlenv; + +#ifdef _OPENMP + #pragma omp for +#endif + + for (int col = 0; col < W - 7; col += 8) { + lenv = leninitv; + tempv = LVFU(temp[0 * W + col]); + temp1v = LVFU(temp[0 * W + col + 4]); + + for (int i = 1; i <= rady; i++) { + tempv = tempv + LVFU(temp[i * W + col]); + temp1v = temp1v + LVFU(temp[i * W + col + 4]); + } + + tempv = tempv / lenv; + temp1v = temp1v / lenv; + STVFU(dst[0][col], tempv); + STVFU(dst[0][col + 4], temp1v); + + for (int row = 1; row <= rady; row++) { + lenp1v = lenv + onev; + tempv = (tempv * lenv + LVFU(temp[(row + rady) * W + col])) / lenp1v; + temp1v = (temp1v * lenv + LVFU(temp[(row + rady) * W + col + 4])) / lenp1v; + STVFU(dst[row][col], tempv); + STVFU(dst[row][col + 4], temp1v); + lenv = lenp1v; + } + + rlenv = onev / lenv; + + for (int row = rady + 1; row < H - rady; row++) { + tempv = tempv + (LVFU(temp[(row + rady) * W + col]) - LVFU(temp[(row - rady - 1) * W + col])) * rlenv ; + temp1v = temp1v + (LVFU(temp[(row + rady) * W + col + 4]) - LVFU(temp[(row - rady - 1) * W + col + 4])) * rlenv ; + STVFU(dst[row][col], tempv); + STVFU(dst[row][col + 4], temp1v); + } + + for (int row = H - rady; row < H; row++) { + lenm1v = lenv - onev; + tempv = (tempv * lenv - LVFU(temp[(row - rady - 1) * W + col])) / lenm1v; + temp1v = (temp1v * lenv - LVFU(temp[(row - rady - 1) * W + col + 4])) / lenm1v; + STVFU(dst[row][col], tempv); + STVFU(dst[row][col + 4], temp1v); + lenv = lenm1v; + } + } + +#else + //vertical blur +#ifdef _OPENMP + #pragma omp for +#endif + + for (int col = 0; col < W - numCols + 1; col += 8) { + float len = rady + 1; + + for(int k = 0; k < numCols; k++) { + dst[0][col + k] = temp[0 * W + col + k]; + } + + for (int i = 1; i <= rady; i++) { + for(int k = 0; k < numCols; k++) { + dst[0][col + k] += temp[i * W + col + k]; + } + } + + for(int k = 0; k < numCols; k++) { + dst[0][col + k] /= len; + } + + for (int row = 1; row <= rady; row++) { + for(int k = 0; k < numCols; k++) { + dst[row][col + k] = (dst[(row - 1)][col + k] * len + temp[(row + rady) * W + col + k]) / (len + 1); + } + + len ++; + } + + for (int row = rady + 1; row < H - rady; row++) { + for(int k = 0; k < numCols; k++) { + dst[row][col + k] = dst[(row - 1)][col + k] + (temp[(row + rady) * W + col + k] - temp[(row - rady - 1) * W + col + k]) / len; + } + } + + for (int row = H - rady; row < H; row++) { + for(int k = 0; k < numCols; k++) { + dst[row][col + k] = (dst[(row - 1)][col + k] * len - temp[(row - rady - 1) * W + col + k]) / (len - 1); + } + + len --; + } + } + +#endif +#ifdef _OPENMP + #pragma omp single +#endif + + for (int col = W - (W % numCols); col < W; col++) { + float len = rady + 1; + dst[0][col] = temp[0 * W + col] / len; + + for (int i = 1; i <= rady; i++) { + dst[0][col] += temp[i * W + col] / len; + } + + for (int row = 1; row <= rady; row++) { + dst[row][col] = (dst[(row - 1)][col] * len + temp[(row + rady) * W + col]) / (len + 1); + len ++; + } + + for (int row = rady + 1; row < H - rady; row++) { + dst[row][col] = dst[(row - 1)][col] + (temp[(row + rady) * W + col] - temp[(row - rady - 1) * W + col]) / len; + } + + for (int row = H - rady; row < H; row++) { + dst[row][col] = (dst[(row - 1)][col] * len - temp[(row - rady - 1) * W + col]) / (len - 1); + len --; + } + } + } + +} + +inline void boxblur (float** src, float** dst, int radius, int W, int H, bool multiThread) +{ + //box blur using rowbuffers and linebuffers instead of a full size buffer + + if (radius == 0) { + if (src != dst) { +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + + for (int row = 0; row < H; row++) { + for (int col = 0; col < W; col++) { + dst[row][col] = src[row][col]; + } + } + } + return; + } + + constexpr int numCols = 8; // process numCols columns at once for better usage of L1 cpu cache +#ifdef _OPENMP + #pragma omp parallel if (multiThread) +#endif + { + std::unique_ptr buffer(new float[numCols * (radius + 1)]); + + //horizontal blur + float* const lineBuffer = buffer.get(); +// float* const lineBuffer = buffer; +#ifdef _OPENMP + #pragma omp for +#endif + for (int row = 0; row < H; row++) { + float len = radius + 1; + float tempval = src[row][0]; + lineBuffer[0] = tempval; + for (int j = 1; j <= radius; j++) { + tempval += src[row][j]; + } + + tempval /= len; + dst[row][0] = tempval; + + for (int col = 1; col <= radius; col++) { + lineBuffer[col] = src[row][col]; + tempval = (tempval * len + src[row][col + radius]) / (len + 1); + dst[row][col] = tempval; + ++len; + } + int pos = 0; + for (int col = radius + 1; col < W - radius; col++) { + const float oldVal = lineBuffer[pos]; + lineBuffer[pos] = src[row][col]; + dst[row][col] = tempval = tempval + (src[row][col + radius] - oldVal) / len; + ++pos; + pos = pos <= radius ? pos : 0; + } + + for (int col = W - radius; col < W; col++) { + dst[row][col] = tempval = (tempval * len - lineBuffer[pos]) / (len - 1); + --len; + ++pos; + pos = pos <= radius ? pos : 0; + } + } + + //vertical blur +#ifdef __SSE2__ + vfloat (* const rowBuffer)[2] = (vfloat(*)[2]) buffer.get(); + const vfloat leninitv = F2V(radius + 1); + const vfloat onev = F2V(1.f); + vfloat tempv, temp1v, lenv, lenp1v, lenm1v, rlenv; + +#ifdef _OPENMP + #pragma omp for nowait +#endif + + for (int col = 0; col < W - 7; col += 8) { + lenv = leninitv; + tempv = LVFU(dst[0][col]); + temp1v = LVFU(dst[0][col + 4]); + rowBuffer[0][0] = tempv; + rowBuffer[0][1] = temp1v; + + for (int i = 1; i <= radius; i++) { + tempv = tempv + LVFU(dst[i][col]); + temp1v = temp1v + LVFU(dst[i][col + 4]); + } + + tempv = tempv / lenv; + temp1v = temp1v / lenv; + STVFU(dst[0][col], tempv); + STVFU(dst[0][col + 4], temp1v); + + for (int row = 1; row <= radius; row++) { + rowBuffer[row][0] = LVFU(dst[row][col]); + rowBuffer[row][1] = LVFU(dst[row][col + 4]); + lenp1v = lenv + onev; + tempv = (tempv * lenv + LVFU(dst[row + radius][col])) / lenp1v; + temp1v = (temp1v * lenv + LVFU(dst[row + radius][col + 4])) / lenp1v; + STVFU(dst[row][col], tempv); + STVFU(dst[row][col + 4], temp1v); + lenv = lenp1v; + } + + rlenv = onev / lenv; + int pos = 0; + for (int row = radius + 1; row < H - radius; row++) { + vfloat oldVal0 = rowBuffer[pos][0]; + vfloat oldVal1 = rowBuffer[pos][1]; + rowBuffer[pos][0] = LVFU(dst[row][col]); + rowBuffer[pos][1] = LVFU(dst[row][col + 4]); + tempv = tempv + (LVFU(dst[row + radius][col]) - oldVal0) * rlenv ; + temp1v = temp1v + (LVFU(dst[row + radius][col + 4]) - oldVal1) * rlenv ; + STVFU(dst[row][col], tempv); + STVFU(dst[row][col + 4], temp1v); + ++pos; + pos = pos <= radius ? pos : 0; + } + + for (int row = H - radius; row < H; row++) { + lenm1v = lenv - onev; + tempv = (tempv * lenv - rowBuffer[pos][0]) / lenm1v; + temp1v = (temp1v * lenv - rowBuffer[pos][1]) / lenm1v; + STVFU(dst[row][col], tempv); + STVFU(dst[row][col + 4], temp1v); + lenv = lenm1v; + ++pos; + pos = pos <= radius ? pos : 0; + } + } + +#else + float (* const rowBuffer)[8] = (float(*)[8]) buffer.get(); +#ifdef _OPENMP + #pragma omp for nowait +#endif + + for (int col = 0; col < W - numCols + 1; col += 8) { + float len = radius + 1; + + for (int k = 0; k < numCols; k++) { + rowBuffer[0][k] = dst[0][col + k]; + } + + for (int i = 1; i <= radius; i++) { + for (int k = 0; k < numCols; k++) { + dst[0][col + k] += dst[i][col + k]; + } + } + + for(int k = 0; k < numCols; k++) { + dst[0][col + k] /= len; + } + + for (int row = 1; row <= radius; row++) { + for(int k = 0; k < numCols; k++) { + rowBuffer[row][k] = dst[row][col + k]; + dst[row][col + k] = (dst[row - 1][col + k] * len + dst[row + radius][col + k]) / (len + 1); + } + + len ++; + } + + int pos = 0; + for (int row = radius + 1; row < H - radius; row++) { + for(int k = 0; k < numCols; k++) { + float oldVal = rowBuffer[pos][k]; + rowBuffer[pos][k] = dst[row][col + k]; + dst[row][col + k] = dst[row - 1][col + k] + (dst[row + radius][col + k] - oldVal) / len; + } + ++pos; + pos = pos <= radius ? pos : 0; + } + + for (int row = H - radius; row < H; row++) { + for(int k = 0; k < numCols; k++) { + dst[row][col + k] = (dst[row - 1][col + k] * len - rowBuffer[pos][k]) / (len - 1); + } + len --; + ++pos; + pos = pos <= radius ? pos : 0; + } + } + +#endif + //vertical blur, remaining columns +#ifdef _OPENMP + #pragma omp single +#endif + { + const int remaining = W % numCols; + + if (remaining > 0) { + float (* const rowBuffer)[8] = (float(*)[8]) buffer.get(); + const int col = W - remaining; + + float len = radius + 1; + for(int k = 0; k < remaining; ++k) { + rowBuffer[0][k] = dst[0][col + k]; + } + for (int row = 1; row <= radius; ++row) { + for(int k = 0; k < remaining; ++k) { + dst[0][col + k] += dst[row][col + k]; + } + } + for(int k = 0; k < remaining; ++k) { + dst[0][col + k] /= len; + } + for (int row = 1; row <= radius; ++row) { + for(int k = 0; k < remaining; ++k) { + rowBuffer[row][k] = dst[row][col + k]; + dst[row][col + k] = (dst[row - 1][col + k] * len + dst[row + radius][col + k]) / (len + 1); + } + len ++; + } + const float rlen = 1.f / len; + int pos = 0; + for (int row = radius + 1; row < H - radius; ++row) { + for(int k = 0; k < remaining; ++k) { + float oldVal = rowBuffer[pos][k]; + rowBuffer[pos][k] = dst[row][col + k]; + dst[row][col + k] = dst[row - 1][col + k] + (dst[row + radius][col + k] - oldVal) * rlen; + } + ++pos; + pos = pos <= radius ? pos : 0; + } + for (int row = H - radius; row < H; ++row) { + for(int k = 0; k < remaining; ++k) { + dst[row][col + k] = (dst[(row - 1)][col + k] * len - rowBuffer[pos][k]) / (len - 1); + } + len --; + ++pos; + pos = pos <= radius ? pos : 0; + } + } + } + } +} + +template void boxblur (T* src, A* dst, A* buffer, int radx, int rady, int W, int H) +{ + //box blur image; box range = (radx,rady) i.e. box size is (2*radx+1)x(2*rady+1) + + float* temp = buffer; + + if (radx == 0) { + for (int row = 0; row < H; row++) + for (int col = 0; col < W; col++) { + temp[row * W + col] = src[row * W + col]; + } + } else { + //horizontal blur + for (int row = H - 1; row >= 0; row--) { + int len = radx + 1; + float tempval = (float)src[row * W]; + + for (int j = 1; j <= radx; j++) { + tempval += (float)src[row * W + j]; + } + + tempval = tempval / len; + temp[row * W] = tempval; + + for (int col = 1; col <= radx; col++) { + tempval = (tempval * len + src[row * W + col + radx]) / (len + 1); + temp[row * W + col] = tempval; + len ++; + } + + float reclen = 1.f / len; + + for (int col = radx + 1; col < W - radx; col++) { + tempval = tempval + ((float)(src[row * W + col + radx] - src[row * W + col - radx - 1])) * reclen; + temp[row * W + col] = tempval; + } + + for (int col = W - radx; col < W; col++) { + tempval = (tempval * len - src[row * W + col - radx - 1]) / (len - 1); + temp[row * W + col] = tempval; + len --; + } + } + } + + if (rady == 0) { + for (int row = 0; row < H; row++) + for (int col = 0; col < W; col++) { + dst[row * W + col] = temp[row * W + col]; + } + } else { + //vertical blur +#ifdef __SSE2__ + vfloat leninitv = F2V( (float)(rady + 1)); + vfloat onev = F2V( 1.f ); + vfloat tempv, temp1v, lenv, lenp1v, lenm1v, rlenv; + int col; + + for (col = 0; col < W - 7; col += 8) { + lenv = leninitv; + tempv = LVFU(temp[0 * W + col]); + temp1v = LVFU(temp[0 * W + col + 4]); + + for (int i = 1; i <= rady; i++) { + tempv = tempv + LVFU(temp[i * W + col]); + temp1v = temp1v + LVFU(temp[i * W + col + 4]); + } + + tempv = tempv / lenv; + temp1v = temp1v / lenv; + STVFU(dst[0 * W + col], tempv); + STVFU(dst[0 * W + col + 4], temp1v); + + for (int row = 1; row <= rady; row++) { + lenp1v = lenv + onev; + tempv = (tempv * lenv + LVFU(temp[(row + rady) * W + col])) / lenp1v; + temp1v = (temp1v * lenv + LVFU(temp[(row + rady) * W + col + 4])) / lenp1v; + STVFU(dst[row * W + col], tempv); + STVFU(dst[row * W + col + 4], temp1v); + lenv = lenp1v; + } + + rlenv = onev / lenv; + + for (int row = rady + 1; row < H - rady; row++) { + tempv = tempv + (LVFU(temp[(row + rady) * W + col]) - LVFU(temp[(row - rady - 1) * W + col])) * rlenv ; + temp1v = temp1v + (LVFU(temp[(row + rady) * W + col + 4]) - LVFU(temp[(row - rady - 1) * W + col + 4])) * rlenv ; + STVFU(dst[row * W + col], tempv); + STVFU(dst[row * W + col + 4], temp1v); + } + + for (int row = H - rady; row < H; row++) { + lenm1v = lenv - onev; + tempv = (tempv * lenv - LVFU(temp[(row - rady - 1) * W + col])) / lenm1v; + temp1v = (temp1v * lenv - LVFU(temp[(row - rady - 1) * W + col + 4])) / lenm1v; + STVFU(dst[row * W + col], tempv); + STVFU(dst[row * W + col + 4], temp1v); + lenv = lenm1v; + } + } + + for (; col < W - 3; col += 4) { + lenv = leninitv; + tempv = LVFU(temp[0 * W + col]); + + for (int i = 1; i <= rady; i++) { + tempv = tempv + LVFU(temp[i * W + col]); + } + + tempv = tempv / lenv; + STVFU(dst[0 * W + col], tempv); + + for (int row = 1; row <= rady; row++) { + lenp1v = lenv + onev; + tempv = (tempv * lenv + LVFU(temp[(row + rady) * W + col])) / lenp1v; + STVFU(dst[row * W + col], tempv); + lenv = lenp1v; + } + + rlenv = onev / lenv; + + for (int row = rady + 1; row < H - rady; row++) { + tempv = tempv + (LVFU(temp[(row + rady) * W + col]) - LVFU(temp[(row - rady - 1) * W + col])) * rlenv ; + STVFU(dst[row * W + col], tempv); + } + + for (int row = H - rady; row < H; row++) { + lenm1v = lenv - onev; + tempv = (tempv * lenv - LVFU(temp[(row - rady - 1) * W + col])) / lenm1v; + STVFU(dst[row * W + col], tempv); + lenv = lenm1v; + } + } + + for (; col < W; col++) { + int len = rady + 1; + dst[0 * W + col] = temp[0 * W + col] / len; + + for (int i = 1; i <= rady; i++) { + dst[0 * W + col] += temp[i * W + col] / len; + } + + for (int row = 1; row <= rady; row++) { + dst[row * W + col] = (dst[(row - 1) * W + col] * len + temp[(row + rady) * W + col]) / (len + 1); + len ++; + } + + for (int row = rady + 1; row < H - rady; row++) { + dst[row * W + col] = dst[(row - 1) * W + col] + (temp[(row + rady) * W + col] - temp[(row - rady - 1) * W + col]) / len; + } + + for (int row = H - rady; row < H; row++) { + dst[row * W + col] = (dst[(row - 1) * W + col] * len - temp[(row - rady - 1) * W + col]) / (len - 1); + len --; + } + } + +#else + + for (int col = 0; col < W; col++) { + int len = rady + 1; + dst[0 * W + col] = temp[0 * W + col] / len; + + for (int i = 1; i <= rady; i++) { + dst[0 * W + col] += temp[i * W + col] / len; + } + + for (int row = 1; row <= rady; row++) { + dst[row * W + col] = (dst[(row - 1) * W + col] * len + temp[(row + rady) * W + col]) / (len + 1); + len ++; + } + + for (int row = rady + 1; row < H - rady; row++) { + dst[row * W + col] = dst[(row - 1) * W + col] + (temp[(row + rady) * W + col] - temp[(row - rady - 1) * W + col]) / len; + } + + for (int row = H - rady; row < H; row++) { + dst[row * W + col] = (dst[(row - 1) * W + col] * len - temp[(row - rady - 1) * W + col]) / (len - 1); + len --; + } + } + +#endif + } + +} + +template void boxabsblur (T* src, A* dst, int radx, int rady, int W, int H, float * temp) +{ + + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + //box blur image; box range = (radx,rady) i.e. box size is (2*radx+1)x(2*rady+1) + + if (radx == 0) { + for (int row = 0; row < H; row++) + for (int col = 0; col < W; col++) { + temp[row * W + col] = fabs(src[row * W + col]); + } + } else { + //horizontal blur + for (int row = 0; row < H; row++) { + int len = radx + 1; + float tempval = fabsf((float)src[row * W + 0]); + + for (int j = 1; j <= radx; j++) { + tempval += fabsf((float)src[row * W + j]); + } + + tempval /= len; + temp[row * W + 0] = tempval; + + for (int col = 1; col <= radx; col++) { + tempval = (tempval * len + fabsf(src[row * W + col + radx])) / (len + 1); + temp[row * W + col] = tempval; + len ++; + } + + float rlen = 1.f / (float)len; + + for (int col = radx + 1; col < W - radx; col++) { + tempval = tempval + ((float)(fabsf(src[row * W + col + radx]) - fabsf(src[row * W + col - radx - 1]))) * rlen; + temp[row * W + col] = tempval; + } + + for (int col = W - radx; col < W; col++) { + tempval = (tempval * len - fabsf(src[row * W + col - radx - 1])) / (len - 1); + temp[row * W + col] = tempval; + len --; + } + } + } + + if (rady == 0) { + for (int row = 0; row < H; row++) + for (int col = 0; col < W; col++) { + dst[row * W + col] = temp[row * W + col]; + } + } else { + //vertical blur +#ifdef __SSE2__ + vfloat leninitv = F2V( (float)(rady + 1)); + vfloat onev = F2V( 1.f ); + vfloat tempv, lenv, lenp1v, lenm1v, rlenv; + + for (int col = 0; col < W - 3; col += 4) { + lenv = leninitv; + tempv = LVF(temp[0 * W + col]); + + for (int i = 1; i <= rady; i++) { + tempv = tempv + LVF(temp[i * W + col]); + } + + tempv = tempv / lenv; + STVF(dst[0 * W + col], tempv); + + for (int row = 1; row <= rady; row++) { + lenp1v = lenv + onev; + tempv = (tempv * lenv + LVF(temp[(row + rady) * W + col])) / lenp1v; + STVF(dst[row * W + col], tempv); + lenv = lenp1v; + } + + rlenv = onev / lenv; + + for (int row = rady + 1; row < H - rady; row++) { + tempv = tempv + (LVF(temp[(row + rady) * W + col]) - LVF(temp[(row - rady - 1) * W + col])) * rlenv; + STVF(dst[row * W + col], tempv); + } + + for (int row = H - rady; row < H; row++) { + lenm1v = lenv - onev; + tempv = (tempv * lenv - LVF(temp[(row - rady - 1) * W + col])) / lenm1v; + STVF(dst[row * W + col], tempv); + lenv = lenm1v; + } + } + + for (int col = W - (W % 4); col < W; col++) { + int len = rady + 1; + dst[0 * W + col] = temp[0 * W + col] / len; + + for (int i = 1; i <= rady; i++) { + dst[0 * W + col] += temp[i * W + col] / len; + } + + for (int row = 1; row <= rady; row++) { + dst[row * W + col] = (dst[(row - 1) * W + col] * len + temp[(row + rady) * W + col]) / (len + 1); + len ++; + } + + for (int row = rady + 1; row < H - rady; row++) { + dst[row * W + col] = dst[(row - 1) * W + col] + (temp[(row + rady) * W + col] - temp[(row - rady - 1) * W + col]) / len; + } + + for (int row = H - rady; row < H; row++) { + dst[row * W + col] = (dst[(row - 1) * W + col] * len - temp[(row - rady - 1) * W + col]) / (len - 1); + len --; + } + } + +#else + + for (int col = 0; col < W; col++) { + int len = rady + 1; + dst[0 * W + col] = temp[0 * W + col] / len; + + for (int i = 1; i <= rady; i++) { + dst[0 * W + col] += temp[i * W + col] / len; + } + + for (int row = 1; row <= rady; row++) { + dst[row * W + col] = (dst[(row - 1) * W + col] * len + temp[(row + rady) * W + col]) / (len + 1); + len ++; + } + + for (int row = rady + 1; row < H - rady; row++) { + dst[row * W + col] = dst[(row - 1) * W + col] + (temp[(row + rady) * W + col] - temp[(row - rady - 1) * W + col]) / len; + } + + for (int row = H - rady; row < H; row++) { + dst[row * W + col] = (dst[(row - 1) * W + col] * len - temp[(row - rady - 1) * W + col]) / (len - 1); + len --; + } + } + +#endif + } + +} + +} +#endif /* _BOXBLUR_H_ */ diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index f9ec00469..375d506ce 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -372,7 +372,7 @@ public: void DeNoise(int call, float * slidL, float * slida, float * slidb, int aut, bool noiscfactiv, const struct local_params& lp, LabImage* originalmaskbl, LabImage * bufmaskblurbl, int levred, float huerefblur, float lumarefblur, float chromarefblur, LabImage* original, LabImage* transformed, int cx, int cy, int sk, const LocwavCurve& locwavCurvehue, bool locwavhueutili); - void fftw_denoise(int GW, int GH, int max_numblox_W, int min_numblox_W, float **tmp1, array2D *Lin, int numThreads, const struct local_params & lp, int chrom); + void fftw_denoise(int sk, int GW, int GH, int max_numblox_W, int min_numblox_W, float **tmp1, array2D *Lin, int numThreads, const struct local_params & lp, int chrom); void ColorLight_Local(float moddE, float powdE, int call, LabImage * bufcolorig, LabImage * originalmask, float **buflight, float **bufchro, float **bufchroslid, float ** bufhh, float ** buflightslid, bool &LHutili, bool &HHutili, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, float sobelref, float ** blend2, LUTf & lllocalcurve, const LocLHCurve & loclhCurve, const LocHHCurve & lochhCurve, LUTf & lightCurveloc, const local_params& lp, LabImage* original, LabImage* transformed, int cx, int cy, int sk); void InverseColorLight_Local(bool tonequ, bool tonecurv, int sp, int senstype, struct local_params& lp, LabImage * originalmask, const LUTf& lightCurveloc, const LUTf& hltonecurveloc, const LUTf& shtonecurveloc, const LUTf& tonecurveloc, const LUTf& exlocalcurve, const LUTf& cclocalcurve, float adjustr, bool localcutili, const LUTf& lllocalcurve, bool locallutili, LabImage* original, LabImage* transformed, int cx, int cy, const float hueref, const float chromaref, const float lumaref, int sk); diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 203efacad..ab58e88c0 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -49,6 +49,7 @@ #define BENCHMARK #include "StopWatch.h" #include "guidedfilter.h" +#include "boxblural.h" #pragma GCC diagnostic warning "-Wall" @@ -250,6 +251,8 @@ float calcreducdE(float dE, float maxdE, float mindE, float maxdElim, float mind } } + + void deltaEforLaplace(float *dE, const float lap, int bfw, int bfh, rtengine::LabImage* bufexporig, const float hueref, const float chromaref, const float lumaref) { @@ -659,7 +662,7 @@ struct local_params { bool activspot; float thrlow; float thrhigh; - // bool usemask; + bool usemask; float lnoiselow; }; @@ -780,7 +783,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.thrlow = locallab.spots.at(sp).levelthrlow; lp.thrhigh = locallab.spots.at(sp).levelthr; - // lp.usemask = locallab.spots.at(sp).usemask; + lp.usemask = locallab.spots.at(sp).usemask; lp.lnoiselow = locallab.spots.at(sp).lnoiselow; // printf("llColorMask=%i lllcMask=%i llExpMask=%i llSHMask=%i llcbMask=%i llretiMask=%i lltmMask=%i llblMask=%i llvibMask=%i\n", llColorMask, lllcMask, llExpMask, llSHMask, llcbMask, llretiMask, lltmMask, llblMask, llvibMask); @@ -3886,6 +3889,48 @@ static void showmask(int lumask, const local_params& lp, int xstart, int ystart, } } } +//from A.Griggio...very similar to discrete_laplacian_threhold...some differences with ceiling and data format +void laplacian(const array2D &src, array2D &dst, int bfw, int bfh, float threshold, float ceiling, float factor, bool multiThread) +{ + const int W = bfw; + const int H = bfh; + + const auto X = + [W](int x) -> int + { + return x < 0 ? x+2 : (x >= W ? x-2 : x); + }; + + const auto Y = + [H](int y) -> int + { + return y < 0 ? y+2 : (y >= H ? y-2 : y); + }; + + const auto get = + [&src](int y, int x) -> float + { + return std::max(src[y][x], 0.f); + }; + + dst(W, H); + const float f = factor / ceiling; + +#ifdef _OPENMP +# pragma omp parallel for if (multiThread) +#endif + for (int y = 0; y < H; ++y) { + int n = Y(y-1), s = Y(y+1); + for (int x = 0; x < W; ++x) { + int w = X(x-1), e = X(x+1); + float v = -8.f * get(y, x) + get(n, x) + get(s, x) + get(y, w) + get(y, e) + get(n, w) + get(n, e) + get(s, w) + get(s, e); + dst[y][x] = LIM(std::abs(v) - threshold, 0.f, ceiling) * f; + } + } +} + + + void ImProcFunctions::discrete_laplacian_threshold(float * data_out, const float * data_in, size_t nx, size_t ny, float t) { @@ -8412,7 +8457,7 @@ void ImProcFunctions::wavcontrast4(struct local_params& lp, float ** tmp, float } -void ImProcFunctions::fftw_denoise(int GW, int GH, int max_numblox_W, int min_numblox_W, float **tmp1, array2D *Lin, int numThreads, const struct local_params & lp, int chrom) +void ImProcFunctions::fftw_denoise(int sk, int GW, int GH, int max_numblox_W, int min_numblox_W, float **tmp1, array2D *Lin, int numThreads, const struct local_params & lp, int chrom) { // BENCHFUN @@ -8596,30 +8641,51 @@ void ImProcFunctions::fftw_denoise(int GW, int GH, int max_numblox_W, int min_nu }//end of vertical block loop } - //Threshold DCT from Alberto Grigio + //Threshold DCT from Alberto Grigio, adapted to Rawtherapee const int detail_thresh = lp.detailthr; array2D mask; if (detail_thresh > 0) { mask(GW, GH); - float thr = log2lin(float(detail_thresh) / 200.f, 100.f); - buildBlendMask(prov, mask, GW, GH, thr); + if (lp.usemask) {//with Laplacian + float amount = LIM01(float(detail_thresh)/100.f); + float thr = (1.f - amount); + float alph = params_Ldetail / 100.f; + array2D LL(GW, GH, prov, ARRAY2D_BYREFERENCE); + laplacian(LL, mask, GW, GH, 25.f, 20000.f, amount, false); + for (int i = 0; i < GH; ++i) { + for (int j = 0; j < GW; ++j) { + mask[i][j] = LIM01(mask[i][j]+ thr); + } + } + for (int i = 0; i < 3; ++i) { + boxblur(mask, mask, 10 / sk, GW, GH, false); + } + for (int i = 0; i < GH; ++i) { + for (int j = 0; j < GW; ++j) { + float k = 1.f - mask[i][j] * alph; + mask[i][j] = 1.f - (k * k); + } + } + } else {//with blend mask + float thr = log2lin(float(detail_thresh) / 200.f, 100.f); + buildBlendMask(prov, mask, GW, GH, thr); #ifdef _OPENMP #pragma omp parallel if (multiThread) #endif - { - gaussianBlur(mask, mask, GW, GH, 20.0); - } - array2D m2(GW, GH); - constexpr float alfa = 0.856f; - const float beta = 1.f + std::sqrt(log2lin(thr, 100.f)); - buildGradientsMask(GW, GH, prov, m2, params_Ldetail / 100.f, 7, 3, alfa, beta, multiThread); - - for (int i = 0; i < GH; ++i) { - for (int j = 0; j < GW; ++j) { - mask[i][j] *= m2[i][j]; + { + gaussianBlur(mask, mask, GW, GH, 20.0 / sk); } - } + array2D m2(GW, GH); + constexpr float alfa = 0.856f; + const float beta = 1.f + std::sqrt(log2lin(thr, 100.f)); + buildGradientsMask(GW, GH, prov, m2, params_Ldetail / 100.f, 7, 3, alfa, beta, multiThread); + for (int i = 0; i < GH; ++i) { + for (int j = 0; j < GW; ++j) { + mask[i][j] *= m2[i][j]; + } + } + } } @@ -9233,7 +9299,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if (!Ldecomp.memory_allocation_failed() && aut == 0) { if ((lp.noiself >= 0.01f || lp.noiself0 >= 0.01f || lp.noiself2 >= 0.01f || lp.noiselc >= 0.01f) && levred == 7 && lp.noiseldetail != 100.f) { - fftw_denoise(GW, GH, max_numblox_W, min_numblox_W, tmp1.L, Lin, numThreads, lp, 0); + fftw_denoise(sk, GW, GH, max_numblox_W, min_numblox_W, tmp1.L, Lin, numThreads, lp, 0); } } @@ -9254,7 +9320,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if (!adecomp.memory_allocation_failed() && aut == 0) { if ((lp.noisecf >= 0.01f || lp.noisecc >= 0.01f) && levred == 7 && lp.noisechrodetail != 100.f) { - fftw_denoise(GW, GH, max_numblox_W, min_numblox_W, tmp1.a, Ain, numThreads, lp, 1); + fftw_denoise(sk, GW, GH, max_numblox_W, min_numblox_W, tmp1.a, Ain, numThreads, lp, 1); } } @@ -9277,7 +9343,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if (!bdecomp.memory_allocation_failed() && aut == 0) { if ((lp.noisecf >= 0.01f || lp.noisecc >= 0.01f) && levred == 7 && lp.noisechrodetail != 100.f) { - fftw_denoise(GW, GH, max_numblox_W, min_numblox_W, tmp1.b, Bin, numThreads, lp, 1); + fftw_denoise(sk, GW, GH, max_numblox_W, min_numblox_W, tmp1.b, Bin, numThreads, lp, 1); } } @@ -9835,7 +9901,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if ((lp.noiself >= 0.01f || lp.noiself0 >= 0.01f || lp.noiself2 >= 0.01f || lp.noiselc >= 0.01f) && levred == 7 && lp.noiseldetail != 100.f) { - fftw_denoise(bfw, bfh, max_numblox_W, min_numblox_W, bufwv.L, Lin, numThreads, lp, 0); + fftw_denoise(sk, bfw, bfh, max_numblox_W, min_numblox_W, bufwv.L, Lin, numThreads, lp, 0); } } @@ -9856,7 +9922,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if (!adecomp.memory_allocation_failed() && aut == 0) { if ((lp.noisecf >= 0.001f || lp.noisecc >= 0.001f) && levred == 7 && lp.noisechrodetail != 100.f) { - fftw_denoise(bfw, bfh, max_numblox_W, min_numblox_W, bufwv.a, Ain, numThreads, lp, 1); + fftw_denoise(sk, bfw, bfh, max_numblox_W, min_numblox_W, bufwv.a, Ain, numThreads, lp, 1); } } @@ -9877,7 +9943,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if (!bdecomp.memory_allocation_failed() && aut == 0) { if ((lp.noisecf >= 0.001f || lp.noisecc >= 0.001f) && levred == 7 && lp.noisechrodetail != 100.f) { - fftw_denoise(bfw, bfh, max_numblox_W, min_numblox_W, bufwv.b, Bin, numThreads, lp, 1); + fftw_denoise(sk, bfw, bfh, max_numblox_W, min_numblox_W, bufwv.b, Bin, numThreads, lp, 1); } } diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 7da7d1d98..aae82f3b9 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -1007,8 +1007,8 @@ enum ProcEventCode { EvlocallabwavCurvehue = 981, Evlocallablevelthr = 982, Evlocallablevelthrlow = 983, - // Evlocallabusemask1 = 984, - Evlocallablnoiselow = 984, + Evlocallabusemask1 = 984, + Evlocallablnoiselow = 985, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index e4d2852d3..64374f4c3 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3307,7 +3307,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : quamethod("cons"), blurMethod("norm"), medMethod("33"), - // usemask(false), + usemask(false), levelthr(40.), lnoiselow(1.), levelthrlow(12.), @@ -4350,7 +4350,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && chroMethod == other.chroMethod && quamethod == other.quamethod && blurMethod == other.blurMethod - // && usemask == other.usemask + && usemask == other.usemask && levelthr == other.levelthr && lnoiselow == other.lnoiselow && levelthrlow == other.levelthrlow @@ -5936,7 +5936,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->chroMethod, "Locallab", "ChroMethod_" + index_str, spot.chroMethod, keyFile); saveToKeyfile(!pedited || spot_edited->quamethod, "Locallab", "QuaMethod_" + index_str, spot.quamethod, keyFile); saveToKeyfile(!pedited || spot_edited->blurMethod, "Locallab", "BlurMethod_" + index_str, spot.blurMethod, keyFile); - // saveToKeyfile(!pedited || spot_edited->usemask, "Locallab", "Usemaskb_" + index_str, spot.usemask, keyFile); + saveToKeyfile(!pedited || spot_edited->usemask, "Locallab", "Usemaskb_" + index_str, spot.usemask, keyFile); saveToKeyfile(!pedited || spot_edited->levelthr, "Locallab", "Levelthr_" + index_str, spot.levelthr, keyFile); saveToKeyfile(!pedited || spot_edited->lnoiselow, "Locallab", "Lnoiselow_" + index_str, spot.lnoiselow, keyFile); saveToKeyfile(!pedited || spot_edited->levelthrlow, "Locallab", "Levelthrlow_" + index_str, spot.levelthrlow, keyFile); @@ -7738,7 +7738,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "ChroMethod_" + index_str, pedited, spot.chroMethod, spotEdited.chroMethod); assignFromKeyfile(keyFile, "Locallab", "QuaMethod_" + index_str, pedited, spot.quamethod, spotEdited.quamethod); assignFromKeyfile(keyFile, "Locallab", "BlurMethod_" + index_str, pedited, spot.blurMethod, spotEdited.blurMethod); - // assignFromKeyfile(keyFile, "Locallab", "Usemaskb_" + index_str, pedited, spot.usemask, spotEdited.usemask); + assignFromKeyfile(keyFile, "Locallab", "Usemaskb_" + index_str, pedited, spot.usemask, spotEdited.usemask); assignFromKeyfile(keyFile, "Locallab", "Levelthr_" + index_str, pedited, spot.levelthr, spotEdited.levelthr); assignFromKeyfile(keyFile, "Locallab", "Lnoiselow_" + index_str, pedited, spot.lnoiselow, spotEdited.lnoiselow); assignFromKeyfile(keyFile, "Locallab", "Levelthrlow_" + index_str, pedited, spot.levelthrlow, spotEdited.levelthrlow); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 295099098..b5e241f51 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1214,7 +1214,7 @@ struct LocallabParams { Glib::ustring quamethod; // cons agre Glib::ustring blurMethod; // norm, inv Glib::ustring medMethod; // none, 33, 55, 77, 99 - // bool usemask; + bool usemask; double levelthr; double lnoiselow; double levelthrlow; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 923763770..129afdca9 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -1011,7 +1011,7 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, //EvlocallabwavCurvehue LUMINANCECURVE, // Evlocallablevelthr LUMINANCECURVE, // Evlocallablevelthrlow - // LUMINANCECURVE, //Evlocallabusemask1 + LUMINANCECURVE, //Evlocallabusemask1 LUMINANCECURVE // Evlocallablnoiselow }; diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 7bb65348a..97fa9111d 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -5763,7 +5763,7 @@ LocallabBlur::LocallabBlur(): expdenoise1(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI1_EXP")))), maskusable(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUSABLE")))), maskunusable(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUNUSABLE")))), -// usemask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_USEMASK")))), + usemask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_USEMASK")))), lnoiselow(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLNOISELOW"), 0.7, 2., 0.01, 1.))), levelthr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 10., 100., 1., 40.))), levelthrlow(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 100., 1., 12.))), @@ -5778,6 +5778,7 @@ LocallabBlur::LocallabBlur(): noisechrof(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISECHROFINE"), MINCHRO, MAXCHRO, 0.01, 0.))), noisechroc(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISECHROCOARSE"), MINCHRO, MAXCHROCC, 0.01, 0.))), noisechrodetail(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISECHRODETAIL"), 0., 100., 0.01, 50.))), + detailFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_DETAILFRA")))), detailthr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DETAILTHR"), 0, 100, 1, 50))), adjblur(Gtk::manage(new Adjuster(M("TP_LOCALLAB_ADJ"), -100., 100., 1., 0., Gtk::manage(new RTImage("circle-blue-yellow-small.png")), Gtk::manage(new RTImage("circle-red-green-small.png"))))), bilateral(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BILATERAL"), 0, 100, 1, 0))), @@ -5829,7 +5830,7 @@ LocallabBlur::LocallabBlur(): blMethodConn = blMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabBlur::blMethodChanged)); fftwblConn = fftwbl->signal_toggled().connect(sigc::mem_fun(*this, &LocallabBlur::fftwblChanged)); - // usemaskConn = usemask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabBlur::usemaskChanged)); + usemaskConn = usemask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabBlur::usemaskChanged)); invblConn = invbl->signal_toggled().connect(sigc::mem_fun(*this, &LocallabBlur::invblChanged)); radius->setAdjusterListener(this); @@ -5931,6 +5932,7 @@ LocallabBlur::LocallabBlur(): noisechrodetail->setAdjusterListener(this); + detailFrame->set_label_align(0.025, 0.5); detailthr->setAdjusterListener(this); adjblur->setAdjusterListener(this); @@ -6057,7 +6059,6 @@ LocallabBlur::LocallabBlur(): wavBox->pack_start(*noiselequal); wavBox->pack_start(*LocalcurveEditorwavhue, Gtk::PACK_SHRINK, 4); ToolParamBlock* const wavBox1 = Gtk::manage(new ToolParamBlock()); - // wavBox1->pack_start(*usemask, Gtk::PACK_SHRINK, 0); wavBox1->pack_start(*maskusable, Gtk::PACK_SHRINK, 0); wavBox1->pack_start(*maskunusable, Gtk::PACK_SHRINK, 0); wavBox1->pack_start(*lnoiselow, Gtk::PACK_SHRINK, 0); @@ -6068,8 +6069,12 @@ LocallabBlur::LocallabBlur(): wavBox->pack_start(*noisechrof); wavBox->pack_start(*noisechroc); wavBox->pack_start(*noisechrodetail); - wavBox->pack_start(*detailthr); wavBox->pack_start(*adjblur); + ToolParamBlock* const detailBox = Gtk::manage(new ToolParamBlock()); + detailBox->pack_start(*detailthr); + detailBox->pack_start(*usemask, Gtk::PACK_SHRINK, 0); + detailFrame->add(*detailBox); + wavBox->pack_start(*detailFrame); wavFrame->add(*wavBox); denoisebox->pack_start(*wavFrame); denoisebox->pack_start(*bilateral); @@ -6260,6 +6265,7 @@ void LocallabBlur::neutral_pressed () quamethod->set_active (0); wavshapeden->setCurve(defSpot.locwavcurveden); wavhue->setCurve(defSpot.locwavcurvehue); + usemask->set_active(defSpot.usemask); } void LocallabBlur::setDefaultExpanderVisibility() @@ -6276,7 +6282,7 @@ void LocallabBlur::disableListener() blMethodConn.block(true); fftwblConn.block(true); - // usemaskConn.block(true); + usemaskConn.block(true); invblConn.block(true); medMethodConn.block(true); blurMethodConn.block(true); @@ -6295,7 +6301,7 @@ void LocallabBlur::enableListener() blMethodConn.block(false); fftwblConn.block(false); - // usemaskConn.block(false); + usemaskConn.block(false); invblConn.block(false); medMethodConn.block(false); blurMethodConn.block(false); @@ -6334,7 +6340,7 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params } fftwbl->set_active(spot.fftwbl); - // usemask->set_active(spot.usemask); + usemask->set_active(spot.usemask); invbl->set_active(spot.invbl); radius->setValue(spot.radius); strength->setValue(spot.strength); @@ -6459,7 +6465,7 @@ void LocallabBlur::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped } spot.fftwbl = fftwbl->get_active(); - // spot.usemask = usemask->get_active(); + spot.usemask = usemask->get_active(); spot.invbl = invbl->get_active(); spot.radius = radius->getValue(); spot.strength = strength->getIntValue(); @@ -6994,7 +7000,7 @@ void LocallabBlur::convertParamToSimple() levelthr->setValue(defSpot.levelthr); lnoiselow->setValue(defSpot.lnoiselow); levelthrlow->setValue(defSpot.levelthrlow); - // usemask->set_active(defSpot.usemask); + usemask->set_active(defSpot.usemask); // Enable all listeners enableListener(); @@ -7130,7 +7136,7 @@ void LocallabBlur::fftwblChanged() } } } -/* + void LocallabBlur::usemaskChanged() { if (isLocActivated && exp->getEnabled()) { @@ -7145,7 +7151,7 @@ void LocallabBlur::usemaskChanged() } } } -*/ + void LocallabBlur::invblChanged() { const LocallabParams::LocallabSpot defSpot; diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index 1eaaa94bd..7b3b6cb47 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -667,7 +667,7 @@ private: Gtk::Label* const maskusable; Gtk::Label* const maskunusable; -// Gtk::CheckButton* const usemask; + Gtk::CheckButton* const usemask; Adjuster* const lnoiselow; Adjuster* const levelthr; Adjuster* const levelthrlow; @@ -682,6 +682,7 @@ private: Adjuster* const noisechrof; Adjuster* const noisechroc; Adjuster* const noisechrodetail; + Gtk::Frame* const detailFrame; Adjuster* const detailthr; Adjuster* const adjblur; Adjuster* const bilateral; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 6c3716a91..6cd2c93e5 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1284,7 +1284,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).chroMethod = locallab.spots.at(j).chroMethod && pSpot.chroMethod == otherSpot.chroMethod; locallab.spots.at(j).quamethod = locallab.spots.at(j).quamethod && pSpot.quamethod == otherSpot.quamethod; locallab.spots.at(j).blurMethod = locallab.spots.at(j).blurMethod && pSpot.blurMethod == otherSpot.blurMethod; - // locallab.spots.at(j).usemask = locallab.spots.at(j).usemask && pSpot.usemask == otherSpot.usemask; + locallab.spots.at(j).usemask = locallab.spots.at(j).usemask && pSpot.usemask == otherSpot.usemask; locallab.spots.at(j).levelthr = locallab.spots.at(j).levelthr && pSpot.levelthr == otherSpot.levelthr; locallab.spots.at(j).lnoiselow = locallab.spots.at(j).lnoiselow && pSpot.lnoiselow == otherSpot.lnoiselow; locallab.spots.at(j).levelthrlow = locallab.spots.at(j).levelthrlow && pSpot.levelthrlow == otherSpot.levelthrlow; @@ -4056,9 +4056,9 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).blurMethod = mods.locallab.spots.at(i).blurMethod; } - // if (locallab.spots.at(i).usemask) { - // toEdit.locallab.spots.at(i).usemask = mods.locallab.spots.at(i).usemask; - // } + if (locallab.spots.at(i).usemask) { + toEdit.locallab.spots.at(i).usemask = mods.locallab.spots.at(i).usemask; + } if (locallab.spots.at(i).levelthr) { toEdit.locallab.spots.at(i).levelthr = mods.locallab.spots.at(i).levelthr; @@ -6587,7 +6587,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : blMethod(v), chroMethod(v), quamethod(v), - // usemask(v), + usemask(v), levelthr(v), lnoiselow(v), levelthrlow(v), @@ -7106,7 +7106,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) blMethod = v; chroMethod = v; quamethod = v; -// usemask = v; + usemask = v; levelthr = v; lnoiselow = v; levelthrlow = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 897c8b16b..41406e3ea 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -620,7 +620,7 @@ public: bool blMethod; bool chroMethod; bool quamethod; - // bool usemask; + bool usemask; bool levelthr; bool lnoiselow; bool levelthrlow; From 8cdb667883ad506c4f2bc14b5c910c45de354532 Mon Sep 17 00:00:00 2001 From: Desmis Date: Sat, 19 Dec 2020 11:04:00 +0100 Subject: [PATCH 028/129] Disabled LA denoise if not used --- rtengine/iplocallab.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index ab58e88c0..7738f3d7a 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -11250,8 +11250,7 @@ void ImProcFunctions::Lab_Local( } //local denoise - - if (lp.denoiena) { + if (lp.denoiena && (lp.noiself > 0.f || lp.noiself0 > 0.f || lp.noiself2 > 0.f || lp.noiselc > 0.f || lp.noisecf > 0.f || lp.noisecc > 0.f )) {//disable denoise if not used float slidL[8] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; float slida[8] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; float slidb[8] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; From 5a2d2dc6b41e51c0557d35a374fd80f66a9e75c3 Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Thu, 24 Dec 2020 14:16:22 +0100 Subject: [PATCH 029/129] Chinese (Simplified) translation updated by syyrmb, closes #6031 --- rtdata/languages/Chinese (Simplified) | 1980 ++++++++++++++++++------- 1 file changed, 1435 insertions(+), 545 deletions(-) diff --git a/rtdata/languages/Chinese (Simplified) b/rtdata/languages/Chinese (Simplified) index a2181050a..11a478c22 100644 --- a/rtdata/languages/Chinese (Simplified) +++ b/rtdata/languages/Chinese (Simplified) @@ -11,18 +11,11 @@ ABOUT_TAB_CREDITS;致谢名单 ABOUT_TAB_LICENSE;授权协议 ABOUT_TAB_RELEASENOTES;发布说明 ABOUT_TAB_SPLASH;启动页 -ADJUSTER_RESET_TO_DEFAULT;单击-恢复默认值\nCtrl+单击-恢复初始值 BATCH_PROCESSING;批量处理 -CURVEEDITOR_AXIS_IN;I: -CURVEEDITOR_AXIS_LEFT_TAN;LT: -CURVEEDITOR_AXIS_OUT;O: -CURVEEDITOR_AXIS_RIGHT_TAN;RT: -CURVEEDITOR_CATMULLROM;灵活 CURVEEDITOR_CURVE;曲线 CURVEEDITOR_CURVES;曲线 CURVEEDITOR_CUSTOM;自定义 CURVEEDITOR_DARKS;暗 -CURVEEDITOR_EDITPOINT_HINT;启用对于节点进/出值的编辑\n\n右击节点以选中\n右击空白处以取消选中节点 CURVEEDITOR_HIGHLIGHTS;高光 CURVEEDITOR_LIGHTS;光 CURVEEDITOR_LINEAR;线性 @@ -30,7 +23,7 @@ CURVEEDITOR_LOADDLGLABEL;加载曲线... CURVEEDITOR_MINMAXCPOINTS;均衡器 CURVEEDITOR_NURBS;控制点 CURVEEDITOR_PARAMETRIC;参数 -CURVEEDITOR_SAVEDLGLABEL;正保存曲线... +CURVEEDITOR_SAVEDLGLABEL;保存曲线... CURVEEDITOR_SHADOWS;阴影 CURVEEDITOR_TOOLTIPCOPY;复制当前曲线到剪贴板 CURVEEDITOR_TOOLTIPLINEAR;重置曲线 @@ -43,8 +36,8 @@ DONT_SHOW_AGAIN;不再显示该信息 DYNPROFILEEDITOR_DELETE;删除 DYNPROFILEEDITOR_EDIT;编辑 DYNPROFILEEDITOR_EDIT_RULE;编辑动态配置规则 -DYNPROFILEEDITOR_ENTRY_TOOLTIP;该项匹配不区分大小写 \n使用 "re:" 前缀来输入\na 正则式 -DYNPROFILEEDITOR_IMGTYPE_ANY;Any +DYNPROFILEEDITOR_ENTRY_TOOLTIP;该项匹配不区分大小写\n使用 "re:" 前缀来输入\n一个正则式 +DYNPROFILEEDITOR_IMGTYPE_ANY;任意 DYNPROFILEEDITOR_IMGTYPE_HDR;HDR DYNPROFILEEDITOR_IMGTYPE_PS;像素偏移 DYNPROFILEEDITOR_IMGTYPE_STD;标准 @@ -54,8 +47,6 @@ DYNPROFILEEDITOR_NEW;新建 DYNPROFILEEDITOR_NEW_RULE;新建动态配置规则 DYNPROFILEEDITOR_PROFILE;处理配置规则 EDITWINDOW_TITLE;图片修改 -EDIT_OBJECT_TOOLTIP;在预览窗口中展示一个允许你调整本工具的widget窗口。 -EDIT_PIPETTE_TOOLTIP;要向曲线添加调整点,点击此按钮,按住Ctrl键并用鼠标左键点击图像预览中你想要的点。\n要调整点的位置,按住Ctrl键并用鼠标左键点击图像预览中的对应位置,然后松开Ctrl(除非你希望精调)同时按住鼠标左键,将鼠标向上/下移动以上下移动曲线中的点。 EXIFFILTER_APERTURE;光圈 EXIFFILTER_CAMERA;相机 EXIFFILTER_EXPOSURECOMPENSATION;曝光补偿值 (EV) @@ -83,14 +74,14 @@ EXIFPANEL_SHOWALL;显示所有 EXIFPANEL_SUBDIRECTORY;子文件夹 EXPORT_BYPASS;要跳过的处理步骤 EXPORT_BYPASS_ALL;选择/取消选择全部选项 -EXPORT_BYPASS_DEFRINGE;跳过去边处理 +EXPORT_BYPASS_DEFRINGE;跳过去除色边处理 EXPORT_BYPASS_DIRPYRDENOISE;跳过降噪处理 EXPORT_BYPASS_DIRPYREQUALIZER;跳过分频反差调整 EXPORT_BYPASS_EQUALIZER;跳过小波层级处理 EXPORT_BYPASS_RAW_CA;跳过 [raw] 色差矫正 -EXPORT_BYPASS_RAW_CCSTEPS;跳过 [raw] 伪色抑制 EXPORT_BYPASS_RAW_DCB_ENHANCE;跳过 [raw] DCB优化步长 EXPORT_BYPASS_RAW_DCB_ITERATIONS;跳过 [raw] DCB迭代 +EXPORT_BYPASS_RAW_CCSTEPS;跳过 [raw] 伪色抑制 EXPORT_BYPASS_RAW_DF;跳过 [raw] 暗场处理 EXPORT_BYPASS_RAW_FF;跳过 [raw] 平场 EXPORT_BYPASS_RAW_GREENTHRESH;跳过 [raw] 绿平衡 @@ -103,7 +94,7 @@ EXPORT_FASTEXPORTOPTIONS;快速导出选项 EXPORT_INSTRUCTIONS;快速导出选项提供跳过占用资源和时间的处理步骤的选项,并使用快速导出设定来进行队列处理。\n此方法推荐在优先追求速度,生成低分辨率图片时使用,或是调整尺寸的输出大小适合你想输出的图片,你又不想修改这些照片的后期处理设定时使用。 EXPORT_MAXHEIGHT;最大高度: EXPORT_MAXWIDTH;最大宽度: -EXPORT_PIPELINE;输出流水线 +EXPORT_PIPELINE;输出流水线 EXPORT_PUTTOQUEUEFAST; 放入快速导出队列 EXPORT_RAW_DMETHOD;去马赛克算法 EXPORT_USE_FAST_PIPELINE;专门(对缩放大小的图片应用全部处理) @@ -115,27 +106,19 @@ FILEBROWSER_APPLYPROFILE;应用配置 FILEBROWSER_APPLYPROFILE_PARTIAL;部分应用配置 FILEBROWSER_AUTODARKFRAME;自动暗场 FILEBROWSER_AUTOFLATFIELD;自动平场 -FILEBROWSER_BROWSEPATHHINT;输入你想前往的路径。\n\n快捷键:\nCtrl-o 让文本框获得焦点\nEnter / Ctrl-Enter 前往输入的目录\nEsc 清除改动\nShift-Esc 让文本框失去焦点\n\n路径快捷键:\n~ - 用户的home/文档路径\n! - 用户的图片路径 FILEBROWSER_CACHE;缓存 -FILEBROWSER_CACHECLEARFROMFULL;清除全部,包括缓存文件 -FILEBROWSER_CACHECLEARFROMPARTIAL;清除全部,不包括缓存文件 FILEBROWSER_CLEARPROFILE;清空 -FILEBROWSER_COLORLABEL_TOOLTIP;颜色标记,\n\n使用下拉菜单或快捷键:\nShift-Ctrl-0 无颜色\nShift-Ctrl-1 红\nShift-Ctrl-2 黄\nShift-Ctrl-3 绿\nShift-Ctrl-4 蓝\nShift-Ctrl-5 紫 FILEBROWSER_COPYPROFILE;复制 FILEBROWSER_CURRENT_NAME;当前名称: FILEBROWSER_DARKFRAME;暗场 -FILEBROWSER_DELETEDIALOG_ALL;你确定要永久删除%1个垃圾桶中的文件吗? FILEBROWSER_DELETEDIALOG_HEADER;删除确认 -FILEBROWSER_DELETEDIALOG_SELECTED;你希望永久删除%1个被选中的文件吗? -FILEBROWSER_DELETEDIALOG_SELECTEDINCLPROC;你希望永久删除%1个被选中的文件, 包括已进行过队列处理的版本吗? FILEBROWSER_EMPTYTRASH;清空垃圾箱 -FILEBROWSER_EMPTYTRASHHINT;永久删除垃圾桶的所有文件 FILEBROWSER_EXTPROGMENU;打开方式 FILEBROWSER_FLATFIELD;平场 FILEBROWSER_MOVETODARKFDIR;移动到暗场路径 FILEBROWSER_MOVETOFLATFIELDDIR;移动到平场路径 FILEBROWSER_NEW_NAME;新名称: -FILEBROWSER_OPENDEFAULTVIEWER;Windows 默认阅览工具 (队列) +FILEBROWSER_OPENDEFAULTVIEWER;Windows默认阅览工具(队列) FILEBROWSER_PARTIALPASTEPROFILE;选择性粘贴 FILEBROWSER_PASTEPROFILE;粘贴 FILEBROWSER_POPUPCANCELJOB;取消任务 @@ -163,15 +146,12 @@ FILEBROWSER_POPUPRANK2;评2星 FILEBROWSER_POPUPRANK3;评3星 FILEBROWSER_POPUPRANK4;评4星 FILEBROWSER_POPUPRANK5;评5星 -FILEBROWSER_POPUPREMOVE;永久删除 -FILEBROWSER_POPUPREMOVEINCLPROC;永久删除,包括队列处理的版本 FILEBROWSER_POPUPRENAME;重命名 FILEBROWSER_POPUPSELECTALL;全部选中 FILEBROWSER_POPUPTRASH;移动到垃圾箱 FILEBROWSER_POPUPUNRANK;取消星级 FILEBROWSER_POPUPUNTRASH;从垃圾箱中移除 FILEBROWSER_QUERYBUTTONHINT;清除搜索队列 -FILEBROWSER_QUERYHINT;输入文件名进行搜索。支持不完整文件名。使用英文逗号分割关键词,例:\n1001,1004,1199\n\n在关键词前面加入!=以排除此关键词,例:\n!=1001,1004,1199\n\n快捷键:\nCtrl-f-让搜索框获得焦点,\nEnter-搜索,\nEsc-清空搜索框,\nShift-Esc-让搜索框失去焦点。 FILEBROWSER_QUERYLABEL; 查找: FILEBROWSER_RANK1_TOOLTIP;评1星\n快捷键:Shift-1 FILEBROWSER_RANK2_TOOLTIP;评2星\n快捷键:Shift-2 @@ -182,28 +162,17 @@ FILEBROWSER_RENAMEDLGLABEL;文件重命名 FILEBROWSER_RESETDEFAULTPROFILE;还原到默认 FILEBROWSER_SELECTDARKFRAME;选择暗场… FILEBROWSER_SELECTFLATFIELD;选择平场… -FILEBROWSER_SHOWCOLORLABEL1HINT;显示被标记为红色的照片\n快捷键:Alt-1 -FILEBROWSER_SHOWCOLORLABEL2HINT;显示被标记为黄色的照片\n快捷键:Alt-2 -FILEBROWSER_SHOWCOLORLABEL3HINT;显示被标记为绿色的照片\n快捷键:Alt-3 -FILEBROWSER_SHOWCOLORLABEL4HINT;显示被标记为蓝色的照片\n快捷键:Alt-4 -FILEBROWSER_SHOWCOLORLABEL5HINT;显示被标记为紫色的照片\n快捷键:Alt-5 FILEBROWSER_SHOWDIRHINT;显示文件夹中所有图片 -FILEBROWSER_SHOWEDITEDHINT;显示已编辑的照片\n快捷键:7 -FILEBROWSER_SHOWEDITEDNOTHINT;显示未编辑的照片\n快捷键:6 FILEBROWSER_SHOWEXIFINFO;显示Exif信息\n\n快捷键:\ni - 多编辑标签页模式, \nAlt-i - 单编辑标签模式 -FILEBROWSER_SHOWNOTTRASHHINT;仅显示未进入垃圾箱的照片 FILEBROWSER_SHOWRANK1HINT;显示1星图片 FILEBROWSER_SHOWRANK2HINT;显示2星图片 FILEBROWSER_SHOWRANK3HINT;显示3星图片 FILEBROWSER_SHOWRANK4HINT;显示4星图片 FILEBROWSER_SHOWRANK5HINT;显示5星图片 -FILEBROWSER_SHOWRECENTLYSAVEDHINT;显示保存的图片\n快捷键: Alt-7 -FILEBROWSER_SHOWRECENTLYSAVEDNOTHINT;显示未保存的图片\n快捷键:Alt-6 +FILEBROWSER_SHOWRECENTLYSAVEDHINT;显示保存的图片\n快捷键:Alt-7 FILEBROWSER_SHOWTRASHHINT;显示垃圾箱内容 -FILEBROWSER_SHOWUNCOLORHINT;显示没有颜色标记的照片\n快捷键:Alt-0 FILEBROWSER_SHOWUNRANKHINT;显示未评星图片 FILEBROWSER_THUMBSIZE;缩略图大小 -FILEBROWSER_UNRANK_TOOLTIP;未评级\n快捷键:Shift-0 FILEBROWSER_ZOOMINHINT;增大缩略图 FILEBROWSER_ZOOMOUTHINT;缩小缩略图 FILECHOOSER_FILTER_ANY;所有文件 @@ -212,7 +181,7 @@ FILECHOOSER_FILTER_CURVE;曲线文件 FILECHOOSER_FILTER_LCP;镜头矫正配置文件 FILECHOOSER_FILTER_PP;处理预设文件 FILECHOOSER_FILTER_SAME;与当前照片格式相同 -FILECHOOSER_FILTER_TIFF;TIFF 文件 +FILECHOOSER_FILTER_TIFF;TIFF文件 GENERAL_ABOUT;关于 GENERAL_AFTER;处理后 GENERAL_APPLY;应用 @@ -221,13 +190,11 @@ GENERAL_AUTO;自动 GENERAL_BEFORE;处理前 GENERAL_CANCEL;取消 GENERAL_CLOSE;关闭 -GENERAL_CURRENT;当前 GENERAL_DISABLE;禁用 GENERAL_DISABLED;禁用 GENERAL_ENABLE;启用 GENERAL_ENABLED;开启 GENERAL_FILE;文件 -GENERAL_HELP;帮助 GENERAL_LANDSCAPE;横向 GENERAL_NA;不适用 GENERAL_NO;否 @@ -235,19 +202,13 @@ GENERAL_NONE;无 GENERAL_OK;确定 GENERAL_OPEN;打开 GENERAL_PORTRAIT;纵向 -GENERAL_RESET;重置 GENERAL_SAVE;保存 -GENERAL_SLIDER;滑条 GENERAL_UNCHANGED;(不改变) GENERAL_WARNING;警告 -GIMP_PLUGIN_INFO;欢迎使用RawTherapee的GIMP插件!\n当你完成编辑后,关闭RawTherapee主窗口,图片就会被自动导入到GIMP中。 HISTOGRAM_TOOLTIP_B;显示/隐藏 蓝色直方图 -HISTOGRAM_TOOLTIP_BAR;显示/隐藏RGB指示条。 -HISTOGRAM_TOOLTIP_CHRO;显示/隐藏色度直方图。 HISTOGRAM_TOOLTIP_G;显示/隐藏 绿色直方图 HISTOGRAM_TOOLTIP_L;显示/隐藏 CIELAB 亮度直方图 HISTOGRAM_TOOLTIP_R;显示/隐藏 红色直方图 -HISTOGRAM_TOOLTIP_RAW;显示/隐藏Raw直方图。 HISTORY_CHANGED;已更改 HISTORY_CUSTOMCURVE;自定义曲线 HISTORY_FROMCLIPBOARD;从剪贴板 @@ -280,7 +241,7 @@ HISTORY_MSG_25;USM锐化-边缘检测半径 HISTORY_MSG_26;USM锐化-边缘容差 HISTORY_MSG_27;USM锐化-光晕控制 HISTORY_MSG_28;USM锐化-光晕控制数量 -HISTORY_MSG_29;锐化-方式 +HISTORY_MSG_29;锐化-方法 HISTORY_MSG_30;RLD-半径 HISTORY_MSG_31;RLD-数量 HISTORY_MSG_32;RLD-衰减 @@ -289,18 +250,18 @@ HISTORY_MSG_34;镜头矫正-畸变 HISTORY_MSG_35;镜头矫正-暗角 HISTORY_MSG_36;镜头矫正-色差 HISTORY_MSG_37;曝光-自动曝光 -HISTORY_MSG_38;白平衡-方式 +HISTORY_MSG_38;白平衡-方法 HISTORY_MSG_39;白平衡-色温 HISTORY_MSG_40;白平衡-色相 HISTORY_MSG_41;曝光-色调曲线1模式 HISTORY_MSG_42;曝光-色调曲线2 HISTORY_MSG_43;曝光-色调曲线2模式 -HISTORY_MSG_44;亮度噪点降低 半径 -HISTORY_MSG_45;亮度噪点降低 边缘容差 +HISTORY_MSG_44;亮度降噪-半径 +HISTORY_MSG_45;亮度降噪-边缘容差 HISTORY_MSG_46;色度降噪 -HISTORY_MSG_47;色度降噪半径 -HISTORY_MSG_48;色度降噪边缘容差 -HISTORY_MSG_49;色度降噪边缘敏感度 +HISTORY_MSG_47;色度降噪-半径 +HISTORY_MSG_48;色度降噪-边缘容差 +HISTORY_MSG_49;色度降噪-边缘敏感度 HISTORY_MSG_50;阴影/高光工具 HISTORY_MSG_51;阴影/高光-高光增强 HISTORY_MSG_52;阴影/高光-阴影增强 @@ -315,18 +276,18 @@ HISTORY_MSG_60;旋转 HISTORY_MSG_61;自动填充 HISTORY_MSG_62;镜头畸变矫正 HISTORY_MSG_63;选择快照 -HISTORY_MSG_64;裁切 +HISTORY_MSG_64;裁剪 HISTORY_MSG_65;色差矫正 HISTORY_MSG_66;曝光-高光还原 HISTORY_MSG_67;曝光-高光还原数量 -HISTORY_MSG_68;曝光-高光还原方式 +HISTORY_MSG_68;曝光-高光还原方法 HISTORY_MSG_69;工作色彩空间 HISTORY_MSG_70;输出色彩空间 HISTORY_MSG_71;输入色彩空间 HISTORY_MSG_72;暗角矫正 HISTORY_MSG_73;通道混合器 HISTORY_MSG_74;调整大小-比例 -HISTORY_MSG_75;调整大小-方式 +HISTORY_MSG_75;调整大小-方法 HISTORY_MSG_76;Exif元数据 HISTORY_MSG_77;IPTC元数据 HISTORY_MSG_78;调整大小数据 @@ -337,37 +298,14 @@ HISTORY_MSG_82;档案修改 HISTORY_MSG_83;阴影/高光-锐度蒙板 HISTORY_MSG_84;视角矫正 HISTORY_MSG_85;镜头矫正-LCP档案 -HISTORY_MSG_86;RGB曲线-色度模式 -HISTORY_MSG_87;脉冲噪声降低 -HISTORY_MSG_88;脉冲降噪阈值 HISTORY_MSG_89;降噪 HISTORY_MSG_90;降噪-亮度 HISTORY_MSG_92;降噪-伽马 -HISTORY_MSG_95;L*a*b*-色度 -HISTORY_MSG_96;L*a*b*-a* 曲线 -HISTORY_MSG_97;L*a*b*-b* 曲线 -HISTORY_MSG_98;去马赛克方法 -HISTORY_MSG_99;热像素过滤器 -HISTORY_MSG_100;曝光-饱和度 -HISTORY_MSG_101;HSV-色度(Hue) -HISTORY_MSG_102;HSV-饱和度(Saturation) HISTORY_MSG_103;HSV-数值 -HISTORY_MSG_104;HSV均衡器 -HISTORY_MSG_105;去色彩边缘 -HISTORY_MSG_106;去边-半径 -HISTORY_MSG_107;去边-阈值 -HISTORY_MSG_109;调整大小-边界限制方块 -HISTORY_MSG_110;调整大小-应用到 HISTORY_MSG_111;Lab-避免色彩偏移 HISTORY_MSG_113;Lab-保护 HISTORY_MSG_114;DCB 迭代 -HISTORY_MSG_115;伪色抑制 -HISTORY_MSG_116;DCB增强 -HISTORY_MSG_117;Raw色差修正-红 -HISTORY_MSG_118;Raw色差修正-蓝 HISTORY_MSG_119;线状噪点过滤器 -HISTORY_MSG_120;绿平衡 -HISTORY_MSG_121;Raw色差修正-自动 HISTORY_MSG_122;自动暗场 HISTORY_MSG_123;暗场文件 HISTORY_MSG_124;线性曝光修正 @@ -376,49 +314,15 @@ HISTORY_MSG_127;平场自动选择 HISTORY_MSG_128;平场模糊半径 HISTORY_MSG_129;平场模糊类型 HISTORY_MSG_130;自动扭曲纠正 -HISTORY_MSG_131;降噪-亮度 -HISTORY_MSG_132;降噪-色度 -HISTORY_MSG_144;微反差-数量 -HISTORY_MSG_145;微反差-均匀度 HISTORY_MSG_146;边缘锐化 HISTORY_MSG_147;边缘锐化-单纯亮度 -HISTORY_MSG_148;微反差 -HISTORY_MSG_149;微反差-3×3阵列 HISTORY_MSG_155;Vib-避免色彩偏移 HISTORY_MSG_158;力度 HISTORY_MSG_159;边缘停止 HISTORY_MSG_160;拉伸 HISTORY_MSG_162;色调映射 -HISTORY_MSG_163;RGB曲线-红 -HISTORY_MSG_164;RGB曲线-绿 -HISTORY_MSG_165;RGB曲线-蓝 -HISTORY_MSG_166;曝光-重置 -HISTORY_MSG_167;去马赛克方法 -HISTORY_MSG_168;L*a*b*-CC曲线 -HISTORY_MSG_169;L*a*b*-CH曲线 -HISTORY_MSG_171;L*a*b*-LC曲线 -HISTORY_MSG_172;L*a*b*-限制LC -HISTORY_MSG_173;降噪-细节恢复 HISTORY_MSG_174;CIECAM02 -HISTORY_MSG_180;CAM02-亮度 (J) -HISTORY_MSG_181;CAM02-色度 (C) HISTORY_MSG_183;CAM02-对比度 (J) -HISTORY_MSG_186;CAM02-算法 -HISTORY_MSG_187;CAM02-红色/肤色保护 -HISTORY_MSG_188;CAM02-亮度 (Q) -HISTORY_MSG_189;CAM02-对比度 (Q) -HISTORY_MSG_190;CAM02-饱和度 (S) -HISTORY_MSG_191;CAM02-色彩丰富度 (M) -HISTORY_MSG_192;CAM02-色度 (h) -HISTORY_MSG_193;CAM02-色调曲线1 -HISTORY_MSG_194;CAM02-色调曲线2 -HISTORY_MSG_195;CAM02-色调曲线1 -HISTORY_MSG_196;CAM02-色调曲线2 -HISTORY_MSG_200;CAM02-色调映射 -HISTORY_MSG_203;降噪-色彩空间 -HISTORY_MSG_204;LMMSE优化步长 -HISTORY_MSG_205;CAM02-热像素/坏点过滤器 -HISTORY_MSG_207;去边-色度曲线 HISTORY_MSG_210;渐变-角度 HISTORY_MSG_211;渐变滤镜 HISTORY_MSG_212;暗角-力度 @@ -426,100 +330,10 @@ HISTORY_MSG_213;暗角滤镜 HISTORY_MSG_239;GF-力度 HISTORY_MSG_244;暗角矫正-力度 HISTORY_MSG_245;暗角矫正-中心 -HISTORY_MSG_246;L*a*b*-CL曲线 -HISTORY_MSG_247;L*a*b*-LH曲线 -HISTORY_MSG_248;L*a*b*-HH曲线 -HISTORY_MSG_255;降噪-中值滤波器 -HISTORY_MSG_256;降噪-中值滤波器-方法 -HISTORY_MSG_285;降噪-中值滤波-方法 -HISTORY_MSG_286;降噪-中值滤波-类型 -HISTORY_MSG_287;降噪-中值滤波-迭代 -HISTORY_MSG_288;平场-溢出控制 -HISTORY_MSG_289;平场-溢出控制-自动 -HISTORY_MSG_293;胶片模拟 -HISTORY_MSG_294;胶片模拟-力度 -HISTORY_MSG_295;胶片模拟-胶片 -HISTORY_MSG_296;降噪-亮度曲线 -HISTORY_MSG_297;降噪-模式 -HISTORY_MSG_298;坏点过滤器 -HISTORY_MSG_299;降噪-色度曲线 -HISTORY_MSG_305;小波层级 -HISTORY_MSG_371;调整大小后加锐(PRS) -HISTORY_MSG_372;PRS USM-半径 -HISTORY_MSG_373;PRS USM-数量 -HISTORY_MSG_374;PRS USM-阈值 -HISTORY_MSG_375;PRS USM-仅加锐边缘 -HISTORY_MSG_376;PRS USM-边缘检测半径 -HISTORY_MSG_377;PRS USM-Edge tolerance -HISTORY_MSG_378;PRS USM-光晕控制 -HISTORY_MSG_379;PRS USM-光晕控制数量 -HISTORY_MSG_380;PRS-方法 -HISTORY_MSG_381;PRS RLD-半径 -HISTORY_MSG_382;PRS RLD-数量 -HISTORY_MSG_383;PRS RLD-衰减 -HISTORY_MSG_384;PRS RLD-迭代 -HISTORY_MSG_445;Raw子图像 -HISTORY_MSG_449;像素偏移-ISO适应 -HISTORY_MSG_452;像素偏移-显示动体 -HISTORY_MSG_453;像素偏移-仅显示动体蒙版 -HISTORY_MSG_457;像素偏移-检测红/蓝 -HISTORY_MSG_462;像素偏移-检测绿 -HISTORY_MSG_464;像素偏移-动体蒙版模糊 -HISTORY_MSG_465;像素偏移-模糊半径 -HISTORY_MSG_468;像素偏移-填洞 -HISTORY_MSG_469;像素偏移-中值 -HISTORY_MSG_471;像素偏移-动体补正 -HISTORY_MSG_472;像素偏移-顺滑过渡 -HISTORY_MSG_473;像素偏移-使用LMMSE -HISTORY_MSG_474;像素偏移-亮度均等 -HISTORY_MSG_475;像素偏移-均等各通道 -HISTORY_MSG_485;镜头矫正 -HISTORY_MSG_486;镜头矫正-相机 -HISTORY_MSG_487;镜头矫正-镜头 -HISTORY_MSG_488;动态范围压缩(DRC) -HISTORY_MSG_491;白平衡 -HISTORY_MSG_492;RGB曲线 -HISTORY_MSG_493;L*a*b*调整 -HISTORY_MSG_494;捕图锐化 -HISTORY_MSG_DEHAZE_ENABLED;去雾 -HISTORY_MSG_DEHAZE_STRENGTH;去雾-力度 -HISTORY_MSG_DUALDEMOSAIC_AUTO_CONTRAST;双重去马赛克-自动阈值 -HISTORY_MSG_DUALDEMOSAIC_CONTRAST;双重去马赛克-对比度阈值 -HISTORY_MSG_FILMNEGATIVE_ENABLED;胶片负片 -HISTORY_MSG_HISTMATCHING;自适应色调曲线 -HISTORY_MSG_LOCALCONTRAST_AMOUNT;局部反差-数量 -HISTORY_MSG_LOCALCONTRAST_DARKNESS;局部反差-黑处 -HISTORY_MSG_LOCALCONTRAST_ENABLED;局部反差 -HISTORY_MSG_LOCALCONTRAST_LIGHTNESS;局部反差-亮处 -HISTORY_MSG_LOCALCONTRAST_RADIUS;局部反差-半径 -HISTORY_MSG_METADATA_MODE;元数据复制模式 -HISTORY_MSG_MICROCONTRAST_CONTRAST;微反差-反差阈值 -HISTORY_MSG_PDSHARPEN_AUTO_CONTRAST;捕图锐化-自动阈值 -HISTORY_MSG_PDSHARPEN_AUTO_RADIUS;捕图锐化-自动半径 -HISTORY_MSG_PDSHARPEN_CHECKITER;捕图锐化-自动限制迭代 -HISTORY_MSG_PDSHARPEN_CONTRAST;捕图锐化-反差阈值 -HISTORY_MSG_PDSHARPEN_ITERATIONS;捕图锐化-迭代 -HISTORY_MSG_PDSHARPEN_RADIUS;捕图锐化-半径 -HISTORY_MSG_PDSHARPEN_RADIUS_BOOST;捕图锐化-边缘半径值提升 -HISTORY_MSG_PIXELSHIFT_DEMOSAIC;像素偏移-动体部分去马赛克算法 -HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;线状噪点过滤方向 -HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF条纹过滤 -HISTORY_MSG_PRSHARPEN_CONTRAST;PRS-反差阈值 -HISTORY_MSG_RAWCACORR_AUTOIT;Raw色差矫正-迭代 -HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw色差矫正-避免色偏 -HISTORY_MSG_RAW_BORDER;Raw边界 -HISTORY_MSG_RESIZE_ALLOWUPSCALING;调整大小-允许升采样 -HISTORY_MSG_SHARPENING_BLUR;加锐-模糊半径 -HISTORY_MSG_SHARPENING_CONTRAST;加锐-反差阈值 -HISTORY_MSG_SH_COLORSPACE;阴影/高光-色彩空间 HISTORY_NEWSNAPSHOT;新建快照 HISTORY_NEWSNAPSHOT_TOOLTIP;快捷键:Alt-s HISTORY_SNAPSHOT;快照 HISTORY_SNAPSHOTS;快照 -ICCPROFCREATOR_COPYRIGHT;版权: -ICCPROFCREATOR_CUSTOM;自定义 -ICCPROFCREATOR_DESCRIPTION;描述: -ICCPROFCREATOR_SAVEDIALOG_TITLE;将ICC档案保存为…… IPTCPANEL_CATEGORY;类别 IPTCPANEL_CITY;城市 IPTCPANEL_COPYHINT;将IPTC设置复制到剪贴板 @@ -539,22 +353,21 @@ IPTCPANEL_SOURCE;来源 IPTCPANEL_TITLE;标题 MAIN_BUTTON_FULLSCREEN;全屏 MAIN_BUTTON_PREFERENCES;参数设置 -MAIN_BUTTON_PUTTOQUEUE_TOOLTIP;将当前图片放入处理队列中\n快捷键: Ctrl+b +MAIN_BUTTON_PUTTOQUEUE_TOOLTIP;将当前图片放入处理队列中\n快捷键:Ctrl+b MAIN_BUTTON_SAVE;保存图片 MAIN_BUTTON_SAVE_TOOLTIP;保存当前图像 \n快捷键:Ctrl+S MAIN_BUTTON_SENDTOEDITOR;发送到编辑器 MAIN_BUTTON_SENDTOEDITOR_TOOLTIP;使用外部工具编辑当前图像 \n快捷键:Ctrl+E -MAIN_BUTTON_SHOWHIDESIDEPANELS_TOOLTIP;显示/隐藏全部侧边栏\n快捷键: m +MAIN_BUTTON_SHOWHIDESIDEPANELS_TOOLTIP;显示/隐藏全部侧边栏\n快捷键:m MAIN_BUTTON_UNFULLSCREEN;退出全屏 MAIN_FRAME_EDITOR;编辑器 -MAIN_FRAME_EDITOR_TOOLTIP;编辑器.\n快捷键: Ctrl-F4 +MAIN_FRAME_EDITOR_TOOLTIP;编辑器.\n快捷键:Ctrl-F4 MAIN_FRAME_FILEBROWSER;文件浏览器 -MAIN_FRAME_FILEBROWSER_TOOLTIP;文件浏览器\n快捷键: Ctrl-F2 +MAIN_FRAME_FILEBROWSER_TOOLTIP;文件浏览器\n快捷键:Ctrl-F2 MAIN_FRAME_PLACES;位置 MAIN_FRAME_PLACES_ADD;添加 -MAIN_FRAME_PLACES_DEL;移除 MAIN_FRAME_QUEUE;批处理队列 -MAIN_FRAME_QUEUE_TOOLTIP;处理队列\n快捷键: Ctrl-F3 +MAIN_FRAME_QUEUE_TOOLTIP;处理队列\n快捷键:Ctrl-F3 MAIN_FRAME_RECENT;最近使用的文件夹 MAIN_MSG_ALREADYEXISTS;该文件已存在 MAIN_MSG_CANNOTLOAD;无法加载图片 @@ -565,20 +378,17 @@ MAIN_MSG_EMPTYFILENAME;未指定文件名! MAIN_MSG_NAVIGATOR;导航器 MAIN_MSG_OPERATIONCANCELLED;取消 MAIN_MSG_QOVERWRITE;是否覆盖? -MAIN_TAB_ADVANCED;高级 -MAIN_TAB_ADVANCED_TOOLTIP;快捷键:Alt-a MAIN_TAB_COLOR;色彩 MAIN_TAB_COLOR_TOOLTIP;快捷键:Alt-c MAIN_TAB_DETAIL;细节 -MAIN_TAB_DETAIL_TOOLTIP;快捷键: Alt-d -MAIN_TAB_DEVELOP;图片调整 +MAIN_TAB_DETAIL_TOOLTIP;快捷键:Alt-d +MAIN_TAB_DEVELOP;批量调整 MAIN_TAB_EXIF;Exif -MAIN_TAB_EXPORT; 快速导出 +MAIN_TAB_EXPORT;快速导出 MAIN_TAB_EXPOSURE;曝光 MAIN_TAB_EXPOSURE_TOOLTIP;快捷键:Alt-e -MAIN_TAB_FAVORITES_TOOLTIP;快捷键: Alt-u MAIN_TAB_FILTER;过滤器 -MAIN_TAB_INSPECT; 检阅 +MAIN_TAB_INSPECT;检阅 MAIN_TAB_IPTC;IPTC MAIN_TAB_METADATA;元数据 MAIN_TAB_METADATA_TOOLTIP;快捷键:Alt-m @@ -586,22 +396,16 @@ MAIN_TAB_RAW;Raw MAIN_TAB_RAW_TOOLTIP;快捷键:Alt-R MAIN_TAB_TRANSFORM;变换 MAIN_TAB_TRANSFORM_TOOLTIP;快捷键:Alt-t -MAIN_TOOLTIP_HIDEHP;显示/隐藏左面板 (包含历史, 快捷键: H) +MAIN_TOOLTIP_HIDEHP;显示/隐藏左面板 (包含历史, 快捷键:H) MAIN_TOOLTIP_INDCLIPPEDH;高光溢出提示 MAIN_TOOLTIP_INDCLIPPEDS;阴影不足提示 -MAIN_TOOLTIP_PREVIEWB;预览蓝色通道\n快捷键:b -MAIN_TOOLTIP_PREVIEWFOCUSMASK;预览合焦蒙版\n快捷键:Shift-f\n\n在浅景深,噪点少,放大得大的图片中更加精准\n在噪点多的图像中,把图片缩放到10%-30%以提升检测精准度。 -MAIN_TOOLTIP_PREVIEWG;预览绿色通道\n快捷键:g -MAIN_TOOLTIP_PREVIEWL;预览亮度\n快捷键:v\n\n0.299*R + 0.587*G + 0.114*B -MAIN_TOOLTIP_PREVIEWR;预览红色通道\n快捷键: r -MAIN_TOOLTIP_PREVIEWSHARPMASK;预览加锐反差蒙版\n快捷键:p -MAIN_TOOLTIP_QINFO;图片快捷信息 -MAIN_TOOLTIP_SHOWHIDELP1;显示/隐藏左面板\n快捷键: l -MAIN_TOOLTIP_SHOWHIDERP1;显示/隐藏右面板\n快捷键: Alt-l -MAIN_TOOLTIP_SHOWHIDETP1;显示/隐藏上面板\n快捷键: Shift-L +MAIN_TOOLTIP_PREVIEWR;预览红色通道\n快捷键:r +MAIN_TOOLTIP_QINFO;图片简短信息 +MAIN_TOOLTIP_SHOWHIDELP1;显示/隐藏左面板\n快捷键:l +MAIN_TOOLTIP_SHOWHIDERP1;显示/隐藏右面板\n快捷键:Alt-l +MAIN_TOOLTIP_SHOWHIDETP1;显示/隐藏上面板\n快捷键:Shift-L MAIN_TOOLTIP_THRESHOLD;阈值 -MAIN_TOOLTIP_TOGGLE;切换 处理前/处理后视图\n快捷键: Shift-b -MONITOR_PROFILE_SYSTEM;系统默认 +MAIN_TOOLTIP_TOGGLE;切换 处理前/处理后视图\n快捷键:Shift-b NAVIGATOR_B;B: NAVIGATOR_G;G: NAVIGATOR_H;H: @@ -614,7 +418,6 @@ NAVIGATOR_S;S: NAVIGATOR_V;V: NAVIGATOR_XY_FULL;宽 = %1, 高 = %2 NAVIGATOR_XY_NA;x = n/a, y = n/a -PARTIALPASTE_ADVANCEDGROUP;高级设置 PARTIALPASTE_BASICGROUP;基本设置 PARTIALPASTE_CACORRECTION;色彩矫正 PARTIALPASTE_CHANNELMIXER;通道混合器 @@ -625,11 +428,10 @@ PARTIALPASTE_COLORGROUP;色彩相关设定 PARTIALPASTE_COLORTONING;色调 PARTIALPASTE_COMMONTRANSFORMPARAMS;自动填充 PARTIALPASTE_COMPOSITIONGROUP;构图设置 -PARTIALPASTE_CROP;剪裁 +PARTIALPASTE_CROP;裁剪 PARTIALPASTE_DARKFRAMEAUTOSELECT;暗场自动选择 PARTIALPASTE_DARKFRAMEFILE;暗场文件 -PARTIALPASTE_DEFRINGE;去边 -PARTIALPASTE_DEHAZE;去雾 +PARTIALPASTE_DEFRINGE;去除色边 PARTIALPASTE_DETAILGROUP;细节设置 PARTIALPASTE_DIALOGLABEL;选择性粘贴配置 PARTIALPASTE_DIRPYRDENOISE;降噪 @@ -640,7 +442,6 @@ PARTIALPASTE_EQUALIZER;小波变换层级 PARTIALPASTE_EVERYTHING;全部 PARTIALPASTE_EXIFCHANGES;对exif所做的修改 PARTIALPASTE_EXPOSURE;曝光 -PARTIALPASTE_FILMNEGATIVE;胶片负片 PARTIALPASTE_FILMSIMULATION;胶片模拟 PARTIALPASTE_FLATFIELDAUTOSELECT;平场自动选择 PARTIALPASTE_FLATFIELDBLURRADIUS;平场模糊半径 @@ -655,7 +456,6 @@ PARTIALPASTE_IPTCINFO;IPTC 信息 PARTIALPASTE_LABCURVE;Lab调整 PARTIALPASTE_LENSGROUP;镜头相关设置 PARTIALPASTE_LENSPROFILE;镜片修正档案 -PARTIALPASTE_LOCALCONTRAST;局部反差 PARTIALPASTE_METAGROUP;元数据 PARTIALPASTE_PCVIGNETTE;暗角滤镜 PARTIALPASTE_PERSPECTIVE;视角 @@ -663,14 +463,12 @@ PARTIALPASTE_PREPROCESS_DEADPIXFILT;坏点过滤器 PARTIALPASTE_PREPROCESS_GREENEQUIL;绿平衡 PARTIALPASTE_PREPROCESS_HOTPIXFILT;热噪过滤器 PARTIALPASTE_PREPROCESS_LINEDENOISE;线状噪点过滤 -PARTIALPASTE_PREPROCESS_PDAFLINESFILTER;PDAF条带过滤器 PARTIALPASTE_PRSHARPENING;调整大小后锐化 PARTIALPASTE_RAWCACORR_AUTO;色差自动矫正 PARTIALPASTE_RAWCACORR_CAREDBLUE;红蓝色差 PARTIALPASTE_RAWEXPOS_BLACK;黑色等级 PARTIALPASTE_RAWEXPOS_LINEAR;白点纠正 PARTIALPASTE_RAWGROUP;Raw设置 -PARTIALPASTE_RAW_BORDER;Raw边界 PARTIALPASTE_RAW_DCBENHANCE;DCB增强 PARTIALPASTE_RAW_DCBITERATIONS;DCB迭代 PARTIALPASTE_RAW_DMETHOD;去马赛克方法 @@ -679,71 +477,53 @@ PARTIALPASTE_RAW_IMAGENUM;子图像 PARTIALPASTE_RAW_LMMSEITERATIONS;LMMSE优化步长 PARTIALPASTE_RAW_PIXELSHIFT;像素偏移 PARTIALPASTE_RESIZE;调整大小 -PARTIALPASTE_RETINEX;Retinex +!PARTIALPASTE_RETINEX;Retinex PARTIALPASTE_RGBCURVES;RGB曲线 PARTIALPASTE_ROTATION;旋转 PARTIALPASTE_SHADOWSHIGHLIGHTS;阴影/高光 PARTIALPASTE_SHARPENEDGE;边缘 PARTIALPASTE_SHARPENING;锐化 -PARTIALPASTE_SHARPENMICRO;微对比度 -PARTIALPASTE_TM_FATTAL;动态范围压缩 +PARTIALPASTE_SHARPENMICRO;微反差 PARTIALPASTE_VIBRANCE;鲜艳度 PARTIALPASTE_VIGNETTING;暗角矫正 PARTIALPASTE_WHITEBALANCE;白平衡 -PREFERENCES_ADD;添加 -PREFERENCES_APPEARANCE;外观 -PREFERENCES_APPEARANCE_CROPMASKCOLOR;裁剪蒙版颜色 -PREFERENCES_APPEARANCE_MAINFONT;主字体 +PREFERENCES_ADD;相加 PREFERENCES_APPEARANCE_NAVGUIDECOLOR;导航器图框颜色 -PREFERENCES_APPEARANCE_PSEUDOHIDPI;伪-高DPI模式 -PREFERENCES_APPEARANCE_THEME;主题 PREFERENCES_APPLNEXTSTARTUP;下次启动生效 PREFERENCES_AUTOMONPROFILE;使用操作系统主显示器的色彩档案 -PREFERENCES_AUTOSAVE_TP_OPEN;在退出时保存工具的展开/折叠状态 PREFERENCES_BATCH_PROCESSING;批处理 -PREFERENCES_BEHADDALL;全 “添加” +PREFERENCES_BEHADDALL;全 “相加” PREFERENCES_BEHAVIOR;行为 PREFERENCES_BEHSETALL;全“ 设定” -PREFERENCES_BEHSETALLHINT;将所有选项设为设定模式\n批处理栏的处理参数将是a绝对值,数值会被显示。 -PREFERENCES_CACHECLEAR;清空 -PREFERENCES_CACHECLEAR_ALL;清空所有缓存文件: PREFERENCES_CACHEMAXENTRIES;最大缓存数量 PREFERENCES_CACHEOPTS;缓存选项 PREFERENCES_CACHETHUMBHEIGHT;最大缩略图高度 -PREFERENCES_CHUNKSIZE_RAW_AMAZE;AMaZE去马赛克 -PREFERENCES_CHUNKSIZE_RAW_CA;Raw色差矫正 -PREFERENCES_CHUNKSIZE_RAW_RCD;RCD去马赛克 -PREFERENCES_CHUNKSIZE_RGB;RGB处理 PREFERENCES_CLIPPINGIND;高光溢出提示 PREFERENCES_CLUTSCACHE;HaldCLUT缓存 PREFERENCES_CLUTSCACHE_LABEL;CLUT最大缓存数 PREFERENCES_CLUTSDIR;HaldCLUT路径 PREFERENCES_CMMBPC;黑场补偿 -PREFERENCES_CROP;裁切编辑 -PREFERENCES_CROP_AUTO_FIT;自动放大以适应裁剪 PREFERENCES_CURVEBBOXPOS;曲线复制/粘贴按钮位置 PREFERENCES_CURVEBBOXPOS_ABOVE;上 PREFERENCES_CURVEBBOXPOS_BELOW;下 PREFERENCES_CURVEBBOXPOS_LEFT;左 PREFERENCES_CURVEBBOXPOS_RIGHT;右 -PREFERENCES_CUSTPROFBUILD;Custom Processing Profile Builder -PREFERENCES_CUSTPROFBUILDKEYFORMAT;Keys format -PREFERENCES_CUSTPROFBUILDKEYFORMAT_NAME;Name -PREFERENCES_CUSTPROFBUILDKEYFORMAT_TID;TagID +!PREFERENCES_CUSTPROFBUILD;Custom Processing Profile Builder +!PREFERENCES_CUSTPROFBUILDKEYFORMAT;Keys format +!PREFERENCES_CUSTPROFBUILDKEYFORMAT_NAME;Name +!PREFERENCES_CUSTPROFBUILDKEYFORMAT_TID;TagID PREFERENCES_CUSTPROFBUILDPATH;可执行文件路径 PREFERENCES_DARKFRAMEFOUND;找到 PREFERENCES_DARKFRAMESHOTS;张 PREFERENCES_DARKFRAMETEMPLATES;模板 PREFERENCES_DATEFORMAT;日期格式 -PREFERENCES_DATEFORMATHINT;可以使用下列控制符:\n%y : 年\n%m : 月h\n%d : 日\n\n例如, 中文日期格式:\n%y/%m/%d +PREFERENCES_DATEFORMATHINT;你可以使用下列控制符:\n%y : 年\n%m : 月h\n%d : 日\n\n例如, 中文日期格式:\n%y/%m/%d PREFERENCES_DIRDARKFRAMES;暗场图像路径 -PREFERENCES_DIRECTORIES;目录 PREFERENCES_DIRHOME;用户文件路径 PREFERENCES_DIRLAST;上次访问路径 PREFERENCES_DIROTHER;其他 PREFERENCES_DIRSELECTDLG;启动时选择图片路径... PREFERENCES_DIRSOFTWARE;软件安装路径 -PREFERENCES_EDITORCMDLINE;自定义命令行 PREFERENCES_EDITORLAYOUT;编辑器布局 PREFERENCES_EXTERNALEDITOR;外部编辑器 PREFERENCES_FBROWSEROPTS;文件浏览器选项 @@ -753,8 +533,8 @@ PREFERENCES_FLATFIELDSHOTS;张 PREFERENCES_FLATFIELDTEMPLATES;模板 PREFERENCES_FORIMAGE;用于图片文件 PREFERENCES_FORRAW;用于Raw文件 -PREFERENCES_FSTRIP_SAME_THUMB_HEIGHT;Same thumbnail height between the Filmstrip and the File Browser -PREFERENCES_FSTRIP_SAME_THUMB_HEIGHT_HINT;Having separate thumbnail size will require more processing time each time you'll switch between the single Editor tab and the File Browser. +!PREFERENCES_FSTRIP_SAME_THUMB_HEIGHT;Same thumbnail height between the Filmstrip and the File Browser +!PREFERENCES_FSTRIP_SAME_THUMB_HEIGHT_HINT;Having separate thumbnail size will require more processing time each time you'll switch between the single Editor tab and the File Browser. PREFERENCES_GIMPPATH;GIMP安装文件夹 PREFERENCES_HISTOGRAMPOSITIONLEFT;将直方图放置在左面板 PREFERENCES_HISTOGRAM_TOOLTIP;启用后,当前使用的后期配置档案将被用于渲染主直方图和导航栏,不启用则将使用伽马矫正的输出档案进行渲染。 @@ -763,12 +543,12 @@ PREFERENCES_ICCDIR;ICC配置路径 PREFERENCES_IMPROCPARAMS;默认图片处理参数 PREFERENCES_INSPECT_LABEL;查看 PREFERENCES_INSPECT_MAXBUFFERS_LABEL;最大缓存图片数 -PREFERENCES_INSPECT_MAXBUFFERS_TOOLTIP;Set the maximum number of images stored in cache when hovering over them in the File Browser; systems with little RAM (2GB) should keep this value set to 1 or 2. +!PREFERENCES_INSPECT_MAXBUFFERS_TOOLTIP;Set the maximum number of images stored in cache when hovering over them in the File Browser; systems with little RAM (2GB) should keep this value set to 1 or 2. PREFERENCES_INTENT_ABSOLUTE;绝对比色 PREFERENCES_INTENT_PERCEPTUAL;可感知 PREFERENCES_INTENT_RELATIVE;相对比色 PREFERENCES_INTENT_SATURATION;饱和度 -PREFERENCES_INTERNALTHUMBIFUNTOUCHED;如果RAW文件没有修改, 显示内嵌JPEG缩略图 +PREFERENCES_INTERNALTHUMBIFUNTOUCHED;如果RAW文件没有修改, 显示内嵌JPEG的缩略图 PREFERENCES_LANG;语言 PREFERENCES_LANGAUTODETECT;使用系统语言 PREFERENCES_MAXRECENTFOLDERS;最近访问路径历史记录数 @@ -785,18 +565,16 @@ PREFERENCES_MONPROFILE_WARNOSX;受MacOS限制, 仅支持sRGB PREFERENCES_MULTITAB;多编辑器标签模式 PREFERENCES_MULTITABDUALMON;多编辑器,编辑器标签独立模式 PREFERENCES_NAVIGATIONFRAME;导航器 -PREFERENCES_OVERLAY_FILENAMES;Overlay filenames on thumbnails in the file browser -PREFERENCES_OVERLAY_FILENAMES_FILMSTRIP;Overlay filenames on thumbnails in the editor pannel -PREFERENCES_OVERWRITEOUTPUTFILE;Overwrite existing output files +PREFERENCES_OVERLAY_FILENAMES;在文件浏览器中显示紧凑的工具栏 +!PREFERENCES_OVERLAY_FILENAMES_FILMSTRIP;Overlay filenames on thumbnails in the editor pannel +!PREFERENCES_OVERWRITEOUTPUTFILE;Overwrite existing output files PREFERENCES_PANFACTORLABEL;拖移速率增幅 PREFERENCES_PARSEDEXT;已知扩展名 PREFERENCES_PARSEDEXTADD;添加扩展名 PREFERENCES_PARSEDEXTADDHINT;输入扩展名并按此按钮将其添加至列表 PREFERENCES_PARSEDEXTDELHINT;从列表中删除选中的扩展名 -PREFERENCES_PARSEDEXTDOWNHINT;让选中的插件在列表中的位置下降。 -PREFERENCES_PARSEDEXTUPHINT;让选中的插件在列表中的位置上升。 -PREFERENCES_PERFORMANCE_THREADS;线程 -PREFERENCES_PERFORMANCE_THREADS_LABEL;用于降噪和小波层级的最大线程数(0=自动) +PREFERENCES_PARSEDEXTDOWNHINT;让选中的扩展名在列表中的位置下降 +PREFERENCES_PARSEDEXTUPHINT;让选中的扩展名在列表中的位置上升 PREFERENCES_PREVDEMO;预览去马赛克方法 PREFERENCES_PREVDEMO_FAST;快速 PREFERENCES_PREVDEMO_LABEL;小于100%缩放查看时使用的去马赛克算法: @@ -807,7 +585,7 @@ PREFERENCES_PROFILELOADPR;配置文件读取优先级 PREFERENCES_PROFILEPRCACHE;缓存中的配置文件 PREFERENCES_PROFILEPRFILE;图片所在位置的配置文件 PREFERENCES_PROFILESAVEBOTH;将配置文件存放到缓存和输入图片所在位置 -PREFERENCES_PROFILESAVECACHE;将配置文件存放缓存 +PREFERENCES_PROFILESAVECACHE;将配置文件存放到缓存 PREFERENCES_PROFILESAVEINPUT;将配置文件与图片并列存放 PREFERENCES_PROFILESAVELOCATION;将配置文件存放到缓存和输入图片所在位置 PREFERENCES_PROFILE_NONE;无 @@ -816,21 +594,20 @@ PREFERENCES_PRTINTENT;渲染意图 PREFERENCES_PRTPROFILE;色彩配置文件 PREFERENCES_PSPATH;Adobe Photoshop安装路径 PREFERENCES_REMEMBERZOOMPAN;记忆图片的缩放和拖动位置 -PREFERENCES_REMEMBERZOOMPAN_TOOLTIP;Remember the zoom % and pan offset of the current image when opening a new image.\n\nThis option only works in "Single Editor Tab Mode" and when "Demosaicing method used for the preview at <100% zoom" is set to "As in PP3". -PREFERENCES_SAVE_TP_OPEN_NOW;保存工具的展开/折叠状态 +PREFERENCES_REMEMBERZOOMPAN_TOOLTIP;当打开新图片时,记忆上一张图片放大的百分比和被拖动到的位置。\n\n这个选项仅在使用“单编辑器模式”且“小于100%缩放查看时使用的去马赛克方法”被设为“与PP3相同”时才有效 PREFERENCES_SELECTLANG;选择语言 -PREFERENCES_SERIALIZE_TIFF_READ;TIFF 读取设定 +PREFERENCES_SERIALIZE_TIFF_READ;TIFF读取设定 PREFERENCES_SERIALIZE_TIFF_READ_LABEL;连续载入TIFF文件 PREFERENCES_SERIALIZE_TIFF_READ_TOOLTIP;开启后可以提高在无压缩TIFF图片文件夹中的缩略图生成速度 PREFERENCES_SET;设定 PREFERENCES_SHOWBASICEXIF;显示基本Exif信息 PREFERENCES_SHOWDATETIME;显示时间日期 -PREFERENCES_SHOWEXPOSURECOMPENSATION;附加曝光补偿 +PREFERENCES_SHOWEXPOSURECOMPENSATION;附带曝光补偿 PREFERENCES_SHOWFILMSTRIPTOOLBAR;显示“数码底片夹”栏 PREFERENCES_SHTHRESHOLD;阴影过暗阈值 PREFERENCES_SINGLETAB;单编辑器模式 PREFERENCES_SINGLETABVERTAB;单编辑器模式, 标签栏垂直 -PREFERENCES_SND_HELP;输入完整路径来指定声音文件, 或者留空表示无声 \nWindows系统声音可以使用 "SystemDefault", "SystemAsterisk" 等\nLinux则可以使用 "complete", "window-attention" 等 +PREFERENCES_SND_HELP;输入完整路径来指定声音文件, 或者留空表示无声。\nWindows系统声音可以使用 "SystemDefault", "SystemAsterisk" 等\nLinux则可以使用 "complete", "window-attention" 等 PREFERENCES_SND_LNGEDITPROCDONE;编辑器处理完成 PREFERENCES_SND_QUEUEDONE;完成队列 PREFERENCES_SND_THRESHOLDSECS;等待秒数 @@ -840,9 +617,7 @@ PREFERENCES_TAB_COLORMGR;色彩管理 PREFERENCES_TAB_DYNAMICPROFILE;动态预设规则 PREFERENCES_TAB_GENERAL;通用 PREFERENCES_TAB_IMPROC;图片处理 -PREFERENCES_TAB_PERFORMANCE;性能 PREFERENCES_TAB_SOUND;音效 -PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;内嵌JPEG预览 PREFERENCES_TP_LABEL;工具栏 PREFERENCES_TP_VSCROLLBAR;隐藏垂直滚动栏 PREFERENCES_USEBUNDLEDPROFILES;启用内置预设 @@ -858,45 +633,27 @@ PROFILEPANEL_TOOLTIPCOPY;将当前配置复制到剪贴板 PROFILEPANEL_TOOLTIPLOAD;由文件加载配置 PROFILEPANEL_TOOLTIPPASTE;从剪贴板粘贴配置 PROFILEPANEL_TOOLTIPSAVE;保存当前配置 -PROGRESSBAR_GREENEQUIL;绿平衡... -PROGRESSBAR_HLREC;高光还原... -PROGRESSBAR_HOTDEADPIXELFILTER;热像素/坏点过滤器... -PROGRESSBAR_LINEDENOISE;线状噪点过滤器... PROGRESSBAR_LOADING;图片加载中... -PROGRESSBAR_LOADINGTHUMBS;正在读取缩略图... +PROGRESSBAR_LOADINGTHUMBS;读取缩略图... PROGRESSBAR_LOADJPEG;JPEG文件加载中... PROGRESSBAR_LOADPNG;PNG文件加载中... PROGRESSBAR_LOADTIFF;TIFF文件加载中... PROGRESSBAR_NOIMAGES;未找到图片 PROGRESSBAR_PROCESSING;图片处理中... -PROGRESSBAR_PROCESSING_PROFILESAVED;处理配置档案已保存 -PROGRESSBAR_RAWCACORR;Raw色差矫正... PROGRESSBAR_READY;就绪 PROGRESSBAR_SAVEJPEG;JPEG文件保存中... PROGRESSBAR_SAVEPNG;PNG文件保存中... PROGRESSBAR_SAVETIFF;TIFF文件保存中... -PROGRESSBAR_SNAPSHOT_ADDED;快照已添加 -QINFO_FRAMECOUNT;%2帧 -QINFO_HDR;HDR / %2帧 QINFO_ISO;ISO -QINFO_NOEXIF;Exif数据不可用. -QINFO_PIXELSHIFT;像素偏移/ %2帧 +QINFO_NOEXIF;Exif数据不可用 QUEUE_AUTOSTART;自动开始 QUEUE_DESTFILENAME;路径和文件名 QUEUE_FORMAT_TITLE;文件格式 QUEUE_LOCATION_FOLDER;保存至文件夹 QUEUE_LOCATION_TEMPLATE;使用模板 -QUEUE_LOCATION_TEMPLATE_TOOLTIP;可以使用下列控制符:\n%f, %d1, %d2, ..., %p1, %p2, ...\n\n这些控制符指向RAW文件所在文件夹及子文件夹 \n\n例如 假如 /home/tom/image/02-09-2006/dsc0012.nef已经打开, 控制符的意义如下:\n%f=dsc0012, %d1=02-09-2006, %d2=image, ...\n%p1=/home/tom/image/02-09-2006, %p2=/home/tom/image, p3=/home/tom, ...\n\n如果想将输出文件保存到输入文件所在位置:\n%p1/%f\n\n如果想将输出文件保存至输入文件夹内的'converted'子文件夹:\n%p1/converted/%f\n\n如果想将输出文件保存至 '/home/tom/converted' 并保留按日期所分的子文件夹:\n%p2/converted/%d1/%f -QUEUE_LOCATION_TITLE;输出位置 -SAMPLEFORMAT_0;未知数据格式 -SAMPLEFORMAT_1;8-bit unsigned -SAMPLEFORMAT_2;16-bit unsigned -SAMPLEFORMAT_16;16-bit浮点数 -SAMPLEFORMAT_32;24-bit浮点数 -SAMPLEFORMAT_64;32-bit浮点数 +QUEUE_LOCATION_TEMPLATE_TOOLTIP;根据图片的位置,评级,被置于垃圾桶与否,或是在队列中的位置来决定其被保存的位置。\n\n以这个路径为例:\n/home/tom/photos/2010-10-31/photo1.raw\n下列格式化的字符串意义如下:\n%d4 = home\n%d3 = tom\n%d2 = photos\n%d1 = 2010-10-31\n%f = photo1\n%p1 = /home/tom/photos/2010-10-31/\n%p2 = /home/tom/photos/\n%p3 = /home/tom/\n%p4 = /home/\n\n%r will be replaced by the photo's rank. If the photo is unranked, '0' is used. If the photo is in the trash, 'x' is used.\n\n%s1, ..., %s9的意思是,照片的文件名会变成它在队列中的排序位次。"%s"后面所跟的数字规定着文件名的长度,比如%s3所导出的第一张照片就会被命名为'001'。\n\n如果你想把图片保存到和原图相同的位置,输入:\n%p1/%f\n\n如果你想把图片保存到原图片所在文件夹的'converted'子文件夹下的话,输入:\n%p1/converted/%f\n\n如果你想把图片保存到\n'/home/tom/photos/converted/2010-10-31',输入:\n%p2/converted/%d1/%f SAVEDLG_AUTOSUFFIX;自动加后缀到已经存在的文件 SAVEDLG_FILEFORMAT;文件格式 -SAVEDLG_FILEFORMAT_FLOAT;浮点数 SAVEDLG_FORCEFORMATOPTS;强制保存选项 SAVEDLG_JPEGQUAL;JPEG质量 SAVEDLG_PUTTOQUEUE;放入队列 @@ -910,7 +667,7 @@ SAVEDLG_SUBSAMP_2;平衡 SAVEDLG_SUBSAMP_3;质量至优 SAVEDLG_TIFFUNCOMPRESSED;未压缩的TIFF SAVEDLG_WARNFILENAME;文件将被命名 -TOOLBAR_TOOLTIP_CROP;剪裁选择\n快捷键:c +TOOLBAR_TOOLTIP_CROP;裁剪选择\n快捷键:c TOOLBAR_TOOLTIP_HAND;手形工具\n快捷键:n TOOLBAR_TOOLTIP_STRAIGHTEN;基准线选择\n快捷键:s TOOLBAR_TOOLTIP_WB;白平衡采样\n快捷键:w @@ -930,11 +687,9 @@ TP_BWMIX_FILTER_YELLOW;黄 TP_BWMIX_GAMMA;伽马矫正 TP_BWMIX_GAM_TOOLTIP;矫正红绿蓝三色通道(RGB)伽马 TP_BWMIX_LABEL;黑白 -TP_BWMIX_MET;方式 -TP_BWMIX_MET_CHANMIX;通道混合器 -TP_BWMIX_MET_DESAT;淡化饱和度 +TP_BWMIX_MET;方法 +TP_BWMIX_MET_DESAT;去饱和 TP_BWMIX_MET_LUMEQUAL;亮度均衡工具 -TP_BWMIX_MIXC;通道混合器 TP_BWMIX_SETTING;预设 TP_BWMIX_SETTING_TOOLTIP;不同预设 (胶片、风光等)或手动的通道混合工具设置 TP_BWMIX_SET_HIGHCONTAST;高对比度 @@ -945,8 +700,6 @@ TP_BWMIX_SET_LOWSENSIT;低灵敏度 TP_BWMIX_SET_LUMINANCE;亮度 TP_BWMIX_SET_PANCHRO;全色的 TP_BWMIX_SET_PORTRAIT;垂直排布(肖像) -TP_BWMIX_SET_RGBABS;绝对RGB -TP_BWMIX_SET_RGBREL;相对RGB TP_BWMIX_TCMODE_FILMLIKE;黑白电影样式 TP_BWMIX_TCMODE_STANDARD;黑白电影标准 TP_BWMIX_VAL;L @@ -958,13 +711,12 @@ TP_CHMIXER_GREEN;绿 TP_CHMIXER_LABEL;通道混合 TP_CHMIXER_RED;红 TP_COARSETRAF_TOOLTIP_HFLIP;水平翻转 -TP_COARSETRAF_TOOLTIP_ROTLEFT;左转 -TP_COARSETRAF_TOOLTIP_ROTRIGHT;右转 +TP_COARSETRAF_TOOLTIP_ROTLEFT;左转\n\n快捷键:\n[ - 多编辑器模式,\nAlt-[ - 单编辑器模式 +TP_COARSETRAF_TOOLTIP_ROTRIGHT;右转\n\n快捷键:\n] - 多编辑器模式,\nAlt-] - 单编辑器模式 TP_COARSETRAF_TOOLTIP_VFLIP;竖直翻转 -TP_COLORAPP_BADPIXSL;热像素/坏点过滤器 TP_COLORAPP_LABEL_CAM02;图像调整 TP_COLORAPP_LIGHT;明度 (J) -TP_COLORAPP_LIGHT_TOOLTIP; CIECAM02、Lab 、RGB中明度意义各不同 +TP_COLORAPP_LIGHT_TOOLTIP; CIECAM02, Lab, RGB中,明度的意义各不相同 TP_COLORAPP_SURROUND_AVER;平均 TP_COLORAPP_SURROUND_DARK;暗 TP_COLORAPP_SURROUND_DIM;暗淡 @@ -974,8 +726,8 @@ TP_COLORAPP_TCMODE_SATUR;色彩饱和度 TP_CROP_FIXRATIO;比例: TP_CROP_GTDIAGONALS;对角线法则 TP_CROP_GTEPASSPORT;生物辨识护照 -TP_CROP_GTFRAME;框架 -TP_CROP_GTGRID;方格 +TP_CROP_GTFRAME;方框 +TP_CROP_GTGRID;网格 TP_CROP_GTHARMMEANS;调和平均律 TP_CROP_GTNONE;无 TP_CROP_GTRULETHIRDS;三等份法则 @@ -983,58 +735,17 @@ TP_CROP_GTTRIANGLE1;黄金三角 1 TP_CROP_GTTRIANGLE2;黄金三角 2 TP_CROP_GUIDETYPE;辅助方式: TP_CROP_H;高 -TP_CROP_LABEL;剪裁 +TP_CROP_LABEL;裁剪 TP_CROP_W;宽 TP_CROP_X;x TP_CROP_Y;y TP_DARKFRAME_AUTOSELECT;自动选择 TP_DARKFRAME_LABEL;暗场 -TP_DEFRINGE_LABEL;去边 +TP_DEFRINGE_LABEL;去除色边 TP_DEFRINGE_RADIUS;半径 -TP_DEFRINGE_THRESHOLD;阈值 -TP_DEHAZE_LABEL;去雾 -TP_DEHAZE_LUMINANCE;仅亮度 -TP_DEHAZE_STRENGTH;力度 -TP_DIRPYRDENOISE_CHROMINANCE_AUTOGLOBAL;全局自动 -TP_DIRPYRDENOISE_CHROMINANCE_BLUEYELLOW;色度—蓝-黄 -TP_DIRPYRDENOISE_CHROMINANCE_CURVE;色度曲线 -TP_DIRPYRDENOISE_CHROMINANCE_FRAME;色度 -TP_DIRPYRDENOISE_CHROMINANCE_MANUAL;手动 -TP_DIRPYRDENOISE_CHROMINANCE_METHOD;方法 -TP_DIRPYRDENOISE_CHROMINANCE_PREVIEW_NOISEINFO;当前预览处噪点:中位数=%1 最大=%2 -TP_DIRPYRDENOISE_CHROMINANCE_PREVIEW_NOISEINFO_EMPTY;当前预览处噪点:中位数=- 最大= - -TP_DIRPYRDENOISE_CHROMINANCE_REDGREEN;色度—红-绿 -TP_DIRPYRDENOISE_LABEL;降噪 -TP_DIRPYRDENOISE_LUMINANCE_CONTROL;亮度控制 -TP_DIRPYRDENOISE_LUMINANCE_CURVE;亮度曲线 TP_DIRPYRDENOISE_LUMINANCE_DETAIL;细节恢复 -TP_DIRPYRDENOISE_LUMINANCE_FRAME;亮度 TP_DIRPYRDENOISE_LUMINANCE_SMOOTHING;亮度 -TP_DIRPYRDENOISE_MAIN_COLORSPACE;色彩空间 TP_DIRPYRDENOISE_MAIN_COLORSPACE_RGB;RGB -TP_DIRPYRDENOISE_MAIN_COLORSPACE_TOOLTIP;对于Raw文件,RGB和L*a*b*均可用\n\n非Raw文件只可用L*a*b*空间,不论用户选择了哪个 -TP_DIRPYRDENOISE_MAIN_MODE;模式 -TP_DIRPYRDENOISE_MAIN_MODE_AGGRESSIVE;激进 -TP_DIRPYRDENOISE_MAIN_MODE_CONSERVATIVE;保守 -TP_DIRPYRDENOISE_MAIN_MODE_TOOLTIP;“保守”会保留低频的色度纹路,而“激进”会消除它们 -TP_DIRPYRDENOISE_MEDIAN_METHOD;中值法 -TP_DIRPYRDENOISE_MEDIAN_METHOD_CHROMINANCE;仅色度 -TP_DIRPYRDENOISE_MEDIAN_METHOD_LAB;L*a*b* -TP_DIRPYRDENOISE_MEDIAN_METHOD_LABEL;中值滤波器 -TP_DIRPYRDENOISE_MEDIAN_METHOD_LUMINANCE;仅亮度 -TP_DIRPYRDENOISE_MEDIAN_METHOD_RGB;RGB -TP_DIRPYRDENOISE_MEDIAN_METHOD_TOOLTIP;当使用“仅亮度”和“L*a*b*”法时,在降噪流水线中,\n中值滤波会在小波被应用后进行。\n当使用“RGB”模式时,它会在降噪流水线的最后被进行 -TP_DIRPYRDENOISE_MEDIAN_METHOD_WEIGHTED;权重L* (小) + a*b* (正常) -TP_DIRPYRDENOISE_MEDIAN_PASSES;中值迭代 -TP_DIRPYRDENOISE_MEDIAN_PASSES_TOOLTIP;使用3x3大小窗口并进行三次中值迭代通常比使用7x7窗口并进行一次迭代的效果更好 -TP_DIRPYRDENOISE_MEDIAN_TYPE;中值类型 -TP_DIRPYRDENOISE_MEDIAN_TYPE_TOOLTIP;使用你想要的窗口大小的中值滤波器。窗口大小越大,处理用时越长。\n3×3柔和:处理3x3窗口中的5个像素。\n\n处理3x3像素大小的窗口里面的9个像素。\n\n5x5柔和:处理5x5像素大小的窗口里面的13个像素。\n\n5x5:处理5x5像素大小的窗口里面的25个像素。\n\n7x7:处理7x7像素大小的窗口里面的49个像素。\n\n9x9:处理9x9像素大小的窗口里面的81个像素。\n\n有时使用小窗口进行多次迭代的效果会优于使用大窗口进行一次迭代的效果 -TP_DIRPYRDENOISE_TYPE_3X3;3×3 -TP_DIRPYRDENOISE_TYPE_3X3SOFT;3×3柔和 -TP_DIRPYRDENOISE_TYPE_5X5;5×5 -TP_DIRPYRDENOISE_TYPE_5X5SOFT;5×5柔和 -TP_DIRPYRDENOISE_TYPE_7X7;7×7 -TP_DIRPYRDENOISE_TYPE_9X9;9×9 TP_DIRPYREQUALIZER_ALGO;皮肤色彩范围 TP_DIRPYREQUALIZER_ARTIF;减少杂色 TP_DIRPYREQUALIZER_HUESKIN;皮肤色相 @@ -1054,33 +765,24 @@ TP_EPD_STRENGTH;力度 TP_EXPOSURE_AUTOLEVELS;自动色阶 TP_EXPOSURE_BLACKLEVEL;黑点 TP_EXPOSURE_BRIGHTNESS;光亮度 -TP_EXPOSURE_CLIP;高光溢出 +TP_EXPOSURE_CLIP;可溢出% TP_EXPOSURE_COMPRHIGHLIGHTS;高光压缩 TP_EXPOSURE_COMPRHIGHLIGHTSTHRESHOLD;高光压缩阈值 TP_EXPOSURE_COMPRSHADOWS;阴影压缩 TP_EXPOSURE_CONTRAST;对比度 -TP_EXPOSURE_CURVEEDITOR;影调曲线 +TP_EXPOSURE_CURVEEDITOR;色调曲线 TP_EXPOSURE_CURVEEDITOR1;色调曲线 1 TP_EXPOSURE_CURVEEDITOR2;色调曲线 2 -TP_EXPOSURE_CURVEEDITOR2_TOOLTIP;请从 RawPedia 网站中 Exposure > Tone Curve 文章中了解如何使用双色调曲线 +TP_EXPOSURE_CURVEEDITOR2_TOOLTIP;请在RawPedia的Exposure > Tone Curve文章中了解如何使用双色调曲线 TP_EXPOSURE_EXPCOMP;曝光补偿 -TP_EXPOSURE_HISTMATCHING;自适应色调曲线 -TP_EXPOSURE_HISTMATCHING_TOOLTIP;自动调整滑条和曲线(不包括曝光补偿)以使图片贴近于内嵌于Raw的JPEG预览图。 TP_EXPOSURE_LABEL;曝光 TP_EXPOSURE_SATURATION;色彩饱和度 TP_EXPOSURE_TCMODE_FILMLIKE;仿胶片式 TP_EXPOSURE_TCMODE_LABEL1;曲线模式1 TP_EXPOSURE_TCMODE_LABEL2;曲线模式2 -TP_EXPOSURE_TCMODE_LUMINANCE;亮度 -TP_EXPOSURE_TCMODE_PERCEPTUAL;感知性 TP_EXPOSURE_TCMODE_SATANDVALBLENDING;饱和度-亮度混合 TP_EXPOSURE_TCMODE_STANDARD;标准 TP_EXPOSURE_TCMODE_WEIGHTEDSTD;加权标准 -TP_FILMNEGATIVE_LABEL;胶片负片 -TP_FILMSIMULATION_LABEL;胶片模拟 -TP_FILMSIMULATION_SLOWPARSEDIR;RawTherapee默认会寻找用于胶片模拟工具的Hald CLUT图像,图像所在的文件夹加载时间比较长。\n前往参数设置-图片处理-Hald CLUT路径\n以寻找被使用的文件夹是哪个。你应该把这个文件夹指向一个只有Hald CLUT图像而没有其他图片的文件夹,而如果你不想用胶片模拟功能,就把它指向一个空文件夹。\n\n阅读RawPedia上的Film Simulation词条以获取更多信息。\n\n你现在想取消扫描吗? -TP_FILMSIMULATION_STRENGTH;力度 -TP_FILMSIMULATION_ZEROCLUTSFOUND;在参数设置中设定HaldCLUT目录 TP_FLATFIELD_AUTOSELECT;自动选择 TP_FLATFIELD_BLURRADIUS;模糊半径 TP_FLATFIELD_BLURTYPE;模糊种类 @@ -1088,24 +790,18 @@ TP_FLATFIELD_BT_AREA;区域 TP_FLATFIELD_BT_HORIZONTAL;水平 TP_FLATFIELD_BT_VERTHORIZ;垂直+水平 TP_FLATFIELD_BT_VERTICAL;垂直 -TP_FLATFIELD_CLIPCONTROL;溢出控制 -TP_FLATFIELD_CLIPCONTROL_TOOLTIP;溢出控制能够避免由于平场的应用而导致的高光溢出。如果在应用平场之前就有溢出的高光,数值就会为0 TP_FLATFIELD_LABEL;平场 -TP_GENERAL_11SCALE_TOOLTIP;此工具的效果仅在以1:1大小预览时才可见/准确 TP_GRADIENT_CENTER;中心 TP_GRADIENT_CENTER_X;中心 X -TP_GRADIENT_CENTER_X_TOOLTIP;将渐变滤镜向左(负值)或向右(正值)移动 TP_GRADIENT_CENTER_Y;中心 Y -TP_GRADIENT_CENTER_Y_TOOLTIP;将渐变滤镜向上(负值)或向下(正值)移动 TP_GRADIENT_DEGREE;角度 TP_GRADIENT_DEGREE_TOOLTIP;转动的角度数 TP_GRADIENT_FEATHER;羽化 TP_GRADIENT_FEATHER_TOOLTIP;以图像对角线的长度为100,设定渐变的宽度 TP_GRADIENT_LABEL;渐变滤镜 TP_GRADIENT_STRENGTH;延展 -TP_GRADIENT_STRENGTH_TOOLTIP;滤镜的强度(档数) TP_HLREC_BLEND;混合 -TP_HLREC_CIELAB;CIELab模式混合 +TP_HLREC_CIELAB;CIELab混合 TP_HLREC_COLOR;色彩延伸 TP_HLREC_LABEL;高光还原 TP_HLREC_LUMINANCE;亮度还原 @@ -1117,146 +813,44 @@ TP_HSVEQUALIZER_SAT;S TP_HSVEQUALIZER_VAL;V TP_ICM_INPUTCAMERA;相机缺省 TP_ICM_INPUTCUSTOM;自定义 -TP_ICM_INPUTCUSTOM_TOOLTIP;选择你自己的 DCP/ICC 色彩档案 +TP_ICM_INPUTCUSTOM_TOOLTIP;选择你自己的DCP/ICC色彩档案 TP_ICM_INPUTDLGLABEL;选择输入ICC配置... TP_ICM_INPUTEMBEDDED;如可能, 使用内置 TP_ICM_INPUTEMBEDDED_TOOLTIP;使用色彩档案嵌入非raw文件 TP_ICM_INPUTNONE;无档案 TP_ICM_INPUTPROFILE;输入配置 TP_ICM_LABEL;ICM -TP_ICM_NOICM;No ICM: sRGB配置 +TP_ICM_NOICM;无ICM:sRGB配置 TP_ICM_OUTPUTPROFILE;输出配置 -TP_ICM_TONECURVE;使用 DCP 色调曲线 +TP_ICM_TONECURVE;使用 DCP色调曲线 TP_ICM_WORKINGPROFILE;当前配置 TP_IMPULSEDENOISE_LABEL;脉冲噪声降低 TP_IMPULSEDENOISE_THRESH;阈值 TP_LABCURVE_AVOIDCOLORSHIFT;避免色彩偏移 TP_LABCURVE_AVOIDCOLORSHIFT_TOOLTIP;使色彩适应当前色彩空间范围, 并使用Munsell色矫正 TP_LABCURVE_BRIGHTNESS;光强度 -TP_LABCURVE_CHROMATICITY;色度 CIE -TP_LABCURVE_CHROMA_TOOLTIP;若要应用黑白色调,将色度值降低为-100 +TP_LABCURVE_CHROMATICITY;色度 TP_LABCURVE_CONTRAST;对比度 TP_LABCURVE_CURVEEDITOR;亮度曲线 TP_LABCURVE_LABEL;Lab调整 TP_LENSGEOM_AUTOCROP;自动剪切 TP_LENSGEOM_FILL;自动填充 -TP_LENSGEOM_LABEL;镜头 / 几何 -TP_LENSGEOM_LIN;线性 -TP_LENSGEOM_LOG;对数 -TP_LENSPROFILE_CORRECTION_AUTOMATCH;自动选择 -TP_LENSPROFILE_CORRECTION_LCPFILE;LCP文件 -TP_LENSPROFILE_CORRECTION_MANUAL;手动选择 +TP_LENSGEOM_LABEL;镜头/几何 TP_LENSPROFILE_LABEL;镜头矫正档案 -TP_LENSPROFILE_MODE_HEADER;镜头档案 -TP_LENSPROFILE_USE_CA;色差 -TP_LENSPROFILE_USE_GEOMETRIC;几何畸变 -TP_LENSPROFILE_USE_HEADER;矫正 -TP_LENSPROFILE_USE_VIGNETTING;暗角 -TP_LOCALCONTRAST_AMOUNT;数量 -TP_LOCALCONTRAST_DARKNESS;黑处等级 -TP_LOCALCONTRAST_LABEL;局部反差 -TP_LOCALCONTRAST_LIGHTNESS;亮处等级 -TP_LOCALCONTRAST_RADIUS;半径 -TP_METADATA_EDIT;应用修改 -TP_METADATA_MODE;元数据复制模式: -TP_METADATA_STRIP;移除所有元数据 TP_PCVIGNETTE_FEATHER;羽化 -TP_PCVIGNETTE_FEATHER_TOOLTIP;羽化:\n0 = 仅边角,\n50 = 到达一半的位置,\n100 = 到达中心 TP_PCVIGNETTE_LABEL;暗角滤镜 TP_PCVIGNETTE_ROUNDNESS;圆度 -TP_PCVIGNETTE_ROUNDNESS_TOOLTIP;圆度:\n0 = 矩形,\n50 = 适于图像的椭圆\n100 = 圆形 TP_PCVIGNETTE_STRENGTH;力度 -TP_PCVIGNETTE_STRENGTH_TOOLTIP;滤镜的曝光补偿力度 (到达边角) -TP_PDSHARPENING_LABEL;捕图加锐 +TP_PCVIGNETTE_STRENGTH_TOOLTIP;滤镜的曝光补偿力度(到达边角) TP_PERSPECTIVE_HORIZONTAL;水平 TP_PERSPECTIVE_LABEL;视角 TP_PERSPECTIVE_VERTICAL;垂直 -TP_PREPROCESS_DEADPIXFILT;坏点过滤器 -TP_PREPROCESS_DEADPIXFILT_TOOLTIP;尝试过滤坏点。 -TP_PREPROCESS_GREENEQUIL;绿平衡 -TP_PREPROCESS_HOTPIXFILT;热像素过滤器 -TP_PREPROCESS_HOTPIXFILT_TOOLTIP;尝试过滤热像素。 TP_PREPROCESS_LABEL;预处理 TP_PREPROCESS_LINEDENOISE;线状噪点过滤 -TP_PREPROCESS_LINEDENOISE_DIRECTION;方向 -TP_PREPROCESS_LINEDENOISE_DIRECTION_BOTH;双向 -TP_PREPROCESS_LINEDENOISE_DIRECTION_HORIZONTAL;横向 -TP_PREPROCESS_LINEDENOISE_DIRECTION_PDAF_LINES;横向,只在PDAF点所在的行上 -TP_PREPROCESS_LINEDENOISE_DIRECTION_VERTICAL;纵向 -TP_PREPROCESS_NO_FOUND;没发现 -TP_PREPROCESS_PDAFLINESFILTER;PDAF条纹过滤器 -TP_PRSHARPENING_LABEL;调整大小后加锐 -TP_PRSHARPENING_TOOLTIP;在调整图片大小后加锐图像。仅在选择"Lanczos"算法时可用。本工具的效果无法预览。见RawPedia的文章以了解本工具的使用教程 +TP_PREPROCESS_NO_FOUND;发现无 TP_RAWCACORR_AUTO;自动修正 -TP_RAWCACORR_AUTOIT;迭代 -TP_RAWCACORR_AUTOIT_TOOLTIP;若“自动矫正”被勾选,此设置便可用。\n自动矫正是保守的,也就是说它经常不会去除所有色差。\n要移除全部色差,你可以使用至多迭代五次的色差矫正迭代。\n每次迭代会纠正上个迭代未能修正的色差,代价是需要花费额外的处理时间。 -TP_RAWCACORR_AVOIDCOLORSHIFT;避免偏色 TP_RAWCACORR_CABLUE;蓝 TP_RAWCACORR_CARED;红 -TP_RAWCACORR_LABEL;色差矫正 -TP_RAWEXPOS_RGB;红,绿,蓝 -TP_RAW_AHD;AHD -TP_RAW_AMAZE;AMaZE -TP_RAW_AMAZEVNG4;AMaZE+VNG4 -TP_RAW_BORDER;边界 -TP_RAW_DCB;DCB -TP_RAW_DCBENHANCE;DCB优化 -TP_RAW_DCBITERATIONS;DCB迭代数 -TP_RAW_DCBVNG4;DCB+VNG4 -TP_RAW_DMETHOD;方法 -TP_RAW_DMETHOD_PROGRESSBAR;%1 去马赛克中... -TP_RAW_DMETHOD_PROGRESSBAR_REFINE;去马赛克精细化... -TP_RAW_DMETHOD_TOOLTIP;注:IGV和LMMSE是专门用于配合降噪工具,在为高ISO图片降噪时不产生迷宫状噪点,色调分离或是褪色所用的。\n像素偏移是为宾得/索尼的像素偏移文件所用的。此算法使用AMaZE算法来处理非像素偏移文件。 -TP_RAW_DUALDEMOSAICAUTOCONTRAST;自动阈值 -TP_RAW_DUALDEMOSAICAUTOCONTRAST_TOOLTIP;如果勾选框被打勾(推荐如此做),RawTherapee会根据图片中的平缓区域自动计算一个最优值。\n如果图像中没有平缓的区域,或是图片噪点太多,该数值会被设为0\n若想手动调整此数值,首先要将勾选框取消勾选(合适的值取决于具体图像的情况)。 -TP_RAW_DUALDEMOSAICCONTRAST;反差阈值 -TP_RAW_EAHD;EAHD -TP_RAW_FALSECOLOR;伪色抑制步长 -TP_RAW_FAST;Fast -TP_RAW_HD;阈值 -TP_RAW_HD_TOOLTIP;更低的数值会使热像素/坏点的检测更加激进,但是“宁错杀,不放过”的激进程度可能会导致杂点的产生。在启用本功能后,如果你发现了新出现的杂点,就逐渐提高阈值,直至杂点消失。 -TP_RAW_HPHD;HPHD -TP_RAW_IGV;IGV -TP_RAW_IMAGENUM;子图像 -TP_RAW_IMAGENUM_SN;SN模式 -TP_RAW_IMAGENUM_TOOLTIP;某些Raw文件包含多张子图像(宾得/索尼的像素偏移,宾得的3张合并HDR,佳能的双像素,富士的EXR)。\n\n当使用除像素偏移外的任意一个去马赛克算法时,本栏用来选择哪帧子图像被处理。\n\n当在像素偏移的Raw文件上使用像素偏移去马赛克算法时,所有子图像都会被应用,此时本栏用来选择哪帧子图像被用来处理动体。 -TP_RAW_LABEL;去马赛克 -TP_RAW_LMMSEITERATIONS;LMMSE优化步长 -TP_RAW_LMMSE_TOOLTIP;添加gamma(步长1),中位数(步长2-4)和精细化(步长5-6)以减少杂点并提升信噪比。 -TP_RAW_MONO;黑白 -TP_RAW_NONE;无(显示传感器阵列) -TP_RAW_PIXELSHIFT;像素偏移 -TP_RAW_PIXELSHIFTBLUR;动体蒙版模糊 -TP_RAW_PIXELSHIFTDMETHOD;动体区域的去马赛克算法 -TP_RAW_PIXELSHIFTEPERISO;敏感度 -TP_RAW_PIXELSHIFTEPERISO_TOOLTIP;默认值0在原生ISO下应该具有不错的效果。\n更大的数值会增强动体检测的敏感度。\n以微小的步长调整此值,同时观察动体蒙版的变化。\n对于欠曝/高ISO的照片,应提高此值。 -TP_RAW_PIXELSHIFTEQUALBRIGHT;将不同照片的亮度均等化 -TP_RAW_PIXELSHIFTEQUALBRIGHTCHANNEL;将各个通道分别均等化 -TP_RAW_PIXELSHIFTEQUALBRIGHTCHANNEL_TOOLTIP;启用:对RGB通道分别进行均等化。\n禁用:使用同一个均等化系数对所有通道进行均等化。 -TP_RAW_PIXELSHIFTEQUALBRIGHT_TOOLTIP;以当前被选中的一帧图像为基准,均等化各帧图像的亮度。\n如果各帧中有过曝的区域,应选择最亮的一帧以避免过曝区域出现紫色,也可启用动体补正来解决该问题。 -TP_RAW_PIXELSHIFTGREEN;检查绿色通道以检测动体 -TP_RAW_PIXELSHIFTHOLEFILL;填补动体蒙版的洞 -TP_RAW_PIXELSHIFTHOLEFILL_TOOLTIP;填补动体蒙版中间所存在的洞 -TP_RAW_PIXELSHIFTMEDIAN;对动体区域使用中值 -TP_RAW_PIXELSHIFTMEDIAN_TOOLTIP;对于运动的部分,使用所有图片的中值,而不是用户选择的某一帧图片。\n移除在所有图片中位置都不同的物体。\n在移动慢(重叠)的物体上会产生动体效果。 -TP_RAW_PIXELSHIFTMM_AUTO;自动 -TP_RAW_PIXELSHIFTMM_CUSTOM;自定义 -TP_RAW_PIXELSHIFTMM_OFF;关闭 -TP_RAW_PIXELSHIFTMOTIONMETHOD;动体补正 -TP_RAW_PIXELSHIFTNONGREENCROSS;检查红/蓝色通道以检测动体 -TP_RAW_PIXELSHIFTSHOWMOTION;显示动体蒙版 -TP_RAW_PIXELSHIFTSHOWMOTIONMASKONLY;仅显示动体蒙版 -TP_RAW_PIXELSHIFTSHOWMOTIONMASKONLY_TOOLTIP;显示没有照片的动体蒙版。 -TP_RAW_PIXELSHIFTSHOWMOTION_TOOLTIP;在图像上用绿色蒙版显示动体区域。 -TP_RAW_PIXELSHIFTSIGMA;模糊半径 -TP_RAW_PIXELSHIFTSIGMA_TOOLTIP;默认半径值1.0一般对于原生ISO来说足够好。\n对于高ISO照片,提高此值,5.0是不错的起始点。\n在改变此值的同时关注动体蒙版。 -TP_RAW_PIXELSHIFTSMOOTH;顺滑过渡 -TP_RAW_PIXELSHIFTSMOOTH_TOOLTIP;让存在动体的区域与没有动体之间的区域之间顺滑地过渡。\n将此值设置为0以禁用顺滑过渡\n将此值设置为1以使用AMaZE/LMMSE算法(这取决于你是否选择了“使用LMMSE”)所解出的你所选择的那一帧图像,如果你选择了“使用中值”,那么就会根据通过所有图像计算出的中值解出图像。 -TP_RAW_RCD;RCD -TP_RAW_RCDVNG4;RCD+VNG4 -TP_RAW_SENSOR_BAYER_LABEL;拜耳阵列传感器 -TP_RESIZE_ALLOW_UPSCALING;允许升采样 -TP_RESIZE_APPLIESTO;应用到: TP_RESIZE_CROPPEDAREA;裁剪区域 TP_RESIZE_FITBOX;矩形区域 TP_RESIZE_FULLIMAGE;整张图 @@ -1264,29 +858,23 @@ TP_RESIZE_H;高: TP_RESIZE_HEIGHT;高度 TP_RESIZE_LABEL;调整大小 TP_RESIZE_LANCZOS;Lanczos算法 -TP_RESIZE_METHOD;方式: +TP_RESIZE_METHOD;方法: TP_RESIZE_NEAREST;最近点 TP_RESIZE_SCALE;缩放倍数 TP_RESIZE_SPECIFY;调整: TP_RESIZE_W;宽: TP_RESIZE_WIDTH;宽度 -TP_RETINEX_CONTEDIT_HSL;HSL直方图 -TP_RETINEX_CONTEDIT_LAB;L*a*b*直方图 -TP_RETINEX_CONTEDIT_LH;色调 -TP_RETINEX_CONTEDIT_MAP;均衡器 -TP_RETINEX_EQUAL;均衡器 -TP_RETINEX_VIEW_UNSHARP;USM锐化 TP_RGBCURVES_BLUE;B TP_RGBCURVES_CHANNEL;通道 TP_RGBCURVES_GREEN;G TP_RGBCURVES_LABEL;RGB曲线 TP_RGBCURVES_LUMAMODE;亮度模式 -TP_RGBCURVES_LUMAMODE_TOOLTIP;亮度模式 允许改变R、G、B三种通道光量但不影响色彩 +TP_RGBCURVES_LUMAMODE_TOOLTIP;亮度模式允许改变R、G、B三个通道光量但不影响色彩 TP_RGBCURVES_RED;R TP_ROTATE_DEGREE;角度 TP_ROTATE_LABEL;旋转 TP_ROTATE_SELECTLINE;选择基准线 -TP_SAVEDIALOG_OK_TIP;快捷键: Ctrl-Enter +TP_SAVEDIALOG_OK_TIP;快捷键:Ctrl-Enter TP_SHADOWSHLIGHTS_HIGHLIGHTS;高光 TP_SHADOWSHLIGHTS_HLTONALW;色调范围 TP_SHADOWSHLIGHTS_LABEL;阴影/高光 @@ -1298,18 +886,14 @@ TP_SHARPENEDGE_LABEL;边缘 TP_SHARPENEDGE_PASSES;迭代 TP_SHARPENEDGE_THREE;仅亮度 TP_SHARPENING_AMOUNT;数量 -TP_SHARPENING_BLUR;模糊半径 -TP_SHARPENING_CONTRAST;反差阈值 TP_SHARPENING_EDRADIUS;半径 TP_SHARPENING_EDTOLERANCE;边缘容差 TP_SHARPENING_HALOCONTROL;光晕控制 TP_SHARPENING_HCAMOUNT;数量 -TP_SHARPENING_ITERCHECK;自动限制迭代 TP_SHARPENING_LABEL;锐化 -TP_SHARPENING_METHOD;方式 +TP_SHARPENING_METHOD;方法 TP_SHARPENING_ONLYEDGES;仅锐化边缘 TP_SHARPENING_RADIUS;半径 -TP_SHARPENING_RADIUS_BOOST;边缘半径值提升 TP_SHARPENING_RLD;理查森-露西反卷积法(RLD) TP_SHARPENING_RLD_AMOUNT;数量 TP_SHARPENING_RLD_DAMPING;衰减 @@ -1317,16 +901,6 @@ TP_SHARPENING_RLD_ITERATIONS;迭代 TP_SHARPENING_THRESHOLD;阈值 TP_SHARPENING_USM;USM锐化 TP_SHARPENMICRO_AMOUNT;数量 -TP_SHARPENMICRO_CONTRAST;反差阈值 -TP_SHARPENMICRO_LABEL;微反差 -TP_SHARPENMICRO_MATRIX;使用3×3阵列而非5×5阵列 -TP_SHARPENMICRO_UNIFORMITY;均匀度 -TP_TM_FATTAL_AMOUNT;数量 -TP_TM_FATTAL_ANCHOR;锚点 -TP_TM_FATTAL_LABEL;动态范围压缩 -TP_TM_FATTAL_THRESHOLD;细节 -TP_VIBRANCE_AVOIDCOLORSHIFT;避免偏色 -TP_VIBRANCE_PROTECTSKINS;保护肤色 TP_VIGNETTING_AMOUNT;数量 TP_VIGNETTING_CENTER;中心 TP_VIGNETTING_CENTER_X;中心 X @@ -1334,6 +908,1221 @@ TP_VIGNETTING_CENTER_Y;中心 Y TP_VIGNETTING_LABEL;暗角矫正 TP_VIGNETTING_RADIUS;半径 TP_VIGNETTING_STRENGTH;力度 +TP_WBALANCE_AUTO;自动 +TP_WBALANCE_CAMERA;相机 +TP_WBALANCE_CLOUDY;阴天 +TP_WBALANCE_CUSTOM;自定义 +TP_WBALANCE_DAYLIGHT;晴天 +TP_WBALANCE_EQBLUERED;蓝红平衡 +TP_WBALANCE_FLASH55;徕卡 +TP_WBALANCE_FLASH_HEADER;闪光 +TP_WBALANCE_GREEN;色度 +TP_WBALANCE_LABEL;白平衡 +TP_WBALANCE_LED_HEADER;LED +TP_WBALANCE_METHOD;方法 +TP_WBALANCE_SHADE;阴影 +TP_WBALANCE_SIZE;大小: +TP_WBALANCE_SOLUX35;Solux 3500K +TP_WBALANCE_SOLUX41;Solux 4100K +TP_WBALANCE_SPOTWB;白平衡采样 +TP_WBALANCE_TEMPERATURE;色温 +TP_WBALANCE_WATER1;水下 1 +TP_WBALANCE_WATER2;水下 2 +TP_WBALANCE_WATER_HEADER;水下 +ZOOMPANEL_100;(100%) +ZOOMPANEL_NEWCROPWINDOW;开启(新的)细节窗口 +ZOOMPANEL_ZOOM100;缩放到100%\n快捷键:z +ZOOMPANEL_ZOOMFITCROPSCREEN;适应边缘到屏幕\n快捷键:f +ZOOMPANEL_ZOOMFITSCREEN;适应屏幕\n快捷键:Alt-f +ZOOMPANEL_ZOOMIN;缩放拉近\n快捷键:+ +ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键:- +ADJUSTER_RESET_TO_DEFAULT;单击-恢复默认值\nCtrl+单击-恢复初始值 +CURVEEDITOR_AXIS_IN;I: +CURVEEDITOR_AXIS_LEFT_TAN;LT: +CURVEEDITOR_AXIS_OUT;O: +CURVEEDITOR_AXIS_RIGHT_TAN;RT: +CURVEEDITOR_CATMULLROM;灵活 +CURVEEDITOR_EDITPOINT_HINT;启用对于节点进/出值的编辑\n\n右击节点以选中\n右击空白处以取消选中节点 +EDIT_OBJECT_TOOLTIP;在预览窗口中展示一个允许你调整本工具的widget窗口。 +EDIT_PIPETTE_TOOLTIP;要向曲线添加调整点,点击此按钮,按住Ctrl键并用鼠标左键点击图像预览中你想要的点。\n要调整点的位置,按住Ctrl键并用鼠标左键点击图像预览中的对应位置,然后松开Ctrl(除非你希望精调)同时按住鼠标左键,将鼠标向上/下移动以上下移动曲线中的点。 + +!!!!!!!!!!!!!!!!!!!!!!!!! +! Untranslated keys follow; remove the ! prefix after an entry is translated. +!!!!!!!!!!!!!!!!!!!!!!!!! + +FILEBROWSER_BROWSEPATHBUTTONHINT;点击以打开路径,刷新文件夹并搜索“查找”框中的关键词 +FILEBROWSER_BROWSEPATHHINT;输入你想前往的路径。\n\n快捷键:\nCtrl-o 让文本框获得焦点\nEnter / Ctrl-Enter 前往输入的目录\nEsc 清除改动\nShift-Esc 让文本框失去焦点\n\n路径快捷键:\n~ - 用户的home/文档路径\n! - 用户的图片路径 +FILEBROWSER_CACHECLEARFROMFULL;清除全部,包括缓存文件 +FILEBROWSER_CACHECLEARFROMPARTIAL;清除全部,不包括缓存文件 +FILEBROWSER_COLORLABEL_TOOLTIP;颜色标记,\n\n使用下拉菜单或快捷键:\nShift-Ctrl-0 无颜色\nShift-Ctrl-1 红\nShift-Ctrl-2 黄\nShift-Ctrl-3 绿\nShift-Ctrl-4 蓝\nShift-Ctrl-5 紫 +FILEBROWSER_DELETEDIALOG_ALL;你确定要永久删除%1个垃圾桶中的文件吗? +FILEBROWSER_DELETEDIALOG_SELECTED;你希望永久删除%1个被选中的文件吗? +FILEBROWSER_DELETEDIALOG_SELECTEDINCLPROC;你希望永久删除%1个被选中的文件, 包括已进行过队列处理的版本吗? +FILEBROWSER_EMPTYTRASHHINT;永久删除垃圾桶的所有文件 +FILEBROWSER_POPUPREMOVE;永久删除 +FILEBROWSER_POPUPREMOVEINCLPROC;永久删除,包括队列处理的版本 +FILEBROWSER_QUERYHINT;输入文件名进行搜索。支持不完整文件名。使用英文逗号分割关键词,例:\n1001,1004,1199\n\n在关键词前面加入!=以排除此关键词,例:\n!=1001,1004,1199\n\n快捷键:\nCtrl-f-让搜索框获得焦点,\nEnter-搜索,\nEsc-清空搜索框,\nShift-Esc-让搜索框失去焦点 +FILEBROWSER_SHOWCOLORLABEL1HINT;显示被标记为红色的照片\n快捷键:Alt-1 +FILEBROWSER_SHOWCOLORLABEL2HINT;显示被标记为黄色的照片\n快捷键:Alt-2 +FILEBROWSER_SHOWCOLORLABEL3HINT;显示被标记为绿色的照片\n快捷键:Alt-3 +FILEBROWSER_SHOWCOLORLABEL4HINT;显示被标记为蓝色的照片\n快捷键:Alt-4 +FILEBROWSER_SHOWCOLORLABEL5HINT;显示被标记为紫色的照片\n快捷键:Alt-5 +FILEBROWSER_SHOWEDITEDHINT;显示已编辑的照片\n快捷键:7 +FILEBROWSER_SHOWEDITEDNOTHINT;显示未编辑的照片\n快捷键:6 +FILEBROWSER_SHOWNOTTRASHHINT;仅显示未进入垃圾箱的照片 +FILEBROWSER_SHOWORIGINALHINT;仅显示原图。\n\n当多张文件名相同,但扩展名不同的图片存在时,在参数设置-文件浏览器-已知扩展名列表中,扩展名排得更靠上的图片会被当作这些图片的原图。 +FILEBROWSER_SHOWRECENTLYSAVEDNOTHINT;显示未保存的图片\n快捷键:Alt-6 +FILEBROWSER_SHOWUNCOLORHINT;显示没有颜色标记的照片\n快捷键:Alt-0 +FILEBROWSER_UNRANK_TOOLTIP;未评级\n快捷键:Shift-0 +GENERAL_CURRENT;当前 +GENERAL_HELP;帮助 +GENERAL_RESET;重置 +GENERAL_SLIDER;滑条 +GIMP_PLUGIN_INFO;欢迎使用RawTherapee的GIMP插件!\n当你完成编辑后,关闭RawTherapee主窗口,图片就会被自动导入到GIMP中 +HISTOGRAM_TOOLTIP_BAR;显示/隐藏RGB指示条 +HISTOGRAM_TOOLTIP_CHRO;显示/隐藏色度直方图 +!HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. +HISTOGRAM_TOOLTIP_RAW;显示/隐藏Raw直方图 +HISTORY_MSG_82;档案已改变 +HISTORY_MSG_86;RGB曲线-色度模式 +HISTORY_MSG_87;脉冲噪声降低 +HISTORY_MSG_88;脉冲降噪阈值 +HISTORY_MSG_91;降噪-Chrominance master +!HISTORY_MSG_93;CbDL-Value +!HISTORY_MSG_94;Contrast by Detail Levels +HISTORY_MSG_95;L*a*b*-色度 +HISTORY_MSG_96;L*a*b*-a* 曲线 +HISTORY_MSG_97;L*a*b*-b* 曲线 +HISTORY_MSG_98;去马赛克方法 +HISTORY_MSG_99;热像素过滤器 +HISTORY_MSG_100;曝光-饱和度 +HISTORY_MSG_101;HSV-色度(Hue) +HISTORY_MSG_102;HSV-饱和度(Saturation) +HISTORY_MSG_104;HSV均衡器 +HISTORY_MSG_105;去除色边 +HISTORY_MSG_106;去除色边-半径 +HISTORY_MSG_107;去除色边-阈值 +!HISTORY_MSG_108;Exposure-HLC threshold +HISTORY_MSG_109;调整大小-边界限制方块 +HISTORY_MSG_110;调整大小-应用到 +!HISTORY_MSG_112;--unused-- +HISTORY_MSG_115;伪色抑制 +HISTORY_MSG_116;DCB增强 +HISTORY_MSG_117;Raw色差矫正-红 +HISTORY_MSG_118;Raw色差矫正-蓝 +HISTORY_MSG_120;绿平衡 +HISTORY_MSG_121;Raw色差矫正-自动 +HISTORY_MSG_131;降噪-亮度 +HISTORY_MSG_132;降噪-色度 +!HISTORY_MSG_133;Output gamma +!HISTORY_MSG_134;Free gamma +!HISTORY_MSG_135;Free gamma +!HISTORY_MSG_136;Free gamma slope +!HISTORY_MSG_137;Black level-Green 1 +!HISTORY_MSG_138;Black level-Red +!HISTORY_MSG_139;Black level-Blue +!HISTORY_MSG_140;Black level-Green 2 +!HISTORY_MSG_141;Black level-Link greens +!HISTORY_MSG_142;ES-Iterations +!HISTORY_MSG_143;ES-Quantity +HISTORY_MSG_144;微反差-数量 +HISTORY_MSG_145;微反差-均匀度 +HISTORY_MSG_148;微反差 +HISTORY_MSG_149;微反差-3×3阵列 +!HISTORY_MSG_150;Post-demosaic artifact/noise red. +!HISTORY_MSG_151;Vibrance +!HISTORY_MSG_152;Vib-Pastel tones +!HISTORY_MSG_153;Vib-Saturated tones +!HISTORY_MSG_154;Vib-Protect skin-tones +!HISTORY_MSG_156;Vib-Link pastel/saturated +!HISTORY_MSG_157;Vib-P/S threshold +!HISTORY_MSG_161;TM-Reweighting iterates +HISTORY_MSG_163;RGB曲线-红 +HISTORY_MSG_164;RGB曲线-绿 +HISTORY_MSG_165;RGB曲线-蓝 +HISTORY_MSG_166;曝光-重置 +HISTORY_MSG_167;去马赛克方法 +HISTORY_MSG_168;L*a*b*-CC曲线 +HISTORY_MSG_169;L*a*b*-CH曲线 +HISTORY_MSG_170;Vibrance-HH曲线 +HISTORY_MSG_171;L*a*b*-LC曲线 +HISTORY_MSG_172;L*a*b*-限制LC +HISTORY_MSG_173;降噪-细节恢复 +!HISTORY_MSG_175;CAM02-CAT02 adaptation +!HISTORY_MSG_176;CAM02-Viewing surround +!HISTORY_MSG_177;CAM02-Scene luminosity +!HISTORY_MSG_178;CAM02-Viewing luminosity +!HISTORY_MSG_179;CAM02-White-point model +HISTORY_MSG_180;CAM02-亮度 (J) +HISTORY_MSG_181;CAM02-色度 (C) +!HISTORY_MSG_182;CAM02-Automatic CAT02 +!HISTORY_MSG_184;CAM02-Scene surround +!HISTORY_MSG_185;CAM02-Gamut control +HISTORY_MSG_186;CAM02-算法 +HISTORY_MSG_187;CAM02-红色/肤色保护 +HISTORY_MSG_188;CAM02-亮度 (Q) +HISTORY_MSG_189;CAM02-对比度 (Q) +HISTORY_MSG_190;CAM02-饱和度 (S) +HISTORY_MSG_191;CAM02-色彩丰富度 (M) +HISTORY_MSG_192;CAM02-色度 (h) +HISTORY_MSG_193;CAM02-色调曲线1 +HISTORY_MSG_194;CAM02-色调曲线2 +HISTORY_MSG_195;CAM02-色调曲线1 +HISTORY_MSG_196;CAM02-色调曲线2 +!HISTORY_MSG_197;CAM02-Color curve +!HISTORY_MSG_198;CAM02-Color curve +!HISTORY_MSG_199;CAM02-Output histograms +HISTORY_MSG_200;CAM02-色调映射 +!HISTORY_MSG_201;NR-Chrominance-R&G +!HISTORY_MSG_202;NR-Chrominance-B&Y +HISTORY_MSG_203;降噪-色彩空间 +HISTORY_MSG_204;LMMSE优化步长 +HISTORY_MSG_205;CAM02-热像素/坏点过滤器 +!HISTORY_MSG_206;CAT02-Auto scene luminosity +HISTORY_MSG_207;去除色边-色度曲线 +!HISTORY_MSG_208;WB-B/R equalizer +!HISTORY_MSG_214;Black-and-White +!HISTORY_MSG_215;B&W-CM-Red +!HISTORY_MSG_216;B&W-CM-Green +!HISTORY_MSG_217;B&W-CM-Blue +!HISTORY_MSG_218;B&W-Gamma-Red +!HISTORY_MSG_219;B&W-Gamma-Green +!HISTORY_MSG_220;B&W-Gamma-Blue +!HISTORY_MSG_221;B&W-Color filter +!HISTORY_MSG_222;B&W-Presets +!HISTORY_MSG_223;B&W-CM-Orange +!HISTORY_MSG_224;B&W-CM-Yellow +!HISTORY_MSG_225;B&W-CM-Cyan +!HISTORY_MSG_226;B&W-CM-Magenta +!HISTORY_MSG_227;B&W-CM-Purple +!HISTORY_MSG_228;B&W-Luminance equalizer +!HISTORY_MSG_229;B&W-Luminance equalizer +!HISTORY_MSG_230;B&W-Mode +!HISTORY_MSG_231;B&W-'Before' curve +!HISTORY_MSG_232;B&W-'Before' curve type +!HISTORY_MSG_233;B&W-'After' curve +!HISTORY_MSG_234;B&W-'After' curve type +!HISTORY_MSG_235;B&W-CM-Auto +!HISTORY_MSG_236;--unused-- +!HISTORY_MSG_237;B&W-CM +!HISTORY_MSG_238;GF-Feather +!HISTORY_MSG_240;GF-Center +!HISTORY_MSG_241;VF-Feather +!HISTORY_MSG_242;VF-Roundness +!HISTORY_MSG_243;VC-Radius +HISTORY_MSG_246;L*a*b*-CL曲线 +HISTORY_MSG_247;L*a*b*-LH曲线 +HISTORY_MSG_248;L*a*b*-HH曲线 +!HISTORY_MSG_249;CbDL-Threshold +!HISTORY_MSG_250;NR-Enhanced +!HISTORY_MSG_251;B&W-Algorithm +!HISTORY_MSG_252;CbDL-Skin tar/prot +!HISTORY_MSG_253;CbDL-Reduce artifacts +!HISTORY_MSG_254;CbDL-Skin hue +HISTORY_MSG_255;降噪-中值滤波器 +HISTORY_MSG_256;降噪-中值滤波器-方法 +!HISTORY_MSG_257;Color Toning +!HISTORY_MSG_258;CT-Color curve +!HISTORY_MSG_259;CT-Opacity curve +!HISTORY_MSG_260;CT-a*[b*] opacity +!HISTORY_MSG_261;CT-Method +!HISTORY_MSG_262;CT-b* opacity +!HISTORY_MSG_263;CT-Shadows-Red +!HISTORY_MSG_264;CT-Shadows-Green +!HISTORY_MSG_265;CT-Shadows-Blue +!HISTORY_MSG_266;CT-Mid-Red +!HISTORY_MSG_267;CT-Mid-Green +!HISTORY_MSG_268;CT-Mid-Blue +!HISTORY_MSG_269;CT-High-Red +!HISTORY_MSG_270;CT-High-Green +!HISTORY_MSG_271;CT-High-Blue +!HISTORY_MSG_272;CT-Balance +!HISTORY_MSG_273;CT-Color Balance SMH +!HISTORY_MSG_274;CT-Sat. Shadows +!HISTORY_MSG_275;CT-Sat. Highlights +!HISTORY_MSG_276;CT-Opacity +!HISTORY_MSG_277;--unused-- +!HISTORY_MSG_278;CT-Preserve luminance +!HISTORY_MSG_279;CT-Shadows +!HISTORY_MSG_280;CT-Highlights +!HISTORY_MSG_281;CT-Sat. strength +!HISTORY_MSG_282;CT-Sat. threshold +!HISTORY_MSG_283;CT-Strength +!HISTORY_MSG_284;CT-Auto sat. protection +HISTORY_MSG_285;降噪-中值滤波-方法 +HISTORY_MSG_286;降噪-中值滤波-类型 +HISTORY_MSG_287;降噪-中值滤波-迭代 +HISTORY_MSG_288;平场-溢出控制 +HISTORY_MSG_289;平场-溢出控制-自动 +!HISTORY_MSG_290;Black Level-Red +!HISTORY_MSG_291;Black Level-Green +!HISTORY_MSG_292;Black Level-Blue +HISTORY_MSG_293;胶片模拟 +HISTORY_MSG_294;胶片模拟-力度 +HISTORY_MSG_295;胶片模拟-胶片 +HISTORY_MSG_296;降噪-亮度曲线 +HISTORY_MSG_297;降噪-模式 +HISTORY_MSG_298;坏点过滤器 +HISTORY_MSG_299;降噪-色度曲线 +!HISTORY_MSG_300;- +!HISTORY_MSG_301;NR-Luma control +!HISTORY_MSG_302;NR-Chroma method +!HISTORY_MSG_303;NR-Chroma method +!HISTORY_MSG_304;W-Contrast levels +HISTORY_MSG_305;小波层级 +!HISTORY_MSG_306;W-Process +!HISTORY_MSG_307;W-Process +!HISTORY_MSG_308;W-Process direction +HISTORY_MSG_309;小波-边缘锐度-细节 +!HISTORY_MSG_310;W-Residual-Sky tar/prot +HISTORY_MSG_311;小波-小波层级 +!HISTORY_MSG_312;W-Residual-Shadows threshold +!HISTORY_MSG_313;W-Chroma-Sat/past +!HISTORY_MSG_314;W-Gamut-Reduce artifacts +!HISTORY_MSG_315;W-Residual-Contrast +!HISTORY_MSG_316;W-Gamut-Skin tar/prot +!HISTORY_MSG_317;W-Gamut-Skin hue +!HISTORY_MSG_318;W-Contrast-Highlight levels +!HISTORY_MSG_319;W-Contrast-Highlight range +!HISTORY_MSG_320;W-Contrast-Shadow range +!HISTORY_MSG_321;W-Contrast-Shadow levels +!HISTORY_MSG_322;W-Gamut-Avoid color shift +!HISTORY_MSG_323;W-ES-Local contrast +!HISTORY_MSG_324;W-Chroma-Pastel +!HISTORY_MSG_325;W-Chroma-Saturated +!HISTORY_MSG_326;W-Chroma-Method +!HISTORY_MSG_327;W-Contrast-Apply to +!HISTORY_MSG_328;W-Chroma-Link strength +!HISTORY_MSG_329;W-Toning-Opacity RG +!HISTORY_MSG_330;W-Toning-Opacity BY +!HISTORY_MSG_331;W-Contrast levels-Extra +!HISTORY_MSG_332;W-Tiling method +!HISTORY_MSG_333;W-Residual-Shadows +!HISTORY_MSG_334;W-Residual-Chroma +!HISTORY_MSG_335;W-Residual-Highlights +!HISTORY_MSG_336;W-Residual-Highlights threshold +!HISTORY_MSG_337;W-Residual-Sky hue +HISTORY_MSG_338;小波-边缘锐度-半径 +HISTORY_MSG_339;小波-边缘锐度-力度 +HISTORY_MSG_340;小波-力度 +!HISTORY_MSG_341;W-Edge performance +!HISTORY_MSG_342;W-ES-First level +!HISTORY_MSG_343;W-Chroma levels +!HISTORY_MSG_344;W-Meth chroma sl/cur +!HISTORY_MSG_345;W-ES-Local contrast +!HISTORY_MSG_346;W-ES-Local contrast method +HISTORY_MSG_347;小波-去噪-第1级 +HISTORY_MSG_348;小波-去噪-第2级 +HISTORY_MSG_349;小波-去噪-第3级 +!HISTORY_MSG_350;W-ES-Edge detection +!HISTORY_MSG_351;W-Residual-HH curve +!HISTORY_MSG_352;W-Background +!HISTORY_MSG_353;W-ES-Gradient sensitivity +!HISTORY_MSG_354;W-ES-Enhanced +!HISTORY_MSG_355;W-ES-Threshold low +!HISTORY_MSG_356;W-ES-Threshold high +!HISTORY_MSG_357;W-Denoise-Link with ES +!HISTORY_MSG_358;W-Gamut-CH +!HISTORY_MSG_359;Hot/Dead-Threshold +!HISTORY_MSG_360;TM-Gamma +!HISTORY_MSG_361;W-Final-Chroma balance +!HISTORY_MSG_362;W-Residual-Compression method +!HISTORY_MSG_363;W-Residual-Compression strength +!HISTORY_MSG_364;W-Final-Contrast balance +!HISTORY_MSG_365;W-Final-Delta balance +!HISTORY_MSG_366;W-Residual-Compression gamma +!HISTORY_MSG_367;W-Final-'After' contrast curve +!HISTORY_MSG_368;W-Final-Contrast balance +!HISTORY_MSG_369;W-Final-Balance method +!HISTORY_MSG_370;W-Final-Local contrast curve +HISTORY_MSG_371;调整大小后加锐(PRS) +HISTORY_MSG_372;PRS USM-半径 +HISTORY_MSG_373;PRS USM-数量 +HISTORY_MSG_374;PRS USM-阈值 +HISTORY_MSG_375;PRS USM-仅加锐边缘 +HISTORY_MSG_376;PRS USM-边缘检测半径 +HISTORY_MSG_377;PRS USM-边缘容差 +HISTORY_MSG_378;PRS USM-光晕控制 +HISTORY_MSG_379;PRS USM-光晕控制数量 +HISTORY_MSG_380;PRS-方法 +HISTORY_MSG_381;PRS RLD-半径 +HISTORY_MSG_382;PRS RLD-数量 +HISTORY_MSG_383;PRS RLD-衰减 +HISTORY_MSG_384;PRS RLD-迭代 +!HISTORY_MSG_385;W-Residual-Color Balance +!HISTORY_MSG_386;W-Residual-CB green high +!HISTORY_MSG_387;W-Residual-CB blue high +!HISTORY_MSG_388;W-Residual-CB green mid +!HISTORY_MSG_389;W-Residual-CB blue mid +!HISTORY_MSG_390;W-Residual-CB green low +!HISTORY_MSG_391;W-Residual-CB blue low +!HISTORY_MSG_392;W-Residual-Color Balance +!HISTORY_MSG_393;DCP-Look table +!HISTORY_MSG_394;DCP-Baseline exposure +!HISTORY_MSG_395;DCP-Base table +!HISTORY_MSG_396;W-Contrast sub-tool +!HISTORY_MSG_397;W-Chroma sub-tool +!HISTORY_MSG_398;W-ES sub-tool +!HISTORY_MSG_399;W-Residual sub-tool +!HISTORY_MSG_400;W-Final sub-tool +!HISTORY_MSG_401;W-Toning sub-tool +!HISTORY_MSG_402;W-Denoise sub-tool +!HISTORY_MSG_403;W-ES-Edge sensitivity +!HISTORY_MSG_404;W-ES-Base amplification +HISTORY_MSG_405;小波-去噪-第4级 +!HISTORY_MSG_406;W-ES-Neighboring pixels +!HISTORY_MSG_407;Retinex-Method +!HISTORY_MSG_408;Retinex-Radius +!HISTORY_MSG_409;Retinex-Contrast +!HISTORY_MSG_410;Retinex-Offset +!HISTORY_MSG_411;Retinex-Strength +!HISTORY_MSG_412;Retinex-Gaussian gradient +!HISTORY_MSG_413;Retinex-Contrast +!HISTORY_MSG_414;Retinex-Histogram-Lab +!HISTORY_MSG_415;Retinex-Transmission +!HISTORY_MSG_416;Retinex +!HISTORY_MSG_417;Retinex-Transmission median +!HISTORY_MSG_418;Retinex-Threshold +!HISTORY_MSG_419;Retinex-Color space +!HISTORY_MSG_420;Retinex-Histogram-HSL +!HISTORY_MSG_421;Retinex-Gamma +!HISTORY_MSG_422;Retinex-Gamma +!HISTORY_MSG_423;Retinex-Gamma slope +!HISTORY_MSG_424;Retinex-HL threshold +!HISTORY_MSG_425;Retinex-Log base +!HISTORY_MSG_426;Retinex-Hue equalizer +!HISTORY_MSG_427;Output rendering intent +!HISTORY_MSG_428;Monitor rendering intent +!HISTORY_MSG_429;Retinex-Iterations +!HISTORY_MSG_430;Retinex-Transmission gradient +!HISTORY_MSG_431;Retinex-Strength gradient +!HISTORY_MSG_432;Retinex-M-Highlights +!HISTORY_MSG_433;Retinex-M-Highlights TW +!HISTORY_MSG_434;Retinex-M-Shadows +!HISTORY_MSG_435;Retinex-M-Shadows TW +!HISTORY_MSG_436;Retinex-M-Radius +!HISTORY_MSG_437;Retinex-M-Method +!HISTORY_MSG_438;Retinex-M-Equalizer +!HISTORY_MSG_439;Retinex-Process +!HISTORY_MSG_440;CbDL-Method +!HISTORY_MSG_441;Retinex-Gain transmission +!HISTORY_MSG_442;Retinex-Scale +!HISTORY_MSG_443;Output black point compensation +!HISTORY_MSG_444;WB-Temp bias +HISTORY_MSG_445;Raw子图像 +HISTORY_MSG_449;像素偏移-ISO适应 +HISTORY_MSG_452;像素偏移-显示动体 +HISTORY_MSG_453;像素偏移-仅显示动体蒙版 +HISTORY_MSG_457;像素偏移-检测红/蓝 +HISTORY_MSG_462;像素偏移-检测绿 +HISTORY_MSG_464;像素偏移-动体蒙版模糊 +HISTORY_MSG_465;像素偏移-模糊半径 +HISTORY_MSG_468;像素偏移-填洞 +HISTORY_MSG_469;像素偏移-中值 +HISTORY_MSG_471;像素偏移-动体补正 +HISTORY_MSG_472;像素偏移-顺滑过渡 +HISTORY_MSG_473;像素偏移-使用LMMSE +HISTORY_MSG_474;像素偏移-亮度均等 +HISTORY_MSG_475;像素偏移-均等各通道 +!HISTORY_MSG_476;CAM02-Temp out +!HISTORY_MSG_477;CAM02-Green out +!HISTORY_MSG_478;CAM02-Yb out +!HISTORY_MSG_479;CAM02-CAT02 adaptation out +!HISTORY_MSG_480;CAM02-Automatic CAT02 out +!HISTORY_MSG_481;CAM02-Temp scene +!HISTORY_MSG_482;CAM02-Green scene +!HISTORY_MSG_483;CAM02-Yb scene +!HISTORY_MSG_484;CAM02-Auto Yb scene +HISTORY_MSG_485;镜头矫正 +HISTORY_MSG_486;镜头矫正-相机 +HISTORY_MSG_487;镜头矫正-镜头 +HISTORY_MSG_488;动态范围压缩(DRC) +HISTORY_MSG_489;DRC-细节 +HISTORY_MSG_490;DRC-数量 +HISTORY_MSG_491;白平衡 +HISTORY_MSG_492;RGB曲线 +HISTORY_MSG_493;L*a*b*调整 +HISTORY_MSG_494;捕图加锐 +!HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors +!HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT-Color correction +!HISTORY_MSG_COLORTONING_LABREGION_AB;CT-Color correction +!HISTORY_MSG_COLORTONING_LABREGION_CHANNEL;CT-Channel +!HISTORY_MSG_COLORTONING_LABREGION_CHROMATICITYMASK;CT-region C mask +!HISTORY_MSG_COLORTONING_LABREGION_HUEMASK;CT-H mask +!HISTORY_MSG_COLORTONING_LABREGION_LIGHTNESS;CT-Lightness +!HISTORY_MSG_COLORTONING_LABREGION_LIGHTNESSMASK;CT-L mask +!HISTORY_MSG_COLORTONING_LABREGION_LIST;CT-List +!HISTORY_MSG_COLORTONING_LABREGION_MASKBLUR;CT-region mask blur +!HISTORY_MSG_COLORTONING_LABREGION_OFFSET;CT-region offset +!HISTORY_MSG_COLORTONING_LABREGION_POWER;CT-region power +!HISTORY_MSG_COLORTONING_LABREGION_SATURATION;CT-Saturation +!HISTORY_MSG_COLORTONING_LABREGION_SHOWMASK;CT-region show mask +!HISTORY_MSG_COLORTONING_LABREGION_SLOPE;CT-region slope +HISTORY_MSG_DEHAZE_DEPTH;去雾-纵深值 +HISTORY_MSG_DEHAZE_ENABLED;去雾 +HISTORY_MSG_DEHAZE_LUMINANCE;去雾-仅亮度 +HISTORY_MSG_DEHAZE_SHOW_DEPTH_MAP;去雾-显示纵深蒙版 +HISTORY_MSG_DEHAZE_STRENGTH;去雾-力度 +HISTORY_MSG_DUALDEMOSAIC_AUTO_CONTRAST;双重去马赛克-自动阈值 +HISTORY_MSG_DUALDEMOSAIC_CONTRAST;双重去马赛克-对比度阈值 +HISTORY_MSG_FILMNEGATIVE_ENABLED;胶片负片 +!HISTORY_MSG_FILMNEGATIVE_VALUES;Film negative values +HISTORY_MSG_HISTMATCHING;自适应色调曲线 +!HISTORY_MSG_ICM_OUTPUT_PRIMARIES;Output-Primaries +!HISTORY_MSG_ICM_OUTPUT_TEMP;Output-ICC-v4 illuminant D +!HISTORY_MSG_ICM_OUTPUT_TYPE;Output-Type +!HISTORY_MSG_ICM_WORKING_GAMMA;Working-Gamma +!HISTORY_MSG_ICM_WORKING_SLOPE;Working-Slope +!HISTORY_MSG_ICM_WORKING_TRC_METHOD;Working-TRC method +HISTORY_MSG_LOCALCONTRAST_AMOUNT;局部反差-数量 +HISTORY_MSG_LOCALCONTRAST_DARKNESS;局部反差-黑处 +HISTORY_MSG_LOCALCONTRAST_ENABLED;局部反差 +HISTORY_MSG_LOCALCONTRAST_LIGHTNESS;局部反差-亮处 +HISTORY_MSG_LOCALCONTRAST_RADIUS;局部反差-半径 +HISTORY_MSG_METADATA_MODE;元数据复制模式 +HISTORY_MSG_MICROCONTRAST_CONTRAST;微反差-反差阈值 +HISTORY_MSG_PDSHARPEN_AUTO_CONTRAST;捕图加锐-自动阈值 +HISTORY_MSG_PDSHARPEN_AUTO_RADIUS;捕图加锐-自动半径 +HISTORY_MSG_PDSHARPEN_CHECKITER;捕图加锐-自动限制迭代 +HISTORY_MSG_PDSHARPEN_CONTRAST;捕图加锐-反差阈值 +HISTORY_MSG_PDSHARPEN_ITERATIONS;捕图加锐-迭代 +HISTORY_MSG_PDSHARPEN_RADIUS;捕图加锐-半径 +HISTORY_MSG_PDSHARPEN_RADIUS_BOOST;捕图加锐-边缘半径值提升 +HISTORY_MSG_PIXELSHIFT_DEMOSAIC;像素偏移-动体部分去马赛克算法 +HISTORY_MSG_PREPROCESS_LINEDENOISE_DIRECTION;线状噪点过滤方向 +HISTORY_MSG_PREPROCESS_PDAFLINESFILTER;PDAF条纹过滤 +HISTORY_MSG_PRSHARPEN_CONTRAST;PRS-反差阈值 +HISTORY_MSG_RAWCACORR_AUTOIT;Raw色差矫正-迭代 +HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw色差矫正-避免色偏 +HISTORY_MSG_RAW_BORDER;Raw边界 +HISTORY_MSG_RESIZE_ALLOWUPSCALING;调整大小-允许升采样 +HISTORY_MSG_SHARPENING_BLUR;加锐-模糊半径 +HISTORY_MSG_SHARPENING_CONTRAST;加锐-反差阈值 +HISTORY_MSG_SH_COLORSPACE;阴影/高光-色彩空间 +!HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light +!HISTORY_MSG_SOFTLIGHT_STRENGTH;Soft light-Strength +HISTORY_MSG_TM_FATTAL_ANCHOR;DRC-锚点 +!HISTORY_MSG_TRANS_Method;Geometry-Method +ICCPROFCREATOR_COPYRIGHT;版权: +!ICCPROFCREATOR_COPYRIGHT_RESET_TOOLTIP;Reset to the default copyright, granted to "RawTherapee, CC0" +ICCPROFCREATOR_CUSTOM;自定义 +ICCPROFCREATOR_DESCRIPTION;描述: +!ICCPROFCREATOR_DESCRIPTION_ADDPARAM;Append gamma and slope values to the description +!ICCPROFCREATOR_DESCRIPTION_TOOLTIP;Leave empty to set the default description. +!ICCPROFCREATOR_GAMMA;Gamma +!ICCPROFCREATOR_ICCVERSION;ICC version: +!ICCPROFCREATOR_ILL;Illuminant: +!ICCPROFCREATOR_ILL_41;D41 +!ICCPROFCREATOR_ILL_50;D50 +!ICCPROFCREATOR_ILL_55;D55 +!ICCPROFCREATOR_ILL_60;D60 +!ICCPROFCREATOR_ILL_65;D65 +!ICCPROFCREATOR_ILL_80;D80 +!ICCPROFCREATOR_ILL_DEF;Default +!ICCPROFCREATOR_ILL_INC;StdA 2856K +!ICCPROFCREATOR_ILL_TOOLTIP;You can only set the illuminant for ICC v4 profiles. +!ICCPROFCREATOR_PRIMARIES;Primaries: +!ICCPROFCREATOR_PRIM_ACESP0;ACES AP0 +!ICCPROFCREATOR_PRIM_ACESP1;ACES AP1 +!ICCPROFCREATOR_PRIM_ADOBE;Adobe RGB (1998) +!ICCPROFCREATOR_PRIM_BEST;BestRGB +!ICCPROFCREATOR_PRIM_BETA;BetaRGB +!ICCPROFCREATOR_PRIM_BLUX;Blue X +!ICCPROFCREATOR_PRIM_BLUY;Blue Y +!ICCPROFCREATOR_PRIM_BRUCE;BruceRGB +!ICCPROFCREATOR_PRIM_GREX;Green X +!ICCPROFCREATOR_PRIM_GREY;Green Y +!ICCPROFCREATOR_PRIM_PROPH;Prophoto +!ICCPROFCREATOR_PRIM_REC2020;Rec2020 +!ICCPROFCREATOR_PRIM_REDX;Red X +!ICCPROFCREATOR_PRIM_REDY;Red Y +!ICCPROFCREATOR_PRIM_SRGB;sRGB +!ICCPROFCREATOR_PRIM_TOOLTIP;You can only set custom primaries for ICC v4 profiles. +!ICCPROFCREATOR_PRIM_WIDEG;Widegamut +!ICCPROFCREATOR_PROF_V2;ICC v2 +!ICCPROFCREATOR_PROF_V4;ICC v4 +ICCPROFCREATOR_SAVEDIALOG_TITLE;将ICC档案保存为... +!ICCPROFCREATOR_SLOPE;Slope +!ICCPROFCREATOR_TRC_PRESET;Tone response curve: +!IPTCPANEL_CATEGORYHINT;Identifies the subject of the image in the opinion of the provider. +!IPTCPANEL_CITYHINT;Enter the name of the city pictured in this image. +!IPTCPANEL_COPYRIGHT;Copyright notice +!IPTCPANEL_COPYRIGHTHINT;Enter a Notice on the current owner of the Copyright for this image, such as ©2008 Jane Doe. +!IPTCPANEL_COUNTRYHINT;Enter the name of the country pictured in this image. +!IPTCPANEL_CREATOR;Creator +!IPTCPANEL_CREATORHINT;Enter the name of the person that created this image. +!IPTCPANEL_CREATORJOBTITLE;Creator's job title +!IPTCPANEL_CREATORJOBTITLEHINT;Enter the Job Title of the person listed in the Creator field. +!IPTCPANEL_DATECREATEDHINT;Enter the Date the image was taken. +!IPTCPANEL_DESCRIPTION;Description +!IPTCPANEL_DESCRIPTIONHINT;Enter a "caption" describing the who, what, and why of what is happening in this image, this might include names of people, and/or their role in the action that is taking place within the image. +!IPTCPANEL_DESCRIPTIONWRITER;Description writer +!IPTCPANEL_DESCRIPTIONWRITERHINT;Enter the name of the person involved in writing, editing or correcting the description of the image. +!IPTCPANEL_HEADLINEHINT;Enter a brief publishable synopsis or summary of the contents of the image. +!IPTCPANEL_INSTRUCTIONSHINT;Enter information about embargoes, or other restrictions not covered by the Copyright field. +!IPTCPANEL_KEYWORDSHINT;Enter any number of keywords, terms or phrases used to express the subject matter in the image. +!IPTCPANEL_PROVINCE;Province or state +!IPTCPANEL_PROVINCEHINT;Enter the name of the province or state pictured in this image. +!IPTCPANEL_SOURCEHINT;Enter or edit the name of a person or party who has a role in the content supply chain, such as a person or entity from whom you received this image from. +!IPTCPANEL_SUPPCATEGORIES;Supplemental categories +!IPTCPANEL_SUPPCATEGORIESHINT;Further refines the subject of the image. +!IPTCPANEL_TITLEHINT;Enter a short verbal and human readable name for the image, this may be the file name. +!IPTCPANEL_TRANSREFERENCE;Job ID +!IPTCPANEL_TRANSREFERENCEHINT;Enter a number or identifier needed for workflow control or tracking. +!MAIN_BUTTON_ICCPROFCREATOR;ICC Profile Creator +!MAIN_BUTTON_NAVNEXT_TOOLTIP;Navigate to the next image relative to image opened in the Editor.\nShortcut: Shift-F4\n\nTo navigate to the next image relative to the currently selected thumbnail in the File Browser or Filmstrip:\nShortcut: F4 +!MAIN_BUTTON_NAVPREV_TOOLTIP;Navigate to the previous image relative to image opened in the Editor.\nShortcut: Shift-F3\n\nTo navigate to the previous image relative to the currently selected thumbnail in the File Browser or Filmstrip:\nShortcut: F3 +!MAIN_BUTTON_NAVSYNC_TOOLTIP;Synchronize the File Browser or Filmstrip with the Editor to reveal the thumbnail of the currently opened image, and clear any active filters.\nShortcut: x\n\nAs above, but without clearing active filters:\nShortcut: y\n(Note that the thumbnail of the opened image will not be shown if filtered out). +MAIN_FRAME_PLACES_DEL;移除 +!MAIN_MSG_IMAGEUNPROCESSED;This command requires all selected images to be queue-processed first. +!MAIN_MSG_PATHDOESNTEXIST;The path\n\n%1\n\ndoes not exist. Please set a correct path in Preferences. +!MAIN_MSG_SETPATHFIRST;You first have to set a target path in Preferences in order to use this function! +!MAIN_MSG_TOOMANYOPENEDITORS;Too many open editors.\nPlease close an editor to continue. +!MAIN_MSG_WRITEFAILED;Failed to write\n"%1"\n\nMake sure that the folder exists and that you have write permission to it. +MAIN_TAB_ADVANCED;高级 +MAIN_TAB_ADVANCED_TOOLTIP;快捷键:Alt-a +!MAIN_TAB_FAVORITES;Favorites +MAIN_TAB_FAVORITES_TOOLTIP;快捷键: Alt-u +MAIN_TOOLTIP_BACKCOLOR0;预览图的背景色:基于主题调整\n快捷键:9 +MAIN_TOOLTIP_BACKCOLOR1;预览图的背景色:黑色\n快捷键:9 +MAIN_TOOLTIP_BACKCOLOR2;预览图的背景色:白色\n快捷键:9 +MAIN_TOOLTIP_BACKCOLOR3;预览图的背景色:中灰色\n快捷键:9 +!MAIN_TOOLTIP_BEFOREAFTERLOCK;Lock / Unlock the Before view\n\nLock: keep the Before view unchanged.\nUseful to evaluate the cumulative effect of multiple tools.\nAdditionally, comparisons can be made to any state in the History.\n\nUnlock: the Before view will follow the After view one step behind, showing the image before the effect of the currently used tool. +MAIN_TOOLTIP_PREVIEWB;预览蓝色通道\n快捷键:b +MAIN_TOOLTIP_PREVIEWFOCUSMASK;预览合焦蒙版\n快捷键:Shift-f\n\n在浅景深,噪点少,放大得大的图片中更加精准\n在噪点多的图像中,把图片缩放到10%-30%以提升检测精准度 +MAIN_TOOLTIP_PREVIEWG;预览绿色通道\n快捷键:g +MAIN_TOOLTIP_PREVIEWL;预览亮度\n快捷键:v\n\n0.299*R + 0.587*G + 0.114*B +MAIN_TOOLTIP_PREVIEWSHARPMASK;预览加锐反差蒙版\n快捷键:p +MONITOR_PROFILE_SYSTEM;系统默认 +!OPTIONS_BUNDLED_MISSING;The bundled profile "%1" could not be found!\n\nYour installation could be damaged.\n\nDefault internal values will be used instead. +!OPTIONS_DEFIMG_MISSING;The default profile for non-raw photos could not be found or is not set.\n\nPlease check your profiles' directory, it may be missing or damaged.\n\n"%1" will be used instead. +!OPTIONS_DEFRAW_MISSING;The default profile for raw photos could not be found or is not set.\n\nPlease check your profiles' directory, it may be missing or damaged.\n\n"%1" will be used instead. +PARTIALPASTE_ADVANCEDGROUP;高级设置 +PARTIALPASTE_DEHAZE;去雾 +PARTIALPASTE_FILMNEGATIVE;胶片负片 +PARTIALPASTE_LOCALCONTRAST;局部反差 +!PARTIALPASTE_METADATA;Metadata mode +PARTIALPASTE_PREPROCESS_PDAFLINESFILTER;PDAF条纹过滤器 +!PARTIALPASTE_RAWCACORR_AVOIDCOLORSHIFT;CA avoid color shift +PARTIALPASTE_RAW_BORDER;Raw边界 +!PARTIALPASTE_SOFTLIGHT;Soft light +PARTIALPASTE_TM_FATTAL;动态范围压缩 +PREFERENCES_APPEARANCE;外观 +!PREFERENCES_APPEARANCE_COLORPICKERFONT;Color picker font +PREFERENCES_APPEARANCE_CROPMASKCOLOR;裁剪蒙版颜色 +PREFERENCES_APPEARANCE_MAINFONT;主字体 +PREFERENCES_APPEARANCE_PSEUDOHIDPI;伪-高DPI模式 +PREFERENCES_APPEARANCE_THEME;主题 +PREFERENCES_AUTOSAVE_TP_OPEN;在退出时保存工具的展开/折叠状态 +PREFERENCES_BEHADDALLHINT;将所有选项设为相加模式。\n批量调整栏的处理参数将在图片当前参数的基础上加减 +PREFERENCES_BEHSETALLHINT;将所有选项设为设定模式。\n批量调整栏的处理参数将是绝对值,数值会被显示 +PREFERENCES_CACHECLEAR;清空 +PREFERENCES_CACHECLEAR_ALL;清空所有缓存文件: +!PREFERENCES_CACHECLEAR_ALLBUTPROFILES;Clear all cached files except for cached processing profiles: +!PREFERENCES_CACHECLEAR_ONLYPROFILES;Clear only cached processing profiles: +!PREFERENCES_CACHECLEAR_SAFETY;Only files in the cache are cleared. Processing profiles stored alongside the source images are not touched. +!PREFERENCES_CHUNKSIZES;Tiles per thread +PREFERENCES_CHUNKSIZE_RAW_AMAZE;AMaZE去马赛克 +PREFERENCES_CHUNKSIZE_RAW_CA;Raw色差矫正 +PREFERENCES_CHUNKSIZE_RAW_RCD;RCD去马赛克 +!PREFERENCES_CHUNKSIZE_RAW_XT;Xtrans demosaic +PREFERENCES_CHUNKSIZE_RGB;RGB处理 +PREFERENCES_CROP;裁剪编辑 +PREFERENCES_CROP_AUTO_FIT;自动放大以适应裁剪 +PREFERENCES_CROP_GUIDES;在不编辑裁剪区域时,裁剪区域所显示的辅助方式 +PREFERENCES_CROP_GUIDES_FRAME;方框 +PREFERENCES_CROP_GUIDES_FULL;原来的辅助方式 +PREFERENCES_CROP_GUIDES_NONE;无 +!PREFERENCES_CUSTPROFBUILDHINT;Executable (or script) file called when a new initial processing profile should be generated for an image.\n\nThe path of the communication file (*.ini style, a.k.a. "Keyfile") is added as a command line parameter. It contains various parameters required for the scripts and image Exif to allow a rules-based processing profile generation.\n\nWARNING: You are responsible for using double quotes where necessary if you're using paths containing spaces. +PREFERENCES_DIRECTORIES;目录 +PREFERENCES_EDITORCMDLINE;自定义命令行 +PREFERENCES_FILEBROWSERTOOLBARSINGLEROW;在文件浏览器中显示紧凑的工具栏 +!PREFERENCES_PERFORMANCE_MEASURE;Measure +!PREFERENCES_PERFORMANCE_MEASURE_HINT;Logs processing times in console +PREFERENCES_PERFORMANCE_THREADS;线程 +PREFERENCES_PERFORMANCE_THREADS_LABEL;用于降噪和小波层级的最大线程数(0=自动) +PREFERENCES_SAVE_TP_OPEN_NOW;保存工具的展开/折叠状态 +PREFERENCES_TAB_PERFORMANCE;性能 +PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;内嵌JPEG预览 +!PREFERENCES_THUMBNAIL_INSPECTOR_MODE;Image to show +!PREFERENCES_THUMBNAIL_INSPECTOR_RAW;Neutral raw rendering +!PREFERENCES_THUMBNAIL_INSPECTOR_RAW_IF_NO_JPEG_FULLSIZE;Embedded JPEG if fullsize, neutral raw otherwise +!PROFILEPANEL_COPYPPASTE;Parameters to copy +!PROFILEPANEL_GLOBALPROFILES;Bundled profiles +!PROFILEPANEL_LOADPPASTE;Parameters to load +!PROFILEPANEL_MODE_TIP;Processing profile fill mode.\n\nButton pressed: partial profiles will be converted to full profiles; the missing values will be replaced with hard-coded defaults.\n\nButton released: profiles will be applied as they are, altering only those values which they contain. +!PROFILEPANEL_PASTEPPASTE;Parameters to paste +!PROFILEPANEL_PDYNAMIC;Dynamic +!PROFILEPANEL_PINTERNAL;Neutral +!PROFILEPANEL_SAVEPPASTE;Parameters to save +PROGRESSBAR_DECODING;解码中... +PROGRESSBAR_GREENEQUIL;绿平衡... +PROGRESSBAR_HLREC;高光还原... +PROGRESSBAR_HOTDEADPIXELFILTER;热像素/坏点过滤器... +PROGRESSBAR_LINEDENOISE;线状噪点过滤器... +PROGRESSBAR_PROCESSING_PROFILESAVED;处理配置档案已保存 +PROGRESSBAR_RAWCACORR;Raw色差矫正... +PROGRESSBAR_SNAPSHOT_ADDED;快照已添加 +!PROGRESSDLG_PROFILECHANGEDINBROWSER;Processing profile changed in browser +QINFO_FRAMECOUNT;%2帧 +QINFO_HDR;HDR / %2帧 +QINFO_PIXELSHIFT;像素偏移/ %2帧 +!QUEUE_AUTOSTART_TOOLTIP;Start processing automatically when a new job arrives. +QUEUE_LOCATION_TITLE;输出位置 +!QUEUE_STARTSTOP_TOOLTIP;Start or stop processing the images in the queue.\n\nShortcut: Ctrl+s +SAMPLEFORMAT_0;未知数据格式 +SAMPLEFORMAT_1;8-bit unsigned +SAMPLEFORMAT_2;16-bit unsigned +!SAMPLEFORMAT_4;24-bit LogLuv +!SAMPLEFORMAT_8;32-bit LogLuv +SAMPLEFORMAT_16;16-bit浮点数 +SAMPLEFORMAT_32;24-bit浮点数 +SAMPLEFORMAT_64;32-bit浮点数 +SAVEDLG_FILEFORMAT_FLOAT;浮点数 +!SAVEDLG_SUBSAMP_TOOLTIP;Best compression:\nJ:a:b 4:2:0\nh/v 2/2\nChroma halved horizontally and vertically.\n\nBalanced:\nJ:a:b 4:2:2\nh/v 2/1\nChroma halved horizontally.\n\nBest quality:\nJ:a:b 4:4:4\nh/v 1/1\nNo chroma subsampling. +!SHCSELECTOR_TOOLTIP;Click right mouse button to reset the position of those 3 sliders. +!SOFTPROOF_GAMUTCHECK_TOOLTIP;Highlight pixels with out-of-gamut colors with respect to:\n- the printer profile, if one is set and soft-proofing is enabled,\n- the output profile, if a printer profile is not set and soft-proofing is enabled,\n- the monitor profile, if soft-proofing is disabled. +!SOFTPROOF_TOOLTIP;Soft-proofing simulates the appearance of the image:\n- when printed, if a printer profile is set in Preferences > Color Management,\n- when viewed on a display that uses the current output profile, if a printer profile is not set. +!THRESHOLDSELECTOR_B;Bottom +!THRESHOLDSELECTOR_BL;Bottom-left +!THRESHOLDSELECTOR_BR;Bottom-right +!THRESHOLDSELECTOR_HINT;Hold the Shift key to move individual control points. +!THRESHOLDSELECTOR_T;Top +!THRESHOLDSELECTOR_TL;Top-left +!THRESHOLDSELECTOR_TR;Top-right +!TOOLBAR_TOOLTIP_COLORPICKER;Lockable Color Picker\n\nWhen the tool is active:\n- Add a picker: left-click.\n- Drag a picker: left-click and drag.\n- Delete a picker: right-click.\n- Delete all pickers: Ctrl+Shift+right-click.\n- Revert to hand tool: right-click outside any picker. +!TP_BWMIX_ALGO;Algorithm OYCPM +!TP_BWMIX_ALGO_TOOLTIP;Linear: will produce a normal linear response.\nSpecial effects: will produce special effects by mixing channels non-linearly. +!TP_BWMIX_CC_ENABLED;Adjust complementary color +!TP_BWMIX_CC_TOOLTIP;Enable to allow automatic adjustment of complementary colors in ROYGCBPM mode. +!TP_BWMIX_CHANNEL;Luminance equalizer +!TP_BWMIX_CURVEEDITOR1;'Before' curve +!TP_BWMIX_CURVEEDITOR2;'After' curve +!TP_BWMIX_CURVEEDITOR_AFTER_TOOLTIP;Tone curve, after B&W conversion, at the end of treatment. +!TP_BWMIX_CURVEEDITOR_BEFORE_TOOLTIP;Tone curve, just before B&W conversion.\nMay take into account the color components. +!TP_BWMIX_CURVEEDITOR_LH_TOOLTIP;Luminance according to hue L=f(H).\nPay attention to extreme values as they may cause artifacts. +!TP_BWMIX_FILTER_TOOLTIP;The color filter simulates shots taken with a colored filter placed in front of the lens. Colored filters reduce the transmission of specific color ranges and therefore affect their lightness. E.g. a red filter darkens blue skies. +TP_BWMIX_MET_CHANMIX;通道混合器 +TP_BWMIX_MIXC;通道混合器 +TP_BWMIX_NEUTRAL;重置 +!TP_BWMIX_RGBLABEL;R: %1%% G: %2%% B: %3%% Total: %4%% +!TP_BWMIX_RGBLABEL_HINT;Final RGB factors that take care of all the mixer options.\n"Total" displays the sum of the RGB values:\n- always 100% in relative mode\n- higher (lighter) or lower (darker) than 100% in absolute mode. +!TP_BWMIX_RGB_TOOLTIP;Mix the RGB channels. Use presets for guidance.\nPay attention to negative values that may cause artifacts or erratic behavior. +!TP_BWMIX_SET_HYPERPANCHRO;Hyper Panchromatic +!TP_BWMIX_SET_NORMCONTAST;Normal Contrast +!TP_BWMIX_SET_ORTHOCHRO;Orthochromatic +TP_BWMIX_SET_RGBABS;绝对RGB +TP_BWMIX_SET_RGBREL;相对RGB +!TP_BWMIX_SET_ROYGCBPMABS;Absolute ROYGCBPM +!TP_BWMIX_SET_ROYGCBPMREL;Relative ROYGCBPM +!TP_BWMIX_TCMODE_SATANDVALBLENDING;B&W Saturation and Value Blending +!TP_BWMIX_TCMODE_WEIGHTEDSTD;B&W Weighted Standard +!TP_CBDL_AFT;After Black-and-White +!TP_CBDL_BEF;Before Black-and-White +!TP_CBDL_METHOD;Process located +!TP_CBDL_METHOD_TOOLTIP;Choose whether the Contrast by Detail Levels tool is to be positioned after the Black-and-White tool, which makes it work in L*a*b* space, or before it, which makes it work in RGB space. +!TP_COLORAPP_ABSOLUTELUMINANCE;Absolute luminance +!TP_COLORAPP_ALGO;Algorithm +!TP_COLORAPP_ALGO_ALL;All +!TP_COLORAPP_ALGO_JC;Lightness + Chroma (JC) +!TP_COLORAPP_ALGO_JS;Lightness + Saturation (JS) +!TP_COLORAPP_ALGO_QM;Brightness + Colorfulness (QM) +!TP_COLORAPP_ALGO_TOOLTIP;Lets you choose between parameter subsets or all parameters. +TP_COLORAPP_BADPIXSL;热像素/坏点过滤器 +!TP_COLORAPP_BADPIXSL_TOOLTIP;Suppression of hot/bad (brightly colored) pixels.\n0 = No effect\n1 = Median\n2 = Gaussian.\nAlternatively, adjust the image to avoid very dark shadows.\n\nThese artifacts are due to limitations of CIECAM02. +!TP_COLORAPP_BRIGHT;Brightness (Q) +!TP_COLORAPP_BRIGHT_TOOLTIP;Brightness in CIECAM02 takes into account the white's luminosity and differs from L*a*b* and RGB brightness. +!TP_COLORAPP_CAT02ADAPTATION_TOOLTIP;When setting manually, values above 65 are recommended. +!TP_COLORAPP_CHROMA;Chroma (C) +!TP_COLORAPP_CHROMA_M;Colorfulness (M) +!TP_COLORAPP_CHROMA_M_TOOLTIP;Colorfulness in CIECAM02 differs from L*a*b* and RGB colorfulness. +!TP_COLORAPP_CHROMA_S;Saturation (S) +!TP_COLORAPP_CHROMA_S_TOOLTIP;Saturation in CIECAM02 differs from L*a*b* and RGB saturation. +!TP_COLORAPP_CHROMA_TOOLTIP;Chroma in CIECAM02 differs from L*a*b* and RGB chroma. +!TP_COLORAPP_CIECAT_DEGREE;CAT02 adaptation +!TP_COLORAPP_CONTRAST;Contrast (J) +!TP_COLORAPP_CONTRAST_Q;Contrast (Q) +!TP_COLORAPP_CONTRAST_Q_TOOLTIP;Differs from L*a*b* and RGB contrast. +!TP_COLORAPP_CONTRAST_TOOLTIP;Differs from L*a*b* and RGB contrast. +!TP_COLORAPP_CURVEEDITOR1;Tone curve 1 +!TP_COLORAPP_CURVEEDITOR1_TOOLTIP;Shows the histogram of L* (L*a*b*) before CIECAM02.\nIf the "Show CIECAM02 output histograms in curves" checkbox is enabled, shows the histogram of J or Q after CIECAM02.\n\nJ and Q are not shown in the main histogram panel.\n\nFor final output refer to the main histogram panel. +!TP_COLORAPP_CURVEEDITOR2;Tone curve 2 +!TP_COLORAPP_CURVEEDITOR2_TOOLTIP;Same usage as with the second exposure tone curve. +!TP_COLORAPP_CURVEEDITOR3;Color curve +!TP_COLORAPP_CURVEEDITOR3_TOOLTIP;Adjust either chroma, saturation or colorfulness.\n\nShows the histogram of chromaticity (L*a*b*) before CIECAM02.\nIf the "Show CIECAM02 output histograms in curves" checkbox is enabled, shows the histogram of C, s or M after CIECAM02.\n\nC, s and M are not shown in the main histogram panel.\nFor final output refer to the main histogram panel. +!TP_COLORAPP_DATACIE;CIECAM02 output histograms in curves +!TP_COLORAPP_DATACIE_TOOLTIP;When enabled, histograms in CIECAM02 curves show approximate values/ranges for J or Q, and C, s or M after the CIECAM02 adjustments.\nThis selection does not impact the main histogram panel.\n\nWhen disabled, histograms in CIECAM02 curves show L*a*b* values before CIECAM02 adjustments. +!TP_COLORAPP_FREE;Free temp+green + CAT02 + [output] +!TP_COLORAPP_GAMUT;Gamut control (L*a*b*) +!TP_COLORAPP_GAMUT_TOOLTIP;Allow gamut control in L*a*b* mode. +!TP_COLORAPP_HUE;Hue (h) +!TP_COLORAPP_HUE_TOOLTIP;Hue (h)-angle between 0° and 360°. +!TP_COLORAPP_LABEL;CIE Color Appearance Model 2002 +!TP_COLORAPP_LABEL_SCENE;Scene Conditions +!TP_COLORAPP_LABEL_VIEWING;Viewing Conditions +!TP_COLORAPP_MEANLUMINANCE;Mean luminance (Yb%) +!TP_COLORAPP_MODEL;WP Model +!TP_COLORAPP_MODEL_TOOLTIP;White-Point Model.\n\nWB [RT] + [output]: RT's white balance is used for the scene, CIECAM02 is set to D50, and the output device's white balance is set in Viewing Conditions.\n\nWB [RT+CAT02] + [output]: RT's white balance settings are used by CAT02 and the output device's white balance is set in Viewing Conditions.\n\nFree temp+green + CAT02 + [output]: temp and green are selected by the user, the output device's white balance is set in Viewing Conditions. +!TP_COLORAPP_NEUTRAL;Reset +!TP_COLORAPP_NEUTRAL_TIP;Reset all sliders checkbox and curves to their default values +!TP_COLORAPP_RSTPRO;Red & skin-tones protection +!TP_COLORAPP_RSTPRO_TOOLTIP;Red & skin-tones protection affects both sliders and curves. +!TP_COLORAPP_SURROUND;Surround +!TP_COLORAPP_SURROUND_EXDARK;Extremly Dark (Cutsheet) +!TP_COLORAPP_SURROUND_TOOLTIP;Changes tones and colors to take into account the viewing conditions of the output device.\n\nAverage: Average light environment (standard). The image will not change.\n\nDim: Dim environment (TV). The image will become slightly dark.\n\nDark: Dark environment (projector). The image will become more dark.\n\nExtremly Dark: Extremly dark environment (cutsheet). The image will become very dark. +!TP_COLORAPP_TCMODE_CHROMA;Chroma +!TP_COLORAPP_TCMODE_COLORF;Colorfulness +!TP_COLORAPP_TCMODE_LABEL1;Curve mode 1 +!TP_COLORAPP_TCMODE_LABEL2;Curve mode 2 +!TP_COLORAPP_TCMODE_LABEL3;Curve chroma mode +!TP_COLORAPP_TEMP_TOOLTIP;To select an illuminant, always set Tint=1.\n\nA temp=2856\nD50 temp=5003\nD55 temp=5503\nD65 temp=6504\nD75 temp=7504 +!TP_COLORAPP_TONECIE;Tone mapping using CIECAM02 +!TP_COLORAPP_TONECIE_TOOLTIP;If this option is disabled, tone mapping is done in L*a*b* space.\nIf this option is enabled, tone mapping is done using CIECAM02.\nThe Tone Mapping tool must be enabled for this setting to take effect. +!TP_COLORAPP_VIEWING_ABSOLUTELUMINANCE_TOOLTIP;Absolute luminance of the viewing environment\n(usually 16 cd/m²). +!TP_COLORAPP_WBCAM;WB [RT+CAT02] + [output] +!TP_COLORAPP_WBRT;WB [RT] + [output] +!TP_COLORTONING_AB;o C/L +!TP_COLORTONING_AUTOSAT;Automatic +!TP_COLORTONING_BALANCE;Balance +!TP_COLORTONING_BY;o C/L +!TP_COLORTONING_CHROMAC;Opacity +!TP_COLORTONING_COLOR;Color +!TP_COLORTONING_CURVEEDITOR_CL_TOOLTIP;Chroma opacity as a function of luminance oC=f(L) +!TP_COLORTONING_HIGHLIGHT;Highlights +!TP_COLORTONING_HUE;Hue +!TP_COLORTONING_LAB;L*a*b* blending +!TP_COLORTONING_LABEL;Color Toning +!TP_COLORTONING_LABGRID;L*a*b* color correction grid +!TP_COLORTONING_LABGRID_VALUES;HL: a=%1 b=%2\nS: a=%3 b=%4 +!TP_COLORTONING_LABREGIONS;Color correction regions +!TP_COLORTONING_LABREGION_ABVALUES;a=%1 b=%2 +!TP_COLORTONING_LABREGION_CHANNEL;Channel +!TP_COLORTONING_LABREGION_CHANNEL_ALL;All +!TP_COLORTONING_LABREGION_CHANNEL_B;Blue +!TP_COLORTONING_LABREGION_CHANNEL_G;Green +!TP_COLORTONING_LABREGION_CHANNEL_R;Red +!TP_COLORTONING_LABREGION_CHROMATICITYMASK;C +!TP_COLORTONING_LABREGION_HUEMASK;H +!TP_COLORTONING_LABREGION_LIGHTNESS;Lightness +!TP_COLORTONING_LABREGION_LIGHTNESSMASK;L +!TP_COLORTONING_LABREGION_LIST_TITLE;Correction +!TP_COLORTONING_LABREGION_MASK;Mask +!TP_COLORTONING_LABREGION_MASKBLUR;Mask Blur +!TP_COLORTONING_LABREGION_OFFSET;Offset +!TP_COLORTONING_LABREGION_POWER;Power +!TP_COLORTONING_LABREGION_SATURATION;Saturation +!TP_COLORTONING_LABREGION_SHOWMASK;Show mask +!TP_COLORTONING_LABREGION_SLOPE;Slope +!TP_COLORTONING_LUMA;Luminance +!TP_COLORTONING_LUMAMODE;Preserve luminance +!TP_COLORTONING_LUMAMODE_TOOLTIP;If enabled, when you change color (red, green, cyan, blue, etc.) the luminance of each pixel is preserved. +!TP_COLORTONING_METHOD;Method +!TP_COLORTONING_METHOD_TOOLTIP;"L*a*b* blending", "RGB sliders" and "RGB curves" use interpolated color blending.\n"Color balance (Shadows/Midtones/Highlights)" and "Saturation 2 colors" use direct colors.\n\nThe Black-and-White tool can be enabled when using any color toning method, which allows for color toning. +!TP_COLORTONING_MIDTONES;Midtones +!TP_COLORTONING_NEUTRAL;Reset sliders +!TP_COLORTONING_NEUTRAL_TIP;Reset all values (Shadows, Midtones, Highlights) to default. +!TP_COLORTONING_OPACITY;Opacity +!TP_COLORTONING_RGBCURVES;RGB-Curves +!TP_COLORTONING_RGBSLIDERS;RGB-Sliders +!TP_COLORTONING_SA;Saturation Protection +!TP_COLORTONING_SATURATEDOPACITY;Strength +!TP_COLORTONING_SATURATIONTHRESHOLD;Threshold +!TP_COLORTONING_SHADOWS;Shadows +!TP_COLORTONING_SPLITCO;Shadows/Midtones/Highlights +!TP_COLORTONING_SPLITCOCO;Color Balance Shadows/Midtones/Highlights +!TP_COLORTONING_SPLITLR;Saturation 2 colors +!TP_COLORTONING_STR;Strength +!TP_COLORTONING_STRENGTH;Strength +!TP_COLORTONING_TWO2;Special chroma '2 colors' +!TP_COLORTONING_TWOALL;Special chroma +!TP_COLORTONING_TWOBY;Special a* and b* +!TP_COLORTONING_TWOCOLOR_TOOLTIP;Standard chroma:\nLinear response, a* = b*.\n\nSpecial chroma:\nLinear response, a* = b*, but unbound-try under the diagonal.\n\nSpecial a* and b*:\nLinear response unbound with separate curves for a* and b*. Intended for special effects.\n\nSpecial chroma 2 colors:\nMore predictable. +!TP_COLORTONING_TWOSTD;Standard chroma +!TP_CROP_PPI;PPI +TP_CROP_RESETCROP;重置 +TP_CROP_SELECTCROP;选择区域 +TP_DEFRINGE_THRESHOLD;阈值 +TP_DEHAZE_DEPTH;纵深 +TP_DEHAZE_LABEL;去雾 +TP_DEHAZE_LUMINANCE;仅亮度 +TP_DEHAZE_SHOW_DEPTH_MAP;显示纵深蒙版 +TP_DEHAZE_STRENGTH;力度 +!TP_DIRPYRDENOISE_CHROMINANCE_AMZ;Auto multi-zones +TP_DIRPYRDENOISE_CHROMINANCE_AUTOGLOBAL;全局自动 +TP_DIRPYRDENOISE_CHROMINANCE_BLUEYELLOW;色度—蓝-黄 +TP_DIRPYRDENOISE_CHROMINANCE_CURVE;色度曲线 +!TP_DIRPYRDENOISE_CHROMINANCE_CURVE_TOOLTIP;Increase (multiply) the value of all chrominance sliders.\nThis curve lets you adjust the strength of chromatic noise reduction as a function of chromaticity, for instance to increase the action in areas of low saturation and to decrease it in those of high saturation. +TP_DIRPYRDENOISE_CHROMINANCE_FRAME;色度噪点 +TP_DIRPYRDENOISE_CHROMINANCE_MANUAL;手动 +!TP_DIRPYRDENOISE_CHROMINANCE_MASTER;Chrominance-Master +TP_DIRPYRDENOISE_CHROMINANCE_METHOD;方法 +!TP_DIRPYRDENOISE_CHROMINANCE_METHODADVANCED_TOOLTIP;Manual\nActs on the full image.\nYou control the noise reduction settings manually.\n\nAutomatic global\nActs on the full image.\n9 zones are used to calculate a global chrominance noise reduction setting.\n\nPreview\nActs on the whole image.\nThe part of the image visible in the preview is used to calculate global chrominance noise reduction settings. +!TP_DIRPYRDENOISE_CHROMINANCE_METHOD_TOOLTIP;Manual\nActs on the full image.\nYou control the noise reduction settings manually.\n\nAutomatic global\nActs on the full image.\n9 zones are used to calculate a global chrominance noise reduction setting.\n\nAutomatic multi-zones\nNo preview-works only during saving, but using the "Preview" method by matching the tile size and center to the preview size and center you can get an idea of the expected results.\nThe image is divided into tiles (about 10 to 70 depending on image size) and each tile receives its own chrominance noise reduction settings.\n\nPreview\nActs on the whole image.\nThe part of the image visible in the preview is used to calculate global chrominance noise reduction settings. +!TP_DIRPYRDENOISE_CHROMINANCE_PMZ;Preview multi-zones +!TP_DIRPYRDENOISE_CHROMINANCE_PREVIEW;Preview +!TP_DIRPYRDENOISE_CHROMINANCE_PREVIEWRESIDUAL_INFO_TOOLTIP;Displays the remaining noise levels of the part of the image visible in the preview after wavelet.\n\n>300 Very noisy\n100-300 Noisy\n50-100 A little noisy\n<50 Very low noise\n\nBeware, the values will differ between RGB and L*a*b* mode. The RGB values are less accurate because the RGB mode does not completely separate luminance and chrominance. +!TP_DIRPYRDENOISE_CHROMINANCE_PREVIEW_INFO;Preview size=%1, Center: Px=%2 Py=%3 +TP_DIRPYRDENOISE_CHROMINANCE_PREVIEW_NOISEINFO;当前预览处噪点:中位数=%1 最大=%2 +TP_DIRPYRDENOISE_CHROMINANCE_PREVIEW_NOISEINFO_EMPTY;当前预览处噪点:中位数= - 最大= - +!TP_DIRPYRDENOISE_CHROMINANCE_PREVIEW_TILEINFO;Tile size=%1, Center: Tx=%2 Ty=%3 +TP_DIRPYRDENOISE_CHROMINANCE_REDGREEN;色度—红-绿 +TP_DIRPYRDENOISE_LABEL;降噪 +TP_DIRPYRDENOISE_LUMINANCE_CONTROL;亮度控制 +TP_DIRPYRDENOISE_LUMINANCE_CURVE;亮度曲线 +TP_DIRPYRDENOISE_LUMINANCE_FRAME;亮度噪点 +TP_DIRPYRDENOISE_MAIN_COLORSPACE;色彩空间 +!TP_DIRPYRDENOISE_MAIN_COLORSPACE_LAB;L*a*b* +TP_DIRPYRDENOISE_MAIN_COLORSPACE_TOOLTIP;对于Raw文件,RGB和L*a*b*均可用\n\n非Raw文件只可用L*a*b*空间,不论用户选择了哪个 +!TP_DIRPYRDENOISE_MAIN_GAMMA;Gamma +!TP_DIRPYRDENOISE_MAIN_GAMMA_TOOLTIP;Gamma varies noise reduction strength across the range of tones. Smaller values will target shadows, while larger values will stretch the effect to the brighter tones. +TP_DIRPYRDENOISE_MAIN_MODE;模式 +TP_DIRPYRDENOISE_MAIN_MODE_AGGRESSIVE;激进 +TP_DIRPYRDENOISE_MAIN_MODE_CONSERVATIVE;保守 +TP_DIRPYRDENOISE_MAIN_MODE_TOOLTIP;“保守”会保留低频的色度纹路,而“激进”会消除它们 +TP_DIRPYRDENOISE_MEDIAN_METHOD;中值法 +TP_DIRPYRDENOISE_MEDIAN_METHOD_CHROMINANCE;仅色度 +TP_DIRPYRDENOISE_MEDIAN_METHOD_LAB;L*a*b* +TP_DIRPYRDENOISE_MEDIAN_METHOD_LABEL;中值滤波器 +TP_DIRPYRDENOISE_MEDIAN_METHOD_LUMINANCE;仅亮度 +TP_DIRPYRDENOISE_MEDIAN_METHOD_RGB;RGB +TP_DIRPYRDENOISE_MEDIAN_METHOD_TOOLTIP;当使用“仅亮度”和“L*a*b*”法时,在降噪流水线中,\n中值滤波会在小波被应用后进行。\n当使用“RGB”模式时,它会在降噪流水线的最后被进行 +TP_DIRPYRDENOISE_MEDIAN_METHOD_WEIGHTED;权重L* (小) + a*b* (正常) +TP_DIRPYRDENOISE_MEDIAN_PASSES;中值迭代 +TP_DIRPYRDENOISE_MEDIAN_PASSES_TOOLTIP;使用3x3大小窗口并进行三次中值迭代通常比使用7x7窗口并进行一次迭代的效果更好 +TP_DIRPYRDENOISE_MEDIAN_TYPE;中值类型 +TP_DIRPYRDENOISE_MEDIAN_TYPE_TOOLTIP;使用你想要的窗口大小的中值滤波器。窗口大小越大,处理用时越长。\n3×3柔和:处理3x3窗口中的5个像素。\n3x3:处理3x3窗口里面的9个像素。\n5x5柔和:处理5x5窗口中的13个像素。\n5x5:处理5x5窗口中的25个像素。\n7x7:处理7x7窗口中的49个像素。\n9x9:处理9x9窗口中的81个像素。\n\n有时使用小窗口进行多次迭代的效果会优于使用大窗口进行一次迭代的效果 +TP_DIRPYRDENOISE_TYPE_3X3;3×3 +TP_DIRPYRDENOISE_TYPE_3X3SOFT;3×3柔和 +TP_DIRPYRDENOISE_TYPE_5X5;5×5 +TP_DIRPYRDENOISE_TYPE_5X5SOFT;5×5柔和 +TP_DIRPYRDENOISE_TYPE_7X7;7×7 +TP_DIRPYRDENOISE_TYPE_9X9;9×9 +!TP_DIRPYREQUALIZER_ALGO_TOOLTIP;Fine: closer to the colors of the skin, minimizing the action on other colors\nLarge: avoid more artifacts. +!TP_DIRPYREQUALIZER_HUESKIN_TOOLTIP;This pyramid is for the upper part, so far as the algorithm at its maximum efficiency.\nTo the lower part, the transition zones.\nIf you need to move the area significantly to the left or right-or if there are artifacts: the white balance is incorrect\nYou can slightly reduce the zone to prevent the rest of the image is affected. +!TP_DIRPYREQUALIZER_SKIN_TOOLTIP;At -100 skin-tones are targetted.\nAt 0 all tones are treated equally.\nAt +100 skin-tones are protected while all other tones are affected. +!TP_DIRPYREQUALIZER_TOOLTIP;Attempts to reduce artifacts in the transitions between skin colors (hue, chroma, luma) and the rest of the image. +!TP_DISTORTION_AUTO_TIP;Automatically corrects lens distortion in raw files by matching it against the embedded JPEG image if one exists and has had its lens disortion auto-corrected by the camera. +!TP_EPD_EDGESTOPPING;Edge stopping +!TP_EPD_GAMMA;Gamma +!TP_EPD_REWEIGHTINGITERATES;Reweighting iterates +!TP_EXPOSURE_AUTOLEVELS_TIP;Toggles execution of Auto Levels to automatically set Exposure slider values based on an image analysis.\nEnables Highlight Reconstruction if necessary. +!TP_EXPOSURE_CLAMPOOG;Clip out-of-gamut colors +!TP_EXPOSURE_CLIP_TIP;The fraction of pixels to be clipped in Auto Levels operation. +TP_EXPOSURE_HISTMATCHING;自适应色调曲线 +TP_EXPOSURE_HISTMATCHING_TOOLTIP;自动调整滑条和曲线(不包括曝光补偿)以使图片贴近于内嵌于Raw的JPEG预览图 +TP_EXPOSURE_TCMODE_LUMINANCE;亮度 +TP_EXPOSURE_TCMODE_PERCEPTUAL;感知性 +!TP_EXPOS_BLACKPOINT_LABEL;Raw Black Points +!TP_EXPOS_WHITEPOINT_LABEL;Raw White Points +!TP_FILMNEGATIVE_BLUE;Blue ratio +!TP_FILMNEGATIVE_GREEN;Reference exponent (contrast) +!TP_FILMNEGATIVE_GUESS_TOOLTIP;Automatically set the red and blue ratios by picking two patches which had a neutral hue (no color) in the original scene. The patches should differ in brightness. Set the white balance afterwards. +TP_FILMNEGATIVE_LABEL;胶片负片 +!TP_FILMNEGATIVE_PICK;Pick neutral spots +!TP_FILMNEGATIVE_RED;Red ratio +TP_FILMSIMULATION_LABEL;胶片模拟 +TP_FILMSIMULATION_SLOWPARSEDIR;RawTherapee默认会寻找用于胶片模拟工具的Hald CLUT图像,图像所在的文件夹加载时间比较长。\n前往参数设置-图片处理-Hald CLUT路径\n以寻找被使用的文件夹是哪个。你应该把这个文件夹指向一个只有Hald CLUT图像而没有其他图片的文件夹,而如果你不想用胶片模拟功能,就把它指向一个空文件夹。\n\n阅读RawPedia的Film Simulation词条以获取更多信息。\n\n你现在想取消扫描吗? +TP_FILMSIMULATION_STRENGTH;力度 +TP_FILMSIMULATION_ZEROCLUTSFOUND;在参数设置中设定HaldCLUT目录 +TP_FLATFIELD_CLIPCONTROL;溢出控制 +TP_FLATFIELD_CLIPCONTROL_TOOLTIP;溢出控制能够避免由于平场的应用而导致的高光溢出。如果在应用平场之前就有溢出的高光,数值就会为0 +TP_GENERAL_11SCALE_TOOLTIP;此工具的效果仅在以1:1大小预览时才可见/准确 +TP_GRADIENT_CENTER_X_TOOLTIP;将渐变滤镜向左(负值)或向右(正值)移动 +TP_GRADIENT_CENTER_Y_TOOLTIP;将渐变滤镜向上(负值)或向下(正值)移动 +TP_GRADIENT_STRENGTH_TOOLTIP;滤镜的强度(档数) +!TP_HLREC_ENA_TOOLTIP;Could be activated by Auto Levels. +!TP_ICM_APPLYBASELINEEXPOSUREOFFSET;Baseline exposure +!TP_ICM_APPLYBASELINEEXPOSUREOFFSET_TOOLTIP;Employ the embedded DCP baseline exposure offset. The setting is only available if the selected DCP has one. +!TP_ICM_APPLYHUESATMAP;Base table +!TP_ICM_APPLYHUESATMAP_TOOLTIP;Employ the embedded DCP base table (HueSatMap). The setting is only available if the selected DCP has one. +!TP_ICM_APPLYLOOKTABLE;Look table +!TP_ICM_APPLYLOOKTABLE_TOOLTIP;Employ the embedded DCP look table. The setting is only available if the selected DCP has one. +!TP_ICM_BPC;Black Point Compensation +!TP_ICM_DCPILLUMINANT;Illuminant +!TP_ICM_DCPILLUMINANT_INTERPOLATED;Interpolated +!TP_ICM_DCPILLUMINANT_TOOLTIP;Select which embedded DCP illuminant to employ. Default is "interpolated" which is a mix between the two based on white balance. The setting is only available if a dual-illuminant DCP with interpolation support is selected. +!TP_ICM_INPUTCAMERAICC;Auto-matched camera profile +!TP_ICM_INPUTCAMERAICC_TOOLTIP;Use RawTherapee's camera-specific DCP or ICC input color profiles. These profiles are more precise than simpler matrix ones. They are not available for all cameras. These profiles are stored in the /iccprofiles/input and /dcpprofiles folders and are automatically retrieved based on a file name matching to the exact model name of the camera. +!TP_ICM_INPUTCAMERA_TOOLTIP;Use a simple color matrix from dcraw, an enhanced RawTherapee version (whichever is available based on camera model) or one embedded in the DNG. +!TP_ICM_INPUTNONE_TOOLTIP;Use no input color profile at all.\nUse only in special cases. +!TP_ICM_PROFILEINTENT;Rendering Intent +!TP_ICM_SAVEREFERENCE;Save Reference Image +!TP_ICM_SAVEREFERENCE_APPLYWB;Apply white balance +!TP_ICM_SAVEREFERENCE_APPLYWB_TOOLTIP;Generally, apply the white balance when saving images to create ICC profiles, and do not apply the white balance to create DCP profiles. +!TP_ICM_SAVEREFERENCE_TOOLTIP;Save the linear TIFF image before the input profile is applied. The result can be used for calibration purposes and generation of a camera profile. +!TP_ICM_TONECURVE_TOOLTIP;Employ the embedded DCP tone curve. The setting is only available if the selected DCP has a tone curve. +!TP_ICM_WORKING_TRC;Tone response curve: +!TP_ICM_WORKING_TRC_CUSTOM;Custom +!TP_ICM_WORKING_TRC_GAMMA;Gamma +!TP_ICM_WORKING_TRC_NONE;None +!TP_ICM_WORKING_TRC_SLOPE;Slope +!TP_ICM_WORKING_TRC_TOOLTIP;Only for built-in profiles. +TP_LABCURVE_CHROMA_TOOLTIP;若要应用黑白色调,将色度值降低为-100 +!TP_LABCURVE_CURVEEDITOR_A_RANGE1;Green Saturated +!TP_LABCURVE_CURVEEDITOR_A_RANGE2;Green Pastel +!TP_LABCURVE_CURVEEDITOR_A_RANGE3;Red Pastel +!TP_LABCURVE_CURVEEDITOR_A_RANGE4;Red Saturated +!TP_LABCURVE_CURVEEDITOR_B_RANGE1;Blue Saturated +!TP_LABCURVE_CURVEEDITOR_B_RANGE2;Blue Pastel +!TP_LABCURVE_CURVEEDITOR_B_RANGE3;Yellow Pastel +!TP_LABCURVE_CURVEEDITOR_B_RANGE4;Yellow Saturated +!TP_LABCURVE_CURVEEDITOR_CC;CC +!TP_LABCURVE_CURVEEDITOR_CC_RANGE1;Neutral +!TP_LABCURVE_CURVEEDITOR_CC_RANGE2;Dull +!TP_LABCURVE_CURVEEDITOR_CC_RANGE3;Pastel +!TP_LABCURVE_CURVEEDITOR_CC_RANGE4;Saturated +TP_LABCURVE_CURVEEDITOR_CC_TOOLTIP;根据色度(C)调整色度(C),C=f(C) +!TP_LABCURVE_CURVEEDITOR_CH;CH +TP_LABCURVE_CURVEEDITOR_CH_TOOLTIP;根据色相(H)调整色度(C),C=f(H) +!TP_LABCURVE_CURVEEDITOR_CL;CL +TP_LABCURVE_CURVEEDITOR_CL_TOOLTIP;根据亮度(L)调整色度(C),C=f(L) +!TP_LABCURVE_CURVEEDITOR_HH;HH +TP_LABCURVE_CURVEEDITOR_HH_TOOLTIP;根据色相(H)调整色相(H),H=f(H) +!TP_LABCURVE_CURVEEDITOR_LC;LC +TP_LABCURVE_CURVEEDITOR_LC_TOOLTIP;根据色度(C)调整亮度(L),L=f(C) +!TP_LABCURVE_CURVEEDITOR_LH;LH +TP_LABCURVE_CURVEEDITOR_LH_TOOLTIP;根据色相(H)调整亮度(L),L=f(H) +TP_LABCURVE_CURVEEDITOR_LL_TOOLTIP;根据亮度(L)调整亮度(L),L=f(L) +TP_LABCURVE_LCREDSK;将LC曲线的效果限定于红色和肤色 +TP_LABCURVE_LCREDSK_TIP;勾选该选项框,LC曲线就只会影响红色和肤色。\n取消勾选,它的效果就会应用到所有色彩上。 +TP_LABCURVE_RSTPROTECTION;红色与肤色保护 +TP_LABCURVE_RSTPRO_TOOLTIP;作用在色度滑条和CC曲线的调整上。 +TP_LENSGEOM_LIN;线性 +TP_LENSGEOM_LOG;对数 +TP_LENSPROFILE_CORRECTION_AUTOMATCH;自动选择 +TP_LENSPROFILE_CORRECTION_LCPFILE;LCP文件 +TP_LENSPROFILE_CORRECTION_MANUAL;手动选择 +TP_LENSPROFILE_LENS_WARNING;警告:制作镜头档案时相机所用的裁切系数比本图片拍摄时\n所使用的裁剪系数更大。矫正结果可能出现错误。 +TP_LENSPROFILE_MODE_HEADER;镜头档案 +TP_LENSPROFILE_USE_CA;色差 +TP_LENSPROFILE_USE_GEOMETRIC;几何畸变 +TP_LENSPROFILE_USE_HEADER;矫正 +TP_LENSPROFILE_USE_VIGNETTING;暗角 +TP_LOCALCONTRAST_AMOUNT;数量 +TP_LOCALCONTRAST_DARKNESS;黑处等级 +TP_LOCALCONTRAST_LABEL;局部反差 +TP_LOCALCONTRAST_LIGHTNESS;亮处等级 +TP_LOCALCONTRAST_RADIUS;半径 +TP_METADATA_EDIT;应用修改 +TP_METADATA_MODE;元数据复制模式 +TP_METADATA_STRIP;移除所有元数据 +!TP_METADATA_TUNNEL;Copy unchanged +TP_NEUTRAL;重置 +!TP_NEUTRAL_TIP;将各个曝光控制滑条的值还原。\n自动色阶所能调整的滑条都会被此还原,不论你是否使用了自动色阶功能 +TP_PCVIGNETTE_FEATHER_TOOLTIP;羽化:\n0 = 仅边角,\n50 = 到达一半的位置,\n100 = 到达中心 +TP_PCVIGNETTE_ROUNDNESS_TOOLTIP;圆度:\n0 = 矩形,\n50 = 适于图像的椭圆\n100 = 圆形 +TP_PDSHARPENING_LABEL;捕图加锐 +TP_PFCURVE_CURVEEDITOR_CH;色相 +TP_PFCURVE_CURVEEDITOR_CH_TOOLTIP;控制去除某个色彩的色边的力度。\n越向上 = 越强,\n越向下 = 越弱 +TP_PREPROCESS_DEADPIXFILT;坏点过滤器 +TP_PREPROCESS_DEADPIXFILT_TOOLTIP;尝试过滤坏点 +TP_PREPROCESS_GREENEQUIL;绿平衡 +TP_PREPROCESS_HOTPIXFILT;热像素过滤器 +TP_PREPROCESS_HOTPIXFILT_TOOLTIP;尝试过滤热像素 +TP_PREPROCESS_LINEDENOISE_DIRECTION;方向 +TP_PREPROCESS_LINEDENOISE_DIRECTION_BOTH;双向 +TP_PREPROCESS_LINEDENOISE_DIRECTION_HORIZONTAL;横向 +TP_PREPROCESS_LINEDENOISE_DIRECTION_PDAF_LINES;横向,只在PDAF点所在的行上 +TP_PREPROCESS_LINEDENOISE_DIRECTION_VERTICAL;纵向 +TP_PREPROCESS_PDAFLINESFILTER;PDAF条纹过滤器 +TP_PRSHARPENING_LABEL;调整大小后加锐 +TP_PRSHARPENING_TOOLTIP;在调整图片大小后加锐图像。仅在选择"Lanczos"算法时可用。\n本工具的效果无法预览。见RawPedia的文章以了解本工具的使用教程 +TP_RAWCACORR_AUTOIT;迭代 +TP_RAWCACORR_AUTOIT_TOOLTIP;若“自动矫正”被勾选,此设置便可用。\n自动矫正是保守的,也就是说它经常不会去除所有色差。\n要移除全部色差,你可以使用至多迭代五次的色差矫正迭代。\n每次迭代会纠正上个迭代未能修正的色差,代价是需要花费额外的处理时间 +TP_RAWCACORR_AVOIDCOLORSHIFT;避免偏色 +TP_RAWCACORR_LABEL;色差矫正 +!TP_RAWEXPOS_BLACK_0;Green 1 (lead) +!TP_RAWEXPOS_BLACK_1;Red +!TP_RAWEXPOS_BLACK_2;Blue +!TP_RAWEXPOS_BLACK_3;Green 2 +!TP_RAWEXPOS_BLACK_BLUE;Blue +!TP_RAWEXPOS_BLACK_GREEN;Green +!TP_RAWEXPOS_BLACK_RED;Red +!TP_RAWEXPOS_LINEAR;White-point correction +TP_RAWEXPOS_RGB;红,绿,蓝 +!TP_RAWEXPOS_TWOGREEN;Link greens +!TP_RAW_1PASSMEDIUM;1-pass (Markesteijn) +!TP_RAW_2PASS;1-pass+fast +!TP_RAW_3PASSBEST;3-pass (Markesteijn) +!TP_RAW_4PASS;3-pass+fast +TP_RAW_AHD;AHD +TP_RAW_AMAZE;AMaZE +TP_RAW_AMAZEVNG4;AMaZE+VNG4 +TP_RAW_BORDER;边界 +TP_RAW_DCB;DCB +TP_RAW_DCBENHANCE;DCB优化 +TP_RAW_DCBITERATIONS;DCB迭代数 +TP_RAW_DCBVNG4;DCB+VNG4 +TP_RAW_DMETHOD;方法 +TP_RAW_DMETHOD_PROGRESSBAR;%1 去马赛克中... +TP_RAW_DMETHOD_PROGRESSBAR_REFINE;去马赛克精细化... +TP_RAW_DMETHOD_TOOLTIP;注:IGV和LMMSE是专门用于配合降噪工具,在为高ISO图片降噪时不产生迷宫状噪点,色调分离或是褪色所用的。\n像素偏移是为宾得/索尼的像素偏移文件所用的。此算法将使用AMaZE算法来处理非像素偏移文件 +TP_RAW_DUALDEMOSAICAUTOCONTRAST;自动阈值 +TP_RAW_DUALDEMOSAICAUTOCONTRAST_TOOLTIP;如果勾选框被打勾(推荐如此做),RawTherapee会根据图片中的平缓区域自动计算一个最优值。\n如果图像中没有平缓的区域,或是图片噪点太多,该数值会被设为0\n若想手动调整此数值,首先要将勾选框取消勾选(合适的值取决于具体图像的情况) +TP_RAW_DUALDEMOSAICCONTRAST;反差阈值 +TP_RAW_EAHD;EAHD +TP_RAW_FALSECOLOR;伪色抑制步长 +TP_RAW_FAST;Fast +TP_RAW_HD;阈值 +TP_RAW_HD_TOOLTIP;更低的数值会使热像素/坏点的检测更加激进,但是“宁错杀,不放过”的激进程度可能会导致杂点的产生。在启用本功能后,如果你发现了新出现的杂点,就逐渐提高阈值,直至杂点消失 +TP_RAW_HPHD;HPHD +TP_RAW_IGV;IGV +TP_RAW_IMAGENUM;子图像 +TP_RAW_IMAGENUM_SN;SN模式 +TP_RAW_IMAGENUM_TOOLTIP;某些Raw文件包含多张子图像(宾得/索尼的像素偏移,宾得的3张合并HDR,佳能的双像素,富士的EXR)。\n\n当使用除像素偏移外的任意一个去马赛克算法时,本栏用来选择哪帧子图像被处理。\n\n当在像素偏移的Raw文件上使用像素偏移去马赛克算法时,所有子图像都会被应用,此时本栏用来选择哪帧子图像被用来处理动体 +TP_RAW_LABEL;去马赛克 +!TP_RAW_LMMSE;LMMSE +TP_RAW_LMMSEITERATIONS;LMMSE优化步长 +TP_RAW_LMMSE_TOOLTIP;添加gamma(步长1),中位数(步长2-4)和精细化(步长5-6)以减少杂点并提升信噪比 +TP_RAW_MONO;黑白 +TP_RAW_NONE;无(显示传感器阵列) +TP_RAW_PIXELSHIFT;像素偏移 +TP_RAW_PIXELSHIFTBLUR;动体蒙版模糊 +TP_RAW_PIXELSHIFTDMETHOD;动体区域的去马赛克算法 +TP_RAW_PIXELSHIFTEPERISO;敏感度 +TP_RAW_PIXELSHIFTEPERISO_TOOLTIP;默认值0在原生ISO下应该具有不错的效果。\n更大的数值会增强动体检测的敏感度。\n以微小的步长调整此值,同时观察动体蒙版的变化。\n对于欠曝/高ISO的照片,应提高此值 +TP_RAW_PIXELSHIFTEQUALBRIGHT;将不同照片的亮度均等化 +TP_RAW_PIXELSHIFTEQUALBRIGHTCHANNEL;将各个通道分别均等化 +TP_RAW_PIXELSHIFTEQUALBRIGHTCHANNEL_TOOLTIP;启用:对RGB通道分别进行均等化。\n禁用:使用同一个均等化系数对所有通道进行均等化 +TP_RAW_PIXELSHIFTEQUALBRIGHT_TOOLTIP;以当前被选中的一帧图像为基准,均等化各帧图像的亮度。\n如果各帧中有过曝的区域,应选择最亮的一帧以避免过曝区域出现紫色,也可启用动体补正来解决该问题 +TP_RAW_PIXELSHIFTGREEN;检查绿色通道以检测动体 +TP_RAW_PIXELSHIFTHOLEFILL;填补动体蒙版的洞 +TP_RAW_PIXELSHIFTHOLEFILL_TOOLTIP;填补动体蒙版中间所存在的洞 +TP_RAW_PIXELSHIFTMEDIAN;对动体区域使用中值 +TP_RAW_PIXELSHIFTMEDIAN_TOOLTIP;对于运动的部分,使用所有图片的中值,而不是用户选择的某一帧图片。\n移除在所有图片中位置都不同的物体。\n在移动慢(重叠)的物体上会产生动体效果 +TP_RAW_PIXELSHIFTMM_AUTO;自动 +TP_RAW_PIXELSHIFTMM_CUSTOM;自定义 +TP_RAW_PIXELSHIFTMM_OFF;关闭 +TP_RAW_PIXELSHIFTMOTIONMETHOD;动体补正 +TP_RAW_PIXELSHIFTNONGREENCROSS;检查红/蓝色通道以检测动体 +TP_RAW_PIXELSHIFTSHOWMOTION;显示动体蒙版 +TP_RAW_PIXELSHIFTSHOWMOTIONMASKONLY;仅显示动体蒙版 +TP_RAW_PIXELSHIFTSHOWMOTIONMASKONLY_TOOLTIP;显示没有照片的动体蒙版 +TP_RAW_PIXELSHIFTSHOWMOTION_TOOLTIP;在图像上用绿色蒙版显示动体区域 +TP_RAW_PIXELSHIFTSIGMA;模糊半径 +TP_RAW_PIXELSHIFTSIGMA_TOOLTIP;默认半径值1.0一般对于原生ISO来说足够好。\n对于高ISO照片,提高此值,5.0是不错的起始点。\n在改变此值的同时关注动体蒙版 +TP_RAW_PIXELSHIFTSMOOTH;顺滑过渡 +TP_RAW_PIXELSHIFTSMOOTH_TOOLTIP;让存在动体的区域与没有动体之间的区域之间顺滑地过渡。\n将此值设置为0以禁用顺滑过渡\n将此值设置为1以使用AMaZE/LMMSE算法(这取决于你是否选择了“使用LMMSE”)所解出的你所选择的那一帧图像,如果你选择了“使用中值”,那么就会根据通过所有图像计算出的中值解出图像 +TP_RAW_RCD;RCD +TP_RAW_RCDVNG4;RCD+VNG4 +TP_RAW_SENSOR_BAYER_LABEL;拜耳阵列传感器 +!TP_RAW_SENSOR_XTRANS_DMETHOD_TOOLTIP;3-pass gives best results (recommended for low ISO images).\n1-pass is almost undistinguishable from 3-pass for high ISO images and is faster.\n+fast gives less artifacts in flat areas +!TP_RAW_SENSOR_XTRANS_LABEL;Sensor with X-Trans Matrix +!TP_RAW_VNG4;VNG4 +!TP_RAW_XTRANS;X-Trans +!TP_RAW_XTRANSFAST;Fast X-Trans +TP_RESIZE_ALLOW_UPSCALING;允许升采样 +TP_RESIZE_APPLIESTO;应用到: +TP_RETINEX_CONTEDIT_HSL;HSL直方图 +TP_RETINEX_CONTEDIT_LAB;L*a*b*直方图 +TP_RETINEX_CONTEDIT_LH;色调 +TP_RETINEX_CONTEDIT_MAP;均衡器 +!TP_RETINEX_CURVEEDITOR_CD;L=f(L) +!TP_RETINEX_CURVEEDITOR_CD_TOOLTIP;Luminance according to luminance L=f(L)\nCorrect raw data to reduce halos and artifacts. +!TP_RETINEX_CURVEEDITOR_LH;Strength=f(H) +!TP_RETINEX_CURVEEDITOR_LH_TOOLTIP;Strength according to hue Strength=f(H)\nThis curve also acts on chroma when using the "Highlight" retinex method. +!TP_RETINEX_CURVEEDITOR_MAP;L=f(L) +!TP_RETINEX_CURVEEDITOR_MAP_TOOLTIP;This curve can be applied alone or with a Gaussian mask or wavelet mask.\nBeware of artifacts! +TP_RETINEX_EQUAL;均衡器 +!TP_RETINEX_FREEGAMMA;Free gamma +!TP_RETINEX_GAIN;Gain +!TP_RETINEX_GAINOFFS;Gain and Offset (brightness) +!TP_RETINEX_GAINTRANSMISSION;Gain transmission +!TP_RETINEX_GAINTRANSMISSION_TOOLTIP;Amplify or reduce the transmission map to achieve the desired luminance.\nThe x-axis is the transmission.\nThe y-axis is the gain. +!TP_RETINEX_GAMMA;Gamma +!TP_RETINEX_GAMMA_FREE;Free +!TP_RETINEX_GAMMA_HIGH;High +!TP_RETINEX_GAMMA_LOW;Low +!TP_RETINEX_GAMMA_MID;Middle +!TP_RETINEX_GAMMA_NONE;None +!TP_RETINEX_GAMMA_TOOLTIP;Restore tones by applying gamma before and after Retinex. Different from Retinex curves or others curves (Lab, Exposure, etc.). +!TP_RETINEX_GRAD;Transmission gradient +!TP_RETINEX_GRADS;Strength gradient +!TP_RETINEX_GRADS_TOOLTIP;If slider at 0, all iterations are identical.\nIf > 0 Strength is reduced when iterations increase, and conversely. +!TP_RETINEX_GRAD_TOOLTIP;If slider at 0, all iterations are identical.\nIf > 0 Variance and Threshold are reduced when iterations increase, and conversely. +!TP_RETINEX_HIGH;High +!TP_RETINEX_HIGHLIG;Highlight +!TP_RETINEX_HIGHLIGHT;Highlight threshold +!TP_RETINEX_HIGHLIGHT_TOOLTIP;Increase action of High algorithm.\nMay require you to re-adjust "Neighboring pixels" and to increase the "White-point correction" in the Raw tab -> Raw White Points tool. +!TP_RETINEX_HSLSPACE_LIN;HSL-Linear +!TP_RETINEX_HSLSPACE_LOG;HSL-Logarithmic +!TP_RETINEX_ITER;Iterations (Tone-mapping) +!TP_RETINEX_ITERF;Tone mapping +!TP_RETINEX_ITER_TOOLTIP;Simulate a tone-mapping operator.\nHigh values increase the processing time. +!TP_RETINEX_LABEL;Retinex +!TP_RETINEX_LABEL_MASK;Mask +!TP_RETINEX_LABSPACE;L*a*b* +!TP_RETINEX_LOW;Low +!TP_RETINEX_MAP;Method +!TP_RETINEX_MAP_GAUS;Gaussian mask +!TP_RETINEX_MAP_MAPP;Sharp mask (wavelet partial) +!TP_RETINEX_MAP_MAPT;Sharp mask (wavelet total) +!TP_RETINEX_MAP_METHOD_TOOLTIP;Use the mask generated by the Gaussian function above (Radius, Method) to reduce halos and artifacts.\n\nCurve only: apply a diagonal contrast curve on the mask.\nBeware of artifacts!\n\nGaussian mask: generate and use a Gaussian blur of the original mask.\nQuick.\n\nSharp mask: generate and use a wavelet on the original mask.\nSlow. +!TP_RETINEX_MAP_NONE;None +!TP_RETINEX_MEDIAN;Transmission median filter +!TP_RETINEX_METHOD;Method +!TP_RETINEX_METHOD_TOOLTIP;Low = Reinforce low light.\nUniform = Equalize action.\nHigh = Reinforce high light.\nHighlights = Remove magenta in highlights. +!TP_RETINEX_MLABEL;Restored haze-free Min=%1 Max=%2 +!TP_RETINEX_MLABEL_TOOLTIP;Should be near min=0 max=32768\nRestored image with no mixture. +!TP_RETINEX_NEIGHBOR;Radius +!TP_RETINEX_NEUTRAL;Reset +!TP_RETINEX_NEUTRAL_TIP;Reset all sliders and curves to their default values. +!TP_RETINEX_OFFSET;Offset (brightness) +!TP_RETINEX_SCALES;Gaussian gradient +!TP_RETINEX_SCALES_TOOLTIP;If slider at 0, all iterations are identical.\nIf > 0 Scale and radius are reduced when iterations increase, and conversely. +!TP_RETINEX_SETTINGS;Settings +!TP_RETINEX_SKAL;Scale +!TP_RETINEX_SLOPE;Free gamma slope +!TP_RETINEX_STRENGTH;Strength +!TP_RETINEX_THRESHOLD;Threshold +!TP_RETINEX_THRESHOLD_TOOLTIP;Limits in/out.\nIn = image source,\nOut = image gauss. +!TP_RETINEX_TLABEL;TM Min=%1 Max=%2 Mean=%3 Sigma=%4 +!TP_RETINEX_TLABEL2;TM Tm=%1 TM=%2 +!TP_RETINEX_TLABEL_TOOLTIP;Transmission map result.\nMin and Max are used by Variance.\nMean and Sigma.\nTm=Min TM=Max of transmission map. +!TP_RETINEX_TRANF;Transmission +!TP_RETINEX_TRANSMISSION;Transmission map +!TP_RETINEX_TRANSMISSION_TOOLTIP;Transmission according to transmission.\nAbscissa: transmission from negative values (min), mean, and positives values (max).\nOrdinate: amplification or reduction. +!TP_RETINEX_UNIFORM;Uniform +!TP_RETINEX_VARIANCE;Contrast +!TP_RETINEX_VARIANCE_TOOLTIP;Low variance increase local contrast and saturation, but can lead to artifacts. +!TP_RETINEX_VIEW;Process +!TP_RETINEX_VIEW_MASK;Mask +!TP_RETINEX_VIEW_METHOD_TOOLTIP;Standard-Normal display.\nMask- Displays the mask.\nUnsharp mask-Displays the image with a high radius unsharp mask.\nTransmission-Auto/Fixed-Displays the file transmission-map, before any action on contrast and brightness.\n\nAttention: the mask does not correspond to reality, but is amplified to make it more visible. +!TP_RETINEX_VIEW_NONE;Standard +!TP_RETINEX_VIEW_TRAN;Transmission-Auto +!TP_RETINEX_VIEW_TRAN2;Transmission-Fixed +TP_RETINEX_VIEW_UNSHARP;USM锐化 +TP_SHARPENING_BLUR;模糊半径 +TP_SHARPENING_CONTRAST;反差阈值 +TP_SHARPENING_ITERCHECK;自动限制迭代 +TP_SHARPENING_RADIUS_BOOST;边缘半径值提升 +TP_SHARPENMICRO_CONTRAST;反差阈值 +TP_SHARPENMICRO_LABEL;微反差 +TP_SHARPENMICRO_MATRIX;使用3×3阵列而非5×5阵列 +TP_SHARPENMICRO_UNIFORMITY;均匀度 +!TP_SOFTLIGHT_LABEL;Soft Light +!TP_SOFTLIGHT_STRENGTH;Strength +TP_TM_FATTAL_AMOUNT;数量 +TP_TM_FATTAL_ANCHOR;锚点 +TP_TM_FATTAL_LABEL;动态范围压缩 +TP_TM_FATTAL_THRESHOLD;细节 +TP_VIBRANCE_AVOIDCOLORSHIFT;避免偏色 +!TP_VIBRANCE_CURVEEDITOR_SKINTONES;HH +!TP_VIBRANCE_CURVEEDITOR_SKINTONES_LABEL;Skin-tones +!TP_VIBRANCE_CURVEEDITOR_SKINTONES_RANGE1;Red/Purple +!TP_VIBRANCE_CURVEEDITOR_SKINTONES_RANGE2;Red +!TP_VIBRANCE_CURVEEDITOR_SKINTONES_RANGE3;Red/Yellow +!TP_VIBRANCE_CURVEEDITOR_SKINTONES_RANGE4;Yellow +TP_VIBRANCE_CURVEEDITOR_SKINTONES_TOOLTIP;根据色相(H)调整色相(H),H=f(H) +!TP_VIBRANCE_LABEL;Vibrance +!TP_VIBRANCE_PASTELS;Pastel Tones +!TP_VIBRANCE_PASTSATTOG;Link pastel and saturated tones +TP_VIBRANCE_PROTECTSKINS;保护肤色 +!TP_VIBRANCE_PSTHRESHOLD;Pastel/saturated tones threshold +!TP_VIBRANCE_PSTHRESHOLD_SATTHRESH;Saturation threshold +!TP_VIBRANCE_PSTHRESHOLD_TOOLTIP;The vertical axis represents pastel tones at the bottom and saturated tones at the top.\nThe horizontal axis represents the saturation range. +!TP_VIBRANCE_PSTHRESHOLD_WEIGTHING;Pastel/saturated transition's weighting +!TP_VIBRANCE_SATURATED;Saturated Tones TP_WAVELET_1;第1级 TP_WAVELET_2;第2级 TP_WAVELET_3;第3级 @@ -1347,80 +2136,181 @@ TP_WAVELET_APPLYTO;应用到 TP_WAVELET_AVOID;避免偏色 TP_WAVELET_B0;黑色 TP_WAVELET_B1;灰色 +TP_WAVELET_B2;残差图 TP_WAVELET_BACKGROUND;背景 TP_WAVELET_BACUR;曲线 +!TP_WAVELET_BALANCE;Contrast balance d/v-h +!TP_WAVELET_BALANCE_TOOLTIP;Alters the balance between the wavelet directions: vertical-horizontal and diagonal.\nIf contrast, chroma or residual tone mapping are activated, the effect due to balance is amplified. +!TP_WAVELET_BALCHRO;Chroma balance +!TP_WAVELET_BALCHRO_TOOLTIP;If enabled, the 'Contrast balance' curve or slider also modifies chroma balance. +!TP_WAVELET_BANONE;None TP_WAVELET_BASLI;滑条 +!TP_WAVELET_BATYPE;Contrast balance method +!TP_WAVELET_CBENAB;Toning and Color Balance +!TP_WAVELET_CB_TOOLTIP;For strong values product color-toning by combining it or not with levels decomposition 'toning'\nFor low values you can change the white balance of the background (sky, ...) without changing that of the front plane, generally more contrasted TP_WAVELET_CCURVE;局部反差 +!TP_WAVELET_CH1;Whole chroma range +!TP_WAVELET_CH2;Saturated/pastel TP_WAVELET_CH3;与反差等级挂钩 TP_WAVELET_CHCU;曲线 TP_WAVELET_CHR;色度-反差挂钩力度 +!TP_WAVELET_CHRO;Saturated/pastel threshold +!TP_WAVELET_CHRO_TOOLTIP;Sets the wavelet level which will be the threshold between saturated and pastel colors.\n1-x: saturated\nx-9: pastel\n\nIf the value exceeds the amount of wavelet levels you are using then it will be ignored. +!TP_WAVELET_CHR_TOOLTIP;Adjusts chroma as a function of "contrast levels" and "chroma-contrast link strength" TP_WAVELET_CHSL;滑条 +!TP_WAVELET_CHTYPE;Chrominance method +!TP_WAVELET_COLORT;Opacity Red-Green TP_WAVELET_COMPCONT;反差 +!TP_WAVELET_COMPGAMMA;Compression gamma +!TP_WAVELET_COMPGAMMA_TOOLTIP;Adjusting the gamma of the residual image allows you to equilibrate the data and histogram. +!TP_WAVELET_COMPTM;Tone mapping +!TP_WAVELET_CONTEDIT;'After' contrast curve +!TP_WAVELET_CONTR;Gamut TP_WAVELET_CONTRA;反差 TP_WAVELET_CONTRAST_MINUS;反差 - TP_WAVELET_CONTRAST_PLUS;反差 + -TP_WAVELET_CONTRA_TOOLTIP;改变余像的反差。 +TP_WAVELET_CONTRA_TOOLTIP;改变残差图的反差 TP_WAVELET_CTYPE;色度控制 +!TP_WAVELET_CURVEEDITOR_CC_TOOLTIP;Modifies local contrast as a function of the original local contrast (abscissa).\nLow abscissa values represent small local contrast (real values about 10..20).\n50% abscissa represents average local contrast (real value about 100..300).\n66% abscissa represents standard deviation of local contrast (real value about 300..800).\n100% abscissa represents maximum local contrast (real value about 3000..8000). +!TP_WAVELET_CURVEEDITOR_CH;Contrast levels=f(Hue) +!TP_WAVELET_CURVEEDITOR_CH_TOOLTIP;Modifies each level's contrast as a function of hue.\nTake care not to overwrite changes made with the Gamut sub-tool's hue controls.\nThe curve will only have an effect when wavelet contrast level sliders are non-zero. +!TP_WAVELET_CURVEEDITOR_CL;L +!TP_WAVELET_CURVEEDITOR_CL_TOOLTIP;Applies a final contrast luminance curve at the end of the wavelet treatment. +!TP_WAVELET_CURVEEDITOR_HH;HH +!TP_WAVELET_CURVEEDITOR_HH_TOOLTIP;Modifies the residual image's hue as a function of hue. TP_WAVELET_DALL;所有方向 -TP_WAVELET_DAUB;Edge performance +TP_WAVELET_DAUB;边缘表现 TP_WAVELET_DAUB2;D2-低 TP_WAVELET_DAUB4;D4-标准 TP_WAVELET_DAUB6;D6-标准增强 TP_WAVELET_DAUB10;D10-中等 TP_WAVELET_DAUB14;D14-高 +TP_WAVELET_DAUB_TOOLTIP;改变多贝西系数:\nD4 = 标准,\nD14 = 一般而言表现最好,但会增加10%的处理耗时。\n\n影响边缘检测以及较低层级的质量。但是质量不完全和这个系数有关,可能会随具体的图像和处理方式而变化 TP_WAVELET_DONE;纵向 TP_WAVELET_DTHR;斜向 TP_WAVELET_DTWO;横向 TP_WAVELET_EDCU;曲线 TP_WAVELET_EDGCONT;局部反差 +!TP_WAVELET_EDGCONT_TOOLTIP;Adjusting the points to the left decreases contrast, and to the right increases it.\nBottom-left, top-left, top-right and bottom-right represent respectively local contrast for low values, mean, mean+stdev and maxima. +!TP_WAVELET_EDGE;Edge Sharpness +!TP_WAVELET_EDGEAMPLI;Base amplification +!TP_WAVELET_EDGEDETECT;Gradient sensitivity +!TP_WAVELET_EDGEDETECTTHR;Threshold low (noise) +!TP_WAVELET_EDGEDETECTTHR2;Threshold high (detection) +!TP_WAVELET_EDGEDETECTTHR_TOOLTIP;This adjuster lets you target edge detection for example to avoid applying edge sharpness to fine details, such as noise in the sky. +!TP_WAVELET_EDGEDETECT_TOOLTIP;Moving the slider to the right increases edge sensitivity. This affects local contrast, edge settings and noise. +!TP_WAVELET_EDGESENSI;Edge sensitivity +!TP_WAVELET_EDGREINF_TOOLTIP;Reinforce or reduce the action of the first level, do the opposite to the second level, and leave the rest unchanged. +!TP_WAVELET_EDGTHRESH;Detail +!TP_WAVELET_EDGTHRESH_TOOLTIP;Change the repartition between the first levels and the others. The higher the threshold the more the action is centered on the first levels. Be careful with negative values, they increase the action of high levels and can introduce artifacts. +!TP_WAVELET_EDRAD;Radius +!TP_WAVELET_EDRAD_TOOLTIP;This radius adjustment is very different from those in other sharpening tools. Its value is compared to each level through a complex function. In this sense, a value of zero still has an effect. TP_WAVELET_EDSL;阈值滑条 +!TP_WAVELET_EDTYPE;Local contrast method TP_WAVELET_EDVAL;力度 +!TP_WAVELET_FINAL;Final Touchup +TP_WAVELET_FINEST;最精细 +!TP_WAVELET_HIGHLIGHT;Highlight luminance range +TP_WAVELET_HS1;全部亮度范围 +TP_WAVELET_HS2;阴影/高光 +!TP_WAVELET_HUESKIN;Skin hue +!TP_WAVELET_HUESKIN_TOOLTIP;The bottom points set the beginning of the transition zone, and the upper points the end of it, where the effect is at its maximum.\n\nIf you need to move the area significantly, or if there are artifacts, then the white balance is incorrect. +!TP_WAVELET_HUESKY;Sky hue +!TP_WAVELET_HUESKY_TOOLTIP;The bottom points set the beginning of the transition zone, and the upper points the end of it, where the effect is at its maximum.\n\nIf you need to move the area significantly, or if there are artifacts, then the white balance is incorrect. +!TP_WAVELET_ITER;Delta balance levels +!TP_WAVELET_ITER_TOOLTIP;Left: increase low levels and reduce high levels,\nRight: reduce low levels and increase high levels. TP_WAVELET_LABEL;小波层级 TP_WAVELET_LARGEST;最粗糙 +!TP_WAVELET_LEVCH;Chroma TP_WAVELET_LEVDIR_ALL;所有方向的全部层级 TP_WAVELET_LEVDIR_INF;小于等于此层级 TP_WAVELET_LEVDIR_ONE;一个层级 TP_WAVELET_LEVDIR_SUP;高于此层级 TP_WAVELET_LEVELS;小波层级 -TP_WAVELET_LEVELS_TOOLTIP;选择将图像分解为几个层级的细节。更多的层级需要使用更多的内存和更长的处理时间。 +TP_WAVELET_LEVELS_TOOLTIP;选择将图像分解为几个层级的细节。更多的层级需要使用更多的内存和更长的处理时间 +TP_WAVELET_LEVF;反差 +!TP_WAVELET_LEVLABEL;当前预览中最高的可见层级 = %1 TP_WAVELET_LEVONE;第2级 TP_WAVELET_LEVTHRE;第4级 TP_WAVELET_LEVTWO;第3级 TP_WAVELET_LEVZERO;第1级 +!TP_WAVELET_LINKEDG;Link with Edge Sharpness' Strength +!TP_WAVELET_LIPST;Enhanced algoritm +!TP_WAVELET_LOWLIGHT;Shadow luminance range TP_WAVELET_MEDGREINF;第一层级 TP_WAVELET_MEDI;减少蓝天中的杂点 +!TP_WAVELET_MEDILEV;Edge detection +!TP_WAVELET_MEDILEV_TOOLTIP;When you enable Edge Detection, it is recommanded:\n- to disabled low contrast levels to avoid artifacts,\n- to use high values of gradient sensitivity.\n\nYou can modulate the strength with 'refine' from Denoise and Refine. +!TP_WAVELET_NEUTRAL;Neutral TP_WAVELET_NOIS;去噪 TP_WAVELET_NOISE;去噪和精细化 +!TP_WAVELET_NPHIGH;High +!TP_WAVELET_NPLOW;Low +!TP_WAVELET_NPNONE;None +!TP_WAVELET_NPTYPE;Neighboring pixels +!TP_WAVELET_NPTYPE_TOOLTIP;This algorithm uses the proximity of a pixel and eight of its neighbors. If less difference, edges are reinforced. +!TP_WAVELET_OPACITY;Opacity Blue-Yellow +!TP_WAVELET_OPACITYW;Contrast balance d/v-h curve +!TP_WAVELET_OPACITYWL;Final local contrast +!TP_WAVELET_OPACITYWL_TOOLTIP;Modify the final local contrast at the end of the wavelet treatment.\n\nThe left side represents the smallest local contrast, progressing to the largest local contrast on the right. +!TP_WAVELET_PASTEL;Pastel chroma +TP_WAVELET_PROC;处理 +!TP_WAVELET_RE1;Reinforced +!TP_WAVELET_RE2;Unchanged +!TP_WAVELET_RE3;Reduced +!TP_WAVELET_RESCHRO;Chroma +!TP_WAVELET_RESCON;Shadows +!TP_WAVELET_RESCONH;Highlights +TP_WAVELET_RESID;残差图像 +!TP_WAVELET_SAT;Saturated chroma TP_WAVELET_SETTINGS;小波设定 +!TP_WAVELET_SKIN;Skin targetting/protection +!TP_WAVELET_SKIN_TOOLTIP;At -100 skin-tones are targetted.\nAt 0 all tones are treated equally.\nAt +100 skin-tones are protected while all other tones are affected. +!TP_WAVELET_SKY;Sky targetting/protection +!TP_WAVELET_SKY_TOOLTIP;At -100 sky-tones are targetted.\nAt 0 all tones are treated equally.\nAt +100 sky-tones are protected while all other tones are affected. TP_WAVELET_STREN;力度 TP_WAVELET_STRENGTH;力度 -TP_WBALANCE_AUTO;自动 -TP_WBALANCE_CAMERA;相机 -TP_WBALANCE_CLOUDY;阴天 -TP_WBALANCE_CUSTOM;自定义 -TP_WBALANCE_DAYLIGHT;晴天 -TP_WBALANCE_EQBLUERED;蓝红平衡 -TP_WBALANCE_FLASH55;徕卡 +TP_WAVELET_SUPE;额外级 +!TP_WAVELET_THR;Shadows threshold +!TP_WAVELET_THRESHOLD;Highlight levels +!TP_WAVELET_THRESHOLD2;Shadow levels +!TP_WAVELET_THRESHOLD2_TOOLTIP;Only levels between 9 and 9 minus the value will be affected by the shadow luminance range. Other levels will be fully treated. The highest level possible is limited by the highlight level value (9 minus highlight level value). +!TP_WAVELET_THRESHOLD_TOOLTIP;Only levels beyond the chosen value will be affected by the highlight luminance range. Other levels will be fully treated. The chosen value here limits the highest possible value of the shadow levels. +!TP_WAVELET_THRH;Highlights threshold +TP_WAVELET_TILESBIG;大切片 +TP_WAVELET_TILESFULL;整张图片 +TP_WAVELET_TILESIZE;切片缓存方法 +TP_WAVELET_TILESLIT;小切片 +TP_WAVELET_TILES_TOOLTIP;处理整张图片可以让图像质量更好,所以推荐使用该选项,切片缓存是给小内存用户的备用方法。阅读RawPedia的文章以了解具体的内存需求 +!TP_WAVELET_TMSTRENGTH;Compression strength +!TP_WAVELET_TMSTRENGTH_TOOLTIP;Control the strength of tone mapping or contrast compression of the residual image. When the value is different from 0, the Strength and Gamma sliders of the Tone Mapping tool in the Exposure tab will become grayed out. +!TP_WAVELET_TMTYPE;Compression method +!TP_WAVELET_TON;Toning +!TP_WBALANCE_EQBLUERED_TOOLTIP;Allows to deviate from the normal behavior of "white balance" by modulating the blue/red balance.\nThis can be useful when shooting conditions:\na) are far from the standard illuminant (e.g. underwater),\nb) are far from conditions where calibrations were performed,\nc) where the matrices or ICC profiles are unsuitable. TP_WBALANCE_FLASH60;标准,佳能,宾得,奥林巴斯 TP_WBALANCE_FLASH65;尼康,松下,索尼,美能达 -TP_WBALANCE_FLASH_HEADER;闪光 -TP_WBALANCE_GREEN;色度 -TP_WBALANCE_LABEL;白平衡 -TP_WBALANCE_LED_HEADER;LED -TP_WBALANCE_METHOD;方式 -TP_WBALANCE_SHADE;阴影 -TP_WBALANCE_SIZE;大小: -TP_WBALANCE_SOLUX35;Solux 3500K -TP_WBALANCE_SOLUX41;Solux 4100K -TP_WBALANCE_SPOTWB;白平衡采样 -TP_WBALANCE_TEMPERATURE;色温 -TP_WBALANCE_WATER1;水下 1 -TP_WBALANCE_WATER2;水下 2 -TP_WBALANCE_WATER_HEADER;水下 -ZOOMPANEL_100;(100%) -ZOOMPANEL_NEWCROPWINDOW;开启(新的)细节窗口 -ZOOMPANEL_ZOOM100;缩放到100%\n快捷键: z -ZOOMPANEL_ZOOMFITCROPSCREEN;适应边缘到屏幕\n快捷键:f -ZOOMPANEL_ZOOMFITSCREEN;适应屏幕\n快捷键: Alt-f -ZOOMPANEL_ZOOMIN;缩放拉近\n快捷键: + -ZOOMPANEL_ZOOMOUT;缩放拉远\n快捷键: - +!TP_WBALANCE_FLUO1;F1-Daylight +!TP_WBALANCE_FLUO2;F2-Cool White +!TP_WBALANCE_FLUO3;F3-White +!TP_WBALANCE_FLUO4;F4-Warm White +!TP_WBALANCE_FLUO5;F5-Daylight +!TP_WBALANCE_FLUO6;F6-Lite White +!TP_WBALANCE_FLUO7;F7-D65 Daylight Simulator +!TP_WBALANCE_FLUO8;F8-D50 / Sylvania F40 Design +!TP_WBALANCE_FLUO9;F9-Cool White Deluxe +!TP_WBALANCE_FLUO10;F10-Philips TL85 +!TP_WBALANCE_FLUO11;F11-Philips TL84 +!TP_WBALANCE_FLUO12;F12-Philips TL83 +TP_WBALANCE_FLUO_HEADER;荧光灯 +!TP_WBALANCE_GTI;GTI +!TP_WBALANCE_HMI;HMI +!TP_WBALANCE_JUDGEIII;JudgeIII +!TP_WBALANCE_LAMP_HEADER;Lamp +!TP_WBALANCE_LED_CRS;CRS SP12 WWMR16 +!TP_WBALANCE_LED_LSI;LSI Lumelex 2040 +!TP_WBALANCE_PICKER;Pick +!TP_WBALANCE_SOLUX47;Solux 4700K (vendor) +!TP_WBALANCE_SOLUX47_NG;Solux 4700K (Nat. Gallery) +TP_WBALANCE_TEMPBIAS;自动白平衡色温偏向 +TP_WBALANCE_TEMPBIAS_TOOLTIP;此功能允许你将色温向冷/暖偏移。\n以调整计算出的“自动白平衡”。这个偏向被表达为\n已计算出的色温的百分比,故最终的调整结果为“色温+色温*偏向” +TP_WBALANCE_TUNGSTEN;白炽灯 From 94f54b644380f2cb57a44368e6446e1a783a7cf6 Mon Sep 17 00:00:00 2001 From: Desmis Date: Sun, 27 Dec 2020 08:14:51 +0100 Subject: [PATCH 030/129] Local adjustments - Denoise and Guided Filter - Recovery based on luminance mask (#6032) * Slider recovery threshold guidedfilter * Enable GuidedFilter recovery based on mask * Enable inverse GF recovery * Small changes GUI * Recovery GUI denoise LA * Enable recovery denoise with mask luminance * Fixed bad compilation error * Fixed bad behavior GUI expert - basic * Another fixed bad behavior GUI * First changes and verifications algo and GUI * Others GUI modifications * Fixed bug compilation and reset and clean code * Some changes in algo - new tooltip * Added calcdif to denoise - prepare GUI - change some tooltips * Change tooltips * Change some settings * Small Change settings default curve denoise --- rtdata/languages/default | 30 ++- rtengine/iplocallab.cc | 399 +++++++++++++++++++++++++++++++++++++-- rtengine/procevents.h | 11 +- rtengine/procparams.cc | 40 +++- rtengine/procparams.h | 9 + rtengine/refreshmap.cc | 12 +- rtgui/locallabtools.cc | 320 ++++++++++++++++++++++++++++++- rtgui/locallabtools.h | 21 ++- rtgui/paramsedited.cc | 63 +++++++ rtgui/paramsedited.h | 9 + 10 files changed, 882 insertions(+), 32 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 33d260c31..4b91668cc 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1231,6 +1231,14 @@ HISTORY_MSG_983;Local - denoise threshold mask high HISTORY_MSG_984;Local - denoise threshold mask low HISTORY_MSG_985;Local - denoise Laplacian HISTORY_MSG_986;Local - denoise reinforce +HISTORY_MSG_987;Local - GF recovery threshold +HISTORY_MSG_988;Local - GF threshold mask low +HISTORY_MSG_989;Local - GF threshold mask high +HISTORY_MSG_990;Local - Denoise recovery threshold +HISTORY_MSG_991;Local - Denoise threshold mask low +HISTORY_MSG_992;Local - Denoise threshold mask high +HISTORY_MSG_993;Local - Denoise Inverse algo +HISTORY_MSG_994;Local - GF Inverse algo HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance @@ -2551,6 +2559,7 @@ TP_LOCALLAB_DENOICHROF_TOOLTIP;Allows you to adjust fine-detail chrominance nois TP_LOCALLAB_DENOIEQUALCHRO_TOOLTIP;Allows you to direct the chroma noise reduction towards either the blue-yellow or red-green colors. TP_LOCALLAB_DENOIEQUAL_TOOLTIP;Allows you to carry out more or less noise reduction in either the shadows or the highlights. TP_LOCALLAB_DENOI1_EXP;Denoise based on luminance mask +TP_LOCALLAB_DENOI2_EXP;Recovery based on luminance mask TP_LOCALLAB_DENOILUMDETAIL_TOOLTIP;Allows you to recover luminance detail by progressively applying a Fourier transform (DCT). TP_LOCALLAB_DENOIQUA_TOOLTIP;Conservative mode preserves low frequency detail. “Aggressive” mode removes low frequency detail. TP_LOCALLAB_DENOIS;Ψ Denoise @@ -2672,6 +2681,7 @@ TP_LOCALLAB_INVBL;Inverse TP_LOCALLAB_INVBL_TOOLTIP;Alternative to ‘Inverse’ mode: use two spots\nFirst Spot:\n full image - delimiter outside preview\n RT-spot shape: rectangle. Transition 100\n\nSecond spot : Excluding spot TP_LOCALLAB_INVERS;Inverse TP_LOCALLAB_INVERS_TOOLTIP;Fewer possibilities if selected (Inverse).\n\nAlternative: use two spots\nFirst Spot:\n full image - delimiter outside preview\n RT-spot shape: rectangle. Transition 100\n\nSecond spot: Excluding spot +TP_LOCALLAB_INVMASK;Inverse algorithm TP_LOCALLAB_ISOGR;Coarseness (ISO) TP_LOCALLAB_LABBLURM;Blur Mask TP_LOCALLAB_LABEL;Local Adjustments @@ -2760,13 +2770,25 @@ TP_LOCALLAB_MASKCOM;Common Color Mask TP_LOCALLAB_MASKCOM_TOOLNAME;Common Color Mask - 13 TP_LOCALLAB_MASKCOM_TOOLTIP;A tool in its own right.\nCan be used to adjust the image appearance (chrominance, luminance, contrast) and texture as a function of Scope. TP_LOCALLAB_MASKCURVE_TOOLTIP;The 3 curves are set to 1 (maximum) by default:\nC=f(C) the chroma varies according to the chrominance. You can decrease the chroma to improve the selection. By setting this curve close to zero (with a low value of C to activate the curve) you can desaturate the background in Inverse mode.\nL=f(L) the luminance varies according to the luminance, so you can decrease the brightness to improve the selection.\nL and C = f(H) luminance and chroma vary with hue, so you can decrease luminance and chroma to improve selection +TP_LOCALLAB_MASKDDECAY;Decay strength +TP_LOCALLAB_MASKDECAY_TOOLTIP;Manages the rate of decay for the gray levels in the mask.\n Decay = 1 linear, Decay > 1 sharper parabolic transitions, Decay < 1 more gradual transitions TP_LOCALLAB_MASKH;Hue curve -TP_LOCALLAB_MASKLC_TOOLTIP;This allows you to target the denoise based on the image luminance information contained in the L(L) or LC(H) mask (Mask and Modifications.\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n if the mask is very dark - below the threshold 'dark' - denoise will be increased if reinforce > 1.\n if the mask is clear - above the threshold 'light' - denoise will be progressively cancelled.\n between the two, denoise will be maintained at the settings without mask. -TP_LOCALLAB_MASKLCTHR;Light area luminance % threshold -TP_LOCALLAB_MASKLCTHRLOW; Dark area luminance % threshold -TP_LOCALLAB_MASKLNOISELOW;Reinforce denoise in dark areas +TP_LOCALLAB_MASKLC_TOOLTIP;This allows you to target the denoise based on the image luminance information contained in the L(L) or LC(H) mask (Mask and Modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n if the mask is very dark - below the threshold 'dark' - denoise will be increased if reinforce > 1.\n if the mask is clear - above the threshold 'light' - denoise will be progressively cancelled.\n between the two, denoise will be maintained at the settings without mask. +TP_LOCALLAB_MASKDE_TOOLTIP;Used to direct the Denoise based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n If the mask is below the ‘dark’ threshold, then the Denoise will be applied progressively.\n if the mask is above the ‘light’ threshold, then the Denoise will be applied progressively.\n Between the two, the image settings without the Denoise will be maintained. +TP_LOCALLAB_MASKGF_TOOLTIP;Used to direct the Guided Filter based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n If the mask is below the ‘dark’ threshold, then the GF will be applied progressively.\n if the mask is above the ‘light’ threshold, then the GF will be applied progressively.\n Between the two, the image settings without the GF will be maintained. +TP_LOCALLAB_MASKDEINV_TOOLTIP;Reverses the way the algorithm interprets the mask.\nIf checked black and very light areas will be decreased. +TP_LOCALLAB_MASKHIGTHRESD_TOOLTIP;Light-tone limit above which denoise will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKHIGTHRES_TOOLTIP;Light-tone limit above which 'Guided Filter' will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKHIGTHRES_TOOLTIP;Light limit above which the GuidedFilter will be applied progressively.\n You can used some tools in 'mask and modifications' to change the gray levels: 'structure mask', 'Smooth radius', 'Gamma and slope', 'Contrast curve', 'Local contrast wavelet'.\n You can use 'lockable color picker' on mask to see what areas will be take into account. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKHIGTHRESD_TOOLTIP;Light limit above which the denoise will be applied progressively.\n You can used some tools in 'mask and modifications' to change the gray levels: 'structure mask', 'Smooth radius', 'Gamma and slope', 'Contrast curve', 'Local contrast wavelet'.\n You can use 'lockable color picker' on mask to see what areas will be take into account. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKLCTHR;Light area luminance threshold +TP_LOCALLAB_MASKLCTHRLOW;Dark area luminance threshold +TP_LOCALLAB_MASKLNOISELOW;Reinforce denoise in dark and light areas +TP_LOCALLAB_MASKLOWTHRES_TOOLTIP;Dark-tone limit below which 'Guided Filter' will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKLOWTHRESD_TOOLTIP;Dark-tone limit below which denoise will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKUSABLE;Mask enabled (Mask & modifications) TP_LOCALLAB_MASKUNUSABLE;Mask disabled (Mask & modifications) +TP_LOCALLAB_MASKRECOTHRES;Recovery threshold TP_LOCALLAB_MASK_TOOLTIP;You can enable multiple masks for a tool by activating another tool and using only the mask (set the tool sliders to 0 ).\n\nYou can also duplicate the RT-spot and place it close to the first spot. The small variations in the spot references allows you to make fine adjustments. TP_LOCALLAB_MED;Medium TP_LOCALLAB_MEDIAN;Median Low diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 7738f3d7a..f19deeeca 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -150,6 +150,26 @@ constexpr float exclusion(float a, float b) return a + b - 2.f * a * b; } +void calcdif(float lmr, float &lmrc) +{ //approximative change between gamma sRGB g=2.4 s=12.92 and gamma LAB g=3.0 s=9.03 + //useful to calculate action with dark and light area mask + //differences in 3 parts linear...very small diffrences with real... + float a0 = 7.6f / 11.6f;//11.6 sRGB - 7.6 Lab...11.6 max difference + float a01 = 62.f - 7.6f; //60 sRGB 62 Lab 60 max difference + float a11 = 60.f - 11.6f; + float a1 = a01 / a11; + float b1 = 62.f - a1 * 60.f; + float a2 = (100.f - 62.f) / (100.f - 60.f); + float b2 = 100.f - a2 * 100.f; + if(lmr < 11.6f) { + lmrc = a0 * lmr; + } else if (lmr < 60.) { + lmrc = a1 * lmr + b1; + } else { + lmrc = a2 * lmr + b2; + } +} + void calcGammaLut(double gamma, double ts, LUTf &gammaLut) { double pwr = 1.0 / gamma; @@ -546,6 +566,8 @@ struct local_params { int softmet; int blurmet; int blmet; + bool invmaskd; + bool invmask; int smasktyp; int chromet; int quamet; @@ -557,6 +579,13 @@ struct local_params { float noiself2; float noiseldetail; int detailthr; + float recothr; + float lowthr; + float higthr; + float recothrd; + float lowthrd; + float higthrd; + float decayd; int noiselequal; float noisechrodetail; float bilat; @@ -846,6 +875,19 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.blurmet = 1; } + if (locallab.spots.at(sp).invmask == false) { + lp.invmask = false; + } else if (locallab.spots.at(sp).invmask == true) { + lp.invmask = true; + } + + if (locallab.spots.at(sp).invmaskd == false) { + lp.invmaskd = false; + } else if (locallab.spots.at(sp).invmaskd == true) { + lp.invmaskd = true; + } + + if (locallab.spots.at(sp).showmaskblMethodtyp == "blur") { lp.smasktyp = 0; } else if (locallab.spots.at(sp).showmaskblMethodtyp == "nois") { @@ -982,7 +1024,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall if (lp.denoiena) { local_noiself0 = 250.f * locwavCurveden[0]; local_noiself = 250.f * locwavCurveden[166]; - local_noiself2 = 250.f * locwavCurveden[323]; + local_noiself2 = 250.f * locwavCurveden[333]; local_noiselc = 200.f * locwavCurveden[500]; } } @@ -992,6 +1034,13 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall float local_noisechrodetail = (float)locallab.spots.at(sp).noisechrodetail; int local_sensiden = locallab.spots.at(sp).sensiden; float local_detailthr = (float)locallab.spots.at(sp).detailthr; + float local_recothr = (float)locallab.spots.at(sp).recothres; + float local_lowthr = (float)locallab.spots.at(sp).lowthres; + float local_higthr = (float)locallab.spots.at(sp).higthres; + float local_recothrd = (float)locallab.spots.at(sp).recothresd; + float local_lowthrd = (float)locallab.spots.at(sp).lowthresd; + float local_higthrd = (float)locallab.spots.at(sp).higthresd; + float local_decayd = (float)locallab.spots.at(sp).decayd; float local_noisecf = ((float)locallab.spots.at(sp).noisechrof) / 10.f; float local_noisecc = ((float)locallab.spots.at(sp).noisechroc) / 10.f; @@ -1339,6 +1388,13 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.noiself2 = local_noiself2; lp.noiseldetail = local_noiseldetail; lp.detailthr = local_detailthr; + lp.recothr = local_recothr; + lp.lowthr = local_lowthr; + lp.higthr = local_higthr; + lp.recothrd = local_recothrd; + lp.lowthrd = local_lowthrd; + lp.higthrd = local_higthrd; + lp.decayd = local_decayd; lp.noiselequal = local_noiselequal; lp.noisechrodetail = local_noisechrodetail; lp.noiselc = local_noiselc; @@ -8933,14 +8989,22 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if(lp.enablMask && lp.lnoiselow !=1.f && lp.smasktyp != 0) { //this code has been reviewed by Ingo in september 2020 PR5903 + float higc; float hig = lp.thrhigh; - if(lp.thrhigh < lp.thrlow) { - hig = lp.thrlow + 0.01f; + calcdif(hig, higc); + float low = lp.thrlow; + float lowc; + calcdif(low, lowc); + + if(higc < lowc) { + higc = lowc + 0.01f; } - float alow = -(lp.lnoiselow - 1.f) / lp.thrlow; + + float alow = -(lp.lnoiselow - 1.f) / lowc; float blow = lp.lnoiselow; - float ahigh = 0.9999f / (hig - 100.f); - float bhigh = 1.f - hig * ahigh; + float ahigh = 0.9999f / (higc - 100.f); + float bhigh = 1.f - higc * ahigh; + #ifdef _OPENMP #pragma omp parallel for if (multiThread) #endif @@ -8949,12 +9013,12 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl const float lM = bufmaskblurbl->L[ir][jr]; const float lmr = lM / 327.68f; - if (lM < 327.68f * lp.thrlow) { - noisevarlum[(ir >> 1) * GW2 + (jr >> 1)] *= alow * lmr + blow; //3.f;//increase denoise - } else if (lM < 327.68f * hig) { + if (lM < 327.68f * lowc) { + noisevarlum[(ir >> 1) * GW2 + (jr >> 1)] *= alow * lmr + blow; + } else if (lM < 327.68f * higc) { // do nothing - denoise not change } else { - noisevarlum[(ir >> 1) * GW2 + (jr >> 1)] *= ahigh * lmr + bhigh; //0.01f;//quasi suppress denoise + noisevarlum[(ir >> 1) * GW2 + (jr >> 1)] *= ahigh * lmr + bhigh; } } } @@ -9348,8 +9412,81 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } - // DeNoise_Local(call, lp, originalmaskbl, levred, huerefblur, lumarefblur, chromarefblur, original, transformed, tmp1, cx, cy, sk); if(lp.smasktyp != 0) { + if(lp.enablMask && lp.recothrd != 1.f && lp.smasktyp != 0) { + LabImage tmp3(GW, GH); + + for (int ir = 0; ir < GH; ir++){ + for (int jr = 0; jr < GW; jr++) { + tmp3.L[ir][jr] = original->L[ir][jr]; + tmp3.a[ir][jr] = original->a[ir][jr]; + tmp3.b[ir][jr] = original->b[ir][jr]; + } + } + + array2D masklum; + masklum(GW, GH); + for (int ir = 0; ir < GH; ir++) + for (int jr = 0; jr < GW; jr++) { + masklum[ir][jr] = 1.f; + } + + float hig = lp.higthrd; + float higc; + calcdif(hig, higc); + float low = lp.lowthrd; + float lowc; + calcdif(low, lowc); + + if(higc < lowc) { + higc = lowc + 0.01f; + } + float th = (lp.recothrd - 1.f); + float ahigh = th / (higc - 100.f); + float bhigh = 1.f - higc * ahigh; + + float alow = th / lowc; + float blow = 1.f - th; +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + for (int ir = 0; ir < GH; ir++) + for (int jr = 0; jr < GW; jr++) { + const float lM = bufmaskblurbl->L[ir][jr]; + const float lmr = lM / 327.68f; + if (lM < 327.68f * lowc) { + masklum[ir][jr] = alow * lmr + blow; + } else if (lM < 327.68f * higc) { + + } else { + masklum[ir][jr] = ahigh * lmr + bhigh; + } + float k = masklum[ir][jr]; + if(lp.invmaskd == true) { + masklum[ir][jr] = 1 - pow(k, lp.decayd); + } else { + masklum[ir][jr] = pow(k, lp.decayd); + } + + } + + for (int i = 0; i < 3; ++i) { + boxblur(masklum, masklum, 10 / sk, GW, GH, false); + } +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + for (int i = 0; i < GH; ++i) { + for (int j = 0; j < GW; ++j) { + tmp1.L[i][j] = (tmp3.L[i][j] - tmp1.L[i][j]) * LIM01(masklum[i][j]) + tmp1.L[i][j]; + tmp1.a[i][j] = (tmp3.a[i][j] - tmp1.a[i][j]) * LIM01(masklum[i][j]) + tmp1.a[i][j]; + tmp1.b[i][j] = (tmp3.b[i][j] - tmp1.b[i][j]) * LIM01(masklum[i][j]) + tmp1.b[i][j]; + } + } + masklum.free(); + + } + DeNoise_Local(call, lp, originalmaskbl, levred, huerefblur, lumarefblur, chromarefblur, original, transformed, tmp1, cx, cy, sk); } else { DeNoise_Local(call, lp, original, levred, huerefblur, lumarefblur, chromarefblur, original, transformed, tmp1, cx, cy, sk); @@ -9535,15 +9672,21 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if(lp.enablMask && lp.lnoiselow != 1.f && lp.smasktyp != 0) { //this code has been reviewed by Ingo in september 2020 PR5903 //i just change parameters to better progressivity + float higc; float hig = lp.thrhigh; - if(lp.thrhigh < lp.thrlow) { - hig = lp.thrlow + 0.01f; + calcdif(hig, higc); + float low = lp.thrlow; + float lowc; + calcdif(low, lowc); + + if(higc < lowc) { + higc = lowc + 0.01f; } - float alow = -(lp.lnoiselow - 1.f) / lp.thrlow; + float alow = -(lp.lnoiselow - 1.f) / lowc; float blow = lp.lnoiselow; - float ahigh = 0.9999f / (hig - 100.f); - float bhigh = 1.f - hig * ahigh; + float ahigh = 0.9999f / (higc - 100.f); + float bhigh = 1.f - higc * ahigh; #ifdef _OPENMP @@ -9553,9 +9696,9 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl for (int jr = 0; jr < bfw; jr++) { const float lM = bufmaskblurbl->L[ir + ystart][jr + xstart]; const float lmr = lM / 327.68f; - if (lM < 327.68f * lp.thrlow) { + if (lM < 327.68f * lowc) { noisevarlum[(ir >> 1) * bfw2 + (jr >> 1)] *= alow * lmr + blow; - } else if (lM < 327.68f * hig) { + } else if (lM < 327.68f * higc) { // do nothing } else { noisevarlum[(ir >> 1) * bfw2 + (jr >> 1)] *= ahigh * lmr + bhigh; @@ -9948,6 +10091,91 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } if (lp.smasktyp != 0) { + if(lp.enablMask && lp.recothrd != 1.f && lp.smasktyp != 0) { + LabImage tmp3(bfw, bfh); +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) if (multiThread) +#endif + for (int y = 0; y < transformed->H ; y++) { + for (int x = 0; x < transformed->W; x++) { + int lox = cx + x; + int loy = cy + y; + + if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { + tmp3.L[loy - begy][lox - begx] = original->L[y][x]; + tmp3.a[loy - begy][lox - begx] = original->a[y][x]; + tmp3.b[loy - begy][lox - begx] = original->b[y][x]; + } + + } + } + + array2D masklum; + masklum(bfw, bfh); + for (int ir = 0; ir < bfh; ir++){ + for (int jr = 0; jr < bfw; jr++) { + masklum[ir][jr] = 1.f; + } + } + + float hig = lp.higthrd; + float higc; + calcdif(hig, higc); + float low = lp.lowthrd; + float lowc; + calcdif(low, lowc); + + if(higc < lowc) { + higc = lowc + 0.01f; + } + float th = (lp.recothrd - 1.f); + float ahigh = th / (higc - 100.f); + float bhigh = 1.f - higc * ahigh; + + float alow = th / lowc; + float blow = 1.f - th; + +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + for (int y = ystart; y < yend; y++) { + for (int x = xstart, lox = cx + x; x < xend; x++, lox++) { + + const float lM = bufmaskblurbl->L[y][x]; + const float lmr = lM / 327.68f; + if (lM < 327.68f * lowc) { + masklum[y-ystart][x-xstart] = alow * lmr + blow; + } else if (lM < 327.68f * higc) { + + } else { + masklum[y-ystart][x-xstart] = ahigh * lmr + bhigh; + } + float k = masklum[y-ystart][x-xstart]; + if(lp.invmaskd == true) { + masklum[y-ystart][x-xstart] = 1 - pow(k, lp.decayd); + } else { + masklum[y-ystart][x-xstart] = pow(k, lp.decayd); + } + } + } + for (int i = 0; i < 3; ++i) { + boxblur(masklum, masklum, 10 / sk, bfw, bfh, false); + } + +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + for (int y = 0; y < bfh; y++) { + for (int x = 0; x < bfw; x++) { + bufwv.L[y][x] = (tmp3.L[y][x] - bufwv.L[y][x]) * LIM01(masklum[y][x]) + bufwv.L[y][x]; + bufwv.a[y][x] = (tmp3.a[y][x] - bufwv.a[y][x]) * LIM01(masklum[y][x]) + bufwv.a[y][x]; + bufwv.b[y][x] = (tmp3.b[y][x] - bufwv.b[y][x]) * LIM01(masklum[y][x]) + bufwv.b[y][x]; + } + } + + masklum.free(); + } + DeNoise_Local2(lp, originalmaskbl, levred, huerefblur, lumarefblur, chromarefblur, original, transformed, bufwv, cx, cy, sk); } else { DeNoise_Local2(lp, original, levred, huerefblur, lumarefblur, chromarefblur, original, transformed, bufwv, cx, cy, sk); @@ -10705,6 +10933,8 @@ void ImProcFunctions::Lab_Local( // if (((radius > 1.5 * GAUSS_SKIP && lp.rad > 1.6) || lp.stren > 0.1 || lp.blmet == 1 || lp.guidb > 0 || lp.showmaskblmet == 2 || lp.enablMask || lp.showmaskblmet == 3 || lp.showmaskblmet == 4) && lp.blurena) { // radius < GAUSS_SKIP means no gauss, just copy of original image std::unique_ptr tmp1; std::unique_ptr tmp2; + std::unique_ptr tmp3; + std::unique_ptr maskk; int ystart = rtengine::max(static_cast(lp.yc - lp.lyT) - cy, 0); int yend = rtengine::min(static_cast(lp.yc + lp.ly) - cy, original->H); int xstart = rtengine::max(static_cast(lp.xc - lp.lxL) - cx, 0); @@ -10734,6 +10964,8 @@ void ImProcFunctions::Lab_Local( if (lp.blurmet == 0) { if (bfw > 0 && bfh > 0) { tmp1.reset(new LabImage(bfw, bfh)); + tmp3.reset(new LabImage(bfw, bfh)); + maskk.reset(new LabImage(bfw, bfh)); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif @@ -10748,12 +10980,16 @@ void ImProcFunctions::Lab_Local( } else if (lp.blurmet == 1) { tmp1.reset(new LabImage(transformed->W, transformed->H)); tmp2.reset(new LabImage(transformed->W, transformed->H)); + tmp3.reset(new LabImage(transformed->W, transformed->H)); for (int y = 0; y < GH ; y++) { for (int x = 0; x < GW; x++) { tmp2->L[y][x] = original->L[y][x]; tmp2->a[y][x] = original->a[y][x]; tmp2->b[y][x] = original->b[y][x]; + tmp3->L[y][x] = original->L[y][x]; + tmp3->a[y][x] = original->a[y][x]; + tmp3->b[y][x] = original->b[y][x]; tmp1->L[y][x] = original->L[y][x]; tmp1->a[y][x] = original->a[y][x]; tmp1->b[y][x] = original->b[y][x]; @@ -10968,6 +11204,9 @@ void ImProcFunctions::Lab_Local( tmp1->L[y - ystart][x - xstart] = original->L[y][x]; tmp1->a[y - ystart][x - xstart] = original->a[y][x]; tmp1->b[y - ystart][x - xstart] = original->b[y][x]; + tmp3->L[y - ystart][x - xstart] = original->L[y][x]; + tmp3->a[y - ystart][x - xstart] = original->a[y][x]; + tmp3->b[y - ystart][x - xstart] = original->b[y][x]; bufgb->L[y - ystart][x - xstart] = original->L[y][x]; } } @@ -11044,6 +11283,67 @@ void ImProcFunctions::Lab_Local( } } } + if(lp.enablMask && lp.recothr != 1.f && lp.smasktyp != 1) { + array2D masklum; + masklum(bfw, bfh); + for (int ir = 0; ir < bfh; ir++) + for (int jr = 0; jr < bfw; jr++) { + masklum[ir][jr] = 1.f; + } + + float hig = lp.higthr; + float higc; + calcdif(hig, higc); + float low = lp.lowthr; + float lowc; + calcdif(low, lowc); + + if(higc < lowc) { + higc = lowc + 0.01f; + } + float th = (lp.recothr - 1.f); + float ahigh = th / (higc - 100.f); + float bhigh = 1.f - higc * ahigh; + + float alow = th / lowc; + float blow = 1.f - th; + +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + for (int ir = 0; ir < bfh; ir++) + for (int jr = 0; jr < bfw; jr++) { + const float lM = bufmaskblurbl->L[ir + ystart][jr + xstart]; + const float lmr = lM / 327.68f; + if (lM < 327.68f * lowc) { + masklum[ir][jr] = alow * lmr + blow; + } else if (lM < 327.68f * higc) { + + } else { + masklum[ir][jr] = ahigh * lmr + bhigh; + } + if(lp.invmask == true) { + float k = masklum[ir][jr]; + masklum[ir][jr] = 1 - k*k; + } + } + + for (int i = 0; i < 3; ++i) { + boxblur(masklum, masklum, 10 / sk, bfw, bfh, false); + } + +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + for (int i = 0; i < bfh; ++i) { + for (int j = 0; j < bfw; ++j) { + tmp1->L[i][j] = (tmp3->L[i][j] - tmp1->L[i][j]) * LIM01(masklum[i][j]) + tmp1->L[i][j]; + tmp1->a[i][j] = (tmp3->a[i][j] - tmp1->a[i][j]) * LIM01(masklum[i][j]) + tmp1->a[i][j]; + tmp1->b[i][j] = (tmp3->b[i][j] - tmp1->b[i][j]) * LIM01(masklum[i][j]) + tmp1->b[i][j]; + } + } + masklum.free(); + } delete tmpImage; } @@ -11060,6 +11360,9 @@ void ImProcFunctions::Lab_Local( tmp1->a[y][x] = original->a[y][x]; tmp1->b[y][x] = original->b[y][x]; tmp2->L[y][x] = original->L[y][x]; + tmp3->L[y][x] = original->L[y][x]; + tmp3->a[y][x] = original->a[y][x]; + tmp3->b[y][x] = original->b[y][x]; } } @@ -11135,6 +11438,66 @@ void ImProcFunctions::Lab_Local( } } } + if(lp.enablMask && lp.recothr != 1.f && lp.smasktyp != 1) { + array2D masklum; + masklum(GW, GH); + for (int ir = 0; ir < GH; ir++) + for (int jr = 0; jr < GW; jr++) { + masklum[ir][jr] = 1.f; + } + + float hig = lp.higthr; + float higc; + calcdif(hig, higc); + float low = lp.lowthr; + float lowc; + calcdif(low, lowc); + + if(higc < lowc) { + higc = lowc + 0.01f; + } + float th = (lp.recothr - 1.f); + float ahigh = th / (higc - 100.f); + float bhigh = 1.f - higc * ahigh; + + float alow = th / lowc; + float blow = 1.f - th; + +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + for (int ir = 0; ir < GH; ir++) + for (int jr = 0; jr < GW; jr++) { + const float lM = bufmaskblurbl->L[ir][jr]; + const float lmr = lM / 327.68f; + if (lM < 327.68f * lowc) { + masklum[ir][jr] = alow * lmr + blow; + masklum[ir][jr] = alow * lmr + blow; + } else if (lM < 327.68f * higc) { + + } else { + masklum[ir][jr] = (ahigh * lmr + bhigh); + } + } + + for (int i = 0; i < 3; ++i) { + boxblur(masklum, masklum, 10 / sk, GW, GH, false); + } + +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + for (int i = 0; i < GH; ++i) { + for (int j = 0; j < GW; ++j) { + tmp1->L[i][j] = (tmp3->L[i][j] - tmp1->L[i][j]) * LIM01(masklum[i][j]) + tmp1->L[i][j]; + tmp1->a[i][j] = (tmp3->a[i][j] - tmp1->a[i][j]) * LIM01(masklum[i][j]) + tmp1->a[i][j]; + tmp1->b[i][j] = (tmp3->b[i][j] - tmp1->b[i][j]) * LIM01(masklum[i][j]) + tmp1->b[i][j]; + } + } + masklum.free(); + + } + delete tmpImage; } } diff --git a/rtengine/procevents.h b/rtengine/procevents.h index aae82f3b9..8ae9e1e4e 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -1007,8 +1007,17 @@ enum ProcEventCode { EvlocallabwavCurvehue = 981, Evlocallablevelthr = 982, Evlocallablevelthrlow = 983, - Evlocallabusemask1 = 984, + Evlocallabusemask1 = 984, Evlocallablnoiselow = 985, + Evlocallabrecothres = 986, + Evlocallablowthres = 987, + Evlocallabhigthres = 988, + Evlocallabrecothresd = 989, + Evlocallablowthresd = 990, + Evlocallabhigthresd = 991, + Evlocallabinvmaskd = 992, + Evlocallabinvmask = 993, + Evlocallabdecayd = 994, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 64374f4c3..9037484ef 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3298,6 +3298,13 @@ LocallabParams::LocallabSpot::LocallabSpot() : itera(1), guidbl(0), strbl(50), + recothres(1.), + lowthres(12.), + higthres(85.), + recothresd(1.), + lowthresd(12.), + higthresd(85.), + decayd(2.), isogr(400), strengr(0), scalegr(100), @@ -3308,7 +3315,9 @@ LocallabParams::LocallabSpot::LocallabSpot() : blurMethod("norm"), medMethod("33"), usemask(false), - levelthr(40.), + invmaskd(false), + invmask(false), + levelthr(85.), lnoiselow(1.), levelthrlow(12.), activlum(true), @@ -3331,7 +3340,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : 0.0, 0.0, 0.35, - 0.5, + 0.66, 0., 0.35, 0.35, @@ -4342,6 +4351,13 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && itera == other.itera && guidbl == other.guidbl && strbl == other.strbl + && recothres == other.recothres + && lowthres == other.lowthres + && higthres == other.higthres + && recothresd == other.recothresd + && lowthresd == other.lowthresd + && higthresd == other.higthresd + && decayd == other.decayd && isogr == other.isogr && strengr == other.strengr && scalegr == other.scalegr @@ -4351,6 +4367,8 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && quamethod == other.quamethod && blurMethod == other.blurMethod && usemask == other.usemask + && invmaskd == other.invmaskd + && invmask == other.invmask && levelthr == other.levelthr && lnoiselow == other.lnoiselow && levelthrlow == other.levelthrlow @@ -5928,6 +5946,13 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->itera, "Locallab", "Iteramed_" + index_str, spot.itera, keyFile); saveToKeyfile(!pedited || spot_edited->guidbl, "Locallab", "Guidbl_" + index_str, spot.guidbl, keyFile); saveToKeyfile(!pedited || spot_edited->strbl, "Locallab", "Strbl_" + index_str, spot.strbl, keyFile); + saveToKeyfile(!pedited || spot_edited->recothres, "Locallab", "Recothres_" + index_str, spot.recothres, keyFile); + saveToKeyfile(!pedited || spot_edited->lowthres, "Locallab", "Lowthres_" + index_str, spot.lowthres, keyFile); + saveToKeyfile(!pedited || spot_edited->higthres, "Locallab", "Higthres_" + index_str, spot.higthres, keyFile); + saveToKeyfile(!pedited || spot_edited->recothresd, "Locallab", "Recothresd_" + index_str, spot.recothresd, keyFile); + saveToKeyfile(!pedited || spot_edited->lowthresd, "Locallab", "Lowthresd_" + index_str, spot.lowthresd, keyFile); + saveToKeyfile(!pedited || spot_edited->higthresd, "Locallab", "Higthresd_" + index_str, spot.higthresd, keyFile); + saveToKeyfile(!pedited || spot_edited->decayd, "Locallab", "Decayd_" + index_str, spot.decayd, keyFile); saveToKeyfile(!pedited || spot_edited->isogr, "Locallab", "Isogr_" + index_str, spot.isogr, keyFile); saveToKeyfile(!pedited || spot_edited->strengr, "Locallab", "Strengr_" + index_str, spot.strengr, keyFile); saveToKeyfile(!pedited || spot_edited->scalegr, "Locallab", "Scalegr_" + index_str, spot.scalegr, keyFile); @@ -5937,6 +5962,8 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->quamethod, "Locallab", "QuaMethod_" + index_str, spot.quamethod, keyFile); saveToKeyfile(!pedited || spot_edited->blurMethod, "Locallab", "BlurMethod_" + index_str, spot.blurMethod, keyFile); saveToKeyfile(!pedited || spot_edited->usemask, "Locallab", "Usemaskb_" + index_str, spot.usemask, keyFile); + saveToKeyfile(!pedited || spot_edited->invmaskd, "Locallab", "Invmaskd_" + index_str, spot.invmaskd, keyFile); + saveToKeyfile(!pedited || spot_edited->invmask, "Locallab", "Invmask_" + index_str, spot.invmask, keyFile); saveToKeyfile(!pedited || spot_edited->levelthr, "Locallab", "Levelthr_" + index_str, spot.levelthr, keyFile); saveToKeyfile(!pedited || spot_edited->lnoiselow, "Locallab", "Lnoiselow_" + index_str, spot.lnoiselow, keyFile); saveToKeyfile(!pedited || spot_edited->levelthrlow, "Locallab", "Levelthrlow_" + index_str, spot.levelthrlow, keyFile); @@ -7730,6 +7757,13 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Iteramed_" + index_str, pedited, spot.itera, spotEdited.itera); assignFromKeyfile(keyFile, "Locallab", "Guidbl_" + index_str, pedited, spot.guidbl, spotEdited.guidbl); assignFromKeyfile(keyFile, "Locallab", "Strbl_" + index_str, pedited, spot.strbl, spotEdited.strbl); + assignFromKeyfile(keyFile, "Locallab", "Recothres_" + index_str, pedited, spot.recothres, spotEdited.recothres); + assignFromKeyfile(keyFile, "Locallab", "Lowthres_" + index_str, pedited, spot.lowthres, spotEdited.lowthres); + assignFromKeyfile(keyFile, "Locallab", "Higthres_" + index_str, pedited, spot.higthres, spotEdited.higthres); + assignFromKeyfile(keyFile, "Locallab", "Recothresd_" + index_str, pedited, spot.recothresd, spotEdited.recothresd); + assignFromKeyfile(keyFile, "Locallab", "Lowthresd_" + index_str, pedited, spot.lowthresd, spotEdited.lowthresd); + assignFromKeyfile(keyFile, "Locallab", "Higthresd_" + index_str, pedited, spot.higthresd, spotEdited.higthresd); + assignFromKeyfile(keyFile, "Locallab", "Decayd_" + index_str, pedited, spot.decayd, spotEdited.decayd); assignFromKeyfile(keyFile, "Locallab", "Isogr_" + index_str, pedited, spot.isogr, spotEdited.isogr); assignFromKeyfile(keyFile, "Locallab", "Strengr_" + index_str, pedited, spot.strengr, spotEdited.strengr); assignFromKeyfile(keyFile, "Locallab", "Scalegr_" + index_str, pedited, spot.scalegr, spotEdited.scalegr); @@ -7739,6 +7773,8 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "QuaMethod_" + index_str, pedited, spot.quamethod, spotEdited.quamethod); assignFromKeyfile(keyFile, "Locallab", "BlurMethod_" + index_str, pedited, spot.blurMethod, spotEdited.blurMethod); assignFromKeyfile(keyFile, "Locallab", "Usemaskb_" + index_str, pedited, spot.usemask, spotEdited.usemask); + assignFromKeyfile(keyFile, "Locallab", "Invmaskd_" + index_str, pedited, spot.invmaskd, spotEdited.invmaskd); + assignFromKeyfile(keyFile, "Locallab", "Invmask_" + index_str, pedited, spot.invmask, spotEdited.invmask); assignFromKeyfile(keyFile, "Locallab", "Levelthr_" + index_str, pedited, spot.levelthr, spotEdited.levelthr); assignFromKeyfile(keyFile, "Locallab", "Lnoiselow_" + index_str, pedited, spot.lnoiselow, spotEdited.lnoiselow); assignFromKeyfile(keyFile, "Locallab", "Levelthrlow_" + index_str, pedited, spot.levelthrlow, spotEdited.levelthrlow); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index b5e241f51..7a7f7f8d5 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1205,6 +1205,13 @@ struct LocallabParams { int itera; int guidbl; int strbl; + double recothres; + double lowthres; + double higthres; + double recothresd; + double lowthresd; + double higthresd; + double decayd; int isogr; int strengr; int scalegr; @@ -1215,6 +1222,8 @@ struct LocallabParams { Glib::ustring blurMethod; // norm, inv Glib::ustring medMethod; // none, 33, 55, 77, 99 bool usemask; + bool invmaskd; + bool invmask; double levelthr; double lnoiselow; double levelthrlow; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 129afdca9..d6079456f 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -1012,7 +1012,17 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallablevelthr LUMINANCECURVE, // Evlocallablevelthrlow LUMINANCECURVE, //Evlocallabusemask1 - LUMINANCECURVE // Evlocallablnoiselow + LUMINANCECURVE, // Evlocallablnoiselow + LUMINANCECURVE, // Evlocallabrecothres + LUMINANCECURVE, // Evlocallablowthres + LUMINANCECURVE, // Evlocallabhigthres + LUMINANCECURVE, // Evlocallabrecothresd + LUMINANCECURVE, // Evlocallablowthresd + LUMINANCECURVE, // Evlocallabhigthresd + LUMINANCECURVE, // Evlocallabinvmaskd + LUMINANCECURVE, // Evlocallabinvmask + LUMINANCECURVE // Evlocallabdecayd + }; diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 97fa9111d..217096cac 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -5751,6 +5751,10 @@ LocallabBlur::LocallabBlur(): guidbl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GUIDBL"), 0, 1000, 1, 0))), strbl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRBL"), 0, 100, 1, 50))), epsbl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_EPSBL"), -10, 10, 1, 0))), + expdenoise2(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI2_EXP")))), + recothres(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKRECOTHRES"), 1., 2., 0.01, 1.))), + lowthres(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 80., 0.5, 12.))), + higthres(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 20., 99., 0.5, 85.))), sensibn(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 40))), blurMethod(Gtk::manage(new MyComboBoxText())), invbl(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVBL")))), @@ -5763,10 +5767,14 @@ LocallabBlur::LocallabBlur(): expdenoise1(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI1_EXP")))), maskusable(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUSABLE")))), maskunusable(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUNUSABLE")))), + maskusable2(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUSABLE")))), + maskunusable2(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUNUSABLE")))), + maskusable3(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUSABLE")))), + maskunusable3(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUNUSABLE")))), usemask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_USEMASK")))), lnoiselow(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLNOISELOW"), 0.7, 2., 0.01, 1.))), - levelthr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 10., 100., 1., 40.))), - levelthrlow(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 100., 1., 12.))), + levelthr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 20., 99., 0.5, 85.))), + levelthrlow(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 80., 0.5, 12.))), noiselumf0(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMFINEZERO"), MINCHRO, MAXCHRO, 0.01, 0.))), noiselumf(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMFINE"), MINCHRO, MAXCHRO, 0.01, 0.))), noiselumf2(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NOISELUMFINETWO"), MINCHRO, MAXCHRO, 0.01, 0.))), @@ -5781,6 +5789,13 @@ LocallabBlur::LocallabBlur(): detailFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_DETAILFRA")))), detailthr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DETAILTHR"), 0, 100, 1, 50))), adjblur(Gtk::manage(new Adjuster(M("TP_LOCALLAB_ADJ"), -100., 100., 1., 0., Gtk::manage(new RTImage("circle-blue-yellow-small.png")), Gtk::manage(new RTImage("circle-red-green-small.png"))))), + expdenoise3(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI2_EXP")))), + recothresd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKRECOTHRES"), 1., 2., 0.01, 1.))), + lowthresd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 80., 0.5, 12.))), + higthresd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 20., 99., 0.5, 85.))), + decayd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKDDECAY"), 0.5, 4., 0.1, 2.))), + invmaskd(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVMASK")))), + invmask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVMASK")))), bilateral(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BILATERAL"), 0, 100, 1, 0))), sensiden(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 60))), neutral(Gtk::manage (new Gtk::Button (M ("TP_RETINEX_NEUTRAL")))), @@ -5832,6 +5847,8 @@ LocallabBlur::LocallabBlur(): fftwblConn = fftwbl->signal_toggled().connect(sigc::mem_fun(*this, &LocallabBlur::fftwblChanged)); usemaskConn = usemask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabBlur::usemaskChanged)); invblConn = invbl->signal_toggled().connect(sigc::mem_fun(*this, &LocallabBlur::invblChanged)); + invmaskdConn = invmaskd->signal_toggled().connect(sigc::mem_fun(*this, &LocallabBlur::invmaskdChanged)); + invmaskConn = invmask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabBlur::invmaskChanged)); radius->setAdjusterListener(this); @@ -5861,6 +5878,10 @@ LocallabBlur::LocallabBlur(): strbl->setAdjusterListener(this); epsbl->setAdjusterListener(this); + setExpandAlignProperties(expdenoise2, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); + recothres->setAdjusterListener(this); + lowthres->setAdjusterListener(this); + higthres->setAdjusterListener(this); sensibn->setAdjusterListener(this); @@ -5936,6 +5957,11 @@ LocallabBlur::LocallabBlur(): detailthr->setAdjusterListener(this); adjblur->setAdjusterListener(this); + setExpandAlignProperties(expdenoise3, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); + recothresd->setAdjusterListener(this); + lowthresd->setAdjusterListener(this); + higthresd->setAdjusterListener(this); + decayd->setAdjusterListener(this); bilateral->setAdjusterListener(this); @@ -6039,6 +6065,15 @@ LocallabBlur::LocallabBlur(): blnoisebox->pack_start(*guidbl); blnoisebox->pack_start(*strbl); blnoisebox->pack_start(*epsbl); + ToolParamBlock* const wavBox2 = Gtk::manage(new ToolParamBlock()); + wavBox2->pack_start(*maskusable2, Gtk::PACK_SHRINK, 0); + wavBox2->pack_start(*maskunusable2, Gtk::PACK_SHRINK, 0); + wavBox2->pack_start(*recothres); + wavBox2->pack_start(*lowthres); + wavBox2->pack_start(*higthres); + wavBox2->pack_start(*invmask); + expdenoise2->add(*wavBox2, false); + blnoisebox->pack_start(*expdenoise2); blnoisebox->pack_start(*sensibn); // blnoisebox->pack_start(*blurMethod); blnoisebox->pack_start(*invbl); @@ -6077,6 +6112,16 @@ LocallabBlur::LocallabBlur(): wavBox->pack_start(*detailFrame); wavFrame->add(*wavBox); denoisebox->pack_start(*wavFrame); + ToolParamBlock* const wavBox3 = Gtk::manage(new ToolParamBlock()); + wavBox3->pack_start(*maskusable3, Gtk::PACK_SHRINK, 0); + wavBox3->pack_start(*maskunusable3, Gtk::PACK_SHRINK, 0); + wavBox3->pack_start(*recothresd); + wavBox3->pack_start(*lowthresd); + wavBox3->pack_start(*higthresd); + wavBox3->pack_start(*decayd); + wavBox3->pack_start(*invmaskd); + expdenoise3->add(*wavBox3, false); + denoisebox->pack_start(*expdenoise3); denoisebox->pack_start(*bilateral); denoisebox->pack_start(*sensiden); denoisebox->pack_start(*neutral); @@ -6158,6 +6203,10 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) wavshapeden->setTooltip(M("TP_LOCALLAB_WASDEN_TOOLTIP")); wavhue->setTooltip(M("TP_LOCALLAB_WAVHUE_TOOLTIP")); expdenoise1->set_tooltip_markup(M("TP_LOCALLAB_MASKLC_TOOLTIP")); + expdenoise2->set_tooltip_markup(M("TP_LOCALLAB_MASKGF_TOOLTIP")); + expdenoise3->set_tooltip_markup(M("TP_LOCALLAB_MASKDE_TOOLTIP")); + invmask->set_tooltip_text(M("TP_LOCALLAB_MASKDEINV_TOOLTIP")); + invmaskd->set_tooltip_text(M("TP_LOCALLAB_MASKDEINV_TOOLTIP")); LocalcurveEditorwavden->setTooltip(M("TP_LOCALLAB_WASDEN_TOOLTIP")); noiselequal->set_tooltip_text(M("TP_LOCALLAB_DENOIEQUAL_TOOLTIP")); noiselumdetail->set_tooltip_text(M("TP_LOCALLAB_DENOILUMDETAIL_TOOLTIP")); @@ -6190,6 +6239,11 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) lapmaskbl->set_tooltip_text(M("TP_LOCALLAB_LAPRAD1_TOOLTIP")); csThresholdblur->set_tooltip_text(M("TP_LOCALLAB_WAVEMASK_LEVEL_TOOLTIP")); sensiden->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP")); + lowthres->set_tooltip_text(M("TP_LOCALLAB_MASKLOWTHRES_TOOLTIP")); + lowthresd->set_tooltip_text(M("TP_LOCALLAB_MASKLOWTHRESD_TOOLTIP")); + higthresd->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRESD_TOOLTIP")); + higthres->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRES_TOOLTIP")); + decayd->set_tooltip_text(M("TP_LOCALLAB_MASKDECAY_TOOLTIP")); } else { expblnoise->set_tooltip_markup(""); @@ -6207,6 +6261,10 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) quamethod->set_tooltip_markup(""); wavhue->setTooltip(""); expdenoise1->set_tooltip_markup(""); + expdenoise2->set_tooltip_markup(""); + expdenoise3->set_tooltip_markup(""); + invmask->set_tooltip_text(""); + invmaskd->set_tooltip_text(""); LocalcurveEditorwavden->setTooltip(""); noiselequal->set_tooltip_text(""); noiselumdetail->set_tooltip_text(""); @@ -6242,6 +6300,11 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) shadmaskblsha->set_tooltip_text(""); csThresholdblur->set_tooltip_text(""); sensiden->set_tooltip_text(""); + lowthres->set_tooltip_text(""); + lowthresd->set_tooltip_text(""); + higthresd->set_tooltip_text(""); + higthres->set_tooltip_text(""); + decayd->set_tooltip_text(""); } } @@ -6266,6 +6329,17 @@ void LocallabBlur::neutral_pressed () wavshapeden->setCurve(defSpot.locwavcurveden); wavhue->setCurve(defSpot.locwavcurvehue); usemask->set_active(defSpot.usemask); + invmaskd->set_active(defSpot.invmaskd); + invmask->set_active(defSpot.invmask); + recothresd->setValue(defSpot.recothresd); + lowthresd->setValue(defSpot.lowthresd); + higthresd->setValue(defSpot.higthresd); + decayd->setValue(defSpot.decayd); + recothres->setValue(defSpot.recothres); + lowthres->setValue(defSpot.lowthres); + higthres->setValue(defSpot.higthres); + + } void LocallabBlur::setDefaultExpanderVisibility() @@ -6273,6 +6347,8 @@ void LocallabBlur::setDefaultExpanderVisibility() expblnoise->set_expanded(false); expdenoise->set_expanded(false); expdenoise1->set_expanded(false); + expdenoise2->set_expanded(false); + expdenoise3->set_expanded(false); expmaskbl->set_expanded(false); } @@ -6283,6 +6359,8 @@ void LocallabBlur::disableListener() blMethodConn.block(true); fftwblConn.block(true); usemaskConn.block(true); + invmaskdConn.block(true); + invmaskConn.block(true); invblConn.block(true); medMethodConn.block(true); blurMethodConn.block(true); @@ -6302,6 +6380,8 @@ void LocallabBlur::enableListener() blMethodConn.block(false); fftwblConn.block(false); usemaskConn.block(false); + invmaskdConn.block(false); + invmaskConn.block(false); invblConn.block(false); medMethodConn.block(false); blurMethodConn.block(false); @@ -6341,6 +6421,8 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params fftwbl->set_active(spot.fftwbl); usemask->set_active(spot.usemask); + invmaskd->set_active(spot.invmaskd); + invmask->set_active(spot.invmask); invbl->set_active(spot.invbl); radius->setValue(spot.radius); strength->setValue(spot.strength); @@ -6363,8 +6445,15 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params itera->setValue((double)spot.itera); guidbl->setValue((double)spot.guidbl); strbl->setValue((double)spot.strbl); + recothres->setValue((double)spot.recothres); + lowthres->setValue((double)spot.lowthres); + higthres->setValue((double)spot.higthres); epsbl->setValue((double)spot.epsbl); sensibn->setValue((double)spot.sensibn); + recothresd->setValue((double)spot.recothresd); + lowthresd->setValue((double)spot.lowthresd); + higthresd->setValue((double)spot.higthresd); + decayd->setValue((double)spot.decayd); if (spot.blurMethod == "norm") { blurMethod->set_active(0); @@ -6466,6 +6555,8 @@ void LocallabBlur::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.fftwbl = fftwbl->get_active(); spot.usemask = usemask->get_active(); + spot.invmaskd = invmaskd->get_active(); + spot.invmask = invmask->get_active(); spot.invbl = invbl->get_active(); spot.radius = radius->getValue(); spot.strength = strength->getIntValue(); @@ -6488,8 +6579,15 @@ void LocallabBlur::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.itera = itera->getIntValue(); spot.guidbl = guidbl->getIntValue(); spot.strbl = strbl->getIntValue(); + spot.recothres = recothres->getValue(); + spot.lowthres = lowthres->getValue(); + spot.higthres = higthres->getValue(); spot.epsbl = epsbl->getIntValue(); spot.sensibn = sensibn->getIntValue(); + spot.recothresd = recothresd->getValue(); + spot.lowthresd = lowthresd->getValue(); + spot.higthresd = higthresd->getValue(); + spot.decayd = decayd->getValue(); if (blurMethod->get_active_row_number() == 0) { spot.blurMethod = "norm"; @@ -6578,8 +6676,15 @@ void LocallabBlur::setDefaults(const rtengine::procparams::ProcParams* defParams itera->setDefault((double)defSpot.itera); guidbl->setDefault((double)defSpot.guidbl); strbl->setDefault((double)defSpot.strbl); + recothres->setDefault((double)defSpot.recothres); + lowthres->setDefault((double)defSpot.lowthres); + higthres->setDefault((double)defSpot.higthres); epsbl->setDefault((double)defSpot.epsbl); sensibn->setDefault((double)defSpot.sensibn); + recothresd->setDefault((double)defSpot.recothresd); + lowthresd->setDefault((double)defSpot.lowthresd); + higthresd->setDefault((double)defSpot.higthresd); + decayd->setDefault((double)defSpot.decayd); noiselumf0->setDefault(defSpot.noiselumf0); noiselumf->setDefault(defSpot.noiselumf); noiselumf2->setDefault(defSpot.noiselumf2); @@ -6670,6 +6775,67 @@ void LocallabBlur::adjusterChanged(Adjuster* a, double newval) } } + if (a == recothres) { + if(recothres->getValue()!= 1.) { + if (showmaskblMethodtyp->get_active_row_number() == 1) { + showmaskblMethodtyp->set_active(2); + } + } + + if (listener) { + listener->panelChanged(Evlocallabrecothres, + recothres->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == lowthres) { + if (listener) { + listener->panelChanged(Evlocallablowthres, + lowthres->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == higthres) { + if (listener) { + listener->panelChanged(Evlocallabhigthres, + higthres->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == recothresd) { + if(recothresd->getValue()!= 1.) { + if (showmaskblMethodtyp->get_active_row_number() == 0) { + showmaskblMethodtyp->set_active(2); + } + } + + if (listener) { + listener->panelChanged(Evlocallabrecothresd, + recothresd->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == lowthresd) { + if (listener) { + listener->panelChanged(Evlocallablowthresd, + lowthresd->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == higthresd) { + if (listener) { + listener->panelChanged(Evlocallabhigthresd, + higthresd->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == decayd) { + if (listener) { + listener->panelChanged(Evlocallabdecayd, + decayd->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + if (a == epsbl) { if (listener) { listener->panelChanged(Evlocallabepsbl, @@ -6954,11 +7120,13 @@ void LocallabBlur::convertParamToNormal() // Disable all listeners disableListener(); - + invmask->set_active(defSpot.invmask); + invmaskd->set_active(defSpot.invmaskd); // Set hidden GUI widgets in Normal mode to default spot values fftwbl->set_active(defSpot.fftwbl); strumaskbl->setValue(defSpot.strumaskbl); toolbl->set_active(defSpot.toolbl); + decayd->setValue(defSpot.decayd); lapmaskbl->setValue(defSpot.lapmaskbl); shadmaskbl->setValue((double)defSpot.shadmaskbl); shadmaskblsha->setValue((double)defSpot.shadmaskblsha); @@ -6975,6 +7143,8 @@ void LocallabBlur::convertParamToSimple() // Disable all listeners disableListener(); + invmask->set_active(defSpot.invmask); + invmaskd->set_active(defSpot.invmaskd); // Set hidden specific GUI widgets in Simple mode to default spot values showmaskblMethod->set_active(0); @@ -7001,6 +7171,15 @@ void LocallabBlur::convertParamToSimple() lnoiselow->setValue(defSpot.lnoiselow); levelthrlow->setValue(defSpot.levelthrlow); usemask->set_active(defSpot.usemask); + invmaskd->set_active(defSpot.invmaskd); + invmask->set_active(defSpot.invmask); + recothresd->setValue(defSpot.recothresd); + lowthresd->setValue(defSpot.lowthresd); + higthresd->setValue(defSpot.higthresd); + decayd->setValue(defSpot.decayd); + recothres->setValue(defSpot.recothres); + lowthres->setValue(defSpot.lowthres); + higthres->setValue(defSpot.higthres); // Enable all listeners enableListener(); @@ -7014,9 +7193,17 @@ void LocallabBlur::updateGUIToMode(const modeType new_type) fftwbl->hide(); expmaskbl->hide(); expdenoise1->hide(); + expdenoise2->hide(); + expdenoise3->hide(); maskusable->hide(); maskunusable->hide(); - + maskusable2->hide(); + maskunusable2->hide(); + maskusable3->hide(); + maskunusable3->hide(); + decayd->hide(); + invmask->hide(); + invmaskd->hide(); break; case Normal: @@ -7032,17 +7219,46 @@ void LocallabBlur::updateGUIToMode(const modeType new_type) // Specific Simple mode widgets are shown in Normal mode expmaskbl->show(); expdenoise1->show(); + expdenoise2->hide(); + expdenoise3->show(); + if (blMethod->get_active_row_number() == 2) { + expdenoise2->show(); + } + + decayd->hide(); + invmask->hide(); + invmaskd->hide(); if(lnoiselow->getValue()!= 1.) { if (showmaskblMethodtyp->get_active_row_number() == 0) { showmaskblMethodtyp->set_active(2); } } + if(recothres->getValue()!= 1.) { + if (showmaskblMethodtyp->get_active_row_number() == 1) { + showmaskblMethodtyp->set_active(2); + } + } + if(recothresd->getValue()!= 1.) { + if (showmaskblMethodtyp->get_active_row_number() == 0) { + showmaskblMethodtyp->set_active(2); + } + } + if (enablMask->get_active()) { maskusable->show(); maskunusable->hide(); + maskusable2->show(); + maskunusable2->hide(); + maskusable3->show(); + maskunusable3->hide(); + } else { maskusable->hide(); maskunusable->show(); + maskusable2->hide(); + maskunusable2->show(); + maskusable3->hide(); + maskunusable3->show(); } break; @@ -7052,8 +7268,20 @@ void LocallabBlur::updateGUIToMode(const modeType new_type) // Show widgets hidden in Normal and Simple mode if (blMethod->get_active_row_number() == 0) { // Keep widget hidden when blMethod is > 0 fftwbl->show(); + expdenoise2->hide(); } + if (blMethod->get_active_row_number() == 1) { + expdenoise2->hide(); + } + if (blMethod->get_active_row_number() == 2) { + expdenoise2->show(); + } + expdenoise1->show(); + expdenoise3->show(); + decayd->show(); + invmask->show(); + invmaskd->show(); expmaskbl->show(); strumaskbl->show(); @@ -7068,12 +7296,31 @@ void LocallabBlur::updateGUIToMode(const modeType new_type) showmaskblMethodtyp->set_active(2); } } + if(recothres->getValue()!= 1.) { + if (showmaskblMethodtyp->get_active_row_number() == 1) { + showmaskblMethodtyp->set_active(2); + } + } + if(recothresd->getValue()!= 1.) { + if (showmaskblMethodtyp->get_active_row_number() == 0) { + showmaskblMethodtyp->set_active(2); + } + } + if (enablMask->get_active()) { maskusable->show(); maskunusable->hide(); + maskusable2->show(); + maskunusable2->hide(); + maskusable3->show(); + maskunusable3->hide(); } else { maskusable->hide(); maskunusable->show(); + maskusable2->hide(); + maskunusable2->show(); + maskusable3->show(); + maskunusable3->hide(); } } @@ -7152,6 +7399,37 @@ void LocallabBlur::usemaskChanged() } } +void LocallabBlur::invmaskdChanged() +{ + if (isLocActivated && exp->getEnabled()) { + if (listener) { + if (invmaskd->get_active()) { + listener->panelChanged(Evlocallabinvmaskd, + M("GENERAL_ENABLED") + " (" + escapeHtmlChars(spotName) + ")"); + } else { + listener->panelChanged(Evlocallabinvmaskd, + M("GENERAL_DISABLED") + " (" + escapeHtmlChars(spotName) + ")"); + } + } + } +} + +void LocallabBlur::invmaskChanged() +{ + if (isLocActivated && exp->getEnabled()) { + if (listener) { + if (invmask->get_active()) { + listener->panelChanged(Evlocallabinvmask, + M("GENERAL_ENABLED") + " (" + escapeHtmlChars(spotName) + ")"); + } else { + listener->panelChanged(Evlocallabinvmask, + M("GENERAL_DISABLED") + " (" + escapeHtmlChars(spotName) + ")"); + } + } + } +} + + void LocallabBlur::invblChanged() { const LocallabParams::LocallabSpot defSpot; @@ -7257,6 +7535,16 @@ void LocallabBlur::showmaskblMethodtypChanged() showmaskblMethodtyp->set_active(2); } } + if(recothres->getValue()!= 1.) { + if (showmaskblMethodtyp->get_active_row_number() == 1) { + showmaskblMethodtyp->set_active(2); + } + } + if(recothresd->getValue()!= 1.) { + if (showmaskblMethodtyp->get_active_row_number() == 0) { + showmaskblMethodtyp->set_active(2); + } + } // If mask preview is activated, deactivate all other tool mask preview if (locToolListener) { @@ -7274,9 +7562,17 @@ void LocallabBlur::enablMaskChanged() if (enablMask->get_active()) { maskusable->show(); maskunusable->hide(); + maskusable2->show(); + maskunusable2->hide(); + maskusable3->show(); + maskunusable3->hide(); } else { maskusable->hide(); maskunusable->show(); + maskusable2->hide(); + maskunusable2->show(); + maskusable3->hide(); + maskunusable3->show(); } if (isLocActivated && exp->getEnabled()) { @@ -7329,7 +7625,7 @@ void LocallabBlur::updateBlurGUI() if (mode == Expert) { // Keep widget hidden in Normal and Simple mode fftwbl->show(); } - + expdenoise2->hide(); radius->show(); strength->show(); grainFrame->show(); @@ -7337,6 +7633,9 @@ void LocallabBlur::updateBlurGUI() itera->hide(); guidbl->hide(); strbl->hide(); + recothres->hide(); + lowthres->hide(); + higthres->hide(); epsbl->hide(); activlum->show(); } else if (blMethod->get_active_row_number() == 1) { @@ -7348,6 +7647,10 @@ void LocallabBlur::updateBlurGUI() itera->show(); guidbl->hide(); strbl->hide(); + expdenoise2->hide(); + recothres->hide(); + lowthres->hide(); + higthres->hide(); epsbl->hide(); activlum->show(); } else if (blMethod->get_active_row_number() == 2) { @@ -7359,6 +7662,13 @@ void LocallabBlur::updateBlurGUI() itera->hide(); guidbl->show(); strbl->show(); + expdenoise2->hide(); + if (mode == Expert || mode == Normal){ + expdenoise2->show(); + recothres->show(); + lowthres->show(); + higthres->show(); + } epsbl->show(); activlum->hide(); } diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index 7b3b6cb47..4410f823e 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -654,6 +654,10 @@ private: Adjuster* const guidbl; Adjuster* const strbl; Adjuster* const epsbl; + MyExpander* const expdenoise2; + Adjuster* const recothres; + Adjuster* const lowthres; + Adjuster* const higthres; Adjuster* const sensibn; MyComboBoxText* const blurMethod; Gtk::CheckButton* const invbl; @@ -666,6 +670,10 @@ private: MyExpander* const expdenoise1; Gtk::Label* const maskusable; Gtk::Label* const maskunusable; + Gtk::Label* const maskusable2; + Gtk::Label* const maskunusable2; + Gtk::Label* const maskusable3; + Gtk::Label* const maskunusable3; Gtk::CheckButton* const usemask; Adjuster* const lnoiselow; @@ -685,6 +693,15 @@ private: Gtk::Frame* const detailFrame; Adjuster* const detailthr; Adjuster* const adjblur; + MyExpander* const expdenoise3; + Adjuster* const recothresd; + Adjuster* const lowthresd; + Adjuster* const higthresd; + Adjuster* const decayd; + + Gtk::CheckButton* const invmaskd; + Gtk::CheckButton* const invmask; + Adjuster* const bilateral; Adjuster* const sensiden; Gtk::Button* neutral; @@ -715,7 +732,7 @@ private: ThresholdAdjuster* const csThresholdblur; sigc::connection blMethodConn, fftwblConn, invblConn, medMethodConn, blurMethodConn, chroMethodConn, activlumConn, showmaskblMethodConn, showmaskblMethodtypConn, enablMaskConn, toolblConn; - sigc::connection quamethodconn, usemaskConn, neutralconn; + sigc::connection quamethodconn, usemaskConn, invmaskdConn, invmaskConn, neutralconn; public: LocallabBlur(); ~LocallabBlur(); @@ -753,6 +770,8 @@ private: void blMethodChanged(); void fftwblChanged(); void usemaskChanged(); + void invmaskdChanged(); + void invmaskChanged(); void invblChanged(); void medMethodChanged(); void blurMethodChanged(); diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 6cd2c93e5..350a7f87f 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1276,6 +1276,13 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).itera = locallab.spots.at(j).itera && pSpot.itera == otherSpot.itera; locallab.spots.at(j).guidbl = locallab.spots.at(j).guidbl && pSpot.guidbl == otherSpot.guidbl; locallab.spots.at(j).strbl = locallab.spots.at(j).strbl && pSpot.strbl == otherSpot.strbl; + locallab.spots.at(j).recothres = locallab.spots.at(j).recothres && pSpot.recothres == otherSpot.recothres; + locallab.spots.at(j).lowthres = locallab.spots.at(j).lowthres && pSpot.lowthres == otherSpot.lowthres; + locallab.spots.at(j).higthres = locallab.spots.at(j).higthres && pSpot.higthres == otherSpot.higthres; + locallab.spots.at(j).recothresd = locallab.spots.at(j).recothresd && pSpot.recothresd == otherSpot.recothresd; + locallab.spots.at(j).lowthresd = locallab.spots.at(j).lowthresd && pSpot.lowthresd == otherSpot.lowthresd; + locallab.spots.at(j).higthresd = locallab.spots.at(j).higthresd && pSpot.higthresd == otherSpot.higthresd; + locallab.spots.at(j).decayd = locallab.spots.at(j).decayd && pSpot.decayd == otherSpot.decayd; locallab.spots.at(j).isogr = locallab.spots.at(j).isogr && pSpot.isogr == otherSpot.isogr; locallab.spots.at(j).strengr = locallab.spots.at(j).strengr && pSpot.strengr == otherSpot.strengr; locallab.spots.at(j).scalegr = locallab.spots.at(j).scalegr && pSpot.scalegr == otherSpot.scalegr; @@ -1285,6 +1292,8 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).quamethod = locallab.spots.at(j).quamethod && pSpot.quamethod == otherSpot.quamethod; locallab.spots.at(j).blurMethod = locallab.spots.at(j).blurMethod && pSpot.blurMethod == otherSpot.blurMethod; locallab.spots.at(j).usemask = locallab.spots.at(j).usemask && pSpot.usemask == otherSpot.usemask; + locallab.spots.at(j).invmaskd = locallab.spots.at(j).invmaskd && pSpot.invmaskd == otherSpot.invmaskd; + locallab.spots.at(j).invmask = locallab.spots.at(j).invmask && pSpot.invmask == otherSpot.invmask; locallab.spots.at(j).levelthr = locallab.spots.at(j).levelthr && pSpot.levelthr == otherSpot.levelthr; locallab.spots.at(j).lnoiselow = locallab.spots.at(j).lnoiselow && pSpot.lnoiselow == otherSpot.lnoiselow; locallab.spots.at(j).levelthrlow = locallab.spots.at(j).levelthrlow && pSpot.levelthrlow == otherSpot.levelthrlow; @@ -4024,6 +4033,34 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).strbl = mods.locallab.spots.at(i).strbl; } + if (locallab.spots.at(i).recothres) { + toEdit.locallab.spots.at(i).recothres = mods.locallab.spots.at(i).recothres; + } + + if (locallab.spots.at(i).lowthres) { + toEdit.locallab.spots.at(i).lowthres = mods.locallab.spots.at(i).lowthres; + } + + if (locallab.spots.at(i).higthres) { + toEdit.locallab.spots.at(i).higthres = mods.locallab.spots.at(i).higthres; + } + + if (locallab.spots.at(i).recothresd) { + toEdit.locallab.spots.at(i).recothresd = mods.locallab.spots.at(i).recothresd; + } + + if (locallab.spots.at(i).lowthresd) { + toEdit.locallab.spots.at(i).lowthresd = mods.locallab.spots.at(i).lowthresd; + } + + if (locallab.spots.at(i).higthresd) { + toEdit.locallab.spots.at(i).higthresd = mods.locallab.spots.at(i).higthresd; + } + + if (locallab.spots.at(i).decayd) { + toEdit.locallab.spots.at(i).decayd = mods.locallab.spots.at(i).decayd; + } + if (locallab.spots.at(i).isogr) { toEdit.locallab.spots.at(i).isogr = mods.locallab.spots.at(i).isogr; } @@ -4060,6 +4097,14 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).usemask = mods.locallab.spots.at(i).usemask; } + if (locallab.spots.at(i).invmaskd) { + toEdit.locallab.spots.at(i).invmaskd = mods.locallab.spots.at(i).invmaskd; + } + + if (locallab.spots.at(i).invmask) { + toEdit.locallab.spots.at(i).invmask = mods.locallab.spots.at(i).invmask; + } + if (locallab.spots.at(i).levelthr) { toEdit.locallab.spots.at(i).levelthr = mods.locallab.spots.at(i).levelthr; } @@ -6580,6 +6625,13 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : itera(v), guidbl(v), strbl(v), + recothres(v), + lowthres(v), + higthres(v), + recothresd(v), + lowthresd(v), + higthresd(v), + decayd(v), isogr(v), strengr(v), scalegr(v), @@ -6588,6 +6640,8 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : chroMethod(v), quamethod(v), usemask(v), + invmaskd(v), + invmask(v), levelthr(v), lnoiselow(v), levelthrlow(v), @@ -7099,6 +7153,13 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) itera = v; guidbl = v; strbl = v; + recothres = v; + lowthres = v; + higthres = v; + recothresd = v; + lowthresd = v; + higthresd = v; + decayd = v; isogr = v; strengr = v; scalegr = v; @@ -7107,6 +7168,8 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) chroMethod = v; quamethod = v; usemask = v; + invmaskd = v; + invmask = v; levelthr = v; lnoiselow = v; levelthrlow = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 41406e3ea..eccbc7a43 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -613,6 +613,13 @@ public: bool itera; bool guidbl; bool strbl; + bool recothres; + bool lowthres; + bool higthres; + bool recothresd; + bool lowthresd; + bool higthresd; + bool decayd; bool isogr; bool strengr; bool scalegr; @@ -621,6 +628,8 @@ public: bool chroMethod; bool quamethod; bool usemask; + bool invmaskd; + bool invmask; bool levelthr; bool lnoiselow; bool levelthrlow; From d2cd5f21c9ca0c0ab3dfba11bb3ff3b56749f863 Mon Sep 17 00:00:00 2001 From: Thanatomanic <6567747+Thanatomanic@users.noreply.github.com> Date: Sun, 27 Dec 2020 15:31:39 +0100 Subject: [PATCH 031/129] GUI changes: more distinct on/off modules, various CSS and GUI tweaks for further future modifications Collection of CSS and GUI improvements, cleanup of main CSS theme, introduction of highlight for enabled module. Primary change is the modification of the module titles to better distinguish modules that are on or off. The text of a disabled module is now less bright, the corresponding icon is a slightly smaller version of the power icon. When activating the module, the text turns brighter and the icon slightly bigger and also brighter. Thanks to @TechXavAL for the icon work. Secondary changes are related to the margins around several GUI elements, padding within elements and some accompanying borders. These changes hopefully make it easier to distinguish the various (sometimes crowded) GUI elements of modules. The panels have gotten a slightly 'outset' look. Nested panels have a changed look where deeper nesting increases the background brightness slightly, instead of darkening it (old behaviour). This is done without a strong decrease in contrast. The old theme is available as a legacy option. Due to hardcoded GUI changes needed for the new theme, the legacy version is not a 100% exact replicate. The @TooWaBoo theme's may also be slightly affected. --- rtdata/images/svg/power-off-small.svg | 39 +- rtdata/images/svg/power-on-small.svg | 66 +- .../themes/RawTherapee - Legacy-GTK3-20_.css | 1398 +++++++++++++++++ rtdata/themes/RawTherapee-GTK3-20_.css | 348 ++-- rtdata/themes/TooWaBlue-GTK3-20_.css | 5 +- rtdata/themes/size - Legacy.css | 1032 ++++++++++++ rtdata/themes/size.css | 36 +- rtgui/batchqueuepanel.cc | 3 + rtgui/blackwhite.cc | 2 + rtgui/colortoning.cc | 4 + rtgui/dirpyrdenoise.cc | 1 - rtgui/editorpanel.cc | 5 + rtgui/exportpanel.cc | 2 + rtgui/favoritbrowser.cc | 1 + rtgui/guiutils.cc | 20 +- rtgui/icmpanel.cc | 1 + rtgui/lensprofile.cc | 2 + rtgui/navigator.cc | 2 +- rtgui/preferences.cc | 4 + rtgui/recentbrowser.cc | 1 + rtgui/retinex.cc | 5 + rtgui/toolpanel.cc | 2 +- rtgui/toolpanelcoord.cc | 10 - 23 files changed, 2684 insertions(+), 305 deletions(-) create mode 100644 rtdata/themes/RawTherapee - Legacy-GTK3-20_.css create mode 100644 rtdata/themes/size - Legacy.css diff --git a/rtdata/images/svg/power-off-small.svg b/rtdata/images/svg/power-off-small.svg index d04115bb9..a45e63dc5 100644 --- a/rtdata/images/svg/power-off-small.svg +++ b/rtdata/images/svg/power-off-small.svg @@ -1,6 +1,4 @@ - - + inkscape:snap-bbox-midpoints="false" + inkscape:document-rotation="0"> image/svg+xml - + Maciej Dworak @@ -100,11 +99,15 @@ inkscape:groupmode="layer" inkscape:label="Layer 1" transform="translate(0,-8)"> - + + diff --git a/rtdata/images/svg/power-on-small.svg b/rtdata/images/svg/power-on-small.svg index caaf7992d..271c8e53e 100644 --- a/rtdata/images/svg/power-on-small.svg +++ b/rtdata/images/svg/power-on-small.svg @@ -1,6 +1,4 @@ - - + inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)" + sodipodi:docname="power-on-small.svg"> + inkscape:snap-bbox-midpoints="false" + inkscape:document-rotation="0" + inkscape:snap-global="false"> + dotted="false" + visible="true" + enabled="true" /> @@ -63,7 +65,7 @@ image/svg+xml - + Maciej Dworak @@ -97,18 +99,36 @@ + transform="translate(0,-8)" + inkscape:groupmode="layer"> + style="display:none;opacity:0.75;fill:none;fill-opacity:0.752941;fill-rule:nonzero;stroke:#2a7fff;stroke-width:2.9;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:normal" + d="M 11.503774,13.128228 A 5,5 0 0 1 13,16.695239 v 0 a 5,5 0 0 1 -5,5 5,5 0 0 1 -5,-5 5,5 0 0 1 1.499601,-3.570323" + id="path5608-3" + inkscape:connector-curvature="0" + inkscape:label="bottom round glow" /> + id="path2553-6" + inkscape:connector-curvature="0" + inkscape:label="bottom straight glow" /> + + + diff --git a/rtdata/themes/RawTherapee - Legacy-GTK3-20_.css b/rtdata/themes/RawTherapee - Legacy-GTK3-20_.css new file mode 100644 index 000000000..dd7be3bfd --- /dev/null +++ b/rtdata/themes/RawTherapee - Legacy-GTK3-20_.css @@ -0,0 +1,1398 @@ +/* + This file is part of RawTherapee. + + Copyright (c) 2015-2017 DrSlony + Copyright (c) 2016-2019 Hombre + Copyright (c) 2016-2019 TooWaBoo + + RawTherapee is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + RawTherapee is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with RawTherapee. If not, see . +*/ + +/***************************/ +/**/ @import "size - Legacy.css"; /**/ +/***************************/ + +/* text-shadow causes a serious performance degradation in rendering the UI, + * at least in comboboxes with many entries (i.e. Profiled Lens Correction). +*/ + +* { + color: #AAAAAA; + text-shadow: none; +} + +*:disabled { + color: #666666; + opacity: 0.7; +} + +.view:selected:not(check):not(radio) { + color: #262626; + background-color: #AAAAAA +} + +/* The Places and Dir browser panels */ +textview.view, treeview.view { + padding: 0; + margin: 0; +} +.view, .textview, textview, textview.view { + background-color: #262626; +} +/* The headers of these panels */ +.view .button { + background-color: #363636; + /*padding: 0.1666666666666666em;*/ +} + +window > box { + padding: 0.416666666666666666em; +} +window.background { + background-color: #484848; +} + +/*** Window decoration *********************************************************/ +@define-color winHeaderbar rgb(50,50,50); + +.csd:not(.popup):not(tooltip) > decoration { + background-color: #484848; + background-image: none; + box-shadow: 0 0.25em 0.75em 0.083333333333333333em rgba(0, 0, 0, 0.5), 0 0 0 0.083333333333333333em #242424; +} +headerbar { + background-color: shade(@winHeaderbar,1.12); + box-shadow: inset 0 0.083333333333333333em rgba(200,200,200,.13); + background-image: linear-gradient(shade(@winHeaderbar,1.14), shade(@winHeaderbar,.86)); + border-bottom-color: #242424; +} +dialog > box { + padding: 0.666666666666666666em; +} +dialog.csd #PrefNotebook > header, +dialog.csd #AboutNotebook > header, +window.csd:not(.fullscreen) #MainNotebook > header.top { + border-top-color: #484848; +} + +/* Window state */ +.maximized > headerbar { + border-radius: 0; +} +/**/ + +/*** End Window decoration *****************************************************/ + +arrow { + min-width: 1.333333333333333333em; + min-height: 1.333333333333333333em; +} +cellview { + margin: -1px 0; +} + +overshoot, +undershoot { + background-image: none; /* removes the dashed scrollbar line */ +} + +dialog.background { + background-color: #484848; +} + +box, grid { + border-width: 0; + border-style: none; + border-radius: 0; + margin: 0.083333333333333333em; + padding: 0; + min-height: 0.4166666666666666em; + min-width: 0.4166666666666666em; +} +label { + padding: 0.083333333333333333em 0; + margin: 0.19em; + min-height: 1.333333333333333333em; +} + +/* Affects all frames except in the toolbox */ +frame { + border-width: 0; + border-color: #303030; + border-radius: 0; + border-style: solid; + /*border-style: none none none solid;*/ + padding: 0; + margin: 0; + background-color: rgba(0,0,0,0.); + min-height: 0; + min-width: 0; +} + +/* Create space between frame contents and frame border */ +frame border { + border-width: 0.083333333333333333em; + padding: 0.3333333333333333em; + border-radius: 0.3333333333333333em; + background-color: #383838; + margin: 0; + min-height: 0; + min-width: 0; +} + +frame > label { + margin: 0 0 0 0.3333333333333333em; + color: #D8D8D8; + padding: 0.416666666666666666em 0; +} + +/* affects selection list*/ +entry > window > frame { + margin: 0; +} + +tooltip { + border-radius: 0.416666666666666666em; + background-color: rgba(0,0,0,0.95); + border-style: none; + box-shadow: none; + padding: 0; + margin: 0; +} + +treeview header button { + background-image: linear-gradient(#343434, #2E2E2E, #292929); +} + +/*** Separator *********************************************************************************/ +separator, +.separator { + border: none; + min-width: 0.083333333333333333em; + min-height: 0.083333333333333333em; +} +grid separator, box separator { + background-color: rgba(0, 0, 0, 0.17); +} +grid separator.horizontal, box separator.horizontal { + margin: 0.5em 0.25em; +} +grid separator.vertical, box separator.vertical { + margin: 0.25em 0.5em; +} + +popover separator:not(:only-child) { + margin: 0 0.5em; +} + +paned.horizontal > separator { + margin: 0 0.16666666666666666em; +} +/* Double line separator */ +paned.vertical > separator { + margin: 0.25em 0; +} + +dialog paned.horizontal > separator { + min-width: 0.333333333333333333em; +} + +menu separator { + margin: 0.25em 0.5em; +} + +#Navigator separator { + margin: 0; +} + +.scrollableToolbar separator.vertical { + margin: 0.19em; +} + +#MyExpander separator.horizontal { + margin: 0.25em 0.19em; +} +#MyFileChooserButton separator { +} + +#PlacesPaned .view.separator { +} + +#MetaPanelNotebook separator { + margin: 0.19em 0; +} +/*** end****************************************************************************************/ + +#FileBrowser { + padding: 0.1666666666666666em; + margin: 0; +} + +#FileCatalog { + background-color: #393939; +} +#FileCatalog:selected { + background-color: #565656; +} + +#BeforeAfterContainer frame { + background-color: #262626; + padding: 0; + margin: 0.0833333333333333em; +} + +#BeforeAfterContainer frame border { + border-radius: 0; + margin: 0; + padding: 0; +} + + +/* Frames in the toolbox. Not MyExpander frames. */ +eventbox.frame { + border-color: #565656; +} + +/*** Load - Save dialog ************************************************************************/ +filechooser { +margin-bottom: 0.25em; +} + +filechooser box > box box > button { +margin-top: 0.5em; +margin-right: 0; +} + +filechooser #pathbarbox { + padding: 0.5em; +} + +/* Right side */ +filechooser > box > paned > box:nth-child(3) { + border-width: 0.083333333333333333em; + padding: 0; + margin: 0; +} +filechooser > box > paned > box:nth-child(3) > box > * > * > * > frame { + padding: 0; + margin: -0.6666666666666666em -0.083333333333333333em; +} +/**/ +filechooser placessidebar viewport.frame { + padding: 0; + margin: -0.3333333333333333em 0 -0.083333333333333333em; + border-width: 0.083333333333333333em; +} +filechooser placessidebar list row image { + min-width: 1.333333333333333333em; + min-height: 1.333333333333333333em; +} +filechooser placessidebar list row { + margin: 0; + padding: 0 0.5em 0 0.83333333333333333em; + min-height: calc(1.416666666666666666em + 8px); +} +filechooser placessidebar list row label{ + margin: 0 0 0 0.583333333333333333em; +} + +/*** end ***************************************************************************************/ + +/*** Scrollbar ***************************************/ +scrollbar { + border: none; + margin: 0; + padding: 0; + background-color: #303030; +} +scrollbar slider { + padding: 0; + margin: 0; + background-color: #808080; +} +scrollbar slider:hover { + background-color: #999999; +} + +scrollbar:not(.overlay-indicator).horizontal { + border-width: 0 0.083333333333333333em 0.083333333333333333em 0.083333333333333333em; +} +scrollbar:not(.overlay-indicator).vertical { + border-width: 0.083333333333333333em 0.083333333333333333em 0.083333333333333333em 0; +} +scrollbar:not(.overlay-indicator).horizontal slider, +scrollbar.horizontal.hovering slider { + min-height: 0.5em; + min-width: 2em; + border-width: 0.25em; +} +scrollbar:not(.overlay-indicator).horizontal.fine-tune slider, +scrollbar.horizontal.hovering.fine-tune slider { + min-height: calc(0.5em - 2px); + border-width: calc(0.25em + 1px); + margin: 0 -1px; + /* + min-height: 0.3333333333333333em; + border-width: 0.3333333333333333em; + margin: 0 -0.0833333333333333em; + */ +} +scrollbar.horizontal.overlay-indicator:not(.hovering) slider { + min-width: 2em; + min-height: 0.25em; + border-width: 0; + border-radius: 0.25em; + margin: 0.166666666666666666em 0.25em; + /*margin: 0 0.1666666666666666em;*/ +} + +scrollbar:not(.overlay-indicator).vertical slider, +scrollbar.vertical.hovering slider { + min-height: 2em; + min-width: 0.5em; + border-width: 0.25em; +} +scrollbar:not(.overlay-indicator).vertical.fine-tune slider, +scrollbar.vertical.hovering.fine-tune slider { + min-width: calc(0.5em - 2px); + border-width: calc(0.25em + 1px); + margin: -0.0833333333333333em 0; + /* + min-width: 0.3333333333333333em; + border-width: 0.3333333333333333em; + margin: -0.0833333333333333em 0; + */ +} +scrollbar.vertical.overlay-indicator:not(.hovering) slider { + min-width: 0.25em; + min-height: 2em; + border-width: 0; + border-radius: 0.25em; + margin: 0.1666666666666666em 0; + /*margin: 0.25em 0.166666666666666666em;*/ +} + +/* Scrollbar stuck workaround */ +scrollbar:not(.overlay-indicator):hover { + min-width: 1px; +} + +/* Toolbar stuck workaround */ +.scrollableToolbar > scrollbar:not(.dummy), +.scrollableToolbar > scrollbar:not(.dummy) > contents:not(.dummy), +.scrollableToolbar > scrollbar:not(.dummy) > contents:not(.dummy) > trough:not(.dummy), +.scrollableToolbar > scrollbar:not(.dummy) > contents:not(.dummy) > trough:not(.dummy) > slider:not(.dummy) { + padding: 0; + margin: 0; + min-height: 0; + min-width: 0; + border: none; +} + +/**************************************************/ + +button { + padding: 0; + box-shadow: none; + min-height: 0.4166666666666666em; + min-width: 0.4166666666666666em; + background-image: linear-gradient(to bottom, rgba(100,100,100,.3), rgba(30,30,30,.3)); +} + +button:disabled { + opacity: 1; +} + +button.flat { + background-image: none; +} + +button.flat:checked { + background-image: linear-gradient(#343434, #2E2E2E, #292929); +} + +checkbutton > check { + background-image: linear-gradient(#343434, #2E2E2E, #292929); +} + +radiobutton > radio { + background-image: linear-gradient(#343434, #2E2E2E, #292929); +} + +button.flat:hover, checkbutton:hover > check, radiobutton:hover > radio { + background-image: linear-gradient(shade(#343434,1.3), shade(#2E2E2E,1.3), shade(#292929,1.3)); +} + +button.popupbutton-arrow { + min-width: 1.5em; +} + +button:hover { + background-image: linear-gradient(to bottom, rgba(150,150,150,.3), rgba(80,80,80,.3)); +} + +button:active { + background-image: linear-gradient(to bottom, rgba(30,30,30,.3), rgba(0,0,0,.3)); +} + +button:checked { + background-image: linear-gradient(to bottom, rgba(30,30,30,.8), rgba(0,0,0,.8)); +} + +button:checked:hover { + background-image: linear-gradient(to bottom, rgba(60,60,60,1), rgba(30,30,30,1)); +} + +/* Save, Cancel, OK ... buttons */ +.dialog-action-area button { + min-height: 2em; + margin-top: 0.5em; +} +/**/ + +/*** Scale**************************************************************************************/ +scale { + padding: 0; + min-height: 0.4166666666666666em; + margin: 0 0.5833333333333333em 0 0; +} + +scale slider { + /* Slider size is min-width x min-height ; margin have to be half of those values, but negative */ + min-width: 0; + min-height: 0; + margin: -0.583333333333333333em; + padding: 0.583333333333333333em; + border-radius: 1.166666666666666666em; + border-width: 0.083333333333333333em; + background-image: linear-gradient(#343434, #2E2E2E, #292929); +} +scale slider:hover { + background-image: linear-gradient(#444444, #3E3E3E, #393939); +} +scale:disabled slider { + background-image: none; + background-color: #444; + border-color: #282828; +} +scale trough { + margin: 0.5em 0.5em; /* have to be half of "scale slider / min-width min-height" */ + min-height: 0.2em; + min-width: 0.2em; + padding: 0 0.583333333333333333em; + border-width: 0.083333333333333333em; + border-radius: 0.333333333333333333em; + background-color: #2A2A2A; +} +scale:disabled trough { + background-color: #444; + border-color: #282828; +} +scale.color trough { + border-width: 0.083333333333333333em; + min-height: 0.333333333333333333em; + min-width: 0.333333333333333333em; + border-radius: 0; + padding: 0; +} + +scale trough highlight { + border: none; + margin: 0 -0.583333333333333333em; + border-radius: 0.2em; + min-height: 0; + min-width: 0; + padding: 0.1em 0.1em 0 0; /*height of trough */ +} + +scale.fine-tune trough highlight { + padding: 0.5em 0.5em 0 0; + border-radius: 0.5em; +} +/*** end ***************************************************************************************/ + + +/*.EditorTopPanel .button, .ToolBarPanelFileBrowser .button, .EditorZoomPanel .button {*/ +.button { + padding: 0.0833333333333333em; + margin: 0.0833333333333333em; + padding: 0; + min-height: 0.4166666666666666em; + min-width: 0.4166666666666666em; + border-radius: 0.25em; +} + +/* Adjusters */ +.text-button { + padding: 0; +} + +/* Any text-button which is a real button, unlike Slider label */ +.text-button.button { + padding: 0.3333333333333333em; +} + +/* Better on/off state separation for text toggle buttons, e.g. auto-levels or histogram matching. */ +button.text-button.toggle { + background-image: linear-gradient(to bottom, rgba(100,100,100,.3), rgba(30,30,30,.3)); +} + +button.text-button.toggle:hover { + background-image: linear-gradient(to bottom, rgba(128,128,128,.3), rgba(64,64,64,.3)); +} + +button.text-button.toggle:checked { + background-image: linear-gradient(to bottom, rgba(30,30,30,.3), rgba(0,0,0,.4)); +} + +button.text-button.toggle:hover:checked { + background-image: linear-gradient(to bottom, rgba(48,48,48,.3), rgba(0,0,0,.3)); +} + +/* */ + +.drawingarea { + border-radius: 0; + background-color: #2A2A2A; + border: 0.0833333333333333em solid #888888; +} +.drawingarea:disabled { + background-color: #444; + border-color: #282828; +} + +.drawingarea:selected { + background-color: #565656; + border-radius: 0.8333333333333333em; +} + +image { + padding: 0.0833333333333333em; +} + +/* Vertical group of buttons in 1 column */ +button.Top { + border-radius: 0.25em 0.25em 0 0; + border-style: solid solid none solid; + margin-bottom: 0; +} +button.MiddleV { + border-radius: 0; + border-style: none solid none solid; + margin-top: 0; + margin-bottom: 0; +} +button.Bottom { + border-radius: 0 0 0.25em 0.25em; + border-style: none solid solid solid; + margin-top: 0; +} +/* end */ + +/* Horizontal group of buttons in 1 row */ +#MetaPanelNotebook scrolledwindow + grid > button.Left, +#MetaPanelNotebook scrolledwindow + grid + grid > button.Left, +#ProfilePanel button.Left, +button.Left { + border-radius: 0.25em 0 0 0.25em; + border-style: solid none solid solid; + margin-right: 0; +} +#MetaPanelNotebook scrolledwindow + grid > button.MiddleH, +#MetaPanelNotebook scrolledwindow + grid + grid > button.MiddleH, +#ProfilePanel button.MiddleH, +button.MiddleH { + border-radius: 0; + border-style: solid none solid none; + margin-left: 0; + margin-right: 0; +} +#MetaPanelNotebook scrolledwindow + grid > button.Right, +#MetaPanelNotebook scrolledwindow + grid + grid > button.Right, +#ProfilePanel button.Right, +button.Right { + border-radius: 0 0.25em 0.25em 0; + border-style: solid solid solid none; + margin-left: 0; +} +/* end */ + +/* [1.23[-][+]] */ +entry, spinbutton { + min-height: 0.8333333333333333em; + background-color: #262626; + border-radius: 0.2em; +} + +spinbutton entry { + padding-right: 0.25em; +} +spinbutton button { + margin: 0; + padding: 0; + border-radius: 0; +} +spinbutton button.up { + border-radius: 0 0.16666666666666666666em 0.16666666666666666666em 0; +} + +entry:disabled, spinbutton:disabled { + background-color: #363636; +} + +entry:hover, spinbutton:hover { + background-color: #565656; +} + +entry:selected { + color: #262626; + background-color: #AAAAAA; +} + +/* Context menus */ +menu { + background-color: #262626; + color: #909090; +} + +/* Context menu item */ +menuitem { + padding: 0.1666666666666666em; + margin: 0; + min-height: 0.8333333333333333em; +} + +/* FlowBoxChild */ +flowboxchild:selected { + background-color: inherit; +} + +/*** Histogram *********************************************************************************/ +#HistogramPanel { + min-height: 0; + margin: 0; + padding: 0; + border: none; +} + +#HistogramPanel > :nth-child(2) { + border: none; + border-left-width: 0.083333333333333333em; +} + +#HistogramPanel > :nth-child(1) { + border: none; +} + +#EditorLeftPaned #HistogramPanel > :nth-child(1) { + border: none; + border-right-width: 0.083333333333333333em; +} + +#EditorLeftPaned #HistogramPanel > :nth-child(2) { + border: none; +} + +#HistogramArea, +#HistogramRGBArea { + border-width: 0.083333333333333333em; +} + +#histButton { + padding: 0.25em 0.25em 0; + margin: 0 0 -1px 0; + min-height: 1.333333333333333333em; + min-width: 1.333333333333333333em; +} +#histButton:last-child { + padding-bottom: 0.25em; + margin: 0; +} + +/* Vertical version of slider. */ +#histScale { + min-height: 4em; + min-width: 0.4166666666666666em; + margin: 0.5833333333333333em 0 0 0; +} +#histScale trough { + padding: 0.583333333333333333em 0; +} +#histScale trough highlight { + margin: -0.583333333333333333em 0; + padding: 0.1em 0 0 0.1em; +} +#histScale.fine-tune trough highlight { + padding: 0.5em 0 0 0.5em; +} + +/* Copied from button.flat style. */ +button.radio#histButton { + background-image: none; +} + +button.radio#histButton:checked { + background-image: linear-gradient(#343434, #2E2E2E, #292929); +} + +button.radio#histButton:hover { + background-image: linear-gradient(shade(#343434,1.3), shade(#2E2E2E,1.3), shade(#292929,1.3)); +} + +/*** end ***************************************************************************************/ + +#MyExpander { + margin: 0; + padding: 0; +} +#MyExpander.withScrollbar { + margin-right: 0.25em; +} + +/* Tool background */ +#ExpanderBox > box, #ExpanderBox > grid { + background-color: #363636; + border-width: 0.0833333333333333em; + border-style: solid; + border-radius: 0.3333333333333333em; + border-color: #252525; + margin: 0; + padding: 0.25em; +} + +#ExpanderBox drawingarea { + background-color: #363636; +} + +#LocallabToolPanel frame, +#ExpanderBox frame, +#ExpanderBox2 frame, +#ExpanderBox3 frame { + padding: 0.1666666666666666em 0 0 0; + border-style: none; +} +#ExpanderBox frame > border { + background-color: #3B3B3B; + border-style: solid; + border-width: 0.0833333333333333em; + border-radius: 0.3333333333333333em; + border-color: #313131; + margin: 0.25em; + padding: 0.25em; +} + +#LocallabToolPanel frame > label, #LocallabToolPanel frame frame > label, +#ExpanderBox frame > label, #ExpanderBox frame frame > label, +#ExpanderBox2 frame > label, #ExpanderBox2 frame frame > label, +#ExpanderBox3 frame > label, #ExpanderBox3 frame frame > label { + margin-left: 7pt; + margin-top: 0; +} + +#LocallabToolPanel frame > box, #LocallabToolPanel frame frame > box, #LocallabToolPanel frame > grid, #LocallabToolPanel frame frame > grid, +#ExpanderBox frame > box, #ExpanderBox frame frame > box, #ExpanderBox frame > grid, #ExpanderBox frame frame > grid, +#ExpanderBox2 frame > box, #ExpanderBox2 frame frame > box, #ExpanderBox2 frame > grid, #ExpanderBox2 frame frame > grid, +#ExpanderBox3 frame > box, #ExpanderBox3 frame frame > box, #ExpanderBox3 frame > grid, #ExpanderBox3 frame frame > grid { + margin: 0.1666666666666666em; +} + +#LocallabToolPanel > box > checkbutton, #LocallabToolPanel > box > box, #LocallabToolPanel > grid > checkbutton, #LocallabToolPanel > box > grid, #LocallabToolPanel > grid > grid, #LocallabToolPanel frame > box > grid, #LocallabToolPanel frame > grid > grid, #LocallabToolPanel frame > grid > box, +#ExpanderBox > box > checkbutton, #ExpanderBox > box > box, #ExpanderBox > grid > checkbutton, #ExpanderBox > box > grid, #ExpanderBox > grid > grid, #ExpanderBox frame > box > grid, #ExpanderBox frame > grid > grid, #ExpanderBox frame > grid > box, +#ExpanderBox2 > box > checkbutton, #ExpanderBox2 > box > box, #ExpanderBox2 > grid > checkbutton, #ExpanderBox2 > box > grid, #ExpanderBox2 > grid > grid, #ExpanderBox2 frame > box > grid, #ExpanderBox2 frame > grid > grid, #ExpanderBox2 frame > grid > box, +#ExpanderBox3 > box > checkbutton, #ExpanderBox3 > box > box, #ExpanderBox3 > grid > checkbutton, #ExpanderBox3 > box > grid, #ExpanderBox3 > grid > grid, #ExpanderBox3 frame > box > grid, #ExpanderBox3 frame > grid > grid, #ExpanderBox3 frame > grid > box { + margin-top: 0.1666666666666666em; +} + +#ExpanderBox frame drawingarea { + background-color: #3B3B3B; +} + +#ExpanderBox frame frame > border { + background-color: #414141; + border: 0.0833333333333333em solid #373737; + border-radius: 0.3333333333333333em; + margin: 0.25em; + padding: 0.25em; +} + +#ExpanderBox frame frame drawingarea { + background-color: #414141; +} + +/* Sub-tool (MyExpander) background */ +#LocallabToolPanel > box, #LocallabToolPanel > grid, +#ExpanderBox2 > box, #ExpanderBox2 > grid { + background-color: #3B3B3B; + border: 0.0833333333333333em solid #2A2A2A; + border-radius: 0.3333333333333333em; + margin: 0; + padding: 0.25em; +} + +#LocallabToolPanel drawingarea, +#ExpanderBox2 drawingarea { + background-color: #3B3B3B; +} + +#LocallabToolPanel frame > border, +#ExpanderBox2 frame > border { + background-color: #414141; + border: 0.0833333333333333em solid #373737; + border-radius: 0.3333333333333333em; + margin: 0.25em; + padding: 0.25em; +} + +#LocallabToolPanel frame drawingarea, +#ExpanderBox2 frame drawingarea { + background-color: #414141; +} + +#LocallabToolPanel frame frame > border, +#ExpanderBox2 frame frame > border { + background-color: #474747; + border: 0.0833333333333333em solid #3D3D3D; + border-radius: 0.3333333333333333em; + margin: 0.25em; + padding: 0.25em; +} + +#LocallabToolPanel frame frame drawingarea, +#ExpanderBox2 frame frame drawingarea { + background-color: #474747; +} + +#MyExpanderTitle > box { + margin: 0.1666666666666667em 0; + padding: 0.1666666666666667em 0; +} + +#MyExpanderTitle label { + color: #CCCCCC; + padding: 0; + margin: 0 0.25em 0 0.25em; + font-size: 1.1em; + font-weight: bold; +} +#MyExpanderTitle:hover { + background-color: #202020; +} +#MyExpanderTitle eventbox:hover image { + background-color: #202020; + border-radius: 0.25em; +} +#MyExpanderTitle:hover label { + color: #D8D8D8; +} + +#LocallabToolPanel separator, #ExpanderBox2 separator, #ExpanderBox3 separator { + color: #292929; +} + +/* Editor tab button */ +#MainNotebook grid label, #MainNotebook grid image { + padding: 0.0833333333333333em; +} + +/* File Browser right side tabs - Toolbox, Inspector, Fast Export, Filter */ +notebook { + padding: 0; + margin: 0; + border-style: none; +} + +notebook header { + box-shadow: none; + background-color: #383838; + border-width: 0.0833333333333333em; + border-style: none; + border-color: #262626; + border-radius: 0; + padding: 0.1666666666666666em; + margin: 0; +} + +notebook tabs { + padding: 0.0833333333333333em; + margin: 0; +} + +notebook tab { + padding: 0.0833333333333333em; + margin: 0.1666666666666666em; + min-height: 1.25em; + min-width: 1.25em; +} + +notebook tab:hover { + background-color: #505050; +} + +notebook tab button { + padding: 0 0; + margin: 0 0.25em; +} + +/* Get rid of shitty notebook header shadow */ +notebook header.top { + border-bottom-style: solid; + padding-bottom: 0.25em; +} +notebook header.right { + border-left-style: solid; + padding-left: 0.25em; +} +notebook header.bottom { + border-top-style: solid; + padding-top: 0.25em; +} +notebook header.left { + border-right-style: solid; + padding-right: 0.25em; +} + +notebook.frame { + /* OK */ + border-radius: 0; + border-style: none; +} + +/* Pad notebooks, makes the other borders look nicer */ +notebook stack { + /* OK */ + background-color: #484848; + padding: 0; + margin: 0; +} + +paned box, paned grid { + padding: 0; + margin: 0; + border-style: none; +} + +paned > separator { + border-width: 0.0833333333333333em 0.0833333333333333em 0 0; + border-style: solid; + border-color: #404040; + padding: 0; + margin: 0.3333333333333333em; +} +fontchooser scrolledwindow, +#PlacesPaned scrolledwindow, +#HistoryPanel scrolledwindow, +#Snapshots scrolledwindow { + border-width: 0.083333333333333333em; +} + +#PlacesPaned { + margin: 0; + padding: 0 0.4166666666666666em 0 0; +} +#PlacesPaned > box:nth-child(1) scrolledwindow + grid { + margin: 0; + border-top-width: 0.083333333333333333em; +} +#PlacesPaned > box:nth-child(3) treeview { + padding: 0; +} + +#MainNotebook > header.left tab image { + margin: 0.5em 0 0 0; +} +#MainNotebook > header.top tab image { + margin: 0 0.5em 0 0; +} +#MainNotebook > header.left tab { + margin: 0.5em 0 0.5em 0; +} +#MainNotebook > header.top tab { + margin: 0 0.5em 0 0.5em; +} + +#MainNotebook header { + /* OK */ + background-color: #2A2A2A; + border: 0; + padding: 0; +} +#MainNotebook tabs { + /* OK */ + background-color: #2A2A2A; +} +#MainNotebook tab:hover { + /* OK */ + background-color: #505050; +} +#MainNotebook tab:active { + /* OK */ + border-color: #989898; +} +#MainNotebook tab:checked { + background-color: #505050; +} + +#RightNotebook > stack > :nth-child(1) checkbutton + scrolledwindow { + min-height: calc(6em + 43px); +} +#RightNotebook > stack > scrolledwindow frame, +#BatchQueueButtonsMainContainer frame, +#MyExpander frame, +dialog frame { + margin: 0; + padding: 0.19em 0.583333333333333333em; +} +#RightNotebook > stack > scrolledwindow frame > border, +#BatchQueueButtonsMainContainer > frame > border, +#MyExpander frame > border, +dialog frame > border { + padding: 0 0.333333333333333333em 0.333333333333333333em; + border-width: 0.083333333333333333em; + margin: 0 -0.583333333333333333em; +} +#RightNotebook > stack > scrolledwindow frame > label:not(.dummy), +#BatchQueueButtonsMainContainer frame > label:not(.dummy), +#ToolPanelNotebook frame > label:not(.dummy), +dialog frame > label:not(.dummy) { + padding: 0.25em 0.5em; +} +#BatchQueueButtonsMainContainer frame > border { + margin-bottom: 0.833333333333333333em; +} +#BatchQueueButtonsMainContainer frame:nth-child(3) > border { + padding-left: 0.916666666666666666em; +} + +#RightNotebook header { + background-color: #2A2A2A; +} +#RightNotebook tabs { + background-color: #2A2A2A; + padding-bottom: 0.083333333333333333em; +} +#RightNotebook tab:hover { + background-color: #505050; + color: #D6D6D6; +} +#RightNotebook tab:active { + border-color: #A5A5A5; +} + +#LabelRightNotebook { + padding: 0.4166666666666666em; + margin: 0.1666666666666666em; + font-size: 1.25em; +} + +#ToolPanelNotebook { + min-width: 25em; +} + +#ToolPanelNotebook header { + background-color: #383838; + border-color: #262626; + padding: 0; + margin: 0; +} + +#ToolPanelNotebook header tabs { + background-color: #2A2A2A; + margin: 0; +} + +#ToolPanelNotebook header tab { + padding: 0.25em; + margin: 0; +} + +/* All tool panels have a frame except for Meta which unlike the rest is a notebook itself. + * So we use CSS to make it look like a frame. */ +#MetaPanelNotebook > stack > box { + border: 0.0833333333333333em solid #262626; + background-color: #363636; + border-radius: 0 0 0.3333333333333333em 0.3333333333333333em; + border-top-style: none; + padding: 0 0.25em 0.25em 0.25em; + margin: 0 0.4166666666666666em 0.4166666666666666em 0.4166666666666666em; +} + +#MetaPanelNotebook header { + border: 0.0833333333333333em solid #262626; + background-color: #363636; + border-radius: 0.3333333333333333em 0.3333333333333333em 0 0; + border-bottom-style: none; + padding: 0.4166666666666666em; + margin: 0.4166666666666666em 0.4166666666666666em 0 0.4166666666666666em; +} + +#MetaPanelNotebook > header > tabs { + background-color: #363636; +} + +#MetaPanelNotebook > header tab { + margin: 0 0.4166666666666666em; + padding: 0.4166666666666666em; +} + +#MetaPanelNotebook textview { + border-radius: 0.25em; +} + +#MetaPanelNotebook entry, #MetaPanelNotebook scrolledwindow, #MetaPanelNotebook combobox { + margin: 0.1666666666666666em 0 0.1666666666666666em 0; +} + +#MetaPanelNotebook entry { + padding: 0 0.0833333333333333em; +} + +#MetaPanelNotebook label { + padding: 0 0.4166666666666666em; +} + +#MetaPanelNotebook text { + border-color: #202020; + background-color: #262626; + border-style: solid; + border-width: 0.0833333333333333em; + border-radius: 0.25em; +} + +#MetaPanelNotebook stack > box > scrolledwindow > viewport { + margin-left: 1.25em; +} + +#PreviewWindow { + border-style: solid; +} + +/* Decently sized tabs */ +#PrefNotebook tab, #AboutNotebook tab { + padding: 0.8em; +} + +#PrefNotebook, #AboutNotebook { + padding: 0; + margin: 0 0 3pt 0; +} + +#PrefNotebook header, #AboutNotebook header { + padding: 0; + margin: 0; +} + +#PrefNotebook header tabs, #AboutNotebook header tabs { + padding: 0; + margin: 0; +} + +#PrefNotebook stack, #AboutNotebook stack { + padding: 3pt; + margin: 0; +} +#PrefNotebook box > frame > border { + padding-top: 0; + padding-bottom: 0.25em; +} +#PrefNotebook scrolledwindow scrolledwindow { + border-width: 0.083333333333333333em; +} + +/* Add space between bottom panel and window edge */ +#IopsPanel { + padding: 0 0.1666666666666666em 0.1666666666666666em; +} + +#EditorLeftPaned:last-child { + padding: 0.8333333333333333em 0 0 0.8333333333333333em; +} + +#EditorRightPaned:last-child { + padding: 0; +} + +#MainNotebook > header #CloseButton { + padding: 0; + margin: 0 0 0 0.3em; +} +#MainNotebook > header #CloseButton image { + padding: 0; + margin: 0; +} + +#RightNotebook #ToolPanelNotebook stack { + margin: 0; +} + +#RightNotebook #HistoryPanel { + min-width: 17.5em; + margin-top: 0.333333333333333333em; +} + +#RightNotebook scrolledwindow { + padding: 0; +} +#HistoryPanel { + margin-top: 0.25em; +} +#HistoryPanel > border { + margin-top: 1.75em; +} +#HistoryPanel > label { + margin: 0 0 -1.5em 0; + padding: 0 0 0 0.083333333333333333em; +} +#Snapshots { + margin-top: 0.166666666666666666em; +} +#Snapshots > border { + min-height: calc(6em + 36px); +} +#Snapshots > label { + margin-bottom: -4px; +} +#Snapshots scrolledwindow + box { + margin: -8px 0 -4px ; + border-top-width: 0.083333333333333333em; +} +#Navigator { + padding-top: 0.25em; + padding-bottom: 0.25em; +} +#Navigator label { + padding: 0; + margin: 0.083333333333333333em 0; +} + +/*** PartialPaste ******************************************************************************/ +#PartialPaste { + border-width: 0.083333333333333333em; + padding-top: 0.5em; + padding-bottom: 0.5em; +} + +#PartialPaste separator.vertical { + margin: 0 0.333333333333333333em; + padding: 0; +} + +#PartialPaste separator { /* Struggles with #PartialPasteHeaderSep */ + margin: 0.166666666666666666em 0.5em 0.166666666666666666em 1.166666666666666666em; +} +#PartialPasteHeaderSep.horizontal { + margin: 0.166666666666666666em 0.5em; +} + +/* +#PartialPasteHeader label { +} +*/ + +/* make the "partial profile" dialog a little bit more readable */ +#PartialPasteHeader { + margin: 1.5em 0 0 0; + padding: 0; + font-weight: bold; +} + +#PartialPasteHeaderSep { + background-color: #D8D8D8; +} + +/*** end ***************************************************************************************/ + + +/* All MyFileChooserButtons */ +button#MyFileChooserButton { + padding: 0.1666666666666666em; + margin: 0.1666666666666666em; +} + +#ToolPanelNotebook button { + margin: 0; +} + +button.flat { + background: none; + border: none; + outline: none; +} + +button.flat:checked { + background: #262626; +} + +.text-button, .image-button, .independent { + box-shadow: none; + min-height: 2em; + min-width: 2em; + padding: 0; +} + +/* Makes image-comboboxes (e.g. tone curve types) have same size as image buttons */ +combobox, .popupbutton-arrow { + min-height: 2em; +} + +/* Makes image-combobox small icons centered */ +button.toggle > grid > image { + padding: 0.3333333333333333em; +} + +#histButton { + background: none; + min-height: 1.3333333333333333em; + min-width: 1.3333333333333333em; +} + +/* -gtk-icon-shadow looks buggy on the small histogram icons */ +#histButton:hover { + -gtk-icon-shadow: none; +} + +.narrowbutton { + min-width: 0.8333333333333333em; +} + + +.smallbuttonbox button { + min-width: 1.3333333333333333em; + min-height: 1.3333333333333333em; +} + + +/* Adds gap between combobox contents and combobox edges */ +button.combo, .image-combo .toggle, #MyFileChooserButton { + padding-left: 0.3333333333333333em; + padding-right: 0.3333333333333333em; +} + +/*** Progressbar *******************************************************************************/ +progressbar trough { + background-color: #383838; + border: none; +} + +progressbar progress { + border-color: #363636; + /*border-radius: 0.25em;*/ + background-color: #215d9c; +} +/*** end ***************************************************************************************/ + +/* Add padding to grid cells */ + +.grid-spacing > * { + margin: 0.1666666666666666em; +} \ No newline at end of file diff --git a/rtdata/themes/RawTherapee-GTK3-20_.css b/rtdata/themes/RawTherapee-GTK3-20_.css index f4f9ddb7f..57c6db148 100644 --- a/rtdata/themes/RawTherapee-GTK3-20_.css +++ b/rtdata/themes/RawTherapee-GTK3-20_.css @@ -1,9 +1,8 @@ /* This file is part of RawTherapee. - Copyright (c) 2015-2017 DrSlony - Copyright (c) 2016-2019 Hombre - Copyright (c) 2016-2019 TooWaBoo + Copyright (c) 2015-2020 RawTherapee + Contributions by DrSlony, Hombre, TooWaBoo, Thanatomanic RawTherapee is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,26 +19,24 @@ */ /***************************/ -/**/ @import "size.css"; /**/ +/**/ @import "size.css"; /**/ /* TODO: Remove this weird dependency */ /***************************/ -/* text-shadow causes a serious performance degradation in rendering the UI, - * at least in comboboxes with many entries (i.e. Profiled Lens Correction). -*/ - +/** Set style defaults **/ * { - color: #AAAAAA; - text-shadow: none; + color: #BBBBBB; + text-shadow: none; /* Keep at none, or suffer serious performance issues */ + font-size: 1em; } *:disabled { - color: #666666; - opacity: 0.7; + color: rgba(255,255,255,0.25); + opacity: 0.8; } .view:selected:not(check):not(radio) { color: #262626; - background-color: #AAAAAA + background-color: #AAAAAA; } /* The Places and Dir browser panels */ @@ -53,7 +50,6 @@ textview.view, treeview.view { /* The headers of these panels */ .view .button { background-color: #363636; - /*padding: 0.1666666666666666em;*/ } window > box { @@ -64,17 +60,15 @@ window.background { } /*** Window decoration *********************************************************/ -@define-color winHeaderbar rgb(50,50,50); - .csd:not(.popup):not(tooltip) > decoration { background-color: #484848; background-image: none; box-shadow: 0 0.25em 0.75em 0.083333333333333333em rgba(0, 0, 0, 0.5), 0 0 0 0.083333333333333333em #242424; } headerbar { - background-color: shade(@winHeaderbar,1.12); + background-color: shade(rgb(50,50,50),1.12); box-shadow: inset 0 0.083333333333333333em rgba(200,200,200,.13); - background-image: linear-gradient(shade(@winHeaderbar,1.14), shade(@winHeaderbar,.86)); + background-image: linear-gradient(shade(rgb(50,50,50),1.14), shade(rgb(50,50,50),.86)); border-bottom-color: #242424; } dialog > box { @@ -90,7 +84,6 @@ window.csd:not(.fullscreen) #MainNotebook > header.top { .maximized > headerbar { border-radius: 0; } -/**/ /*** End Window decoration *****************************************************/ @@ -128,33 +121,20 @@ label { /* Affects all frames except in the toolbox */ frame { - border-width: 0; - border-color: #303030; - border-radius: 0; - border-style: solid; - /*border-style: none none none solid;*/ padding: 0; - margin: 0; - background-color: rgba(0,0,0,0.); - min-height: 0; - min-width: 0; + margin-bottom: 0.75em; } /* Create space between frame contents and frame border */ frame border { - border-width: 0.083333333333333333em; - padding: 0.3333333333333333em; + border: 1px solid #262626; border-radius: 0.3333333333333333em; - background-color: #383838; - margin: 0; - min-height: 0; - min-width: 0; + padding: 0.083333333333333333em; } frame > label { - margin: 0 0 0 0.3333333333333333em; color: #D8D8D8; - padding: 0.416666666666666666em 0; + padding: 0.416666666666666666em 0.25em; } /* affects selection list*/ @@ -199,7 +179,7 @@ popover separator:not(:only-child) { paned.horizontal > separator { margin: 0 0.16666666666666666em; } -/* Double line separator */ + paned.vertical > separator { margin: 0.25em 0; } @@ -419,19 +399,19 @@ button.flat { } button.flat:checked { - background-image: linear-gradient(#343434, #2E2E2E, #292929); + background-image: linear-gradient(#545454, #4E4E34, #494949); } checkbutton > check { - background-image: linear-gradient(#343434, #2E2E2E, #292929); + background-image: linear-gradient(#545454, #4E4E4E, #494949); } radiobutton > radio { - background-image: linear-gradient(#343434, #2E2E2E, #292929); + background-image: linear-gradient(#545454, #4E4E4E, #494949); } button.flat:hover, checkbutton:hover > check, radiobutton:hover > radio { - background-image: linear-gradient(shade(#343434,1.3), shade(#2E2E2E,1.3), shade(#292929,1.3)); + background-image: linear-gradient(shade(#545454,1.3), shade(#4E4E4E,1.3), shade(#494949,1.3)); } button.popupbutton-arrow { @@ -476,10 +456,10 @@ scale slider { padding: 0.583333333333333333em; border-radius: 1.166666666666666666em; border-width: 0.083333333333333333em; - background-image: linear-gradient(#343434, #2E2E2E, #292929); + background-image: linear-gradient(#444444, #3E3E3E, #393939); } scale slider:hover { - background-image: linear-gradient(#444444, #3E3E3E, #393939); + background-image: linear-gradient(#545454, #4E4E4E, #494949); } scale:disabled slider { background-image: none; @@ -493,7 +473,7 @@ scale trough { padding: 0 0.583333333333333333em; border-width: 0.083333333333333333em; border-radius: 0.333333333333333333em; - background-color: #2A2A2A; + background-color: rgba(0,0,0,0.15); } scale:disabled trough { background-color: #444; @@ -574,7 +554,7 @@ button.text-button.toggle:hover:checked { .drawingarea:selected { background-color: #565656; - border-radius: 0.8333333333333333em; + border-radius: 1.8333333333333333em; } image { @@ -631,7 +611,7 @@ button.Right { /* [1.23[-][+]] */ entry, spinbutton { min-height: 0.8333333333333333em; - background-color: #262626; + background-color: rgba(0,0,0,0.075); border-radius: 0.2em; } @@ -752,149 +732,118 @@ button.radio#histButton:hover { /*** end ***************************************************************************************/ +/*** Modules ***********************************************************************************/ +#EditorModules > box { + margin: 0; + padding: 0; +} + #MyExpander { margin: 0; padding: 0; } -#MyExpander.withScrollbar { - margin-right: 0.25em; + +#MyExpander.withScrollbar { /* This margin is always added */ + margin-right: 1em; } +#MyExpander.withScrollbar #MyExpander { /* No margin for nested expanders */ + margin-right: 0; +} + +/* Borders around tools and subtools */ +#MyExpander { + border-top: 0.0833333333333333em solid rgba(0,0,0,0.3); +} +#MyExpander:first-child { + border-top: none; +} +#MyExpander:nth-last-child(2), +#MyExpander #MyExpander:nth-last-child(1) { + border-bottom: 0.0833333333333333em solid rgba(0,0,0,0.3); +} +#MyExpander #MyExpander:nth-last-child(2) { + border-bottom: none; +} + + /* Tool background */ -#ExpanderBox > box, #ExpanderBox > grid { - background-color: #363636; - border-width: 0.0833333333333333em; - border-style: solid; - border-radius: 0.3333333333333333em; - border-color: #252525; - margin: 0; - padding: 0.25em; +#ExpanderBox > box, +#ExpanderBox > grid { + background-color: rgba(255,255,255,0.075); + padding: 0.3em 0.5em 0.6em 0.5em; + border-top: 0.0833333333333333em solid rgba(255,255,255,0.1); + border-bottom: none; } -#ExpanderBox drawingarea { - background-color: #363636; +/* Not all combinations below are used, but this makes sure + also some of the more exotic box and frame layouts are + treated properly. */ +#ExpanderBox frame > box, +#ExpanderBox frame frame > box, +#ExpanderBox2 frame > box, +#ExpanderBox2 frame frame > box, +#ExpanderBox3 frame > box, +#ExpanderBox3 frame frame > box, +#ExpanderBox frame > grid, +#ExpanderBox frame frame > grid, +#ExpanderBox2 frame > grid, +#ExpanderBox2 frame frame > grid, +#ExpanderBox3 frame > grid, +#ExpanderBox3 frame frame > grid { + padding: 0 0.5em 0.5em 0.5em; } -#LocallabToolPanel frame, -#ExpanderBox frame, -#ExpanderBox2 frame, -#ExpanderBox3 frame { - padding: 0.1666666666666666em 0 0 0; - border-style: none; -} -#ExpanderBox frame > border { - background-color: #3B3B3B; - border-style: solid; - border-width: 0.0833333333333333em; - border-radius: 0.3333333333333333em; - border-color: #313131; - margin: 0.25em; - padding: 0.25em; -} - -#LocallabToolPanel frame > label, #LocallabToolPanel frame frame > label, -#ExpanderBox frame > label, #ExpanderBox frame frame > label, -#ExpanderBox2 frame > label, #ExpanderBox2 frame frame > label, -#ExpanderBox3 frame > label, #ExpanderBox3 frame frame > label { - margin-left: 7pt; - margin-top: 0; -} - -#LocallabToolPanel frame > box, #LocallabToolPanel frame frame > box, #LocallabToolPanel frame > grid, #LocallabToolPanel frame frame > grid, -#ExpanderBox frame > box, #ExpanderBox frame frame > box, #ExpanderBox frame > grid, #ExpanderBox frame frame > grid, -#ExpanderBox2 frame > box, #ExpanderBox2 frame frame > box, #ExpanderBox2 frame > grid, #ExpanderBox2 frame frame > grid, -#ExpanderBox3 frame > box, #ExpanderBox3 frame frame > box, #ExpanderBox3 frame > grid, #ExpanderBox3 frame frame > grid { - margin: 0.1666666666666666em; -} - -#LocallabToolPanel > box > checkbutton, #LocallabToolPanel > box > box, #LocallabToolPanel > grid > checkbutton, #LocallabToolPanel > box > grid, #LocallabToolPanel > grid > grid, #LocallabToolPanel frame > box > grid, #LocallabToolPanel frame > grid > grid, #LocallabToolPanel frame > grid > box, -#ExpanderBox > box > checkbutton, #ExpanderBox > box > box, #ExpanderBox > grid > checkbutton, #ExpanderBox > box > grid, #ExpanderBox > grid > grid, #ExpanderBox frame > box > grid, #ExpanderBox frame > grid > grid, #ExpanderBox frame > grid > box, -#ExpanderBox2 > box > checkbutton, #ExpanderBox2 > box > box, #ExpanderBox2 > grid > checkbutton, #ExpanderBox2 > box > grid, #ExpanderBox2 > grid > grid, #ExpanderBox2 frame > box > grid, #ExpanderBox2 frame > grid > grid, #ExpanderBox2 frame > grid > box, -#ExpanderBox3 > box > checkbutton, #ExpanderBox3 > box > box, #ExpanderBox3 > grid > checkbutton, #ExpanderBox3 > box > grid, #ExpanderBox3 > grid > grid, #ExpanderBox3 frame > box > grid, #ExpanderBox3 frame > grid > grid, #ExpanderBox3 frame > grid > box { - margin-top: 0.1666666666666666em; -} - -#ExpanderBox frame drawingarea { - background-color: #3B3B3B; -} - -#ExpanderBox frame frame > border { - background-color: #414141; - border: 0.0833333333333333em solid #373737; - border-radius: 0.3333333333333333em; - margin: 0.25em; - padding: 0.25em; -} - -#ExpanderBox frame frame drawingarea { - background-color: #414141; +/* Necessary hack for extra margin in Wavelets and some other locations */ +#ExpanderBox box > box, +#ExpanderBox2 box > box { + margin: 0.16666666666666em 0; } /* Sub-tool (MyExpander) background */ -#LocallabToolPanel > box, #LocallabToolPanel > grid, -#ExpanderBox2 > box, #ExpanderBox2 > grid { - background-color: #3B3B3B; - border: 0.0833333333333333em solid #2A2A2A; - border-radius: 0.3333333333333333em; +#LocallabToolPanel > box, +#LocallabToolPanel > grid, +#ExpanderBox2 > box, +#ExpanderBox2 > grid { + background-color: rgba(255,255,255,0.075); margin: 0; - padding: 0.25em; -} - -#LocallabToolPanel drawingarea, -#ExpanderBox2 drawingarea { - background-color: #3B3B3B; -} - -#LocallabToolPanel frame > border, -#ExpanderBox2 frame > border { - background-color: #414141; - border: 0.0833333333333333em solid #373737; - border-radius: 0.3333333333333333em; - margin: 0.25em; - padding: 0.25em; -} - -#LocallabToolPanel frame drawingarea, -#ExpanderBox2 frame drawingarea { - background-color: #414141; -} - -#LocallabToolPanel frame frame > border, -#ExpanderBox2 frame frame > border { - background-color: #474747; - border: 0.0833333333333333em solid #3D3D3D; - border-radius: 0.3333333333333333em; - margin: 0.25em; - padding: 0.25em; -} - -#LocallabToolPanel frame frame drawingarea, -#ExpanderBox2 frame frame drawingarea { - background-color: #474747; -} - -#MyExpanderTitle > box { - margin: 0.1666666666666666em 0; - padding: 0.1666666666666666em 0; + padding: 0.25em 0.5em 0.5em 0.25em; + border-top: 0.0833333333333333em solid rgba(255,255,255,0.1); + border-bottom: none; } #MyExpanderTitle label { - color: #CCCCCC; + color: #AAAAAA; padding: 0; - margin: 0 0.25em 0 0.25em; - font-size: 1.1em; + margin: 0; + font-size: 1.1em; /* TODO: Does not work? */ + font-weight: bold; } + +#MyExpander.Fold > #MyExpanderTitle label, +#MyExpander.OnOff.enabledTool > #MyExpanderTitle label { + color: #DDDDDD; +} + #MyExpanderTitle:hover { background-color: #202020; } #MyExpanderTitle eventbox:hover image { background-color: #202020; - border-radius: 0.25em; + margin: 0; + padding: 0; } #MyExpanderTitle:hover label { color: #D8D8D8; } +/* Alignment of tool headers is controlled by the image */ +#MyExpander.Fold > #MyExpanderTitle box > image, +#MyExpander.OnOff > #MyExpanderTitle #MyExpanderStatus image { + padding: 0.3em; + margin: 0.25em 0.25em 0.25em 0; +} + #LocallabToolPanel separator, #ExpanderBox2 separator, #ExpanderBox3 separator { color: #292929; } @@ -903,6 +852,7 @@ button.radio#histButton:hover { #MainNotebook grid label, #MainNotebook grid image { padding: 0.0833333333333333em; } +/*** end ***************************************************************************************/ /* File Browser right side tabs - Toolbox, Inspector, Fast Export, Filter */ notebook { @@ -918,7 +868,7 @@ notebook header { border-style: none; border-color: #262626; border-radius: 0; - padding: 0.1666666666666666em; + padding: 0; margin: 0; } @@ -962,14 +912,12 @@ notebook header.left { } notebook.frame { - /* OK */ border-radius: 0; border-style: none; } /* Pad notebooks, makes the other borders look nicer */ notebook stack { - /* OK */ background-color: #484848; padding: 0; margin: 0; @@ -982,12 +930,14 @@ paned box, paned grid { } paned > separator { - border-width: 0.0833333333333333em 0.0833333333333333em 0 0; - border-style: solid; - border-color: #404040; + background: rgba(0,0,0,0.075); + border: none; + min-width: 0.25em; + min-height: 0.25em; padding: 0; - margin: 0.3333333333333333em; + margin: 0; } + fontchooser scrolledwindow, #PlacesPaned scrolledwindow, #HistoryPanel scrolledwindow, @@ -1021,21 +971,17 @@ fontchooser scrolledwindow, } #MainNotebook header { - /* OK */ background-color: #2A2A2A; border: 0; padding: 0; } #MainNotebook tabs { - /* OK */ background-color: #2A2A2A; } #MainNotebook tab:hover { - /* OK */ background-color: #505050; } #MainNotebook tab:active { - /* OK */ border-color: #989898; } #MainNotebook tab:checked { @@ -1047,18 +993,16 @@ fontchooser scrolledwindow, } #RightNotebook > stack > scrolledwindow frame, #BatchQueueButtonsMainContainer frame, -#MyExpander frame, dialog frame { margin: 0; - padding: 0.19em 0.583333333333333333em; + padding: 0; } #RightNotebook > stack > scrolledwindow frame > border, #BatchQueueButtonsMainContainer > frame > border, -#MyExpander frame > border, dialog frame > border { - padding: 0 0.333333333333333333em 0.333333333333333333em; + padding: 0; border-width: 0.083333333333333333em; - margin: 0 -0.583333333333333333em; + margin: 0; } #RightNotebook > stack > scrolledwindow frame > label:not(.dummy), #BatchQueueButtonsMainContainer frame > label:not(.dummy), @@ -1098,21 +1042,18 @@ dialog frame > label:not(.dummy) { min-width: 25em; } -#ToolPanelNotebook header { - background-color: #383838; - border-color: #262626; - padding: 0; - margin: 0; +#ToolPanelNotebook viewport { + padding: 0; } #ToolPanelNotebook header tabs { + padding: 0.0833333333333333em; background-color: #2A2A2A; - margin: 0; } #ToolPanelNotebook header tab { - padding: 0.25em; margin: 0; + padding: 0.3333333333333333em; } /* All tool panels have a frame except for Meta which unlike the rest is a notebook itself. @@ -1234,44 +1175,31 @@ dialog frame > label:not(.dummy) { margin: 0; } -#RightNotebook #HistoryPanel { - min-width: 17.5em; - margin-top: 0.333333333333333333em; -} - #RightNotebook scrolledwindow { padding: 0; } -#HistoryPanel { - margin-top: 0.25em; -} -#HistoryPanel > border { - margin-top: 1.75em; -} -#HistoryPanel > label { - margin: 0 0 -1.5em 0; - padding: 0 0 0 0.083333333333333333em; -} -#Snapshots { - margin-top: 0.166666666666666666em; -} -#Snapshots > border { - min-height: calc(6em + 36px); + +#Navigator border, +#HistoryPanel border, +#Snapshots border { + border: none; } + +#Navigator > label, +#HistoryPanel > label, #Snapshots > label { - margin-bottom: -4px; + margin: 0; + padding: 0 0 0.25em 0; } + #Snapshots scrolledwindow + box { - margin: -8px 0 -4px ; + margin: -8px 0 -4px; border-top-width: 0.083333333333333333em; } -#Navigator { - padding-top: 0.25em; - padding-bottom: 0.25em; -} -#Navigator label { + +#Navigator box label { + margin: 0; padding: 0; - margin: 0.083333333333333333em 0; } /*** PartialPaste ******************************************************************************/ diff --git a/rtdata/themes/TooWaBlue-GTK3-20_.css b/rtdata/themes/TooWaBlue-GTK3-20_.css index c4300413e..4e7e192ad 100644 --- a/rtdata/themes/TooWaBlue-GTK3-20_.css +++ b/rtdata/themes/TooWaBlue-GTK3-20_.css @@ -318,12 +318,12 @@ fontchooser scrolledwindow, /*** end ***************************************************************************************/ /*** Navigator *********************************************************************************/ -#Navigator { +#Navigator box { padding-top: 0.75em; padding-bottom: 0.25em; background-color: @bg-dark-grey; } -#Navigator label { +#Navigator box label { padding: 0; margin: 0.083333333333333333em 0 0; } @@ -1223,6 +1223,7 @@ window.csd:not(.fullscreen) #MainNotebook > header.top { color: @headline-big; padding: 0; margin: 0.083333333333333333em 0.25em 0 0.166666666666666666em; + font-weight: bold; } #MyExpanderTitle:hover label { diff --git a/rtdata/themes/size - Legacy.css b/rtdata/themes/size - Legacy.css new file mode 100644 index 000000000..08c39f973 --- /dev/null +++ b/rtdata/themes/size - Legacy.css @@ -0,0 +1,1032 @@ +* { + min-width: 0; + min-height: 0; + padding: 0; + margin: 0; +} + +progressbar.vertical { + min-width: 0; + min-height: 9em; +} +progressbar trough { + border-width: 0.083333333333333333em; + border-radius: 0.3em; +} + +progressbar trough progress { + border-width: 0.083333333333333333em; + border-radius: 0.3em; +} + +progressbar.vertical trough { + min-width: 0.6em; +} +progressbar.vertical trough progress { + min-width: 0.6em; + margin: 0; +} + +progressbar.horizontal trough { + min-height: 0.6em; + margin-top: 0; +} +#IopsPanel progressbar.horizontal trough { + margin-top: 0; +} + +progressbar.horizontal trough progress { + min-height: 0.6em; + margin: 0; +} + +/* #IopsPanel progressbar trough.empty, */ +progressbar trough.empty progress { +} + +/*** Notebook **********************************************************************************/ +notebook, +notebook header, +notebook tabs, +notebook tab, +notebook stack { + border-radius: 0; + border: none; + padding: 0; + margin: 0; + min-width: 0; + min-height: 0; +} +notebook > header { + padding: 0 0.416666666666666666em; +} +notebook > header.left { + padding: 0.416666666666666666em 0; +} +notebook > header tab { + margin: 0.416666666666666666em 0.25em; + padding: 0 0.333333333333333333em; +} +notebook > header.left tab { + margin: 0.2em; + padding: 0.333333333333333333em; +} +notebook > header.left tabs { + margin: 0; + padding: 0; +} +notebook > header tab > grid > image { + min-height: 2em; + min-width: 2em; + padding: 0.25em; + margin: 0; +} + +notebook > header > tabs > arrow { + border-radius: 0.2em; + padding: 0 0.166666666666666666em; + margin: 0.5em 0; +} +notebook > header.left > tabs > arrow { + padding: 0.166666666666666666em 0; + margin: 0 0.5em; +} + +/*?win*/ +#MainNotebook > stack { + padding: 0.25em; +} + +#MainNotebook > stack > :nth-child(2) > box:nth-child(3) { + margin-top: 0.416666666666666666em; +} + + +/* Adds a line on top of the notebook as a separtor for the titlebar (only on CSD) */ +dialog.csd #PrefNotebook > header, +dialog.csd #AboutNotebook > header, +window.csd:not(.fullscreen) #MainNotebook > header.top { + border-top-width: 0.083333333333333333em; +} +/**/ + + +#RightNotebook > stack > scrolledwindow > viewport > box > box:last-child > image, +#ToolPanelNotebook > stack > scrolledwindow > viewport > box > box:last-child > image { + min-height: 5em; +} + +#ToolPanelNotebook > header { + border-bottom-width: 0.083333333333333333em; + margin-left: 0.083333333333333333em; + margin-right: 0.083333333333333333em; + padding: 0 0.19em; +} +#ToolPanelNotebook > header tabs { + margin: 0; +} +#ToolPanelNotebook > header tab { + padding: 0; +} +#ToolPanelNotebook > header tab image{ + min-height: 2em; + min-width: 2em; + margin: 0.19em 0.25em 0.333333333333333333em; + padding: 0; +} +#ToolPanelNotebook > stack { + padding: 0; +} + +#RightNotebook > header { + margin: 0 0.2em 0 0; +} +#RightNotebook > stack { + padding: 0; +} +#RightNotebook > header tab label { + padding-left: 0.25em; + padding-right: 0.25em; +} + +#RightNotebook > stack > :nth-child(1) > * > box, +#RightNotebook > stack > :nth-child(4) > * > box { + padding: 0.5em; + border-width: 0.083333333333333333em; +} + +#PrefNotebook > header { + margin: -0.666666666666666666em -0.666666666666666666em 0.333333333333333333em; +} +#PrefNotebook > stack { + margin: 0 -0.666666666666666666em; +} +#PrefNotebook > stack > scrolledwindow > viewport { + padding: 0 0.333333333333333333em; +} + +#AboutNotebook > header { + margin: -0.666666666666666666em -0.666666666666666666em 0.666666666666666666em; +} + +#AboutNotebook > stack text, +#AboutNotebook > stack textview { + padding: 0.75em 0; +} +/* Meta panel notebook */ +#MetaPanelNotebook > header { + padding: 0.333333333333333333em; + margin: 0 0.5em 0; +} +#MetaPanelNotebook > header > tabs { + padding-left: 0.333333333333333333em; +} +#MetaPanelNotebook > stack { + padding: 0 0 0.5em 0; +} + +#MetaPanelNotebook > stack > box { + border: none; + border-radius: 0; + border-top-style: none; + padding: 0 0.333333333333333333em 0.25em; + margin:0 0.5em -0.5em; +} +#MetaPanelNotebook > stack > box:nth-child(1) > scrolledwindow { + margin: 0 0 0.333333333333333333em; + padding: 0; +} + +#MetaPanelNotebook > stack > box:nth-child(2) > scrolledwindow > viewport.frame { + padding: 0; +} + +#MetaPanelNotebook entry { + padding: 0 0.333333333333333333em; + border-radius: 0; + margin-left: 0; + margin-right: 0; +} + +#MetaPanelNotebook .view { + border-width: 0.083333333333333333em; + padding: 0.083333333333333333em 0.25em; +} + +#MetaPanelNotebook stack label { + margin-top: 0; + margin-bottom: 0; + padding: 0; +} + +/*** end ***************************************************************************************/ + +/*** File Browser ******************************************************************************/ +#FileCatalog { + border-width: 0.083333333333333333em; +} + +/*?win*/ +#FileBrowser { + padding: 0; + margin: 0; +} + +#ToolBarPanelFileBrowser { + margin: 0 0 0.416666666666666666em 0; + min-height: 0; + min-width: 0; + padding: 0; +} +#FileBrowserQueryToolbar > viewport > box { + margin: 0 0 0.416666666666666666em 0; + min-height: 0; + min-width: 0; + padding: 0; +} + +/*** end ***************************************************************************************/ + +/*** Image Editor ******************************************************************************/ +#EditorRightPaned { + margin: 0; +} + +#BeforeAfterContainer { + border-width: 0.083333333333333333em; + border-radius: 0; + padding: 0; + margin: calc(0.416666666666666666em - 2px) 0 0.416666666666666666em; +} +#BeforeAfterContainer > box:nth-child(2) > box:nth-child(2), +#BeforeAfterContainer > box:nth-child(1) > box:nth-child(2){ + border-top: 0.083333333333333333em solid @bg-dark-grey; +} +#BeforeAfterContainer > box:nth-child(2){ + border-left: 0.083333333333333333em solid @bg-dark-grey; +} + +/* !!! Must be same height as "Small Lock Button" */ +#BeforeAfterContainer label { + padding: 0 0.5em; + min-height: 2em; + min-width: 2em; + margin: 0.25em 0; + border-width: 0.083333333333333333em; +} + +#EditorToolbarTop { + margin: 0 -1px 0 -1px; + padding: 0; + min-height: 0; +} + +#IopsPanel { + margin: 0; + padding: 0; + min-height: 0; +} + +#EditorZoomPanel label { + min-width: 4em; + margin: 0; +} +/*** end ***************************************************************************************/ + +/*** Toolbox ***********************************************************************************/ +#MyExpander image { + min-width: 1.333333333333333333em; + min-height: 0; + margin: -0.083333333333333333em 0.125em; +} + +#MyExpander .drawingarea:not(.slider) { + border-width: 0.083333333333333333em; +} +#MyExpander .slider, +#MyExpander #CurveSHCSelector { + border-width: 0.083333333333333333em; +} +#MyExpander .drawingarea:disabled { +} +#ThresholdAdjuster { + margin: 0.083333333333333333em 0 0.166666666666666666em 0; +} + +#ToolPanelNotebook > stack > scrolledwindow > viewport.frame { + padding: 0 0.25em; +} + +#MyExpander { + margin: 0; + padding: 0; +} +#ExpanderBox > box, #ExpanderBox > grid { + border-width: 0.083333333333333333em; + border-radius: 0.416666666666666666em; + margin: 0; + padding: 0.5em 0.333333333333333333em; +} + +/* Sub-tool (MyExpander) */ +#ExpanderBox2 > box, #ExpanderBox2 > grid { + border-width: 0.083333333333333333em; + border-radius: 0.416666666666666666em; + margin: 0 0.19em; + padding: 0.333333333333333333em; +} + +#MyExpanderTitle > box { + margin: 0; + padding: 0.25em 0; +} + +#MyExpanderTitle label { + padding: 0; + margin: 0.083333333333333333em 0.25em 0 0.166666666666666666em; +} +/*** end ***************************************************************************************/ + +/*** Context & popups menus *****************************************************************************/ +.csd.popup > decoration { + border-radius: 0; + border: none; + padding: 0; + margin: 0; +} + +menu { + border-width: 0.083333333333333333em; + padding: 0.083333333333333333em; + margin: 0; + border-radius: 0; +} +menu > arrow.top, +menu > arrow.top:hover, +menu > arrow.bottom, +menu > arrow.bottom:hover { + border: none; + padding: 0.5em; + min-height: 1.5em; +} + +menuitem { + padding: 0 0.333333333333333333em; + margin: 0.083333333333333333em; + min-height: 2em; +} + +menu arrow { + min-width: 1.333333333333333333em; + margin: 0 -0.19em; + padding: 0; + margin: 0 -0.25em 0 0; +} + +menu image:not(.dummy), +#MyExpander menu image:not(.dummy) { + min-height: 2em; + min-width: 1.5em; + padding: 0; + margin: 0 0 0 -1.333333333333333333em; +} + +/*** Selection popup list (used in filechooser) ***/ +entry > window > frame:not(.dummy) { + padding: 0; +} +entry > window > frame > border:not(.dummy) { + padding: 0.083333333333333333em; + margin: 0.083333333333333333em; + border-width: 0.083333333333333333em; +} +/* end */ + +/*** end ***************************************************************************************/ + +/*** Popover *** Context menu filechooser ******************************************************/ +popover { + border-width: 0.083333333333333333em; + border-radius: 0; + padding: 0; + margin: 0; +} +popover > box { + padding: 0; + margin: -9px; +} +popover modelbutton { + min-height: 2em; + padding: 0 0.416666666666666666em; + margin: 0; + border-radius: 0; +} + +popover label { + margin-right: 0.5em; +} +/** end ****************************************************************************************/ + +/*** Switch ***********************************************************************************/ +switch { + min-height: 2.333333333333333333em; + min-width: 11em; + margin: 0 0.19em; + padding: 0; + border-radius: 0.2em; + border-width: 0.083333333333333333em; + margin-bottom: 0.5em; +} + +switch slider { + border-width: 0.083333333333333333em; + border-radius: 0.2em 0 0 0.2em; + + /* Needed to cover the total switch */ + margin: -0.083333333333333333em; + padding: 0.083333333333333333em; +} +switch:checked slider{ + border-radius: 0 0.2em 0.2em 0; +} +/** end ****************************************************************************************/ + +/*** Buttons ***********************************************************************************/ +button, +#BeforeAfterContainer button { + min-height: 1.666666666666666666em; + min-width: 1.666666666666666666em;/*x*/ + margin: 0.125em; + border-radius: 0.2em; + border-width: 0.083333333333333333em; +} +button.flat { + border-width: 0.083333333333333333em; +} + +/* Combobox */ +button.combo { + padding: 0 0 0 0.25em; +} +combobox entry.combo + button.combo { + min-width: 1em; + margin-left: 0; + padding: 0; + border-top-left-radius: 0; + border-bottom-left-radius: 0; + border-left: none; +} +#WB-Size-Helper button.combo { + min-width: 0; + margin: 0; +} +#WB-Size-Helper { + min-width: 3.5em; + margin: 0.125em; +} + +combobox arrow { + margin-right: 0.083333333333333333em; +} + +combobox entry.combo + button.combo arrow { + margin-right: 0; +} + +#PlacesPaned button.combo { + margin: 0; +} +#PlacesPaned combobox { + margin-bottom: calc(0.416666666666666666em - 8px); +} + +#ProfilePanel combobox { + margin-right: -0.166666666666666666em; +} + +/* Misc */ +button label { + margin: 0 0.416666666666666666em; +} +button image:not(.dummy), +#MyExpander button image:not(.dummy) { + margin: 0; +} +#MyFileChooserButton label { + margin: 0 0 0 0.416666666666666666em; +} +#MyFileChooserButton image:not(.dummy):last-child { + margin: 0 0.416666666666666666em 0 0; + min-width: 1.333333333333333333em; +} +#MetaPanelNotebook button + button:last-child { + margin-right: 0; +} +#MetaPanelNotebook scrolledwindow + grid > button:first-child, +#MetaPanelNotebook scrolledwindow + grid + grid > button:first-child { + margin-left: 0; +} +#MetaPanelNotebook scrolledwindow + grid > button:last-child, +#MetaPanelNotebook scrolledwindow + grid + grid > button:last-child { + margin-right: 0; +} + +#ProfilePanel { + margin-bottom: 0.35em; +} +#ProfilePanel > grid { + margin-bottom: 0.2em; +} + +/* Reset button */ +scale + button.flat, +spinbutton + button.flat, +scale + image + image + button.flat { + min-height: 1.333333333333333333em; + margin-top:0.095em; + margin-bottom: 0.095em; +} + +/* Color chooser & buttons */ +button.color { + min-width: 3.25em; +} + +button.color colorswatch { + min-height: 0; + min-width: 0; + margin: 1px; + border-radius: 0.2em; +} + +colorchooser colorswatch { + border-width: 1px; +} +colorchooser colorswatch#add-color-button:first-child { + border-radius: 5.5px 0 0 5.5px; +} + +/* Font chooser button */ +button.font label{ + min-height: 0; + min-width: 0; + margin: 0 0.125em; +} + +/* Save, Cancel, OK ... buttons */ +dialog .dialog-action-area button { + min-height: 2.166666666666666666em; + margin: 0.5em 0 0 0.333333333333333333em; + padding: 0; +} +messagedialog .dialog-action-area button { + min-height: 1.833333333333333333em; + margin: 0 0.5em 0.5em; + padding: 0; +} +messagedialog .dialog-action-area button:not(:only-child):nth-child(1) { + margin-right: 0.25em; +} +messagedialog .dialog-action-area button:not(:only-child):nth-child(2) { + margin-left: 0.25em; +} + +/* Big tool buttons */ +#ToolBarPanelFileBrowser button, +#EditorTopPanel button, +#IopsPanel button, +#ProfilePanel button, +#MainNotebook > header > grid > button, +#MyExpander button.independent.toggle:not(.image-button):not(.text-button):first-child:only-child, /* Graduated filter big button */ +.curve-mainbox .curve-buttonbox button.flat, +#BatchQueueButtonsMainContainer + grid + box button, +#RightNotebook > stack > scrolledwindow:last-child button.image-button, /* Fast Export */ +#MetaPanelNotebook scrolledwindow + grid > button, +#MetaPanelNotebook scrolledwindow + grid + grid > button { + min-height: 2.333333333333333333em; + min-width: 2.333333333333333333em; + margin: 0 0.125em; +} +#ToolBarPanelFileBrowser > button:first-child, +#EditorTopPanel > button:first-child, +#IopsPanel > button:nth-child(6), +#ProfilePanel > grid > button:first-child { + margin-left: 0; +} +#ToolBarPanelFileBrowser > button:last-child, +#ToolBarPanelFileBrowser > box:last-child > button:last-child, +#EditorTopPanel > button:last-child, +#EditorTopPanel > box:last-child > button:last-child, +#IopsPanel > button:last-child, +#ProfilePanel > grid > button:last-child, +#BatchQueueButtonsMainContainer + grid + box button { + margin-right: 0; +} +#MyExpander button.independent.toggle:not(.image-button):not(.text-button):first-child:only-child, /* Graduated filter button */ +#MetaPanelNotebook scrolledwindow + grid > button, +#MetaPanelNotebook scrolledwindow + grid + grid > button { + margin: 0.125em; +} + +#EditorTopPanel button.narrowbutton { + min-width: 0.833333333333333333em; + padding: 0 0.13em; +} + +/* Image close button */ +#MainNotebook > header tab #CloseButton { + padding: 0; + margin: 0.333333333333333333em 0 0.416666666666666666em 0.19em; + min-width: 1.5em; + min-height: 0; +} +#MainNotebook > header tab #CloseButton image{ + min-width: 1.333333333333333333em; + min-height: 1.333333333333333333em; +} + +/* Filter buttons*/ +#ToolBarPanelFileBrowser .smallbuttonbox { + min-height: 1.166666666666666666em; + padding: 0; + margin: 0; +} +#ToolBarPanelFileBrowser .smallbuttonbox:nth-child(2) { + margin-top: 0.166666666666666666em; + margin-bottom: -0.166666666666666666em; +} +#ToolBarPanelFileBrowser .smallbuttonbox button.smallbutton image { + margin: -1em 0; + padding: 0; + min-width: 0; + min-height: 0; +} +#ToolBarPanelFileBrowser .smallbuttonbox button.smallbutton { + min-height: 0; + min-width: 1.166666666666666666em; + padding: 0; + margin: 0 0.166666666666666666em; + border: none; + border-radius: 0; +} + +/* Arrow toggle combo button */ +#IopsPanel .image-combo button.Right, +#MyExpander .image-combo button.Right { + border-left: none; + margin-left: 0; + padding: 0; + border-top-left-radius: 0; + border-bottom-left-radius: 0; + min-width: 1.333333333333333333em; +} +#IopsPanel .image-combo button.Right image, +#MyExpander .image-combo button.Right image { + margin: 0 -0.083333333333333333em; +} +#IopsPanel .image-combo button.Left, +#MyExpander .image-combo button.Left { + border-top-right-radius: 0; + border-bottom-right-radius: 0; + min-width: 2.333333333333333333em; + margin-right: 0; +} +#MyExpander .image-combo button.Left { + min-width: 2.75em; +} +#MyExpander .image-combo button.Left label { + margin-right: 0; +} + +/* Search & Query buttons */ +#FileBrowserQueryToolbar entry + button.flat, +#FileBrowserIconToolbar entry + button.flat { + min-height: 1.666666666666666666em;/*x*/ + min-width: 1.666666666666666666em;/*x*/ + margin: 0; + border-radius: 0 0.2em 0.2em 0; + border-width: 0.083333333333333333em; + padding: 0; +} +#FileBrowserQueryToolbar entry + button.flat:not(:hover):not(:active), +#FileBrowserIconToolbar entry + button.flat:not(:hover):not(:active) { + border-left: none; + padding-left: 0.083333333333333333em; +} +#FileBrowserIconToolbar box > entry + button.flat { + margin-top: 0.416666666666666666em; + margin-bottom: 0.416666666666666666em; + min-height: 0; +} + +/* Small Lock Button */ +#BeforeAfterContainer button { + min-height: 2em; + min-width: 2em; + margin: 0.25em 0.25em 0.25em 0; + padding: 0; + border-radius: 0.2em; + border-width: 0.083333333333333333em; +} +#BeforeAfterContainer button image{ + margin: 0 0 0 0.083333333333333333em; +} +#BeforeAfterContainer button:checked image{ + margin: 0.083333333333333333em -0.166666666666666666em 0.083333333333333333em 0.25em; +} + +/* Snapshot & Places buttons */ +#Snapshots button, +#PlacesPaned > box:nth-child(1) scrolledwindow + grid > button { + margin: 0; + padding: 0; + border-width: 0.083333333333333333em; + border-radius: 0; + min-height: 0.5em;/*x*/ +} +/**/ + + +/* View & Filechooser Buttons */ +.view button { + min-height: 2em; + min-width: 1.333333333333333333em; + padding: 0 0.19em; + margin: 0; +} +#pathbarbox button { + min-width: 2em; + margin: 0; + padding: 0; + } +window treeview > header image { + min-width: 1.333333333333333333em; +} + +window .view button { + border: none; + border-bottom-width: 0.083333333333333333em; +} +dialog .view button { + border-width: 0.083333333333333333em; +} + +.view header button:not(:first-child):not(:only-child), +.path-bar button:not(:first-child):not(:only-child) { + border-left: none; +} +.view header button, +.path-bar button { + border-radius: 0; +} + +.path-bar button:first-child { + border-top-left-radius: 0.2em; + border-bottom-left-radius: 0.2em; + margin: 0; + padding: 0; +} +.path-bar button:last-child { + border-top-right-radius: 0.2em; + border-bottom-right-radius: 0.2em; + margin: 0; + padding: 0; +} +#pathbarbox button:not(:first-child):not(:last-child) label { + margin: 0 0.5em; +} + +#pathbarbox button:not(:first-child):not(:last-child) image { + margin: 0 0 0 0.5em; + min-width: 1.333333333333333333em; +} +/**/ + +/* Popover Filechooser (Create folder) */ +popover button.text-button { + border-width: 0.083333333333333333em; +} +popover button.text-button label { + padding: 0; + margin: 0; +} +/* Adds padding around sides of text-buttons */ +button.text-button { + padding: 0 0.6666666666666666em; +} +/**/ + +/*** end ***************************************************************************************/ + +/*** Checkbox & Radio **************************************************************************/ +checkbutton, +radiobutton { + padding: 0.083333333333333333em 0; + margin: 0.125em; + min-height: 1.666666666666666666em;/*x*/ +} + +check, +radio { + border-width: 0.105em; + margin: 0; + padding: 0; + min-height: 1.166666666666666666em; + min-width: 1.166666666666666666em; +} +check { + border-radius: 0.166666666666666666em; +} + +radio{ + border-radius: 1.166666666666666666em; +} + +radiobutton label, +checkbutton label { + margin: 0 0.583333333333333333em 0 0.416666666666666666em; + padding: 0; +} + +frame > checkbutton check{ + margin-left: 0.5em; +} + +#PartialPaste checkbutton { + padding: 0; + margin: 0.125em 0 0 0.583333333333333333em; +} +#PartialPaste checkbutton:not(#PartialPasteHeader) { + margin: 0 0 0 1.166666666666666666em; +} + +/*** end ***************************************************************************************/ + +/*** Entry & Spinbutton ************************************************************************/ +#MyExpander entry, +entry, +spinbutton { + margin: 0.125em; + padding: 0 0.333333333333333333em; + min-height: 1.666666666666666666em;/*x*/ + min-width: 0; + border-width: 0.083333333333333333em; +} +#FileBrowserQueryToolbar entry, +#FileBrowserIconToolbar entry { + min-height: 1.666666666666666666em;/*x*/ + min-width: 0; + margin: 0; + border-right: none; + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} + +#FileBrowserIconToolbar box > entry { + margin-top: 0.416666666666666666em; + margin-bottom: 0.416666666666666666em; + margin-left: 0.19em; + min-height: 0; +} +#FileBrowserQueryToolbar box + box > label + entry { + margin-left: 0.19em; +} +spinbutton { + padding: 0; +} + +#MyExpander spinbutton { + margin: 0.125em; + padding: 0; + min-height: 1.333333333333333333em; + min-width: 0; + border-width: 0.083333333333333333em; +} +/* Needed for Reset & and Auto button height*/ +#MyExpander button + label + spinbutton { + margin-top: 0.333333333333333333em; + margin-bottom: 0.333333333333333333em; +} +#MyExpander checkbutton + label + spinbutton { + margin-top: 0.416666666666666666em; + margin-bottom: 0.416666666666666666em; +} +/**/ + +#MyExpander spinbutton button, +spinbutton button { + padding: 0; + min-height: 1.333333333333333333em; + min-width: 1.666666666666666666em; + border: none; +} + +#MyExpander spinbutton entry, +spinbutton entry { + padding: 0 0.333333333333333333em; + margin: 0; + min-height: 0; + min-width: 0; + border: none; +} +#MyExpander spinbutton entry { + padding: 0 0.333333333333333333em 0 0.833333333333333333em; +} + +#MyExpander spinbutton button:hover, +spinbutton button:hover { + border: none; +} +#MyExpander spinbutton button:active, +spinbutton button:active { + border: none; +} + +/* Text selection */ +.view entry { + margin: 0 -2px; + border-width: 0.083333333333333333em; +} +/* end*/ + +/*** end ***************************************************************************************/ + +/* Curves **************************************************************************************/ +.curve-mainbox { + margin: 0.19em; + border-width: 0.083333333333333333em; +} +.curve-mainbox .curve-curvebox { + margin: 0; + padding: 0.416666666666666666em; +} +.curve-mainbox .curve-spinbuttonbox { + margin: 0; + padding: 0.25em; + border-width: 0.083333333333333333em; +} +.curve-mainbox .curve-sliderbox { + margin: 0; + padding: 0.25em; + border-width: 0.083333333333333333em; +} +.curve-mainbox .curve-buttonbox { + padding: 0.25em; +} +.curve-mainbox.left .curve-buttonbox { + border-width: 0.083333333333333333em; +} +.curve-mainbox.right .curve-buttonbox { + border-width: 0.083333333333333333em; +} +.curve-mainbox.top .curve-buttonbox { + border-width: 0.083333333333333333em; +} +.curve-mainbox.bottom .curve-buttonbox { + border-width: 0.083333333333333333em; +} +.curve-mainbox .curve-buttonbox button.flat { + margin: 0.095em; +} +/*** end ***************************************************************************************/ + +/*** Window Layout *****************************************************************************/ +.csd:not(.popup):not(tooltip) > decoration { + border-radius: 0.416666666666666666em 0.416666666666666666em 0 0; + border: none; + padding: 0; + margin: 0.833333333333333333em; +} +headerbar { + border-bottom-width: 0.083333333333333333em; + border-radius: 0.416666666666666666em 0.416666666666666666em 0 0; + min-height: 2em; + padding: 0.083333333333333333em 0.416666666666666666em 0; + margin: 0; +} + +/* Window state */ +.maximized > headerbar { + border-radius: 0; +} +/**/ + +/* Titlebar buttons*/ + +headerbar button.titlebutton image { + padding: 0; + margin: 0; +} +headerbar button.titlebutton { + margin: 0 0 0 0.333333333333333333em; + border-width: 0.083333333333333333em; + min-width: 1.5em; + min-height: 1.5em; + padding: 0; +} +messagedialog headerbar button.titlebutton { + min-width: 1.25em; + min-height: 1.25em; + margin: 0; +} +/*** end ***************************************************************************************/ \ No newline at end of file diff --git a/rtdata/themes/size.css b/rtdata/themes/size.css index e3a22f337..2d23bf860 100644 --- a/rtdata/themes/size.css +++ b/rtdata/themes/size.css @@ -313,38 +313,6 @@ window.csd:not(.fullscreen) #MainNotebook > header.top { margin: 0.083333333333333333em 0 0.166666666666666666em 0; } -#ToolPanelNotebook > stack > scrolledwindow > viewport.frame { - padding: 0 0.25em; -} - -#MyExpander { - margin: 0; - padding: 0; -} -#ExpanderBox > box, #ExpanderBox > grid { - border-width: 0.083333333333333333em; - border-radius: 0.416666666666666666em; - margin: 0; - padding: 0.5em 0.333333333333333333em; -} - -/* Sub-tool (MyExpander) */ -#ExpanderBox2 > box, #ExpanderBox2 > grid { - border-width: 0.083333333333333333em; - border-radius: 0.416666666666666666em; - margin: 0 0.19em; - padding: 0.333333333333333333em; -} - -#MyExpanderTitle > box { - margin: 0; - padding: 0.25em 0; -} - -#MyExpanderTitle label { - padding: 0; - margin: 0.083333333333333333em 0.25em 0 0.166666666666666666em; -} /*** end ***************************************************************************************/ /*** Context & popups menus *****************************************************************************/ @@ -366,8 +334,8 @@ menu > arrow.top:hover, menu > arrow.bottom, menu > arrow.bottom:hover { border: none; - padding: 0.5em; - min-height: 1.5em; + padding: 0.25em; + min-height: 1em; } menuitem { diff --git a/rtgui/batchqueuepanel.cc b/rtgui/batchqueuepanel.cc index f7a73a30b..aacf190cc 100644 --- a/rtgui/batchqueuepanel.cc +++ b/rtgui/batchqueuepanel.cc @@ -61,10 +61,12 @@ BatchQueuePanel::BatchQueuePanel (FileCatalog* aFileCatalog) : parent(nullptr) batchQueueButtonBox->pack_start (*qStartStop, Gtk::PACK_SHRINK, 4); batchQueueButtonBox->pack_start (*qAutoStart, Gtk::PACK_SHRINK, 4); Gtk::Frame *bbox = Gtk::manage(new Gtk::Frame(M("MAIN_FRAME_QUEUE"))); + bbox->set_label_align(0.025, 0.5); bbox->add(*batchQueueButtonBox); // Output directory selection fdir = Gtk::manage (new Gtk::Frame (M("QUEUE_LOCATION_TITLE"))); + fdir->set_label_align(0.025, 0.5); Gtk::VBox* odvb = Gtk::manage (new Gtk::VBox ()); Gtk::HBox* hb2 = Gtk::manage (new Gtk::HBox ()); useTemplate = Gtk::manage (new Gtk::RadioButton (M("QUEUE_LOCATION_TEMPLATE") + ":")); @@ -112,6 +114,7 @@ BatchQueuePanel::BatchQueuePanel (FileCatalog* aFileCatalog) : parent(nullptr) // Output file format selection fformat = Gtk::manage (new Gtk::Frame (M("QUEUE_FORMAT_TITLE"))); + fformat->set_label_align(0.025, 0.5); saveFormatPanel = Gtk::manage (new SaveFormatPanel ()); setExpandAlignProperties(saveFormatPanel, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); fformat->add (*saveFormatPanel); diff --git a/rtgui/blackwhite.cc b/rtgui/blackwhite.cc index ea493d6e1..11eab3447 100644 --- a/rtgui/blackwhite.cc +++ b/rtgui/blackwhite.cc @@ -89,6 +89,7 @@ BlackWhite::BlackWhite (): FoldableToolPanel(this, "blackwhite", M("TP_BWMIX_LAB //----------- Auto and Reset buttons ------------------------------ mixerFrame = Gtk::manage (new Gtk::Frame (M("TP_BWMIX_MET_CHANMIX"))); + mixerFrame->set_label_align(0.025, 0.5); pack_start (*mixerFrame, Gtk::PACK_SHRINK, 0); mixerVBox = Gtk::manage (new Gtk::VBox ()); @@ -280,6 +281,7 @@ BlackWhite::BlackWhite (): FoldableToolPanel(this, "blackwhite", M("TP_BWMIX_LAB //----------- Gamma sliders ------------------------------ gammaFrame = Gtk::manage (new Gtk::Frame (M("TP_BWMIX_GAMMA"))); + gammaFrame->set_label_align(0.025, 0.5); pack_start (*gammaFrame, Gtk::PACK_SHRINK, 0); Gtk::VBox *gammaVBox = Gtk::manage (new Gtk::VBox()); diff --git a/rtgui/colortoning.cc b/rtgui/colortoning.cc index 77bc31638..f730e8175 100644 --- a/rtgui/colortoning.cc +++ b/rtgui/colortoning.cc @@ -296,6 +296,10 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR Gtk::Frame *chanMixerMidFrame = Gtk::manage (new Gtk::Frame(M("TP_COLORTONING_MIDTONES"))); Gtk::Frame *chanMixerShadowsFrame = Gtk::manage (new Gtk::Frame(M("TP_COLORTONING_SHADOWS"))); + chanMixerHLFrame->set_label_align (0.025, 0.5); + chanMixerMidFrame->set_label_align (0.025, 0.5); + chanMixerShadowsFrame->set_label_align (0.025, 0.5); + chanMixerHLFrame->add(*chanMixerHLBox); chanMixerMidFrame->add(*chanMixerMidBox); chanMixerShadowsFrame->add(*chanMixerShadowsBox); diff --git a/rtgui/dirpyrdenoise.cc b/rtgui/dirpyrdenoise.cc index 7129542d1..168993271 100644 --- a/rtgui/dirpyrdenoise.cc +++ b/rtgui/dirpyrdenoise.cc @@ -165,7 +165,6 @@ DirPyrDenoise::DirPyrDenoise () : FoldableToolPanel(this, "dirpyrdenoise", M("TP // ---- Median FIltering ---- Gtk::Frame* medianFrame = Gtk::manage (new Gtk::Frame ()); - medianFrame->set_label_align(0.025, 0.5); Gtk::VBox *medianVBox = Gtk::manage ( new Gtk::VBox()); medianVBox->set_spacing(2); diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 34d677206..beda3bba4 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -501,6 +501,7 @@ EditorPanel::EditorPanel (FilePanel* filePanel) profilep = Gtk::manage (new ProfilePanel ()); ppframe = Gtk::manage(new Gtk::Frame()); + ppframe->set_label_align(0.025, 0.5); ppframe->set_name ("ProfilePanel"); ppframe->add (*profilep); ppframe->set_label (M ("PROFILEPANEL_LABEL")); @@ -509,6 +510,9 @@ EditorPanel::EditorPanel (FilePanel* filePanel) navigator = Gtk::manage (new Navigator ()); navigator->previewWindow->set_size_request (-1, 150 * RTScalable::getScale()); leftsubbox->pack_start (*navigator, Gtk::PACK_SHRINK, 2); + + Gtk::Separator* historyseparator = Gtk::manage (new Gtk::Separator (Gtk::ORIENTATION_HORIZONTAL)); + leftsubbox->pack_start (*historyseparator, Gtk::PACK_SHRINK, 2); history = Gtk::manage (new History ()); leftsubbox->pack_start (*history); @@ -777,6 +781,7 @@ EditorPanel::EditorPanel (FilePanel* filePanel) hpanedr->set_name ("EditorRightPaned"); leftbox->reference (); vboxright->reference (); + vboxright->set_name ("EditorModules"); if (options.showHistory) { hpanedl->pack1 (*leftbox, false, false); diff --git a/rtgui/exportpanel.cc b/rtgui/exportpanel.cc index b4332f4a4..b18cee496 100644 --- a/rtgui/exportpanel.cc +++ b/rtgui/exportpanel.cc @@ -63,6 +63,7 @@ ExportPanel::ExportPanel () : listener (nullptr) // ---------------------- Bayer sensor frame ----------------------- Gtk::Frame *bayerFrame = Gtk::manage ( new Gtk::Frame (M ("TP_RAW_SENSOR_BAYER_LABEL"))); + bayerFrame->set_label_align(0.025, 0.5); Gtk::VBox* bayerFrameVBox = Gtk::manage (new Gtk::VBox ()); Gtk::HBox* hb_raw_bayer_method = Gtk::manage (new Gtk::HBox ()); @@ -86,6 +87,7 @@ ExportPanel::ExportPanel () : listener (nullptr) // ---------------------- Bayer sensor frame ----------------------- Gtk::Frame *xtransFrame = Gtk::manage ( new Gtk::Frame (M ("TP_RAW_SENSOR_XTRANS_LABEL"))); + xtransFrame->set_label_align(0.025, 0.5); Gtk::VBox* xtransFrameVBox = Gtk::manage (new Gtk::VBox ()); Gtk::HBox* hb_raw_xtrans_method = Gtk::manage (new Gtk::HBox ()); diff --git a/rtgui/favoritbrowser.cc b/rtgui/favoritbrowser.cc index 2d49ab087..06a9cf3be 100644 --- a/rtgui/favoritbrowser.cc +++ b/rtgui/favoritbrowser.cc @@ -27,6 +27,7 @@ FavoritBrowser::FavoritBrowser () : listener (NULL) scrollw->set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); Gtk::Frame* frame = Gtk::manage (new Gtk::Frame ("Favorite Folders")); + frame->set_label_align(0.025, 0.5); frame->add (*scrollw); pack_start (*frame); diff --git a/rtgui/guiutils.cc b/rtgui/guiutils.cc index d759751c3..93629d5fd 100644 --- a/rtgui/guiutils.cc +++ b/rtgui/guiutils.cc @@ -583,8 +583,10 @@ MyExpander::MyExpander(bool useEnabled, Gtk::Widget* titleWidget) : setExpandAlignProperties(headerHBox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL); if (useEnabled) { + get_style_context()->add_class("OnOff"); statusImage = Gtk::manage(new RTImage(disabledImage)); imageEvBox = Gtk::manage(new Gtk::EventBox()); + imageEvBox->set_name("MyExpanderStatus"); imageEvBox->add(*statusImage); imageEvBox->set_above_child(true); imageEvBox->signal_button_release_event().connect( sigc::mem_fun(this, & MyExpander::on_enabled_change) ); @@ -592,6 +594,7 @@ MyExpander::MyExpander(bool useEnabled, Gtk::Widget* titleWidget) : imageEvBox->signal_leave_notify_event().connect( sigc::mem_fun(this, & MyExpander::on_enter_leave_enable), false ); headerHBox->pack_start(*imageEvBox, Gtk::PACK_SHRINK, 0); } else { + get_style_context()->add_class("Fold"); statusImage = Gtk::manage(new RTImage(openedImage)); headerHBox->pack_start(*statusImage, Gtk::PACK_SHRINK, 0); } @@ -606,7 +609,7 @@ MyExpander::MyExpander(bool useEnabled, Gtk::Widget* titleWidget) : titleEvBox = Gtk::manage(new Gtk::EventBox()); titleEvBox->set_name("MyExpanderTitle"); - titleEvBox->set_border_width(2); + titleEvBox->set_border_width(0); titleEvBox->add(*headerHBox); titleEvBox->set_above_child(false); // this is the key! By making it below the child, they will get the events first. titleEvBox->set_can_focus(false); @@ -634,8 +637,8 @@ MyExpander::MyExpander(bool useEnabled, Glib::ustring titleLabel) : headerHBox->set_can_focus(false); setExpandAlignProperties(headerHBox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL); - if (useEnabled) { + get_style_context()->add_class("OnOff"); statusImage = Gtk::manage(new RTImage(disabledImage)); imageEvBox = Gtk::manage(new Gtk::EventBox()); imageEvBox->set_name("MyExpanderStatus"); @@ -646,6 +649,7 @@ MyExpander::MyExpander(bool useEnabled, Glib::ustring titleLabel) : imageEvBox->signal_leave_notify_event().connect( sigc::mem_fun(this, & MyExpander::on_enter_leave_enable), false ); headerHBox->pack_start(*imageEvBox, Gtk::PACK_SHRINK, 0); } else { + get_style_context()->add_class("Fold"); statusImage = Gtk::manage(new RTImage(openedImage)); headerHBox->pack_start(*statusImage, Gtk::PACK_SHRINK, 0); } @@ -654,12 +658,12 @@ MyExpander::MyExpander(bool useEnabled, Glib::ustring titleLabel) : label = Gtk::manage(new Gtk::Label()); setExpandAlignProperties(label, true, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER); - label->set_markup(Glib::ustring("") + escapeHtmlChars(titleLabel) + Glib::ustring("")); + label->set_markup(escapeHtmlChars(titleLabel)); headerHBox->pack_start(*label, Gtk::PACK_EXPAND_WIDGET, 0); titleEvBox = Gtk::manage(new Gtk::EventBox()); titleEvBox->set_name("MyExpanderTitle"); - titleEvBox->set_border_width(2); + titleEvBox->set_border_width(0); titleEvBox->add(*headerHBox); titleEvBox->set_above_child(false); // this is the key! By make it below the child, they will get the events first. titleEvBox->set_can_focus(false); @@ -736,7 +740,7 @@ void MyExpander::setLevel (int level) void MyExpander::setLabel (Glib::ustring newLabel) { if (label) { - label->set_markup(Glib::ustring("") + escapeHtmlChars(newLabel) + Glib::ustring("")); + label->set_markup(escapeHtmlChars(newLabel)); } } @@ -764,8 +768,10 @@ void MyExpander::set_inconsistent(bool isInconsistent) } else { if (enabled) { statusImage->set(enabledImage->get_surface()); + get_style_context()->add_class("enabledTool"); } else { statusImage->set(disabledImage->get_surface()); + get_style_context()->remove_class("enabledTool"); } } } @@ -792,6 +798,7 @@ void MyExpander::setEnabled(bool isEnabled) if (!inconsistent) { statusImage->set(disabledImage->get_surface()); + get_style_context()->remove_class("enabledTool"); message.emit(); } } else { @@ -799,6 +806,7 @@ void MyExpander::setEnabled(bool isEnabled) if (!inconsistent) { statusImage->set(enabledImage->get_surface()); + get_style_context()->add_class("enabledTool"); message.emit(); } } @@ -901,9 +909,11 @@ bool MyExpander::on_enabled_change(GdkEventButton* event) if (enabled) { enabled = false; statusImage->set(disabledImage->get_surface()); + get_style_context()->remove_class("enabledTool"); } else { enabled = true; statusImage->set(enabledImage->get_surface()); + get_style_context()->add_class("enabledTool"); } message.emit(); diff --git a/rtgui/icmpanel.cc b/rtgui/icmpanel.cc index 92827bf30..4a67d076f 100644 --- a/rtgui/icmpanel.cc +++ b/rtgui/icmpanel.cc @@ -95,6 +95,7 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha inone->set_group(opts); dcpFrame = Gtk::manage(new Gtk::Frame("DCP")); + dcpFrame->set_label_align(0.025, 0.5); Gtk::Grid* dcpGrid = Gtk::manage(new Gtk::Grid()); dcpGrid->set_column_homogeneous(false); diff --git a/rtgui/lensprofile.cc b/rtgui/lensprofile.cc index 1a8391f66..73fb0399b 100644 --- a/rtgui/lensprofile.cc +++ b/rtgui/lensprofile.cc @@ -74,11 +74,13 @@ LensProfilePanel::LensProfilePanel() : // Main containers: Gtk::Frame *nodesFrame = Gtk::manage(new Gtk::Frame(M("TP_LENSPROFILE_MODE_HEADER"))); + nodesFrame->set_label_align (0.025, 0.5); modesGrid->get_style_context()->add_class("grid-spacing"); setExpandAlignProperties(modesGrid, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); Gtk::Frame *distFrame = Gtk::manage(new Gtk::Frame(M("TP_LENSPROFILE_USE_HEADER"))); + distFrame->set_label_align (0.025, 0.5); distGrid->get_style_context()->add_class("grid-spacing"); setExpandAlignProperties(distGrid, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); diff --git a/rtgui/navigator.cc b/rtgui/navigator.cc index 9397cfc67..71e7e3d1d 100644 --- a/rtgui/navigator.cc +++ b/rtgui/navigator.cc @@ -72,8 +72,8 @@ Navigator::Navigator() : ); set_label (M("MAIN_MSG_NAVIGATOR")); + set_name("Navigator"); Gtk::VBox* mbox = Gtk::manage (new Gtk::VBox ()); - mbox->set_name("Navigator"); previewWindow = Gtk::manage (new PreviewWindow ()); mbox->pack_start (*previewWindow, Gtk::PACK_SHRINK, 2); dimension = Gtk::manage (new Gtk::Label ()); diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index b18e9e66c..3177f3cd4 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -627,6 +627,7 @@ Gtk::Widget* Preferences::getImageProcessingPanel () // Crop Gtk::Frame *cropFrame = Gtk::manage(new Gtk::Frame(M("PREFERENCES_CROP"))); + cropFrame->set_label_align (0.025, 0.5); Gtk::Grid *cropGrid = Gtk::manage(new Gtk::Grid()); Gtk::Label *cropGuidesLbl = Gtk::manage(new Gtk::Label(M("PREFERENCES_CROP_GUIDES") + ": ", Gtk::ALIGN_START)); cropGuidesCombo = Gtk::manage(new Gtk::ComboBoxText()); @@ -685,6 +686,7 @@ Gtk::Widget* Preferences::getPerformancePanel() vbPerformance->pack_start (*fclut, Gtk::PACK_SHRINK, 4); Gtk::Frame* fchunksize = Gtk::manage ( new Gtk::Frame (M ("PREFERENCES_CHUNKSIZES")) ); + fchunksize->set_label_align(0.025, 0.5); Gtk::VBox* chunkSizeVB = Gtk::manage ( new Gtk::VBox () ); Gtk::HBox* measureHB = Gtk::manage ( new Gtk::HBox () ); @@ -705,6 +707,7 @@ Gtk::Widget* Preferences::getPerformancePanel() vbPerformance->pack_start (*fchunksize, Gtk::PACK_SHRINK, 4); Gtk::Frame* finspect = Gtk::manage ( new Gtk::Frame (M ("PREFERENCES_INSPECT_LABEL")) ); + finspect->set_label_align(0.025, 0.5); Gtk::VBox *inspectorvb = Gtk::manage(new Gtk::VBox()); placeSpinBox(inspectorvb, maxInspectorBuffersSB, "PREFERENCES_INSPECT_MAXBUFFERS_LABEL", 0, 1, 5, 2, 1, 12, "PREFERENCES_INSPECT_MAXBUFFERS_TOOLTIP"); @@ -720,6 +723,7 @@ Gtk::Widget* Preferences::getPerformancePanel() vbPerformance->pack_start (*finspect, Gtk::PACK_SHRINK, 4); Gtk::Frame* threadsFrame = Gtk::manage ( new Gtk::Frame (M ("PREFERENCES_PERFORMANCE_THREADS")) ); + threadsFrame->set_label_align(0.025, 0.5); Gtk::VBox* threadsVBox = Gtk::manage ( new Gtk::VBox (Gtk::PACK_SHRINK, 4) ); #ifdef _OPENMP diff --git a/rtgui/recentbrowser.cc b/rtgui/recentbrowser.cc index fca97cafa..90fe69216 100644 --- a/rtgui/recentbrowser.cc +++ b/rtgui/recentbrowser.cc @@ -28,6 +28,7 @@ RecentBrowser::RecentBrowser () recentDirs = Gtk::manage (new MyComboBoxText ()); Gtk::Frame* frame = Gtk::manage (new Gtk::Frame (M("MAIN_FRAME_RECENT"))); + frame->set_label_align(0.025, 0.5); frame->add (*recentDirs); for(size_t i = 0; i < options.recentFolders.size(); i++) { diff --git a/rtgui/retinex.cc b/rtgui/retinex.cc index ec250d69b..0a40ced9d 100644 --- a/rtgui/retinex.cc +++ b/rtgui/retinex.cc @@ -132,6 +132,7 @@ Retinex::Retinex () : FoldableToolPanel (this, "retinex", M ("TP_RETINEX_LABEL") // Gtk::Frame *maskFrame = Gtk::manage (new Gtk::Frame (M ("TP_RETINEX_LABEL_MASK")) ); maskFrame = Gtk::manage (new Gtk::Frame (M ("TP_RETINEX_LABEL_MASK")) ); + maskFrame->set_label_align(0.025, 0.5); setExpandAlignProperties (maskFrame, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); Gtk::Grid *maskGrid = Gtk::manage ( new Gtk::Grid()); @@ -242,6 +243,7 @@ Retinex::Retinex () : FoldableToolPanel (this, "retinex", M ("TP_RETINEX_LABEL") equalFrame = Gtk::manage (new Gtk::Frame (M ("TP_RETINEX_EQUAL"))); + equalFrame->set_label_align(0.025, 0.5); setExpandAlignProperties (equalFrame, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); //GTK318 #if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 20 @@ -345,6 +347,7 @@ Retinex::Retinex () : FoldableToolPanel (this, "retinex", M ("TP_RETINEX_LABEL") iterFrame = Gtk::manage (new Gtk::Frame (M ("TP_RETINEX_ITERF"))); + iterFrame->set_label_align(0.025, 0.5); setExpandAlignProperties (iterFrame, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); //GTK318 #if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 20 @@ -389,6 +392,7 @@ Retinex::Retinex () : FoldableToolPanel (this, "retinex", M ("TP_RETINEX_LABEL") tranFrame = Gtk::manage (new Gtk::Frame (M ("TP_RETINEX_TRANF"))); + tranFrame->set_label_align(0.025, 0.5); setExpandAlignProperties (tranFrame, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); //GTK318 #if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 20 @@ -444,6 +448,7 @@ Retinex::Retinex () : FoldableToolPanel (this, "retinex", M ("TP_RETINEX_LABEL") gainFrame = Gtk::manage (new Gtk::Frame (M ("TP_RETINEX_GAINOFFS"))); + gainFrame->set_label_align(0.025, 0.5); setExpandAlignProperties (gainFrame, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); //GTK318 #if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 20 diff --git a/rtgui/toolpanel.cc b/rtgui/toolpanel.cc index b1282f523..710a19c87 100644 --- a/rtgui/toolpanel.cc +++ b/rtgui/toolpanel.cc @@ -55,7 +55,7 @@ FoldableToolPanel::FoldableToolPanel(Gtk::Box* content, Glib::ustring toolName, Gtk::HBox *titleHBox = Gtk::manage(new Gtk::HBox()); Gtk::Label *label = Gtk::manage(new Gtk::Label()); - label->set_markup(Glib::ustring("") + escapeHtmlChars(UILabel) + Glib::ustring("")); + label->set_markup(escapeHtmlChars(UILabel)); label->set_alignment(Gtk::ALIGN_START, Gtk::ALIGN_CENTER); titleHBox->pack_start(*label, Gtk::PACK_EXPAND_WIDGET, 0); diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index 0b4ffc24b..9ccc9f8ba 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -200,37 +200,29 @@ ToolPanelCoordinator::ToolPanelCoordinator (bool batch) : ipc (nullptr), favorit if(favoriteCount > 0) { favoritePanelSW = Gtk::manage(new MyScrolledWindow()); favoritePanelSW->add(*favoritePanel); - favoritePanel->pack_start(*Gtk::manage(new Gtk::HSeparator), Gtk::PACK_SHRINK, 0); favoritePanel->pack_start(*vbPanelEnd[0], Gtk::PACK_SHRINK, 4); } updateVScrollbars(options.hideTPVScrollbar); exposurePanelSW->add (*exposurePanel); - exposurePanel->pack_start (*Gtk::manage (new Gtk::HSeparator), Gtk::PACK_SHRINK, 0); exposurePanel->pack_start (*vbPanelEnd[1], Gtk::PACK_SHRINK, 4); detailsPanelSW->add (*detailsPanel); - detailsPanel->pack_start (*Gtk::manage (new Gtk::HSeparator), Gtk::PACK_SHRINK, 0); detailsPanel->pack_start (*vbPanelEnd[2], Gtk::PACK_SHRINK, 4); colorPanelSW->add (*colorPanel); - colorPanel->pack_start (*Gtk::manage (new Gtk::HSeparator), Gtk::PACK_SHRINK, 0); colorPanel->pack_start (*vbPanelEnd[3], Gtk::PACK_SHRINK, 4); advancedPanelSW->add (*advancedPanel); - advancedPanel->pack_start (*Gtk::manage (new Gtk::HSeparator), Gtk::PACK_SHRINK, 0); advancedPanel->pack_start (*vbPanelEnd[6], Gtk::PACK_SHRINK, 0); locallabPanelSW->add(*locallabPanel); - locallabPanel->pack_start(*Gtk::manage(new Gtk::HSeparator), Gtk::PACK_SHRINK, 0); locallabPanel->pack_start(*vbPanelEnd[7], Gtk::PACK_SHRINK, 4); transformPanelSW->add (*transformPanel); - transformPanel->pack_start (*Gtk::manage (new Gtk::HSeparator), Gtk::PACK_SHRINK, 0); transformPanel->pack_start (*vbPanelEnd[4], Gtk::PACK_SHRINK, 4); rawPanelSW->add (*rawPanel); - rawPanel->pack_start (*Gtk::manage (new Gtk::HSeparator), Gtk::PACK_SHRINK, 0); rawPanel->pack_start (*vbPanelEnd[5], Gtk::PACK_SHRINK, 0); toiF = Gtk::manage (new TextOrIcon ("star.png", M ("MAIN_TAB_FAVORITES"), M ("MAIN_TAB_FAVORITES_TOOLTIP"))); @@ -1168,14 +1160,12 @@ void ToolPanelCoordinator::updateVScrollbars(bool hide) rawPanelSW->set_policy (Gtk::POLICY_AUTOMATIC, policy); advancedPanelSW->set_policy (Gtk::POLICY_AUTOMATIC, policy); locallabPanelSW->set_policy(Gtk::POLICY_AUTOMATIC, policy); - for (auto currExp : expList) { currExp->updateVScrollbars(hide); } } - void ToolPanelCoordinator::updateTPVScrollbar(bool hide) { updateVScrollbars(hide); From bad08bfe1da51635ea9dcc5866587b97a0756228 Mon Sep 17 00:00:00 2001 From: Desmis Date: Tue, 29 Dec 2020 10:27:57 +0100 Subject: [PATCH 032/129] Local adjustments - Color and light - Recovery based on luminance mask (#6035) * Init GUI color mask recovery * Enable recovery Color and Light with mask * Disabled invmaskd in color and light * Hide decay in standard - added tooltips * Change tooltips * Change normal to simple for all defaults mask --- rtdata/languages/default | 10 +- rtengine/iplocallab.cc | 88 ++++++++++++++++++ rtengine/procevents.h | 4 + rtengine/procparams.cc | 16 ++++ rtengine/procparams.h | 4 + rtengine/refreshmap.cc | 6 +- rtgui/locallabtools.cc | 196 +++++++++++++++++++++++++++++++-------- rtgui/locallabtools.h | 7 ++ rtgui/locallabtools2.cc | 46 ++++----- rtgui/paramsedited.cc | 28 ++++++ rtgui/paramsedited.h | 4 + 11 files changed, 345 insertions(+), 64 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 4b91668cc..d2c57707e 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1239,6 +1239,11 @@ HISTORY_MSG_991;Local - Denoise threshold mask low HISTORY_MSG_992;Local - Denoise threshold mask high HISTORY_MSG_993;Local - Denoise Inverse algo HISTORY_MSG_994;Local - GF Inverse algo +HISTORY_MSG_995;Local - Denoise decay +HISTORY_MSG_996;Local - Color recovery threshold +HISTORY_MSG_997;Local - Color threshold mask low +HISTORY_MSG_998;Local - Color threshold mask high +HISTORY_MSG_999;Local - Color decay HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance @@ -2776,16 +2781,17 @@ TP_LOCALLAB_MASKH;Hue curve TP_LOCALLAB_MASKLC_TOOLTIP;This allows you to target the denoise based on the image luminance information contained in the L(L) or LC(H) mask (Mask and Modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n if the mask is very dark - below the threshold 'dark' - denoise will be increased if reinforce > 1.\n if the mask is clear - above the threshold 'light' - denoise will be progressively cancelled.\n between the two, denoise will be maintained at the settings without mask. TP_LOCALLAB_MASKDE_TOOLTIP;Used to direct the Denoise based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n If the mask is below the ‘dark’ threshold, then the Denoise will be applied progressively.\n if the mask is above the ‘light’ threshold, then the Denoise will be applied progressively.\n Between the two, the image settings without the Denoise will be maintained. TP_LOCALLAB_MASKGF_TOOLTIP;Used to direct the Guided Filter based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n If the mask is below the ‘dark’ threshold, then the GF will be applied progressively.\n if the mask is above the ‘light’ threshold, then the GF will be applied progressively.\n Between the two, the image settings without the GF will be maintained. +TP_LOCALLAB_MASKRECOL_TOOLTIP;Used to modulate the effect of the Color and Light settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Color and Light settings \n In between these two areas, the full value of the Color and Light settings will be applied TP_LOCALLAB_MASKDEINV_TOOLTIP;Reverses the way the algorithm interprets the mask.\nIf checked black and very light areas will be decreased. +TP_LOCALLAB_MASKHIGTHRESC_TOOLTIP;Light-tone limit above which Color and Light will be restored progressively to their original values prior to being modified by the Color and Light settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESD_TOOLTIP;Light-tone limit above which denoise will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRES_TOOLTIP;Light-tone limit above which 'Guided Filter' will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 -TP_LOCALLAB_MASKHIGTHRES_TOOLTIP;Light limit above which the GuidedFilter will be applied progressively.\n You can used some tools in 'mask and modifications' to change the gray levels: 'structure mask', 'Smooth radius', 'Gamma and slope', 'Contrast curve', 'Local contrast wavelet'.\n You can use 'lockable color picker' on mask to see what areas will be take into account. Be carefull in 'settings' to Background color mask = 0 -TP_LOCALLAB_MASKHIGTHRESD_TOOLTIP;Light limit above which the denoise will be applied progressively.\n You can used some tools in 'mask and modifications' to change the gray levels: 'structure mask', 'Smooth radius', 'Gamma and slope', 'Contrast curve', 'Local contrast wavelet'.\n You can use 'lockable color picker' on mask to see what areas will be take into account. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLCTHR;Light area luminance threshold TP_LOCALLAB_MASKLCTHRLOW;Dark area luminance threshold TP_LOCALLAB_MASKLNOISELOW;Reinforce denoise in dark and light areas TP_LOCALLAB_MASKLOWTHRES_TOOLTIP;Dark-tone limit below which 'Guided Filter' will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESD_TOOLTIP;Dark-tone limit below which denoise will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKLOWTHRESC_TOOLTIP;Dark-tone limit below which Color and Light will be restored progressively to their original values prior to being modified by the Color and Light settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKUSABLE;Mask enabled (Mask & modifications) TP_LOCALLAB_MASKUNUSABLE;Mask disabled (Mask & modifications) TP_LOCALLAB_MASKRECOTHRES;Recovery threshold diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index f19deeeca..79cb1b938 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -586,6 +586,10 @@ struct local_params { float lowthrd; float higthrd; float decayd; + float recothrc; + float lowthrc; + float higthrc; + float decayc; int noiselequal; float noisechrodetail; float bilat; @@ -1041,6 +1045,10 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall float local_lowthrd = (float)locallab.spots.at(sp).lowthresd; float local_higthrd = (float)locallab.spots.at(sp).higthresd; float local_decayd = (float)locallab.spots.at(sp).decayd; + float local_recothrc = (float)locallab.spots.at(sp).recothresc; + float local_lowthrc = (float)locallab.spots.at(sp).lowthresc; + float local_higthrc = (float)locallab.spots.at(sp).higthresc; + float local_decayc = (float)locallab.spots.at(sp).decayc; float local_noisecf = ((float)locallab.spots.at(sp).noisechrof) / 10.f; float local_noisecc = ((float)locallab.spots.at(sp).noisechroc) / 10.f; @@ -1395,6 +1403,10 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.lowthrd = local_lowthrd; lp.higthrd = local_higthrd; lp.decayd = local_decayd; + lp.recothrc = local_recothrc; + lp.lowthrc = local_lowthrc; + lp.higthrc = local_higthrc; + lp.decayc = local_decayc; lp.noiselequal = local_noiselequal; lp.noisechrodetail = local_noisechrodetail; lp.noiselc = local_noiselc; @@ -15345,6 +15357,82 @@ void ImProcFunctions::Lab_Local( if (lp.softradiuscol > 0.f) { softproc(bufcolorig.get(), bufcolfin.get(), lp.softradiuscol, bfh, bfw, 0.001, 0.00001, 0.5f, sk, multiThread, 1); } + //mask recovery + + if(lp.enaColorMask && lp.recothrc != 1.f) { + LabImage tmp3(bfw, bfh); + + for (int y = 0; y < bfh; y++){ + for (int x = 0; x < bfw; x++) { + tmp3.L[y][x] = original->L[y + ystart][x + xstart]; + tmp3.a[y][x] = original->a[y + ystart][x + xstart]; + tmp3.b[y][x] = original->b[y + ystart][x + xstart]; + } + } + array2D masklum; + masklum(bfw, bfh); + for (int ir = 0; ir < bfh; ir++) + for (int jr = 0; jr < bfw; jr++) { + masklum[ir][jr] = 1.f; + } + + float hig = lp.higthrc; + float higc; + calcdif(hig, higc); + float low = lp.lowthrc; + float lowc; + calcdif(low, lowc); + + if(higc < lowc) { + higc = lowc + 0.01f; + } + float th = (lp.recothrc - 1.f); + float ahigh = th / (higc - 100.f); + float bhigh = 1.f - higc * ahigh; + + float alow = th / lowc; + float blow = 1.f - th; + bool invmaskc = false; +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + for (int ir = 0; ir < bfh; ir++) + for (int jr = 0; jr < bfw; jr++) { + const float lM = bufmaskblurcol->L[ir][jr]; + const float lmr = lM / 327.68f; + if (lM < 327.68f * lowc) { + masklum[ir][jr] = alow * lmr + blow; + } else if (lM < 327.68f * higc) { + + } else { + masklum[ir][jr] = ahigh * lmr + bhigh; + } + float k = masklum[ir][jr]; + if(invmaskc == false) { + masklum[ir][jr] = 1 - pow(k, lp.decayc); + } else { + masklum[ir][jr] = pow(k, lp.decayc); + } + + } + + for (int i = 0; i < 3; ++i) { + boxblur(masklum, masklum, 10 / sk, bfw, bfh, false); + } + +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + for (int i = 0; i < bfh; ++i) { + for (int j = 0; j < bfw; ++j) { + bufcolfin->L[i][j] = (tmp3.L[i][j] - bufcolfin->L[i][j]) * LIM01(masklum[i][j]) + bufcolfin->L[i][j]; + bufcolfin->a[i][j] = (tmp3.a[i][j] - bufcolfin->a[i][j]) * LIM01(masklum[i][j]) + bufcolfin->a[i][j]; + bufcolfin->b[i][j] = (tmp3.b[i][j] - bufcolfin->b[i][j]) * LIM01(masklum[i][j]) + bufcolfin->b[i][j]; + } + } + masklum.free(); + + } float meansob = 0.f; transit_shapedetect2(call, 0, bufcolorig.get(), bufcolfin.get(), originalmaskcol.get(), hueref, chromaref, lumaref, sobelref, meansob, blend2, lp, original, transformed, cx, cy, sk); } diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 8ae9e1e4e..efe7d5b33 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -1018,6 +1018,10 @@ enum ProcEventCode { Evlocallabinvmaskd = 992, Evlocallabinvmask = 993, Evlocallabdecayd = 994, + Evlocallabrecothresc = 995, + Evlocallablowthresc = 996, + Evlocallabhigthresc = 997, + Evlocallabdecayc = 998, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 9037484ef..a53f2eb69 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3026,6 +3026,10 @@ LocallabParams::LocallabSpot::LocallabSpot() : 0.35 }, csthresholdcol(0, 0, 6, 5, false), + recothresc(1.), + lowthresc(12.), + higthresc(85.), + decayc(2.), // Exposure visiexpose(false), expexpose(false), @@ -4222,6 +4226,10 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && Lmaskcurve == other.Lmaskcurve && LLmaskcolcurvewav == other.LLmaskcolcurvewav && csthresholdcol == other.csthresholdcol + && recothresc == other.recothresc + && lowthresc == other.lowthresc + && higthresc == other.higthresc + && decayc == other.decayc // Exposure && visiexpose == other.visiexpose && expexpose == other.expexpose @@ -5817,6 +5825,10 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->Lmaskcurve, "Locallab", "LmaskCurve_" + index_str, spot.Lmaskcurve, keyFile); saveToKeyfile(!pedited || spot_edited->LLmaskcolcurvewav, "Locallab", "LLmaskcolCurvewav_" + index_str, spot.LLmaskcolcurvewav, keyFile); saveToKeyfile(!pedited || spot_edited->csthresholdcol, "Locallab", "CSThresholdcol_" + index_str, spot.csthresholdcol.toVector(), keyFile); + saveToKeyfile(!pedited || spot_edited->recothresc, "Locallab", "Recothresc_" + index_str, spot.recothresc, keyFile); + saveToKeyfile(!pedited || spot_edited->lowthresc, "Locallab", "Lowthresc_" + index_str, spot.lowthresc, keyFile); + saveToKeyfile(!pedited || spot_edited->higthresc, "Locallab", "Higthresc_" + index_str, spot.higthresc, keyFile); + saveToKeyfile(!pedited || spot_edited->decayc, "Locallab", "Decayc_" + index_str, spot.decayc, keyFile); } // Exposure if ((!pedited || spot_edited->visiexpose) && spot.visiexpose) { @@ -7600,6 +7612,10 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) spotEdited.csthresholdcol = true; } + assignFromKeyfile(keyFile, "Locallab", "Recothresc_" + index_str, pedited, spot.recothresc, spotEdited.recothresc); + assignFromKeyfile(keyFile, "Locallab", "Lowthresc_" + index_str, pedited, spot.lowthresc, spotEdited.lowthresc); + assignFromKeyfile(keyFile, "Locallab", "Higthresc_" + index_str, pedited, spot.higthresc, spotEdited.higthresc); + assignFromKeyfile(keyFile, "Locallab", "Decayc_" + index_str, pedited, spot.decayc, spotEdited.decayc); // Exposure spot.visiexpose = assignFromKeyfile(keyFile, "Locallab", "Expexpose_" + index_str, pedited, spot.expexpose, spotEdited.expexpose); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 7a7f7f8d5..451467b1a 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1084,6 +1084,10 @@ struct LocallabParams { std::vector Lmaskcurve; std::vector LLmaskcolcurvewav; Threshold csthresholdcol; + double recothresc; + double lowthresc; + double higthresc; + double decayc; // Exposure bool visiexpose; bool expexpose; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index d6079456f..1705f8d6f 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -1021,7 +1021,11 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabhigthresd LUMINANCECURVE, // Evlocallabinvmaskd LUMINANCECURVE, // Evlocallabinvmask - LUMINANCECURVE // Evlocallabdecayd + LUMINANCECURVE, // Evlocallabdecayd + LUMINANCECURVE, // Evlocallabrecothresc + LUMINANCECURVE, // Evlocallablowthresc + LUMINANCECURVE, // Evlocallabhigthresc + LUMINANCECURVE // Evlocallabdecayc }; diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 217096cac..71e293c96 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -424,6 +424,13 @@ LocallabColor::LocallabColor(): structcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUCCOL1"), 0, 100, 1, 0))), blurcolde(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURDE"), 2, 100, 1, 5))), softradiuscol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOFTRADIUSCOL"), 0.0, 100.0, 0.5, 0.))), + exprecov(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI2_EXP")))), + maskusablec(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUSABLE")))), + maskunusablec(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUNUSABLE")))), + recothresc(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKRECOTHRES"), 1., 2., 0.01, 1.))), + lowthresc(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 80., 0.5, 12.))), + higthresc(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 20., 99., 0.5, 85.))), + decayc(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKDDECAY"), 0.5, 4., 0.1, 2.))), invers(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVERS")))), expgradcol(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_EXPGRAD")))), strcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADSTRLUM"), -4., 4., 0.05, 0.))), @@ -531,6 +538,11 @@ LocallabColor::LocallabColor(): softradiuscol->setLogScale(10, 0); softradiuscol->setAdjusterListener(this); + recothresc->setAdjusterListener(this); + lowthresc->setAdjusterListener(this); + higthresc->setAdjusterListener(this); + decayc->setAdjusterListener(this); + setExpandAlignProperties(exprecov, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); inversConn = invers->signal_toggled().connect(sigc::mem_fun(*this, &LocallabColor::inversChanged)); invers->set_tooltip_text(M("TP_LOCALLAB_INVERS_TOOLTIP")); @@ -788,6 +800,18 @@ LocallabColor::LocallabColor(): pack_start(*blurcolde); pack_start(*softradiuscol); pack_start(*invers); + ToolParamBlock* const colBox3 = Gtk::manage(new ToolParamBlock()); + colBox3->pack_start(*maskusablec, Gtk::PACK_SHRINK, 0); + colBox3->pack_start(*maskunusablec, Gtk::PACK_SHRINK, 0); + colBox3->pack_start(*recothresc); + colBox3->pack_start(*lowthresc); + colBox3->pack_start(*higthresc); + colBox3->pack_start(*decayc); + // colBox3->pack_start(*invmaskc); + exprecov->add(*colBox3, false); + pack_start(*exprecov, false, false); + + ToolParamBlock* const gradcolBox = Gtk::manage(new ToolParamBlock()); gradcolBox->pack_start(*strcol); gradcolBox->pack_start(*strcolab); @@ -923,6 +947,7 @@ void LocallabColor::updateAdviceTooltips(const bool showTooltips) strengthgrid->set_tooltip_text(M("TP_LOCALLAB_STRENGRID_TOOLTIP")); blurcolde->set_tooltip_text(M("TP_LOCALLAB_BLURCOLDE_TOOLTIP")); softradiuscol->set_tooltip_text(M("TP_LOCALLAB_SOFTRADIUSCOL_TOOLTIP")); + exprecov->set_tooltip_markup(M("TP_LOCALLAB_MASKRECOL_TOOLTIP")); expgradcol->set_tooltip_text(M("TP_LOCALLAB_EXPGRADCOL_TOOLTIP")); rgbCurveEditorG->set_tooltip_text(M("TP_LOCALLAB_RGBCURVE_TOOLTIP")); sensi->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP")); @@ -963,6 +988,9 @@ void LocallabColor::updateAdviceTooltips(const bool showTooltips) blurcol->set_tooltip_text(M("TP_LOCALLAB_BLURRMASK_TOOLTIP")); lapmaskcol->set_tooltip_text(M("TP_LOCALLAB_LAPRAD1_TOOLTIP")); csThresholdcol->set_tooltip_text(M("TP_LOCALLAB_WAVEMASK_LEVEL_TOOLTIP")); + decayc->set_tooltip_text(M("TP_LOCALLAB_MASKDECAY_TOOLTIP")); + lowthresc->set_tooltip_text(M("TP_LOCALLAB_MASKLOWTHRESC_TOOLTIP")); + higthresc->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRESC_TOOLTIP")); } else { lumFrame->set_tooltip_text(""); lightness->set_tooltip_text(""); @@ -970,6 +998,7 @@ void LocallabColor::updateAdviceTooltips(const bool showTooltips) strengthgrid->set_tooltip_text(""); blurcolde->set_tooltip_text(""); softradiuscol->set_tooltip_text(""); + exprecov->set_tooltip_markup(""); expgradcol->set_tooltip_text(""); rgbCurveEditorG->set_tooltip_text(""); sensi->set_tooltip_text(""); @@ -1010,11 +1039,15 @@ void LocallabColor::updateAdviceTooltips(const bool showTooltips) mask2CurveEditorGwav->set_tooltip_text(""); LLmaskcolshapewav->setTooltip(""); csThresholdcol->set_tooltip_text(""); + decayc->set_tooltip_text(""); + lowthresc->set_tooltip_text(""); + higthresc->set_tooltip_text(""); } } void LocallabColor::setDefaultExpanderVisibility() { + exprecov->set_expanded(false); expgradcol->set_expanded(false); expcurvcol->set_expanded(false); expmaskcol1->set_expanded(false); @@ -1142,6 +1175,11 @@ void LocallabColor::read(const rtengine::procparams::ProcParams* pp, const Param merMethod->set_active(3); } + recothresc->setValue((double)spot.recothresc); + lowthresc->setValue((double)spot.lowthresc); + higthresc->setValue((double)spot.higthresc); + decayc->setValue((double)spot.decayc); + if (spot.mergecolMethod == "one") { mergecolMethod->set_active(0); } else if (spot.mergecolMethod == "two") { @@ -1275,6 +1313,11 @@ void LocallabColor::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pe spot.strcolh = strcolh->getValue(); spot.angcol = angcol->getValue(); + spot.recothresc = recothresc->getValue(); + spot.lowthresc = lowthresc->getValue(); + spot.higthresc = higthresc->getValue(); + spot.decayc = decayc->getValue(); + if (qualitycurveMethod->get_active_row_number() == 0) { spot.qualitycurveMethod = "none"; } else if (qualitycurveMethod->get_active_row_number() == 1) { @@ -1438,6 +1481,11 @@ void LocallabColor::setDefaults(const rtengine::procparams::ProcParams* defParam slomaskcol->setDefault(defSpot.slomaskcol); shadmaskcol->setDefault((double)defSpot.shadmaskcol); csThresholdcol->setDefault(defSpot.csthresholdcol); + recothresc->setDefault((double)defSpot.recothresc); + lowthresc->setDefault((double)defSpot.lowthresc); + higthresc->setDefault((double)defSpot.higthresc); + decayc->setDefault((double)defSpot.decayc); + } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -1502,6 +1550,36 @@ void LocallabColor::adjusterChanged(Adjuster* a, double newval) } } + if (a == recothresc) { + + if (listener) { + listener->panelChanged(Evlocallabrecothresc, + recothresc->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == lowthresc) { + if (listener) { + listener->panelChanged(Evlocallablowthresc, + lowthresc->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == higthresc) { + if (listener) { + listener->panelChanged(Evlocallabhigthresc, + higthresc->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == decayc) { + if (listener) { + listener->panelChanged(Evlocallabdecayc, + decayc->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == strcol) { if (listener) { listener->panelChanged(Evlocallabstrcol, @@ -1867,6 +1945,7 @@ void LocallabColor::convertParamToNormal() HHhmaskshape->setCurve(defSpot.HHhmaskcurve); LLmaskcolshapewav->setCurve(defSpot.LLmaskcolcurvewav); csThresholdcol->setValue(defSpot.csthresholdcol); + decayc->setValue(defSpot.decayc); // Enable all listeners enableListener(); @@ -1901,13 +1980,17 @@ void LocallabColor::convertParamToSimple() showmaskcolMethod->set_active(0); showmaskcolMethodinv->set_active(0); enaColorMask->set_active(defSpot.enaColorMask); - CCmaskshape->setCurve(defSpot.CCmaskcurve); - LLmaskshape->setCurve(defSpot.LLmaskcurve); - HHmaskshape->setCurve(defSpot.HHmaskcurve); - blendmaskcol->setValue((double)defSpot.blendmaskcol); - radmaskcol->setValue(defSpot.radmaskcol); - chromaskcol->setValue(defSpot.chromaskcol); - Lmaskshape->setCurve(defSpot.Lmaskcurve); +// CCmaskshape->setCurve(defSpot.CCmaskcurve); +// LLmaskshape->setCurve(defSpot.LLmaskcurve); +// HHmaskshape->setCurve(defSpot.HHmaskcurve); +// blendmaskcol->setValue((double)defSpot.blendmaskcol); +// radmaskcol->setValue(defSpot.radmaskcol); +// chromaskcol->setValue(defSpot.chromaskcol); +// Lmaskshape->setCurve(defSpot.Lmaskcurve); + recothresc->setValue(defSpot.recothresc); + lowthresc->setValue(defSpot.lowthresc); + higthresc->setValue(defSpot.higthresc); + decayc->setValue(defSpot.decayc); // Enable all listeners enableListener(); @@ -1925,7 +2008,10 @@ void LocallabColor::updateGUIToMode(const modeType new_type) expcurvcol->hide(); expmaskcol1->hide(); expmaskcol->hide(); - + exprecov->hide(); + maskusablec->hide(); + maskunusablec->hide(); + decayc->hide(); break; case Normal: @@ -1940,6 +2026,7 @@ void LocallabColor::updateGUIToMode(const modeType new_type) H2CurveEditorG->hide(); rgbCurveEditorG->hide(); special->hide(); + exprecov->show(); expmaskcol1->hide(); struFrame->hide(); blurFrame->hide(); @@ -1952,13 +2039,23 @@ void LocallabColor::updateGUIToMode(const modeType new_type) csThresholdcol->hide(); // Specific Simple mode widgets are shown in Normal mode softradiuscol->show(); + if (enaColorMask->get_active()) { + maskusablec->show(); + maskunusablec->hide(); + + } else { + maskusablec->hide(); + maskunusablec->show(); + } if (!invers->get_active()) { // Keep widget hidden when invers is toggled expgradcol->show(); + exprecov->show(); } expcurvcol->show(); expmaskcol->show(); + decayc->hide(); break; @@ -1970,11 +2067,23 @@ void LocallabColor::updateGUIToMode(const modeType new_type) if (!invers->get_active()) { // Keep widget hidden when invers is toggled softradiuscol->show(); expgradcol->show(); + exprecov->show(); } strcolab->show(); strcolh->show(); expcurvcol->show(); + if (enaColorMask->get_active()) { + maskusablec->show(); + maskunusablec->hide(); + + } else { + maskusablec->hide(); + maskunusablec->show(); + } + + exprecov->show(); + decayc->show(); if (!invers->get_active()) { // Keep widgets hidden when invers is toggled clCurveEditorG->show(); @@ -2173,6 +2282,15 @@ void LocallabColor::showmaskcolMethodChangedinv() void LocallabColor::enaColorMaskChanged() { + if (enaColorMask->get_active()) { + maskusablec->show(); + maskunusablec->hide(); + + } else { + maskusablec->hide(); + maskunusablec->show(); + } + if (isLocActivated && exp->getEnabled()) { if (listener) { if (enaColorMask->get_active()) { @@ -2227,6 +2345,7 @@ void LocallabColor::updateColorGUI1() structcol->hide(); softradiuscol->hide(); expgradcol->hide(); + exprecov->hide(); labqualcurv->hide(); qualitycurveMethod->hide(); clCurveEditorG->hide(); @@ -2251,6 +2370,7 @@ void LocallabColor::updateColorGUI1() if (mode == Expert || mode == Normal) { // Keep widget hidden in Simple mode softradiuscol->show(); expgradcol->show(); + exprecov->show(); } labqualcurv->show(); @@ -3250,13 +3370,13 @@ void LocallabExposure::convertParamToSimple() softradiusexp->setValue(defSpot.softradiusexp); enaExpMask->set_active(defSpot.enaExpMask); enaExpMaskaft->set_active(defSpot.enaExpMaskaft); - CCmaskexpshape->setCurve(defSpot.CCmaskexpcurve); - LLmaskexpshape->setCurve(defSpot.CCmaskexpcurve); - HHmaskexpshape->setCurve(defSpot.HHmaskexpcurve); - blendmaskexp->setValue((double)defSpot.blendmaskexp); - radmaskexp->setValue(defSpot.radmaskexp); - chromaskexp->setValue(defSpot.chromaskexp); - Lmaskexpshape->setCurve(defSpot.Lmaskexpcurve); + // CCmaskexpshape->setCurve(defSpot.CCmaskexpcurve); + // LLmaskexpshape->setCurve(defSpot.CCmaskexpcurve); + // HHmaskexpshape->setCurve(defSpot.HHmaskexpcurve); + // blendmaskexp->setValue((double)defSpot.blendmaskexp); + // radmaskexp->setValue(defSpot.radmaskexp); +// chromaskexp->setValue(defSpot.chromaskexp); +// Lmaskexpshape->setCurve(defSpot.Lmaskexpcurve); // Enable all listeners enableListener(); @@ -4262,13 +4382,13 @@ void LocallabShadow::convertParamToSimple() showmaskSHMethod->set_active(0); showmaskSHMethodinv->set_active(0); enaSHMask->set_active(defSpot.enaSHMask); - CCmaskSHshape->setCurve(defSpot.CCmaskSHcurve); - LLmaskSHshape->setCurve(defSpot.LLmaskSHcurve); - HHmaskSHshape->setCurve(defSpot.HHmaskSHcurve); - blendmaskSH->setValue((double)defSpot.blendmaskSH); - radmaskSH->setValue(defSpot.radmaskSH); - chromaskSH->setValue(defSpot.chromaskSH); - LmaskSHshape->setCurve(defSpot.LmaskSHcurve); + // CCmaskSHshape->setCurve(defSpot.CCmaskSHcurve); + // LLmaskSHshape->setCurve(defSpot.LLmaskSHcurve); + // HHmaskSHshape->setCurve(defSpot.HHmaskSHcurve); + // blendmaskSH->setValue((double)defSpot.blendmaskSH); + // radmaskSH->setValue(defSpot.radmaskSH); + // chromaskSH->setValue(defSpot.chromaskSH); + // LmaskSHshape->setCurve(defSpot.LmaskSHcurve); // Enable all listeners enableListener(); @@ -5169,13 +5289,13 @@ void LocallabVibrance::convertParamToSimple() angvib->setValue(defSpot.angvib); showmaskvibMethod->set_active(0); enavibMask->set_active(defSpot.enavibMask); - CCmaskvibshape->setCurve(defSpot.CCmaskvibcurve); - LLmaskvibshape->setCurve(defSpot.LLmaskvibcurve); - HHmaskvibshape->setCurve(defSpot.HHmaskvibcurve); - blendmaskvib->setValue((double)defSpot.blendmaskvib); - radmaskvib->setValue(defSpot.radmaskvib); - chromaskvib->setValue(defSpot.chromaskvib); - Lmaskvibshape->setCurve(defSpot.Lmaskvibcurve); + // CCmaskvibshape->setCurve(defSpot.CCmaskvibcurve); + // LLmaskvibshape->setCurve(defSpot.LLmaskvibcurve); + // HHmaskvibshape->setCurve(defSpot.HHmaskvibcurve); + // blendmaskvib->setValue((double)defSpot.blendmaskvib); + // radmaskvib->setValue(defSpot.radmaskvib); + // chromaskvib->setValue(defSpot.chromaskvib); + // Lmaskvibshape->setCurve(defSpot.Lmaskvibcurve); // Enable all listener enableListener(); @@ -7158,15 +7278,15 @@ void LocallabBlur::convertParamToSimple() } lnoiselow->setValue(defSpot.lnoiselow); enablMask->set_active(defSpot.enablMask); - CCmaskblshape->setCurve(defSpot.CCmaskblcurve); - LLmaskblshape->setCurve(defSpot.LLmaskblcurve); - HHmaskblshape->setCurve(defSpot.HHmaskblcurve); - blendmaskbl->setValue((double)defSpot.blendmaskbl); - radmaskbl->setValue(defSpot.radmaskbl); - chromaskbl->setValue(defSpot.chromaskbl); - gammaskbl->setValue(defSpot.gammaskbl); - slomaskbl->setValue(defSpot.slomaskbl); - Lmaskblshape->setCurve(defSpot.Lmasklccurve); + // CCmaskblshape->setCurve(defSpot.CCmaskblcurve); + // LLmaskblshape->setCurve(defSpot.LLmaskblcurve); + // HHmaskblshape->setCurve(defSpot.HHmaskblcurve); + // blendmaskbl->setValue((double)defSpot.blendmaskbl); + // radmaskbl->setValue(defSpot.radmaskbl); + // chromaskbl->setValue(defSpot.chromaskbl); + // gammaskbl->setValue(defSpot.gammaskbl); + // slomaskbl->setValue(defSpot.slomaskbl); + // Lmaskblshape->setCurve(defSpot.Lmasklccurve); levelthr->setValue(defSpot.levelthr); lnoiselow->setValue(defSpot.lnoiselow); levelthrlow->setValue(defSpot.levelthrlow); diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index 4410f823e..6d3bb9b50 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -189,6 +189,13 @@ private: Adjuster* const structcol; Adjuster* const blurcolde; Adjuster* const softradiuscol; + MyExpander* const exprecov; + Gtk::Label* const maskusablec; + Gtk::Label* const maskunusablec; + Adjuster* const recothresc; + Adjuster* const lowthresc; + Adjuster* const higthresc; + Adjuster* const decayc; Gtk::CheckButton* const invers; MyExpander* const expgradcol; Adjuster* const strcol; diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index 52d5d9ad3..aa08fe86d 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -555,13 +555,13 @@ void LocallabTone::convertParamToSimple() showmasktmMethod->set_active(0); enatmMask->set_active(defSpot.enatmMask); enatmMaskaft->set_active(defSpot.enatmMaskaft); - CCmasktmshape->setCurve(defSpot.CCmasktmcurve); - LLmasktmshape->setCurve(defSpot.LLmasktmcurve); - HHmasktmshape->setCurve(defSpot.HHmasktmcurve); - blendmasktm->setValue((double)defSpot.blendmasktm); - radmasktm->setValue(defSpot.radmasktm); - chromasktm->setValue(defSpot.chromasktm); - Lmasktmshape->setCurve(defSpot.Lmasktmcurve); +// CCmasktmshape->setCurve(defSpot.CCmasktmcurve); +// LLmasktmshape->setCurve(defSpot.LLmasktmcurve); +// HHmasktmshape->setCurve(defSpot.HHmasktmcurve); +// blendmasktm->setValue((double)defSpot.blendmasktm); +// radmasktm->setValue(defSpot.radmasktm); +// chromasktm->setValue(defSpot.chromasktm); +// Lmasktmshape->setCurve(defSpot.Lmasktmcurve); // Enable all listeners enableListener(); @@ -3584,13 +3584,13 @@ void LocallabContrast::convertParamToSimple() showmasklcMethod->set_active(0); enalcMask->set_active(defSpot.enalcMask); - CCmasklcshape->setCurve(defSpot.CCmasklccurve); - LLmasklcshape->setCurve(defSpot.LLmasklccurve); - HHmasklcshape->setCurve(defSpot.HHmasklccurve); - blendmasklc->setValue((double)defSpot.blendmasklc); - radmasklc->setValue(defSpot.radmasklc); - chromasklc->setValue(defSpot.chromasklc); - Lmasklcshape->setCurve(defSpot.Lmasklccurve); +// CCmasklcshape->setCurve(defSpot.CCmasklccurve); +// LLmasklcshape->setCurve(defSpot.LLmasklccurve); +// HHmasklcshape->setCurve(defSpot.HHmasklccurve); +// blendmasklc->setValue((double)defSpot.blendmasklc); +// radmasklc->setValue(defSpot.radmasklc); +// chromasklc->setValue(defSpot.chromasklc); +// Lmasklcshape->setCurve(defSpot.Lmasklccurve); // Enable all listeners enableListener(); @@ -4505,15 +4505,15 @@ void LocallabCBDL::convertParamToSimple() softradiuscb->setValue(defSpot.softradiuscb); showmaskcbMethod->set_active(0); enacbMask->set_active(defSpot.enacbMask); - CCmaskcbshape->setCurve(defSpot.CCmaskcbcurve); - LLmaskcbshape->setCurve(defSpot.LLmaskcbcurve); - HHmaskcbshape->setCurve(defSpot.HHmaskcbcurve); - blendmaskcb->setValue((double)defSpot.blendmaskcb); - radmaskcb->setValue(defSpot.radmaskcb); - chromaskcb->setValue(defSpot.chromaskcb); - gammaskcb->setValue(defSpot.gammaskcb); - slomaskcb->setValue(defSpot.slomaskcb); - Lmaskcbshape->setCurve(defSpot.Lmaskcbcurve); +// CCmaskcbshape->setCurve(defSpot.CCmaskcbcurve); +// LLmaskcbshape->setCurve(defSpot.LLmaskcbcurve); +// HHmaskcbshape->setCurve(defSpot.HHmaskcbcurve); +// blendmaskcb->setValue((double)defSpot.blendmaskcb); +// radmaskcb->setValue(defSpot.radmaskcb); +// chromaskcb->setValue(defSpot.chromaskcb); +// gammaskcb->setValue(defSpot.gammaskcb); +// slomaskcb->setValue(defSpot.slomaskcb); +// Lmaskcbshape->setCurve(defSpot.Lmaskcbcurve); // Enable all listers enableListener(); diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 350a7f87f..cc5e3ef59 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1151,6 +1151,10 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).Lmaskcurve = locallab.spots.at(j).Lmaskcurve && pSpot.Lmaskcurve == otherSpot.Lmaskcurve; locallab.spots.at(j).LLmaskcolcurvewav = locallab.spots.at(j).LLmaskcolcurvewav && pSpot.LLmaskcolcurvewav == otherSpot.LLmaskcolcurvewav; locallab.spots.at(j).csthresholdcol = locallab.spots.at(j).csthresholdcol && pSpot.csthresholdcol == otherSpot.csthresholdcol; + locallab.spots.at(j).recothresc = locallab.spots.at(j).recothresc && pSpot.recothresc == otherSpot.recothresc; + locallab.spots.at(j).lowthresc = locallab.spots.at(j).lowthresc && pSpot.lowthresc == otherSpot.lowthresc; + locallab.spots.at(j).higthresc = locallab.spots.at(j).higthresc && pSpot.higthresc == otherSpot.higthresc; + locallab.spots.at(j).decayc = locallab.spots.at(j).decayc && pSpot.decayc == otherSpot.decayc; // Exposure locallab.spots.at(j).visiexpose = locallab.spots.at(j).visiexpose && pSpot.visiexpose == otherSpot.visiexpose; locallab.spots.at(j).expexpose = locallab.spots.at(j).expexpose && pSpot.expexpose == otherSpot.expexpose; @@ -3562,6 +3566,22 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).csthresholdcol = mods.locallab.spots.at(i).csthresholdcol; } + if (locallab.spots.at(i).recothresc) { + toEdit.locallab.spots.at(i).recothresc = mods.locallab.spots.at(i).recothresc; + } + + if (locallab.spots.at(i).lowthresc) { + toEdit.locallab.spots.at(i).lowthresc = mods.locallab.spots.at(i).lowthresc; + } + + if (locallab.spots.at(i).higthresc) { + toEdit.locallab.spots.at(i).higthresc = mods.locallab.spots.at(i).higthresc; + } + + if (locallab.spots.at(i).decayc) { + toEdit.locallab.spots.at(i).decayc = mods.locallab.spots.at(i).decayc; + } + // Exposure if (locallab.spots.at(i).visiexpose) { toEdit.locallab.spots.at(i).visiexpose = mods.locallab.spots.at(i).visiexpose; @@ -6504,6 +6524,10 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : Lmaskcurve(v), LLmaskcolcurvewav(v), csthresholdcol(v), + recothresc(v), + lowthresc(v), + higthresc(v), + decayc(v), // Exposure visiexpose(v), expexpose(v), @@ -7028,6 +7052,10 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) Lmaskcurve = v; LLmaskcolcurvewav = v; csthresholdcol = v; + recothresc = v; + lowthresc = v; + higthresc = v; + decayc = v; // Exposure visiexpose = v; expexpose = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index eccbc7a43..d48f251db 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -492,6 +492,10 @@ public: bool Lmaskcurve; bool LLmaskcolcurvewav; bool csthresholdcol; + bool recothresc; + bool lowthresc; + bool higthresc; + bool decayc; // Exposure bool visiexpose; bool expexpose; From d1188015615d230b489cba4df462790e177a99ab Mon Sep 17 00:00:00 2001 From: Desmis Date: Wed, 30 Dec 2020 10:12:32 +0100 Subject: [PATCH 033/129] LA denoise recovery gray (#6037) --- rtdata/languages/default | 4 +++- rtengine/iplocallab.cc | 10 ++++++++-- rtengine/procevents.h | 1 + rtengine/procparams.cc | 4 ++++ rtengine/procparams.h | 1 + rtengine/refreshmap.cc | 3 ++- rtgui/locallabtools.cc | 17 +++++++++++++++++ rtgui/locallabtools.h | 1 + rtgui/paramsedited.cc | 7 +++++++ rtgui/paramsedited.h | 1 + 10 files changed, 45 insertions(+), 4 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index d2c57707e..78db75169 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1244,6 +1244,7 @@ HISTORY_MSG_996;Local - Color recovery threshold HISTORY_MSG_997;Local - Color threshold mask low HISTORY_MSG_998;Local - Color threshold mask high HISTORY_MSG_999;Local - Color decay +HISTORY_MSG_1000;Local - Denoise gray HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance @@ -2779,7 +2780,7 @@ TP_LOCALLAB_MASKDDECAY;Decay strength TP_LOCALLAB_MASKDECAY_TOOLTIP;Manages the rate of decay for the gray levels in the mask.\n Decay = 1 linear, Decay > 1 sharper parabolic transitions, Decay < 1 more gradual transitions TP_LOCALLAB_MASKH;Hue curve TP_LOCALLAB_MASKLC_TOOLTIP;This allows you to target the denoise based on the image luminance information contained in the L(L) or LC(H) mask (Mask and Modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n if the mask is very dark - below the threshold 'dark' - denoise will be increased if reinforce > 1.\n if the mask is clear - above the threshold 'light' - denoise will be progressively cancelled.\n between the two, denoise will be maintained at the settings without mask. -TP_LOCALLAB_MASKDE_TOOLTIP;Used to direct the Denoise based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n If the mask is below the ‘dark’ threshold, then the Denoise will be applied progressively.\n if the mask is above the ‘light’ threshold, then the Denoise will be applied progressively.\n Between the two, the image settings without the Denoise will be maintained. +TP_LOCALLAB_MASKDE_TOOLTIP;Used to direct the Denoise based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n If the mask is below the ‘dark’ threshold, then the Denoise will be applied progressively.\n if the mask is above the ‘light’ threshold, then the Denoise will be applied progressively.\n Between the two, the image settings without the Denoise will be maintained, unless you act on the slider "Gray area denoise". TP_LOCALLAB_MASKGF_TOOLTIP;Used to direct the Guided Filter based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n If the mask is below the ‘dark’ threshold, then the GF will be applied progressively.\n if the mask is above the ‘light’ threshold, then the GF will be applied progressively.\n Between the two, the image settings without the GF will be maintained. TP_LOCALLAB_MASKRECOL_TOOLTIP;Used to modulate the effect of the Color and Light settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Color and Light settings \n In between these two areas, the full value of the Color and Light settings will be applied TP_LOCALLAB_MASKDEINV_TOOLTIP;Reverses the way the algorithm interprets the mask.\nIf checked black and very light areas will be decreased. @@ -2792,6 +2793,7 @@ TP_LOCALLAB_MASKLNOISELOW;Reinforce denoise in dark and light areas TP_LOCALLAB_MASKLOWTHRES_TOOLTIP;Dark-tone limit below which 'Guided Filter' will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESD_TOOLTIP;Dark-tone limit below which denoise will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESC_TOOLTIP;Dark-tone limit below which Color and Light will be restored progressively to their original values prior to being modified by the Color and Light settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKLCTHRMID;Gray area denoise TP_LOCALLAB_MASKUSABLE;Mask enabled (Mask & modifications) TP_LOCALLAB_MASKUNUSABLE;Mask disabled (Mask & modifications) TP_LOCALLAB_MASKRECOTHRES;Recovery threshold diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 79cb1b938..642e1e772 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -584,6 +584,7 @@ struct local_params { float higthr; float recothrd; float lowthrd; + float midthrd; float higthrd; float decayd; float recothrc; @@ -1043,6 +1044,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall float local_higthr = (float)locallab.spots.at(sp).higthres; float local_recothrd = (float)locallab.spots.at(sp).recothresd; float local_lowthrd = (float)locallab.spots.at(sp).lowthresd; + float local_midthrd = (float)locallab.spots.at(sp).midthresd; float local_higthrd = (float)locallab.spots.at(sp).higthresd; float local_decayd = (float)locallab.spots.at(sp).decayd; float local_recothrc = (float)locallab.spots.at(sp).recothresc; @@ -1400,6 +1402,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.lowthr = local_lowthr; lp.higthr = local_higthr; lp.recothrd = local_recothrd; + lp.midthrd = local_midthrd; lp.lowthrd = local_lowthrd; lp.higthrd = local_higthrd; lp.decayd = local_decayd; @@ -9449,6 +9452,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl float low = lp.lowthrd; float lowc; calcdif(low, lowc); + float mid = 0.01f * lp.midthrd; if(higc < lowc) { higc = lowc + 0.01f; @@ -9469,9 +9473,9 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if (lM < 327.68f * lowc) { masklum[ir][jr] = alow * lmr + blow; } else if (lM < 327.68f * higc) { - + masklum[ir][jr] = (1.f - mid); } else { - masklum[ir][jr] = ahigh * lmr + bhigh; + masklum[ir][jr] = ahigh * lmr + bhigh; } float k = masklum[ir][jr]; if(lp.invmaskd == true) { @@ -10136,6 +10140,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl float low = lp.lowthrd; float lowc; calcdif(low, lowc); + float mid = 0.01f * lp.midthrd; if(higc < lowc) { higc = lowc + 0.01f; @@ -10158,6 +10163,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if (lM < 327.68f * lowc) { masklum[y-ystart][x-xstart] = alow * lmr + blow; } else if (lM < 327.68f * higc) { + masklum[y-ystart][x-xstart] = 1.f - mid; } else { masklum[y-ystart][x-xstart] = ahigh * lmr + bhigh; diff --git a/rtengine/procevents.h b/rtengine/procevents.h index efe7d5b33..06c3c50da 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -1022,6 +1022,7 @@ enum ProcEventCode { Evlocallablowthresc = 996, Evlocallabhigthresc = 997, Evlocallabdecayc = 998, + Evlocallabmidthresd = 999, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index a53f2eb69..8e30a6e5c 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3307,6 +3307,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : higthres(85.), recothresd(1.), lowthresd(12.), + midthresd(0.), higthresd(85.), decayd(2.), isogr(400), @@ -4364,6 +4365,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && higthres == other.higthres && recothresd == other.recothresd && lowthresd == other.lowthresd + && midthresd == other.midthresd && higthresd == other.higthresd && decayd == other.decayd && isogr == other.isogr @@ -5963,6 +5965,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->higthres, "Locallab", "Higthres_" + index_str, spot.higthres, keyFile); saveToKeyfile(!pedited || spot_edited->recothresd, "Locallab", "Recothresd_" + index_str, spot.recothresd, keyFile); saveToKeyfile(!pedited || spot_edited->lowthresd, "Locallab", "Lowthresd_" + index_str, spot.lowthresd, keyFile); + saveToKeyfile(!pedited || spot_edited->midthresd, "Locallab", "Midthresd_" + index_str, spot.midthresd, keyFile); saveToKeyfile(!pedited || spot_edited->higthresd, "Locallab", "Higthresd_" + index_str, spot.higthresd, keyFile); saveToKeyfile(!pedited || spot_edited->decayd, "Locallab", "Decayd_" + index_str, spot.decayd, keyFile); saveToKeyfile(!pedited || spot_edited->isogr, "Locallab", "Isogr_" + index_str, spot.isogr, keyFile); @@ -7778,6 +7781,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Higthres_" + index_str, pedited, spot.higthres, spotEdited.higthres); assignFromKeyfile(keyFile, "Locallab", "Recothresd_" + index_str, pedited, spot.recothresd, spotEdited.recothresd); assignFromKeyfile(keyFile, "Locallab", "Lowthresd_" + index_str, pedited, spot.lowthresd, spotEdited.lowthresd); + assignFromKeyfile(keyFile, "Locallab", "Midthresd_" + index_str, pedited, spot.midthresd, spotEdited.midthresd); assignFromKeyfile(keyFile, "Locallab", "Higthresd_" + index_str, pedited, spot.higthresd, spotEdited.higthresd); assignFromKeyfile(keyFile, "Locallab", "Decayd_" + index_str, pedited, spot.decayd, spotEdited.decayd); assignFromKeyfile(keyFile, "Locallab", "Isogr_" + index_str, pedited, spot.isogr, spotEdited.isogr); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 451467b1a..368b7e5e7 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1214,6 +1214,7 @@ struct LocallabParams { double higthres; double recothresd; double lowthresd; + double midthresd; double higthresd; double decayd; int isogr; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 1705f8d6f..127acfb8a 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -1025,7 +1025,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabrecothresc LUMINANCECURVE, // Evlocallablowthresc LUMINANCECURVE, // Evlocallabhigthresc - LUMINANCECURVE // Evlocallabdecayc + LUMINANCECURVE, // Evlocallabdecayc + LUMINANCECURVE // Evlocallabmidthresd }; diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 71e293c96..2641d404e 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -5912,6 +5912,7 @@ LocallabBlur::LocallabBlur(): expdenoise3(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI2_EXP")))), recothresd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKRECOTHRES"), 1., 2., 0.01, 1.))), lowthresd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 80., 0.5, 12.))), + midthresd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRMID"), 0., 100., 0.5, 0.))), higthresd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 20., 99., 0.5, 85.))), decayd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKDDECAY"), 0.5, 4., 0.1, 2.))), invmaskd(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVMASK")))), @@ -6080,6 +6081,7 @@ LocallabBlur::LocallabBlur(): setExpandAlignProperties(expdenoise3, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); recothresd->setAdjusterListener(this); lowthresd->setAdjusterListener(this); + midthresd->setAdjusterListener(this); higthresd->setAdjusterListener(this); decayd->setAdjusterListener(this); @@ -6237,6 +6239,7 @@ LocallabBlur::LocallabBlur(): wavBox3->pack_start(*maskunusable3, Gtk::PACK_SHRINK, 0); wavBox3->pack_start(*recothresd); wavBox3->pack_start(*lowthresd); + wavBox3->pack_start(*midthresd); wavBox3->pack_start(*higthresd); wavBox3->pack_start(*decayd); wavBox3->pack_start(*invmaskd); @@ -6361,6 +6364,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) sensiden->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP")); lowthres->set_tooltip_text(M("TP_LOCALLAB_MASKLOWTHRES_TOOLTIP")); lowthresd->set_tooltip_text(M("TP_LOCALLAB_MASKLOWTHRESD_TOOLTIP")); +// midthresd->set_tooltip_text(M("TP_LOCALLAB_MASKMIDTHRESD_TOOLTIP")); higthresd->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRESD_TOOLTIP")); higthres->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRES_TOOLTIP")); decayd->set_tooltip_text(M("TP_LOCALLAB_MASKDECAY_TOOLTIP")); @@ -6424,6 +6428,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) lowthresd->set_tooltip_text(""); higthresd->set_tooltip_text(""); higthres->set_tooltip_text(""); +// midthresd->set_tooltip_text(""); decayd->set_tooltip_text(""); } @@ -6453,6 +6458,7 @@ void LocallabBlur::neutral_pressed () invmask->set_active(defSpot.invmask); recothresd->setValue(defSpot.recothresd); lowthresd->setValue(defSpot.lowthresd); + midthresd->setValue(defSpot.midthresd); higthresd->setValue(defSpot.higthresd); decayd->setValue(defSpot.decayd); recothres->setValue(defSpot.recothres); @@ -6572,6 +6578,7 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params sensibn->setValue((double)spot.sensibn); recothresd->setValue((double)spot.recothresd); lowthresd->setValue((double)spot.lowthresd); + midthresd->setValue((double)spot.midthresd); higthresd->setValue((double)spot.higthresd); decayd->setValue((double)spot.decayd); @@ -6706,6 +6713,7 @@ void LocallabBlur::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.sensibn = sensibn->getIntValue(); spot.recothresd = recothresd->getValue(); spot.lowthresd = lowthresd->getValue(); + spot.midthresd = midthresd->getValue(); spot.higthresd = higthresd->getValue(); spot.decayd = decayd->getValue(); @@ -6803,6 +6811,7 @@ void LocallabBlur::setDefaults(const rtengine::procparams::ProcParams* defParams sensibn->setDefault((double)defSpot.sensibn); recothresd->setDefault((double)defSpot.recothresd); lowthresd->setDefault((double)defSpot.lowthresd); + midthresd->setDefault((double)defSpot.midthresd); higthresd->setDefault((double)defSpot.higthresd); decayd->setDefault((double)defSpot.decayd); noiselumf0->setDefault(defSpot.noiselumf0); @@ -6942,6 +6951,13 @@ void LocallabBlur::adjusterChanged(Adjuster* a, double newval) } } + if (a == midthresd) { + if (listener) { + listener->panelChanged(Evlocallabmidthresd, + midthresd->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + if (a == higthresd) { if (listener) { listener->panelChanged(Evlocallabhigthresd, @@ -7295,6 +7311,7 @@ void LocallabBlur::convertParamToSimple() invmask->set_active(defSpot.invmask); recothresd->setValue(defSpot.recothresd); lowthresd->setValue(defSpot.lowthresd); + midthresd->setValue(defSpot.midthresd); higthresd->setValue(defSpot.higthresd); decayd->setValue(defSpot.decayd); recothres->setValue(defSpot.recothres); diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index 6d3bb9b50..03f6c0b5e 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -703,6 +703,7 @@ private: MyExpander* const expdenoise3; Adjuster* const recothresd; Adjuster* const lowthresd; + Adjuster* const midthresd; Adjuster* const higthresd; Adjuster* const decayd; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index cc5e3ef59..3a47da11a 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1285,6 +1285,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).higthres = locallab.spots.at(j).higthres && pSpot.higthres == otherSpot.higthres; locallab.spots.at(j).recothresd = locallab.spots.at(j).recothresd && pSpot.recothresd == otherSpot.recothresd; locallab.spots.at(j).lowthresd = locallab.spots.at(j).lowthresd && pSpot.lowthresd == otherSpot.lowthresd; + locallab.spots.at(j).midthresd = locallab.spots.at(j).midthresd && pSpot.midthresd == otherSpot.midthresd; locallab.spots.at(j).higthresd = locallab.spots.at(j).higthresd && pSpot.higthresd == otherSpot.higthresd; locallab.spots.at(j).decayd = locallab.spots.at(j).decayd && pSpot.decayd == otherSpot.decayd; locallab.spots.at(j).isogr = locallab.spots.at(j).isogr && pSpot.isogr == otherSpot.isogr; @@ -4073,6 +4074,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).lowthresd = mods.locallab.spots.at(i).lowthresd; } + if (locallab.spots.at(i).midthresd) { + toEdit.locallab.spots.at(i).midthresd = mods.locallab.spots.at(i).midthresd; + } + if (locallab.spots.at(i).higthresd) { toEdit.locallab.spots.at(i).higthresd = mods.locallab.spots.at(i).higthresd; } @@ -6654,6 +6659,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : higthres(v), recothresd(v), lowthresd(v), + midthresd(v), higthresd(v), decayd(v), isogr(v), @@ -7186,6 +7192,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) higthres = v; recothresd = v; lowthresd = v; + midthresd = v; higthresd = v; decayd = v; isogr = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index d48f251db..5d4047d3e 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -622,6 +622,7 @@ public: bool higthres; bool recothresd; bool lowthresd; + bool midthresd; bool higthresd; bool decayd; bool isogr; From f61ebbccd2333311b0a8cf1c1f9e884c0ba299ec Mon Sep 17 00:00:00 2001 From: Desmis Date: Thu, 31 Dec 2020 09:08:48 +0100 Subject: [PATCH 034/129] Added forgotten avoid color shift --- rtengine/iplocallab.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 642e1e772..38b17b2ab 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -10577,6 +10577,7 @@ void ImProcFunctions::Lab_Local( constexpr int del = 3; // to avoid crash with [loy - begy] and [lox - begx] and bfh bfw // with gtk2 [loy - begy-1] [lox - begx -1 ] and del = 1 struct local_params lp; calcLocalParams(sp, oW, oH, params->locallab, lp, prevDeltaE, llColorMask, llColorMaskinv, llExpMask, llExpMaskinv, llSHMask, llSHMaskinv, llvibMask, lllcMask, llsharMask, llcbMask, llretiMask, llsoftMask, lltmMask, llblMask, lllogMask, ll_Mask, locwavCurveden, locwavdenutili); + avoidcolshi(lp, sp, original, transformed, cy, cx); const float radius = lp.rad / (sk * 1.4f); //0 to 70 ==> see skip int levred; From b8d5a3d9fbee253883437d94b494f174fb30fdad Mon Sep 17 00:00:00 2001 From: Desmis Date: Fri, 1 Jan 2021 12:05:33 +0100 Subject: [PATCH 035/129] Local adjustments - Log encoding - Recovery based on mask luminance (#6038) * GUI for recovery mask - Log encoding * Enable recovery Log encoding with luminance mask --- rtdata/languages/default | 8 +++ rtengine/hilite_recon.cc | 5 +- rtengine/iplocallab.cc | 88 +++++++++++++++++++++++++++++ rtengine/procevents.h | 4 ++ rtengine/procparams.cc | 16 ++++++ rtengine/procparams.h | 4 ++ rtengine/refreshmap.cc | 6 +- rtgui/locallabtools.h | 8 +++ rtgui/locallabtools2.cc | 119 +++++++++++++++++++++++++++++++++++++++ rtgui/paramsedited.cc | 28 +++++++++ rtgui/paramsedited.h | 4 ++ 11 files changed, 288 insertions(+), 2 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 78db75169..cbcdebac3 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1245,6 +1245,10 @@ HISTORY_MSG_997;Local - Color threshold mask low HISTORY_MSG_998;Local - Color threshold mask high HISTORY_MSG_999;Local - Color decay HISTORY_MSG_1000;Local - Denoise gray +HISTORY_MSG_1001;Local - Log recovery threshold +HISTORY_MSG_1002;Local - Log threshold mask low +HISTORY_MSG_1003;Local - Log threshold mask high +HISTORY_MSG_1004;Local - Log decay HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance @@ -2783,8 +2787,10 @@ TP_LOCALLAB_MASKLC_TOOLTIP;This allows you to target the denoise based on the im TP_LOCALLAB_MASKDE_TOOLTIP;Used to direct the Denoise based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n If the mask is below the ‘dark’ threshold, then the Denoise will be applied progressively.\n if the mask is above the ‘light’ threshold, then the Denoise will be applied progressively.\n Between the two, the image settings without the Denoise will be maintained, unless you act on the slider "Gray area denoise". TP_LOCALLAB_MASKGF_TOOLTIP;Used to direct the Guided Filter based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n If the mask is below the ‘dark’ threshold, then the GF will be applied progressively.\n if the mask is above the ‘light’ threshold, then the GF will be applied progressively.\n Between the two, the image settings without the GF will be maintained. TP_LOCALLAB_MASKRECOL_TOOLTIP;Used to modulate the effect of the Color and Light settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Color and Light settings \n In between these two areas, the full value of the Color and Light settings will be applied +TP_LOCALLAB_MASKRELOG_TOOLTIP;Used to modulate the effect of the Log encoding settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Log encoding settings - can be used to restore highlights reconstructed by Color propagation \n In between these two areas, the full value of the Log encoding settings will be applied TP_LOCALLAB_MASKDEINV_TOOLTIP;Reverses the way the algorithm interprets the mask.\nIf checked black and very light areas will be decreased. TP_LOCALLAB_MASKHIGTHRESC_TOOLTIP;Light-tone limit above which Color and Light will be restored progressively to their original values prior to being modified by the Color and Light settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKHIGTHRESL_TOOLTIP;Light-tone limit above which Log encoding will be restored progressively to their original values prior to being modified by the Log encoding settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESD_TOOLTIP;Light-tone limit above which denoise will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRES_TOOLTIP;Light-tone limit above which 'Guided Filter' will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLCTHR;Light area luminance threshold @@ -2793,6 +2799,8 @@ TP_LOCALLAB_MASKLNOISELOW;Reinforce denoise in dark and light areas TP_LOCALLAB_MASKLOWTHRES_TOOLTIP;Dark-tone limit below which 'Guided Filter' will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESD_TOOLTIP;Dark-tone limit below which denoise will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESC_TOOLTIP;Dark-tone limit below which Color and Light will be restored progressively to their original values prior to being modified by the Color and Light settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKLOWTHRESL_TOOLTIP;Dark-tone limit below which Log encoding will be restored progressively to their original values prior to being modified by the Log encoding settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 + TP_LOCALLAB_MASKLCTHRMID;Gray area denoise TP_LOCALLAB_MASKUSABLE;Mask enabled (Mask & modifications) TP_LOCALLAB_MASKUNUSABLE;Mask disabled (Mask & modifications) diff --git a/rtengine/hilite_recon.cc b/rtengine/hilite_recon.cc index 1a4c4c7f4..6c41ad5ae 100644 --- a/rtengine/hilite_recon.cc +++ b/rtengine/hilite_recon.cc @@ -32,6 +32,8 @@ #include "opthelper.h" #include "rawimagesource.h" #include "rt_math.h" +#define BENCHMARK +#include "StopWatch.h" namespace { @@ -289,7 +291,8 @@ namespace rtengine { void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue) -{ +{ + BENCHFUN double progress = 0.0; if (plistener) { diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 38b17b2ab..9fe6421a3 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -591,6 +591,10 @@ struct local_params { float lowthrc; float higthrc; float decayc; + float recothrl; + float lowthrl; + float higthrl; + float decayl; int noiselequal; float noisechrodetail; float bilat; @@ -1051,6 +1055,10 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall float local_lowthrc = (float)locallab.spots.at(sp).lowthresc; float local_higthrc = (float)locallab.spots.at(sp).higthresc; float local_decayc = (float)locallab.spots.at(sp).decayc; + float local_recothrl = (float)locallab.spots.at(sp).recothresl; + float local_lowthrl = (float)locallab.spots.at(sp).lowthresl; + float local_higthrl = (float)locallab.spots.at(sp).higthresl; + float local_decayl = (float)locallab.spots.at(sp).decayl; float local_noisecf = ((float)locallab.spots.at(sp).noisechrof) / 10.f; float local_noisecc = ((float)locallab.spots.at(sp).noisechroc) / 10.f; @@ -1410,6 +1418,10 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.lowthrc = local_lowthrc; lp.higthrc = local_higthrc; lp.decayc = local_decayc; + lp.recothrl = local_recothrl; + lp.lowthrl = local_lowthrl; + lp.higthrl = local_higthrl; + lp.decayl = local_decayl; lp.noiselequal = local_noiselequal; lp.noisechrodetail = local_noisechrodetail; lp.noiselc = local_noiselc; @@ -10818,6 +10830,82 @@ void ImProcFunctions::Lab_Local( } } + + if(lp.enaLMask && lp.recothrl != 1.f) { + LabImage tmp3(bfw, bfh); + + for (int y = 0; y < bfh; y++){ + for (int x = 0; x < bfw; x++) { + tmp3.L[y][x] = original->L[y + ystart][x + xstart]; + tmp3.a[y][x] = original->a[y + ystart][x + xstart]; + tmp3.b[y][x] = original->b[y + ystart][x + xstart]; + } + } + array2D masklum; + masklum(bfw, bfh); + for (int ir = 0; ir < bfh; ir++) + for (int jr = 0; jr < bfw; jr++) { + masklum[ir][jr] = 1.f; + } + + float hig = lp.higthrl; + float higc; + calcdif(hig, higc); + float low = lp.lowthrl; + float lowc; + calcdif(low, lowc); + + if(higc < lowc) { + higc = lowc + 0.01f; + } + float th = (lp.recothrl - 1.f); + float ahigh = th / (higc - 100.f); + float bhigh = 1.f - higc * ahigh; + + float alow = th / lowc; + float blow = 1.f - th; + bool invmaskl = false; +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + for (int ir = 0; ir < bfh; ir++) + for (int jr = 0; jr < bfw; jr++) { + const float lM = bufmaskoriglog->L[ir][jr]; + const float lmr = lM / 327.68f; + if (lM < 327.68f * lowc) { + masklum[ir][jr] = alow * lmr + blow; + } else if (lM < 327.68f * higc) { + + } else { + masklum[ir][jr] = ahigh * lmr + bhigh; + } + float k = masklum[ir][jr]; + if(invmaskl == false) { + masklum[ir][jr] = 1 - pow(k, lp.decayl); + } else { + masklum[ir][jr] = pow(k, lp.decayl); + } + + } + + for (int i = 0; i < 3; ++i) { + boxblur(masklum, masklum, 10 / sk, bfw, bfh, false); + } + +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + for (int i = 0; i < bfh; ++i) { + for (int j = 0; j < bfw; ++j) { + bufexpfin->L[i][j] = (tmp3.L[i][j] - bufexpfin->L[i][j]) * LIM01(masklum[i][j]) + bufexpfin->L[i][j]; + bufexpfin->a[i][j] = (tmp3.a[i][j] - bufexpfin->a[i][j]) * LIM01(masklum[i][j]) + bufexpfin->a[i][j]; + bufexpfin->b[i][j] = (tmp3.b[i][j] - bufexpfin->b[i][j]) * LIM01(masklum[i][j]) + bufexpfin->b[i][j]; + } + } + masklum.free(); + + } + //end graduated transit_shapedetect2(call, 11, bufexporig.get(), bufexpfin.get(), originalmasklog.get(), hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); } diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 06c3c50da..8bad0a588 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -1023,6 +1023,10 @@ enum ProcEventCode { Evlocallabhigthresc = 997, Evlocallabdecayc = 998, Evlocallabmidthresd = 999, + Evlocallabrecothresl = 1000, + Evlocallablowthresl = 1001, + Evlocallabhigthresl = 1002, + Evlocallabdecayl = 1003, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 8e30a6e5c..3698518ee 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -4017,6 +4017,10 @@ LocallabParams::LocallabSpot::LocallabSpot() : 1.0, 1.0 }, + recothresl(1.), + lowthresl(12.), + higthresl(85.), + decayl(2.), // mask visimask(false), complexmask(0), @@ -4636,6 +4640,10 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && radmaskL == other.radmaskL && chromaskL == other.chromaskL && LmaskcurveL == other.LmaskcurveL + && recothresl == other.recothresl + && lowthresl == other.lowthresl + && higthresl == other.higthresl + && decayl == other.decayl // mask && visimask == other.visimask @@ -6238,6 +6246,10 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->radmaskL, "Locallab", "radmaskL_" + index_str, spot.radmaskL, keyFile); saveToKeyfile(!pedited || spot_edited->chromaskL, "Locallab", "chromaskL_" + index_str, spot.chromaskL, keyFile); saveToKeyfile(!pedited || spot_edited->LmaskcurveL, "Locallab", "LmaskCurveL_" + index_str, spot.LmaskcurveL, keyFile); + saveToKeyfile(!pedited || spot_edited->recothresl, "Locallab", "Recothresl_" + index_str, spot.recothresl, keyFile); + saveToKeyfile(!pedited || spot_edited->lowthresl, "Locallab", "Lowthresl_" + index_str, spot.lowthresl, keyFile); + saveToKeyfile(!pedited || spot_edited->higthresl, "Locallab", "Higthresl_" + index_str, spot.higthresl, keyFile); + saveToKeyfile(!pedited || spot_edited->decayl, "Locallab", "Decayl_" + index_str, spot.decayl, keyFile); } //mask @@ -8092,6 +8104,10 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "radmaskL_" + index_str, pedited, spot.radmaskL, spotEdited.radmaskL); assignFromKeyfile(keyFile, "Locallab", "chromaskL_" + index_str, pedited, spot.chromaskL, spotEdited.chromaskL); assignFromKeyfile(keyFile, "Locallab", "LmaskCurveL_" + index_str, pedited, spot.LmaskcurveL, spotEdited.LmaskcurveL); + assignFromKeyfile(keyFile, "Locallab", "Recothresl_" + index_str, pedited, spot.recothresl, spotEdited.recothresl); + assignFromKeyfile(keyFile, "Locallab", "Lowthresl_" + index_str, pedited, spot.lowthresl, spotEdited.lowthresl); + assignFromKeyfile(keyFile, "Locallab", "Higthresl_" + index_str, pedited, spot.higthresl, spotEdited.higthresl); + assignFromKeyfile(keyFile, "Locallab", "Decayl_" + index_str, pedited, spot.decayl, spotEdited.decayl); // mask spot.visimask = assignFromKeyfile(keyFile, "Locallab", "Expmask_" + index_str, pedited, spot.expmask, spotEdited.expmask); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 368b7e5e7..fd5726646 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1477,6 +1477,10 @@ struct LocallabParams { double radmaskL; double chromaskL; std::vector LmaskcurveL; + double recothresl; + double lowthresl; + double higthresl; + double decayl; // mask bool visimask; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 127acfb8a..d97dc1ce2 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -1026,7 +1026,11 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallablowthresc LUMINANCECURVE, // Evlocallabhigthresc LUMINANCECURVE, // Evlocallabdecayc - LUMINANCECURVE // Evlocallabmidthresd + LUMINANCECURVE, // Evlocallabmidthresd + LUMINANCECURVE, // Evlocallabrecothresl + LUMINANCECURVE, // Evlocallablowthresl + LUMINANCECURVE, // Evlocallabhigthresl + LUMINANCECURVE // Evlocallabdecayl }; diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index 03f6c0b5e..56b4e0b20 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -1269,6 +1269,14 @@ private: Gtk::HBox* const surrHBox; Adjuster* const baselog; + MyExpander* const exprecovl; + Gtk::Label* const maskusablel; + Gtk::Label* const maskunusablel; + Adjuster* const recothresl; + Adjuster* const lowthresl; + Adjuster* const higthresl; + Adjuster* const decayl; + Adjuster* const sensilog; Gtk::Frame* const gradlogFrame; Adjuster* const strlog; diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index aa08fe86d..8e71bb7f2 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -4658,6 +4658,14 @@ LocallabLog::LocallabLog(): surround(Gtk::manage (new MyComboBoxText ())), surrHBox(Gtk::manage(new Gtk::HBox())), baselog(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BASELOG"), 1.3, 3., 0.05, 2.))),//, Gtk::manage(new RTImage("circle-black-small.png")), Gtk::manage(new RTImage("circle-white-small.png"))))), + exprecovl(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI2_EXP")))), + maskusablel(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUSABLE")))), + maskunusablel(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUNUSABLE")))), + recothresl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKRECOTHRES"), 1., 2., 0.01, 1.))), + lowthresl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 80., 0.5, 12.))), + higthresl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 20., 99., 0.5, 85.))), + decayl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKDDECAY"), 0.5, 4., 0.1, 2.))), + sensilog(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 60))), gradlogFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRADLOGFRA")))), strlog(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADSTR"), -2.0, 2.0, 0.05, 0.))), @@ -4731,6 +4739,11 @@ LocallabLog::LocallabLog(): targabs->setAdjusterListener(this); baselog->setAdjusterListener(this); + recothresl->setAdjusterListener(this); + lowthresl->setAdjusterListener(this); + higthresl->setAdjusterListener(this); + decayl->setAdjusterListener(this); + setExpandAlignProperties(exprecovl, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); sensilog->setAdjusterListener(this); @@ -4850,6 +4863,16 @@ LocallabLog::LocallabLog(): logP2Box->pack_start(*targabs); logP2Box->pack_start(*catad); logP2Box->pack_start (*surrHBox); + ToolParamBlock* const logBox3 = Gtk::manage(new ToolParamBlock()); + logBox3->pack_start(*maskusablel, Gtk::PACK_SHRINK, 0); + logBox3->pack_start(*maskunusablel, Gtk::PACK_SHRINK, 0); + logBox3->pack_start(*recothresl); + logBox3->pack_start(*lowthresl); + logBox3->pack_start(*higthresl); + logBox3->pack_start(*decayl); + // colBox3->pack_start(*invmaskc); + exprecovl->add(*logBox3, false); + ToolParamBlock* const logP3Box = Gtk::manage(new ToolParamBlock()); logP3Box->pack_start(*showmaskLMethod, Gtk::PACK_SHRINK, 4); logP3Box->pack_start(*enaLMask, Gtk::PACK_SHRINK, 0); @@ -4863,6 +4886,7 @@ LocallabLog::LocallabLog(): log2Frame->add(*logP2Box); pack_start(*log2Frame); + pack_start(*exprecovl, false, false); // pack_start(*baselog); pack_start(*sensilog); @@ -4887,6 +4911,7 @@ LocallabLog::~LocallabLog() void LocallabLog::setDefaultExpanderVisibility() { + exprecovl->set_expanded(false); expmaskL->set_expanded(false); expL->set_expanded(false); @@ -4905,6 +4930,7 @@ void LocallabLog::updateAdviceTooltips(const bool showTooltips) Autogray->set_tooltip_text(M("TP_LOCALLAB_LOGAUTOGRAY_TOOLTIP")); // blackEv->set_tooltip_text(M("TP_LOCALLAB_LOGBLACKWHEV_TOOLTIP")); // whiteEv->set_tooltip_text(M("TP_LOCALLAB_LOGBLACKWHEV_TOOLTIP")); + exprecovl->set_tooltip_markup(M("TP_LOCALLAB_MASKRELOG_TOOLTIP")); blackEv->set_tooltip_text(""); whiteEv->set_tooltip_text(""); sourceGray->set_tooltip_text(""); @@ -4934,6 +4960,9 @@ void LocallabLog::updateAdviceTooltips(const bool showTooltips) chromaskL->set_tooltip_text(M("TP_LOCALLAB_CHROMASK_TOOLTIP")); // mask2CurveEditorL->set_tooltip_text(M("TP_LOCALLAB_CONTRASTCURVMASK_TOOLTIP")); LmaskshapeL->setTooltip(M("TP_LOCALLAB_LMASK_LL_TOOLTIP")); + decayl->set_tooltip_text(M("TP_LOCALLAB_MASKDECAY_TOOLTIP")); + lowthresl->set_tooltip_text(M("TP_LOCALLAB_MASKLOWTHRESL_TOOLTIP")); + higthresl->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRESL_TOOLTIP")); } else { @@ -4943,6 +4972,7 @@ void LocallabLog::updateAdviceTooltips(const bool showTooltips) logFrame->set_tooltip_text(""); log1Frame->set_tooltip_text(""); log2Frame->set_tooltip_text(""); + exprecovl->set_tooltip_markup(""); autocompute->set_tooltip_text(""); blackEv->set_tooltip_text(""); whiteEv->set_tooltip_text(""); @@ -4974,6 +5004,9 @@ void LocallabLog::updateAdviceTooltips(const bool showTooltips) chromaskL->set_tooltip_text(""); mask2CurveEditorL->set_tooltip_text(""); LmaskshapeL->setTooltip(""); + decayl->set_tooltip_text(""); + lowthresl->set_tooltip_text(""); + higthresl->set_tooltip_text(""); } } @@ -5068,6 +5101,10 @@ void LocallabLog::read(const rtengine::procparams::ProcParams* pp, const ParamsE } else if (spot.surround == "ExtremelyDark") { surround->set_active (3); } + recothresl->setValue((double)spot.recothresl); + lowthresl->setValue((double)spot.lowthresl); + higthresl->setValue((double)spot.higthresl); + decayl->setValue((double)spot.decayl); ciecam->set_active(spot.ciecam); fullimage->set_active(spot.fullimage); @@ -5158,6 +5195,11 @@ void LocallabLog::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedi spot.chromaskL = chromaskL->getValue(); spot.LmaskcurveL = LmaskshapeL->getCurve(); + spot.recothresl = recothresl->getValue(); + spot.lowthresl = lowthresl->getValue(); + spot.higthresl = higthresl->getValue(); + spot.decayl = decayl->getValue(); + if (sursour->get_active_row_number() == 0) { spot.sursour = "Average"; } else if (sursour->get_active_row_number() == 1) { @@ -5181,6 +5223,15 @@ void LocallabLog::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedi void LocallabLog::enaLMaskChanged() { + if (enaLMask->get_active()) { + maskusablel->show(); + maskunusablel->hide(); + + } else { + maskusablel->hide(); + maskunusablel->show(); + } + if (isLocActivated && exp->getEnabled()) { if (listener) { if (enaLMask->get_active()) { @@ -5218,6 +5269,10 @@ void LocallabLog::updateGUIToMode(const modeType new_type) surHBox->hide(); expmaskL->hide(); gradlogFrame->hide(); + exprecovl->hide(); + maskusablel->hide(); + maskunusablel->hide(); + decayl->hide(); break; case Normal: @@ -5239,6 +5294,17 @@ void LocallabLog::updateGUIToMode(const modeType new_type) surHBox->hide(); expmaskL->hide(); gradlogFrame->show(); + if (enaLMask->get_active()) { + maskusablel->show(); + maskunusablel->hide(); + + } else { + maskusablel->hide(); + maskunusablel->show(); + } + + exprecovl->show(); + decayl->hide(); break; @@ -5260,6 +5326,16 @@ void LocallabLog::updateGUIToMode(const modeType new_type) expmaskL->show(); gradlogFrame->show(); surHBox->show(); + if (enaLMask->get_active()) { + maskusablel->show(); + maskunusablel->hide(); + + } else { + maskusablel->hide(); + maskunusablel->show(); + } + exprecovl->show(); + decayl->show(); } } @@ -5282,6 +5358,10 @@ void LocallabLog::convertParamToSimple() strlog->setValue(defSpot.strlog); anglog->setValue(defSpot.anglog); enaLMask->set_active(false); + recothresl->setValue(defSpot.recothresl); + lowthresl->setValue(defSpot.lowthresl); + higthresl->setValue(defSpot.higthresl); + decayl->setValue(defSpot.decayl); // Enable all listeners enableListener(); } @@ -5300,6 +5380,7 @@ void LocallabLog::convertParamToNormal() lightq->setValue(defSpot.lightq); sursour->set_active(0); enaLMask->set_active(false); + decayl->setValue(defSpot.decayl); // Enable all listeners enableListener(); @@ -5392,6 +5473,10 @@ void LocallabLog::setDefaults(const rtengine::procparams::ProcParams* defParams, blendmaskL->setDefault(defSpot.blendmaskL); radmaskL->setDefault(defSpot.radmaskL); chromaskL->setDefault(defSpot.chromaskL); + recothresl->setDefault((double)defSpot.recothresl); + lowthresl->setDefault((double)defSpot.lowthresl); + higthresl->setDefault((double)defSpot.higthresl); + decayl->setDefault((double)defSpot.decayl); } @@ -5515,6 +5600,36 @@ void LocallabLog::adjusterChanged(Adjuster* a, double newval) } } + if (a == recothresl) { + + if (listener) { + listener->panelChanged(Evlocallabrecothresl, + recothresl->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == lowthresl) { + if (listener) { + listener->panelChanged(Evlocallablowthresl, + lowthresl->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == higthresl) { + if (listener) { + listener->panelChanged(Evlocallabhigthresl, + higthresl->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == decayl) { + if (listener) { + listener->panelChanged(Evlocallabdecayl, + decayl->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == sensilog) { if (listener) { listener->panelChanged(Evlocallabsensilog, @@ -5777,6 +5892,10 @@ void LocallabLog::updateLogGUI() sourceabs->hide(); } } + if (mode == Expert || mode == Normal) { // Keep widget hidden in Simple mode + exprecovl->show(); + } + } diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 3a47da11a..d32e75488 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1552,6 +1552,10 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).radmaskL = locallab.spots.at(j).radmaskL && pSpot.radmaskL == otherSpot.radmaskL; locallab.spots.at(j).chromaskL = locallab.spots.at(j).chromaskL && pSpot.chromaskL == otherSpot.chromaskL; locallab.spots.at(j).LmaskcurveL = locallab.spots.at(j).LmaskcurveL && pSpot.LmaskcurveL == otherSpot.LmaskcurveL; + locallab.spots.at(j).recothresl = locallab.spots.at(j).recothresl && pSpot.recothresl == otherSpot.recothresl; + locallab.spots.at(j).lowthresl = locallab.spots.at(j).lowthresl && pSpot.lowthresl == otherSpot.lowthresl; + locallab.spots.at(j).higthresl = locallab.spots.at(j).higthresl && pSpot.higthresl == otherSpot.higthresl; + locallab.spots.at(j).decayl = locallab.spots.at(j).decayl && pSpot.decayl == otherSpot.decayl; //mask @@ -5112,6 +5116,22 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).LmaskcurveL = mods.locallab.spots.at(i).LmaskcurveL; } + if (locallab.spots.at(i).recothresl) { + toEdit.locallab.spots.at(i).recothresl = mods.locallab.spots.at(i).recothresl; + } + + if (locallab.spots.at(i).lowthresl) { + toEdit.locallab.spots.at(i).lowthresl = mods.locallab.spots.at(i).lowthresl; + } + + if (locallab.spots.at(i).higthresl) { + toEdit.locallab.spots.at(i).higthresl = mods.locallab.spots.at(i).higthresl; + } + + if (locallab.spots.at(i).decayl) { + toEdit.locallab.spots.at(i).decayl = mods.locallab.spots.at(i).decayl; + } + // mask if (locallab.spots.at(i).visimask) { toEdit.locallab.spots.at(i).visimask = mods.locallab.spots.at(i).visimask; @@ -6922,6 +6942,10 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : radmaskL(v), chromaskL(v), LmaskcurveL(v), + recothresl(v), + lowthresl(v), + higthresl(v), + decayl(v), // mask visimask(v), complexmask(v), @@ -7458,6 +7482,10 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) radmaskL = v; chromaskL = v; LmaskcurveL = v; + recothresl = v; + lowthresl = v; + higthresl = v; + decayl = v; // mask visimask = v; complexmask = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 5d4047d3e..70eb19f75 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -885,6 +885,10 @@ public: bool radmaskL; bool chromaskL; bool LmaskcurveL; + bool recothresl; + bool lowthresl; + bool higthresl; + bool decayl; //mask bool visimask; bool complexmask; From cc7f1ecdab343cf96ba3ffe2aad095ebf7d56535 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Mon, 4 Jan 2021 10:37:48 +0100 Subject: [PATCH 036/129] Consistent crash during DCB demosaicing, only affecting one camera, fixes #6034 --- rtengine/demosaic_algos.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtengine/demosaic_algos.cc b/rtengine/demosaic_algos.cc index a31415968..85197d766 100644 --- a/rtengine/demosaic_algos.cc +++ b/rtengine/demosaic_algos.cc @@ -972,11 +972,11 @@ inline void RawImageSource::dcb_initTileLimits(int &colMin, int &rowMin, int &co } if( y0 + TILESIZE + TILEBORDER >= H - border) { - rowMax = TILEBORDER + H - border - y0; + rowMax = std::min(TILEBORDER + H - border - y0, rowMax); } if( x0 + TILESIZE + TILEBORDER >= W - border) { - colMax = TILEBORDER + W - border - x0; + colMax = std::min(TILEBORDER + W - border - x0, colMax); } } From 064a79971b57be45d379baa2f69bc15256baa9fa Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Mon, 4 Jan 2021 13:39:29 +0100 Subject: [PATCH 037/129] rcd demosaic: small speedup and reduction of memory usage --- rtengine/rcd_demosaic.cc | 85 +++++++++++++++++++++------------------- 1 file changed, 44 insertions(+), 41 deletions(-) diff --git a/rtengine/rcd_demosaic.cc b/rtengine/rcd_demosaic.cc index c7cf1e68a..c986dd601 100644 --- a/rtengine/rcd_demosaic.cc +++ b/rtengine/rcd_demosaic.cc @@ -84,17 +84,18 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) //Tolerance to avoid dividing by zero constexpr float eps = 1e-5f; constexpr float epssq = 1e-10f; + constexpr float scale = 65536.f; #ifdef _OPENMP #pragma omp parallel #endif { int progresscounter = 0; - float *cfa = (float*) calloc(tileSize * tileSize, sizeof *cfa); - float (*rgb)[tileSize * tileSize] = (float (*)[tileSize * tileSize])malloc(3 * sizeof *rgb); - float *VH_Dir = (float*) calloc(tileSize * tileSize, sizeof *VH_Dir); - float *PQ_Dir = (float*) calloc(tileSize * tileSize, sizeof *PQ_Dir); - float *lpf = PQ_Dir; // reuse buffer, they don't overlap in usage + float *const cfa = (float*) calloc(tileSize * tileSize, sizeof *cfa); + float (*const rgb)[tileSize * tileSize] = (float (*)[tileSize * tileSize])malloc(3 * sizeof *rgb); + float *const VH_Dir = (float*) calloc(tileSize * tileSize, sizeof *VH_Dir); + float *const PQ_Dir = (float*) calloc(tileSize * tileSize / 2, sizeof *PQ_Dir); + float *const lpf = PQ_Dir; // reuse buffer, they don't overlap in usage #ifdef _OPENMP #pragma omp for schedule(dynamic, chunkSize) collapse(2) nowait @@ -117,16 +118,15 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) for (int row = rowStart; row < rowEnd; row++) { int indx = (row - rowStart) * tileSize; - int c0 = fc(cfarray, row, colStart); - int c1 = fc(cfarray, row, colStart + 1); + const int c0 = fc(cfarray, row, colStart); + const int c1 = fc(cfarray, row, colStart + 1); int col = colStart; - for (; col < colEnd - 1; col+=2, indx+=2) { - cfa[indx] = rgb[c0][indx] = LIM01(rawData[row][col] / 65535.f); - cfa[indx + 1] = rgb[c1][indx + 1] = LIM01(rawData[row][col + 1] / 65535.f); + cfa[indx] = rgb[c0][indx] = LIM01(rawData[row][col] / scale); + cfa[indx + 1] = rgb[c1][indx + 1] = LIM01(rawData[row][col + 1] / scale); } if (col < colEnd) { - cfa[indx] = rgb[c0][indx] = LIM01(rawData[row][col] / 65535.f); + cfa[indx] = rgb[c0][indx] = LIM01(rawData[row][col] / scale); } } @@ -138,8 +138,8 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) for (int col = 4, indx = row * tileSize + col; col < tilecols - 4; col++, indx++) { const float cfai = cfa[indx]; //Calculate h/v local discrimination - float V_Stat = max(epssq, -18.f * cfai * (cfa[indx - w1] + cfa[indx + w1] + 2.f * (cfa[indx - w2] + cfa[indx + w2]) - cfa[indx - w3] - cfa[indx + w3]) - 2.f * cfai * (cfa[indx - w4] + cfa[indx + w4] - 19.f * cfai) - cfa[indx - w1] * (70.f * cfa[indx + w1] + 12.f * cfa[indx - w2] - 24.f * cfa[indx + w2] + 38.f * cfa[indx - w3] - 16.f * cfa[indx + w3] - 12.f * cfa[indx - w4] + 6.f * cfa[indx + w4] - 46.f * cfa[indx - w1]) + cfa[indx + w1] * (24.f * cfa[indx - w2] - 12.f * cfa[indx + w2] + 16.f * cfa[indx - w3] - 38.f * cfa[indx + w3] - 6.f * cfa[indx - w4] + 12.f * cfa[indx + w4] + 46.f * cfa[indx + w1]) + cfa[indx - w2] * (14.f * cfa[indx + w2] - 12.f * cfa[indx + w3] - 2.f * cfa[indx - w4] + 2.f * cfa[indx + w4] + 11.f * cfa[indx - w2]) + cfa[indx + w2] * (-12.f * cfa[indx - w3] + 2.f * (cfa[indx - w4] - cfa[indx + w4]) + 11.f * cfa[indx + w2]) + cfa[indx - w3] * (2.f * cfa[indx + w3] - 6.f * cfa[indx - w4] + 10.f * cfa[indx - w3]) + cfa[indx + w3] * (-6.f * cfa[indx + w4] + 10.f * cfa[indx + w3]) + cfa[indx - w4] * cfa[indx - w4] + cfa[indx + w4] * cfa[indx + w4]); - float H_Stat = max(epssq, -18.f * cfai * (cfa[indx - 1] + cfa[indx + 1] + 2.f * (cfa[indx - 2] + cfa[indx + 2]) - cfa[indx - 3] - cfa[indx + 3]) - 2.f * cfai * (cfa[indx - 4] + cfa[indx + 4] - 19.f * cfai) - cfa[indx - 1] * (70.f * cfa[indx + 1] + 12.f * cfa[indx - 2] - 24.f * cfa[indx + 2] + 38.f * cfa[indx - 3] - 16.f * cfa[indx + 3] - 12.f * cfa[indx - 4] + 6.f * cfa[indx + 4] - 46.f * cfa[indx - 1]) + cfa[indx + 1] * (24.f * cfa[indx - 2] - 12.f * cfa[indx + 2] + 16.f * cfa[indx - 3] - 38.f * cfa[indx + 3] - 6.f * cfa[indx - 4] + 12.f * cfa[indx + 4] + 46.f * cfa[indx + 1]) + cfa[indx - 2] * (14.f * cfa[indx + 2] - 12.f * cfa[indx + 3] - 2.f * cfa[indx - 4] + 2.f * cfa[indx + 4] + 11.f * cfa[indx - 2]) + cfa[indx + 2] * (-12.f * cfa[indx - 3] + 2.f * (cfa[indx - 4] - cfa[indx + 4]) + 11.f * cfa[indx + 2]) + cfa[indx - 3] * (2.f * cfa[indx + 3] - 6.f * cfa[indx - 4] + 10.f * cfa[indx - 3]) + cfa[indx + 3] * (-6.f * cfa[indx + 4] + 10.f * cfa[indx + 3]) + cfa[indx - 4] * cfa[indx - 4] + cfa[indx + 4] * cfa[indx + 4]); + float V_Stat = std::max(epssq, -18.f * cfai * (cfa[indx - w1] + cfa[indx + w1] + 2.f * (cfa[indx - w2] + cfa[indx + w2]) - cfa[indx - w3] - cfa[indx + w3]) - 2.f * cfai * (cfa[indx - w4] + cfa[indx + w4] - 19.f * cfai) - cfa[indx - w1] * (70.f * cfa[indx + w1] + 12.f * cfa[indx - w2] - 24.f * cfa[indx + w2] + 38.f * cfa[indx - w3] - 16.f * cfa[indx + w3] - 12.f * cfa[indx - w4] + 6.f * cfa[indx + w4] - 46.f * cfa[indx - w1]) + cfa[indx + w1] * (24.f * cfa[indx - w2] - 12.f * cfa[indx + w2] + 16.f * cfa[indx - w3] - 38.f * cfa[indx + w3] - 6.f * cfa[indx - w4] + 12.f * cfa[indx + w4] + 46.f * cfa[indx + w1]) + cfa[indx - w2] * (14.f * cfa[indx + w2] - 12.f * cfa[indx + w3] - 2.f * cfa[indx - w4] + 2.f * cfa[indx + w4] + 11.f * cfa[indx - w2]) + cfa[indx + w2] * (-12.f * cfa[indx - w3] + 2.f * (cfa[indx - w4] - cfa[indx + w4]) + 11.f * cfa[indx + w2]) + cfa[indx - w3] * (2.f * cfa[indx + w3] - 6.f * cfa[indx - w4] + 10.f * cfa[indx - w3]) + cfa[indx + w3] * (-6.f * cfa[indx + w4] + 10.f * cfa[indx + w3]) + cfa[indx - w4] * cfa[indx - w4] + cfa[indx + w4] * cfa[indx + w4]); + float H_Stat = std::max(epssq, -18.f * cfai * (cfa[indx - 1] + cfa[indx + 1] + 2.f * (cfa[indx - 2] + cfa[indx + 2]) - cfa[indx - 3] - cfa[indx + 3]) - 2.f * cfai * (cfa[indx - 4] + cfa[indx + 4] - 19.f * cfai) - cfa[indx - 1] * (70.f * cfa[indx + 1] + 12.f * cfa[indx - 2] - 24.f * cfa[indx + 2] + 38.f * cfa[indx - 3] - 16.f * cfa[indx + 3] - 12.f * cfa[indx - 4] + 6.f * cfa[indx + 4] - 46.f * cfa[indx - 1]) + cfa[indx + 1] * (24.f * cfa[indx - 2] - 12.f * cfa[indx + 2] + 16.f * cfa[indx - 3] - 38.f * cfa[indx + 3] - 6.f * cfa[indx - 4] + 12.f * cfa[indx + 4] + 46.f * cfa[indx + 1]) + cfa[indx - 2] * (14.f * cfa[indx + 2] - 12.f * cfa[indx + 3] - 2.f * cfa[indx - 4] + 2.f * cfa[indx + 4] + 11.f * cfa[indx - 2]) + cfa[indx + 2] * (-12.f * cfa[indx - 3] + 2.f * (cfa[indx - 4] - cfa[indx + 4]) + 11.f * cfa[indx + 2]) + cfa[indx - 3] * (2.f * cfa[indx + 3] - 6.f * cfa[indx - 4] + 10.f * cfa[indx - 3]) + cfa[indx + 3] * (-6.f * cfa[indx + 4] + 10.f * cfa[indx + 3]) + cfa[indx - 4] * cfa[indx - 4] + cfa[indx + 4] * cfa[indx + 4]); VH_Dir[indx] = V_Stat / (V_Stat + H_Stat); } @@ -151,8 +151,10 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) // Step 2.1: Low pass filter incorporating green, red and blue local samples from the raw data for (int row = 2; row < tileRows - 2; row++) { - for (int col = 2 + (fc(cfarray, row, 0) & 1), indx = row * tileSize + col; col < tilecols - 2; col += 2, indx += 2) { - lpf[indx>>1] = 0.25f * cfa[indx] + 0.125f * (cfa[indx - w1] + cfa[indx + w1] + cfa[indx - 1] + cfa[indx + 1]) + 0.0625f * (cfa[indx - w1 - 1] + cfa[indx - w1 + 1] + cfa[indx + w1 - 1] + cfa[indx + w1 + 1]); + for (int col = 2 + (fc(cfarray, row, 0) & 1), indx = row * tileSize + col, lpindx = indx / 2; col < tilecols - 2; col += 2, indx += 2, ++lpindx) { + lpf[lpindx] = 0.25f * cfa[indx] + + 0.125f * (cfa[indx - w1] + cfa[indx + w1] + cfa[indx - 1] + cfa[indx + 1]) + + 0.0625f * (cfa[indx - w1 - 1] + cfa[indx - w1 + 1] + cfa[indx + w1 - 1] + cfa[indx + w1 + 1]); } } @@ -163,11 +165,12 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) for (int row = 4; row < tileRows - 4; row++) { int col = 4 + (fc(cfarray, row, 0) & 1); int indx = row * tileSize + col; + int lpindx = indx / 2; #ifdef __SSE2__ const vfloat zd5v = F2V(0.5f); const vfloat zd25v = F2V(0.25f); const vfloat epsv = F2V(eps); - for (; col < tilecols - 7; col += 8, indx += 8) { + for (; col < tilecols - 7; col += 8, indx += 8, lpindx += 4) { // Cardinal gradients const vfloat cfai = LC2VFU(cfa[indx]); const vfloat N_Grad = epsv + (vabsf(LC2VFU(cfa[indx - w1]) - LC2VFU(cfa[indx + w1])) + vabsf(cfai - LC2VFU(cfa[indx - w2]))) + (vabsf(LC2VFU(cfa[indx - w1]) - LC2VFU(cfa[indx - w3])) + vabsf(LC2VFU(cfa[indx - w2]) - LC2VFU(cfa[indx - w4]))); @@ -176,11 +179,11 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) const vfloat E_Grad = epsv + (vabsf(LC2VFU(cfa[indx - 1]) - LC2VFU(cfa[indx + 1])) + vabsf(cfai - LC2VFU(cfa[indx + 2]))) + (vabsf(LC2VFU(cfa[indx + 1]) - LC2VFU(cfa[indx + 3])) + vabsf(LC2VFU(cfa[indx + 2]) - LC2VFU(cfa[indx + 4]))); // Cardinal pixel estimations - const vfloat lpfi = LVFU(lpf[indx>>1]); - const vfloat N_Est = LC2VFU(cfa[indx - w1]) + (LC2VFU(cfa[indx - w1]) * (lpfi - LVFU(lpf[(indx - w2)>>1])) / (epsv + lpfi + LVFU(lpf[(indx - w2)>>1]))); - const vfloat S_Est = LC2VFU(cfa[indx + w1]) + (LC2VFU(cfa[indx + w1]) * (lpfi - LVFU(lpf[(indx + w2)>>1])) / (epsv + lpfi + LVFU(lpf[(indx + w2)>>1]))); - const vfloat W_Est = LC2VFU(cfa[indx - 1]) + (LC2VFU(cfa[indx - 1]) * (lpfi - LVFU(lpf[(indx - 2)>>1])) / (epsv + lpfi + LVFU(lpf[(indx - 2)>>1]))); - const vfloat E_Est = LC2VFU(cfa[indx + 1]) + (LC2VFU(cfa[indx + 1]) * (lpfi - LVFU(lpf[(indx + 2)>>1])) / (epsv + lpfi + LVFU(lpf[(indx + 2)>>1]))); + const vfloat lpfi = LVFU(lpf[lpindx]); + const vfloat N_Est = LC2VFU(cfa[indx - w1]) + (LC2VFU(cfa[indx - w1]) * (lpfi - LVFU(lpf[lpindx - w1])) / (epsv + lpfi + LVFU(lpf[lpindx - w1]))); + const vfloat S_Est = LC2VFU(cfa[indx + w1]) + (LC2VFU(cfa[indx + w1]) * (lpfi - LVFU(lpf[lpindx + w1])) / (epsv + lpfi + LVFU(lpf[lpindx + w1]))); + const vfloat W_Est = LC2VFU(cfa[indx - 1]) + (LC2VFU(cfa[indx - 1]) * (lpfi - LVFU(lpf[lpindx - 1])) / (epsv + lpfi + LVFU(lpf[lpindx - 1]))); + const vfloat E_Est = LC2VFU(cfa[indx + 1]) + (LC2VFU(cfa[indx + 1]) * (lpfi - LVFU(lpf[lpindx + 1])) / (epsv + lpfi + LVFU(lpf[lpindx + 1]))); // Vertical and horizontal estimations const vfloat V_Est = (S_Grad * N_Est + N_Grad * S_Est) / (N_Grad + S_Grad); @@ -200,7 +203,7 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) STC2VFU(rgb[1][indx], result); } #endif - for (; col < tilecols - 4; col += 2, indx += 2) { + for (; col < tilecols - 4; col += 2, indx += 2, ++lpindx) { // Cardinal gradients const float cfai = cfa[indx]; const float N_Grad = eps + (std::fabs(cfa[indx - w1] - cfa[indx + w1]) + std::fabs(cfai - cfa[indx - w2])) + (std::fabs(cfa[indx - w1] - cfa[indx - w3]) + std::fabs(cfa[indx - w2] - cfa[indx - w4])); @@ -209,11 +212,11 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) const float E_Grad = eps + (std::fabs(cfa[indx - 1] - cfa[indx + 1]) + std::fabs(cfai - cfa[indx + 2])) + (std::fabs(cfa[indx + 1] - cfa[indx + 3]) + std::fabs(cfa[indx + 2] - cfa[indx + 4])); // Cardinal pixel estimations - const float lpfi = lpf[indx>>1]; - const float N_Est = cfa[indx - w1] * (1.f + (lpfi - lpf[(indx - w2)>>1]) / (eps + lpfi + lpf[(indx - w2)>>1])); - const float S_Est = cfa[indx + w1] * (1.f + (lpfi - lpf[(indx + w2)>>1]) / (eps + lpfi + lpf[(indx + w2)>>1])); - const float W_Est = cfa[indx - 1] * (1.f + (lpfi - lpf[(indx - 2)>>1]) / (eps + lpfi + lpf[(indx - 2)>>1])); - const float E_Est = cfa[indx + 1] * (1.f + (lpfi - lpf[(indx + 2)>>1]) / (eps + lpfi + lpf[(indx + 2)>>1])); + const float lpfi = lpf[lpindx]; + const float N_Est = cfa[indx - w1] * (1.f + (lpfi - lpf[lpindx - w1]) / (eps + lpfi + lpf[lpindx - w1])); + const float S_Est = cfa[indx + w1] * (1.f + (lpfi - lpf[lpindx + w1]) / (eps + lpfi + lpf[lpindx + w1])); + const float W_Est = cfa[indx - 1] * (1.f + (lpfi - lpf[lpindx - 1]) / (eps + lpfi + lpf[lpindx - 1])); + const float E_Est = cfa[indx + 1] * (1.f + (lpfi - lpf[lpindx + 1]) / (eps + lpfi + lpf[lpindx + 1])); // Vertical and horizontal estimations const float V_Est = (S_Grad * N_Est + N_Grad * S_Est) / (N_Grad + S_Grad); @@ -225,7 +228,7 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) const float VH_Neighbourhood_Value = 0.25f * ((VH_Dir[indx - w1 - 1] + VH_Dir[indx - w1 + 1]) + (VH_Dir[indx + w1 - 1] + VH_Dir[indx + w1 + 1])); const float VH_Disc = std::fabs(0.5f - VH_Central_Value) < std::fabs(0.5f - VH_Neighbourhood_Value) ? VH_Neighbourhood_Value : VH_Central_Value; - rgb[1][indx] = VH_Disc * H_Est + (1.f - VH_Disc) * V_Est; + rgb[1][indx] = intp(VH_Disc, H_Est, V_Est); } } @@ -235,23 +238,23 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) // Step 4.1: Calculate P/Q diagonal local discrimination for (int row = rcdBorder - 4; row < tileRows - rcdBorder + 4; row++) { - for (int col = rcdBorder - 4 + (fc(cfarray, row, rcdBorder) & 1), indx = row * tileSize + col; col < tilecols - rcdBorder + 4; col += 2, indx += 2) { + for (int col = rcdBorder - 4 + (fc(cfarray, row, rcdBorder) & 1), indx = row * tileSize + col, pqindx = indx / 2; col < tilecols - rcdBorder + 4; col += 2, indx += 2, ++pqindx) { const float cfai = cfa[indx]; - float P_Stat = max(epssq, - 18.f * cfai * (cfa[indx - w1 - 1] + cfa[indx + w1 + 1] + 2.f * (cfa[indx - w2 - 2] + cfa[indx + w2 + 2]) - cfa[indx - w3 - 3] - cfa[indx + w3 + 3]) - 2.f * cfai * (cfa[indx - w4 - 4] + cfa[indx + w4 + 4] - 19.f * cfai) - cfa[indx - w1 - 1] * (70.f * cfa[indx + w1 + 1] - 12.f * cfa[indx - w2 - 2] + 24.f * cfa[indx + w2 + 2] - 38.f * cfa[indx - w3 - 3] + 16.f * cfa[indx + w3 + 3] + 12.f * cfa[indx - w4 - 4] - 6.f * cfa[indx + w4 + 4] + 46.f * cfa[indx - w1 - 1]) + cfa[indx + w1 + 1] * (24.f * cfa[indx - w2 - 2] - 12.f * cfa[indx + w2 + 2] + 16.f * cfa[indx - w3 - 3] - 38.f * cfa[indx + w3 + 3] - 6.f * cfa[indx - w4 - 4] + 12.f * cfa[indx + w4 + 4] + 46.f * cfa[indx + w1 + 1]) + cfa[indx - w2 - 2] * (14.f * cfa[indx + w2 + 2] - 12.f * cfa[indx + w3 + 3] - 2.f * (cfa[indx - w4 - 4] - cfa[indx + w4 + 4]) + 11.f * cfa[indx - w2 - 2]) - cfa[indx + w2 + 2] * (12.f * cfa[indx - w3 - 3] + 2.f * (cfa[indx - w4 - 4] - cfa[indx + w4 + 4]) + 11.f * cfa[indx + w2 + 2]) + cfa[indx - w3 - 3] * (2.f * cfa[indx + w3 + 3] - 6.f * cfa[indx - w4 - 4] + 10.f * cfa[indx - w3 - 3]) - cfa[indx + w3 + 3] * (6.f * cfa[indx + w4 + 4] + 10.f * cfa[indx + w3 + 3]) + cfa[indx - w4 - 4] * cfa[indx - w4 - 4] + cfa[indx + w4 + 4] * cfa[indx + w4 + 4]); - float Q_Stat = max(epssq, - 18.f * cfai * (cfa[indx + w1 - 1] + cfa[indx - w1 + 1] + 2.f * (cfa[indx + w2 - 2] + cfa[indx - w2 + 2]) - cfa[indx + w3 - 3] - cfa[indx - w3 + 3]) - 2.f * cfai * (cfa[indx + w4 - 4] + cfa[indx - w4 + 4] - 19.f * cfai) - cfa[indx + w1 - 1] * (70.f * cfa[indx - w1 + 1] - 12.f * cfa[indx + w2 - 2] + 24.f * cfa[indx - w2 + 2] - 38.f * cfa[indx + w3 - 3] + 16.f * cfa[indx - w3 + 3] + 12.f * cfa[indx + w4 - 4] - 6.f * cfa[indx - w4 + 4] + 46.f * cfa[indx + w1 - 1]) + cfa[indx - w1 + 1] * (24.f * cfa[indx + w2 - 2] - 12.f * cfa[indx - w2 + 2] + 16.f * cfa[indx + w3 - 3] - 38.f * cfa[indx - w3 + 3] - 6.f * cfa[indx + w4 - 4] + 12.f * cfa[indx - w4 + 4] + 46.f * cfa[indx - w1 + 1]) + cfa[indx + w2 - 2] * (14.f * cfa[indx - w2 + 2] - 12.f * cfa[indx - w3 + 3] - 2.f * (cfa[indx + w4 - 4] - cfa[indx - w4 + 4]) + 11.f * cfa[indx + w2 - 2]) - cfa[indx - w2 + 2] * (12.f * cfa[indx + w3 - 3] + 2.f * (cfa[indx + w4 - 4] - cfa[indx - w4 + 4]) + 11.f * cfa[indx - w2 + 2]) + cfa[indx + w3 - 3] * (2.f * cfa[indx - w3 + 3] - 6.f * cfa[indx + w4 - 4] + 10.f * cfa[indx + w3 - 3]) - cfa[indx - w3 + 3] * (6.f * cfa[indx - w4 + 4] + 10.f * cfa[indx - w3 + 3]) + cfa[indx + w4 - 4] * cfa[indx + w4 - 4] + cfa[indx - w4 + 4] * cfa[indx - w4 + 4]); + float P_Stat = std::max(epssq, - 18.f * cfai * (cfa[indx - w1 - 1] + cfa[indx + w1 + 1] + 2.f * (cfa[indx - w2 - 2] + cfa[indx + w2 + 2]) - cfa[indx - w3 - 3] - cfa[indx + w3 + 3]) - 2.f * cfai * (cfa[indx - w4 - 4] + cfa[indx + w4 + 4] - 19.f * cfai) - cfa[indx - w1 - 1] * (70.f * cfa[indx + w1 + 1] - 12.f * cfa[indx - w2 - 2] + 24.f * cfa[indx + w2 + 2] - 38.f * cfa[indx - w3 - 3] + 16.f * cfa[indx + w3 + 3] + 12.f * cfa[indx - w4 - 4] - 6.f * cfa[indx + w4 + 4] + 46.f * cfa[indx - w1 - 1]) + cfa[indx + w1 + 1] * (24.f * cfa[indx - w2 - 2] - 12.f * cfa[indx + w2 + 2] + 16.f * cfa[indx - w3 - 3] - 38.f * cfa[indx + w3 + 3] - 6.f * cfa[indx - w4 - 4] + 12.f * cfa[indx + w4 + 4] + 46.f * cfa[indx + w1 + 1]) + cfa[indx - w2 - 2] * (14.f * cfa[indx + w2 + 2] - 12.f * cfa[indx + w3 + 3] - 2.f * (cfa[indx - w4 - 4] - cfa[indx + w4 + 4]) + 11.f * cfa[indx - w2 - 2]) - cfa[indx + w2 + 2] * (12.f * cfa[indx - w3 - 3] + 2.f * (cfa[indx - w4 - 4] - cfa[indx + w4 + 4]) + 11.f * cfa[indx + w2 + 2]) + cfa[indx - w3 - 3] * (2.f * cfa[indx + w3 + 3] - 6.f * cfa[indx - w4 - 4] + 10.f * cfa[indx - w3 - 3]) - cfa[indx + w3 + 3] * (6.f * cfa[indx + w4 + 4] + 10.f * cfa[indx + w3 + 3]) + cfa[indx - w4 - 4] * cfa[indx - w4 - 4] + cfa[indx + w4 + 4] * cfa[indx + w4 + 4]); + float Q_Stat = std::max(epssq, - 18.f * cfai * (cfa[indx + w1 - 1] + cfa[indx - w1 + 1] + 2.f * (cfa[indx + w2 - 2] + cfa[indx - w2 + 2]) - cfa[indx + w3 - 3] - cfa[indx - w3 + 3]) - 2.f * cfai * (cfa[indx + w4 - 4] + cfa[indx - w4 + 4] - 19.f * cfai) - cfa[indx + w1 - 1] * (70.f * cfa[indx - w1 + 1] - 12.f * cfa[indx + w2 - 2] + 24.f * cfa[indx - w2 + 2] - 38.f * cfa[indx + w3 - 3] + 16.f * cfa[indx - w3 + 3] + 12.f * cfa[indx + w4 - 4] - 6.f * cfa[indx - w4 + 4] + 46.f * cfa[indx + w1 - 1]) + cfa[indx - w1 + 1] * (24.f * cfa[indx + w2 - 2] - 12.f * cfa[indx - w2 + 2] + 16.f * cfa[indx + w3 - 3] - 38.f * cfa[indx - w3 + 3] - 6.f * cfa[indx + w4 - 4] + 12.f * cfa[indx - w4 + 4] + 46.f * cfa[indx - w1 + 1]) + cfa[indx + w2 - 2] * (14.f * cfa[indx - w2 + 2] - 12.f * cfa[indx - w3 + 3] - 2.f * (cfa[indx + w4 - 4] - cfa[indx - w4 + 4]) + 11.f * cfa[indx + w2 - 2]) - cfa[indx - w2 + 2] * (12.f * cfa[indx + w3 - 3] + 2.f * (cfa[indx + w4 - 4] - cfa[indx - w4 + 4]) + 11.f * cfa[indx - w2 + 2]) + cfa[indx + w3 - 3] * (2.f * cfa[indx - w3 + 3] - 6.f * cfa[indx + w4 - 4] + 10.f * cfa[indx + w3 - 3]) - cfa[indx - w3 + 3] * (6.f * cfa[indx - w4 + 4] + 10.f * cfa[indx - w3 + 3]) + cfa[indx + w4 - 4] * cfa[indx + w4 - 4] + cfa[indx - w4 + 4] * cfa[indx - w4 + 4]); - PQ_Dir[indx] = P_Stat / (P_Stat + Q_Stat); + PQ_Dir[pqindx] = P_Stat / (P_Stat + Q_Stat); } } // Step 4.2: Populate the red and blue channels at blue and red CFA positions for (int row = rcdBorder - 3; row < tileRows - rcdBorder + 3; row++) { - for (int col = rcdBorder - 3 + (fc(cfarray, row, rcdBorder - 1) & 1), indx = row * tileSize + col, c = 2 - fc(cfarray, row, col); col < tilecols - rcdBorder + 3; col += 2, indx += 2) { + for (int col = rcdBorder - 3 + (fc(cfarray, row, rcdBorder - 1) & 1), indx = row * tileSize + col, c = 2 - fc(cfarray, row, col), pqindx = indx / 2, pqindx2 = (indx - w1 - 1) / 2, pqindx3 = (indx + w1 - 1) / 2; col < tilecols - rcdBorder + 3; col += 2, indx += 2, ++pqindx, ++pqindx2, ++pqindx3) { // Refined P/Q diagonal local discrimination - float PQ_Central_Value = PQ_Dir[indx]; - float PQ_Neighbourhood_Value = 0.25f * (PQ_Dir[indx - w1 - 1] + PQ_Dir[indx - w1 + 1] + PQ_Dir[indx + w1 - 1] + PQ_Dir[indx + w1 + 1]); + float PQ_Central_Value = PQ_Dir[pqindx]; + float PQ_Neighbourhood_Value = 0.25f * (PQ_Dir[pqindx2] + PQ_Dir[pqindx2 + 1] + PQ_Dir[pqindx3] + PQ_Dir[pqindx3 + 1]); float PQ_Disc = (std::fabs(0.5f - PQ_Central_Value) < std::fabs(0.5f - PQ_Neighbourhood_Value)) ? PQ_Neighbourhood_Value : PQ_Central_Value; @@ -272,7 +275,7 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) float Q_Est = (NE_Grad * SW_Est + SW_Grad * NE_Est) / (NE_Grad + SW_Grad); // R@B and B@R interpolation - rgb[c][indx] = rgb[1][indx] + (1.f - PQ_Disc) * P_Est + PQ_Disc * Q_Est; + rgb[c][indx] = rgb[1][indx] + intp(PQ_Disc, Q_Est, P_Est); } } @@ -281,7 +284,7 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) for (int col = rcdBorder + (fc(cfarray, row, rcdBorder - 1) & 1), indx = row * tileSize + col; col < tilecols - rcdBorder; col += 2, indx += 2) { // Refined vertical and horizontal local discrimination - float VH_Central_Value = VH_Dir[indx]; + float VH_Central_Value = VH_Dir[indx]; float VH_Neighbourhood_Value = 0.25f * ((VH_Dir[indx - w1 - 1] + VH_Dir[indx - w1 + 1]) + (VH_Dir[indx + w1 - 1] + VH_Dir[indx + w1 + 1])); float VH_Disc = (std::fabs(0.5f - VH_Central_Value) < std::fabs(0.5f - VH_Neighbourhood_Value)) ? VH_Neighbourhood_Value : VH_Central_Value; @@ -315,7 +318,7 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) float H_Est = (E_Grad * W_Est + W_Grad * E_Est) / (E_Grad + W_Grad); // R@G and B@G interpolation - rgb[c][indx] = rgb1 + (1.f - VH_Disc) * V_Est + VH_Disc * H_Est; + rgb[c][indx] = rgb1 + intp(VH_Disc, H_Est, V_Est); } } } @@ -323,9 +326,9 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) for (int row = rowStart + rcdBorder; row < rowEnd - rcdBorder; ++row) { for (int col = colStart + rcdBorder; col < colEnd - rcdBorder; ++col) { int idx = (row - rowStart) * tileSize + col - colStart ; - red[row][col] = std::max(0.f, rgb[0][idx] * 65535.f); - green[row][col] = std::max(0.f, rgb[1][idx] * 65535.f); - blue[row][col] = std::max(0.f, rgb[2][idx] * 65535.f); + red[row][col] = std::max(0.f, rgb[0][idx] * scale); + green[row][col] = std::max(0.f, rgb[1][idx] * scale); + blue[row][col] = std::max(0.f, rgb[2][idx] * scale); } } From 8b333d1527919523f22fa576ff38f0bab3da8c93 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Mon, 4 Jan 2021 19:43:48 +0100 Subject: [PATCH 038/129] Windows Dev Builds not Updating again, fixes #6033 --- rtengine/boxblural.h | 889 ----------------------------------------- rtengine/iplocallab.cc | 16 +- 2 files changed, 8 insertions(+), 897 deletions(-) delete mode 100644 rtengine/boxblural.h diff --git a/rtengine/boxblural.h b/rtengine/boxblural.h deleted file mode 100644 index 3504e92ab..000000000 --- a/rtengine/boxblural.h +++ /dev/null @@ -1,889 +0,0 @@ -/* -*- C++ -*- - * - * This file is part of RawTherapee. - * - * Copyright (C) 2010 Emil Martinec - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ -#ifndef _BOXBLURAL_H_ -#define _BOXBLURAL_H_ - -#include -#include -#include -#include -#include -#include "alignedbuffer.h" -#include "rt_math.h" -#include "opthelper.h" -#include "StopWatch.h" - - -namespace rtengine -{ - -// classical filtering if the support window is small: - -template void boxblur (T** src, A** dst, int radx, int rady, int W, int H) -{ - //box blur image; box range = (radx,rady) - assert(2*radx+1 < W); - assert(2*rady+1 < H); - - AlignedBuffer* buffer = new AlignedBuffer (W * H); - float* temp = buffer->data; - - if (radx == 0) { -#ifdef _OPENMP - #pragma omp parallel for -#endif - - for (int row = 0; row < H; row++) - for (int col = 0; col < W; col++) { - temp[row * W + col] = (float)src[row][col]; - } - } else { - //horizontal blur -#ifdef _OPENMP - #pragma omp parallel for -#endif - - for (int row = 0; row < H; row++) { - int len = radx + 1; - temp[row * W + 0] = (float)src[row][0] / len; - - for (int j = 1; j <= radx; j++) { - temp[row * W + 0] += (float)src[row][j] / len; - } - - for (int col = 1; col <= radx; col++) { - temp[row * W + col] = (temp[row * W + col - 1] * len + (float)src[row][col + radx]) / (len + 1); - len ++; - } - - for (int col = radx + 1; col < W - radx; col++) { - temp[row * W + col] = temp[row * W + col - 1] + ((float)(src[row][col + radx] - src[row][col - radx - 1])) / len; - } - - for (int col = W - radx; col < W; col++) { - temp[row * W + col] = (temp[row * W + col - 1] * len - src[row][col - radx - 1]) / (len - 1); - len --; - } - } - } - - if (rady == 0) { -#ifdef _OPENMP - #pragma omp parallel for -#endif - - for (int row = 0; row < H; row++) - for (int col = 0; col < W; col++) { - dst[row][col] = temp[row * W + col]; - } - } else { - //vertical blur -#ifdef _OPENMP - #pragma omp parallel for -#endif - - for (int col = 0; col < W; col++) { - int len = rady + 1; - dst[0][col] = temp[0 * W + col] / len; - - for (int i = 1; i <= rady; i++) { - dst[0][col] += temp[i * W + col] / len; - } - - for (int row = 1; row <= rady; row++) { - dst[row][col] = (dst[(row - 1)][col] * len + temp[(row + rady) * W + col]) / (len + 1); - len ++; - } - - for (int row = rady + 1; row < H - rady; row++) { - dst[row][col] = dst[(row - 1)][col] + (temp[(row + rady) * W + col] - temp[(row - rady - 1) * W + col]) / len; - } - - for (int row = H - rady; row < H; row++) { - dst[row][col] = (dst[(row - 1)][col] * len - temp[(row - rady - 1) * W + col]) / (len - 1); - len --; - } - } - } - - delete buffer; - -} - -template void boxblur (T** src, A** dst, T* buffer, int radx, int rady, int W, int H) -{ - //box blur image; box range = (radx,rady) - - float* temp = buffer; - - if (radx == 0) { -#ifdef _OPENMP - #pragma omp for -#endif - - for (int row = 0; row < H; row++) - for (int col = 0; col < W; col++) { - temp[row * W + col] = (float)src[row][col]; - } - } else { - //horizontal blur -#ifdef _OPENMP - #pragma omp for -#endif - - for (int row = 0; row < H; row++) { - float len = radx + 1; - float tempval = (float)src[row][0]; - - for (int j = 1; j <= radx; j++) { - tempval += (float)src[row][j]; - } - - tempval /= len; - temp[row * W + 0] = tempval; - - for (int col = 1; col <= radx; col++) { - temp[row * W + col] = tempval = (tempval * len + (float)src[row][col + radx]) / (len + 1); - len ++; - } - - for (int col = radx + 1; col < W - radx; col++) { - temp[row * W + col] = tempval = tempval + ((float)(src[row][col + radx] - src[row][col - radx - 1])) / len; - } - - for (int col = W - radx; col < W; col++) { - temp[row * W + col] = tempval = (tempval * len - src[row][col - radx - 1]) / (len - 1); - len --; - } - } - } - - if (rady == 0) { -#ifdef _OPENMP - #pragma omp for -#endif - - for (int row = 0; row < H; row++) - for (int col = 0; col < W; col++) { - dst[row][col] = temp[row * W + col]; - } - } else { - const int numCols = 8; // process numCols columns at once for better usage of L1 cpu cache -#ifdef __SSE2__ - vfloat leninitv = F2V( (float)(rady + 1)); - vfloat onev = F2V( 1.f ); - vfloat tempv, temp1v, lenv, lenp1v, lenm1v, rlenv; - -#ifdef _OPENMP - #pragma omp for -#endif - - for (int col = 0; col < W - 7; col += 8) { - lenv = leninitv; - tempv = LVFU(temp[0 * W + col]); - temp1v = LVFU(temp[0 * W + col + 4]); - - for (int i = 1; i <= rady; i++) { - tempv = tempv + LVFU(temp[i * W + col]); - temp1v = temp1v + LVFU(temp[i * W + col + 4]); - } - - tempv = tempv / lenv; - temp1v = temp1v / lenv; - STVFU(dst[0][col], tempv); - STVFU(dst[0][col + 4], temp1v); - - for (int row = 1; row <= rady; row++) { - lenp1v = lenv + onev; - tempv = (tempv * lenv + LVFU(temp[(row + rady) * W + col])) / lenp1v; - temp1v = (temp1v * lenv + LVFU(temp[(row + rady) * W + col + 4])) / lenp1v; - STVFU(dst[row][col], tempv); - STVFU(dst[row][col + 4], temp1v); - lenv = lenp1v; - } - - rlenv = onev / lenv; - - for (int row = rady + 1; row < H - rady; row++) { - tempv = tempv + (LVFU(temp[(row + rady) * W + col]) - LVFU(temp[(row - rady - 1) * W + col])) * rlenv ; - temp1v = temp1v + (LVFU(temp[(row + rady) * W + col + 4]) - LVFU(temp[(row - rady - 1) * W + col + 4])) * rlenv ; - STVFU(dst[row][col], tempv); - STVFU(dst[row][col + 4], temp1v); - } - - for (int row = H - rady; row < H; row++) { - lenm1v = lenv - onev; - tempv = (tempv * lenv - LVFU(temp[(row - rady - 1) * W + col])) / lenm1v; - temp1v = (temp1v * lenv - LVFU(temp[(row - rady - 1) * W + col + 4])) / lenm1v; - STVFU(dst[row][col], tempv); - STVFU(dst[row][col + 4], temp1v); - lenv = lenm1v; - } - } - -#else - //vertical blur -#ifdef _OPENMP - #pragma omp for -#endif - - for (int col = 0; col < W - numCols + 1; col += 8) { - float len = rady + 1; - - for(int k = 0; k < numCols; k++) { - dst[0][col + k] = temp[0 * W + col + k]; - } - - for (int i = 1; i <= rady; i++) { - for(int k = 0; k < numCols; k++) { - dst[0][col + k] += temp[i * W + col + k]; - } - } - - for(int k = 0; k < numCols; k++) { - dst[0][col + k] /= len; - } - - for (int row = 1; row <= rady; row++) { - for(int k = 0; k < numCols; k++) { - dst[row][col + k] = (dst[(row - 1)][col + k] * len + temp[(row + rady) * W + col + k]) / (len + 1); - } - - len ++; - } - - for (int row = rady + 1; row < H - rady; row++) { - for(int k = 0; k < numCols; k++) { - dst[row][col + k] = dst[(row - 1)][col + k] + (temp[(row + rady) * W + col + k] - temp[(row - rady - 1) * W + col + k]) / len; - } - } - - for (int row = H - rady; row < H; row++) { - for(int k = 0; k < numCols; k++) { - dst[row][col + k] = (dst[(row - 1)][col + k] * len - temp[(row - rady - 1) * W + col + k]) / (len - 1); - } - - len --; - } - } - -#endif -#ifdef _OPENMP - #pragma omp single -#endif - - for (int col = W - (W % numCols); col < W; col++) { - float len = rady + 1; - dst[0][col] = temp[0 * W + col] / len; - - for (int i = 1; i <= rady; i++) { - dst[0][col] += temp[i * W + col] / len; - } - - for (int row = 1; row <= rady; row++) { - dst[row][col] = (dst[(row - 1)][col] * len + temp[(row + rady) * W + col]) / (len + 1); - len ++; - } - - for (int row = rady + 1; row < H - rady; row++) { - dst[row][col] = dst[(row - 1)][col] + (temp[(row + rady) * W + col] - temp[(row - rady - 1) * W + col]) / len; - } - - for (int row = H - rady; row < H; row++) { - dst[row][col] = (dst[(row - 1)][col] * len - temp[(row - rady - 1) * W + col]) / (len - 1); - len --; - } - } - } - -} - -inline void boxblur (float** src, float** dst, int radius, int W, int H, bool multiThread) -{ - //box blur using rowbuffers and linebuffers instead of a full size buffer - - if (radius == 0) { - if (src != dst) { -#ifdef _OPENMP - #pragma omp parallel for if (multiThread) -#endif - - for (int row = 0; row < H; row++) { - for (int col = 0; col < W; col++) { - dst[row][col] = src[row][col]; - } - } - } - return; - } - - constexpr int numCols = 8; // process numCols columns at once for better usage of L1 cpu cache -#ifdef _OPENMP - #pragma omp parallel if (multiThread) -#endif - { - std::unique_ptr buffer(new float[numCols * (radius + 1)]); - - //horizontal blur - float* const lineBuffer = buffer.get(); -// float* const lineBuffer = buffer; -#ifdef _OPENMP - #pragma omp for -#endif - for (int row = 0; row < H; row++) { - float len = radius + 1; - float tempval = src[row][0]; - lineBuffer[0] = tempval; - for (int j = 1; j <= radius; j++) { - tempval += src[row][j]; - } - - tempval /= len; - dst[row][0] = tempval; - - for (int col = 1; col <= radius; col++) { - lineBuffer[col] = src[row][col]; - tempval = (tempval * len + src[row][col + radius]) / (len + 1); - dst[row][col] = tempval; - ++len; - } - int pos = 0; - for (int col = radius + 1; col < W - radius; col++) { - const float oldVal = lineBuffer[pos]; - lineBuffer[pos] = src[row][col]; - dst[row][col] = tempval = tempval + (src[row][col + radius] - oldVal) / len; - ++pos; - pos = pos <= radius ? pos : 0; - } - - for (int col = W - radius; col < W; col++) { - dst[row][col] = tempval = (tempval * len - lineBuffer[pos]) / (len - 1); - --len; - ++pos; - pos = pos <= radius ? pos : 0; - } - } - - //vertical blur -#ifdef __SSE2__ - vfloat (* const rowBuffer)[2] = (vfloat(*)[2]) buffer.get(); - const vfloat leninitv = F2V(radius + 1); - const vfloat onev = F2V(1.f); - vfloat tempv, temp1v, lenv, lenp1v, lenm1v, rlenv; - -#ifdef _OPENMP - #pragma omp for nowait -#endif - - for (int col = 0; col < W - 7; col += 8) { - lenv = leninitv; - tempv = LVFU(dst[0][col]); - temp1v = LVFU(dst[0][col + 4]); - rowBuffer[0][0] = tempv; - rowBuffer[0][1] = temp1v; - - for (int i = 1; i <= radius; i++) { - tempv = tempv + LVFU(dst[i][col]); - temp1v = temp1v + LVFU(dst[i][col + 4]); - } - - tempv = tempv / lenv; - temp1v = temp1v / lenv; - STVFU(dst[0][col], tempv); - STVFU(dst[0][col + 4], temp1v); - - for (int row = 1; row <= radius; row++) { - rowBuffer[row][0] = LVFU(dst[row][col]); - rowBuffer[row][1] = LVFU(dst[row][col + 4]); - lenp1v = lenv + onev; - tempv = (tempv * lenv + LVFU(dst[row + radius][col])) / lenp1v; - temp1v = (temp1v * lenv + LVFU(dst[row + radius][col + 4])) / lenp1v; - STVFU(dst[row][col], tempv); - STVFU(dst[row][col + 4], temp1v); - lenv = lenp1v; - } - - rlenv = onev / lenv; - int pos = 0; - for (int row = radius + 1; row < H - radius; row++) { - vfloat oldVal0 = rowBuffer[pos][0]; - vfloat oldVal1 = rowBuffer[pos][1]; - rowBuffer[pos][0] = LVFU(dst[row][col]); - rowBuffer[pos][1] = LVFU(dst[row][col + 4]); - tempv = tempv + (LVFU(dst[row + radius][col]) - oldVal0) * rlenv ; - temp1v = temp1v + (LVFU(dst[row + radius][col + 4]) - oldVal1) * rlenv ; - STVFU(dst[row][col], tempv); - STVFU(dst[row][col + 4], temp1v); - ++pos; - pos = pos <= radius ? pos : 0; - } - - for (int row = H - radius; row < H; row++) { - lenm1v = lenv - onev; - tempv = (tempv * lenv - rowBuffer[pos][0]) / lenm1v; - temp1v = (temp1v * lenv - rowBuffer[pos][1]) / lenm1v; - STVFU(dst[row][col], tempv); - STVFU(dst[row][col + 4], temp1v); - lenv = lenm1v; - ++pos; - pos = pos <= radius ? pos : 0; - } - } - -#else - float (* const rowBuffer)[8] = (float(*)[8]) buffer.get(); -#ifdef _OPENMP - #pragma omp for nowait -#endif - - for (int col = 0; col < W - numCols + 1; col += 8) { - float len = radius + 1; - - for (int k = 0; k < numCols; k++) { - rowBuffer[0][k] = dst[0][col + k]; - } - - for (int i = 1; i <= radius; i++) { - for (int k = 0; k < numCols; k++) { - dst[0][col + k] += dst[i][col + k]; - } - } - - for(int k = 0; k < numCols; k++) { - dst[0][col + k] /= len; - } - - for (int row = 1; row <= radius; row++) { - for(int k = 0; k < numCols; k++) { - rowBuffer[row][k] = dst[row][col + k]; - dst[row][col + k] = (dst[row - 1][col + k] * len + dst[row + radius][col + k]) / (len + 1); - } - - len ++; - } - - int pos = 0; - for (int row = radius + 1; row < H - radius; row++) { - for(int k = 0; k < numCols; k++) { - float oldVal = rowBuffer[pos][k]; - rowBuffer[pos][k] = dst[row][col + k]; - dst[row][col + k] = dst[row - 1][col + k] + (dst[row + radius][col + k] - oldVal) / len; - } - ++pos; - pos = pos <= radius ? pos : 0; - } - - for (int row = H - radius; row < H; row++) { - for(int k = 0; k < numCols; k++) { - dst[row][col + k] = (dst[row - 1][col + k] * len - rowBuffer[pos][k]) / (len - 1); - } - len --; - ++pos; - pos = pos <= radius ? pos : 0; - } - } - -#endif - //vertical blur, remaining columns -#ifdef _OPENMP - #pragma omp single -#endif - { - const int remaining = W % numCols; - - if (remaining > 0) { - float (* const rowBuffer)[8] = (float(*)[8]) buffer.get(); - const int col = W - remaining; - - float len = radius + 1; - for(int k = 0; k < remaining; ++k) { - rowBuffer[0][k] = dst[0][col + k]; - } - for (int row = 1; row <= radius; ++row) { - for(int k = 0; k < remaining; ++k) { - dst[0][col + k] += dst[row][col + k]; - } - } - for(int k = 0; k < remaining; ++k) { - dst[0][col + k] /= len; - } - for (int row = 1; row <= radius; ++row) { - for(int k = 0; k < remaining; ++k) { - rowBuffer[row][k] = dst[row][col + k]; - dst[row][col + k] = (dst[row - 1][col + k] * len + dst[row + radius][col + k]) / (len + 1); - } - len ++; - } - const float rlen = 1.f / len; - int pos = 0; - for (int row = radius + 1; row < H - radius; ++row) { - for(int k = 0; k < remaining; ++k) { - float oldVal = rowBuffer[pos][k]; - rowBuffer[pos][k] = dst[row][col + k]; - dst[row][col + k] = dst[row - 1][col + k] + (dst[row + radius][col + k] - oldVal) * rlen; - } - ++pos; - pos = pos <= radius ? pos : 0; - } - for (int row = H - radius; row < H; ++row) { - for(int k = 0; k < remaining; ++k) { - dst[row][col + k] = (dst[(row - 1)][col + k] * len - rowBuffer[pos][k]) / (len - 1); - } - len --; - ++pos; - pos = pos <= radius ? pos : 0; - } - } - } - } -} - -template void boxblur (T* src, A* dst, A* buffer, int radx, int rady, int W, int H) -{ - //box blur image; box range = (radx,rady) i.e. box size is (2*radx+1)x(2*rady+1) - - float* temp = buffer; - - if (radx == 0) { - for (int row = 0; row < H; row++) - for (int col = 0; col < W; col++) { - temp[row * W + col] = src[row * W + col]; - } - } else { - //horizontal blur - for (int row = H - 1; row >= 0; row--) { - int len = radx + 1; - float tempval = (float)src[row * W]; - - for (int j = 1; j <= radx; j++) { - tempval += (float)src[row * W + j]; - } - - tempval = tempval / len; - temp[row * W] = tempval; - - for (int col = 1; col <= radx; col++) { - tempval = (tempval * len + src[row * W + col + radx]) / (len + 1); - temp[row * W + col] = tempval; - len ++; - } - - float reclen = 1.f / len; - - for (int col = radx + 1; col < W - radx; col++) { - tempval = tempval + ((float)(src[row * W + col + radx] - src[row * W + col - radx - 1])) * reclen; - temp[row * W + col] = tempval; - } - - for (int col = W - radx; col < W; col++) { - tempval = (tempval * len - src[row * W + col - radx - 1]) / (len - 1); - temp[row * W + col] = tempval; - len --; - } - } - } - - if (rady == 0) { - for (int row = 0; row < H; row++) - for (int col = 0; col < W; col++) { - dst[row * W + col] = temp[row * W + col]; - } - } else { - //vertical blur -#ifdef __SSE2__ - vfloat leninitv = F2V( (float)(rady + 1)); - vfloat onev = F2V( 1.f ); - vfloat tempv, temp1v, lenv, lenp1v, lenm1v, rlenv; - int col; - - for (col = 0; col < W - 7; col += 8) { - lenv = leninitv; - tempv = LVFU(temp[0 * W + col]); - temp1v = LVFU(temp[0 * W + col + 4]); - - for (int i = 1; i <= rady; i++) { - tempv = tempv + LVFU(temp[i * W + col]); - temp1v = temp1v + LVFU(temp[i * W + col + 4]); - } - - tempv = tempv / lenv; - temp1v = temp1v / lenv; - STVFU(dst[0 * W + col], tempv); - STVFU(dst[0 * W + col + 4], temp1v); - - for (int row = 1; row <= rady; row++) { - lenp1v = lenv + onev; - tempv = (tempv * lenv + LVFU(temp[(row + rady) * W + col])) / lenp1v; - temp1v = (temp1v * lenv + LVFU(temp[(row + rady) * W + col + 4])) / lenp1v; - STVFU(dst[row * W + col], tempv); - STVFU(dst[row * W + col + 4], temp1v); - lenv = lenp1v; - } - - rlenv = onev / lenv; - - for (int row = rady + 1; row < H - rady; row++) { - tempv = tempv + (LVFU(temp[(row + rady) * W + col]) - LVFU(temp[(row - rady - 1) * W + col])) * rlenv ; - temp1v = temp1v + (LVFU(temp[(row + rady) * W + col + 4]) - LVFU(temp[(row - rady - 1) * W + col + 4])) * rlenv ; - STVFU(dst[row * W + col], tempv); - STVFU(dst[row * W + col + 4], temp1v); - } - - for (int row = H - rady; row < H; row++) { - lenm1v = lenv - onev; - tempv = (tempv * lenv - LVFU(temp[(row - rady - 1) * W + col])) / lenm1v; - temp1v = (temp1v * lenv - LVFU(temp[(row - rady - 1) * W + col + 4])) / lenm1v; - STVFU(dst[row * W + col], tempv); - STVFU(dst[row * W + col + 4], temp1v); - lenv = lenm1v; - } - } - - for (; col < W - 3; col += 4) { - lenv = leninitv; - tempv = LVFU(temp[0 * W + col]); - - for (int i = 1; i <= rady; i++) { - tempv = tempv + LVFU(temp[i * W + col]); - } - - tempv = tempv / lenv; - STVFU(dst[0 * W + col], tempv); - - for (int row = 1; row <= rady; row++) { - lenp1v = lenv + onev; - tempv = (tempv * lenv + LVFU(temp[(row + rady) * W + col])) / lenp1v; - STVFU(dst[row * W + col], tempv); - lenv = lenp1v; - } - - rlenv = onev / lenv; - - for (int row = rady + 1; row < H - rady; row++) { - tempv = tempv + (LVFU(temp[(row + rady) * W + col]) - LVFU(temp[(row - rady - 1) * W + col])) * rlenv ; - STVFU(dst[row * W + col], tempv); - } - - for (int row = H - rady; row < H; row++) { - lenm1v = lenv - onev; - tempv = (tempv * lenv - LVFU(temp[(row - rady - 1) * W + col])) / lenm1v; - STVFU(dst[row * W + col], tempv); - lenv = lenm1v; - } - } - - for (; col < W; col++) { - int len = rady + 1; - dst[0 * W + col] = temp[0 * W + col] / len; - - for (int i = 1; i <= rady; i++) { - dst[0 * W + col] += temp[i * W + col] / len; - } - - for (int row = 1; row <= rady; row++) { - dst[row * W + col] = (dst[(row - 1) * W + col] * len + temp[(row + rady) * W + col]) / (len + 1); - len ++; - } - - for (int row = rady + 1; row < H - rady; row++) { - dst[row * W + col] = dst[(row - 1) * W + col] + (temp[(row + rady) * W + col] - temp[(row - rady - 1) * W + col]) / len; - } - - for (int row = H - rady; row < H; row++) { - dst[row * W + col] = (dst[(row - 1) * W + col] * len - temp[(row - rady - 1) * W + col]) / (len - 1); - len --; - } - } - -#else - - for (int col = 0; col < W; col++) { - int len = rady + 1; - dst[0 * W + col] = temp[0 * W + col] / len; - - for (int i = 1; i <= rady; i++) { - dst[0 * W + col] += temp[i * W + col] / len; - } - - for (int row = 1; row <= rady; row++) { - dst[row * W + col] = (dst[(row - 1) * W + col] * len + temp[(row + rady) * W + col]) / (len + 1); - len ++; - } - - for (int row = rady + 1; row < H - rady; row++) { - dst[row * W + col] = dst[(row - 1) * W + col] + (temp[(row + rady) * W + col] - temp[(row - rady - 1) * W + col]) / len; - } - - for (int row = H - rady; row < H; row++) { - dst[row * W + col] = (dst[(row - 1) * W + col] * len - temp[(row - rady - 1) * W + col]) / (len - 1); - len --; - } - } - -#endif - } - -} - -template void boxabsblur (T* src, A* dst, int radx, int rady, int W, int H, float * temp) -{ - - //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - //box blur image; box range = (radx,rady) i.e. box size is (2*radx+1)x(2*rady+1) - - if (radx == 0) { - for (int row = 0; row < H; row++) - for (int col = 0; col < W; col++) { - temp[row * W + col] = fabs(src[row * W + col]); - } - } else { - //horizontal blur - for (int row = 0; row < H; row++) { - int len = radx + 1; - float tempval = fabsf((float)src[row * W + 0]); - - for (int j = 1; j <= radx; j++) { - tempval += fabsf((float)src[row * W + j]); - } - - tempval /= len; - temp[row * W + 0] = tempval; - - for (int col = 1; col <= radx; col++) { - tempval = (tempval * len + fabsf(src[row * W + col + radx])) / (len + 1); - temp[row * W + col] = tempval; - len ++; - } - - float rlen = 1.f / (float)len; - - for (int col = radx + 1; col < W - radx; col++) { - tempval = tempval + ((float)(fabsf(src[row * W + col + radx]) - fabsf(src[row * W + col - radx - 1]))) * rlen; - temp[row * W + col] = tempval; - } - - for (int col = W - radx; col < W; col++) { - tempval = (tempval * len - fabsf(src[row * W + col - radx - 1])) / (len - 1); - temp[row * W + col] = tempval; - len --; - } - } - } - - if (rady == 0) { - for (int row = 0; row < H; row++) - for (int col = 0; col < W; col++) { - dst[row * W + col] = temp[row * W + col]; - } - } else { - //vertical blur -#ifdef __SSE2__ - vfloat leninitv = F2V( (float)(rady + 1)); - vfloat onev = F2V( 1.f ); - vfloat tempv, lenv, lenp1v, lenm1v, rlenv; - - for (int col = 0; col < W - 3; col += 4) { - lenv = leninitv; - tempv = LVF(temp[0 * W + col]); - - for (int i = 1; i <= rady; i++) { - tempv = tempv + LVF(temp[i * W + col]); - } - - tempv = tempv / lenv; - STVF(dst[0 * W + col], tempv); - - for (int row = 1; row <= rady; row++) { - lenp1v = lenv + onev; - tempv = (tempv * lenv + LVF(temp[(row + rady) * W + col])) / lenp1v; - STVF(dst[row * W + col], tempv); - lenv = lenp1v; - } - - rlenv = onev / lenv; - - for (int row = rady + 1; row < H - rady; row++) { - tempv = tempv + (LVF(temp[(row + rady) * W + col]) - LVF(temp[(row - rady - 1) * W + col])) * rlenv; - STVF(dst[row * W + col], tempv); - } - - for (int row = H - rady; row < H; row++) { - lenm1v = lenv - onev; - tempv = (tempv * lenv - LVF(temp[(row - rady - 1) * W + col])) / lenm1v; - STVF(dst[row * W + col], tempv); - lenv = lenm1v; - } - } - - for (int col = W - (W % 4); col < W; col++) { - int len = rady + 1; - dst[0 * W + col] = temp[0 * W + col] / len; - - for (int i = 1; i <= rady; i++) { - dst[0 * W + col] += temp[i * W + col] / len; - } - - for (int row = 1; row <= rady; row++) { - dst[row * W + col] = (dst[(row - 1) * W + col] * len + temp[(row + rady) * W + col]) / (len + 1); - len ++; - } - - for (int row = rady + 1; row < H - rady; row++) { - dst[row * W + col] = dst[(row - 1) * W + col] + (temp[(row + rady) * W + col] - temp[(row - rady - 1) * W + col]) / len; - } - - for (int row = H - rady; row < H; row++) { - dst[row * W + col] = (dst[(row - 1) * W + col] * len - temp[(row - rady - 1) * W + col]) / (len - 1); - len --; - } - } - -#else - - for (int col = 0; col < W; col++) { - int len = rady + 1; - dst[0 * W + col] = temp[0 * W + col] / len; - - for (int i = 1; i <= rady; i++) { - dst[0 * W + col] += temp[i * W + col] / len; - } - - for (int row = 1; row <= rady; row++) { - dst[row * W + col] = (dst[(row - 1) * W + col] * len + temp[(row + rady) * W + col]) / (len + 1); - len ++; - } - - for (int row = rady + 1; row < H - rady; row++) { - dst[row * W + col] = dst[(row - 1) * W + col] + (temp[(row + rady) * W + col] - temp[(row - rady - 1) * W + col]) / len; - } - - for (int row = H - rady; row < H; row++) { - dst[row * W + col] = (dst[(row - 1) * W + col] * len - temp[(row - rady - 1) * W + col]) / (len - 1); - len --; - } - } - -#endif - } - -} - -} -#endif /* _BOXBLUR_H_ */ diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 9fe6421a3..18b1bc79a 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -49,7 +49,7 @@ #define BENCHMARK #include "StopWatch.h" #include "guidedfilter.h" -#include "boxblural.h" +#include "boxblur.h" #pragma GCC diagnostic warning "-Wall" @@ -8742,7 +8742,7 @@ void ImProcFunctions::fftw_denoise(int sk, int GW, int GH, int max_numblox_W, in } } for (int i = 0; i < 3; ++i) { - boxblur(mask, mask, 10 / sk, GW, GH, false); + boxblur(static_cast(mask), static_cast(mask), 10 / sk, GW, GH, false); } for (int i = 0; i < GH; ++i) { for (int j = 0; j < GW; ++j) { @@ -9499,7 +9499,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } for (int i = 0; i < 3; ++i) { - boxblur(masklum, masklum, 10 / sk, GW, GH, false); + boxblur(static_cast(masklum), static_cast(masklum), 10 / sk, GW, GH, false); } #ifdef _OPENMP #pragma omp parallel for if (multiThread) @@ -10189,7 +10189,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } } for (int i = 0; i < 3; ++i) { - boxblur(masklum, masklum, 10 / sk, bfw, bfh, false); + boxblur(static_cast(masklum), static_cast(masklum), 10 / sk, bfw, bfh, false); } #ifdef _OPENMP @@ -10889,7 +10889,7 @@ void ImProcFunctions::Lab_Local( } for (int i = 0; i < 3; ++i) { - boxblur(masklum, masklum, 10 / sk, bfw, bfh, false); + boxblur(static_cast(masklum), static_cast(masklum), 10 / sk, bfw, bfh, false); } #ifdef _OPENMP @@ -11436,7 +11436,7 @@ void ImProcFunctions::Lab_Local( } for (int i = 0; i < 3; ++i) { - boxblur(masklum, masklum, 10 / sk, bfw, bfh, false); + boxblur(static_cast(masklum), static_cast(masklum), 10 / sk, bfw, bfh, false); } #ifdef _OPENMP @@ -11588,7 +11588,7 @@ void ImProcFunctions::Lab_Local( } for (int i = 0; i < 3; ++i) { - boxblur(masklum, masklum, 10 / sk, GW, GH, false); + boxblur(static_cast(masklum), static_cast(masklum), 10 / sk, GW, GH, false); } #ifdef _OPENMP @@ -15512,7 +15512,7 @@ void ImProcFunctions::Lab_Local( } for (int i = 0; i < 3; ++i) { - boxblur(masklum, masklum, 10 / sk, bfw, bfh, false); + boxblur(static_cast(masklum), static_cast(masklum), 10 / sk, bfw, bfh, false); } #ifdef _OPENMP From 5df1478320756c5491fb16de0a16b2e305c8bbd5 Mon Sep 17 00:00:00 2001 From: Desmis Date: Tue, 5 Jan 2021 07:50:22 +0100 Subject: [PATCH 039/129] Local adjustments - Dynamic range and exposure - Recovery based on luminance mask (#6046) * GUI for recovery mask - Log encoding * Enable recovery Log encoding with luminance mask * GUI for exposure * Improve code with maskrecov * Enable recovery based on luminance mask for Dynalic Range and exposure * Change tooltips * Change boxblur --- rtdata/languages/default | 11 +- rtengine/iplocallab.cc | 250 +++++++++++++++++---------------------- rtengine/procevents.h | 4 + rtengine/procparams.cc | 16 +++ rtengine/procparams.h | 4 + rtengine/refreshmap.cc | 6 +- rtgui/locallabtools.cc | 109 +++++++++++++++++ rtgui/locallabtools.h | 8 ++ rtgui/paramsedited.cc | 28 +++++ rtgui/paramsedited.h | 4 + 10 files changed, 295 insertions(+), 145 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index cbcdebac3..24f3c3b5d 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1249,6 +1249,10 @@ HISTORY_MSG_1001;Local - Log recovery threshold HISTORY_MSG_1002;Local - Log threshold mask low HISTORY_MSG_1003;Local - Log threshold mask high HISTORY_MSG_1004;Local - Log decay +HISTORY_MSG_1005;Local - Exp recovery threshold +HISTORY_MSG_1006;Local - Exp threshold mask low +HISTORY_MSG_1007;Local - Exp threshold mask high +HISTORY_MSG_1008;Local - Exp decay HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance @@ -2787,9 +2791,11 @@ TP_LOCALLAB_MASKLC_TOOLTIP;This allows you to target the denoise based on the im TP_LOCALLAB_MASKDE_TOOLTIP;Used to direct the Denoise based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n If the mask is below the ‘dark’ threshold, then the Denoise will be applied progressively.\n if the mask is above the ‘light’ threshold, then the Denoise will be applied progressively.\n Between the two, the image settings without the Denoise will be maintained, unless you act on the slider "Gray area denoise". TP_LOCALLAB_MASKGF_TOOLTIP;Used to direct the Guided Filter based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n If the mask is below the ‘dark’ threshold, then the GF will be applied progressively.\n if the mask is above the ‘light’ threshold, then the GF will be applied progressively.\n Between the two, the image settings without the GF will be maintained. TP_LOCALLAB_MASKRECOL_TOOLTIP;Used to modulate the effect of the Color and Light settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Color and Light settings \n In between these two areas, the full value of the Color and Light settings will be applied +TP_LOCALLAB_MASKREEXP_TOOLTIP;Used to modulate the effect of the 'Dynamic range and Exposure' settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings \n In between these two areas, the full value of the 'Dynamic range and Exposure' settings will be applied TP_LOCALLAB_MASKRELOG_TOOLTIP;Used to modulate the effect of the Log encoding settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Log encoding settings - can be used to restore highlights reconstructed by Color propagation \n In between these two areas, the full value of the Log encoding settings will be applied TP_LOCALLAB_MASKDEINV_TOOLTIP;Reverses the way the algorithm interprets the mask.\nIf checked black and very light areas will be decreased. -TP_LOCALLAB_MASKHIGTHRESC_TOOLTIP;Light-tone limit above which Color and Light will be restored progressively to their original values prior to being modified by the Color and Light settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKHIGTHRESC_TOOLTIP;Light-tone limit above which Color and Light will be restored progressively to their original values prior to being modified by the Color and Light settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, 'Blur mask', ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKHIGTHRESE_TOOLTIP;Light-tone limit above which 'Dynamic range and Exposure' will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESL_TOOLTIP;Light-tone limit above which Log encoding will be restored progressively to their original values prior to being modified by the Log encoding settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESD_TOOLTIP;Light-tone limit above which denoise will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRES_TOOLTIP;Light-tone limit above which 'Guided Filter' will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 @@ -2798,8 +2804,9 @@ TP_LOCALLAB_MASKLCTHRLOW;Dark area luminance threshold TP_LOCALLAB_MASKLNOISELOW;Reinforce denoise in dark and light areas TP_LOCALLAB_MASKLOWTHRES_TOOLTIP;Dark-tone limit below which 'Guided Filter' will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESD_TOOLTIP;Dark-tone limit below which denoise will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 -TP_LOCALLAB_MASKLOWTHRESC_TOOLTIP;Dark-tone limit below which Color and Light will be restored progressively to their original values prior to being modified by the Color and Light settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKLOWTHRESC_TOOLTIP;Dark-tone limit below which Color and Light will be restored progressively to their original values prior to being modified by the Color and Light settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, 'blur mask', ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESL_TOOLTIP;Dark-tone limit below which Log encoding will be restored progressively to their original values prior to being modified by the Log encoding settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKLOWTHRESE_TOOLTIP;Dark-tone limit below which 'Dynamic range and Exposure' will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLCTHRMID;Gray area denoise TP_LOCALLAB_MASKUSABLE;Mask enabled (Mask & modifications) diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 18b1bc79a..28d5d847c 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -591,6 +591,10 @@ struct local_params { float lowthrc; float higthrc; float decayc; + float recothre; + float lowthre; + float higthre; + float decaye; float recothrl; float lowthrl; float higthrl; @@ -1055,6 +1059,12 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall float local_lowthrc = (float)locallab.spots.at(sp).lowthresc; float local_higthrc = (float)locallab.spots.at(sp).higthresc; float local_decayc = (float)locallab.spots.at(sp).decayc; + + float local_recothre = (float)locallab.spots.at(sp).recothrese; + float local_lowthre = (float)locallab.spots.at(sp).lowthrese; + float local_higthre = (float)locallab.spots.at(sp).higthrese; + float local_decaye = (float)locallab.spots.at(sp).decaye; + float local_recothrl = (float)locallab.spots.at(sp).recothresl; float local_lowthrl = (float)locallab.spots.at(sp).lowthresl; float local_higthrl = (float)locallab.spots.at(sp).higthresl; @@ -1418,6 +1428,11 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.lowthrc = local_lowthrc; lp.higthrc = local_higthrc; lp.decayc = local_decayc; + lp.recothre = local_recothre; + lp.lowthre = local_lowthre; + lp.higthre = local_higthre; + lp.decaye = local_decaye; + lp.recothrl = local_recothrl; lp.lowthrl = local_lowthrl; lp.higthrl = local_higthrl; @@ -8743,6 +8758,7 @@ void ImProcFunctions::fftw_denoise(int sk, int GW, int GH, int max_numblox_W, in } for (int i = 0; i < 3; ++i) { boxblur(static_cast(mask), static_cast(mask), 10 / sk, GW, GH, false); + } for (int i = 0; i < GH; ++i) { for (int j = 0; j < GW; ++j) { @@ -10529,6 +10545,79 @@ void ImProcFunctions::avoidcolshi(struct local_params& lp, int sp, LabImage * or } } +void maskrecov(const LabImage * bufcolfin, LabImage * original, LabImage * bufmaskblurcol, int bfh, int bfw, int ystart, int xstart, float hig, float low, float recoth, float decay, bool invmask, int sk, bool multiThread) +{ + LabImage tmp3(bfw, bfh); + + for (int y = 0; y < bfh; y++){ + for (int x = 0; x < bfw; x++) { + tmp3.L[y][x] = original->L[y + ystart][x + xstart]; + tmp3.a[y][x] = original->a[y + ystart][x + xstart]; + tmp3.b[y][x] = original->b[y + ystart][x + xstart]; + } + } + array2D masklum; + masklum(bfw, bfh); + for (int ir = 0; ir < bfh; ir++) + for (int jr = 0; jr < bfw; jr++) { + masklum[ir][jr] = 1.f; + } + + float higc; + calcdif(hig, higc); + float lowc; + calcdif(low, lowc); + + if(higc < lowc) { + higc = lowc + 0.01f; + } + float th = (recoth - 1.f); + float ahigh = th / (higc - 100.f); + float bhigh = 1.f - higc * ahigh; + + float alow = th / lowc; + float blow = 1.f - th; +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + for (int ir = 0; ir < bfh; ir++) + for (int jr = 0; jr < bfw; jr++) { + const float lM = bufmaskblurcol->L[ir][jr]; + const float lmr = lM / 327.68f; + if (lM < 327.68f * lowc) { + masklum[ir][jr] = alow * lmr + blow; + } else if (lM < 327.68f * higc) { + //nothing...but we can.. + } else { + masklum[ir][jr] = ahigh * lmr + bhigh; + } + float k = masklum[ir][jr]; + if(invmask == false) { + masklum[ir][jr] = 1 - pow(k, decay); + } else { + masklum[ir][jr] = pow(k, decay); + } + + } + + for (int i = 0; i < 3; ++i) { + boxblur(static_cast(masklum), static_cast(masklum), 10 / sk, bfw, bfh, false); + } + +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + for (int i = 0; i < bfh; ++i) { + for (int j = 0; j < bfw; ++j) { + bufcolfin->L[i][j] = (tmp3.L[i][j] - bufcolfin->L[i][j]) * LIM01(masklum[i][j]) + bufcolfin->L[i][j]; + bufcolfin->a[i][j] = (tmp3.a[i][j] - bufcolfin->a[i][j]) * LIM01(masklum[i][j]) + bufcolfin->a[i][j]; + bufcolfin->b[i][j] = (tmp3.b[i][j] - bufcolfin->b[i][j]) * LIM01(masklum[i][j]) + bufcolfin->b[i][j]; + } + } + masklum.free(); +} + + void ImProcFunctions::Lab_Local( int call, int sp, float** shbuffer, LabImage * original, LabImage * transformed, LabImage * reserved, LabImage * lastorig, int cx, int cy, int oW, int oH, int sk, @@ -10829,84 +10918,17 @@ void ImProcFunctions::Lab_Local( } } } + //end graduated if(lp.enaLMask && lp.recothrl != 1.f) { - LabImage tmp3(bfw, bfh); - - for (int y = 0; y < bfh; y++){ - for (int x = 0; x < bfw; x++) { - tmp3.L[y][x] = original->L[y + ystart][x + xstart]; - tmp3.a[y][x] = original->a[y + ystart][x + xstart]; - tmp3.b[y][x] = original->b[y + ystart][x + xstart]; - } - } - array2D masklum; - masklum(bfw, bfh); - for (int ir = 0; ir < bfh; ir++) - for (int jr = 0; jr < bfw; jr++) { - masklum[ir][jr] = 1.f; - } - float hig = lp.higthrl; - float higc; - calcdif(hig, higc); float low = lp.lowthrl; - float lowc; - calcdif(low, lowc); - - if(higc < lowc) { - higc = lowc + 0.01f; - } - float th = (lp.recothrl - 1.f); - float ahigh = th / (higc - 100.f); - float bhigh = 1.f - higc * ahigh; - - float alow = th / lowc; - float blow = 1.f - th; - bool invmaskl = false; -#ifdef _OPENMP - #pragma omp parallel for if (multiThread) -#endif - for (int ir = 0; ir < bfh; ir++) - for (int jr = 0; jr < bfw; jr++) { - const float lM = bufmaskoriglog->L[ir][jr]; - const float lmr = lM / 327.68f; - if (lM < 327.68f * lowc) { - masklum[ir][jr] = alow * lmr + blow; - } else if (lM < 327.68f * higc) { - - } else { - masklum[ir][jr] = ahigh * lmr + bhigh; - } - float k = masklum[ir][jr]; - if(invmaskl == false) { - masklum[ir][jr] = 1 - pow(k, lp.decayl); - } else { - masklum[ir][jr] = pow(k, lp.decayl); - } - - } - - for (int i = 0; i < 3; ++i) { - boxblur(static_cast(masklum), static_cast(masklum), 10 / sk, bfw, bfh, false); - } - -#ifdef _OPENMP - #pragma omp parallel for if (multiThread) -#endif - for (int i = 0; i < bfh; ++i) { - for (int j = 0; j < bfw; ++j) { - bufexpfin->L[i][j] = (tmp3.L[i][j] - bufexpfin->L[i][j]) * LIM01(masklum[i][j]) + bufexpfin->L[i][j]; - bufexpfin->a[i][j] = (tmp3.a[i][j] - bufexpfin->a[i][j]) * LIM01(masklum[i][j]) + bufexpfin->a[i][j]; - bufexpfin->b[i][j] = (tmp3.b[i][j] - bufexpfin->b[i][j]) * LIM01(masklum[i][j]) + bufexpfin->b[i][j]; - } - } - masklum.free(); - + float recoth = lp.recothrl; + float decay = lp.decayl; + bool invmask = false; + maskrecov(bufexpfin.get(), original, bufmaskoriglog.get(), bfh, bfw, ystart, xstart, hig, low, recoth, decay, invmask, sk, multiThread); } - - //end graduated transit_shapedetect2(call, 11, bufexporig.get(), bufexpfin.get(), originalmasklog.get(), hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); } @@ -14307,6 +14329,16 @@ void ImProcFunctions::Lab_Local( if (lp.softradiusexp > 0.f && lp.expmet == 0) { softproc(buforig.get(), bufexpfin.get(), lp.softradiusexp, bfh, bfw, 0.1, 0.001, 0.5f, sk, multiThread, 1); } + + if(lp.enaExpMask && lp.recothre != 1.f) { + float hig = lp.higthre; + float low = lp.lowthre; + float recoth = lp.recothre; + float decay = lp.decaye; + bool invmask = false; + maskrecov(bufexpfin.get(), original, bufmaskblurexp.get(), bfh, bfw, ystart, xstart, hig, low, recoth, decay, invmask, sk, multiThread); + } + float meansob = 0.f; transit_shapedetect2(call, 1, bufexporig.get(), bufexpfin.get(), originalmaskexp.get(), hueref, chromaref, lumaref, sobelref, meansob, blend2, lp, original, transformed, cx, cy, sk); } @@ -15455,78 +15487,12 @@ void ImProcFunctions::Lab_Local( //mask recovery if(lp.enaColorMask && lp.recothrc != 1.f) { - LabImage tmp3(bfw, bfh); - - for (int y = 0; y < bfh; y++){ - for (int x = 0; x < bfw; x++) { - tmp3.L[y][x] = original->L[y + ystart][x + xstart]; - tmp3.a[y][x] = original->a[y + ystart][x + xstart]; - tmp3.b[y][x] = original->b[y + ystart][x + xstart]; - } - } - array2D masklum; - masklum(bfw, bfh); - for (int ir = 0; ir < bfh; ir++) - for (int jr = 0; jr < bfw; jr++) { - masklum[ir][jr] = 1.f; - } - float hig = lp.higthrc; - float higc; - calcdif(hig, higc); float low = lp.lowthrc; - float lowc; - calcdif(low, lowc); - - if(higc < lowc) { - higc = lowc + 0.01f; - } - float th = (lp.recothrc - 1.f); - float ahigh = th / (higc - 100.f); - float bhigh = 1.f - higc * ahigh; - - float alow = th / lowc; - float blow = 1.f - th; - bool invmaskc = false; -#ifdef _OPENMP - #pragma omp parallel for if (multiThread) -#endif - for (int ir = 0; ir < bfh; ir++) - for (int jr = 0; jr < bfw; jr++) { - const float lM = bufmaskblurcol->L[ir][jr]; - const float lmr = lM / 327.68f; - if (lM < 327.68f * lowc) { - masklum[ir][jr] = alow * lmr + blow; - } else if (lM < 327.68f * higc) { - - } else { - masklum[ir][jr] = ahigh * lmr + bhigh; - } - float k = masklum[ir][jr]; - if(invmaskc == false) { - masklum[ir][jr] = 1 - pow(k, lp.decayc); - } else { - masklum[ir][jr] = pow(k, lp.decayc); - } - - } - - for (int i = 0; i < 3; ++i) { - boxblur(static_cast(masklum), static_cast(masklum), 10 / sk, bfw, bfh, false); - } - -#ifdef _OPENMP - #pragma omp parallel for if (multiThread) -#endif - for (int i = 0; i < bfh; ++i) { - for (int j = 0; j < bfw; ++j) { - bufcolfin->L[i][j] = (tmp3.L[i][j] - bufcolfin->L[i][j]) * LIM01(masklum[i][j]) + bufcolfin->L[i][j]; - bufcolfin->a[i][j] = (tmp3.a[i][j] - bufcolfin->a[i][j]) * LIM01(masklum[i][j]) + bufcolfin->a[i][j]; - bufcolfin->b[i][j] = (tmp3.b[i][j] - bufcolfin->b[i][j]) * LIM01(masklum[i][j]) + bufcolfin->b[i][j]; - } - } - masklum.free(); - + float recoth = lp.recothrc; + float decay = lp.decayc; + bool invmask = false; + maskrecov(bufcolfin.get(), original, bufmaskblurcol.get(), bfh, bfw, ystart, xstart, hig, low, recoth, decay, invmask, sk, multiThread); } float meansob = 0.f; transit_shapedetect2(call, 0, bufcolorig.get(), bufcolfin.get(), originalmaskcol.get(), hueref, chromaref, lumaref, sobelref, meansob, blend2, lp, original, transformed, cx, cy, sk); diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 8bad0a588..31e1da96d 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -1027,6 +1027,10 @@ enum ProcEventCode { Evlocallablowthresl = 1001, Evlocallabhigthresl = 1002, Evlocallabdecayl = 1003, + Evlocallabrecothrese = 1004, + Evlocallablowthrese = 1005, + Evlocallabhigthrese = 1006, + Evlocallabdecaye = 1007, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 3698518ee..ef2ac7a88 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3126,6 +3126,10 @@ LocallabParams::LocallabSpot::LocallabSpot() : fatdetail(40.0), fatanchor(1.0), fatlevel(1.), + recothrese(1.), + lowthrese(12.), + higthrese(85.), + decaye(2.), // Shadow highlight visishadhigh(false), expshadhigh(false), @@ -4278,6 +4282,10 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && fatdetail == other.fatdetail && fatanchor == other.fatanchor && fatlevel == other.fatlevel + && recothrese == other.recothrese + && lowthrese == other.lowthrese + && higthrese == other.higthrese + && decaye == other.decaye // Shadow highlight && visishadhigh == other.visishadhigh && expshadhigh == other.expshadhigh @@ -5883,6 +5891,10 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->fatdetail, "Locallab", "Fatdetail_" + index_str, spot.fatdetail, keyFile); saveToKeyfile(!pedited || spot_edited->fatanchor, "Locallab", "Fatanchor_" + index_str, spot.fatanchor, keyFile); saveToKeyfile(!pedited || spot_edited->fatlevel, "Locallab", "Fatlevel_" + index_str, spot.fatlevel, keyFile); + saveToKeyfile(!pedited || spot_edited->recothrese, "Locallab", "Recothrese_" + index_str, spot.recothrese, keyFile); + saveToKeyfile(!pedited || spot_edited->lowthrese, "Locallab", "Lowthrese_" + index_str, spot.lowthrese, keyFile); + saveToKeyfile(!pedited || spot_edited->higthrese, "Locallab", "Higthrese_" + index_str, spot.higthrese, keyFile); + saveToKeyfile(!pedited || spot_edited->decaye, "Locallab", "Decaye_" + index_str, spot.decaye, keyFile); } // Shadow highlight if ((!pedited || spot_edited->visishadhigh) && spot.visishadhigh) { @@ -7679,6 +7691,10 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Fatdetail_" + index_str, pedited, spot.fatdetail, spotEdited.fatdetail); assignFromKeyfile(keyFile, "Locallab", "Fatanchor_" + index_str, pedited, spot.fatanchor, spotEdited.fatanchor); assignFromKeyfile(keyFile, "Locallab", "Fatlevel_" + index_str, pedited, spot.fatlevel, spotEdited.fatlevel); + assignFromKeyfile(keyFile, "Locallab", "Recothrese_" + index_str, pedited, spot.recothrese, spotEdited.recothrese); + assignFromKeyfile(keyFile, "Locallab", "Lowthrese_" + index_str, pedited, spot.lowthrese, spotEdited.lowthrese); + assignFromKeyfile(keyFile, "Locallab", "Higthrese_" + index_str, pedited, spot.higthrese, spotEdited.higthrese); + assignFromKeyfile(keyFile, "Locallab", "Decaye_" + index_str, pedited, spot.decaye, spotEdited.decaye); // Shadow highlight spot.visishadhigh = assignFromKeyfile(keyFile, "Locallab", "Expshadhigh_" + index_str, pedited, spot.expshadhigh, spotEdited.expshadhigh); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index fd5726646..659ccb652 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1131,6 +1131,10 @@ struct LocallabParams { double fatdetail; double fatanchor; double fatlevel; + double recothrese; + double lowthrese; + double higthrese; + double decaye; // Shadow highlight bool visishadhigh; bool expshadhigh; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index d97dc1ce2..6e7c6a3d2 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -1030,7 +1030,11 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabrecothresl LUMINANCECURVE, // Evlocallablowthresl LUMINANCECURVE, // Evlocallabhigthresl - LUMINANCECURVE // Evlocallabdecayl + LUMINANCECURVE, // Evlocallabdecayl + LUMINANCECURVE, // Evlocallabrecothrese + LUMINANCECURVE, // Evlocallablowthrese + LUMINANCECURVE, // Evlocallabhigthrese + LUMINANCECURVE // Evlocallabdecaye }; diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 2641d404e..bf8b2e344 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -2496,6 +2496,13 @@ LocallabExposure::LocallabExposure(): expchroma(Gtk::manage(new Adjuster(M("TP_LOCALLAB_EXPCHROMA"), -50, 100, 1, 5))), curveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_CURVEEDITOR_TONES_LABEL"))), shapeexpos(static_cast(curveEditorG->addCurve(CT_Diagonal, ""))), + exprecove(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI2_EXP")))), + maskusablee(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUSABLE")))), + maskunusablee(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUNUSABLE")))), + recothrese(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKRECOTHRES"), 1., 2., 0.01, 1.))), + lowthrese(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 80., 0.5, 12.))), + higthrese(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 20., 99., 0.5, 85.))), + decaye(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKDDECAY"), 0.5, 4., 0.1, 2.))), expgradexp(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_EXPGRAD")))), strexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADSTR"), -4., 4., 0.05, 0.))), angexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADANG"), -180, 180, 0.1, 0.))), @@ -2597,6 +2604,11 @@ LocallabExposure::LocallabExposure(): softradiusexp->setLogScale(10, 0); softradiusexp->setAdjusterListener(this); + recothrese->setAdjusterListener(this); + lowthrese->setAdjusterListener(this); + higthrese->setAdjusterListener(this); + decaye->setAdjusterListener(this); + setExpandAlignProperties(exprecove, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); inversexConn = inversex->signal_toggled().connect(sigc::mem_fun(*this, &LocallabExposure::inversexChanged)); inversex->set_tooltip_text(M("TP_LOCALLAB_INVERS_TOOLTIP")); @@ -2706,6 +2718,16 @@ LocallabExposure::LocallabExposure(): toolBox->pack_start(*curveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor exptoolexp->add(*toolBox, false); pack_start(*exptoolexp); + ToolParamBlock* const expBox3 = Gtk::manage(new ToolParamBlock()); + expBox3->pack_start(*maskusablee, Gtk::PACK_SHRINK, 0); + expBox3->pack_start(*maskunusablee, Gtk::PACK_SHRINK, 0); + expBox3->pack_start(*recothrese); + expBox3->pack_start(*lowthrese); + expBox3->pack_start(*higthrese); + expBox3->pack_start(*decaye); + exprecove->add(*expBox3, false); + pack_start(*exprecove, false, false); + ToolParamBlock* const gradBox = Gtk::manage(new ToolParamBlock()); gradBox->pack_start(*strexp); gradBox->pack_start(*angexp); @@ -2772,6 +2794,10 @@ void LocallabExposure::updateAdviceTooltips(const bool showTooltips) // expMethod->set_tooltip_text(M("TP_LOCALLAB_EXPMETHOD_TOOLTIP")); // pdeFrame->set_tooltip_text(M("TP_LOCALLAB_PDEFRAME_TOOLTIP")); exppde->set_tooltip_text(M("TP_LOCALLAB_PDEFRAME_TOOLTIP")); + exprecove->set_tooltip_markup(M("TP_LOCALLAB_MASKREEXP_TOOLTIP")); + decaye->set_tooltip_text(M("TP_LOCALLAB_MASKDECAY_TOOLTIP")); + lowthrese->set_tooltip_text(M("TP_LOCALLAB_MASKLOWTHRESE_TOOLTIP")); + higthrese->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRESE_TOOLTIP")); blurexpde->set_tooltip_text(M("TP_LOCALLAB_BLURCOLDE_TOOLTIP")); laplacexp->set_tooltip_text(M("TP_LOCALLAB_EXPLAP_TOOLTIP")); linear->set_tooltip_text(M("TP_LOCALLAB_EXPLAPLIN_TOOLTIP")); @@ -2806,6 +2832,7 @@ void LocallabExposure::updateAdviceTooltips(const bool showTooltips) exp->set_tooltip_text(""); exppde->set_tooltip_text(""); blurexpde->set_tooltip_text(""); + exprecove->set_tooltip_markup(""); laplacexp->set_tooltip_text(""); linear->set_tooltip_text(""); balanexp->set_tooltip_text(""); @@ -2838,6 +2865,7 @@ void LocallabExposure::updateAdviceTooltips(const bool showTooltips) void LocallabExposure::setDefaultExpanderVisibility() { exptoolexp->set_expanded(false); + exprecove->set_expanded(false); exppde->set_expanded(false); expfat->set_expanded(false); expgradexp->set_expanded(false); @@ -2906,6 +2934,11 @@ void LocallabExposure::read(const rtengine::procparams::ProcParams* pp, const Pa exnoiseMethod->set_active(2); } + recothrese->setValue((double)spot.recothrese); + lowthrese->setValue((double)spot.lowthrese); + higthrese->setValue((double)spot.higthrese); + decaye->setValue((double)spot.decaye); + fatamount->setValue(spot.fatamount); fatdetail->setValue(spot.fatdetail); fatlevel->setValue(spot.fatlevel); @@ -2988,6 +3021,10 @@ void LocallabExposure::write(rtengine::procparams::ProcParams* pp, ParamsEdited* } else if (exnoiseMethod->get_active_row_number() == 2) { spot.exnoiseMethod = "medhi"; } + spot.recothrese = recothrese->getValue(); + spot.lowthrese = lowthrese->getValue(); + spot.higthrese = higthrese->getValue(); + spot.decaye = decaye->getValue(); spot.fatamount = fatamount->getValue(); spot.fatdetail = fatdetail->getValue(); @@ -3064,6 +3101,10 @@ void LocallabExposure::setDefaults(const rtengine::procparams::ProcParams* defPa slomaskexp->setDefault(defSpot.slomaskexp); strmaskexp->setDefault(defSpot.strmaskexp); angmaskexp->setDefault(defSpot.angmaskexp); + recothrese->setDefault((double)defSpot.recothrese); + lowthrese->setDefault((double)defSpot.lowthrese); + higthrese->setDefault((double)defSpot.higthrese); + decaye->setDefault((double)defSpot.decaye); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -3133,6 +3174,34 @@ void LocallabExposure::adjusterChanged(Adjuster* a, double newval) } } + if (a == recothrese) { + if (listener) { + listener->panelChanged(Evlocallabrecothrese, + recothrese->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == lowthrese) { + if (listener) { + listener->panelChanged(Evlocallablowthrese, + lowthrese->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == higthrese) { + if (listener) { + listener->panelChanged(Evlocallabhigthrese, + higthrese->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == decaye) { + if (listener) { + listener->panelChanged(Evlocallabdecaye, + decaye->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + if (a == sensiex) { if (listener) { listener->panelChanged(Evlocallabsensiex, @@ -3352,6 +3421,7 @@ void LocallabExposure::convertParamToNormal() slomaskexp->setValue(defSpot.slomaskexp); strmaskexp->setValue(defSpot.strmaskexp); angmaskexp->setValue(defSpot.angmaskexp); + decaye->setValue(defSpot.decaye); // Enable all listeners enableListener(); @@ -3377,6 +3447,10 @@ void LocallabExposure::convertParamToSimple() // radmaskexp->setValue(defSpot.radmaskexp); // chromaskexp->setValue(defSpot.chromaskexp); // Lmaskexpshape->setCurve(defSpot.Lmaskexpcurve); + recothrese->setValue(defSpot.recothrese); + lowthrese->setValue(defSpot.lowthrese); + higthrese->setValue(defSpot.higthrese); + decaye->setValue(defSpot.decaye); // Enable all listeners enableListener(); @@ -3391,6 +3465,10 @@ void LocallabExposure::updateGUIToMode(const modeType new_type) blurexpde->hide(); expgradexp->hide(); softradiusexp->hide(); + exprecove->hide(); + maskusablee->hide(); + maskunusablee->hide(); + decaye->hide(); expmaskexp->hide(); break; @@ -3403,14 +3481,25 @@ void LocallabExposure::updateGUIToMode(const modeType new_type) gammaskexp->hide(); slomaskexp->hide(); gradFramemask->hide(); + exprecove->show(); + if (enaExpMask->get_active()) { + maskusablee->show(); + maskunusablee->hide(); + + } else { + maskusablee->hide(); + maskunusablee->show(); + } // Specific Simple mode widgets are shown in Normal mode if (!inversex->get_active()) { // Keep widget hidden when invers is toggled expgradexp->show(); softradiusexp->show(); + exprecove->show(); } expmaskexp->show(); + decaye->hide(); break; @@ -3425,6 +3514,15 @@ void LocallabExposure::updateGUIToMode(const modeType new_type) if (!inversex->get_active()) { // Keep widget hidden when invers is toggled expgradexp->show(); softradiusexp->show(); + exprecove->show(); + } + if (enaExpMask->get_active()) { + maskusablee->show(); + maskunusablee->hide(); + + } else { + maskusablee->hide(); + maskunusablee->show(); } expmaskexp->show(); @@ -3432,6 +3530,7 @@ void LocallabExposure::updateGUIToMode(const modeType new_type) gammaskexp->show(); slomaskexp->show(); gradFramemask->show(); + decaye->show(); } } @@ -3538,6 +3637,14 @@ void LocallabExposure::showmaskexpMethodChangedinv() void LocallabExposure::enaExpMaskChanged() { + if (enaExpMask->get_active()) { + maskusablee->show(); + maskunusablee->hide(); + } else { + maskusablee->hide(); + maskunusablee->show(); + } + if (isLocActivated && exp->getEnabled()) { if (listener) { if (enaExpMask->get_active()) { @@ -3605,6 +3712,7 @@ void LocallabExposure::updateExposureGUI3() if (inversex->get_active()) { expMethod->hide(); expcomp->setLabel(M("TP_LOCALLAB_EXPCOMPINV")); + exprecove->hide(); // Manage specific case where expMethod is different from 0 if (expMethod->get_active_row_number() > 0) { @@ -3631,6 +3739,7 @@ void LocallabExposure::updateExposureGUI3() if (mode == Expert || mode == Normal) { // Keep widgets hidden in Simple mode softradiusexp->show(); expgradexp->show(); + exprecove->show(); } showmaskexpMethodinv->hide(); diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index 56b4e0b20..d8378748a 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -354,6 +354,14 @@ private: Adjuster* const expchroma; CurveEditorGroup* const curveEditorG; DiagonalCurveEditor* shapeexpos; + MyExpander* const exprecove; + Gtk::Label* const maskusablee; + Gtk::Label* const maskunusablee; + Adjuster* const recothrese; + Adjuster* const lowthrese; + Adjuster* const higthrese; + Adjuster* const decaye; + MyExpander* const expgradexp; Adjuster* const strexp; Adjuster* const angexp; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index d32e75488..f7ea7f554 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1198,6 +1198,10 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).fatdetail = locallab.spots.at(j).fatdetail && pSpot.fatdetail == otherSpot.fatdetail; locallab.spots.at(j).fatanchor = locallab.spots.at(j).fatanchor && pSpot.fatanchor == otherSpot.fatanchor; locallab.spots.at(j).fatlevel = locallab.spots.at(j).fatlevel && pSpot.fatlevel == otherSpot.fatlevel; + locallab.spots.at(j).recothrese = locallab.spots.at(j).recothrese && pSpot.recothrese == otherSpot.recothrese; + locallab.spots.at(j).lowthrese = locallab.spots.at(j).lowthrese && pSpot.lowthrese == otherSpot.lowthrese; + locallab.spots.at(j).higthrese = locallab.spots.at(j).higthrese && pSpot.higthrese == otherSpot.higthrese; + locallab.spots.at(j).decaye = locallab.spots.at(j).decaye && pSpot.decaye == otherSpot.decaye; // Shadow highlight locallab.spots.at(j).visishadhigh = locallab.spots.at(j).visishadhigh && pSpot.visishadhigh == otherSpot.visishadhigh; locallab.spots.at(j).expshadhigh = locallab.spots.at(j).expshadhigh && pSpot.expshadhigh == otherSpot.expshadhigh; @@ -3756,6 +3760,22 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).fatlevel = mods.locallab.spots.at(i).fatlevel; } + if (locallab.spots.at(i).recothrese) { + toEdit.locallab.spots.at(i).recothrese = mods.locallab.spots.at(i).recothrese; + } + + if (locallab.spots.at(i).lowthrese) { + toEdit.locallab.spots.at(i).lowthrese = mods.locallab.spots.at(i).lowthrese; + } + + if (locallab.spots.at(i).higthrese) { + toEdit.locallab.spots.at(i).higthrese = mods.locallab.spots.at(i).higthrese; + } + + if (locallab.spots.at(i).decaye) { + toEdit.locallab.spots.at(i).decaye = mods.locallab.spots.at(i).decaye; + } + // Shadow highlight if (locallab.spots.at(i).visishadhigh) { toEdit.locallab.spots.at(i).visishadhigh = mods.locallab.spots.at(i).visishadhigh; @@ -6596,6 +6616,10 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : fatdetail(v), fatanchor(v), fatlevel(v), + recothrese(v), + lowthrese(v), + higthrese(v), + decaye(v), // Shadow highlight visishadhigh(v), expshadhigh(v), @@ -7129,6 +7153,10 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) fatdetail = v; fatanchor = v; fatlevel = v; + recothrese = v; + lowthrese = v; + higthrese = v; + decaye = v; // Shadow highlight visishadhigh = v; expshadhigh = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 70eb19f75..a30fa2022 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -539,6 +539,10 @@ public: bool fatdetail; bool fatanchor; bool fatlevel; + bool recothrese; + bool lowthrese; + bool higthrese; + bool decaye; // Shadow highlight bool visishadhigh; bool expshadhigh; From 66908b6c5a86ea8634bffe42cdebc8692d8f1b2f Mon Sep 17 00:00:00 2001 From: Desmis Date: Tue, 5 Jan 2021 09:12:30 +0100 Subject: [PATCH 040/129] Improve GUI Ciecam - disable setDelay and throwOnButtonRelease --- rtengine/procparams.cc | 2 +- rtgui/colorappearance.cc | 76 +++++++++++++++++++++------------------- 2 files changed, 40 insertions(+), 38 deletions(-) diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index ef2ac7a88..7dace90c8 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -1448,7 +1448,7 @@ ColorAppearanceParams::ColorAppearanceParams() : gamut(true), datacie(false), tonecie(false), - tempout(5000), + tempout(5003), autotempout(true), ybout(18), greenout(1.0), diff --git a/rtgui/colorappearance.cc b/rtgui/colorappearance.cc index 2c64f15e4..6b3d972b5 100644 --- a/rtgui/colorappearance.cc +++ b/rtgui/colorappearance.cc @@ -50,12 +50,12 @@ static double wbSlider2Temp (double sval) // slider range: 0 - 10000 double temp; - if (sval <= 5000) { + if (sval <= 5003) { // linear below center-temp - temp = MINTEMP0 + (sval / 5000.0) * (CENTERTEMP0 - MINTEMP0); + temp = MINTEMP0 + (sval / 5003.0) * (CENTERTEMP0 - MINTEMP0); } else { const double slope = (double) (CENTERTEMP0 - MINTEMP0) / (MAXTEMP0 - CENTERTEMP0); - double x = (sval - 5000) / 5000; // x 0..1 + double x = (sval - 5003) / 5003; // x 0..1 double y = x * slope + (1.0 - slope) * pow (x, 4.0); //double y = pow(x, 4.0); temp = CENTERTEMP0 + y * (MAXTEMP0 - CENTERTEMP0); @@ -162,7 +162,7 @@ static double wbTemp2Slider (double temp) double sval; if (temp <= CENTERTEMP0) { - sval = ((temp - MINTEMP0) / (CENTERTEMP0 - MINTEMP0)) * 5000.0; + sval = ((temp - MINTEMP0) / (CENTERTEMP0 - MINTEMP0)) * 5003.0; } else { const double slope = (double) (CENTERTEMP0 - MINTEMP0) / (MAXTEMP0 - CENTERTEMP0); const double y = (temp - CENTERTEMP0) / (MAXTEMP0 - CENTERTEMP0); @@ -175,7 +175,7 @@ static double wbTemp2Slider (double temp) for (;;) { double y1 = x * slope + (1.0 - slope) * pow (x, 4.0); - if (5000 * fabs (y1 - y) < 0.1) { + if (5003 * fabs (y1 - y) < 0.1) { break; } @@ -196,7 +196,7 @@ static double wbTemp2Slider (double temp) } } - sval = 5000.0 + x * 5000.0; + sval = 5003.0 + x * 5003.0; } if (sval < 0) { @@ -279,10 +279,11 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" degree = Gtk::manage (new Adjuster (M ("TP_COLORAPP_CIECAT_DEGREE"), 0., 100., 1., 90.)); degree->set_tooltip_markup (M ("TP_COLORAPP_DEGREE_TOOLTIP")); + degree->setAdjusterListener(this); - degree->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); + // degree->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); - degree->throwOnButtonRelease(); + // degree->throwOnButtonRelease(); degree->addAutoButton (M ("TP_COLORAPP_CAT02ADAPTATION_TOOLTIP")); p1VBox->pack_start (*degree); @@ -364,19 +365,19 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" // adapscen = Gtk::manage (new Adjuster (M ("TP_COLORAPP_ABSOLUTELUMINANCE"), 0.01, 16384., 0.001, 2000.)); // EV -7 ==> EV 17 adapscen = Gtk::manage (new Adjuster (M ("TP_COLORAPP_ABSOLUTELUMINANCE"), MINLA0, MAXLA0, 0.01, 1997.4, NULL, NULL, &wbSlider2la, &wbla2Slider)); - adapscen->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); + // adapscen->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); adapscen->set_tooltip_markup (M ("TP_COLORAPP_ADAPSCEN_TOOLTIP")); - adapscen->throwOnButtonRelease(); +// adapscen->throwOnButtonRelease(); adapscen->addAutoButton(); p1VBox->pack_start (*adapscen); ybscen = Gtk::manage (new Adjuster (M ("TP_COLORAPP_MEANLUMINANCE"), 1, 90, 1, 18)); ybscen->set_tooltip_markup (M ("TP_COLORAPP_YBSCEN_TOOLTIP")); - ybscen->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); + // ybscen->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); - ybscen->throwOnButtonRelease(); +// ybscen->throwOnButtonRelease(); ybscen->addAutoButton(); p1VBox->pack_start (*ybscen); @@ -423,76 +424,77 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" p2VBox->pack_start (*Gtk::manage (new Gtk::HSeparator()), Gtk::PACK_EXPAND_WIDGET, 4); jlight = Gtk::manage (new Adjuster (M ("TP_COLORAPP_LIGHT"), -100.0, 100.0, 0.1, 0.)); + jlight->setAdjusterListener (this); - jlight->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); + // jlight->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); - jlight->throwOnButtonRelease(); + // jlight->throwOnButtonRelease(); jlight->set_tooltip_markup (M ("TP_COLORAPP_LIGHT_TOOLTIP")); p2VBox->pack_start (*jlight); qbright = Gtk::manage (new Adjuster (M ("TP_COLORAPP_BRIGHT"), -100.0, 100.0, 0.1, 0.)); - qbright->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); + // qbright->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); - qbright->throwOnButtonRelease(); +// qbright->throwOnButtonRelease(); qbright->set_tooltip_markup (M ("TP_COLORAPP_BRIGHT_TOOLTIP")); p2VBox->pack_start (*qbright); chroma = Gtk::manage (new Adjuster (M ("TP_COLORAPP_CHROMA"), -100.0, 100.0, 0.1, 0.)); - chroma->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); + // chroma->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); - chroma->throwOnButtonRelease(); +// chroma->throwOnButtonRelease(); chroma->set_tooltip_markup (M ("TP_COLORAPP_CHROMA_TOOLTIP")); p2VBox->pack_start (*chroma); schroma = Gtk::manage (new Adjuster (M ("TP_COLORAPP_CHROMA_S"), -100.0, 100.0, 0.1, 0.)); - schroma->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); + // schroma->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); - schroma->throwOnButtonRelease(); +// schroma->throwOnButtonRelease(); schroma->set_tooltip_markup (M ("TP_COLORAPP_CHROMA_S_TOOLTIP")); p2VBox->pack_start (*schroma); mchroma = Gtk::manage (new Adjuster (M ("TP_COLORAPP_CHROMA_M"), -100.0, 100.0, 0.1, 0.)); - mchroma->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); + // mchroma->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); - mchroma->throwOnButtonRelease(); +// mchroma->throwOnButtonRelease(); mchroma->set_tooltip_markup (M ("TP_COLORAPP_CHROMA_M_TOOLTIP")); p2VBox->pack_start (*mchroma); rstprotection = Gtk::manage ( new Adjuster (M ("TP_COLORAPP_RSTPRO"), 0., 100., 0.1, 0.) ); - rstprotection->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); + // rstprotection->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); - rstprotection->throwOnButtonRelease(); + // rstprotection->throwOnButtonRelease(); rstprotection->set_tooltip_markup (M ("TP_COLORAPP_RSTPRO_TOOLTIP")); p2VBox->pack_start (*rstprotection); contrast = Gtk::manage (new Adjuster (M ("TP_COLORAPP_CONTRAST"), -100.0, 100.0, 0.1, 0.)); - contrast->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); + // contrast->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); - contrast->throwOnButtonRelease(); +// contrast->throwOnButtonRelease(); contrast->set_tooltip_markup (M ("TP_COLORAPP_CONTRAST_TOOLTIP")); p2VBox->pack_start (*contrast); qcontrast = Gtk::manage (new Adjuster (M ("TP_COLORAPP_CONTRAST_Q"), -100.0, 100.0, 0.1, 0.)); - qcontrast->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); + // qcontrast->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); - qcontrast->throwOnButtonRelease(); + // qcontrast->throwOnButtonRelease(); qcontrast->set_tooltip_markup (M ("TP_COLORAPP_CONTRAST_Q_TOOLTIP")); p2VBox->pack_start (*qcontrast); colorh = Gtk::manage (new Adjuster (M ("TP_COLORAPP_HUE"), -100.0, 100.0, 0.1, 0.)); - colorh->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); + // colorh->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); - colorh->throwOnButtonRelease(); +// colorh->throwOnButtonRelease(); colorh->set_tooltip_markup (M ("TP_COLORAPP_HUE_TOOLTIP")); p2VBox->pack_start (*colorh); @@ -639,9 +641,9 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" // adaplum = Gtk::manage (new Adjuster (M ("TP_COLORAPP_ABSOLUTELUMINANCE"), 0.1, 16384., 0.1, 16.)); adaplum = Gtk::manage (new Adjuster (M ("TP_COLORAPP_ABSOLUTELUMINANCE"), MINLA0, MAXLA0, 0.01, 16, NULL, NULL, &wbSlider2la, &wbla2Slider)); - adaplum->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); + // adaplum->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); - adaplum->throwOnButtonRelease(); + // adaplum->throwOnButtonRelease(); adaplum->set_tooltip_markup (M ("TP_COLORAPP_VIEWING_ABSOLUTELUMINANCE_TOOLTIP")); p3VBox->pack_start (*adaplum); @@ -650,9 +652,9 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" degreeout = Gtk::manage (new Adjuster (M ("TP_COLORAPP_CIECAT_DEGREE"), 0., 100., 1., 90.)); - degreeout->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); + // degreeout->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); - degreeout->throwOnButtonRelease(); + // degreeout->throwOnButtonRelease(); degreeout->set_tooltip_markup (M ("TP_COLORAPP_DEGREOUT_TOOLTIP")); degreeout->addAutoButton (M ("TP_COLORAPP_CAT02ADAPTATION_TOOLTIP")); @@ -669,7 +671,7 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" ybout->set_tooltip_markup (M ("TP_COLORAPP_YBOUT_TOOLTIP")); tempout->set_tooltip_markup (M ("TP_COLORAPP_TEMP2_TOOLTIP")); - tempout->throwOnButtonRelease(); + // tempout->throwOnButtonRelease(); tempout->addAutoButton (M ("TP_COLORAPP_TEMPOUT_TOOLTIP")); tempout->show(); @@ -715,9 +717,9 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" */ badpixsl = Gtk::manage (new Adjuster (M ("TP_COLORAPP_BADPIXSL"), 0, 2, 1, 0)); - badpixsl->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); + // badpixsl->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); - badpixsl->throwOnButtonRelease(); + // badpixsl->throwOnButtonRelease(); badpixsl->set_tooltip_markup (M ("TP_COLORAPP_BADPIXSL_TOOLTIP")); pack_start (*badpixsl, Gtk::PACK_SHRINK); From e8da58ad240612dd53d1fe3301208397f9ef86c6 Mon Sep 17 00:00:00 2001 From: Desmis Date: Thu, 7 Jan 2021 10:09:28 +0100 Subject: [PATCH 041/129] Some GUI improvment Ciecam --- rtdata/languages/default | 2 +- rtengine/improccoordinator.cc | 7 ++-- rtgui/colorappearance.cc | 60 +++++++++++++++++++++++------------ 3 files changed, 44 insertions(+), 25 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 24f3c3b5d..a45dae36f 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2062,7 +2062,7 @@ TP_COLORAPP_MOD16;CIECAM16 TP_COLORAPP_NEUTRAL;Reset TP_COLORAPP_NEUTRAL_TIP;Reset all sliders checkbox and curves to their default values TP_COLORAPP_PRESETCAT02;Preset cat02/16 automatic - Symmetric mode -TP_COLORAPP_PRESETCAT02_TIP;Set combobox, sliders, temp, green so that Cat02/16 automatic is preset.\nYou can change illuminant shooting conditions.\nYou must change Cat02/16 adaptation Viewing conditions if needed.\nYou can change Temperature and Tint Viewing conditions if needed, and other settings if needed. +TP_COLORAPP_PRESETCAT02_TIP;Set combobox, sliders, temp, green so that Cat02/16 automatic is preset.\nYou can change illuminant shooting conditions.\nYou must change Cat02/16 adaptation Viewing conditions if needed.\nYou can change Temperature and Tint Viewing conditions if needed, and other settings if needed.\nAll auto checkbox are disabled TP_COLORAPP_RSTPRO;Red & skin-tones protection TP_COLORAPP_RSTPRO_TOOLTIP;Red & skin-tones protection affects both sliders and curves. TP_COLORAPP_SOURCEF_TOOLTIP;Corresponds to the shooting conditions and how to bring the conditions and data back to a "normal" area. Normal" means average or standard conditions and data, i.e. without taking into account CIECAM corrections. diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 1bee058c8..466ebf23f 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -1591,10 +1591,11 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) acListener->ybCamChanged((int) yb); //real value Yb scene } - if (params->colorappearance.enabled && params->colorappearance.presetcat02 && params->colorappearance.autotempout) { + // if (params->colorappearance.enabled && params->colorappearance.presetcat02 && params->colorappearance.autotempout) { + // if (params->colorappearance.enabled && params->colorappearance.presetcat02) { // acListener->wbCamChanged(params->wb.temperature, params->wb.green); //real temp and tint - acListener->wbCamChanged(params->wb.temperature, 1.f); //real temp and tint = 1. - } + // acListener->wbCamChanged(params->wb.temperature, 1.f); //real temp and tint = 1. + // } } else { // CIECAM is disabled, we free up its image buffer to save some space diff --git a/rtgui/colorappearance.cc b/rtgui/colorappearance.cc index 6b3d972b5..e2d49a6b4 100644 --- a/rtgui/colorappearance.cc +++ b/rtgui/colorappearance.cc @@ -39,7 +39,7 @@ #define MINLA0 0.01 #define MAXLA0 16384 -#define CENTERLA0 500 +//#define CENTERLA0 500 using namespace rtengine; using namespace rtengine::procparams; @@ -71,7 +71,7 @@ static double wbSlider2Temp (double sval) return temp; } - +/* static double wbSlider2la (double sval) { @@ -99,7 +99,8 @@ static double wbSlider2la (double sval) return la; } - +*/ +/* static double wbla2Slider (double la) { @@ -153,7 +154,7 @@ static double wbla2Slider (double la) return sval; } - +*/ static double wbTemp2Slider (double temp) @@ -363,7 +364,9 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" // adapscen = Gtk::manage (new Adjuster (M ("TP_COLORAPP_ABSOLUTELUMINANCE"), 0.01, 16384., 0.001, 2000.)); // EV -7 ==> EV 17 - adapscen = Gtk::manage (new Adjuster (M ("TP_COLORAPP_ABSOLUTELUMINANCE"), MINLA0, MAXLA0, 0.01, 1997.4, NULL, NULL, &wbSlider2la, &wbla2Slider)); +// adapscen = Gtk::manage (new Adjuster (M ("TP_COLORAPP_ABSOLUTELUMINANCE"), MINLA0, MAXLA0, 0.01, 1997.4, NULL, NULL, &wbSlider2la, &wbla2Slider)); + adapscen = Gtk::manage (new Adjuster (M ("TP_COLORAPP_ABSOLUTELUMINANCE"), MINLA0, MAXLA0, 0.01, 2000.));//, NULL, NULL, &wbSlider2la, &wbla2Slider)); + adapscen->setLogScale(500, 0); // adapscen->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); adapscen->set_tooltip_markup (M ("TP_COLORAPP_ADAPSCEN_TOOLTIP")); @@ -638,8 +641,8 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" Gtk::Image* itempR1 = Gtk::manage (new RTImage ("circle-yellow-small.png")); Gtk::Image* igreenL1 = Gtk::manage (new RTImage ("circle-magenta-small.png")); Gtk::Image* igreenR1 = Gtk::manage (new RTImage ("circle-green-small.png")); -// adaplum = Gtk::manage (new Adjuster (M ("TP_COLORAPP_ABSOLUTELUMINANCE"), 0.1, 16384., 0.1, 16.)); - adaplum = Gtk::manage (new Adjuster (M ("TP_COLORAPP_ABSOLUTELUMINANCE"), MINLA0, MAXLA0, 0.01, 16, NULL, NULL, &wbSlider2la, &wbla2Slider)); + adaplum = Gtk::manage (new Adjuster (M ("TP_COLORAPP_ABSOLUTELUMINANCE"), MINLA0, MAXLA0, 0.01, 16.));//, NULL, NULL, &wbSlider2la, &wbla2Slider)); + adaplum->setLogScale(500, 0); // adaplum->setDelay(std::max(options.adjusterMinDelay, options.adjusterMaxDelay)); @@ -672,7 +675,7 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" tempout->set_tooltip_markup (M ("TP_COLORAPP_TEMP2_TOOLTIP")); // tempout->throwOnButtonRelease(); - tempout->addAutoButton (M ("TP_COLORAPP_TEMPOUT_TOOLTIP")); + // tempout->addAutoButton (M ("TP_COLORAPP_TEMPOUT_TOOLTIP")); tempout->show(); greenout->show(); @@ -813,7 +816,7 @@ void ColorAppearance::neutral_pressed () qcontrast->resetValue (false); colorh->resetValue (false); tempout->resetValue (false); - tempout->setAutoValue (true); +// tempout->setAutoValue (true); greenout->resetValue (false); ybout->resetValue (false); tempsc->resetValue (false); @@ -905,7 +908,7 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited) adapscen->setAutoInconsistent (multiImage && !pedited->colorappearance.autoadapscen); ybscen->setAutoInconsistent (multiImage && !pedited->colorappearance.autoybscen); set_inconsistent (multiImage && !pedited->colorappearance.enabled); - tempout->setAutoInconsistent (multiImage && !pedited->colorappearance.autotempout); + // tempout->setAutoInconsistent (multiImage && !pedited->colorappearance.autotempout); shape->setUnChanged (!pedited->colorappearance.curve); shape2->setUnChanged (!pedited->colorappearance.curve2); @@ -1078,7 +1081,7 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited) lastAutoAdapscen = pp->colorappearance.autoadapscen; lastAutoDegreeout = pp->colorappearance.autodegreeout; lastAutoybscen = pp->colorappearance.autoybscen; - lastAutotempout = pp->colorappearance.autotempout; +// lastAutotempout = pp->colorappearance.autotempout; degree->setValue (pp->colorappearance.degree); degree->setAutoValue (pp->colorappearance.autodegree); @@ -1101,7 +1104,7 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited) qcontrast->setValue (pp->colorappearance.qcontrast); colorh->setValue (pp->colorappearance.colorh); tempout->setValue (pp->colorappearance.tempout); - tempout->setAutoValue (pp->colorappearance.autotempout); +// tempout->setAutoValue (pp->colorappearance.autotempout); greenout->setValue (pp->colorappearance.greenout); ybout->setValue (pp->colorappearance.ybout); tempsc->setValue (pp->colorappearance.tempsc); @@ -1168,7 +1171,7 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited) pp->colorappearance.curve2 = shape2->getCurve (); pp->colorappearance.curve3 = shape3->getCurve (); pp->colorappearance.tempout = tempout->getValue (); - pp->colorappearance.autotempout = tempout->getAutoValue (); +// pp->colorappearance.autotempout = tempout->getAutoValue (); pp->colorappearance.greenout = greenout->getValue (); pp->colorappearance.ybout = ybout->getValue (); pp->colorappearance.tempsc = tempsc->getValue (); @@ -1247,7 +1250,7 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited) pedited->colorappearance.tempsc = tempsc->getEditedState (); pedited->colorappearance.greensc = greensc->getEditedState (); pedited->colorappearance.presetcat02 = presetcat02->get_inconsistent (); - pedited->colorappearance.autotempout = !tempout->getAutoInconsistent(); +// pedited->colorappearance.autotempout = !tempout->getAutoInconsistent(); } @@ -1595,8 +1598,14 @@ void ColorAppearance::presetcat02pressed () degreeout->setValue(90); ybout->setValue(18); tempout->setValue (nexttemp); - tempout->setAutoValue (true); - + +/* if(tempout->getAutoValue()) { + tempout->resetValue (false); + } else { + tempout->setValue (nexttemp); + tempout->setAutoValue (true); + } +*/ greenout->setValue (nextgreen); enableListener(); } else { @@ -1956,6 +1965,16 @@ void ColorAppearance::adjusterChanged(Adjuster* a, double newval) void ColorAppearance::adjusterAutoToggled(Adjuster* a) { + /* + if(presetcat02->get_active ()){ + if(tempout->getAutoValue()) { + tempout->resetValue (false); + } else { + tempout->setValue (nexttemp); + tempout->setAutoValue (true); + } + } +*/ if (multiImage) { if (degree->getAutoInconsistent()) { degree->setAutoInconsistent (false); @@ -1991,7 +2010,7 @@ void ColorAppearance::adjusterAutoToggled(Adjuster* a) ybscen->setAutoInconsistent (true); } - lastAutotempout = tempout->getAutoValue(); +/* lastAutotempout = tempout->getAutoValue(); if (tempout->getAutoInconsistent()) { tempout->setAutoInconsistent (false); @@ -2001,9 +2020,8 @@ void ColorAppearance::adjusterAutoToggled(Adjuster* a) } lastAutotempout = tempout->getAutoValue(); - +*/ } - if (listener && (multiImage || getEnabled()) ) { if (a == degree) { @@ -2046,7 +2064,7 @@ void ColorAppearance::adjusterAutoToggled(Adjuster* a) listener->panelChanged (EvCATAutoyb, M ("GENERAL_DISABLED")); } } - +/* if (a == tempout) { if (tempout->getAutoInconsistent()) { listener->panelChanged (EvCATAutotempout, M ("GENERAL_UNCHANGED")); @@ -2056,7 +2074,7 @@ void ColorAppearance::adjusterAutoToggled(Adjuster* a) listener->panelChanged (EvCATAutotempout, M ("GENERAL_DISABLED")); } } - +*/ } } void ColorAppearance::enabledChanged () From b554f52ab9136ad0333564b385f45d8196bd7b4d Mon Sep 17 00:00:00 2001 From: Desmis Date: Thu, 7 Jan 2021 12:08:10 +0100 Subject: [PATCH 042/129] Improve HLreconstruction color propagation - best transitions - code from ART - thanks to Alberto --- rtengine/hilite_recon.cc | 141 ++++++++++++++++++++++++++++++++------- 1 file changed, 118 insertions(+), 23 deletions(-) diff --git a/rtengine/hilite_recon.cc b/rtengine/hilite_recon.cc index 6c41ad5ae..331ea9db4 100644 --- a/rtengine/hilite_recon.cc +++ b/rtengine/hilite_recon.cc @@ -34,6 +34,12 @@ #include "rt_math.h" #define BENCHMARK #include "StopWatch.h" +#include "guidedfilter.h" +#include "settings.h" +#include "gauss.h" +#include "rescale.h" +#include "iccstore.h" +#include "color.h" namespace { @@ -289,6 +295,9 @@ void boxblur_resamp(const float* const* src, float** dst, float** temp, int H, i namespace rtengine { +extern const Settings *settings; +using namespace procparams; + const ProcParams params; void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue) { @@ -415,10 +424,10 @@ void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue return; } - if (plistener) { - progress += 0.05; - plistener->setProgress(progress); - } + // if (plistener) { + // progress += 0.05; + // plistener->setProgress(progress); + // } constexpr int blurBorder = 256; minx = std::max(0, minx - blurBorder); @@ -436,17 +445,17 @@ void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue boxblur2(red, channelblur[0], temp, miny, minx, blurHeight, blurWidth, bufferWidth, 4); - if (plistener) { - progress += 0.07; - plistener->setProgress(progress); - } + // if (plistener) { + // progress += 0.07; + // plistener->setProgress(progress); + // } boxblur2(green, channelblur[1], temp, miny, minx, blurHeight, blurWidth, bufferWidth, 4); - if (plistener) { - progress += 0.07; - plistener->setProgress(progress); - } + // if (plistener) { +// progress += 0.07; + // plistener->setProgress(progress); + // } boxblur2(blue, channelblur[2], temp, miny, minx, blurHeight, blurWidth, bufferWidth, 4); @@ -931,6 +940,38 @@ void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // now reconstruct clipped channels using color ratios + //using code from ART - thanks to Alberto Griggio + const int W2 = float(W) / 2.f + 0.5f; + const int H2 = float(H) / 2.f + 0.5f; + array2D mask(W2, H2, ARRAY2D_CLEAR_DATA); + array2D rbuf(W2, H2); + array2D gbuf(W2, H2); + array2D bbuf(W2, H2); + array2D guide(W2, H2); + array2D Y(W2, H2); + + using rtengine::TMatrix; + TMatrix ws = ICCStore::getInstance()->workingSpaceMatrix(params.icm.workingProfile); + + { + array2D rsrc(W, H, red, ARRAY2D_BYREFERENCE); + array2D gsrc(W, H, green, ARRAY2D_BYREFERENCE); + array2D bsrc(W, H, blue, ARRAY2D_BYREFERENCE); + rescaleNearest(rsrc, rbuf, true); + rescaleNearest(gsrc, gbuf, true); + rescaleNearest(bsrc, bbuf, true); + +#ifdef _OPENMP +# pragma omp parallel for +#endif + for (int y = 0; y < H2; ++y) { + for (int x = 0; x < W2; ++x) { + Y[y][x] = rtengine::Color::rgbLuminance(static_cast(rbuf[y][x]), static_cast(gbuf[y][x]), static_cast(bbuf[y][x]), ws); + guide[y][x] = Color::igamma_srgb(Y[y][x]); + } + } + } +//end addind code ART #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) @@ -1080,15 +1121,18 @@ void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue if (UNLIKELY(!totwt)) { continue; } + //using code from ART - thanks to Alberto Griggio + float maskval = 1.f; + int yy = i + miny; + int xx = j + minx; //now correct clipped channels if (pixel[0] > max_f[0] && pixel[1] > max_f[1] && pixel[2] > max_f[2]) { //all channels clipped - const float mult = whitept / (0.299f * clipfix[0] + 0.587f * clipfix[1] + 0.114f * clipfix[2]); - red[i + miny][j + minx] = clipfix[0] * mult; - green[i + miny][j + minx] = clipfix[1] * mult; - blue[i + miny][j + minx] = clipfix[2] * mult; + red[yy][xx] = clipfix[0] * mult; + green[yy][xx] = clipfix[1] * mult; + blue[yy][xx] = clipfix[2] * mult; } else {//some channels clipped const float notclipped[3] = { pixel[0] <= max_f[0] ? 1.f : 0.f, @@ -1097,33 +1141,84 @@ void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue }; if (notclipped[0] == 0.f) { //red clipped - red[i + miny][j + minx] = max(pixel[0], clipfix[0] * ((notclipped[1] * pixel[1] + notclipped[2] * pixel[2]) / + red[yy][xx] = max(pixel[0], clipfix[0] * ((notclipped[1] * pixel[1] + notclipped[2] * pixel[2]) / (notclipped[1] * clipfix[1] + notclipped[2] * clipfix[2] + epsilon))); } if (notclipped[1] == 0.f) { //green clipped - green[i + miny][j + minx] = max(pixel[1], clipfix[1] * ((notclipped[2] * pixel[2] + notclipped[0] * pixel[0]) / + green[yy][xx] = max(pixel[1], clipfix[1] * ((notclipped[2] * pixel[2] + notclipped[0] * pixel[0]) / (notclipped[2] * clipfix[2] + notclipped[0] * clipfix[0] + epsilon))); } if (notclipped[2] == 0.f) { //blue clipped - blue[i + miny][j + minx] = max(pixel[2], clipfix[2] * ((notclipped[0] * pixel[0] + notclipped[1] * pixel[1]) / + blue[yy][xx] = max(pixel[2], clipfix[2] * ((notclipped[0] * pixel[0] + notclipped[1] * pixel[1]) / (notclipped[0] * clipfix[0] + notclipped[1] * clipfix[1] + epsilon))); } + + maskval = 1.f - (notclipped[0] + notclipped[1] + notclipped[2]) / 5.f; } - Y = 0.299f * red[i + miny][j + minx] + 0.587f * green[i + miny][j + minx] + 0.114f * blue[i + miny][j + minx]; + Y = 0.299f * red[yy][xx] + 0.587f * green[yy][xx] + 0.114f * blue[yy][xx]; if (Y > whitept) { const float mult = whitept / Y; - red[i + miny][j + minx] *= mult; - green[i + miny][j + minx] *= mult; - blue[i + miny][j + minx] *= mult; + red[yy][xx] *= mult; + green[yy][xx] *= mult; + blue[yy][xx] *= mult; + } + + int ii = (yy) / 2; + int jj = (xx) / 2; + rbuf[ii][jj] = red[yy][xx]; + gbuf[ii][jj] = green[yy][xx]; + bbuf[ii][jj] = blue[yy][xx]; + mask[ii][jj] = maskval; + } + } + + if (plistener) { + progress += 0.05; + plistener->setProgress(progress); + } + +// #ifdef _OPENMP +// #pragma omp parallel +// #endif + { + //gaussianBlur(mask, mask, W/2, H/2, 5); + // gaussianBlur(rbuf, rbuf, W/2, H/2, 1); + // gaussianBlur(gbuf, gbuf, W/2, H/2, 1); + // gaussianBlur(bbuf, bbuf, W/2, H/2, 1); + guidedFilter(guide, mask, mask, 2, 0.001f, true, 1); + guidedFilter(guide, rbuf, rbuf, 3, 0.01f * 65535.f, true, 1); + guidedFilter(guide, gbuf, gbuf, 3, 0.01f * 65535.f, true, 1); + guidedFilter(guide, bbuf, bbuf, 3, 0.01f * 65535.f, true, 1); + } + + { +#ifdef _OPENMP + #pragma omp parallel for +#endif + for (int y = 0; y < H; ++y) { + float fy = y * 0.5f; + int yy = y / 2; + for (int x = 0; x < W; ++x) { + float fx = x * 0.5f; + int xx = x / 2; + float m = mask[yy][xx]; + if (m > 0.f) { + red[y][x] = intp(m, getBilinearValue(rbuf, fx, fy), red[y][x]); + green[y][x] = intp(m, getBilinearValue(gbuf, fx, fy), green[y][x]); + blue[y][x] = intp(m, getBilinearValue(bbuf, fx, fy), blue[y][x]); + } } } } + + + if (plistener) { plistener->setProgress(1.00); } From efb601c0289b2f97b03ac71016513980fa9e0fb4 Mon Sep 17 00:00:00 2001 From: Desmis Date: Fri, 8 Jan 2021 13:17:28 +0100 Subject: [PATCH 043/129] Local adjustments - Shadows highlights - Recovery based on luminance mask (#6050) * LA GUI for recovery using luminance mask * LA Shadows Highlights Enable Recovery based on luminance mask --- rtdata/languages/default | 7 +++ rtengine/iplocallab.cc | 22 ++++++++ rtengine/procevents.h | 4 ++ rtengine/procparams.cc | 16 ++++++ rtengine/procparams.h | 4 ++ rtengine/refreshmap.cc | 6 +- rtgui/locallabtools.cc | 119 +++++++++++++++++++++++++++++++++++++++ rtgui/locallabtools.h | 7 +++ rtgui/paramsedited.cc | 28 +++++++++ rtgui/paramsedited.h | 4 ++ 10 files changed, 216 insertions(+), 1 deletion(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index a45dae36f..90af69bdb 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1253,6 +1253,10 @@ HISTORY_MSG_1005;Local - Exp recovery threshold HISTORY_MSG_1006;Local - Exp threshold mask low HISTORY_MSG_1007;Local - Exp threshold mask high HISTORY_MSG_1008;Local - Exp decay +HISTORY_MSG_1009;Local - SH recovery threshold +HISTORY_MSG_1010;Local - SH threshold mask low +HISTORY_MSG_1011;Local - SH threshold mask high +HISTORY_MSG_1012;Local - SH decay HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance @@ -2792,9 +2796,11 @@ TP_LOCALLAB_MASKDE_TOOLTIP;Used to direct the Denoise based on the image luminan TP_LOCALLAB_MASKGF_TOOLTIP;Used to direct the Guided Filter based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n If the mask is below the ‘dark’ threshold, then the GF will be applied progressively.\n if the mask is above the ‘light’ threshold, then the GF will be applied progressively.\n Between the two, the image settings without the GF will be maintained. TP_LOCALLAB_MASKRECOL_TOOLTIP;Used to modulate the effect of the Color and Light settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Color and Light settings \n In between these two areas, the full value of the Color and Light settings will be applied TP_LOCALLAB_MASKREEXP_TOOLTIP;Used to modulate the effect of the 'Dynamic range and Exposure' settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings \n In between these two areas, the full value of the 'Dynamic range and Exposure' settings will be applied +TP_LOCALLAB_MASKRESH_TOOLTIP;Used to modulate the effect of the Shadows Highlights settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Shadows Highlights settings \n In between these two areas, the full value of the Shadows Highlights settings will be applied TP_LOCALLAB_MASKRELOG_TOOLTIP;Used to modulate the effect of the Log encoding settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Log encoding settings - can be used to restore highlights reconstructed by Color propagation \n In between these two areas, the full value of the Log encoding settings will be applied TP_LOCALLAB_MASKDEINV_TOOLTIP;Reverses the way the algorithm interprets the mask.\nIf checked black and very light areas will be decreased. TP_LOCALLAB_MASKHIGTHRESC_TOOLTIP;Light-tone limit above which Color and Light will be restored progressively to their original values prior to being modified by the Color and Light settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, 'Blur mask', ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKHIGTHRESS_TOOLTIP;Light-tone limit above which Shadows Highlights will be restored progressively to their original values prior to being modified by the Shadows Highlights settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESE_TOOLTIP;Light-tone limit above which 'Dynamic range and Exposure' will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESL_TOOLTIP;Light-tone limit above which Log encoding will be restored progressively to their original values prior to being modified by the Log encoding settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESD_TOOLTIP;Light-tone limit above which denoise will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 @@ -2807,6 +2813,7 @@ TP_LOCALLAB_MASKLOWTHRESD_TOOLTIP;Dark-tone limit below which denoise will be pr TP_LOCALLAB_MASKLOWTHRESC_TOOLTIP;Dark-tone limit below which Color and Light will be restored progressively to their original values prior to being modified by the Color and Light settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, 'blur mask', ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESL_TOOLTIP;Dark-tone limit below which Log encoding will be restored progressively to their original values prior to being modified by the Log encoding settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESE_TOOLTIP;Dark-tone limit below which 'Dynamic range and Exposure' will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKLOWTHRESS_TOOLTIP;Dark-tone limit below which Shadows Highligts will be restored progressively to their original values prior to being modified by the Shadows Highlights settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLCTHRMID;Gray area denoise TP_LOCALLAB_MASKUSABLE;Mask enabled (Mask & modifications) diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 28d5d847c..5d00d5bd8 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -595,6 +595,10 @@ struct local_params { float lowthre; float higthre; float decaye; + float recothrs; + float lowthrs; + float higthrs; + float decays; float recothrl; float lowthrl; float higthrl; @@ -1065,6 +1069,11 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall float local_higthre = (float)locallab.spots.at(sp).higthrese; float local_decaye = (float)locallab.spots.at(sp).decaye; + float local_recothrs = (float)locallab.spots.at(sp).recothress; + float local_lowthrs = (float)locallab.spots.at(sp).lowthress; + float local_higthrs = (float)locallab.spots.at(sp).higthress; + float local_decays = (float)locallab.spots.at(sp).decays; + float local_recothrl = (float)locallab.spots.at(sp).recothresl; float local_lowthrl = (float)locallab.spots.at(sp).lowthresl; float local_higthrl = (float)locallab.spots.at(sp).higthresl; @@ -1432,6 +1441,10 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.lowthre = local_lowthre; lp.higthre = local_higthre; lp.decaye = local_decaye; + lp.recothrs = local_recothrs; + lp.lowthrs = local_lowthrs; + lp.higthrs = local_higthrs; + lp.decays = local_decays; lp.recothrl = local_recothrl; lp.lowthrl = local_lowthrl; @@ -12602,6 +12615,15 @@ void ImProcFunctions::Lab_Local( } } + if(lp.enaSHMask && lp.recothrs != 1.f) { + float hig = lp.higthrs; + float low = lp.lowthrs; + float recoth = lp.recothrs; + float decay = lp.decays; + bool invmask = false; + maskrecov(bufexpfin.get(), original, bufmaskorigSH.get(), bfh, bfw, ystart, xstart, hig, low, recoth, decay, invmask, sk, multiThread); + } + transit_shapedetect2(call, 9, bufexporig.get(), bufexpfin.get(), originalmaskSH.get(), hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); if (params->locallab.spots.at(sp).recurs) { diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 31e1da96d..292b0cfbc 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -1031,6 +1031,10 @@ enum ProcEventCode { Evlocallablowthrese = 1005, Evlocallabhigthrese = 1006, Evlocallabdecaye = 1007, + Evlocallabrecothress = 1008, + Evlocallablowthress = 1009, + Evlocallabhigthress = 1010, + Evlocallabdecays = 1011, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 7dace90c8..96587733f 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3210,6 +3210,10 @@ LocallabParams::LocallabSpot::LocallabSpot() : fatanchorSH(50.0), gamSH(2.4), sloSH(12.92), + recothress(1.), + lowthress(12.), + higthress(85.), + decays(2.), // Vibrance visivibrance(false), expvibrance(false), @@ -4326,6 +4330,10 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && fatanchorSH == other.fatanchorSH && gamSH == other.gamSH && sloSH == other.sloSH + && recothress == other.recothress + && lowthress == other.lowthress + && higthress == other.higthress + && decays == other.decays // Vibrance && visivibrance == other.visivibrance && expvibrance == other.expvibrance @@ -5931,6 +5939,10 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->fatanchorSH, "Locallab", "FatanchorSH_" + index_str, spot.fatanchorSH, keyFile); saveToKeyfile(!pedited || spot_edited->gamSH, "Locallab", "GamSH_" + index_str, spot.gamSH, keyFile); saveToKeyfile(!pedited || spot_edited->sloSH, "Locallab", "SloSH_" + index_str, spot.sloSH, keyFile); + saveToKeyfile(!pedited || spot_edited->recothress, "Locallab", "Recothress_" + index_str, spot.recothress, keyFile); + saveToKeyfile(!pedited || spot_edited->lowthress, "Locallab", "Lowthress_" + index_str, spot.lowthress, keyFile); + saveToKeyfile(!pedited || spot_edited->higthress, "Locallab", "Higthress_" + index_str, spot.higthress, keyFile); + saveToKeyfile(!pedited || spot_edited->decays, "Locallab", "Decays_" + index_str, spot.decays, keyFile); } // Vibrance if ((!pedited || spot_edited->visivibrance) && spot.visivibrance) { @@ -7736,6 +7748,10 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "FatanchorSH_" + index_str, pedited, spot.fatanchorSH, spotEdited.fatanchorSH); assignFromKeyfile(keyFile, "Locallab", "GamSH_" + index_str, pedited, spot.gamSH, spotEdited.gamSH); assignFromKeyfile(keyFile, "Locallab", "SloSH_" + index_str, pedited, spot.sloSH, spotEdited.sloSH); + assignFromKeyfile(keyFile, "Locallab", "Recothress_" + index_str, pedited, spot.recothress, spotEdited.recothress); + assignFromKeyfile(keyFile, "Locallab", "Lowthress_" + index_str, pedited, spot.lowthress, spotEdited.lowthress); + assignFromKeyfile(keyFile, "Locallab", "Higthress_" + index_str, pedited, spot.higthress, spotEdited.higthress); + assignFromKeyfile(keyFile, "Locallab", "Decays_" + index_str, pedited, spot.decays, spotEdited.decays); // Vibrance spot.visivibrance = assignFromKeyfile(keyFile, "Locallab", "Expvibrance_" + index_str, pedited, spot.expvibrance, spotEdited.expvibrance); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 659ccb652..9008805ad 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1167,6 +1167,10 @@ struct LocallabParams { double fatanchorSH; double gamSH; double sloSH; + double recothress; + double lowthress; + double higthress; + double decays; // Vibrance bool visivibrance; bool expvibrance; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 6e7c6a3d2..940b9882c 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -1034,7 +1034,11 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabrecothrese LUMINANCECURVE, // Evlocallablowthrese LUMINANCECURVE, // Evlocallabhigthrese - LUMINANCECURVE // Evlocallabdecaye + LUMINANCECURVE, // Evlocallabdecaye + LUMINANCECURVE, // Evlocallabrecothress + LUMINANCECURVE, // Evlocallablowthress + LUMINANCECURVE, // Evlocallabhigthress + LUMINANCECURVE // Evlocallabdecays }; diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index bf8b2e344..45eab0939 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -3784,6 +3784,13 @@ LocallabShadow::LocallabShadow(): sh_radius(Gtk::manage(new Adjuster(M("TP_SHADOWSHLIGHTS_RADIUS"), 0, 100, 1, 40))), sensihs(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 15))), blurSHde(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURDE"), 2, 100, 1, 5))), + exprecovs(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI2_EXP")))), + maskusables(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUSABLE")))), + maskunusables(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUNUSABLE")))), + recothress(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKRECOTHRES"), 1., 2., 0.01, 1.))), + lowthress(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 80., 0.5, 12.))), + higthress(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 20., 99., 0.5, 85.))), + decays(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKDDECAY"), 0.5, 4., 0.1, 2.))), gamFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GAMFRA")))), gamSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GAMSH"), 0.25, 15.0, 0.01, 2.4))), sloSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SLOSH"), 0.0, 500.0, 0.01, 12.92))), @@ -3835,6 +3842,13 @@ LocallabShadow::LocallabShadow(): sh_radius->setAdjusterListener(this); + + recothress->setAdjusterListener(this); + lowthress->setAdjusterListener(this); + higthress->setAdjusterListener(this); + decays->setAdjusterListener(this); + setExpandAlignProperties(exprecovs, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); + sensihs->setAdjusterListener(this); blurSHde->setAdjusterListener(this); @@ -3931,6 +3945,16 @@ LocallabShadow::LocallabShadow(): pack_start(*sh_radius); // pack_start(*sensihs); pack_start(*blurSHde); + ToolParamBlock* const shBox3 = Gtk::manage(new ToolParamBlock()); + shBox3->pack_start(*maskusables, Gtk::PACK_SHRINK, 0); + shBox3->pack_start(*maskunusables, Gtk::PACK_SHRINK, 0); + shBox3->pack_start(*recothress); + shBox3->pack_start(*lowthress); + shBox3->pack_start(*higthress); + shBox3->pack_start(*decays); + // colBox3->pack_start(*invmaskc); + exprecovs->add(*shBox3, false); + pack_start(*exprecovs, false, false); gamFrame->set_label_align(0.025, 0.5); ToolParamBlock* const gammBox = Gtk::manage(new ToolParamBlock()); gammBox->pack_start(*gamSH); @@ -4005,6 +4029,7 @@ void LocallabShadow::updateAdviceTooltips(const bool showTooltips) gamSH->set_tooltip_text(M("TP_LOCALLAB_SHTRC_TOOLTIP")); sloSH->set_tooltip_text(M("TP_LOCALLAB_SHTRC_TOOLTIP")); strSH->set_tooltip_text(M("TP_LOCALLAB_GRADGEN_TOOLTIP")); + exprecovs->set_tooltip_markup(M("TP_LOCALLAB_MASKRESH_TOOLTIP")); expmasksh->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); blurSHde->set_tooltip_text(M("TP_LOCALLAB_BLURCOLDE_TOOLTIP")); CCmaskSHshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); @@ -4031,6 +4056,9 @@ void LocallabShadow::updateAdviceTooltips(const bool showTooltips) shadows->set_tooltip_text(""); s_tonalwidth->set_tooltip_text(""); sh_radius->set_tooltip_text(""); + decays->set_tooltip_text(M("TP_LOCALLAB_MASKDECAY_TOOLTIP")); + lowthress->set_tooltip_text(M("TP_LOCALLAB_MASKLOWTHRESS_TOOLTIP")); + higthress->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRESS_TOOLTIP")); } else { exp->set_tooltip_text(""); @@ -4060,12 +4088,17 @@ void LocallabShadow::updateAdviceTooltips(const bool showTooltips) shadows->set_tooltip_text(""); s_tonalwidth->set_tooltip_text(""); sh_radius->set_tooltip_text(""); + exprecovs->set_tooltip_markup(""); + decays->set_tooltip_text(""); + lowthress->set_tooltip_text(""); + higthress->set_tooltip_text(""); } } void LocallabShadow::setDefaultExpanderVisibility() { + exprecovs->set_expanded(false); expgradsh->set_expanded(false); expmasksh->set_expanded(false); } @@ -4118,6 +4151,10 @@ void LocallabShadow::read(const rtengine::procparams::ProcParams* pp, const Para for (int i = 0; i < 5; i++) { multipliersh[i]->setValue((double)spot.multsh[i]); } + recothress->setValue((double)spot.recothress); + lowthress->setValue((double)spot.lowthress); + higthress->setValue((double)spot.higthress); + decays->setValue((double)spot.decays); detailSH->setValue((double)spot.detailSH); highlights->setValue((double)spot.highlights); @@ -4209,6 +4246,10 @@ void LocallabShadow::write(rtengine::procparams::ProcParams* pp, ParamsEdited* p spot.LmaskSHcurve = LmaskSHshape->getCurve(); spot.fatamountSH = fatamountSH->getValue(); spot.fatanchorSH = fatanchorSH->getValue(); + spot.recothress = recothress->getValue(); + spot.lowthress = lowthress->getValue(); + spot.higthress = higthress->getValue(); + spot.decays = decays->getValue(); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -4246,6 +4287,10 @@ void LocallabShadow::setDefaults(const rtengine::procparams::ProcParams* defPara slomaskSH->setDefault(defSpot.slomaskSH); fatamountSH->setDefault(defSpot.fatamountSH); fatanchorSH->setDefault(defSpot.fatanchorSH); + recothress->setDefault((double)defSpot.recothress); + lowthress->setDefault((double)defSpot.lowthress); + higthress->setDefault((double)defSpot.higthress); + decays->setDefault((double)defSpot.decays); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -4308,6 +4353,36 @@ void LocallabShadow::adjusterChanged(Adjuster* a, double newval) } } + if (a == recothress) { + + if (listener) { + listener->panelChanged(Evlocallabrecothress, + recothress->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == lowthress) { + if (listener) { + listener->panelChanged(Evlocallablowthress, + lowthress->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == higthress) { + if (listener) { + listener->panelChanged(Evlocallabhigthress, + higthress->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == decays) { + if (listener) { + listener->panelChanged(Evlocallabdecays, + decays->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == sensihs) { if (listener) { listener->panelChanged(Evlocallabsensihs, @@ -4471,6 +4546,7 @@ void LocallabShadow::convertParamToNormal() slomaskSH->setValue(defSpot.slomaskSH); fatamountSH->setValue(defSpot.fatamountSH); fatanchorSH->setValue(defSpot.fatanchorSH); + decays->setValue(defSpot.decays); // Enable all listeners enableListener(); @@ -4498,6 +4574,11 @@ void LocallabShadow::convertParamToSimple() // radmaskSH->setValue(defSpot.radmaskSH); // chromaskSH->setValue(defSpot.chromaskSH); // LmaskSHshape->setCurve(defSpot.LmaskSHcurve); + + recothress->setValue(defSpot.recothress); + lowthress->setValue(defSpot.lowthress); + higthress->setValue(defSpot.higthresc); + decays->setValue(defSpot.decays); // Enable all listeners enableListener(); @@ -4512,6 +4593,10 @@ void LocallabShadow::updateGUIToMode(const modeType new_type) gamFrame->hide(); expgradsh->hide(); expmasksh->hide(); + exprecovs->hide(); + maskusables->hide(); + maskunusables->hide(); + decays->hide(); break; @@ -4522,17 +4607,29 @@ void LocallabShadow::updateGUIToMode(const modeType new_type) gammaskSH->hide(); slomaskSH->hide(); fatSHFrame->hide(); + exprecovs->show(); // Specific Simple mode widgets are shown in Normal mode if (shMethod->get_active_row_number() != 0) { // Keep widget hidden when shMethod is equal to 0 gamFrame->show(); } + if (enaSHMask->get_active()) { + maskusables->show(); + maskunusables->hide(); + + } else { + maskusables->hide(); + maskunusables->show(); + } + if (!inverssh->get_active()) { // Keep widget hidden when inverssh is toggled expgradsh->show(); + exprecovs->show(); } expmasksh->show(); + decays->hide(); break; @@ -4546,7 +4643,18 @@ void LocallabShadow::updateGUIToMode(const modeType new_type) if (!inverssh->get_active()) { // Keep widget hidden when inverssh is toggled expgradsh->show(); + exprecovs->show(); } + if (enaSHMask->get_active()) { + maskusables->show(); + maskunusables->hide(); + + } else { + maskusables->hide(); + maskunusables->show(); + } + exprecovs->show(); + decays->show(); expmasksh->show(); lapmaskSH->show(); @@ -4650,6 +4758,15 @@ void LocallabShadow::showmaskSHMethodChangedinv() void LocallabShadow::enaSHMaskChanged() { + if (enaSHMask->get_active()) { + maskusables->show(); + maskunusables->hide(); + + } else { + maskusables->hide(); + maskunusables->show(); + } + if (isLocActivated && exp->getEnabled()) { if (listener) { if (enaSHMask->get_active()) { @@ -4676,9 +4793,11 @@ void LocallabShadow::updateShadowGUI1() showmaskSHMethod->set_active(0); showmaskSHMethodConn.block(false); showmaskSHMethodinv->show(); + exprecovs->hide(); } else { if (mode == Expert || mode == Normal) { // Keep widget hidden in Simple mode expgradsh->show(); + exprecovs->show(); } showmaskSHMethod->show(); diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index d8378748a..140946972 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -448,6 +448,13 @@ private: Adjuster* const sh_radius; Adjuster* const sensihs; Adjuster* const blurSHde; + MyExpander* const exprecovs; + Gtk::Label* const maskusables; + Gtk::Label* const maskunusables; + Adjuster* const recothress; + Adjuster* const lowthress; + Adjuster* const higthress; + Adjuster* const decays; Gtk::Frame* const gamFrame; Adjuster* const gamSH; Adjuster* const sloSH; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index f7ea7f554..9bed07130 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1238,6 +1238,10 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).fatanchorSH = locallab.spots.at(j).fatanchorSH && pSpot.fatanchorSH == otherSpot.fatanchorSH; locallab.spots.at(j).gamSH = locallab.spots.at(j).gamSH && pSpot.gamSH == otherSpot.gamSH; locallab.spots.at(j).sloSH = locallab.spots.at(j).sloSH && pSpot.sloSH == otherSpot.sloSH; + locallab.spots.at(j).recothress = locallab.spots.at(j).recothress && pSpot.recothress == otherSpot.recothress; + locallab.spots.at(j).lowthress = locallab.spots.at(j).lowthress && pSpot.lowthress == otherSpot.lowthress; + locallab.spots.at(j).higthress = locallab.spots.at(j).higthress && pSpot.higthress == otherSpot.higthress; + locallab.spots.at(j).decays = locallab.spots.at(j).decays && pSpot.decays == otherSpot.decays; // Vibrance locallab.spots.at(j).visivibrance = locallab.spots.at(j).visivibrance && pSpot.visivibrance == otherSpot.visivibrance; locallab.spots.at(j).expvibrance = locallab.spots.at(j).expvibrance && pSpot.expvibrance == otherSpot.expvibrance; @@ -3903,6 +3907,22 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).sloSH = mods.locallab.spots.at(i).sloSH; } + if (locallab.spots.at(i).recothress) { + toEdit.locallab.spots.at(i).recothress = mods.locallab.spots.at(i).recothress; + } + + if (locallab.spots.at(i).lowthress) { + toEdit.locallab.spots.at(i).lowthress = mods.locallab.spots.at(i).lowthress; + } + + if (locallab.spots.at(i).higthress) { + toEdit.locallab.spots.at(i).higthress = mods.locallab.spots.at(i).higthress; + } + + if (locallab.spots.at(i).decays) { + toEdit.locallab.spots.at(i).decays = mods.locallab.spots.at(i).decays; + } + // Vibrance if (locallab.spots.at(i).visivibrance) { toEdit.locallab.spots.at(i).visivibrance = mods.locallab.spots.at(i).visivibrance; @@ -6652,6 +6672,10 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : fatanchorSH(v), gamSH(v), sloSH(v), + recothress(v), + lowthress(v), + higthress(v), + decays(v), // Vibrance visivibrance(v), expvibrance(v), @@ -7193,6 +7217,10 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) fatanchorSH = v; gamSH = v; sloSH = v; + recothress = v; + lowthress = v; + higthress = v; + decays = v; // Vibrance visivibrance = v; expvibrance = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index a30fa2022..c1fb0a232 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -575,6 +575,10 @@ public: bool fatanchorSH; bool gamSH; bool sloSH; + bool recothress; + bool lowthress; + bool higthress; + bool decays; // Vibrance bool visivibrance; bool expvibrance; From 036257859d6dc7494e892461eab3736b7144cb51 Mon Sep 17 00:00:00 2001 From: Desmis Date: Fri, 8 Jan 2021 17:17:44 +0100 Subject: [PATCH 044/129] Local adjustments - denoise - Change curve denoise and default settings (#6051) * Change parameters curve LA denoise * Change enable denoise and default curve * Change default curve level denoise * Change default reset and enable --- rtdata/languages/default | 3 ++- rtengine/iplocallab.cc | 56 ++++++++++++++++++++++++++-------------- rtengine/procparams.cc | 12 ++++----- rtgui/locallabtools.cc | 7 ++++- 4 files changed, 51 insertions(+), 27 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 90af69bdb..fb653eff1 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -3086,7 +3086,7 @@ TP_LOCALLAB_VIS_TOOLTIP;Click to show/hide selected Control Spot.\nCtr TP_LOCALLAB_WAMASKCOL;Ψ Mask Wavelet level TP_LOCALLAB_WARM;Warm/Cool & Color artifacts TP_LOCALLAB_WARM_TOOLTIP;This slider uses the CIECAM algorithm and acts as a White Balance control to make the color temperature of the selected area warmer or cooler.\nIt can also reduce color artifacts in some cases. -TP_LOCALLAB_WASDEN_TOOLTIP;Luminance noise reduction: the left-hand side of the curve corresponds to the first 3 levels 0,1, 2 (fine detail). The right hand side of the curve corresponds to the coarser details (level 3 and beyond). +TP_LOCALLAB_WASDEN_TOOLTIP;Luminance noise reduction: the left-hand side of the curve including the 'separation point' corresponds to the first 3 levels 0, 1, 2 (fine detail). The right hand side of the curve corresponds to the coarser details (level 3, 4, 5, 6). TP_LOCALLAB_WAT_BALTHRES_TOOLTIP;Balances the action within each level. TP_LOCALLAB_WAT_BLURLC_TOOLTIP;The default blur setting affects all 3 L*a* b* components (luminance and colour).\nWhen checked, only luminance is blurred. TP_LOCALLAB_WAT_CLARIC_TOOLTIP;“Merge chroma” is used to select the intensity of the desired effect on chrominance. @@ -3661,6 +3661,7 @@ TP_WAVELET_PASTEL;Pastel chroma TP_WAVELET_PROC;Process TP_WAVELET_PROTAB;Protection TP_WAVELET_QUAAGRES;Agressive +TP_WAVELET_QUANONE;None TP_WAVELET_QUACONSER;Conservative TP_WAVELET_RADIUS;Radius shadows - highlight TP_WAVELET_RANGEAB;Range a and b % diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 5d00d5bd8..3241e93e9 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -607,6 +607,9 @@ struct local_params { float noisechrodetail; float bilat; float noiselc; + float noiselc4; + float noiselc5; + float noiselc6; float noisecf; float noisecc; float mulloc[6]; @@ -629,6 +632,7 @@ struct local_params { bool sfena; bool cbdlena; bool denoiena; + bool wavcurvedenoi; bool expvib; bool exposena; bool hsena; @@ -859,6 +863,8 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.quamet = 0; } else if (locallab.spots.at(sp).quamethod == "agre") { lp.quamet = 1; + } else if (locallab.spots.at(sp).quamethod == "none") { + lp.quamet = 2; } if (locallab.spots.at(sp).shMethod == "std") { @@ -1026,6 +1032,9 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall float local_noiself0 = 0.f; float local_noiself2 = 0.f; float local_noiselc = 0.f; + float lnoiselc4 = 0.f; + float lnoiselc5 = 0.f; + float lnoiselc6 = 0.f; if (locwavCurveden && locwavdenutili) { if (lp.denoiena) { @@ -1040,12 +1049,15 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall if (wavcurveden) { if (lp.denoiena) { local_noiself0 = 250.f * locwavCurveden[0]; - local_noiself = 250.f * locwavCurveden[166]; - local_noiself2 = 250.f * locwavCurveden[333]; - local_noiselc = 200.f * locwavCurveden[500]; - } + local_noiself = 250.f * locwavCurveden[83]; + local_noiself2 = 250.f * locwavCurveden[166]; + local_noiselc = 200.f * locwavCurveden[250]; + lnoiselc4 = 250.f * locwavCurveden[333]; + lnoiselc5 = 250.f * locwavCurveden[416]; + lnoiselc6 = 250.f * locwavCurveden[500]; + } } - + lp.wavcurvedenoi = wavcurveden; float local_noiseldetail = (float)locallab.spots.at(sp).noiselumdetail; int local_noiselequal = locallab.spots.at(sp).noiselequal; float local_noisechrodetail = (float)locallab.spots.at(sp).noisechrodetail; @@ -1453,6 +1465,10 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.noiselequal = local_noiselequal; lp.noisechrodetail = local_noisechrodetail; lp.noiselc = local_noiselc; + lp.noiselc4 = lnoiselc4; + lp.noiselc5 = lnoiselc5; + lp.noiselc6 = lnoiselc6; + lp.noisecf = local_noisecf; lp.noisecc = local_noisecc; lp.sensden = local_sensiden; @@ -6273,11 +6289,11 @@ void ImProcFunctions::calc_ref(int sp, LabImage * original, LabImage * transform deltasobelL = new LabImage(spotSi, spotSi); bool isdenoise = false; - if ((lp.noiself > 0.f || lp.noiself0 > 0.f || lp.noiself2 > 0.f || lp.noiselc > 0.f || lp.noisecf > 0.f || lp.noisecc > 0.f) && lp.denoiena) { + if ((lp.noiself > 0.f || lp.noiself0 > 0.f || lp.noiself2 > 0.f || lp.wavcurvedenoi || lp.noiselc > 0.f || lp.noisecf > 0.f || lp.noisecc > 0.f) && lp.denoiena) { isdenoise = true; } - if (isdenoise) { + if (isdenoise) { origblur = new LabImage(spotSi, spotSi); blurorig = new LabImage(spotSi, spotSi); @@ -8850,9 +8866,9 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl bool execdenoi = noiscfactiv && ((lp.colorena && execcolor) || (lp.tonemapena && lp.strengt != 0.f) || (lp.cbdlena && execbdl) || (lp.sfena && lp.strng > 0.f) || (lp.lcena && lp.lcamount > 0.f) || (lp.sharpena && lp.shrad > 0.42) || (lp.retiena && lp.str > 0.f) || (lp.exposena && lp.expcomp != 0.f) || (lp.expvib && lp.past != 0.f)); bool execmaskden = (lp.showmaskblmet == 2 || lp.enablMask || lp.showmaskblmet == 3 || lp.showmaskblmet == 4) && lp.smasktyp != 0; - if (((lp.noiself > 0.f || lp.noiself0 > 0.f || lp.noiself2 > 0.f || lp.noiselc > 0.f || lp.noisecf > 0.f || lp.noisecc > 0.f + if (((lp.noiself > 0.f || lp.noiself0 > 0.f || lp.noiself2 > 0.f || lp.wavcurvedenoi || lp.noiselc > 0.f || lp.noisecf > 0.f || lp.noisecc > 0.f // || lp.showmaskblmet == 2 || lp.enablMask || lp.showmaskblmet == 3 || lp.showmaskblmet == 4 || aut == 1 || aut == 2) && lp.denoiena) || execdenoi) { // sk == 1 ?? - || execmaskden || aut == 1 || aut == 2) && lp.denoiena) || execdenoi) { // sk == 1 ?? + || execmaskden || aut == 1 || aut == 2) && lp.denoiena && lp.quamet != 2) || execdenoi) { // sk == 1 ?? StopWatch Stop1("locallab Denoise called"); @@ -8948,9 +8964,9 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl vari[2] = 0.8f * SQR((lp.noiself2 / 125.0) * (1.0 + lp.noiself2 / 25.0)); vari[3] = 0.8f * SQR((lp.noiselc / 125.0) * (1.0 + lp.noiselc / 25.0)); - vari[4] = 0.8f * SQR((lp.noiselc / 125.0) * (1.0 + lp.noiselc / 25.0)); - vari[5] = 0.8f * SQR((lp.noiselc / 125.0) * (1.0 + lp.noiselc / 25.0)); - vari[6] = 0.8f * SQR((lp.noiselc / 125.0) * (1.0 + lp.noiselc / 25.0)); + vari[4] = 0.8f * SQR((lp.noiselc4 / 125.0) * (1.0 + lp.noiselc4 / 25.0)); + vari[5] = 0.8f * SQR((lp.noiselc5 / 125.0) * (1.0 + lp.noiselc5 / 25.0)); + vari[6] = 0.8f * SQR((lp.noiselc6 / 125.0) * (1.0 + lp.noiselc6 / 25.0)); } else if (levred == 4) { edge = 3; vari[0] = 0.8f * SQR((lp.noiself0 / 125.0) * (1.0 + lp.noiself0 / 25.0)); @@ -9009,6 +9025,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl vari[3] = rtengine::max(0.000001f, kr3 * vari[3]); if (levred == 7) { + kr3 = kr4 = kr5 = 1.f; vari[4] = rtengine::max(0.000001f, kr4 * vari[4]); vari[5] = rtengine::max(0.000001f, kr5 * vari[5]); vari[6] = rtengine::max(0.000001f, kr5 * vari[6]); @@ -9418,7 +9435,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } if (!Ldecomp.memory_allocation_failed() && aut == 0) { - if ((lp.noiself >= 0.01f || lp.noiself0 >= 0.01f || lp.noiself2 >= 0.01f || lp.noiselc >= 0.01f) && levred == 7 && lp.noiseldetail != 100.f) { + if ((lp.noiself >= 0.01f || lp.noiself0 >= 0.01f || lp.noiself2 >= 0.01f || lp.wavcurvedenoi || lp.noiselc >= 0.01f) && levred == 7 && lp.noiseldetail != 100.f && lp.quamet != 2) { fftw_denoise(sk, GW, GH, max_numblox_W, min_numblox_W, tmp1.L, Lin, numThreads, lp, 0); } } @@ -9629,9 +9646,9 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl vari[2] = 0.8f * SQR((lp.noiself2 / 125.0) * (1.0 + lp.noiself2 / 25.0)); vari[3] = 0.8f * SQR((lp.noiselc / 125.0) * (1.0 + lp.noiselc / 25.0)); - vari[4] = 0.8f * SQR((lp.noiselc / 125.0) * (1.0 + lp.noiselc / 25.0)); - vari[5] = 0.8f * SQR((lp.noiselc / 125.0) * (1.0 + lp.noiselc / 25.0)); - vari[6] = 0.8f * SQR((lp.noiselc / 125.0) * (1.0 + lp.noiselc / 25.0)); + vari[4] = 0.8f * SQR((lp.noiselc4 / 125.0) * (1.0 + lp.noiselc4 / 25.0)); + vari[5] = 0.8f * SQR((lp.noiselc5 / 125.0) * (1.0 + lp.noiselc5 / 25.0)); + vari[6] = 0.8f * SQR((lp.noiselc6 / 125.0) * (1.0 + lp.noiselc6 / 25.0)); } else if (levred == 4) { edge = 3; vari[0] = 0.8f * SQR((lp.noiself0 / 125.0) * (1.0 + lp.noiself0 / 25.0)); @@ -9691,6 +9708,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl vari[3] = rtengine::max(0.000001f, kr3 * vari[3]); if (levred == 7) { + kr3 = kr4 = kr5 = 1.f; vari[4] = rtengine::max(0.000001f, kr4 * vari[4]); vari[5] = rtengine::max(0.000001f, kr5 * vari[5]); vari[6] = rtengine::max(0.000001f, kr5 * vari[6]); @@ -10100,7 +10118,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if (!Ldecomp.memory_allocation_failed() && aut == 0) { - if ((lp.noiself >= 0.01f || lp.noiself0 >= 0.01f || lp.noiself2 >= 0.01f || lp.noiselc >= 0.01f) && levred == 7 && lp.noiseldetail != 100.f) { + if ((lp.noiself >= 0.01f || lp.noiself0 >= 0.01f || lp.noiself2 >= 0.01f || lp.wavcurvedenoi || lp.noiselc >= 0.01f) && levred == 7 && lp.noiseldetail != 100.f && lp.quamet != 2) { fftw_denoise(sk, bfw, bfh, max_numblox_W, min_numblox_W, bufwv.L, Lin, numThreads, lp, 0); } } @@ -10956,7 +10974,7 @@ void ImProcFunctions::Lab_Local( //Prepare mask for Blur and noise and Denoise bool denoiz = false; - if ((lp.noiself > 0.f || lp.noiself0 > 0.f || lp.noiself2 > 0.f || lp.noiselc > 0.f || lp.noisecf > 0.f || lp.noisecc > 0.f || lp.bilat > 0.f) && lp.denoiena) { + if ((lp.noiself > 0.f || lp.noiself0 > 0.f || lp.noiself2 > 0.f || lp.noiselc > 0.f || lp.wavcurvedenoi || lp.noisecf > 0.f || lp.noisecc > 0.f || lp.bilat > 0.f) && lp.denoiena) { denoiz = true; } @@ -11755,7 +11773,7 @@ void ImProcFunctions::Lab_Local( } //local denoise - if (lp.denoiena && (lp.noiself > 0.f || lp.noiself0 > 0.f || lp.noiself2 > 0.f || lp.noiselc > 0.f || lp.noisecf > 0.f || lp.noisecc > 0.f )) {//disable denoise if not used + if (lp.denoiena && (lp.noiself > 0.f || lp.noiself0 > 0.f || lp.noiself2 > 0.f || lp.wavcurvedenoi || lp.noiselc > 0.f || lp.noisecf > 0.f || lp.noisecc > 0.f )) {//disable denoise if not used float slidL[8] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; float slida[8] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; float slidb[8] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 96587733f..63eefc334 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3324,7 +3324,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : epsbl(0), blMethod("blur"), chroMethod("lum"), - quamethod("cons"), + quamethod("none"), blurMethod("norm"), medMethod("33"), usemask(false), @@ -3350,15 +3350,15 @@ LocallabParams::LocallabSpot::LocallabSpot() : locwavcurveden{ static_cast(FCT_MinMaxCPoints), 0.0, - 0.0, - 0.0, + 0.09, 0.35, - 0.66, 0., - 0.35, + 0.33, + 0.17, + 0.33, 0.35, 1.0, - 0.0, + 0.03, 0.35, 0.35 }, diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 45eab0939..d7bf6bec3 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -6252,6 +6252,7 @@ LocallabBlur::LocallabBlur(): quamethod->append(M("TP_WAVELET_QUACONSER")); quamethod->append(M("TP_WAVELET_QUAAGRES")); + quamethod->append(M("TP_WAVELET_QUANONE")); quamethodconn = quamethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabBlur::quamethodChanged)); Gtk::Label* const quaLabel = Gtk::manage(new Gtk::Label(M("TP_WAVELET_DENQUA") + ":")); quaHBox->pack_start(*quaLabel, Gtk::PACK_SHRINK, 4); @@ -6678,7 +6679,7 @@ void LocallabBlur::neutral_pressed () adjblur->setValue(defSpot.adjblur); bilateral->setValue(defSpot.bilateral); sensiden->setValue(defSpot.sensiden); - quamethod->set_active (0); + quamethod->set_active (2); wavshapeden->setCurve(defSpot.locwavcurveden); wavhue->setCurve(defSpot.locwavcurvehue); usemask->set_active(defSpot.usemask); @@ -6828,6 +6829,8 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params quamethod->set_active(0); } else if (spot.quamethod == "agre") { quamethod->set_active(1); + } else if (spot.quamethod == "none") { + quamethod->set_active(2); } activlum->set_active(spot.activlum); @@ -6963,6 +6966,8 @@ void LocallabBlur::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.quamethod = "cons"; } else if (quamethod->get_active_row_number() == 1) { spot.quamethod = "agre"; + } else if (quamethod->get_active_row_number() == 2) { + spot.quamethod = "none"; } spot.activlum = activlum->get_active(); From a58376021b1300f415597ea0a8cda4604b317ea4 Mon Sep 17 00:00:00 2001 From: Desmis Date: Sun, 10 Jan 2021 10:16:33 +0100 Subject: [PATCH 045/129] Fixed too small spot in Tone mapping --- rtengine/iplocallab.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 3241e93e9..a2e5ab378 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -12235,7 +12235,8 @@ void ImProcFunctions::Lab_Local( const int bfh = yend - ystart; const int bfw = xend - xstart; - if (bfw >= mSP && bfh >= mSP) { + if (bfw >= mDEN && bfh >= mDEN) { + // printf("OK TM\n"); array2D buflight(bfw, bfh); JaggedArray bufchro(bfw, bfh); std::unique_ptr bufgb(new LabImage(bfw, bfh)); From c5519c0fe7c888ff341941192eff0fe7a765e8cf Mon Sep 17 00:00:00 2001 From: rom9 <4711834+rom9@users.noreply.github.com> Date: Sun, 10 Jan 2021 16:58:25 +0100 Subject: [PATCH 046/129] Film Negative bundled processing profile: disabled "Lock ratio" option in Crop tool. The aspect ratio of the negative is usually not the same as the digital image. --- rtdata/profiles/Film Negative.pp3 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rtdata/profiles/Film Negative.pp3 b/rtdata/profiles/Film Negative.pp3 index c298a6ea9..0ecac1d33 100644 --- a/rtdata/profiles/Film Negative.pp3 +++ b/rtdata/profiles/Film Negative.pp3 @@ -13,6 +13,9 @@ Curve2=1;0;0;0.0397505754145333;0.020171771436200074;0.54669745433149319;0.69419 Enabled=false Method=Blend +[Crop] +FixedRatio=false + [Color Management] InputProfile=(camera) ToneCurve=false From 291c866b53d5cb0672e41130c0944009608e41e6 Mon Sep 17 00:00:00 2001 From: Desmis Date: Sun, 10 Jan 2021 18:26:20 +0100 Subject: [PATCH 047/129] LA log encoding - forgotten enable mask in standard --- rtgui/locallabtools2.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index 8e71bb7f2..a5026d3a8 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -5292,7 +5292,7 @@ void LocallabLog::updateGUIToMode(const modeType new_type) surrHBox->show(); expL->hide(); surHBox->hide(); - expmaskL->hide(); + expmaskL->show(); gradlogFrame->show(); if (enaLMask->get_active()) { maskusablel->show(); @@ -5379,7 +5379,7 @@ void LocallabLog::convertParamToNormal() lightl->setValue(defSpot.lightl); lightq->setValue(defSpot.lightq); sursour->set_active(0); - enaLMask->set_active(false); +// enaLMask->set_active(true); decayl->setValue(defSpot.decayl); // Enable all listeners enableListener(); From f94cf7869675355ef1de18addc69c0b34bc4e444 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sun, 10 Jan 2021 21:33:00 +0100 Subject: [PATCH 048/129] Improvement for rcd demosaic, #6054 --- rtengine/rcd_demosaic.cc | 149 +++++++++++++++++++-------------------- 1 file changed, 73 insertions(+), 76 deletions(-) diff --git a/rtengine/rcd_demosaic.cc b/rtengine/rcd_demosaic.cc index c986dd601..7f76ddcdb 100644 --- a/rtengine/rcd_demosaic.cc +++ b/rtengine/rcd_demosaic.cc @@ -21,7 +21,6 @@ #include "rawimagesource.h" #include "rt_math.h" #include "../rtgui/multilangmgr.h" -#include "opthelper.h" #include "StopWatch.h" using namespace std; @@ -75,9 +74,10 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) } const unsigned int cfarray[2][2] = {{FC(0,0), FC(0,1)}, {FC(1,0), FC(1,1)}}; - constexpr int rcdBorder = 9; - constexpr int tileSize = 214; - constexpr int tileSizeN = tileSize - 2 * rcdBorder; + constexpr int rcdBorder = 6; + constexpr int tileBorder = 9; + constexpr int tileSize = 140; + constexpr int tileSizeN = tileSize - 2 * tileBorder; const int numTh = H / (tileSizeN) + ((H % (tileSizeN)) ? 1 : 0); const int numTw = W / (tileSizeN) + ((W % (tileSizeN)) ? 1 : 0); constexpr int w1 = tileSize, w2 = 2 * tileSize, w3 = 3 * tileSize, w4 = 4 * tileSize; @@ -96,6 +96,8 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) float *const VH_Dir = (float*) calloc(tileSize * tileSize, sizeof *VH_Dir); float *const PQ_Dir = (float*) calloc(tileSize * tileSize / 2, sizeof *PQ_Dir); float *const lpf = PQ_Dir; // reuse buffer, they don't overlap in usage + float *const P_CDiff_Hpf = (float*) calloc(tileSize * tileSize / 2, sizeof *P_CDiff_Hpf); + float *const Q_CDiff_Hpf = (float*) calloc(tileSize * tileSize / 2, sizeof *Q_CDiff_Hpf); #ifdef _OPENMP #pragma omp for schedule(dynamic, chunkSize) collapse(2) nowait @@ -104,12 +106,12 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) for (int tc = 0; tc < numTw; ++tc) { const int rowStart = tr * tileSizeN; const int rowEnd = std::min(rowStart + tileSize, H); - if (rowStart + rcdBorder == rowEnd - rcdBorder) { + if (rowStart + tileBorder == rowEnd - tileBorder) { continue; } const int colStart = tc * tileSizeN; const int colEnd = std::min(colStart + tileSize, W); - if (colStart + rcdBorder == colEnd - rcdBorder) { + if (colStart + tileBorder == colEnd - tileBorder) { continue; } @@ -134,15 +136,38 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) * STEP 1: Find cardinal and diagonal interpolation directions */ - for (int row = 4; row < tileRows - 4; row++) { - for (int col = 4, indx = row * tileSize + col; col < tilecols - 4; col++, indx++) { - const float cfai = cfa[indx]; - //Calculate h/v local discrimination - float V_Stat = std::max(epssq, -18.f * cfai * (cfa[indx - w1] + cfa[indx + w1] + 2.f * (cfa[indx - w2] + cfa[indx + w2]) - cfa[indx - w3] - cfa[indx + w3]) - 2.f * cfai * (cfa[indx - w4] + cfa[indx + w4] - 19.f * cfai) - cfa[indx - w1] * (70.f * cfa[indx + w1] + 12.f * cfa[indx - w2] - 24.f * cfa[indx + w2] + 38.f * cfa[indx - w3] - 16.f * cfa[indx + w3] - 12.f * cfa[indx - w4] + 6.f * cfa[indx + w4] - 46.f * cfa[indx - w1]) + cfa[indx + w1] * (24.f * cfa[indx - w2] - 12.f * cfa[indx + w2] + 16.f * cfa[indx - w3] - 38.f * cfa[indx + w3] - 6.f * cfa[indx - w4] + 12.f * cfa[indx + w4] + 46.f * cfa[indx + w1]) + cfa[indx - w2] * (14.f * cfa[indx + w2] - 12.f * cfa[indx + w3] - 2.f * cfa[indx - w4] + 2.f * cfa[indx + w4] + 11.f * cfa[indx - w2]) + cfa[indx + w2] * (-12.f * cfa[indx - w3] + 2.f * (cfa[indx - w4] - cfa[indx + w4]) + 11.f * cfa[indx + w2]) + cfa[indx - w3] * (2.f * cfa[indx + w3] - 6.f * cfa[indx - w4] + 10.f * cfa[indx - w3]) + cfa[indx + w3] * (-6.f * cfa[indx + w4] + 10.f * cfa[indx + w3]) + cfa[indx - w4] * cfa[indx - w4] + cfa[indx + w4] * cfa[indx + w4]); - float H_Stat = std::max(epssq, -18.f * cfai * (cfa[indx - 1] + cfa[indx + 1] + 2.f * (cfa[indx - 2] + cfa[indx + 2]) - cfa[indx - 3] - cfa[indx + 3]) - 2.f * cfai * (cfa[indx - 4] + cfa[indx + 4] - 19.f * cfai) - cfa[indx - 1] * (70.f * cfa[indx + 1] + 12.f * cfa[indx - 2] - 24.f * cfa[indx + 2] + 38.f * cfa[indx - 3] - 16.f * cfa[indx + 3] - 12.f * cfa[indx - 4] + 6.f * cfa[indx + 4] - 46.f * cfa[indx - 1]) + cfa[indx + 1] * (24.f * cfa[indx - 2] - 12.f * cfa[indx + 2] + 16.f * cfa[indx - 3] - 38.f * cfa[indx + 3] - 6.f * cfa[indx - 4] + 12.f * cfa[indx + 4] + 46.f * cfa[indx + 1]) + cfa[indx - 2] * (14.f * cfa[indx + 2] - 12.f * cfa[indx + 3] - 2.f * cfa[indx - 4] + 2.f * cfa[indx + 4] + 11.f * cfa[indx - 2]) + cfa[indx + 2] * (-12.f * cfa[indx - 3] + 2.f * (cfa[indx - 4] - cfa[indx + 4]) + 11.f * cfa[indx + 2]) + cfa[indx - 3] * (2.f * cfa[indx + 3] - 6.f * cfa[indx - 4] + 10.f * cfa[indx - 3]) + cfa[indx + 3] * (-6.f * cfa[indx + 4] + 10.f * cfa[indx + 3]) + cfa[indx - 4] * cfa[indx - 4] + cfa[indx + 4] * cfa[indx + 4]); + float bufferV[3][tileSize - 8]; + + // Step 1.1: Calculate the square of the vertical and horizontal color difference high pass filter + for (int row = 3; row < std::min(tileRows - 3, 5); ++row) { + for (int col = 4, indx = row * tileSize + col; col < tilecols - 4; ++col, ++indx) { + bufferV[row - 3][col - 4] = SQR((cfa[indx - w3] - cfa[indx - w1] - cfa[indx + w1] + cfa[indx + w3]) - 3.f * (cfa[indx - w2] + cfa[indx + w2]) + 6.f * cfa[indx]); + } + } + + // Step 1.2: Obtain the vertical and horizontal directional discrimination strength + + float bufferH[tileSize - 6] ALIGNED16; + float* V0 = bufferV[0]; + float* V1 = bufferV[1]; + float* V2 = bufferV[2]; + for (int row = 4; row < tileRows - 4; ++row) { + for (int col = 3, indx = row * tileSize + col; col < tilecols - 3; ++col, ++indx) { + bufferH[col - 3] = SQR((cfa[indx - 3] - cfa[indx - 1] - cfa[indx + 1] + cfa[indx + 3]) - 3.f * (cfa[indx - 2] + cfa[indx + 2]) + 6.f * cfa[indx]); + } + for (int col = 4, indx = (row + 1) * tileSize + col; col < tilecols - 4; ++col, ++indx) { + V2[col - 4] = SQR((cfa[indx - w3] - cfa[indx - w1] - cfa[indx + w1] + cfa[indx + w3]) - 3.f * (cfa[indx - w2] + cfa[indx + w2]) + 6.f * cfa[indx]); + } + for (int col = 4, indx = row * tileSize + col; col < tilecols - 4; ++col, ++indx) { + + float V_Stat = std::max(epssq, V0[col - 4] + V1[col - 4] + V2[col - 4]); + float H_Stat = std::max(epssq, bufferH[col - 4] + bufferH[col - 3] + bufferH[col - 2]); VH_Dir[indx] = V_Stat / (V_Stat + H_Stat); } + // rotate pointers from row0, row1, row2 to row1, row2, row0 + std::swap(V0, V2); + std::swap(V0, V1); } /** @@ -150,11 +175,11 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) */ // Step 2.1: Low pass filter incorporating green, red and blue local samples from the raw data - for (int row = 2; row < tileRows - 2; row++) { + for (int row = 2; row < tileRows - 2; ++row) { for (int col = 2 + (fc(cfarray, row, 0) & 1), indx = row * tileSize + col, lpindx = indx / 2; col < tilecols - 2; col += 2, indx += 2, ++lpindx) { - lpf[lpindx] = 0.25f * cfa[indx] + - 0.125f * (cfa[indx - w1] + cfa[indx + w1] + cfa[indx - 1] + cfa[indx + 1]) + - 0.0625f * (cfa[indx - w1 - 1] + cfa[indx - w1 + 1] + cfa[indx + w1 - 1] + cfa[indx + w1 + 1]); + lpf[lpindx] = cfa[indx] + + 0.5f * (cfa[indx - w1] + cfa[indx + w1] + cfa[indx - 1] + cfa[indx + 1]) + + 0.25f * (cfa[indx - w1 - 1] + cfa[indx - w1 + 1] + cfa[indx + w1 - 1] + cfa[indx + w1 + 1]); } } @@ -162,48 +187,8 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) * STEP 3: Populate the green channel */ // Step 3.1: Populate the green channel at blue and red CFA positions - for (int row = 4; row < tileRows - 4; row++) { - int col = 4 + (fc(cfarray, row, 0) & 1); - int indx = row * tileSize + col; - int lpindx = indx / 2; -#ifdef __SSE2__ - const vfloat zd5v = F2V(0.5f); - const vfloat zd25v = F2V(0.25f); - const vfloat epsv = F2V(eps); - for (; col < tilecols - 7; col += 8, indx += 8, lpindx += 4) { - // Cardinal gradients - const vfloat cfai = LC2VFU(cfa[indx]); - const vfloat N_Grad = epsv + (vabsf(LC2VFU(cfa[indx - w1]) - LC2VFU(cfa[indx + w1])) + vabsf(cfai - LC2VFU(cfa[indx - w2]))) + (vabsf(LC2VFU(cfa[indx - w1]) - LC2VFU(cfa[indx - w3])) + vabsf(LC2VFU(cfa[indx - w2]) - LC2VFU(cfa[indx - w4]))); - const vfloat S_Grad = epsv + (vabsf(LC2VFU(cfa[indx - w1]) - LC2VFU(cfa[indx + w1])) + vabsf(cfai - LC2VFU(cfa[indx + w2]))) + (vabsf(LC2VFU(cfa[indx + w1]) - LC2VFU(cfa[indx + w3])) + vabsf(LC2VFU(cfa[indx + w2]) - LC2VFU(cfa[indx + w4]))); - const vfloat W_Grad = epsv + (vabsf(LC2VFU(cfa[indx - 1]) - LC2VFU(cfa[indx + 1])) + vabsf(cfai - LC2VFU(cfa[indx - 2]))) + (vabsf(LC2VFU(cfa[indx - 1]) - LC2VFU(cfa[indx - 3])) + vabsf(LC2VFU(cfa[indx - 2]) - LC2VFU(cfa[indx - 4]))); - const vfloat E_Grad = epsv + (vabsf(LC2VFU(cfa[indx - 1]) - LC2VFU(cfa[indx + 1])) + vabsf(cfai - LC2VFU(cfa[indx + 2]))) + (vabsf(LC2VFU(cfa[indx + 1]) - LC2VFU(cfa[indx + 3])) + vabsf(LC2VFU(cfa[indx + 2]) - LC2VFU(cfa[indx + 4]))); - - // Cardinal pixel estimations - const vfloat lpfi = LVFU(lpf[lpindx]); - const vfloat N_Est = LC2VFU(cfa[indx - w1]) + (LC2VFU(cfa[indx - w1]) * (lpfi - LVFU(lpf[lpindx - w1])) / (epsv + lpfi + LVFU(lpf[lpindx - w1]))); - const vfloat S_Est = LC2VFU(cfa[indx + w1]) + (LC2VFU(cfa[indx + w1]) * (lpfi - LVFU(lpf[lpindx + w1])) / (epsv + lpfi + LVFU(lpf[lpindx + w1]))); - const vfloat W_Est = LC2VFU(cfa[indx - 1]) + (LC2VFU(cfa[indx - 1]) * (lpfi - LVFU(lpf[lpindx - 1])) / (epsv + lpfi + LVFU(lpf[lpindx - 1]))); - const vfloat E_Est = LC2VFU(cfa[indx + 1]) + (LC2VFU(cfa[indx + 1]) * (lpfi - LVFU(lpf[lpindx + 1])) / (epsv + lpfi + LVFU(lpf[lpindx + 1]))); - - // Vertical and horizontal estimations - const vfloat V_Est = (S_Grad * N_Est + N_Grad * S_Est) / (N_Grad + S_Grad); - const vfloat H_Est = (W_Grad * E_Est + E_Grad * W_Est) / (E_Grad + W_Grad); - - // G@B and G@R interpolation - // Refined vertical and horizontal local discrimination - const vfloat VH_Central_Value = LC2VFU(VH_Dir[indx]); - const vfloat VH_Neighbourhood_Value = zd25v * ((LC2VFU(VH_Dir[indx - w1 - 1]) + LC2VFU(VH_Dir[indx - w1 + 1])) + (LC2VFU(VH_Dir[indx + w1 - 1]) + LC2VFU(VH_Dir[indx + w1 + 1]))); - -#if defined(__clang__) - const vfloat VH_Disc = vself(vmaskf_lt(vabsf(zd5v - VH_Central_Value), vabsf(zd5v - VH_Neighbourhood_Value)), VH_Neighbourhood_Value, VH_Central_Value); -#else - const vfloat VH_Disc = vabsf(zd5v - VH_Central_Value) < vabsf(zd5v - VH_Neighbourhood_Value) ? VH_Neighbourhood_Value : VH_Central_Value; -#endif - const vfloat result = vintpf(VH_Disc, H_Est, V_Est); - STC2VFU(rgb[1][indx], result); - } -#endif - for (; col < tilecols - 4; col += 2, indx += 2, ++lpindx) { + for (int row = 4; row < tileRows - 4; ++row) { + for (int col = 4 + (fc(cfarray, row, 0) & 1), indx = row * tileSize + col, lpindx = indx / 2; col < tilecols - 4; col += 2, indx += 2, ++lpindx) { // Cardinal gradients const float cfai = cfa[indx]; const float N_Grad = eps + (std::fabs(cfa[indx - w1] - cfa[indx + w1]) + std::fabs(cfai - cfa[indx - w2])) + (std::fabs(cfa[indx - w1] - cfa[indx - w3]) + std::fabs(cfa[indx - w2] - cfa[indx - w4])); @@ -213,10 +198,10 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) // Cardinal pixel estimations const float lpfi = lpf[lpindx]; - const float N_Est = cfa[indx - w1] * (1.f + (lpfi - lpf[lpindx - w1]) / (eps + lpfi + lpf[lpindx - w1])); - const float S_Est = cfa[indx + w1] * (1.f + (lpfi - lpf[lpindx + w1]) / (eps + lpfi + lpf[lpindx + w1])); - const float W_Est = cfa[indx - 1] * (1.f + (lpfi - lpf[lpindx - 1]) / (eps + lpfi + lpf[lpindx - 1])); - const float E_Est = cfa[indx + 1] * (1.f + (lpfi - lpf[lpindx + 1]) / (eps + lpfi + lpf[lpindx + 1])); + const float N_Est = cfa[indx - w1] * (lpfi + lpfi) / (eps + lpfi + lpf[lpindx - w1]); + const float S_Est = cfa[indx + w1] * (lpfi + lpfi) / (eps + lpfi + lpf[lpindx + w1]); + const float W_Est = cfa[indx - 1] * (lpfi + lpfi) / (eps + lpfi + lpf[lpindx - 1]); + const float E_Est = cfa[indx + 1] * (lpfi + lpfi) / (eps + lpfi + lpf[lpindx + 1]); // Vertical and horizontal estimations const float V_Est = (S_Grad * N_Est + N_Grad * S_Est) / (N_Grad + S_Grad); @@ -236,21 +221,26 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) * STEP 4: Populate the red and blue channels */ - // Step 4.1: Calculate P/Q diagonal local discrimination - for (int row = rcdBorder - 4; row < tileRows - rcdBorder + 4; row++) { - for (int col = rcdBorder - 4 + (fc(cfarray, row, rcdBorder) & 1), indx = row * tileSize + col, pqindx = indx / 2; col < tilecols - rcdBorder + 4; col += 2, indx += 2, ++pqindx) { - const float cfai = cfa[indx]; + // Step 4.0: Calculate the square of the P/Q diagonals color difference high pass filter + for (int row = 3; row < tileRows - 3; ++row) { + for (int col = 3, indx = row * tileSize + col, indx2 = indx / 2; col < tilecols - 3; col+=2, indx+=2, indx2++ ) { + P_CDiff_Hpf[indx2] = SQR((cfa[indx - w3 - 3] - cfa[indx - w1 - 1] - cfa[indx + w1 + 1] + cfa[indx + w3 + 3]) - 3.f * (cfa[indx - w2 - 2] + cfa[indx + w2 + 2]) + 6.f * cfa[indx]); + Q_CDiff_Hpf[indx2] = SQR((cfa[indx - w3 + 3] - cfa[indx - w1 + 1] - cfa[indx + w1 - 1] + cfa[indx + w3 - 3]) - 3.f * (cfa[indx - w2 + 2] + cfa[indx + w2 - 2]) + 6.f * cfa[indx]); + } + } - float P_Stat = std::max(epssq, - 18.f * cfai * (cfa[indx - w1 - 1] + cfa[indx + w1 + 1] + 2.f * (cfa[indx - w2 - 2] + cfa[indx + w2 + 2]) - cfa[indx - w3 - 3] - cfa[indx + w3 + 3]) - 2.f * cfai * (cfa[indx - w4 - 4] + cfa[indx + w4 + 4] - 19.f * cfai) - cfa[indx - w1 - 1] * (70.f * cfa[indx + w1 + 1] - 12.f * cfa[indx - w2 - 2] + 24.f * cfa[indx + w2 + 2] - 38.f * cfa[indx - w3 - 3] + 16.f * cfa[indx + w3 + 3] + 12.f * cfa[indx - w4 - 4] - 6.f * cfa[indx + w4 + 4] + 46.f * cfa[indx - w1 - 1]) + cfa[indx + w1 + 1] * (24.f * cfa[indx - w2 - 2] - 12.f * cfa[indx + w2 + 2] + 16.f * cfa[indx - w3 - 3] - 38.f * cfa[indx + w3 + 3] - 6.f * cfa[indx - w4 - 4] + 12.f * cfa[indx + w4 + 4] + 46.f * cfa[indx + w1 + 1]) + cfa[indx - w2 - 2] * (14.f * cfa[indx + w2 + 2] - 12.f * cfa[indx + w3 + 3] - 2.f * (cfa[indx - w4 - 4] - cfa[indx + w4 + 4]) + 11.f * cfa[indx - w2 - 2]) - cfa[indx + w2 + 2] * (12.f * cfa[indx - w3 - 3] + 2.f * (cfa[indx - w4 - 4] - cfa[indx + w4 + 4]) + 11.f * cfa[indx + w2 + 2]) + cfa[indx - w3 - 3] * (2.f * cfa[indx + w3 + 3] - 6.f * cfa[indx - w4 - 4] + 10.f * cfa[indx - w3 - 3]) - cfa[indx + w3 + 3] * (6.f * cfa[indx + w4 + 4] + 10.f * cfa[indx + w3 + 3]) + cfa[indx - w4 - 4] * cfa[indx - w4 - 4] + cfa[indx + w4 + 4] * cfa[indx + w4 + 4]); - float Q_Stat = std::max(epssq, - 18.f * cfai * (cfa[indx + w1 - 1] + cfa[indx - w1 + 1] + 2.f * (cfa[indx + w2 - 2] + cfa[indx - w2 + 2]) - cfa[indx + w3 - 3] - cfa[indx - w3 + 3]) - 2.f * cfai * (cfa[indx + w4 - 4] + cfa[indx - w4 + 4] - 19.f * cfai) - cfa[indx + w1 - 1] * (70.f * cfa[indx - w1 + 1] - 12.f * cfa[indx + w2 - 2] + 24.f * cfa[indx - w2 + 2] - 38.f * cfa[indx + w3 - 3] + 16.f * cfa[indx - w3 + 3] + 12.f * cfa[indx + w4 - 4] - 6.f * cfa[indx - w4 + 4] + 46.f * cfa[indx + w1 - 1]) + cfa[indx - w1 + 1] * (24.f * cfa[indx + w2 - 2] - 12.f * cfa[indx - w2 + 2] + 16.f * cfa[indx + w3 - 3] - 38.f * cfa[indx - w3 + 3] - 6.f * cfa[indx + w4 - 4] + 12.f * cfa[indx - w4 + 4] + 46.f * cfa[indx - w1 + 1]) + cfa[indx + w2 - 2] * (14.f * cfa[indx - w2 + 2] - 12.f * cfa[indx - w3 + 3] - 2.f * (cfa[indx + w4 - 4] - cfa[indx - w4 + 4]) + 11.f * cfa[indx + w2 - 2]) - cfa[indx - w2 + 2] * (12.f * cfa[indx + w3 - 3] + 2.f * (cfa[indx + w4 - 4] - cfa[indx - w4 + 4]) + 11.f * cfa[indx - w2 + 2]) + cfa[indx + w3 - 3] * (2.f * cfa[indx - w3 + 3] - 6.f * cfa[indx + w4 - 4] + 10.f * cfa[indx + w3 - 3]) - cfa[indx - w3 + 3] * (6.f * cfa[indx - w4 + 4] + 10.f * cfa[indx - w3 + 3]) + cfa[indx + w4 - 4] * cfa[indx + w4 - 4] + cfa[indx - w4 + 4] * cfa[indx - w4 + 4]); - - PQ_Dir[pqindx] = P_Stat / (P_Stat + Q_Stat); + // Step 4.1: Obtain the P/Q diagonals directional discrimination strength + for (int row = 4; row < tileRows - 4; ++row) { + for (int col = 4 + FC(row, 0) & 1, indx = row * tileSize + col, indx2 = indx / 2, indx3 = (indx - w1 - 1) / 2, indx4 = (indx + w1 - 1) / 2; col < tilecols - 4; col += 2, indx += 2, indx2++, indx3++, indx4++ ) { + float P_Stat = std::max(epssq, P_CDiff_Hpf[indx3] + P_CDiff_Hpf[indx2] + P_CDiff_Hpf[indx4 + 1]); + float Q_Stat = std::max(epssq, Q_CDiff_Hpf[indx3 + 1] + Q_CDiff_Hpf[indx2] + Q_CDiff_Hpf[indx4]); + PQ_Dir[indx2] = P_Stat / (P_Stat + Q_Stat); } } // Step 4.2: Populate the red and blue channels at blue and red CFA positions - for (int row = rcdBorder - 3; row < tileRows - rcdBorder + 3; row++) { - for (int col = rcdBorder - 3 + (fc(cfarray, row, rcdBorder - 1) & 1), indx = row * tileSize + col, c = 2 - fc(cfarray, row, col), pqindx = indx / 2, pqindx2 = (indx - w1 - 1) / 2, pqindx3 = (indx + w1 - 1) / 2; col < tilecols - rcdBorder + 3; col += 2, indx += 2, ++pqindx, ++pqindx2, ++pqindx3) { + for (int row = 4; row < tileRows - 4; ++row) { + for (int col = 4 + (fc(cfarray, row, 0) & 1), indx = row * tileSize + col, c = 2 - fc(cfarray, row, col), pqindx = indx / 2, pqindx2 = (indx - w1 - 1) / 2, pqindx3 = (indx + w1 - 1) / 2; col < tilecols - 4; col += 2, indx += 2, ++pqindx, ++pqindx2, ++pqindx3) { // Refined P/Q diagonal local discrimination float PQ_Central_Value = PQ_Dir[pqindx]; @@ -280,8 +270,8 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) } // Step 4.3: Populate the red and blue channels at green CFA positions - for (int row = rcdBorder; row < tileRows - rcdBorder; row++) { - for (int col = rcdBorder + (fc(cfarray, row, rcdBorder - 1) & 1), indx = row * tileSize + col; col < tilecols - rcdBorder; col += 2, indx += 2) { + for (int row = 4; row < tileRows - 4; ++row) { + for (int col = 4 + (fc(cfarray, row, 1) & 1), indx = row * tileSize + col; col < tilecols - 4; col += 2, indx += 2) { // Refined vertical and horizontal local discrimination float VH_Central_Value = VH_Dir[indx]; @@ -323,8 +313,13 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) } } - for (int row = rowStart + rcdBorder; row < rowEnd - rcdBorder; ++row) { - for (int col = colStart + rcdBorder; col < colEnd - rcdBorder; ++col) { + // For the outermost tiles in all directions we can use a smaller border margin + const int last_vertical = rowEnd - ((tr == numTh - 1) ? rcdBorder : tileBorder); + const int first_horizontal = colStart + ((tc == 0) ? rcdBorder : tileBorder); + const int last_horizontal = colEnd - ((tc == numTw - 1) ? rcdBorder : tileBorder); + for(int row = rowStart + ((tr == 0) ? rcdBorder : tileBorder); row < last_vertical; row++) { +// for (int row = rowStart + tileBorder; row < rowEnd - tileBorder; ++row) { + for (int col = first_horizontal; col < last_horizontal; ++col) { int idx = (row - rowStart) * tileSize + col - colStart ; red[row][col] = std::max(0.f, rgb[0][idx] * scale); green[row][col] = std::max(0.f, rgb[1][idx] * scale); @@ -352,6 +347,8 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) free(rgb); free(VH_Dir); free(PQ_Dir); + free(P_CDiff_Hpf); + free(Q_CDiff_Hpf); } border_interpolate(W, H, rcdBorder, rawData, red, green, blue); From d36545b71a48cd8ae3a4eeccd318baedcf86b9e1 Mon Sep 17 00:00:00 2001 From: Thanatomanic <6567747+Thanatomanic@users.noreply.github.com> Date: Mon, 11 Jan 2021 18:03:44 +0100 Subject: [PATCH 049/129] Update camconst.json with basic support for Canon EOS-1D X M3 --- rtengine/camconst.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rtengine/camconst.json b/rtengine/camconst.json index 0a34b4436..35b6715b9 100644 --- a/rtengine/camconst.json +++ b/rtengine/camconst.json @@ -400,6 +400,13 @@ Camera constants: ] } }, + + { // Quality C, initial data by @agriggio, white frame samples provided by @noirsabb in #5862, color charts not processed yet + "make_model" : "CANON EOS-1D X MARK III", + "raw_crop": [ 72, 38, 5496, 3670 ], + "masked_areas" : [ 40, 10, 5534, 70 ], + "ranges" : { "white" : 16382 } + }, { // Quality A "make_model": "Canon EOS 5D Mark III", From 0ba18ab68792098fdfc51909b2c169689431e8b8 Mon Sep 17 00:00:00 2001 From: Desmis Date: Tue, 12 Jan 2021 06:58:21 +0100 Subject: [PATCH 050/129] Local adjustments - Vibrance and Warm Cool - Recovery based on luminance mask (#6055) * GUI for Vibrance Recovery based on luminance mask * Enable LA Vibrance Recovery based on luminance mask --- rtdata/languages/default | 7 +++ rtengine/iplocallab.cc | 22 ++++++++ rtengine/procevents.h | 4 ++ rtengine/procparams.cc | 16 ++++++ rtengine/procparams.h | 4 ++ rtengine/refreshmap.cc | 6 ++- rtgui/locallabtools.cc | 112 +++++++++++++++++++++++++++++++++++++++ rtgui/locallabtools.h | 7 +++ rtgui/paramsedited.cc | 28 ++++++++++ rtgui/paramsedited.h | 4 ++ 10 files changed, 209 insertions(+), 1 deletion(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index fb653eff1..875a2d212 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1257,6 +1257,10 @@ HISTORY_MSG_1009;Local - SH recovery threshold HISTORY_MSG_1010;Local - SH threshold mask low HISTORY_MSG_1011;Local - SH threshold mask high HISTORY_MSG_1012;Local - SH decay +HISTORY_MSG_1013;Local - vib recovery threshold +HISTORY_MSG_1014;Local - vib threshold mask low +HISTORY_MSG_1015;Local - vib threshold mask high +HISTORY_MSG_1016;Local - vib decay HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance @@ -2797,10 +2801,12 @@ TP_LOCALLAB_MASKGF_TOOLTIP;Used to direct the Guided Filter based on the image l TP_LOCALLAB_MASKRECOL_TOOLTIP;Used to modulate the effect of the Color and Light settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Color and Light settings \n In between these two areas, the full value of the Color and Light settings will be applied TP_LOCALLAB_MASKREEXP_TOOLTIP;Used to modulate the effect of the 'Dynamic range and Exposure' settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings \n In between these two areas, the full value of the 'Dynamic range and Exposure' settings will be applied TP_LOCALLAB_MASKRESH_TOOLTIP;Used to modulate the effect of the Shadows Highlights settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Shadows Highlights settings \n In between these two areas, the full value of the Shadows Highlights settings will be applied +TP_LOCALLAB_MASKRESVIB_TOOLTIP;Used to modulate the effect of the Vibrance and Warm Cool settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Vibrance and Warm Cool settings \n In between these two areas, the full value of the Vibrance and Warm Cool settings will be applied TP_LOCALLAB_MASKRELOG_TOOLTIP;Used to modulate the effect of the Log encoding settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Log encoding settings - can be used to restore highlights reconstructed by Color propagation \n In between these two areas, the full value of the Log encoding settings will be applied TP_LOCALLAB_MASKDEINV_TOOLTIP;Reverses the way the algorithm interprets the mask.\nIf checked black and very light areas will be decreased. TP_LOCALLAB_MASKHIGTHRESC_TOOLTIP;Light-tone limit above which Color and Light will be restored progressively to their original values prior to being modified by the Color and Light settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, 'Blur mask', ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESS_TOOLTIP;Light-tone limit above which Shadows Highlights will be restored progressively to their original values prior to being modified by the Shadows Highlights settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKHIGTHRESVIB_TOOLTIP;Light-tone limit above which Vibrance and Warm Cool will be restored progressively to their original values prior to being modified by the Vibrance and Warm Cool settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESE_TOOLTIP;Light-tone limit above which 'Dynamic range and Exposure' will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESL_TOOLTIP;Light-tone limit above which Log encoding will be restored progressively to their original values prior to being modified by the Log encoding settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESD_TOOLTIP;Light-tone limit above which denoise will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 @@ -2814,6 +2820,7 @@ TP_LOCALLAB_MASKLOWTHRESC_TOOLTIP;Dark-tone limit below which Color and Light wi TP_LOCALLAB_MASKLOWTHRESL_TOOLTIP;Dark-tone limit below which Log encoding will be restored progressively to their original values prior to being modified by the Log encoding settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESE_TOOLTIP;Dark-tone limit below which 'Dynamic range and Exposure' will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESS_TOOLTIP;Dark-tone limit below which Shadows Highligts will be restored progressively to their original values prior to being modified by the Shadows Highlights settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKLOWTHRESVIB_TOOLTIP;Dark-tone limit below which Vibrance and Wram Cool will be restored progressively to their original values prior to being modified by the Vibrance and Warm Cool settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLCTHRMID;Gray area denoise TP_LOCALLAB_MASKUSABLE;Mask enabled (Mask & modifications) diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index a2e5ab378..daf638375 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -595,6 +595,10 @@ struct local_params { float lowthre; float higthre; float decaye; + float recothrv; + float lowthrv; + float higthrv; + float decayv; float recothrs; float lowthrs; float higthrs; @@ -1081,6 +1085,11 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall float local_higthre = (float)locallab.spots.at(sp).higthrese; float local_decaye = (float)locallab.spots.at(sp).decaye; + float local_recothrv = (float)locallab.spots.at(sp).recothresv; + float local_lowthrv = (float)locallab.spots.at(sp).lowthresv; + float local_higthrv = (float)locallab.spots.at(sp).higthresv; + float local_decayv = (float)locallab.spots.at(sp).decayv; + float local_recothrs = (float)locallab.spots.at(sp).recothress; float local_lowthrs = (float)locallab.spots.at(sp).lowthress; float local_higthrs = (float)locallab.spots.at(sp).higthress; @@ -1457,6 +1466,10 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.lowthrs = local_lowthrs; lp.higthrs = local_higthrs; lp.decays = local_decays; + lp.recothrv = local_recothrv; + lp.lowthrv = local_lowthrv; + lp.higthrv = local_higthrv; + lp.decayv = local_decayv; lp.recothrl = local_recothrl; lp.lowthrl = local_lowthrl; @@ -12207,6 +12220,15 @@ void ImProcFunctions::Lab_Local( ImProcFunctions::ciecamloc_02float(sp, bufexpfin.get(), 2); } + if(lp.enavibMask && lp.recothrv != 1.f) { + float hig = lp.higthrv; + float low = lp.lowthrv; + float recoth = lp.recothrv; + float decay = lp.decayv; + bool invmask = false; + maskrecov(bufexpfin.get(), original, bufmaskorigvib.get(), bfh, bfw, ystart, xstart, hig, low, recoth, decay, invmask, sk, multiThread); + } + transit_shapedetect2(call, 2, bufexporig.get(), bufexpfin.get(), originalmaskvib.get(), hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 292b0cfbc..1dcd1b260 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -1035,6 +1035,10 @@ enum ProcEventCode { Evlocallablowthress = 1009, Evlocallabhigthress = 1010, Evlocallabdecays = 1011, + Evlocallabrecothresv = 1012, + Evlocallablowthresv = 1013, + Evlocallabhigthresv = 1014, + Evlocallabdecayv = 1015, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 63eefc334..926948440 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3292,6 +3292,10 @@ LocallabParams::LocallabSpot::LocallabSpot() : 1.0, 1.0 }, + recothresv(1.), + lowthresv(12.), + higthresv(85.), + decayv(2.), // Soft Light visisoft(false), expsoft(false), @@ -4362,6 +4366,10 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && strvibh == other.strvibh && angvib == other.angvib && Lmaskvibcurve == other.Lmaskvibcurve + && recothresv == other.recothresv + && lowthresv == other.lowthresv + && higthresv == other.higthresv + && decayv == other.decayv // Soft Light && visisoft == other.visisoft && expsoft == other.expsoft @@ -5972,6 +5980,10 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->strvibh, "Locallab", "Strvibh_" + index_str, spot.strvibh, keyFile); saveToKeyfile(!pedited || spot_edited->angvib, "Locallab", "Angvib_" + index_str, spot.angvib, keyFile); saveToKeyfile(!pedited || spot_edited->Lmaskvibcurve, "Locallab", "LmaskvibCurve_" + index_str, spot.Lmaskvibcurve, keyFile); + saveToKeyfile(!pedited || spot_edited->recothresv, "Locallab", "Recothresv_" + index_str, spot.recothresv, keyFile); + saveToKeyfile(!pedited || spot_edited->lowthresv, "Locallab", "Lowthresv_" + index_str, spot.lowthresv, keyFile); + saveToKeyfile(!pedited || spot_edited->higthresv, "Locallab", "Higthresv_" + index_str, spot.higthresv, keyFile); + saveToKeyfile(!pedited || spot_edited->decayv, "Locallab", "Decayv_" + index_str, spot.decayv, keyFile); } // Soft Light if ((!pedited || spot_edited->visisoft) && spot.visisoft) { @@ -7794,6 +7806,10 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Strvibh_" + index_str, pedited, spot.strvibh, spotEdited.strvibh); assignFromKeyfile(keyFile, "Locallab", "Angvib_" + index_str, pedited, spot.angvib, spotEdited.angvib); assignFromKeyfile(keyFile, "Locallab", "LmaskvibCurve_" + index_str, pedited, spot.Lmaskvibcurve, spotEdited.Lmaskvibcurve); + assignFromKeyfile(keyFile, "Locallab", "Recothresv_" + index_str, pedited, spot.recothresv, spotEdited.recothresv); + assignFromKeyfile(keyFile, "Locallab", "Lowthresv_" + index_str, pedited, spot.lowthresv, spotEdited.lowthresv); + assignFromKeyfile(keyFile, "Locallab", "Higthresv_" + index_str, pedited, spot.higthresv, spotEdited.higthresv); + assignFromKeyfile(keyFile, "Locallab", "Decayv_" + index_str, pedited, spot.decayv, spotEdited.decayv); // Soft Light spot.visisoft = assignFromKeyfile(keyFile, "Locallab", "Expsoft_" + index_str, pedited, spot.expsoft, spotEdited.expsoft); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 9008805ad..e1355579d 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1199,6 +1199,10 @@ struct LocallabParams { double strvibh; double angvib; std::vector Lmaskvibcurve; + double recothresv; + double lowthresv; + double higthresv; + double decayv; // Soft Light bool visisoft; bool expsoft; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 940b9882c..512d048d1 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -1038,7 +1038,11 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabrecothress LUMINANCECURVE, // Evlocallablowthress LUMINANCECURVE, // Evlocallabhigthress - LUMINANCECURVE // Evlocallabdecays + LUMINANCECURVE, // Evlocallabdecays + LUMINANCECURVE, // Evlocallabrecothrev + LUMINANCECURVE, // Evlocallablowthresv + LUMINANCECURVE, // Evlocallabhigthresv + LUMINANCECURVE // Evlocallabdecayv }; diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index d7bf6bec3..5db535ae2 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -4859,6 +4859,13 @@ LocallabVibrance::LocallabVibrance(): sensiv(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 15))), curveEditorGG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_VIBRANCE_CURVEEDITOR_SKINTONES_LABEL"))), skinTonesCurve(static_cast(curveEditorGG->addCurve(CT_Diagonal, M("TP_VIBRANCE_CURVEEDITOR_SKINTONES")))), + exprecovv(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI2_EXP")))), + maskusablev(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUSABLE")))), + maskunusablev(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUNUSABLE")))), + recothresv(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKRECOTHRES"), 1., 2., 0.01, 1.))), + lowthresv(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 80., 0.5, 12.))), + higthresv(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 20., 99., 0.5, 85.))), + decayv(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKDDECAY"), 0.5, 4., 0.1, 2.))), expgradvib(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_EXPGRAD")))), strvib(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADSTR"), -4., 4., 0.05, 0.))), strvibab(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADSTRCHRO"), -4., 4., 0.05, 0.))), @@ -4921,6 +4928,12 @@ LocallabVibrance::LocallabVibrance(): curveEditorGG->curveListComplete(); + recothresv->setAdjusterListener(this); + lowthresv->setAdjusterListener(this); + higthresv->setAdjusterListener(this); + decayv->setAdjusterListener(this); + setExpandAlignProperties(exprecovv, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); + setExpandAlignProperties(expgradvib, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); strvib->setAdjusterListener(this); @@ -4994,6 +5007,17 @@ LocallabVibrance::LocallabVibrance(): pack_start(*pastSatTog, Gtk::PACK_SHRINK, 0); // pack_start(*sensiv, Gtk::PACK_SHRINK, 0); pack_start(*curveEditorGG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor + ToolParamBlock* const vibBox3 = Gtk::manage(new ToolParamBlock()); + vibBox3->pack_start(*maskusablev, Gtk::PACK_SHRINK, 0); + vibBox3->pack_start(*maskunusablev, Gtk::PACK_SHRINK, 0); + vibBox3->pack_start(*recothresv); + vibBox3->pack_start(*lowthresv); + vibBox3->pack_start(*higthresv); + vibBox3->pack_start(*decayv); + // colBox3->pack_start(*invmaskc); + exprecovv->add(*vibBox3, false); + pack_start(*exprecovv, false, false); + ToolParamBlock* const gradvibBox = Gtk::manage(new ToolParamBlock()); gradvibBox->pack_start(*strvib); gradvibBox->pack_start(*strvibab); @@ -5046,6 +5070,7 @@ void LocallabVibrance::updateAdviceTooltips(const bool showTooltips) exp->set_tooltip_text(M("TP_LOCALLAB_VIBRA_TOOLTIP")); warm->set_tooltip_text(M("TP_LOCALLAB_WARM_TOOLTIP")); strvib->set_tooltip_text(M("TP_LOCALLAB_GRADGEN_TOOLTIP")); + exprecovv->set_tooltip_markup(M("TP_LOCALLAB_MASKRESVIB_TOOLTIP")); expmaskvib->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); CCmaskvibshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); LLmaskvibshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP")); @@ -5077,6 +5102,9 @@ void LocallabVibrance::updateAdviceTooltips(const bool showTooltips) pastSatTog->set_tooltip_text(""); sensiv->set_tooltip_text(""); curveEditorGG->set_tooltip_text(""); + decayv->set_tooltip_text(M("TP_LOCALLAB_MASKDECAY_TOOLTIP")); + lowthresv->set_tooltip_text(M("TP_LOCALLAB_MASKLOWTHRESVIB_TOOLTIP")); + higthresv->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRESVIB_TOOLTIP")); } else { exp->set_tooltip_text(""); @@ -5102,11 +5130,16 @@ void LocallabVibrance::updateAdviceTooltips(const bool showTooltips) pastSatTog->set_tooltip_text(""); sensiv->set_tooltip_text(""); curveEditorGG->set_tooltip_text(""); + exprecovv->set_tooltip_markup(""); + decayv->set_tooltip_text(""); + lowthresv->set_tooltip_text(""); + higthresv->set_tooltip_text(""); } } void LocallabVibrance::setDefaultExpanderVisibility() { + exprecovv->set_expanded(false); expgradvib->set_expanded(false); expmaskvib->set_expanded(false); } @@ -5174,6 +5207,10 @@ void LocallabVibrance::read(const rtengine::procparams::ProcParams* pp, const Pa gammaskvib->setValue(spot.gammaskvib); slomaskvib->setValue(spot.slomaskvib); Lmaskvibshape->setCurve(spot.Lmaskvibcurve); + recothresv->setValue((double)spot.recothresv); + lowthresv->setValue((double)spot.lowthresv); + higthresv->setValue((double)spot.higthresv); + decayv->setValue((double)spot.decayv); } // Enable all listeners @@ -5223,6 +5260,10 @@ void LocallabVibrance::write(rtengine::procparams::ProcParams* pp, ParamsEdited* spot.gammaskvib = gammaskvib->getValue(); spot.slomaskvib = slomaskvib->getValue(); spot.Lmaskvibcurve = Lmaskvibshape->getCurve(); + spot.recothresv = recothresv->getValue(); + spot.lowthresv = lowthresv->getValue(); + spot.higthresv = higthresv->getValue(); + spot.decayv = decayv->getValue(); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -5251,6 +5292,10 @@ void LocallabVibrance::setDefaults(const rtengine::procparams::ProcParams* defPa chromaskvib->setDefault(defSpot.chromaskvib); gammaskvib->setDefault(defSpot.gammaskvib); slomaskvib->setDefault(defSpot.slomaskvib); + recothresv->setDefault((double)defSpot.recothresv); + lowthresv->setDefault((double)defSpot.lowthresv); + higthresv->setDefault((double)defSpot.higthresv); + decayv->setDefault((double)defSpot.decayv); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -5292,6 +5337,35 @@ void LocallabVibrance::adjusterChanged(Adjuster* a, double newval) } } + if (a == recothresv) { + + if (listener) { + listener->panelChanged(Evlocallabrecothresv, + recothresv->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == lowthresv) { + if (listener) { + listener->panelChanged(Evlocallablowthresv, + lowthresv->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == higthresv) { + if (listener) { + listener->panelChanged(Evlocallabhigthresv, + higthresv->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == decayv) { + if (listener) { + listener->panelChanged(Evlocallabdecayv, + decayv->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + if (a == strvib) { if (listener) { listener->panelChanged(Evlocallabstrvib, @@ -5496,6 +5570,7 @@ void LocallabVibrance::convertParamToNormal() lapmaskvib->setValue(defSpot.lapmaskvib); gammaskvib->setValue(defSpot.gammaskvib); slomaskvib->setValue(defSpot.slomaskvib); + decayv->setValue(defSpot.decayv); // Enable all listeners enableListener(); @@ -5524,6 +5599,10 @@ void LocallabVibrance::convertParamToSimple() // radmaskvib->setValue(defSpot.radmaskvib); // chromaskvib->setValue(defSpot.chromaskvib); // Lmaskvibshape->setCurve(defSpot.Lmaskvibcurve); + recothresv->setValue(defSpot.recothresv); + lowthresv->setValue(defSpot.lowthresv); + higthresv->setValue(defSpot.higthresv); + decayv->setValue(defSpot.decayv); // Enable all listener enableListener(); @@ -5543,6 +5622,10 @@ void LocallabVibrance::updateGUIToMode(const modeType new_type) curveEditorGG->hide(); expgradvib->hide(); expmaskvib->hide(); + exprecovv->hide(); + decayv->hide(); + maskusablev->hide(); + maskunusablev->hide(); break; @@ -5563,6 +5646,16 @@ void LocallabVibrance::updateGUIToMode(const modeType new_type) // Specific Simple mode widgets are shown in Normal mode expgradvib->show(); expmaskvib->show(); + exprecovv->show(); + decayv->hide(); + if (enavibMask->get_active()) { + maskusablev->show(); + maskunusablev->hide(); + + } else { + maskusablev->hide(); + maskunusablev->show(); + } break; @@ -5582,6 +5675,16 @@ void LocallabVibrance::updateGUIToMode(const modeType new_type) lapmaskvib->show(); gammaskvib->show(); slomaskvib->show(); + exprecovv->show(); + decayv->show(); + if (enavibMask->get_active()) { + maskusablev->show(); + maskunusablev->hide(); + + } else { + maskusablev->hide(); + maskunusablev->show(); + } } } @@ -5664,6 +5767,15 @@ void LocallabVibrance::showmaskvibMethodChanged() void LocallabVibrance::enavibMaskChanged() { + if (enavibMask->get_active()) { + maskusablev->show(); + maskunusablev->hide(); + + } else { + maskusablev->hide(); + maskunusablev->show(); + } + if (isLocActivated && exp->getEnabled()) { if (listener) { if (enavibMask->get_active()) { diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index 140946972..964b91132 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -540,6 +540,13 @@ private: Adjuster* const sensiv; CurveEditorGroup* const curveEditorGG; DiagonalCurveEditor* const skinTonesCurve; + MyExpander* const exprecovv; + Gtk::Label* const maskusablev; + Gtk::Label* const maskunusablev; + Adjuster* const recothresv; + Adjuster* const lowthresv; + Adjuster* const higthresv; + Adjuster* const decayv; MyExpander* const expgradvib; Adjuster* const strvib; Adjuster* const strvibab; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 9bed07130..db61a85ec 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1270,6 +1270,10 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).strvibh = locallab.spots.at(j).strvibh && pSpot.strvibh == otherSpot.strvibh; locallab.spots.at(j).angvib = locallab.spots.at(j).angvib && pSpot.angvib == otherSpot.angvib; locallab.spots.at(j).Lmaskvibcurve = locallab.spots.at(j).Lmaskvibcurve && pSpot.Lmaskvibcurve == otherSpot.Lmaskvibcurve; + locallab.spots.at(j).recothresv = locallab.spots.at(j).recothresv && pSpot.recothresv == otherSpot.recothresv; + locallab.spots.at(j).lowthresv = locallab.spots.at(j).lowthresv && pSpot.lowthresv == otherSpot.lowthresv; + locallab.spots.at(j).higthresv = locallab.spots.at(j).higthresv && pSpot.higthresv == otherSpot.higthresv; + locallab.spots.at(j).decayv = locallab.spots.at(j).decayv && pSpot.decayv == otherSpot.decayv; // Soft Light locallab.spots.at(j).visisoft = locallab.spots.at(j).visisoft && pSpot.visisoft == otherSpot.visisoft; locallab.spots.at(j).expsoft = locallab.spots.at(j).expsoft && pSpot.expsoft == otherSpot.expsoft; @@ -4032,6 +4036,22 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).Lmaskvibcurve = mods.locallab.spots.at(i).Lmaskvibcurve; } + if (locallab.spots.at(i).recothresv) { + toEdit.locallab.spots.at(i).recothresv = mods.locallab.spots.at(i).recothresv; + } + + if (locallab.spots.at(i).lowthresv) { + toEdit.locallab.spots.at(i).lowthresv = mods.locallab.spots.at(i).lowthresv; + } + + if (locallab.spots.at(i).higthresv) { + toEdit.locallab.spots.at(i).higthresv = mods.locallab.spots.at(i).higthresv; + } + + if (locallab.spots.at(i).decayv) { + toEdit.locallab.spots.at(i).decayv = mods.locallab.spots.at(i).decayv; + } + // Soft Light if (locallab.spots.at(i).visisoft) { toEdit.locallab.spots.at(i).visisoft = mods.locallab.spots.at(i).visisoft; @@ -6704,6 +6724,10 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : strvibh(v), angvib(v), Lmaskvibcurve(v), + recothresv(v), + lowthresv(v), + higthresv(v), + decayv(v), // Soft Light visisoft(v), expsoft(v), @@ -7249,6 +7273,10 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) strvibh = v; angvib = v; Lmaskvibcurve = v; + recothresv = v; + lowthresv = v; + higthresv = v; + decayv = v; // Soft Light visisoft = v; expsoft = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index c1fb0a232..bcc18ff30 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -607,6 +607,10 @@ public: bool strvibh; bool angvib; bool Lmaskvibcurve; + bool recothresv; + bool lowthresv; + bool higthresv; + bool decayv; // Soft Light bool visisoft; bool expsoft; From e7cc10bbae216a8afa80ef9819a6cd8b9b0f11ad Mon Sep 17 00:00:00 2001 From: Franz Trischberger Date: Tue, 12 Jan 2021 09:19:14 +0200 Subject: [PATCH 051/129] Add ORI to the recognized file formats Disabled by default as .ori extension might be used to identify a file as "original". When shooting Olympus High Res files the camera saves the High Res file as .orf and the first of the 8 frames as .ori. The .ori can later be used to fix artefacts from motion or as a backup if the whole High Res came out flawed. --- rtdata/options/options.lin | 4 ++-- rtdata/options/options.osx | 4 ++-- rtdata/options/options.win | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/rtdata/options/options.lin b/rtdata/options/options.lin index 580390b28..fbd8bc6cb 100644 --- a/rtdata/options/options.lin +++ b/rtdata/options/options.lin @@ -12,8 +12,8 @@ MultiUser=true [File Browser] # Image filename extensions to be looked for, and their corresponding search state (0/1 -> skip/include) -ParseExtensions=3fr;arw;arq;cr2;cr3;crf;crw;dcr;dng;fff;iiq;jpg;jpeg;kdc;mef;mos;mrw;nef;nrw;orf;pef;png;raf;raw;rw2;rwl;rwz;sr2;srf;srw;tif;tiff;x3f; -ParseExtensionsEnabled=1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;1;1; +ParseExtensions=3fr;arw;arq;cr2;cr3;crf;crw;dcr;dng;fff;iiq;jpg;jpeg;kdc;mef;mos;mrw;nef;nrw;orf;ori;pef;png;raf;raw;rw2;rwl;rwz;sr2;srf;srw;tif;tiff;x3f; +ParseExtensionsEnabled=1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;0;1;1;1;1;1;1;1;1;1;1;1; [Output] PathTemplate=%p1/converted/%f diff --git a/rtdata/options/options.osx b/rtdata/options/options.osx index c83aea179..cf31210e6 100644 --- a/rtdata/options/options.osx +++ b/rtdata/options/options.osx @@ -13,8 +13,8 @@ UseSystemTheme=false [File Browser] # Image filename extensions to be looked for, and their corresponding search state (0/1 -> skip/include) -ParseExtensions=3fr;arw;arq;cr2;cr3;crf;crw;dcr;dng;fff;iiq;jpg;jpeg;kdc;mef;mos;mrw;nef;nrw;orf;pef;png;raf;raw;rw2;rwl;rwz;sr2;srf;srw;tif;tiff;x3f; -ParseExtensionsEnabled=1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;1;1; +ParseExtensions=3fr;arw;arq;cr2;cr3;crf;crw;dcr;dng;fff;iiq;jpg;jpeg;kdc;mef;mos;mrw;nef;nrw;orf;ori;pef;png;raf;raw;rw2;rwl;rwz;sr2;srf;srw;tif;tiff;x3f; +ParseExtensionsEnabled=1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;0;1;1;1;1;1;1;1;1;1;1;1; [Output] PathTemplate=%p1/converted/%f diff --git a/rtdata/options/options.win b/rtdata/options/options.win index a54e021b1..00b74d07f 100644 --- a/rtdata/options/options.win +++ b/rtdata/options/options.win @@ -14,8 +14,8 @@ UseSystemTheme=false [File Browser] # Image filename extensions to be looked for, and their corresponding search state (0/1 -> skip/include) -ParseExtensions=3fr;arw;arq;cr2;cr3;crf;crw;dcr;dng;fff;iiq;jpg;jpeg;kdc;mef;mos;mrw;nef;nrw;orf;pef;png;raf;raw;rw2;rwl;rwz;sr2;srf;srw;tif;tiff;x3f; -ParseExtensionsEnabled=1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;1;1; +ParseExtensions=3fr;arw;arq;cr2;cr3;crf;crw;dcr;dng;fff;iiq;jpg;jpeg;kdc;mef;mos;mrw;nef;nrw;orf;ori;pef;png;raf;raw;rw2;rwl;rwz;sr2;srf;srw;tif;tiff;x3f; +ParseExtensionsEnabled=1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;0;1;1;1;1;1;1;1;1;1;1;1; [Output] PathTemplate=%p1/converted/%f From 8037457a8d544f28660117886d4962d0a928a3d2 Mon Sep 17 00:00:00 2001 From: Desmis Date: Tue, 12 Jan 2021 15:14:56 +0100 Subject: [PATCH 052/129] Local adjustment - local contrast - wavelet - Recovery based on luminance mask (#6057) * LA GUI Lc and Wavelet - recovery based on luminance mask * Enable LA Lc wavelet Recovery based on luminance mask --- rtdata/languages/default | 10 +++- rtengine/iplocallab.cc | 21 +++++++ rtengine/procevents.h | 4 ++ rtengine/procparams.cc | 16 ++++++ rtengine/procparams.h | 4 ++ rtengine/refreshmap.cc | 6 +- rtgui/locallabtools.h | 7 +++ rtgui/locallabtools2.cc | 116 +++++++++++++++++++++++++++++++++++++++ rtgui/paramsedited.cc | 28 ++++++++++ rtgui/paramsedited.h | 4 ++ 10 files changed, 214 insertions(+), 2 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 875a2d212..68c9b0a8d 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1261,6 +1261,10 @@ HISTORY_MSG_1013;Local - vib recovery threshold HISTORY_MSG_1014;Local - vib threshold mask low HISTORY_MSG_1015;Local - vib threshold mask high HISTORY_MSG_1016;Local - vib decay +HISTORY_MSG_1017;Local - lc recovery threshold +HISTORY_MSG_1018;Local - lc threshold mask low +HISTORY_MSG_1019;Local - lc threshold mask high +HISTORY_MSG_1020;Local - lc decay HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance @@ -2802,11 +2806,14 @@ TP_LOCALLAB_MASKRECOL_TOOLTIP;Used to modulate the effect of the Color and Light TP_LOCALLAB_MASKREEXP_TOOLTIP;Used to modulate the effect of the 'Dynamic range and Exposure' settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings \n In between these two areas, the full value of the 'Dynamic range and Exposure' settings will be applied TP_LOCALLAB_MASKRESH_TOOLTIP;Used to modulate the effect of the Shadows Highlights settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Shadows Highlights settings \n In between these two areas, the full value of the Shadows Highlights settings will be applied TP_LOCALLAB_MASKRESVIB_TOOLTIP;Used to modulate the effect of the Vibrance and Warm Cool settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Vibrance and Warm Cool settings \n In between these two areas, the full value of the Vibrance and Warm Cool settings will be applied +TP_LOCALLAB_MASKRESWAV_TOOLTIP;Used to modulate the effect of the Local contrast and Wavelet settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Local contrast and Wavelet settings \n In between these two areas, the full value of the Local contrast and Wavelet settings will be applied TP_LOCALLAB_MASKRELOG_TOOLTIP;Used to modulate the effect of the Log encoding settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Log encoding settings - can be used to restore highlights reconstructed by Color propagation \n In between these two areas, the full value of the Log encoding settings will be applied TP_LOCALLAB_MASKDEINV_TOOLTIP;Reverses the way the algorithm interprets the mask.\nIf checked black and very light areas will be decreased. TP_LOCALLAB_MASKHIGTHRESC_TOOLTIP;Light-tone limit above which Color and Light will be restored progressively to their original values prior to being modified by the Color and Light settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, 'Blur mask', ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESS_TOOLTIP;Light-tone limit above which Shadows Highlights will be restored progressively to their original values prior to being modified by the Shadows Highlights settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESVIB_TOOLTIP;Light-tone limit above which Vibrance and Warm Cool will be restored progressively to their original values prior to being modified by the Vibrance and Warm Cool settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKHIGTHRESWAV_TOOLTIP;Light-tone limit above which Local contrast and Wavelet will be restored progressively to their original values prior to being modified by the Local contrast and Wavelet settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 + TP_LOCALLAB_MASKHIGTHRESE_TOOLTIP;Light-tone limit above which 'Dynamic range and Exposure' will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESL_TOOLTIP;Light-tone limit above which Log encoding will be restored progressively to their original values prior to being modified by the Log encoding settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESD_TOOLTIP;Light-tone limit above which denoise will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 @@ -2820,7 +2827,8 @@ TP_LOCALLAB_MASKLOWTHRESC_TOOLTIP;Dark-tone limit below which Color and Light wi TP_LOCALLAB_MASKLOWTHRESL_TOOLTIP;Dark-tone limit below which Log encoding will be restored progressively to their original values prior to being modified by the Log encoding settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESE_TOOLTIP;Dark-tone limit below which 'Dynamic range and Exposure' will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESS_TOOLTIP;Dark-tone limit below which Shadows Highligts will be restored progressively to their original values prior to being modified by the Shadows Highlights settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 -TP_LOCALLAB_MASKLOWTHRESVIB_TOOLTIP;Dark-tone limit below which Vibrance and Wram Cool will be restored progressively to their original values prior to being modified by the Vibrance and Warm Cool settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKLOWTHRESVIB_TOOLTIP;Dark-tone limit below which Vibrance and Warm Cool will be restored progressively to their original values prior to being modified by the Vibrance and Warm Cool settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKLOWTHRESWAV_TOOLTIP;Dark-tone limit below which Local contrast and Wavelet will be restored progressively to their original values prior to being modified by the Local contrast and Wavelet settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLCTHRMID;Gray area denoise TP_LOCALLAB_MASKUSABLE;Mask enabled (Mask & modifications) diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index daf638375..cfb56afb9 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -599,6 +599,10 @@ struct local_params { float lowthrv; float higthrv; float decayv; + float recothrw; + float lowthrw; + float higthrw; + float decayw; float recothrs; float lowthrs; float higthrs; @@ -1090,6 +1094,11 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall float local_higthrv = (float)locallab.spots.at(sp).higthresv; float local_decayv = (float)locallab.spots.at(sp).decayv; + float local_recothrw = (float)locallab.spots.at(sp).recothresw; + float local_lowthrw = (float)locallab.spots.at(sp).lowthresw; + float local_higthrw = (float)locallab.spots.at(sp).higthresw; + float local_decayw = (float)locallab.spots.at(sp).decayw; + float local_recothrs = (float)locallab.spots.at(sp).recothress; float local_lowthrs = (float)locallab.spots.at(sp).lowthress; float local_higthrs = (float)locallab.spots.at(sp).higthress; @@ -1470,6 +1479,10 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.lowthrv = local_lowthrv; lp.higthrv = local_higthrv; lp.decayv = local_decayv; + lp.recothrw = local_recothrw; + lp.lowthrw = local_lowthrw; + lp.higthrw = local_higthrw; + lp.decayw = local_decayw; lp.recothrl = local_recothrl; lp.lowthrl = local_lowthrl; @@ -13289,6 +13302,14 @@ void ImProcFunctions::Lab_Local( } } + if(lp.enalcMask && lp.recothrw != 1.f) { + float hig = lp.higthrw; + float low = lp.lowthrw; + float recoth = lp.recothrw; + float decay = lp.decayw; + bool invmask = false; + maskrecov(tmp1.get(), original, bufmaskoriglc.get(), bfh, bfw, ystart, xstart, hig, low, recoth, decay, invmask, sk, multiThread); + } transit_shapedetect2(call, 10, bufgb.get(), tmp1.get(), originalmasklc.get(), hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); tmp1.reset(); diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 1dcd1b260..5d30e8cb4 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -1039,6 +1039,10 @@ enum ProcEventCode { Evlocallablowthresv = 1013, Evlocallabhigthresv = 1014, Evlocallabdecayv = 1015, + Evlocallabrecothresw = 1016, + Evlocallablowthresw = 1017, + Evlocallabhigthresw = 1018, + Evlocallabdecayw = 1019, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 926948440..476c79318 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3868,6 +3868,10 @@ LocallabParams::LocallabSpot::LocallabSpot() : 1.0, 1.0 }, + recothresw(1.), + lowthresw(12.), + higthresw(85.), + decayw(2.), // Contrast by detail levels visicbdl(false), expcbdl(false), @@ -4596,6 +4600,10 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && radmasklc == other.radmasklc && chromasklc == other.chromasklc && Lmasklccurve == other.Lmasklccurve + && recothresw == other.recothresw + && lowthresw == other.lowthresw + && higthresw == other.higthresw + && decayw == other.decayw // Contrast by detail levels && visicbdl == other.visicbdl && expcbdl == other.expcbdl @@ -6216,6 +6224,10 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->radmasklc, "Locallab", "Radmasklc_" + index_str, spot.radmasklc, keyFile); saveToKeyfile(!pedited || spot_edited->chromasklc, "Locallab", "Chromasklc_" + index_str, spot.chromasklc, keyFile); saveToKeyfile(!pedited || spot_edited->Lmasklccurve, "Locallab", "LmasklcCurve_" + index_str, spot.Lmasklccurve, keyFile); + saveToKeyfile(!pedited || spot_edited->recothresw, "Locallab", "Recothresw_" + index_str, spot.recothresw, keyFile); + saveToKeyfile(!pedited || spot_edited->lowthresw, "Locallab", "Lowthresw_" + index_str, spot.lowthresw, keyFile); + saveToKeyfile(!pedited || spot_edited->higthresw, "Locallab", "Higthresw_" + index_str, spot.higthresw, keyFile); + saveToKeyfile(!pedited || spot_edited->decayw, "Locallab", "Decayw_" + index_str, spot.decayw, keyFile); } // Contrast by detail levels if ((!pedited || spot_edited->visicbdl) && spot.visicbdl) { @@ -8080,6 +8092,10 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Radmasklc_" + index_str, pedited, spot.radmasklc, spotEdited.radmasklc); assignFromKeyfile(keyFile, "Locallab", "Chromasklc_" + index_str, pedited, spot.chromasklc, spotEdited.chromasklc); assignFromKeyfile(keyFile, "Locallab", "LmasklcCurve_" + index_str, pedited, spot.Lmasklccurve, spotEdited.Lmasklccurve); + assignFromKeyfile(keyFile, "Locallab", "Recothresw_" + index_str, pedited, spot.recothresw, spotEdited.recothresw); + assignFromKeyfile(keyFile, "Locallab", "Lowthresw_" + index_str, pedited, spot.lowthresw, spotEdited.lowthresw); + assignFromKeyfile(keyFile, "Locallab", "Higthresw_" + index_str, pedited, spot.higthresw, spotEdited.higthresw); + assignFromKeyfile(keyFile, "Locallab", "Decayw_" + index_str, pedited, spot.decayw, spotEdited.decayw); // Contrast by detail levels spot.visicbdl = assignFromKeyfile(keyFile, "Locallab", "Expcbdl_" + index_str, pedited, spot.expcbdl, spotEdited.expcbdl); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index e1355579d..dd394de7d 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1429,6 +1429,10 @@ struct LocallabParams { double radmasklc; double chromasklc; std::vector Lmasklccurve; + double recothresw; + double lowthresw; + double higthresw; + double decayw; // Contrast by detail levels bool visicbdl; bool expcbdl; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 512d048d1..75dff967f 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -1042,7 +1042,11 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabrecothrev LUMINANCECURVE, // Evlocallablowthresv LUMINANCECURVE, // Evlocallabhigthresv - LUMINANCECURVE // Evlocallabdecayv + LUMINANCECURVE, // Evlocallabdecayv + LUMINANCECURVE, // Evlocallabrecothrew + LUMINANCECURVE, // Evlocallablowthresw + LUMINANCECURVE, // Evlocallabhigthresw + LUMINANCECURVE // Evlocallabdecayw }; diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index 964b91132..bd8f7f665 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -1111,6 +1111,13 @@ private: FlatCurveEditor* const wavshapecomp; Adjuster* const fatres; Gtk::CheckButton* const fftwlc; + MyExpander* const exprecovw; + Gtk::Label* const maskusablew; + Gtk::Label* const maskunusablew; + Adjuster* const recothresw; + Adjuster* const lowthresw; + Adjuster* const higthresw; + Adjuster* const decayw; MyExpander* const expmasklc; MyComboBoxText* const showmasklcMethod; Gtk::CheckButton* const enalcMask; diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index a5026d3a8..31015735d 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -2169,6 +2169,14 @@ LocallabContrast::LocallabContrast(): wavshapecomp(static_cast(LocalcurveEditorwavcomp->addCurve(CT_Flat, "", nullptr, false, false))), fatres(Gtk::manage(new Adjuster(M("TP_LOCALLAB_FATRES"), 0., 100., 1., 0.))), fftwlc(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_FFTW")))), + exprecovw(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI2_EXP")))), + maskusablew(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUSABLE")))), + maskunusablew(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUNUSABLE")))), + recothresw(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKRECOTHRES"), 1., 2., 0.01, 1.))), + lowthresw(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 80., 0.5, 12.))), + higthresw(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 20., 99., 0.5, 85.))), + decayw(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKDDECAY"), 0.5, 4., 0.1, 2.))), + expmasklc(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_SHOWLC")))), showmasklcMethod(Gtk::manage(new MyComboBoxText())), enalcMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))), @@ -2381,6 +2389,13 @@ LocallabContrast::LocallabContrast(): fftwlcConn = fftwlc->signal_toggled().connect(sigc::mem_fun(*this, &LocallabContrast::fftwlcChanged)); + recothresw->setAdjusterListener(this); + lowthresw->setAdjusterListener(this); + higthresw->setAdjusterListener(this); + decayw->setAdjusterListener(this); + setExpandAlignProperties(exprecovw, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); + + setExpandAlignProperties(expmasklc, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); showmasklcMethod->append(M("TP_LOCALLAB_SHOWMNONE")); @@ -2561,6 +2576,17 @@ LocallabContrast::LocallabContrast(): expcontrastpyr2->add(*blurcontBox2, false); pack_start(*expcontrastpyr2); pack_start(*fftwlc); + ToolParamBlock* const wwBox3 = Gtk::manage(new ToolParamBlock()); + wwBox3->pack_start(*maskusablew, Gtk::PACK_SHRINK, 0); + wwBox3->pack_start(*maskunusablew, Gtk::PACK_SHRINK, 0); + wwBox3->pack_start(*recothresw); + wwBox3->pack_start(*lowthresw); + wwBox3->pack_start(*higthresw); + wwBox3->pack_start(*decayw); + // colBox3->pack_start(*invmaskc); + exprecovw->add(*wwBox3, false); + pack_start(*exprecovw, false, false); + ToolParamBlock* const masklcBox = Gtk::manage(new ToolParamBlock()); masklcBox->pack_start(*showmasklcMethod, Gtk::PACK_SHRINK, 4); masklcBox->pack_start(*enalcMask, Gtk::PACK_SHRINK, 0); @@ -2611,6 +2637,7 @@ void LocallabContrast::updateAdviceTooltips(const bool showTooltips) levelwav->set_tooltip_markup(M("TP_LOCALLAB_LEVELWAV_TOOLTIP")); clariFrame->set_tooltip_markup(M("TP_LOCALLAB_CLARI_TOOLTIP")); clarisoft->set_tooltip_markup(M("TP_LOCALLAB_CLARISOFT_TOOLTIP")); + exprecovw->set_tooltip_markup(M("TP_LOCALLAB_MASKRESWAV_TOOLTIP")); wavshape->setTooltip(M("TP_LOCALLAB_WAT_WAVSHAPE_TOOLTIP")); clarilres->set_tooltip_text(M("TP_LOCALLAB_WAT_CLARIL_TOOLTIP")); @@ -2670,6 +2697,9 @@ void LocallabContrast::updateAdviceTooltips(const bool showTooltips) masklcCurveEditorG->set_tooltip_markup(M("TP_LOCALLAB_MASKCURVE_TOOLTIP")); chromasklc->set_tooltip_text(M("TP_LOCALLAB_CHROMASK_TOOLTIP")); sensilc->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP")); + decayw->set_tooltip_text(M("TP_LOCALLAB_MASKDECAY_TOOLTIP")); + lowthresw->set_tooltip_text(M("TP_LOCALLAB_MASKLOWTHRESWAV_TOOLTIP")); + higthresw->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRESWAV_TOOLTIP")); } else { contFrame->set_tooltip_text(""); LocalcurveEditorwav->set_tooltip_markup(""); @@ -2734,6 +2764,10 @@ void LocallabContrast::updateAdviceTooltips(const bool showTooltips) wavshapecomp->setTooltip(""); threswav->set_tooltip_text(""); residcomp->set_tooltip_text(""); + exprecovw->set_tooltip_markup(""); + decayw->set_tooltip_text(""); + lowthresw->set_tooltip_text(""); + higthresw->set_tooltip_text(""); } } @@ -2744,6 +2778,7 @@ void LocallabContrast::setDefaultExpanderVisibility() expcontrastpyr->set_expanded(false); expcontrastpyr2->set_expanded(false); expmasklc->set_expanded(false); + exprecovw->set_expanded(false); } void LocallabContrast::disableListener() @@ -2898,6 +2933,10 @@ void LocallabContrast::read(const rtengine::procparams::ProcParams* pp, const Pa radmasklc->setValue(spot.radmasklc); chromasklc->setValue(spot.chromasklc); Lmasklcshape->setCurve(spot.Lmasklccurve); + recothresw->setValue((double)spot.recothresw); + lowthresw->setValue((double)spot.lowthresw); + higthresw->setValue((double)spot.higthresw); + decayw->setValue((double)spot.decayw); } // Enable all listeners @@ -3016,6 +3055,10 @@ void LocallabContrast::write(rtengine::procparams::ProcParams* pp, ParamsEdited* spot.radmasklc = radmasklc->getValue(); spot.chromasklc = chromasklc->getValue(); spot.Lmasklccurve = Lmasklcshape->getCurve(); + spot.recothresw = recothresw->getValue(); + spot.lowthresw = lowthresw->getValue(); + spot.higthresw = higthresw->getValue(); + spot.decayw = decayw->getValue(); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -3074,6 +3117,10 @@ void LocallabContrast::setDefaults(const rtengine::procparams::ProcParams* defPa blendmasklc->setDefault((double)defSpot.blendmasklc); radmasklc->setDefault(defSpot.radmasklc); chromasklc->setDefault(defSpot.chromasklc); + recothresw->setDefault((double)defSpot.recothresw); + lowthresw->setDefault((double)defSpot.lowthresw); + higthresw->setDefault((double)defSpot.higthresw); + decayw->setDefault((double)defSpot.decayw); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -3370,6 +3417,35 @@ void LocallabContrast::adjusterChanged(Adjuster* a, double newval) } } + if (a == recothresw) { + + if (listener) { + listener->panelChanged(Evlocallabrecothresw, + recothresw->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == lowthresw) { + if (listener) { + listener->panelChanged(Evlocallablowthresw, + lowthresw->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == higthresw) { + if (listener) { + listener->panelChanged(Evlocallabhigthresw, + higthresw->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == decayw) { + if (listener) { + listener->panelChanged(Evlocallabdecayw, + decayw->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + if (a == blendmasklc) { if (listener) { listener->panelChanged(Evlocallabblendmasklc, @@ -3559,6 +3635,7 @@ void LocallabContrast::convertParamToNormal() wavshapecomp->setCurve(defSpot.loccompwavcurve); fatres->setValue(defSpot.fatres); fftwlc->set_active(defSpot.fftwlc); + decayw->setValue(defSpot.decayw); // Enable all listeners enableListener(); @@ -3593,6 +3670,11 @@ void LocallabContrast::convertParamToSimple() // Lmasklcshape->setCurve(defSpot.Lmasklccurve); // Enable all listeners + recothresw->setValue(defSpot.recothresw); + lowthresw->setValue(defSpot.lowthresw); + higthresw->setValue(defSpot.higthresw); + decayw->setValue(defSpot.decayw); + enableListener(); // Update GUI based on converted widget parameters: @@ -3611,6 +3693,10 @@ void LocallabContrast::updateGUIToMode(const modeType new_type) expcontrastpyr2->hide(); fftwlc->hide(); expmasklc->hide(); + exprecovw->hide(); + decayw->hide(); + maskusablew->hide(); + maskunusablew->hide(); break; @@ -3623,6 +3709,16 @@ void LocallabContrast::updateGUIToMode(const modeType new_type) // Specific Simple mode widgets are shown in Normal mode localcontMethod->show(); expmasklc->show(); + exprecovw->show(); + decayw->hide(); + if (enalcMask->get_active()) { + maskusablew->show(); + maskunusablew->hide(); + + } else { + maskusablew->hide(); + maskunusablew->show(); + } break; @@ -3641,6 +3737,17 @@ void LocallabContrast::updateGUIToMode(const modeType new_type) } expmasklc->show(); + exprecovw->show(); + decayw->show(); + if (enalcMask->get_active()) { + maskusablew->show(); + maskunusablew->hide(); + + } else { + maskusablew->hide(); + maskunusablew->show(); + } + } } @@ -3864,6 +3971,15 @@ void LocallabContrast::showmasklcMethodChanged() void LocallabContrast::enalcMaskChanged() { + if (enalcMask->get_active()) { + maskusablew->show(); + maskunusablew->hide(); + + } else { + maskusablew->hide(); + maskunusablew->show(); + } + if (isLocActivated && exp->getEnabled()) { if (listener) { if (enalcMask->get_active()) { diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index db61a85ec..a117ca1f5 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1500,6 +1500,10 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).radmasklc = locallab.spots.at(j).radmasklc && pSpot.radmaskcb == otherSpot.radmasklc; locallab.spots.at(j).chromasklc = locallab.spots.at(j).chromasklc && pSpot.chromasklc == otherSpot.chromasklc; locallab.spots.at(j).Lmasklccurve = locallab.spots.at(j).Lmasklccurve && pSpot.Lmasklccurve == otherSpot.Lmasklccurve; + locallab.spots.at(j).recothresw = locallab.spots.at(j).recothresw && pSpot.recothresw == otherSpot.recothresw; + locallab.spots.at(j).lowthresw = locallab.spots.at(j).lowthresw && pSpot.lowthresw == otherSpot.lowthresw; + locallab.spots.at(j).higthresw = locallab.spots.at(j).higthresw && pSpot.higthresw == otherSpot.higthresw; + locallab.spots.at(j).decayw = locallab.spots.at(j).decayw && pSpot.decayw == otherSpot.decayw; // Contrast by detail levels locallab.spots.at(j).visicbdl = locallab.spots.at(j).visicbdl && pSpot.visicbdl == otherSpot.visicbdl; locallab.spots.at(j).expcbdl = locallab.spots.at(j).expcbdl && pSpot.expcbdl == otherSpot.expcbdl; @@ -4940,6 +4944,22 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).Lmasklccurve = mods.locallab.spots.at(i).Lmasklccurve; } + if (locallab.spots.at(i).recothresw) { + toEdit.locallab.spots.at(i).recothresw = mods.locallab.spots.at(i).recothresw; + } + + if (locallab.spots.at(i).lowthresw) { + toEdit.locallab.spots.at(i).lowthresw = mods.locallab.spots.at(i).lowthresw; + } + + if (locallab.spots.at(i).higthresw) { + toEdit.locallab.spots.at(i).higthresw = mods.locallab.spots.at(i).higthresw; + } + + if (locallab.spots.at(i).decayw) { + toEdit.locallab.spots.at(i).decayw = mods.locallab.spots.at(i).decayw; + } + // Contrast by detail levels if (locallab.spots.at(i).visicbdl) { toEdit.locallab.spots.at(i).visicbdl = mods.locallab.spots.at(i).visicbdl; @@ -6954,6 +6974,10 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : radmasklc(v), chromasklc(v), Lmasklccurve(v), + recothresw(v), + lowthresw(v), + higthresw(v), + decayw(v), // Contrast by detail levels visicbdl(v), expcbdl(v), @@ -7502,6 +7526,10 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) radmasklc = v; chromasklc = v; Lmasklccurve = v; + recothresw = v; + lowthresw = v; + higthresw = v; + decayw = v; // Contrast by detail levels visicbdl = v; expcbdl = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index bcc18ff30..04fa30f45 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -837,6 +837,10 @@ public: bool radmasklc; bool chromasklc; bool Lmasklccurve; + bool recothresw; + bool lowthresw; + bool higthresw; + bool decayw; // Contrast by detail levels bool visicbdl; bool expcbdl; From 13bd5c068115b5d97efeee64240bd057548846d8 Mon Sep 17 00:00:00 2001 From: Desmis Date: Wed, 13 Jan 2021 12:28:09 +0100 Subject: [PATCH 053/129] LA denoise - Improve Recovery based on luminance mask with chominance slider (#6058) --- rtdata/languages/default | 9 ++++++--- rtengine/iplocallab.cc | 40 +++++++++++++++++++++++++++++++++------- rtengine/procevents.h | 1 + rtengine/procparams.cc | 4 ++++ rtengine/procparams.h | 1 + rtengine/refreshmap.cc | 3 ++- rtgui/locallabtools.cc | 15 +++++++++++++++ rtgui/locallabtools.h | 1 + rtgui/paramsedited.cc | 7 +++++++ rtgui/paramsedited.h | 1 + 10 files changed, 71 insertions(+), 11 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 68c9b0a8d..3b7e026f0 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1244,7 +1244,7 @@ HISTORY_MSG_996;Local - Color recovery threshold HISTORY_MSG_997;Local - Color threshold mask low HISTORY_MSG_998;Local - Color threshold mask high HISTORY_MSG_999;Local - Color decay -HISTORY_MSG_1000;Local - Denoise gray +HISTORY_MSG_1000;Local - Denoise luminance gray HISTORY_MSG_1001;Local - Log recovery threshold HISTORY_MSG_1002;Local - Log threshold mask low HISTORY_MSG_1003;Local - Log threshold mask high @@ -1265,6 +1265,7 @@ HISTORY_MSG_1017;Local - lc recovery threshold HISTORY_MSG_1018;Local - lc threshold mask low HISTORY_MSG_1019;Local - lc threshold mask high HISTORY_MSG_1020;Local - lc decay +HISTORY_MSG_1021;Local - Denoise chrominance gray HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance @@ -2800,7 +2801,7 @@ TP_LOCALLAB_MASKDDECAY;Decay strength TP_LOCALLAB_MASKDECAY_TOOLTIP;Manages the rate of decay for the gray levels in the mask.\n Decay = 1 linear, Decay > 1 sharper parabolic transitions, Decay < 1 more gradual transitions TP_LOCALLAB_MASKH;Hue curve TP_LOCALLAB_MASKLC_TOOLTIP;This allows you to target the denoise based on the image luminance information contained in the L(L) or LC(H) mask (Mask and Modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n if the mask is very dark - below the threshold 'dark' - denoise will be increased if reinforce > 1.\n if the mask is clear - above the threshold 'light' - denoise will be progressively cancelled.\n between the two, denoise will be maintained at the settings without mask. -TP_LOCALLAB_MASKDE_TOOLTIP;Used to direct the Denoise based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n If the mask is below the ‘dark’ threshold, then the Denoise will be applied progressively.\n if the mask is above the ‘light’ threshold, then the Denoise will be applied progressively.\n Between the two, the image settings without the Denoise will be maintained, unless you act on the slider "Gray area denoise". +TP_LOCALLAB_MASKDE_TOOLTIP;Used to direct the Denoise based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n If the mask is below the ‘dark’ threshold, then the Denoise will be applied progressively.\n if the mask is above the ‘light’ threshold, then the Denoise will be applied progressively.\n Between the two, the image settings without the Denoise will be maintained, unless you act on the sliders "Gray area luminance denoise" or "Gray area chrominance denoise". TP_LOCALLAB_MASKGF_TOOLTIP;Used to direct the Guided Filter based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n If the mask is below the ‘dark’ threshold, then the GF will be applied progressively.\n if the mask is above the ‘light’ threshold, then the GF will be applied progressively.\n Between the two, the image settings without the GF will be maintained. TP_LOCALLAB_MASKRECOL_TOOLTIP;Used to modulate the effect of the Color and Light settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Color and Light settings \n In between these two areas, the full value of the Color and Light settings will be applied TP_LOCALLAB_MASKREEXP_TOOLTIP;Used to modulate the effect of the 'Dynamic range and Exposure' settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings \n In between these two areas, the full value of the 'Dynamic range and Exposure' settings will be applied @@ -2830,7 +2831,9 @@ TP_LOCALLAB_MASKLOWTHRESS_TOOLTIP;Dark-tone limit below which Shadows Highligts TP_LOCALLAB_MASKLOWTHRESVIB_TOOLTIP;Dark-tone limit below which Vibrance and Warm Cool will be restored progressively to their original values prior to being modified by the Vibrance and Warm Cool settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESWAV_TOOLTIP;Dark-tone limit below which Local contrast and Wavelet will be restored progressively to their original values prior to being modified by the Local contrast and Wavelet settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 -TP_LOCALLAB_MASKLCTHRMID;Gray area denoise +TP_LOCALLAB_MASKLCTHRMID;Gray area luminance denoise +TP_LOCALLAB_MASKLCTHRMIDCH;Gray area chrominance denoise + TP_LOCALLAB_MASKUSABLE;Mask enabled (Mask & modifications) TP_LOCALLAB_MASKUNUSABLE;Mask disabled (Mask & modifications) TP_LOCALLAB_MASKRECOTHRES;Recovery threshold diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index cfb56afb9..e9032ae22 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -585,6 +585,7 @@ struct local_params { float recothrd; float lowthrd; float midthrd; + float midthrdch; float higthrd; float decayd; float recothrc; @@ -1077,6 +1078,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall float local_recothrd = (float)locallab.spots.at(sp).recothresd; float local_lowthrd = (float)locallab.spots.at(sp).lowthresd; float local_midthrd = (float)locallab.spots.at(sp).midthresd; + float local_midthrdch = (float)locallab.spots.at(sp).midthresdch; float local_higthrd = (float)locallab.spots.at(sp).higthresd; float local_decayd = (float)locallab.spots.at(sp).decayd; float local_recothrc = (float)locallab.spots.at(sp).recothresc; @@ -1460,6 +1462,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.higthr = local_higthr; lp.recothrd = local_recothrd; lp.midthrd = local_midthrd; + lp.midthrdch = local_midthrdch; lp.lowthrd = local_lowthrd; lp.higthrd = local_higthrd; lp.decayd = local_decayd; @@ -9524,10 +9527,13 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } array2D masklum; + array2D masklumch; masklum(GW, GH); + masklumch(GW, GH); for (int ir = 0; ir < GH; ir++) for (int jr = 0; jr < GW; jr++) { masklum[ir][jr] = 1.f; + masklumch[ir][jr] = 1.f; } float hig = lp.higthrd; @@ -9537,6 +9543,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl float lowc; calcdif(low, lowc); float mid = 0.01f * lp.midthrd; + float midch = 0.01f * lp.midthrdch; if(higc < lowc) { higc = lowc + 0.01f; @@ -9556,22 +9563,29 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl const float lmr = lM / 327.68f; if (lM < 327.68f * lowc) { masklum[ir][jr] = alow * lmr + blow; + masklumch[ir][jr] = alow * lmr + blow; } else if (lM < 327.68f * higc) { masklum[ir][jr] = (1.f - mid); + masklumch[ir][jr] = (1.f - midch); } else { masklum[ir][jr] = ahigh * lmr + bhigh; + masklumch[ir][jr] = ahigh * lmr + bhigh; } float k = masklum[ir][jr]; + float kch = masklumch[ir][jr]; if(lp.invmaskd == true) { - masklum[ir][jr] = 1 - pow(k, lp.decayd); + masklum[ir][jr] = 1.f - pow(k, lp.decayd); + masklumch[ir][jr] = 1.f - pow(kch, lp.decayd); } else { masklum[ir][jr] = pow(k, lp.decayd); + masklumch[ir][jr] = pow(kch, lp.decayd); } } for (int i = 0; i < 3; ++i) { boxblur(static_cast(masklum), static_cast(masklum), 10 / sk, GW, GH, false); + boxblur(static_cast(masklumch), static_cast(masklumch), 10 / sk, GW, GH, false); } #ifdef _OPENMP #pragma omp parallel for if (multiThread) @@ -9579,12 +9593,12 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl for (int i = 0; i < GH; ++i) { for (int j = 0; j < GW; ++j) { tmp1.L[i][j] = (tmp3.L[i][j] - tmp1.L[i][j]) * LIM01(masklum[i][j]) + tmp1.L[i][j]; - tmp1.a[i][j] = (tmp3.a[i][j] - tmp1.a[i][j]) * LIM01(masklum[i][j]) + tmp1.a[i][j]; - tmp1.b[i][j] = (tmp3.b[i][j] - tmp1.b[i][j]) * LIM01(masklum[i][j]) + tmp1.b[i][j]; + tmp1.a[i][j] = (tmp3.a[i][j] - tmp1.a[i][j]) * LIM01(masklumch[i][j]) + tmp1.a[i][j]; + tmp1.b[i][j] = (tmp3.b[i][j] - tmp1.b[i][j]) * LIM01(masklumch[i][j]) + tmp1.b[i][j]; } } masklum.free(); - + masklumch.free(); } DeNoise_Local(call, lp, originalmaskbl, levred, huerefblur, lumarefblur, chromarefblur, original, transformed, tmp1, cx, cy, sk); @@ -10212,10 +10226,13 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } array2D masklum; + array2D masklumch; masklum(bfw, bfh); + masklumch(bfw, bfh); for (int ir = 0; ir < bfh; ir++){ for (int jr = 0; jr < bfw; jr++) { masklum[ir][jr] = 1.f; + masklumch[ir][jr] = 1.f; } } @@ -10226,6 +10243,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl float lowc; calcdif(low, lowc); float mid = 0.01f * lp.midthrd; + float midch = 0.01f * lp.midthrdch; if(higc < lowc) { higc = lowc + 0.01f; @@ -10247,22 +10265,29 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl const float lmr = lM / 327.68f; if (lM < 327.68f * lowc) { masklum[y-ystart][x-xstart] = alow * lmr + blow; + masklumch[y-ystart][x-xstart] = alow * lmr + blow; } else if (lM < 327.68f * higc) { masklum[y-ystart][x-xstart] = 1.f - mid; + masklumch[y-ystart][x-xstart] = 1.f - midch; } else { masklum[y-ystart][x-xstart] = ahigh * lmr + bhigh; + masklumch[y-ystart][x-xstart] = ahigh * lmr + bhigh; } float k = masklum[y-ystart][x-xstart]; + float kch = masklumch[y-ystart][x-xstart]; if(lp.invmaskd == true) { - masklum[y-ystart][x-xstart] = 1 - pow(k, lp.decayd); + masklum[y-ystart][x-xstart] = 1.f - pow(k, lp.decayd); + masklumch[y-ystart][x-xstart] = 1.f - pow(kch, lp.decayd); } else { masklum[y-ystart][x-xstart] = pow(k, lp.decayd); + masklumch[y-ystart][x-xstart] = pow(kch, lp.decayd); } } } for (int i = 0; i < 3; ++i) { boxblur(static_cast(masklum), static_cast(masklum), 10 / sk, bfw, bfh, false); + boxblur(static_cast(masklumch), static_cast(masklumch), 10 / sk, bfw, bfh, false); } #ifdef _OPENMP @@ -10271,12 +10296,13 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl for (int y = 0; y < bfh; y++) { for (int x = 0; x < bfw; x++) { bufwv.L[y][x] = (tmp3.L[y][x] - bufwv.L[y][x]) * LIM01(masklum[y][x]) + bufwv.L[y][x]; - bufwv.a[y][x] = (tmp3.a[y][x] - bufwv.a[y][x]) * LIM01(masklum[y][x]) + bufwv.a[y][x]; - bufwv.b[y][x] = (tmp3.b[y][x] - bufwv.b[y][x]) * LIM01(masklum[y][x]) + bufwv.b[y][x]; + bufwv.a[y][x] = (tmp3.a[y][x] - bufwv.a[y][x]) * LIM01(masklumch[y][x]) + bufwv.a[y][x]; + bufwv.b[y][x] = (tmp3.b[y][x] - bufwv.b[y][x]) * LIM01(masklumch[y][x]) + bufwv.b[y][x]; } } masklum.free(); + masklumch.free(); } DeNoise_Local2(lp, originalmaskbl, levred, huerefblur, lumarefblur, chromarefblur, original, transformed, bufwv, cx, cy, sk); diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 5d30e8cb4..65a9d5b81 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -1043,6 +1043,7 @@ enum ProcEventCode { Evlocallablowthresw = 1017, Evlocallabhigthresw = 1018, Evlocallabdecayw = 1019, + Evlocallabmidthresdch = 1020, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 476c79318..4dd2c1d85 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3320,6 +3320,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : recothresd(1.), lowthresd(12.), midthresd(0.), + midthresdch(0.), higthresd(85.), decayd(2.), isogr(400), @@ -4398,6 +4399,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && recothresd == other.recothresd && lowthresd == other.lowthresd && midthresd == other.midthresd + && midthresdch == other.midthresdch && higthresd == other.higthresd && decayd == other.decayd && isogr == other.isogr @@ -6018,6 +6020,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->recothresd, "Locallab", "Recothresd_" + index_str, spot.recothresd, keyFile); saveToKeyfile(!pedited || spot_edited->lowthresd, "Locallab", "Lowthresd_" + index_str, spot.lowthresd, keyFile); saveToKeyfile(!pedited || spot_edited->midthresd, "Locallab", "Midthresd_" + index_str, spot.midthresd, keyFile); + saveToKeyfile(!pedited || spot_edited->midthresdch, "Locallab", "Midthresdch_" + index_str, spot.midthresdch, keyFile); saveToKeyfile(!pedited || spot_edited->higthresd, "Locallab", "Higthresd_" + index_str, spot.higthresd, keyFile); saveToKeyfile(!pedited || spot_edited->decayd, "Locallab", "Decayd_" + index_str, spot.decayd, keyFile); saveToKeyfile(!pedited || spot_edited->isogr, "Locallab", "Isogr_" + index_str, spot.isogr, keyFile); @@ -7854,6 +7857,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Recothresd_" + index_str, pedited, spot.recothresd, spotEdited.recothresd); assignFromKeyfile(keyFile, "Locallab", "Lowthresd_" + index_str, pedited, spot.lowthresd, spotEdited.lowthresd); assignFromKeyfile(keyFile, "Locallab", "Midthresd_" + index_str, pedited, spot.midthresd, spotEdited.midthresd); + assignFromKeyfile(keyFile, "Locallab", "Midthresdch_" + index_str, pedited, spot.midthresdch, spotEdited.midthresdch); assignFromKeyfile(keyFile, "Locallab", "Higthresd_" + index_str, pedited, spot.higthresd, spotEdited.higthresd); assignFromKeyfile(keyFile, "Locallab", "Decayd_" + index_str, pedited, spot.decayd, spotEdited.decayd); assignFromKeyfile(keyFile, "Locallab", "Isogr_" + index_str, pedited, spot.isogr, spotEdited.isogr); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index dd394de7d..bc9d212e9 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1227,6 +1227,7 @@ struct LocallabParams { double recothresd; double lowthresd; double midthresd; + double midthresdch; double higthresd; double decayd; int isogr; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 75dff967f..9b3fd2365 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -1046,7 +1046,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabrecothrew LUMINANCECURVE, // Evlocallablowthresw LUMINANCECURVE, // Evlocallabhigthresw - LUMINANCECURVE // Evlocallabdecayw + LUMINANCECURVE, // Evlocallabdecayw + LUMINANCECURVE // Evlocallabmidthresdch }; diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 5db535ae2..244438e4b 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -6253,6 +6253,7 @@ LocallabBlur::LocallabBlur(): recothresd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKRECOTHRES"), 1., 2., 0.01, 1.))), lowthresd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 80., 0.5, 12.))), midthresd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRMID"), 0., 100., 0.5, 0.))), + midthresdch(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRMIDCH"), 0., 100., 0.5, 0.))), higthresd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 20., 99., 0.5, 85.))), decayd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKDDECAY"), 0.5, 4., 0.1, 2.))), invmaskd(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVMASK")))), @@ -6423,6 +6424,7 @@ LocallabBlur::LocallabBlur(): recothresd->setAdjusterListener(this); lowthresd->setAdjusterListener(this); midthresd->setAdjusterListener(this); + midthresdch->setAdjusterListener(this); higthresd->setAdjusterListener(this); decayd->setAdjusterListener(this); @@ -6581,6 +6583,7 @@ LocallabBlur::LocallabBlur(): wavBox3->pack_start(*recothresd); wavBox3->pack_start(*lowthresd); wavBox3->pack_start(*midthresd); + wavBox3->pack_start(*midthresdch); wavBox3->pack_start(*higthresd); wavBox3->pack_start(*decayd); wavBox3->pack_start(*invmaskd); @@ -6800,6 +6803,7 @@ void LocallabBlur::neutral_pressed () recothresd->setValue(defSpot.recothresd); lowthresd->setValue(defSpot.lowthresd); midthresd->setValue(defSpot.midthresd); + midthresdch->setValue(defSpot.midthresdch); higthresd->setValue(defSpot.higthresd); decayd->setValue(defSpot.decayd); recothres->setValue(defSpot.recothres); @@ -6920,6 +6924,7 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params recothresd->setValue((double)spot.recothresd); lowthresd->setValue((double)spot.lowthresd); midthresd->setValue((double)spot.midthresd); + midthresdch->setValue((double)spot.midthresdch); higthresd->setValue((double)spot.higthresd); decayd->setValue((double)spot.decayd); @@ -7057,6 +7062,7 @@ void LocallabBlur::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.recothresd = recothresd->getValue(); spot.lowthresd = lowthresd->getValue(); spot.midthresd = midthresd->getValue(); + spot.midthresdch = midthresdch->getValue(); spot.higthresd = higthresd->getValue(); spot.decayd = decayd->getValue(); @@ -7157,6 +7163,7 @@ void LocallabBlur::setDefaults(const rtengine::procparams::ProcParams* defParams recothresd->setDefault((double)defSpot.recothresd); lowthresd->setDefault((double)defSpot.lowthresd); midthresd->setDefault((double)defSpot.midthresd); + midthresdch->setDefault((double)defSpot.midthresdch); higthresd->setDefault((double)defSpot.higthresd); decayd->setDefault((double)defSpot.decayd); noiselumf0->setDefault(defSpot.noiselumf0); @@ -7303,6 +7310,13 @@ void LocallabBlur::adjusterChanged(Adjuster* a, double newval) } } + if (a == midthresdch) { + if (listener) { + listener->panelChanged(Evlocallabmidthresdch, + midthresdch->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + if (a == higthresd) { if (listener) { listener->panelChanged(Evlocallabhigthresd, @@ -7657,6 +7671,7 @@ void LocallabBlur::convertParamToSimple() recothresd->setValue(defSpot.recothresd); lowthresd->setValue(defSpot.lowthresd); midthresd->setValue(defSpot.midthresd); + midthresdch->setValue(defSpot.midthresdch); higthresd->setValue(defSpot.higthresd); decayd->setValue(defSpot.decayd); recothres->setValue(defSpot.recothres); diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index bd8f7f665..9d17c2eec 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -726,6 +726,7 @@ private: Adjuster* const recothresd; Adjuster* const lowthresd; Adjuster* const midthresd; + Adjuster* const midthresdch; Adjuster* const higthresd; Adjuster* const decayd; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index a117ca1f5..102d6b499 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1298,6 +1298,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).recothresd = locallab.spots.at(j).recothresd && pSpot.recothresd == otherSpot.recothresd; locallab.spots.at(j).lowthresd = locallab.spots.at(j).lowthresd && pSpot.lowthresd == otherSpot.lowthresd; locallab.spots.at(j).midthresd = locallab.spots.at(j).midthresd && pSpot.midthresd == otherSpot.midthresd; + locallab.spots.at(j).midthresdch = locallab.spots.at(j).midthresdch && pSpot.midthresdch == otherSpot.midthresdch; locallab.spots.at(j).higthresd = locallab.spots.at(j).higthresd && pSpot.higthresd == otherSpot.higthresd; locallab.spots.at(j).decayd = locallab.spots.at(j).decayd && pSpot.decayd == otherSpot.decayd; locallab.spots.at(j).isogr = locallab.spots.at(j).isogr && pSpot.isogr == otherSpot.isogr; @@ -4146,6 +4147,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).midthresd = mods.locallab.spots.at(i).midthresd; } + if (locallab.spots.at(i).midthresdch) { + toEdit.locallab.spots.at(i).midthresdch = mods.locallab.spots.at(i).midthresdch; + } + if (locallab.spots.at(i).higthresd) { toEdit.locallab.spots.at(i).higthresd = mods.locallab.spots.at(i).higthresd; } @@ -6772,6 +6777,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : recothresd(v), lowthresd(v), midthresd(v), + midthresdch(v), higthresd(v), decayd(v), isogr(v), @@ -7325,6 +7331,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) recothresd = v; lowthresd = v; midthresd = v; + midthresdch = v; higthresd = v; decayd = v; isogr = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 04fa30f45..b56fea35b 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -635,6 +635,7 @@ public: bool recothresd; bool lowthresd; bool midthresd; + bool midthresdch; bool higthresd; bool decayd; bool isogr; From 5e95b2e5e2abbcc369573f9cbf84186513d2f802 Mon Sep 17 00:00:00 2001 From: Desmis Date: Thu, 14 Jan 2021 07:41:25 +0100 Subject: [PATCH 054/129] Local adjustments - Tone Mapping - Recovery based on luminance mask (#6059) * LA TM GUI for Recovery based on luminance mask * LA TM enable Recovery based on luminance mask --- rtdata/languages/default | 10 +++-- rtengine/iplocallab.cc | 22 ++++++++++ rtengine/procevents.h | 4 ++ rtengine/procparams.cc | 16 ++++++++ rtengine/procparams.h | 4 ++ rtengine/refreshmap.cc | 6 ++- rtgui/locallabtools.h | 7 ++++ rtgui/locallabtools2.cc | 89 ++++++++++++++++++++++++++++++++++++++++ rtgui/paramsedited.cc | 28 +++++++++++++ rtgui/paramsedited.h | 4 ++ 10 files changed, 186 insertions(+), 4 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 3b7e026f0..06a920fc1 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1266,6 +1266,10 @@ HISTORY_MSG_1018;Local - lc threshold mask low HISTORY_MSG_1019;Local - lc threshold mask high HISTORY_MSG_1020;Local - lc decay HISTORY_MSG_1021;Local - Denoise chrominance gray +HISTORY_MSG_1022;Local - TM recovery threshold +HISTORY_MSG_1023;Local - TM threshold mask low +HISTORY_MSG_1024;Local - TM threshold mask high +HISTORY_MSG_1025;Local - TM decay HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance @@ -2806,15 +2810,16 @@ TP_LOCALLAB_MASKGF_TOOLTIP;Used to direct the Guided Filter based on the image l TP_LOCALLAB_MASKRECOL_TOOLTIP;Used to modulate the effect of the Color and Light settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Color and Light settings \n In between these two areas, the full value of the Color and Light settings will be applied TP_LOCALLAB_MASKREEXP_TOOLTIP;Used to modulate the effect of the 'Dynamic range and Exposure' settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings \n In between these two areas, the full value of the 'Dynamic range and Exposure' settings will be applied TP_LOCALLAB_MASKRESH_TOOLTIP;Used to modulate the effect of the Shadows Highlights settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Shadows Highlights settings \n In between these two areas, the full value of the Shadows Highlights settings will be applied +TP_LOCALLAB_MASKRESTM_TOOLTIP;Used to modulate the effect of the Tone Mapping settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Tone Mapping settings \n In between these two areas, the full value of the Tone Mapping settings will be applied TP_LOCALLAB_MASKRESVIB_TOOLTIP;Used to modulate the effect of the Vibrance and Warm Cool settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Vibrance and Warm Cool settings \n In between these two areas, the full value of the Vibrance and Warm Cool settings will be applied TP_LOCALLAB_MASKRESWAV_TOOLTIP;Used to modulate the effect of the Local contrast and Wavelet settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Local contrast and Wavelet settings \n In between these two areas, the full value of the Local contrast and Wavelet settings will be applied TP_LOCALLAB_MASKRELOG_TOOLTIP;Used to modulate the effect of the Log encoding settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Log encoding settings - can be used to restore highlights reconstructed by Color propagation \n In between these two areas, the full value of the Log encoding settings will be applied TP_LOCALLAB_MASKDEINV_TOOLTIP;Reverses the way the algorithm interprets the mask.\nIf checked black and very light areas will be decreased. TP_LOCALLAB_MASKHIGTHRESC_TOOLTIP;Light-tone limit above which Color and Light will be restored progressively to their original values prior to being modified by the Color and Light settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, 'Blur mask', ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESS_TOOLTIP;Light-tone limit above which Shadows Highlights will be restored progressively to their original values prior to being modified by the Shadows Highlights settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKHIGTHRESTM_TOOLTIP;Light-tone limit above which Tone Mapping will be restored progressively to their original values prior to being modified by the Tone Mapping settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESVIB_TOOLTIP;Light-tone limit above which Vibrance and Warm Cool will be restored progressively to their original values prior to being modified by the Vibrance and Warm Cool settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESWAV_TOOLTIP;Light-tone limit above which Local contrast and Wavelet will be restored progressively to their original values prior to being modified by the Local contrast and Wavelet settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 - TP_LOCALLAB_MASKHIGTHRESE_TOOLTIP;Light-tone limit above which 'Dynamic range and Exposure' will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESL_TOOLTIP;Light-tone limit above which Log encoding will be restored progressively to their original values prior to being modified by the Log encoding settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESD_TOOLTIP;Light-tone limit above which denoise will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 @@ -2828,12 +2833,11 @@ TP_LOCALLAB_MASKLOWTHRESC_TOOLTIP;Dark-tone limit below which Color and Light wi TP_LOCALLAB_MASKLOWTHRESL_TOOLTIP;Dark-tone limit below which Log encoding will be restored progressively to their original values prior to being modified by the Log encoding settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESE_TOOLTIP;Dark-tone limit below which 'Dynamic range and Exposure' will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESS_TOOLTIP;Dark-tone limit below which Shadows Highligts will be restored progressively to their original values prior to being modified by the Shadows Highlights settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKLOWTHRESTM_TOOLTIP;Dark-tone limit below which Tone Mapping will be restored progressively to their original values prior to being modified by the Tone Mapping settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESVIB_TOOLTIP;Dark-tone limit below which Vibrance and Warm Cool will be restored progressively to their original values prior to being modified by the Vibrance and Warm Cool settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESWAV_TOOLTIP;Dark-tone limit below which Local contrast and Wavelet will be restored progressively to their original values prior to being modified by the Local contrast and Wavelet settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 - TP_LOCALLAB_MASKLCTHRMID;Gray area luminance denoise TP_LOCALLAB_MASKLCTHRMIDCH;Gray area chrominance denoise - TP_LOCALLAB_MASKUSABLE;Mask enabled (Mask & modifications) TP_LOCALLAB_MASKUNUSABLE;Mask disabled (Mask & modifications) TP_LOCALLAB_MASKRECOTHRES;Recovery threshold diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index e9032ae22..1e4609476 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -600,6 +600,10 @@ struct local_params { float lowthrv; float higthrv; float decayv; + float recothrt; + float lowthrt; + float higthrt; + float decayt; float recothrw; float lowthrw; float higthrw; @@ -1096,6 +1100,11 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall float local_higthrv = (float)locallab.spots.at(sp).higthresv; float local_decayv = (float)locallab.spots.at(sp).decayv; + float local_recothrt = (float)locallab.spots.at(sp).recothrest; + float local_lowthrt = (float)locallab.spots.at(sp).lowthrest; + float local_higthrt = (float)locallab.spots.at(sp).higthrest; + float local_decayt = (float)locallab.spots.at(sp).decayt; + float local_recothrw = (float)locallab.spots.at(sp).recothresw; float local_lowthrw = (float)locallab.spots.at(sp).lowthresw; float local_higthrw = (float)locallab.spots.at(sp).higthresw; @@ -1486,6 +1495,10 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.lowthrw = local_lowthrw; lp.higthrw = local_higthrw; lp.decayw = local_decayw; + lp.recothrt = local_recothrt; + lp.lowthrt = local_lowthrt; + lp.higthrt = local_higthrt; + lp.decayt = local_decayt; lp.recothrl = local_recothrl; lp.lowthrl = local_lowthrl; @@ -12493,6 +12506,15 @@ void ImProcFunctions::Lab_Local( } } + if(lp.enatmMask && lp.recothrt != 1.f) { + float hig = lp.higthrt; + float low = lp.lowthrt; + float recoth = lp.recothrt; + float decay = lp.decayt; + bool invmask = false; + maskrecov(tmp1.get(), original, bufmaskorigtm.get(), bfh, bfw, ystart, xstart, hig, low, recoth, decay, invmask, sk, multiThread); + } + // transit_shapedetect_retinex(call, 4, bufgb.get(),bufmaskorigtm.get(), originalmasktm.get(), buflight, bufchro, hueref, chromaref, lumaref, lp, original, transformed, cx, cy, sk); transit_shapedetect2(call, 8, bufgb.get(), tmp1.get(), originalmasktm.get(), hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 65a9d5b81..70787bef6 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -1044,6 +1044,10 @@ enum ProcEventCode { Evlocallabhigthresw = 1018, Evlocallabdecayw = 1019, Evlocallabmidthresdch = 1020, + Evlocallabrecothrest = 1021, + Evlocallablowthrest = 1022, + Evlocallabhigthrest = 1023, + Evlocallabdecayt = 1024, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 4dd2c1d85..c787755cd 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3546,6 +3546,10 @@ LocallabParams::LocallabSpot::LocallabSpot() : 1.0, 1.0 }, + recothrest(1.), + lowthrest(12.), + higthrest(85.), + decayt(2.), // Retinex visireti(false), expreti(false), @@ -4479,6 +4483,10 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && slomasktm == other.slomasktm && lapmasktm == other.lapmasktm && Lmasktmcurve == other.Lmasktmcurve + && recothrest == other.recothrest + && lowthrest == other.lowthrest + && higthrest == other.higthrest + && decayt == other.decayt // Retinex && visireti == other.visireti && expreti == other.expreti @@ -6101,6 +6109,10 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->slomasktm, "Locallab", "Slomasktm_" + index_str, spot.slomasktm, keyFile); saveToKeyfile(!pedited || spot_edited->lapmasktm, "Locallab", "Lapmasktm_" + index_str, spot.lapmasktm, keyFile); saveToKeyfile(!pedited || spot_edited->Lmasktmcurve, "Locallab", "LmasktmCurve_" + index_str, spot.Lmasktmcurve, keyFile); + saveToKeyfile(!pedited || spot_edited->recothrest, "Locallab", "Recothrest_" + index_str, spot.recothrest, keyFile); + saveToKeyfile(!pedited || spot_edited->lowthrest, "Locallab", "Lowthrest_" + index_str, spot.lowthrest, keyFile); + saveToKeyfile(!pedited || spot_edited->higthrest, "Locallab", "Higthrest_" + index_str, spot.higthrest, keyFile); + saveToKeyfile(!pedited || spot_edited->decayt, "Locallab", "Decayt_" + index_str, spot.decayt, keyFile); } // Retinex if ((!pedited || spot_edited->visireti) && spot.visireti) { @@ -7950,6 +7962,10 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Slomasktm_" + index_str, pedited, spot.slomasktm, spotEdited.slomasktm); assignFromKeyfile(keyFile, "Locallab", "Lapmasktm_" + index_str, pedited, spot.lapmasktm, spotEdited.lapmasktm); assignFromKeyfile(keyFile, "Locallab", "LmasktmCurve_" + index_str, pedited, spot.Lmasktmcurve, spotEdited.Lmasktmcurve); + assignFromKeyfile(keyFile, "Locallab", "Recothrest_" + index_str, pedited, spot.recothrest, spotEdited.recothrest); + assignFromKeyfile(keyFile, "Locallab", "Lowthrest_" + index_str, pedited, spot.lowthrest, spotEdited.lowthrest); + assignFromKeyfile(keyFile, "Locallab", "Higthrest_" + index_str, pedited, spot.higthrest, spotEdited.higthrest); + assignFromKeyfile(keyFile, "Locallab", "Decayt_" + index_str, pedited, spot.decayt, spotEdited.decayt); // Retinex spot.visireti = assignFromKeyfile(keyFile, "Locallab", "Expreti_" + index_str, pedited, spot.expreti, spotEdited.expreti); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index bc9d212e9..0c9f35d17 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1307,6 +1307,10 @@ struct LocallabParams { double slomasktm; double lapmasktm; std::vector Lmasktmcurve; + double recothrest; + double lowthrest; + double higthrest; + double decayt; // Retinex bool visireti; bool expreti; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 9b3fd2365..6eff2f9d6 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -1047,7 +1047,11 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallablowthresw LUMINANCECURVE, // Evlocallabhigthresw LUMINANCECURVE, // Evlocallabdecayw - LUMINANCECURVE // Evlocallabmidthresdch + LUMINANCECURVE, // Evlocallabmidthresdch + LUMINANCECURVE, // Evlocallabrecothret + LUMINANCECURVE, // Evlocallablowthrest + LUMINANCECURVE, // Evlocallabhigthrest + LUMINANCECURVE // Evlocallabdecayt }; diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index 9d17c2eec..03ff4d68e 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -834,6 +834,13 @@ private: Adjuster* const rewei; Adjuster* const softradiustm; Adjuster* const sensitm; + MyExpander* const exprecovt; + Gtk::Label* const maskusablet; + Gtk::Label* const maskunusablet; + Adjuster* const recothrest; + Adjuster* const lowthrest; + Adjuster* const higthrest; + Adjuster* const decayt; MyExpander* const expmasktm; MyComboBoxText* const showmasktmMethod; Gtk::CheckButton* const enatmMask; diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index 31015735d..5c22a6128 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -128,6 +128,13 @@ LocallabTone::LocallabTone(): rewei(Gtk::manage(new Adjuster(M("TP_LOCALLAB_REWEI"), 0, 3, 1, 0))), softradiustm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOFTRADIUSCOL"), 0.0, 100.0, 0.1, 0.))), sensitm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 60))), + exprecovt(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI2_EXP")))), + maskusablet(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUSABLE")))), + maskunusablet(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUNUSABLE")))), + recothrest(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKRECOTHRES"), 1., 2., 0.01, 1.))), + lowthrest(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 80., 0.5, 12.))), + higthrest(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 20., 99., 0.5, 85.))), + decayt(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKDDECAY"), 0.5, 4., 0.1, 2.))), expmasktm(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_SHOWT")))), showmasktmMethod(Gtk::manage(new MyComboBoxText())), enatmMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))), @@ -169,6 +176,12 @@ LocallabTone::LocallabTone(): sensitm->setAdjusterListener(this); + recothrest->setAdjusterListener(this); + lowthrest->setAdjusterListener(this); + higthrest->setAdjusterListener(this); + decayt->setAdjusterListener(this); + setExpandAlignProperties(exprecovt, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); + setExpandAlignProperties(expmasktm, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); showmasktmMethod->append(M("TP_LOCALLAB_SHOWMNONE")); @@ -231,6 +244,17 @@ LocallabTone::LocallabTone(): pack_start(*rewei); // pack_start(*softradiustm); // Always bad with TM ?? pack_start(*sensitm); + ToolParamBlock* const tmBox3 = Gtk::manage(new ToolParamBlock()); + tmBox3->pack_start(*maskusablet, Gtk::PACK_SHRINK, 0); + tmBox3->pack_start(*maskunusablet, Gtk::PACK_SHRINK, 0); + tmBox3->pack_start(*recothrest); + tmBox3->pack_start(*lowthrest); + tmBox3->pack_start(*higthrest); + tmBox3->pack_start(*decayt); + // colBox3->pack_start(*invmaskc); + exprecovt->add(*tmBox3, false); + pack_start(*exprecovt, false, false); + ToolParamBlock* const masktmBox = Gtk::manage(new ToolParamBlock()); masktmBox->pack_start(*showmasktmMethod, Gtk::PACK_SHRINK, 4); masktmBox->pack_start(*enatmMask, Gtk::PACK_SHRINK, 0); @@ -274,6 +298,7 @@ void LocallabTone::updateAdviceTooltips(const bool showTooltips) { if (showTooltips) { exp->set_tooltip_text(M("TP_LOCALLAB_TONEMAP_TOOLTIP")); + exprecovt->set_tooltip_markup(M("TP_LOCALLAB_MASKRESTM_TOOLTIP")); equiltm->set_tooltip_text(M("TP_LOCALLAB_EQUILTM_TOOLTIP")); gamma->set_tooltip_text(M("TP_LOCALLAB_TONEMAPGAM_TOOLTIP")); estop->set_tooltip_text(M("TP_LOCALLAB_TONEMAPESTOP_TOOLTIP")); @@ -293,6 +318,9 @@ void LocallabTone::updateAdviceTooltips(const bool showTooltips) chromasktm->set_tooltip_text(M("TP_LOCALLAB_CHROMASK_TOOLTIP")); slomasktm->set_tooltip_text(M("TP_LOCALLAB_SLOMASK_TOOLTIP")); lapmasktm->set_tooltip_text(M("TP_LOCALLAB_LAPRAD1_TOOLTIP")); + decayt->set_tooltip_text(M("TP_LOCALLAB_MASKDECAY_TOOLTIP")); + lowthrest->set_tooltip_text(M("TP_LOCALLAB_MASKLOWTHRESTM_TOOLTIP")); + higthrest->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRESTM_TOOLTIP")); } else { exp->set_tooltip_text(""); @@ -317,11 +345,16 @@ void LocallabTone::updateAdviceTooltips(const bool showTooltips) chromasktm->set_tooltip_text(""); slomasktm->set_tooltip_text(""); lapmasktm->set_tooltip_text(""); + exprecovt->set_tooltip_markup(""); + decayt->set_tooltip_text(""); + lowthrest->set_tooltip_text(""); + higthrest->set_tooltip_text(""); } } void LocallabTone::setDefaultExpanderVisibility() { + exprecovt->set_expanded(false); expmasktm->set_expanded(false); } @@ -384,6 +417,10 @@ void LocallabTone::read(const rtengine::procparams::ProcParams* pp, const Params gammasktm->setValue(spot.gammasktm); slomasktm->setValue(spot.slomasktm); Lmasktmshape->setCurve(spot.Lmasktmcurve); + recothrest->setValue((double)spot.recothrest); + lowthrest->setValue((double)spot.lowthrest); + higthrest->setValue((double)spot.higthrest); + decayt->setValue((double)spot.decayt); } // Enable all listeners @@ -428,6 +465,10 @@ void LocallabTone::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.gammasktm = gammasktm->getValue(); spot.slomasktm = slomasktm->getValue(); spot.Lmasktmcurve = Lmasktmshape->getCurve(); + spot.recothrest = recothrest->getValue(); + spot.lowthrest = lowthrest->getValue(); + spot.higthrest = higthrest->getValue(); + spot.decayt = decayt->getValue(); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -456,6 +497,10 @@ void LocallabTone::setDefaults(const rtengine::procparams::ProcParams* defParams chromasktm->setDefault(defSpot.chromasktm); gammasktm->setDefault(defSpot.gammasktm); slomasktm->setDefault(defSpot.slomasktm); + recothrest->setDefault((double)defSpot.recothrest); + lowthrest->setDefault((double)defSpot.lowthrest); + higthrest->setDefault((double)defSpot.higthrest); + decayt->setDefault((double)defSpot.decayt); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -496,6 +541,14 @@ void LocallabTone::adjusterChanged(Adjuster* a, double newval) listener->panelChanged(Evlocallabgammasktm, gammasktm->getTextValue() + spName); } else if (a == slomasktm) { listener->panelChanged(Evlocallabslomasktm, slomasktm->getTextValue() + spName); + } else if (a == recothrest) { + listener->panelChanged(Evlocallabrecothrest, recothrest->getTextValue() + spName); + } else if (a == lowthrest) { + listener->panelChanged(Evlocallablowthrest, lowthrest->getTextValue() + spName); + } else if (a == higthrest) { + listener->panelChanged(Evlocallabhigthrest, higthrest->getTextValue() + spName); + } else if (a == decayt) { + listener->panelChanged(Evlocallabdecayt, decayt->getTextValue() + spName); } } } @@ -562,6 +615,10 @@ void LocallabTone::convertParamToSimple() // radmasktm->setValue(defSpot.radmasktm); // chromasktm->setValue(defSpot.chromasktm); // Lmasktmshape->setCurve(defSpot.Lmasktmcurve); + recothrest->setValue(defSpot.recothrest); + lowthrest->setValue(defSpot.lowthrest); + higthrest->setValue(defSpot.higthrest); + decayt->setValue(defSpot.decayt); // Enable all listeners enableListener(); @@ -576,6 +633,10 @@ void LocallabTone::updateGUIToMode(const modeType new_type) satur->hide(); rewei->hide(); expmasktm->hide(); + exprecovt->hide(); + decayt->hide(); + maskusablet->hide(); + maskunusablet->hide(); break; @@ -589,6 +650,16 @@ void LocallabTone::updateGUIToMode(const modeType new_type) slomasktm->hide(); // Specific Simple mode widgets are shown in Normal mode expmasktm->show(); + exprecovt->show(); + decayt->hide(); + if (enatmMask->get_active()) { + maskusablet->show(); + maskunusablet->hide(); + + } else { + maskusablet->hide(); + maskunusablet->show(); + } break; @@ -601,6 +672,16 @@ void LocallabTone::updateGUIToMode(const modeType new_type) lapmasktm->show(); gammasktm->show(); slomasktm->show(); + exprecovt->show(); + decayt->show(); + if (enatmMask->get_active()) { + maskusablet->show(); + maskunusablet->hide(); + + } else { + maskusablet->hide(); + maskunusablet->show(); + } } } @@ -650,6 +731,14 @@ void LocallabTone::showmasktmMethodChanged() void LocallabTone::enatmMaskChanged() { + if (enatmMask->get_active()) { + maskusablet->show(); + maskunusablet->hide(); + } else { + maskusablet->hide(); + maskunusablet->show(); + } + if (isLocActivated && exp->getEnabled()) { if (listener) { if (enatmMask->get_active()) { diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 102d6b499..0e7abb5d6 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1378,6 +1378,10 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).slomasktm = locallab.spots.at(j).slomasktm && pSpot.slomasktm == otherSpot.slomasktm; locallab.spots.at(j).lapmasktm = locallab.spots.at(j).lapmasktm && pSpot.lapmasktm == otherSpot.lapmasktm; locallab.spots.at(j).Lmasktmcurve = locallab.spots.at(j).Lmasktmcurve && pSpot.Lmasktmcurve == otherSpot.Lmasktmcurve; + locallab.spots.at(j).recothrest = locallab.spots.at(j).recothrest && pSpot.recothrest == otherSpot.recothrest; + locallab.spots.at(j).lowthrest = locallab.spots.at(j).lowthrest && pSpot.lowthrest == otherSpot.lowthrest; + locallab.spots.at(j).higthrest = locallab.spots.at(j).higthrest && pSpot.higthrest == otherSpot.higthrest; + locallab.spots.at(j).decayt = locallab.spots.at(j).decayt && pSpot.decayt == otherSpot.decayt; // Retinex locallab.spots.at(j).visireti = locallab.spots.at(j).visireti && pSpot.visireti == otherSpot.visireti; locallab.spots.at(j).expreti = locallab.spots.at(j).expreti && pSpot.expreti == otherSpot.expreti; @@ -4465,6 +4469,22 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).Lmasktmcurve = mods.locallab.spots.at(i).Lmasktmcurve; } + if (locallab.spots.at(i).recothrest) { + toEdit.locallab.spots.at(i).recothrest = mods.locallab.spots.at(i).recothrest; + } + + if (locallab.spots.at(i).lowthrest) { + toEdit.locallab.spots.at(i).lowthrest = mods.locallab.spots.at(i).lowthrest; + } + + if (locallab.spots.at(i).higthrest) { + toEdit.locallab.spots.at(i).higthrest = mods.locallab.spots.at(i).higthrest; + } + + if (locallab.spots.at(i).decayt) { + toEdit.locallab.spots.at(i).decayt = mods.locallab.spots.at(i).decayt; + } + // Retinex if (locallab.spots.at(i).visireti) { toEdit.locallab.spots.at(i).visireti = mods.locallab.spots.at(i).visireti; @@ -6857,6 +6877,10 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : slomasktm(v), lapmasktm(v), Lmasktmcurve(v), + recothrest(v), + lowthrest(v), + higthrest(v), + decayt(v), // Retinex visireti(v), expreti(v), @@ -7410,6 +7434,10 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) slomasktm = v; lapmasktm = v; Lmasktmcurve = v; + recothrest = v; + lowthrest = v; + higthrest = v; + decayt = v; // Retinex visireti = v; expreti = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index b56fea35b..0fea0406a 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -715,6 +715,10 @@ public: bool slomasktm; bool lapmasktm; bool Lmasktmcurve; + bool recothrest; + bool lowthrest; + bool higthrest; + bool decayt; // Retinex bool visireti; bool expreti; From 58feb50b334784f28bb1ec612ebf7b0999a19623 Mon Sep 17 00:00:00 2001 From: Desmis Date: Thu, 14 Jan 2021 14:21:01 +0100 Subject: [PATCH 055/129] Local adjustments - CBDL Luminance - Recovery based on luminance mask (#6060) * LA CBDL GUI for Recovery based on luminance mask * Improve tooltips --- rtdata/languages/default | 7 +++ rtengine/iplocallab.cc | 23 ++++++++ rtengine/procevents.h | 4 ++ rtengine/procparams.cc | 16 ++++++ rtengine/procparams.h | 4 ++ rtengine/refreshmap.cc | 6 ++- rtgui/locallabtools.h | 7 +++ rtgui/locallabtools2.cc | 111 +++++++++++++++++++++++++++++++++++++++ rtgui/paramsedited.cc | 28 ++++++++++ rtgui/paramsedited.h | 4 ++ 10 files changed, 209 insertions(+), 1 deletion(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 06a920fc1..d4e268a38 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1270,6 +1270,10 @@ HISTORY_MSG_1022;Local - TM recovery threshold HISTORY_MSG_1023;Local - TM threshold mask low HISTORY_MSG_1024;Local - TM threshold mask high HISTORY_MSG_1025;Local - TM decay +HISTORY_MSG_1026;Local - cbdl recovery threshold +HISTORY_MSG_1027;Local - cbdl threshold mask low +HISTORY_MSG_1028;Local - cbdl threshold mask high +HISTORY_MSG_1029;Local - cbdl decay HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance @@ -2810,6 +2814,7 @@ TP_LOCALLAB_MASKGF_TOOLTIP;Used to direct the Guided Filter based on the image l TP_LOCALLAB_MASKRECOL_TOOLTIP;Used to modulate the effect of the Color and Light settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Color and Light settings \n In between these two areas, the full value of the Color and Light settings will be applied TP_LOCALLAB_MASKREEXP_TOOLTIP;Used to modulate the effect of the 'Dynamic range and Exposure' settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings \n In between these two areas, the full value of the 'Dynamic range and Exposure' settings will be applied TP_LOCALLAB_MASKRESH_TOOLTIP;Used to modulate the effect of the Shadows Highlights settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Shadows Highlights settings \n In between these two areas, the full value of the Shadows Highlights settings will be applied +TP_LOCALLAB_MASKRESCB_TOOLTIP;Used to modulate the effect of the CBDL (Luminance only) settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the CBDL settings \n In between these two areas, the full value of the CBDL settings will be applied TP_LOCALLAB_MASKRESTM_TOOLTIP;Used to modulate the effect of the Tone Mapping settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Tone Mapping settings \n In between these two areas, the full value of the Tone Mapping settings will be applied TP_LOCALLAB_MASKRESVIB_TOOLTIP;Used to modulate the effect of the Vibrance and Warm Cool settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Vibrance and Warm Cool settings \n In between these two areas, the full value of the Vibrance and Warm Cool settings will be applied TP_LOCALLAB_MASKRESWAV_TOOLTIP;Used to modulate the effect of the Local contrast and Wavelet settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Local contrast and Wavelet settings \n In between these two areas, the full value of the Local contrast and Wavelet settings will be applied @@ -2817,6 +2822,7 @@ TP_LOCALLAB_MASKRELOG_TOOLTIP;Used to modulate the effect of the Log encoding se TP_LOCALLAB_MASKDEINV_TOOLTIP;Reverses the way the algorithm interprets the mask.\nIf checked black and very light areas will be decreased. TP_LOCALLAB_MASKHIGTHRESC_TOOLTIP;Light-tone limit above which Color and Light will be restored progressively to their original values prior to being modified by the Color and Light settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, 'Blur mask', ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESS_TOOLTIP;Light-tone limit above which Shadows Highlights will be restored progressively to their original values prior to being modified by the Shadows Highlights settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKHIGTHRESCB_TOOLTIP;Light-tone limit above which CBDL (Luminance only) will be restored progressively to their original values prior to being modified by the CBDL settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESTM_TOOLTIP;Light-tone limit above which Tone Mapping will be restored progressively to their original values prior to being modified by the Tone Mapping settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESVIB_TOOLTIP;Light-tone limit above which Vibrance and Warm Cool will be restored progressively to their original values prior to being modified by the Vibrance and Warm Cool settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESWAV_TOOLTIP;Light-tone limit above which Local contrast and Wavelet will be restored progressively to their original values prior to being modified by the Local contrast and Wavelet settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 @@ -2833,6 +2839,7 @@ TP_LOCALLAB_MASKLOWTHRESC_TOOLTIP;Dark-tone limit below which Color and Light wi TP_LOCALLAB_MASKLOWTHRESL_TOOLTIP;Dark-tone limit below which Log encoding will be restored progressively to their original values prior to being modified by the Log encoding settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESE_TOOLTIP;Dark-tone limit below which 'Dynamic range and Exposure' will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESS_TOOLTIP;Dark-tone limit below which Shadows Highligts will be restored progressively to their original values prior to being modified by the Shadows Highlights settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKLOWTHRESCB_TOOLTIP;Dark-tone limit below which CBDL (Luminance only) will be restored progressively to their original values prior to being modified by the CBDL settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESTM_TOOLTIP;Dark-tone limit below which Tone Mapping will be restored progressively to their original values prior to being modified by the Tone Mapping settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESVIB_TOOLTIP;Dark-tone limit below which Vibrance and Warm Cool will be restored progressively to their original values prior to being modified by the Vibrance and Warm Cool settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESWAV_TOOLTIP;Dark-tone limit below which Local contrast and Wavelet will be restored progressively to their original values prior to being modified by the Local contrast and Wavelet settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 1e4609476..79c84f648 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -600,6 +600,10 @@ struct local_params { float lowthrv; float higthrv; float decayv; + float recothrcb; + float lowthrcb; + float higthrcb; + float decaycb; float recothrt; float lowthrt; float higthrt; @@ -1100,6 +1104,11 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall float local_higthrv = (float)locallab.spots.at(sp).higthresv; float local_decayv = (float)locallab.spots.at(sp).decayv; + float local_recothrcb = (float)locallab.spots.at(sp).recothrescb; + float local_lowthrcb = (float)locallab.spots.at(sp).lowthrescb; + float local_higthrcb = (float)locallab.spots.at(sp).higthresv; + float local_decaycb = (float)locallab.spots.at(sp).decaycb; + float local_recothrt = (float)locallab.spots.at(sp).recothrest; float local_lowthrt = (float)locallab.spots.at(sp).lowthrest; float local_higthrt = (float)locallab.spots.at(sp).higthrest; @@ -1499,6 +1508,10 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.lowthrt = local_lowthrt; lp.higthrt = local_higthrt; lp.decayt = local_decayt; + lp.recothrcb = local_recothrcb; + lp.lowthrcb = local_lowthrcb; + lp.higthrcb = local_higthrcb; + lp.decaycb = local_decaycb; lp.recothrl = local_recothrl; lp.lowthrl = local_lowthrl; @@ -11989,6 +12002,16 @@ void ImProcFunctions::Lab_Local( if (lp.softradiuscb > 0.f) { softproc(origcbdl.get(), loctemp.get(), lp.softradiuscb, bfh, bfw, 0.001, 0.00001, 0.5f, sk, multiThread, 1); } + + if(lp.enacbMask && lp.recothrcb != 1.f) { + float hig = lp.higthrcb; + float low = lp.lowthrcb; + float recoth = lp.recothrcb; + float decay = lp.decaycb; + bool invmask = false; + maskrecov(loctemp.get(), original, bufmaskorigcb.get(), bfh, bfw, ystart, xstart, hig, low, recoth, decay, invmask, sk, multiThread); + } + } diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 70787bef6..a324d7fe0 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -1048,6 +1048,10 @@ enum ProcEventCode { Evlocallablowthrest = 1022, Evlocallabhigthrest = 1023, Evlocallabdecayt = 1024, + Evlocallabrecothrescb = 1025, + Evlocallablowthrescb = 1026, + Evlocallabhigthrescb = 1027, + Evlocallabdecaycb = 1028, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index c787755cd..50a2f5c6c 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3947,6 +3947,10 @@ LocallabParams::LocallabSpot::LocallabSpot() : 1.0, 1.0 }, + recothrescb(1.), + lowthrescb(12.), + higthrescb(85.), + decaycb(2.), // Log encoding visilog(false), explog(false), @@ -4644,6 +4648,10 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && slomaskcb == other.slomaskcb && lapmaskcb == other.lapmaskcb && Lmaskcbcurve == other.Lmaskcbcurve + && recothrescb == other.recothrescb + && lowthrescb == other.lowthrescb + && higthrescb == other.higthrescb + && decaycb == other.decaycb // Log encoding && visilog == other.visilog && explog == other.explog @@ -6270,6 +6278,10 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->slomaskcb, "Locallab", "Slomaskcb_" + index_str, spot.slomaskcb, keyFile); saveToKeyfile(!pedited || spot_edited->lapmaskcb, "Locallab", "Lapmaskcb_" + index_str, spot.lapmaskcb, keyFile); saveToKeyfile(!pedited || spot_edited->Lmaskcbcurve, "Locallab", "LmaskcbCurve_" + index_str, spot.Lmaskcbcurve, keyFile); + saveToKeyfile(!pedited || spot_edited->recothrescb, "Locallab", "Recothrescb_" + index_str, spot.recothrescb, keyFile); + saveToKeyfile(!pedited || spot_edited->lowthrescb, "Locallab", "Lowthrescb_" + index_str, spot.lowthrescb, keyFile); + saveToKeyfile(!pedited || spot_edited->higthrescb, "Locallab", "Higthrescb_" + index_str, spot.higthrescb, keyFile); + saveToKeyfile(!pedited || spot_edited->decaycb, "Locallab", "Decaycb_" + index_str, spot.decaycb, keyFile); } // Log encoding if ((!pedited || spot_edited->visilog) && spot.visilog) { @@ -8146,6 +8158,10 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Slomaskcb_" + index_str, pedited, spot.slomaskcb, spotEdited.slomaskcb); assignFromKeyfile(keyFile, "Locallab", "Lapmaskcb_" + index_str, pedited, spot.lapmaskcb, spotEdited.lapmaskcb); assignFromKeyfile(keyFile, "Locallab", "LmaskcbCurve_" + index_str, pedited, spot.Lmaskcbcurve, spotEdited.Lmaskcbcurve); + assignFromKeyfile(keyFile, "Locallab", "Recothrescb_" + index_str, pedited, spot.recothrescb, spotEdited.recothrescb); + assignFromKeyfile(keyFile, "Locallab", "Lowthrescb_" + index_str, pedited, spot.lowthrescb, spotEdited.lowthrescb); + assignFromKeyfile(keyFile, "Locallab", "Higthrescb_" + index_str, pedited, spot.higthrescb, spotEdited.higthrescb); + assignFromKeyfile(keyFile, "Locallab", "Decaycb_" + index_str, pedited, spot.decaycb, spotEdited.decaycb); // Log encoding spot.visilog = assignFromKeyfile(keyFile, "Locallab", "Explog_" + index_str, pedited, spot.explog, spotEdited.explog); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 0c9f35d17..c0ddfc0f0 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1460,6 +1460,10 @@ struct LocallabParams { double slomaskcb; double lapmaskcb; std::vector Lmaskcbcurve; + double recothrescb; + double lowthrescb; + double higthrescb; + double decaycb; // Log encoding bool visilog; bool explog; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 6eff2f9d6..0d08b253a 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -1051,7 +1051,11 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabrecothret LUMINANCECURVE, // Evlocallablowthrest LUMINANCECURVE, // Evlocallabhigthrest - LUMINANCECURVE // Evlocallabdecayt + LUMINANCECURVE, // Evlocallabdecayt + LUMINANCECURVE, // Evlocallabrecothrecb + LUMINANCECURVE, // Evlocallablowthrescb + LUMINANCECURVE, // Evlocallabhigthrescb + LUMINANCECURVE // Evlocallabdecaycb }; diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index 03ff4d68e..68fb80071 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -1209,6 +1209,13 @@ private: Adjuster* const contresid; Adjuster* const softradiuscb; Adjuster* const sensicb; + MyExpander* const exprecovcb; + Gtk::Label* const maskusablecb; + Gtk::Label* const maskunusablecb; + Adjuster* const recothrescb; + Adjuster* const lowthrescb; + Adjuster* const higthrescb; + Adjuster* const decaycb; MyExpander* const expmaskcb; MyComboBoxText* const showmaskcbMethod; Gtk::CheckButton* const enacbMask; diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index 5c22a6128..e4c0e6bad 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -4177,6 +4177,13 @@ LocallabCBDL::LocallabCBDL(): contresid(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CONTRESID"), -100, 100, 1, 0))), softradiuscb(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOFTRADIUSCOL"), 0.0, 100.0, 0.5, 0.))), sensicb(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 60))), + exprecovcb(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI2_EXP")))), + maskusablecb(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUSABLE")))), + maskunusablecb(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUNUSABLE")))), + recothrescb(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKRECOTHRES"), 1., 2., 0.01, 1.))), + lowthrescb(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 80., 0.5, 12.))), + higthrescb(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 20., 99., 0.5, 85.))), + decaycb(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKDDECAY"), 0.5, 4., 0.1, 2.))), expmaskcb(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_SHOWCB")))), showmaskcbMethod(Gtk::manage(new MyComboBoxText())), enacbMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))), @@ -4217,6 +4224,12 @@ LocallabCBDL::LocallabCBDL(): sensicb->setAdjusterListener(this); + recothrescb->setAdjusterListener(this); + lowthrescb->setAdjusterListener(this); + higthrescb->setAdjusterListener(this); + decaycb->setAdjusterListener(this); + setExpandAlignProperties(exprecovcb, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); + showmaskcbMethod->append(M("TP_LOCALLAB_SHOWMNONE")); showmaskcbMethod->append(M("TP_LOCALLAB_SHOWMODIF")); showmaskcbMethod->append(M("TP_LOCALLAB_SHOWMODIFMASK")); @@ -4298,6 +4311,17 @@ LocallabCBDL::LocallabCBDL(): pack_start(*residFrame); pack_start(*softradiuscb); pack_start(*sensicb); + ToolParamBlock* const cbBox3 = Gtk::manage(new ToolParamBlock()); + cbBox3->pack_start(*maskusablecb, Gtk::PACK_SHRINK, 0); + cbBox3->pack_start(*maskunusablecb, Gtk::PACK_SHRINK, 0); + cbBox3->pack_start(*recothrescb); + cbBox3->pack_start(*lowthrescb); + cbBox3->pack_start(*higthrescb); + cbBox3->pack_start(*decaycb); + // colBox3->pack_start(*invmaskc); + exprecovcb->add(*cbBox3, false); + pack_start(*exprecovcb, false, false); + ToolParamBlock* const maskcbBox = Gtk::manage(new ToolParamBlock()); maskcbBox->pack_start(*showmaskcbMethod, Gtk::PACK_SHRINK, 4); maskcbBox->pack_start(*enacbMask, Gtk::PACK_SHRINK, 0); @@ -4346,6 +4370,7 @@ void LocallabCBDL::updateAdviceTooltips(const bool showTooltips) adj->set_tooltip_text(M("TP_LOCALLAB_CBDL_ADJ_TOOLTIP")); } + exprecovcb->set_tooltip_markup(M("TP_LOCALLAB_MASKRESCB_TOOLTIP")); chromacbdl->set_tooltip_text(M("TP_LOCALLAB_CHROMACB_TOOLTIP")); threshold->set_tooltip_text(M("TP_LOCALLAB_CBDL_THRES_TOOLTIP")); clarityml->set_tooltip_text(M("TP_LOCALLAB_CBDLCLARI_TOOLTIP")); @@ -4363,6 +4388,9 @@ void LocallabCBDL::updateAdviceTooltips(const bool showTooltips) chromaskcb->set_tooltip_text(M("TP_LOCALLAB_CHROMASK_TOOLTIP")); slomaskcb->set_tooltip_text(M("TP_LOCALLAB_SLOMASK_TOOLTIP")); lapmaskcb->set_tooltip_text(M("TP_LOCALLAB_LAPRAD1_TOOLTIP")); + decaycb->set_tooltip_text(M("TP_LOCALLAB_MASKDECAY_TOOLTIP")); + lowthrescb->set_tooltip_text(M("TP_LOCALLAB_MASKLOWTHRESCB_TOOLTIP")); + higthrescb->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRESCB_TOOLTIP")); } else { levFrame->set_tooltip_text(""); @@ -4387,11 +4415,16 @@ void LocallabCBDL::updateAdviceTooltips(const bool showTooltips) chromaskcb->set_tooltip_text(""); slomaskcb->set_tooltip_text(""); lapmaskcb->set_tooltip_text(""); + exprecovcb->set_tooltip_markup(""); + decaycb->set_tooltip_text(""); + lowthrescb->set_tooltip_text(""); + higthrescb->set_tooltip_text(""); } } void LocallabCBDL::setDefaultExpanderVisibility() { + exprecovcb->set_expanded(false); expmaskcb->set_expanded(false); } @@ -4457,6 +4490,10 @@ void LocallabCBDL::read(const rtengine::procparams::ProcParams* pp, const Params gammaskcb->setValue(spot.gammaskcb); slomaskcb->setValue(spot.slomaskcb); Lmaskcbshape->setCurve(spot.Lmaskcbcurve); + recothrescb->setValue((double)spot.recothrescb); + lowthrescb->setValue((double)spot.lowthrescb); + higthrescb->setValue((double)spot.higthrescb); + decaycb->setValue((double)spot.decaycb); } // Enable all listeners @@ -4500,6 +4537,10 @@ void LocallabCBDL::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.gammaskcb = gammaskcb->getValue(); spot.slomaskcb = slomaskcb->getValue(); spot.Lmaskcbcurve = Lmaskcbshape->getCurve(); + spot.recothrescb = recothrescb->getValue(); + spot.lowthrescb = lowthrescb->getValue(); + spot.higthrescb = higthrescb->getValue(); + spot.decaycb = decaycb->getValue(); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -4529,6 +4570,10 @@ void LocallabCBDL::setDefaults(const rtengine::procparams::ProcParams* defParams chromaskcb->setDefault(defSpot.chromaskcb); gammaskcb->setDefault(defSpot.gammaskcb); slomaskcb->setDefault(defSpot.slomaskcb); + recothrescb->setDefault((double)defSpot.recothrescb); + lowthrescb->setDefault((double)defSpot.lowthrescb); + higthrescb->setDefault((double)defSpot.higthrescb); + decaycb->setDefault((double)defSpot.decaycb); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -4593,6 +4638,35 @@ void LocallabCBDL::adjusterChanged(Adjuster* a, double newval) } } + if (a == recothrescb) { + + if (listener) { + listener->panelChanged(Evlocallabrecothrescb, + recothrescb->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == lowthrescb) { + if (listener) { + listener->panelChanged(Evlocallablowthrescb, + lowthrescb->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == higthrescb) { + if (listener) { + listener->panelChanged(Evlocallabhigthrescb, + higthrescb->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == decaycb) { + if (listener) { + listener->panelChanged(Evlocallabdecaycb, + decaycb->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + if (a == blendmaskcb) { if (listener) { listener->panelChanged(Evlocallabblendmaskcb, @@ -4694,6 +4768,7 @@ void LocallabCBDL::convertParamToNormal() // Set hidden GUI widgets in Normal mode to default spot values lapmaskcb->setValue(defSpot.lapmaskcb); + decaycb->setValue(defSpot.decaycb); // Enable all listeners enableListener(); @@ -4719,6 +4794,10 @@ void LocallabCBDL::convertParamToSimple() // gammaskcb->setValue(defSpot.gammaskcb); // slomaskcb->setValue(defSpot.slomaskcb); // Lmaskcbshape->setCurve(defSpot.Lmaskcbcurve); + recothrescb->setValue(defSpot.recothrescb); + lowthrescb->setValue(defSpot.lowthrescb); + higthrescb->setValue(defSpot.higthrescb); + decaycb->setValue(defSpot.decaycb); // Enable all listers enableListener(); @@ -4731,6 +4810,10 @@ void LocallabCBDL::updateGUIToMode(const modeType new_type) // Expert and Normal mode widgets are hidden in Simple mode softradiuscb->hide(); expmaskcb->hide(); + exprecovcb->hide(); + decaycb->hide(); + maskusablecb->hide(); + maskunusablecb->hide(); break; @@ -4740,6 +4823,16 @@ void LocallabCBDL::updateGUIToMode(const modeType new_type) // Specific Simple mode widgets are shown in Normal mode softradiuscb->show(); expmaskcb->show(); + exprecovcb->show(); + decaycb->hide(); + if (enacbMask->get_active()) { + maskusablecb->show(); + maskunusablecb->hide(); + + } else { + maskusablecb->hide(); + maskunusablecb->show(); + } break; @@ -4748,6 +4841,16 @@ void LocallabCBDL::updateGUIToMode(const modeType new_type) softradiuscb->show(); expmaskcb->show(); lapmaskcb->show(); + exprecovcb->show(); + decaycb->show(); + if (enacbMask->get_active()) { + maskusablecb->show(); + maskunusablecb->hide(); + + } else { + maskusablecb->hide(); + maskunusablecb->show(); + } } } @@ -4782,6 +4885,14 @@ void LocallabCBDL::showmaskcbMethodChanged() void LocallabCBDL::enacbMaskChanged() { + if (enacbMask->get_active()) { + maskusablecb->show(); + maskunusablecb->hide(); + } else { + maskusablecb->hide(); + maskunusablecb->show(); + } + if (isLocActivated && exp->getEnabled()) { if (listener) { if (enacbMask->get_active()) { diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 0e7abb5d6..18a66453e 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1535,6 +1535,10 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).slomaskcb = locallab.spots.at(j).slomaskcb && pSpot.slomaskcb == otherSpot.slomaskcb; locallab.spots.at(j).lapmaskcb = locallab.spots.at(j).lapmaskcb && pSpot.lapmaskcb == otherSpot.lapmaskcb; locallab.spots.at(j).Lmaskcbcurve = locallab.spots.at(j).Lmaskcbcurve && pSpot.Lmaskcbcurve == otherSpot.Lmaskcbcurve; + locallab.spots.at(j).recothrescb = locallab.spots.at(j).recothrescb && pSpot.recothrescb == otherSpot.recothrescb; + locallab.spots.at(j).lowthrescb = locallab.spots.at(j).lowthrescb && pSpot.lowthrescb == otherSpot.lowthrescb; + locallab.spots.at(j).higthrescb = locallab.spots.at(j).higthrescb && pSpot.higthrescb == otherSpot.higthrescb; + locallab.spots.at(j).decaycb = locallab.spots.at(j).decaycb && pSpot.decaycb == otherSpot.decaycb; // Log encoding locallab.spots.at(j).visilog = locallab.spots.at(j).visilog && pSpot.visilog == otherSpot.visilog; locallab.spots.at(j).explog = locallab.spots.at(j).explog && pSpot.explog == otherSpot.explog; @@ -5072,6 +5076,22 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).Lmaskcbcurve = mods.locallab.spots.at(i).Lmaskcbcurve; } + if (locallab.spots.at(i).recothrescb) { + toEdit.locallab.spots.at(i).recothrescb = mods.locallab.spots.at(i).recothrescb; + } + + if (locallab.spots.at(i).lowthrescb) { + toEdit.locallab.spots.at(i).lowthrescb = mods.locallab.spots.at(i).lowthrescb; + } + + if (locallab.spots.at(i).higthrescb) { + toEdit.locallab.spots.at(i).higthrescb = mods.locallab.spots.at(i).higthrescb; + } + + if (locallab.spots.at(i).decaycb) { + toEdit.locallab.spots.at(i).decaycb = mods.locallab.spots.at(i).decaycb; + } + // Log encoding if (locallab.spots.at(i).visilog) { toEdit.locallab.spots.at(i).visilog = mods.locallab.spots.at(i).visilog; @@ -7030,6 +7050,10 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : slomaskcb(v), lapmaskcb(v), Lmaskcbcurve(v), + recothrescb(v), + lowthrescb(v), + higthrescb(v), + decaycb(v), // Log encoding visilog(v), explog(v), @@ -7591,6 +7615,10 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) slomaskcb = v; lapmaskcb = v; Lmaskcbcurve = v; + recothrescb = v; + lowthrescb = v; + higthrescb = v; + decaycb = v; // Log encoding visilog = v; explog = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 0fea0406a..d684db7be 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -868,6 +868,10 @@ public: bool slomaskcb; bool lapmaskcb; bool Lmaskcbcurve; + bool recothrescb; + bool lowthrescb; + bool higthrescb; + bool decaycb; // Log encoding bool visilog; bool explog; From 59b7eb0bbd13606f61c7495752a13acf5838c9f4 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Thu, 14 Jan 2021 19:12:49 +0100 Subject: [PATCH 056/129] rcd: small speedup and cleaner code, #6054 --- rtengine/rcd_demosaic.cc | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/rtengine/rcd_demosaic.cc b/rtengine/rcd_demosaic.cc index 7f76ddcdb..b97b19bb9 100644 --- a/rtengine/rcd_demosaic.cc +++ b/rtengine/rcd_demosaic.cc @@ -76,7 +76,7 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) const unsigned int cfarray[2][2] = {{FC(0,0), FC(0,1)}, {FC(1,0), FC(1,1)}}; constexpr int rcdBorder = 6; constexpr int tileBorder = 9; - constexpr int tileSize = 140; + constexpr int tileSize = 194; constexpr int tileSizeN = tileSize - 2 * tileBorder; const int numTh = H / (tileSizeN) + ((H % (tileSizeN)) ? 1 : 0); const int numTw = W / (tileSizeN) + ((W % (tileSizeN)) ? 1 : 0); @@ -119,23 +119,15 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) const int tilecols = std::min(colEnd - colStart, tileSize); for (int row = rowStart; row < rowEnd; row++) { - int indx = (row - rowStart) * tileSize; const int c0 = fc(cfarray, row, colStart); const int c1 = fc(cfarray, row, colStart + 1); - int col = colStart; - for (; col < colEnd - 1; col+=2, indx+=2) { - cfa[indx] = rgb[c0][indx] = LIM01(rawData[row][col] / scale); - cfa[indx + 1] = rgb[c1][indx + 1] = LIM01(rawData[row][col + 1] / scale); - } - if (col < colEnd) { - cfa[indx] = rgb[c0][indx] = LIM01(rawData[row][col] / scale); + for (int col = colStart, indx = (row - rowStart) * tileSize; col < colEnd; ++col, ++indx) { + cfa[indx] = rgb[c0][indx] = rgb[c1][indx] = LIM01(rawData[row][col] / scale); } } - /** * STEP 1: Find cardinal and diagonal interpolation directions */ - float bufferV[3][tileSize - 8]; // Step 1.1: Calculate the square of the vertical and horizontal color difference high pass filter @@ -314,12 +306,12 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) } // For the outermost tiles in all directions we can use a smaller border margin - const int last_vertical = rowEnd - ((tr == numTh - 1) ? rcdBorder : tileBorder); - const int first_horizontal = colStart + ((tc == 0) ? rcdBorder : tileBorder); - const int last_horizontal = colEnd - ((tc == numTw - 1) ? rcdBorder : tileBorder); - for(int row = rowStart + ((tr == 0) ? rcdBorder : tileBorder); row < last_vertical; row++) { -// for (int row = rowStart + tileBorder; row < rowEnd - tileBorder; ++row) { - for (int col = first_horizontal; col < last_horizontal; ++col) { + const int firstVertical = rowStart + ((tr == 0) ? rcdBorder : tileBorder); + const int lastVertical = rowEnd - ((tr == numTh - 1) ? rcdBorder : tileBorder); + const int firstHorizontal = colStart + ((tc == 0) ? rcdBorder : tileBorder); + const int lastHorizontal = colEnd - ((tc == numTw - 1) ? rcdBorder : tileBorder); + for (int row = firstVertical; row < lastVertical; ++row) { + for (int col = firstHorizontal; col < lastHorizontal; ++col) { int idx = (row - rowStart) * tileSize + col - colStart ; red[row][col] = std::max(0.f, rgb[0][idx] * scale); green[row][col] = std::max(0.f, rgb[1][idx] * scale); From ea6bb8fcf7e7c0bc6f873fffb12b07fc24340700 Mon Sep 17 00:00:00 2001 From: Desmis Date: Fri, 15 Jan 2021 12:29:46 +0100 Subject: [PATCH 057/129] Local adjustments - Retinex - Last Recovery based on luminance mask (#6062) * LA Retinex GUI for Recovery based on luminance mask * LA Retinex Enable Recovery based on luminance mask --- rtdata/languages/default | 7 +++ rtengine/improcfun.h | 4 +- rtengine/iplocallab.cc | 53 ++++++++++++++++-- rtengine/ipretinex.cc | 11 ++-- rtengine/procevents.h | 4 ++ rtengine/procparams.cc | 16 ++++++ rtengine/procparams.h | 4 ++ rtengine/refreshmap.cc | 6 +- rtgui/locallabtools.h | 7 +++ rtgui/locallabtools2.cc | 118 +++++++++++++++++++++++++++++++++++++++ rtgui/paramsedited.cc | 28 ++++++++++ rtgui/paramsedited.h | 4 ++ 12 files changed, 248 insertions(+), 14 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index d4e268a38..5b7a358db 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1274,6 +1274,10 @@ HISTORY_MSG_1026;Local - cbdl recovery threshold HISTORY_MSG_1027;Local - cbdl threshold mask low HISTORY_MSG_1028;Local - cbdl threshold mask high HISTORY_MSG_1029;Local - cbdl decay +HISTORY_MSG_1030;Local - reti recovery threshold +HISTORY_MSG_1031;Local - reti threshold mask low +HISTORY_MSG_1032;Local - reti threshold mask high +HISTORY_MSG_1033;Local - reti decay HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance @@ -2815,6 +2819,7 @@ TP_LOCALLAB_MASKRECOL_TOOLTIP;Used to modulate the effect of the Color and Light TP_LOCALLAB_MASKREEXP_TOOLTIP;Used to modulate the effect of the 'Dynamic range and Exposure' settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings \n In between these two areas, the full value of the 'Dynamic range and Exposure' settings will be applied TP_LOCALLAB_MASKRESH_TOOLTIP;Used to modulate the effect of the Shadows Highlights settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Shadows Highlights settings \n In between these two areas, the full value of the Shadows Highlights settings will be applied TP_LOCALLAB_MASKRESCB_TOOLTIP;Used to modulate the effect of the CBDL (Luminance only) settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the CBDL settings \n In between these two areas, the full value of the CBDL settings will be applied +TP_LOCALLAB_MASKRESRETI_TOOLTIP;Used to modulate the effect of the Retinex (Luminance only) settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Retinex settings \n In between these two areas, the full value of the Retinex settings will be applied TP_LOCALLAB_MASKRESTM_TOOLTIP;Used to modulate the effect of the Tone Mapping settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Tone Mapping settings \n In between these two areas, the full value of the Tone Mapping settings will be applied TP_LOCALLAB_MASKRESVIB_TOOLTIP;Used to modulate the effect of the Vibrance and Warm Cool settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Vibrance and Warm Cool settings \n In between these two areas, the full value of the Vibrance and Warm Cool settings will be applied TP_LOCALLAB_MASKRESWAV_TOOLTIP;Used to modulate the effect of the Local contrast and Wavelet settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Local contrast and Wavelet settings \n In between these two areas, the full value of the Local contrast and Wavelet settings will be applied @@ -2823,6 +2828,7 @@ TP_LOCALLAB_MASKDEINV_TOOLTIP;Reverses the way the algorithm interprets the mask TP_LOCALLAB_MASKHIGTHRESC_TOOLTIP;Light-tone limit above which Color and Light will be restored progressively to their original values prior to being modified by the Color and Light settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, 'Blur mask', ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESS_TOOLTIP;Light-tone limit above which Shadows Highlights will be restored progressively to their original values prior to being modified by the Shadows Highlights settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESCB_TOOLTIP;Light-tone limit above which CBDL (Luminance only) will be restored progressively to their original values prior to being modified by the CBDL settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKHIGTHRESRETI_TOOLTIP;Light-tone limit above which Retinex (Luminance only) will be restored progressively to their original values prior to being modified by the Retinex settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESTM_TOOLTIP;Light-tone limit above which Tone Mapping will be restored progressively to their original values prior to being modified by the Tone Mapping settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESVIB_TOOLTIP;Light-tone limit above which Vibrance and Warm Cool will be restored progressively to their original values prior to being modified by the Vibrance and Warm Cool settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESWAV_TOOLTIP;Light-tone limit above which Local contrast and Wavelet will be restored progressively to their original values prior to being modified by the Local contrast and Wavelet settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 @@ -2840,6 +2846,7 @@ TP_LOCALLAB_MASKLOWTHRESL_TOOLTIP;Dark-tone limit below which Log encoding will TP_LOCALLAB_MASKLOWTHRESE_TOOLTIP;Dark-tone limit below which 'Dynamic range and Exposure' will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESS_TOOLTIP;Dark-tone limit below which Shadows Highligts will be restored progressively to their original values prior to being modified by the Shadows Highlights settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESCB_TOOLTIP;Dark-tone limit below which CBDL (Luminance only) will be restored progressively to their original values prior to being modified by the CBDL settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKLOWTHRESRETI_TOOLTIP;Dark-tone limit below which Retinex (Luminance only) will be restored progressively to their original values prior to being modified by the Retinex settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESTM_TOOLTIP;Dark-tone limit below which Tone Mapping will be restored progressively to their original values prior to being modified by the Tone Mapping settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESVIB_TOOLTIP;Dark-tone limit below which Vibrance and Warm Cool will be restored progressively to their original values prior to being modified by the Vibrance and Warm Cool settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESWAV_TOOLTIP;Dark-tone limit below which Local contrast and Wavelet will be restored progressively to their original values prior to being modified by the Local contrast and Wavelet settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 375d506ce..4915e04e6 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -266,7 +266,7 @@ public: const LocCCmaskCurve & locccmasretiCurve, bool lcmasretiutili, const LocLLmaskCurve & locllmasretiCurve, bool llmasretiutili, const LocHHmaskCurve & lochhmasretiCurve, bool lhmasretiutili, int llretiMask, bool retiMasktmap, bool retiMask, float rad, float lap, bool pde, float gamm, float slop, float chro, float blend, const LUTf & lmaskretilocalcurve, bool localmaskretiutili, - LabImage * bufreti, LabImage * bufmask, LabImage * buforig, LabImage * buforigmas, bool multiThread, + LabImage * bufreti, LabImage * bufmask, LabImage * buforig, LabImage * buforigmas, LabImage * bufmaskorigreti, bool multiThread, bool delt, const float hueref, const float chromaref, const float lumaref, float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope, float balance, float balanceh, float lumask); @@ -275,7 +275,7 @@ public: void log_encode(Imagefloat *rgb, struct local_params & lp, bool multiThread, int bfw, int bfh); void getAutoLogloc(int sp, ImageSource *imgsrc, float *sourceg, float *blackev, float *whiteev, bool *Autogr, float *sourceab, int fw, int fh, float xsta, float xend, float ysta, float yend, int SCALE); - void MSRLocal(int call, int sp, bool fftw, int lum, float** reducDE, LabImage * bufreti, LabImage * bufmask, LabImage * buforig, LabImage * buforigmas, float** luminance, const float* const *originalLuminance, + void MSRLocal(int call, int sp, bool fftw, int lum, float** reducDE, LabImage * bufreti, LabImage * bufmask, LabImage * buforig, LabImage * buforigmas, LabImage * bufmaskorigreti, float** luminance, const float* const *originalLuminance, const int width, const int height, int bfwr, int bfhr, const procparams::LocallabParams &loc, const int skip, const LocretigainCurve &locRETgainCcurve, const LocretitransCurve &locRETtransCcurve, 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, const LocCCmaskCurve & locccmasretiCurve, bool lcmasretiutili, const LocLLmaskCurve & locllmasretiCurve, bool llmasretiutili, const LocHHmaskCurve & lochhmasretiCurve, bool lhmasretiutili, int llretiMask, diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 79c84f648..820e8c352 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -612,6 +612,10 @@ struct local_params { float lowthrw; float higthrw; float decayw; + float recothrr; + float lowthrr; + float higthrr; + float decayr; float recothrs; float lowthrs; float higthrs; @@ -1106,9 +1110,14 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall float local_recothrcb = (float)locallab.spots.at(sp).recothrescb; float local_lowthrcb = (float)locallab.spots.at(sp).lowthrescb; - float local_higthrcb = (float)locallab.spots.at(sp).higthresv; + float local_higthrcb = (float)locallab.spots.at(sp).higthrescb; float local_decaycb = (float)locallab.spots.at(sp).decaycb; + float local_recothrr = (float)locallab.spots.at(sp).recothresr; + float local_lowthrr = (float)locallab.spots.at(sp).lowthresr; + float local_higthrr = (float)locallab.spots.at(sp).higthresr; + float local_decayr = (float)locallab.spots.at(sp).decayr; + float local_recothrt = (float)locallab.spots.at(sp).recothrest; float local_lowthrt = (float)locallab.spots.at(sp).lowthrest; float local_higthrt = (float)locallab.spots.at(sp).higthrest; @@ -1512,6 +1521,10 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.lowthrcb = local_lowthrcb; lp.higthrcb = local_higthrcb; lp.decaycb = local_decaycb; + lp.recothrr = local_recothrr; + lp.lowthrr = local_lowthrr; + lp.higthrr = local_higthrr; + lp.decayr = local_decayr; lp.recothrl = local_recothrl; lp.lowthrl = local_lowthrl; @@ -13513,6 +13526,7 @@ void ImProcFunctions::Lab_Local( LabImage *bufmask = nullptr; LabImage *buforig = nullptr; LabImage *buforigmas = nullptr; + LabImage *bufmaskorigreti = nullptr; if (GW >= mSP && GH >= mSP) @@ -13527,10 +13541,12 @@ void ImProcFunctions::Lab_Local( bufreti = new LabImage(GW, GH); bufmask = new LabImage(GW, GH); + bufmaskorigreti = new LabImage(GW, GH); if (!lp.enaretiMasktmap && lp.enaretiMask) { buforig = new LabImage(GW, GH); buforigmas = new LabImage(GW, GH); + // bufmaskorigreti = new LabImage(GW, GH); } #ifdef _OPENMP @@ -13557,14 +13573,21 @@ void ImProcFunctions::Lab_Local( bufmask->a[y][x] = original->a[y][x]; bufmask->b[y][x] = original->b[y][x]; + + if (!lp.enaretiMasktmap && lp.enaretiMask) { buforig->L[y][x] = original->L[y][x]; buforig->a[y][x] = original->a[y][x]; buforig->b[y][x] = original->b[y][x]; + + // bufmaskorigreti->L[y][x] = original->L[y][x]; + // bufmaskorigreti->a[y][x] = original->a[y][x]; + // bufmaskorigreti->b[y][x] = original->b[y][x]; + + } } - float raddE = params->locallab.spots.at(sp).softradiusret; //calc dE and reduction to use in MSR to reduce artifacts @@ -13620,7 +13643,7 @@ void ImProcFunctions::Lab_Local( const float maxdE2 = 5.f + MAXSCOPE * sco * (1 + 0.1f * lp.thr); const float mindElim2 = 2.f + MINSCOPE * limscope * lp.thr; const float maxdElim2 = 5.f + MAXSCOPE * limscope * (1 + 0.1f * lp.thr); - ImProcFunctions::MSRLocal(call, sp, fftw, 1, reducDE, bufreti, bufmask, buforig, buforigmas, orig, orig1, + ImProcFunctions::MSRLocal(call, sp, fftw, 1, reducDE, bufreti, bufmask, buforig, buforigmas, bufmaskorigreti, orig, orig1, Wd, Hd, Wd, Hd, params->locallab, sk, locRETgainCcurve, locRETtransCcurve, 0, 4, 1.f, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax, locccmasretiCurve, lcmasretiutili, locllmasretiCurve, llmasretiutili, lochhmasretiCurve, lhmasretiutili, llretiMask, lmaskretilocalcurve, localmaskretiutili, @@ -13661,6 +13684,14 @@ void ImProcFunctions::Lab_Local( delete [] data; } + if(lp.enaretiMask && lp.recothrr != 1.f) { + float hig = lp.higthrr; + float low = lp.lowthrr; + float recoth = lp.recothrr; + float decay = lp.decayr; + bool invmask = false; + maskrecov(tmpl, original, bufmaskorigreti, Hd, Wd, 0, 0, hig, low, recoth, decay, invmask, sk, multiThread); + } float minL = tmpl->L[0][0] - bufreti->L[0][0]; float maxL = minL; @@ -13796,6 +13827,7 @@ void ImProcFunctions::Lab_Local( delete tmpl; delete bufmask; + delete bufmaskorigreti; if (!lp.enaretiMasktmap && lp.enaretiMask) { if (buforig) { @@ -13824,6 +13856,7 @@ void ImProcFunctions::Lab_Local( LabImage *bufmask = nullptr; LabImage *buforig = nullptr; LabImage *buforigmas = nullptr; + LabImage *bufmaskorigreti = nullptr; int bfhr = bfh; int bfwr = bfw; @@ -13845,6 +13878,7 @@ void ImProcFunctions::Lab_Local( Wd = bfw; bufreti = new LabImage(bfw, bfh); bufmask = new LabImage(bfw, bfh); + bufmaskorigreti = new LabImage(bfw, bfh); if (!lp.enaretiMasktmap && lp.enaretiMask) { buforig = new LabImage(bfw, bfh); @@ -13945,7 +13979,7 @@ void ImProcFunctions::Lab_Local( const float mindElim2 = 2.f + MINSCOPE * limscope * lp.thr; const float maxdElim2 = 5.f + MAXSCOPE * limscope * (1 + 0.1f * lp.thr); - ImProcFunctions::MSRLocal(call, sp, fftw, 1, reducDE, bufreti, bufmask, buforig, buforigmas, orig, orig1, + ImProcFunctions::MSRLocal(call, sp, fftw, 1, reducDE, bufreti, bufmask, buforig, buforigmas, bufmaskorigreti, orig, orig1, Wd, Hd, bfwr, bfhr, params->locallab, sk, locRETgainCcurve, locRETtransCcurve, 0, 4, 1.f, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax, locccmasretiCurve, lcmasretiutili, locllmasretiCurve, llmasretiutili, lochhmasretiCurve, lhmasretiutili, llretiMask, lmaskretilocalcurve, localmaskretiutili, @@ -13985,6 +14019,14 @@ void ImProcFunctions::Lab_Local( } } } + if(lp.enaretiMask && lp.recothrr != 1.f) { + float hig = lp.higthrr; + float low = lp.lowthrr; + float recoth = lp.recothrr; + float decay = lp.decayr; + bool invmask = false; + maskrecov(tmpl, original, bufmaskorigreti, Hd, Wd, ystart, xstart, hig, low, recoth, decay, invmask, sk, multiThread); + } if (!lp.invret) { float minL = tmpl->L[0][0] - bufreti->L[0][0]; @@ -14123,7 +14165,8 @@ void ImProcFunctions::Lab_Local( delete tmpl; delete bufmask; - + delete bufmaskorigreti; + if (!lp.enaretiMasktmap && lp.enaretiMask) { if (buforig) { delete buforig; diff --git a/rtengine/ipretinex.cc b/rtengine/ipretinex.cc index d65bf1cad..b3b28d3ad 100644 --- a/rtengine/ipretinex.cc +++ b/rtengine/ipretinex.cc @@ -782,7 +782,7 @@ void ImProcFunctions::maskforretinex(int sp, int before, float ** luminance, flo const LocCCmaskCurve & locccmasretiCurve, bool lcmasretiutili, const LocLLmaskCurve & locllmasretiCurve, bool llmasretiutili, const LocHHmaskCurve & lochhmasretiCurve, bool lhmasretiutili, int llretiMask, bool retiMasktmap, bool retiMask, float rad, float lap, bool pde, float gamm, float slop, float chro, float blend, const LUTf & lmaskretilocalcurve, bool localmaskretiutili, - LabImage * bufreti, LabImage * bufmask, LabImage * buforig, LabImage * buforigmas, bool multiThread, + LabImage * bufreti, LabImage * bufmask, LabImage * buforig, LabImage * buforigmas, LabImage * bufmaskorigreti, bool multiThread, bool delt, const float hueref, const float chromaref, const float lumaref, float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope, float balance, float balanceh, float lumask) { @@ -793,11 +793,10 @@ void ImProcFunctions::maskforretinex(int sp, int before, float ** luminance, flo array2D guid(W_L, H_L); std::unique_ptr bufmaskblurreti; bufmaskblurreti.reset(new LabImage(W_L, H_L)); - std::unique_ptr bufmaskorigreti; - bufmaskorigreti.reset(new LabImage(W_L, H_L)); +// std::unique_ptr bufmaskorigreti; +// bufmaskorigreti.reset(new LabImage(W_L, H_L)); std::unique_ptr bufprov; bufprov.reset(new LabImage(W_L, H_L)); - #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif @@ -1124,7 +1123,7 @@ void ImProcFunctions::maskforretinex(int sp, int before, float ** luminance, flo -void ImProcFunctions::MSRLocal(int call, int sp, bool fftw, int lum, float** reducDE, LabImage * bufreti, LabImage * bufmask, LabImage * buforig, LabImage * buforigmas, float** luminance, const float* const *originalLuminance, +void ImProcFunctions::MSRLocal(int call, int sp, bool fftw, int lum, float** reducDE, LabImage * bufreti, LabImage * bufmask, LabImage * buforig, LabImage * buforigmas, LabImage * bufmaskorigreti, float** luminance, const float* const *originalLuminance, const int width, const int height, int bfwr, int bfhr, const procparams::LocallabParams &loc, const int skip, const LocretigainCurve &locRETgainCcurve, const LocretitransCurve &locRETtransCcurve, 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, const LocCCmaskCurve & locccmasretiCurve, bool lcmasretiutili, const LocLLmaskCurve & locllmasretiCurve, bool llmasretiutili, const LocHHmaskCurve & lochhmasretiCurve, bool lhmasretiutili, int llretiMask, @@ -1614,7 +1613,7 @@ void ImProcFunctions::MSRLocal(int call, int sp, bool fftw, int lum, float** red locccmasretiCurve, lcmasretiutili, locllmasretiCurve, llmasretiutili, lochhmasretiCurve, lhmasretiutili, llretiMask, retiMasktmap, retiMask, rad, lap, pde, gamm, slop, chro, blend, lmaskretilocalcurve, localmaskretiutili, - bufreti, bufmask, buforig, buforigmas, multiThread, + bufreti, bufmask, buforig, buforigmas, bufmaskorigreti, multiThread, delt, hueref, chromaref, lumaref, maxdE, mindE, maxdElim, mindElim, iterat, limscope, scope, balance, balanceh, lumask ); diff --git a/rtengine/procevents.h b/rtengine/procevents.h index a324d7fe0..00f2d1916 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -1052,6 +1052,10 @@ enum ProcEventCode { Evlocallablowthrescb = 1026, Evlocallabhigthrescb = 1027, Evlocallabdecaycb = 1028, + Evlocallabrecothresr = 1029, + Evlocallablowthresr = 1030, + Evlocallabhigthresr = 1031, + Evlocallabdecayr = 1032, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 50a2f5c6c..e77a4c57a 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3664,6 +3664,10 @@ LocallabParams::LocallabSpot::LocallabSpot() : 1.0, 1.0 }, + recothresr(1.), + lowthresr(12.), + higthresr(85.), + decayr(2.), // Sharpening visisharp(false), expsharp(false), @@ -4529,6 +4533,10 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && cliptm == other.cliptm && fftwreti == other.fftwreti && Lmaskreticurve == other.Lmaskreticurve + && recothresr == other.recothresr + && lowthresr == other.lowthresr + && higthresr == other.higthresr + && decayr == other.decayr // Sharpening && visisharp == other.visisharp && expsharp == other.expsharp @@ -6160,6 +6168,10 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->cliptm, "Locallab", "Cliptm_" + index_str, spot.cliptm, keyFile); saveToKeyfile(!pedited || spot_edited->fftwreti, "Locallab", "Fftwreti_" + index_str, spot.fftwreti, keyFile); saveToKeyfile(!pedited || spot_edited->Lmaskreticurve, "Locallab", "LmaskretiCurve_" + index_str, spot.Lmaskreticurve, keyFile); + saveToKeyfile(!pedited || spot_edited->recothresr, "Locallab", "Recothresr_" + index_str, spot.recothresr, keyFile); + saveToKeyfile(!pedited || spot_edited->lowthresr, "Locallab", "Lowthresr_" + index_str, spot.lowthresr, keyFile); + saveToKeyfile(!pedited || spot_edited->higthresr, "Locallab", "Higthresr_" + index_str, spot.higthresr, keyFile); + saveToKeyfile(!pedited || spot_edited->decayr, "Locallab", "Decayr_" + index_str, spot.decayr, keyFile); } // Sharpening if ((!pedited || spot_edited->visisharp) && spot.visisharp) { @@ -8020,6 +8032,10 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Cliptm_" + index_str, pedited, spot.cliptm, spotEdited.cliptm); assignFromKeyfile(keyFile, "Locallab", "Fftwreti_" + index_str, pedited, spot.fftwreti, spotEdited.fftwreti); assignFromKeyfile(keyFile, "Locallab", "LmaskretiCurve_" + index_str, pedited, spot.Lmaskreticurve, spotEdited.Lmaskreticurve); + assignFromKeyfile(keyFile, "Locallab", "Recothresr_" + index_str, pedited, spot.recothresr, spotEdited.recothresr); + assignFromKeyfile(keyFile, "Locallab", "Lowthresr_" + index_str, pedited, spot.lowthresr, spotEdited.lowthresr); + assignFromKeyfile(keyFile, "Locallab", "Higthresr_" + index_str, pedited, spot.higthresr, spotEdited.higthresr); + assignFromKeyfile(keyFile, "Locallab", "Decayr_" + index_str, pedited, spot.decayr, spotEdited.decayr); // Sharpening spot.visisharp = assignFromKeyfile(keyFile, "Locallab", "Expsharp_" + index_str, pedited, spot.expsharp, spotEdited.expsharp); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index c0ddfc0f0..4efe4c2fc 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1349,6 +1349,10 @@ struct LocallabParams { double cliptm; bool fftwreti; std::vector Lmaskreticurve; + double recothresr; + double lowthresr; + double higthresr; + double decayr; // Sharpening bool visisharp; bool expsharp; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 0d08b253a..742aa3707 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -1055,7 +1055,11 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabrecothrecb LUMINANCECURVE, // Evlocallablowthrescb LUMINANCECURVE, // Evlocallabhigthrescb - LUMINANCECURVE // Evlocallabdecaycb + LUMINANCECURVE, // Evlocallabdecaycb + LUMINANCECURVE, // Evlocallabrecothrer + LUMINANCECURVE, // Evlocallablowthresr + LUMINANCECURVE, // Evlocallabhigthresr + LUMINANCECURVE // Evlocallabdecayr }; diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index 68fb80071..d8fb1ab29 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -930,6 +930,13 @@ private: Gtk::Label* const transLabels2; CurveEditorGroup* const LocalcurveEditorgainT; FlatCurveEditor* const cTgainshape; + MyExpander* const exprecovr; + Gtk::Label* const maskusabler; + Gtk::Label* const maskunusabler; + Adjuster* const recothresr; + Adjuster* const lowthresr; + Adjuster* const higthresr; + Adjuster* const decayr; MyExpander* const expmaskreti; MyComboBoxText* const showmaskretiMethod; Gtk::CheckButton* const enaretiMask; diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index e4c0e6bad..bc45879d9 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -802,6 +802,13 @@ LocallabRetinex::LocallabRetinex(): transLabels2(Gtk::manage(new Gtk::Label("---"))), LocalcurveEditorgainT(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_TRANSMISSIONGAIN"))), cTgainshape(static_cast(LocalcurveEditorgainT->addCurve(CT_Flat, "", nullptr, false, false))), + exprecovr(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI2_EXP")))), + maskusabler(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUSABLE")))), + maskunusabler(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUNUSABLE")))), + recothresr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKRECOTHRES"), 1., 2., 0.01, 1.))), + lowthresr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHRLOW"), 1., 80., 0.5, 12.))), + higthresr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKLCTHR"), 20., 99., 0.5, 85.))), + decayr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKDDECAY"), 0.5, 4., 0.1, 2.))), expmaskreti(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_SHOWR")))), showmaskretiMethod(Gtk::manage(new MyComboBoxText())), enaretiMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))), @@ -892,6 +899,12 @@ LocallabRetinex::LocallabRetinex(): LocalcurveEditorgainT->curveListComplete(); + recothresr->setAdjusterListener(this); + lowthresr->setAdjusterListener(this); + higthresr->setAdjusterListener(this); + decayr->setAdjusterListener(this); + setExpandAlignProperties(exprecovr, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); + setExpandAlignProperties(expmaskreti, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); showmaskretiMethod->append(M("TP_LOCALLAB_SHOWMNONE")); @@ -987,6 +1000,16 @@ LocallabRetinex::LocallabRetinex(): toolretiBox->pack_start(*LocalcurveEditorgainT, Gtk::PACK_SHRINK, 4); expretitools->add(*toolretiBox, false); retiBox->pack_start(*expretitools, false, false); + ToolParamBlock* const reBox3 = Gtk::manage(new ToolParamBlock()); + reBox3->pack_start(*maskusabler, Gtk::PACK_SHRINK, 0); + reBox3->pack_start(*maskunusabler, Gtk::PACK_SHRINK, 0); + reBox3->pack_start(*recothresr); + reBox3->pack_start(*lowthresr); + reBox3->pack_start(*higthresr); + reBox3->pack_start(*decayr); + // colBox3->pack_start(*invmaskc); + exprecovr->add(*reBox3, false); + ToolParamBlock* const maskretiBox = Gtk::manage(new ToolParamBlock()); maskretiBox->pack_start(*showmaskretiMethod, Gtk::PACK_SHRINK, 4); maskretiBox->pack_start(*enaretiMask, Gtk::PACK_SHRINK, 0); @@ -1000,6 +1023,7 @@ LocallabRetinex::LocallabRetinex(): maskretiBox->pack_start(*slomaskreti, Gtk::PACK_SHRINK, 0); maskretiBox->pack_start(*mask2retiCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor expmaskreti->add(*maskretiBox, false); + retiBox->pack_start(*exprecovr, false, false); retiBox->pack_start(*expmaskreti, false, false); // retiBox->pack_start(*inversret); retitoolFrame->add(*retiBox); @@ -1066,6 +1090,7 @@ void LocallabRetinex::updateAdviceTooltips(const bool showTooltips) dehaFrame->set_tooltip_text(M("TP_LOCALLAB_DEHAZFRAME_TOOLTIP")); dehaz->set_tooltip_text(M("TP_LOCALLAB_DEHAZ_TOOLTIP")); retiFrame->set_tooltip_text(M("TP_LOCALLAB_RETIFRAME_TOOLTIP")); + exprecovr->set_tooltip_markup(M("TP_LOCALLAB_MASKRESRETI_TOOLTIP")); loglin->set_tooltip_text(M("TP_LOCALLAB_RETI_LOGLIN_TOOLTIP")); sensih->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP")); fftwreti->set_tooltip_text(M("TP_LOCALLAB_LC_FFTW_TOOLTIP")); @@ -1098,6 +1123,9 @@ void LocallabRetinex::updateAdviceTooltips(const bool showTooltips) chromaskreti->set_tooltip_text(M("TP_LOCALLAB_CHROMASK_TOOLTIP")); slomaskreti->set_tooltip_text(M("TP_LOCALLAB_SLOMASK_TOOLTIP")); lapmaskreti->set_tooltip_text(M("TP_LOCALLAB_LAPRAD1_TOOLTIP")); + decayr->set_tooltip_text(M("TP_LOCALLAB_MASKDECAY_TOOLTIP")); + lowthresr->set_tooltip_text(M("TP_LOCALLAB_MASKLOWTHRESRETI_TOOLTIP")); + higthresr->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRESRETI_TOOLTIP")); } else { dehaFrame->set_tooltip_text(""); @@ -1135,11 +1163,16 @@ void LocallabRetinex::updateAdviceTooltips(const bool showTooltips) chromaskreti->set_tooltip_text(""); slomaskreti->set_tooltip_text(""); lapmaskreti->set_tooltip_text(""); + exprecovr->set_tooltip_markup(""); + decayr->set_tooltip_text(""); + lowthresr->set_tooltip_text(""); + higthresr->set_tooltip_text(""); } } void LocallabRetinex::setDefaultExpanderVisibility() { + exprecovr->set_expanded(false); expretitools->set_expanded(false); expmaskreti->set_expanded(false); } @@ -1231,6 +1264,10 @@ void LocallabRetinex::read(const rtengine::procparams::ProcParams* pp, const Par slomaskreti->setValue(spot.slomaskreti); Lmaskretishape->setCurve(spot.Lmaskreticurve); inversret->set_active(spot.inversret); + recothresr->setValue((double)spot.recothresr); + lowthresr->setValue((double)spot.lowthresr); + higthresr->setValue((double)spot.higthresr); + decayr->setValue((double)spot.decayr); } // Enable all listeners @@ -1304,6 +1341,10 @@ void LocallabRetinex::write(rtengine::procparams::ProcParams* pp, ParamsEdited* spot.slomaskreti = slomaskreti->getValue(); spot.Lmaskreticurve = Lmaskretishape->getCurve(); spot.inversret = inversret->get_active(); + spot.recothresr = recothresr->getValue(); + spot.lowthresr = lowthresr->getValue(); + spot.higthresr = higthresr->getValue(); + spot.decayr = decayr->getValue(); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -1338,6 +1379,10 @@ void LocallabRetinex::setDefaults(const rtengine::procparams::ProcParams* defPar chromaskreti->setDefault(defSpot.chromaskreti); gammaskreti->setDefault(defSpot.gammaskreti); slomaskreti->setDefault(defSpot.slomaskreti); + recothresr->setDefault((double)defSpot.recothresr); + lowthresr->setDefault((double)defSpot.lowthresr); + higthresr->setDefault((double)defSpot.higthresr); + decayr->setDefault((double)defSpot.decayr); } // Note: No need to manage pedited as batch mode is deactivated for Locallab @@ -1461,6 +1506,35 @@ void LocallabRetinex::adjusterChanged(Adjuster* a, double newval) } } + if (a == recothresr) { + + if (listener) { + listener->panelChanged(Evlocallabrecothresr, + recothresr->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == lowthresr) { + if (listener) { + listener->panelChanged(Evlocallablowthresr, + lowthresr->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == higthresr) { + if (listener) { + listener->panelChanged(Evlocallabhigthresr, + higthresr->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == decayr) { + if (listener) { + listener->panelChanged(Evlocallabdecayr, + decayr->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + if (a == blendmaskreti) { if (listener) { listener->panelChanged(Evlocallabblendmaskreti, @@ -1614,6 +1688,10 @@ void LocallabRetinex::convertParamToNormal() slomaskreti->setValue(defSpot.slomaskreti); Lmaskretishape->setCurve(defSpot.Lmaskreticurve); inversret->set_active(defSpot.inversret); + recothresr->setValue(defSpot.recothresr); + lowthresr->setValue(defSpot.lowthresr); + higthresr->setValue(defSpot.higthresr); + decayr->setValue(defSpot.decayr); // Enable all listeners enableListener(); @@ -1629,6 +1707,17 @@ void LocallabRetinex::convertParamToNormal() void LocallabRetinex::convertParamToSimple() { + const LocallabParams::LocallabSpot defSpot; + + // Disable all listeners + disableListener(); + + recothresr->setValue(defSpot.recothresr); + lowthresr->setValue(defSpot.lowthresr); + higthresr->setValue(defSpot.higthresr); + decayr->setValue(defSpot.decayr); + enableListener(); + } void LocallabRetinex::updateGUIToMode(const modeType new_type) @@ -1638,6 +1727,11 @@ void LocallabRetinex::updateGUIToMode(const modeType new_type) // Expert and Normal mode widgets are hidden in Simple mode retiFrame->hide(); retitoolFrame->hide(); + exprecovr->hide(); + decayr->hide(); + maskusabler->hide(); + maskunusabler->hide(); + break; case Normal: @@ -1645,12 +1739,27 @@ void LocallabRetinex::updateGUIToMode(const modeType new_type) retiFrame->hide(); retitoolFrame->hide(); // Specific Simple mode widgets are shown in Normal mode + exprecovr->hide(); + decayr->hide(); + maskusabler->hide(); + maskunusabler->hide(); + break; case Expert: // Show widgets hidden in Normal and Simple mode retiFrame->show(); retitoolFrame->show(); + exprecovr->show(); + decayr->show(); + if (enaretiMask->get_active()) { + maskusabler->show(); + maskunusabler->hide(); + + } else { + maskusabler->hide(); + maskunusabler->show(); + } } } @@ -1740,6 +1849,15 @@ void LocallabRetinex::showmaskretiMethodChanged() void LocallabRetinex::enaretiMaskChanged() { + if (enaretiMask->get_active()) { + maskusabler->show(); + maskunusabler->hide(); + + } else { + maskusabler->hide(); + maskunusabler->show(); + } + if (isLocActivated && exp->getEnabled()) { if (listener) { if (enaretiMask->get_active()) { diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 18a66453e..42767391b 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1420,6 +1420,10 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).cliptm = locallab.spots.at(j).cliptm && pSpot.cliptm == otherSpot.cliptm; locallab.spots.at(j).fftwreti = locallab.spots.at(j).fftwreti && pSpot.fftwreti == otherSpot.fftwreti; locallab.spots.at(j).Lmaskreticurve = locallab.spots.at(j).Lmaskreticurve && pSpot.Lmaskreticurve == otherSpot.Lmaskreticurve; + locallab.spots.at(j).recothresr = locallab.spots.at(j).recothresr && pSpot.recothresr == otherSpot.recothresr; + locallab.spots.at(j).lowthresr = locallab.spots.at(j).lowthresr && pSpot.lowthresr == otherSpot.lowthresr; + locallab.spots.at(j).higthresr = locallab.spots.at(j).higthresr && pSpot.higthresr == otherSpot.higthresr; + locallab.spots.at(j).decayr = locallab.spots.at(j).decayr && pSpot.decayr == otherSpot.decayr; // Sharpening locallab.spots.at(j).visisharp = locallab.spots.at(j).visisharp && pSpot.visisharp == otherSpot.visisharp; locallab.spots.at(j).expsharp = locallab.spots.at(j).expsharp && pSpot.expsharp == otherSpot.expsharp; @@ -4638,6 +4642,22 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).Lmaskreticurve = mods.locallab.spots.at(i).Lmaskreticurve; } + if (locallab.spots.at(i).recothresr) { + toEdit.locallab.spots.at(i).recothresr = mods.locallab.spots.at(i).recothresr; + } + + if (locallab.spots.at(i).lowthresr) { + toEdit.locallab.spots.at(i).lowthresr = mods.locallab.spots.at(i).lowthresr; + } + + if (locallab.spots.at(i).higthresr) { + toEdit.locallab.spots.at(i).higthresr = mods.locallab.spots.at(i).higthresr; + } + + if (locallab.spots.at(i).decayr) { + toEdit.locallab.spots.at(i).decayr = mods.locallab.spots.at(i).decayr; + } + // Sharpening if (locallab.spots.at(i).visisharp) { toEdit.locallab.spots.at(i).visisharp = mods.locallab.spots.at(i).visisharp; @@ -6939,6 +6959,10 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : cliptm(v), fftwreti(v), Lmaskreticurve(v), + recothresr(v), + lowthresr(v), + higthresr(v), + decayr(v), // Sharpening visisharp(v), expsharp(v), @@ -7500,6 +7524,10 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) cliptm = v; fftwreti = v; Lmaskreticurve = v; + recothresr = v; + lowthresr = v; + higthresr = v; + decayr = v; // Sharpening visisharp = v; expsharp = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index d684db7be..75893792a 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -757,6 +757,10 @@ public: bool cliptm; bool fftwreti; bool Lmaskreticurve; + bool recothresr; + bool lowthresr; + bool higthresr; + bool decayr; // Sharpening bool visisharp; bool expsharp; From 369707df7a20f1fc3ec1e61b780f4594a2cce41b Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sat, 16 Jan 2021 23:32:24 +0100 Subject: [PATCH 058/129] rcd demosaic: added some comments, #6054 --- rtengine/rcd_demosaic.cc | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/rtengine/rcd_demosaic.cc b/rtengine/rcd_demosaic.cc index b97b19bb9..d582c23dd 100644 --- a/rtengine/rcd_demosaic.cc +++ b/rtengine/rcd_demosaic.cc @@ -35,7 +35,7 @@ unsigned fc(const unsigned int cfa[2][2], int r, int c) { namespace rtengine { -/** +/* * RATIO CORRECTED DEMOSAICING * Luis Sanz Rodriguez (luis.sanz.rodriguez(at)gmail(dot)com) * @@ -44,7 +44,12 @@ namespace rtengine * Original code from https://github.com/LuisSR/RCD-Demosaicing * Licensed under the GNU GPL version 3 */ + // Tiled version by Ingo Weyrich (heckflosse67@gmx.de) +// Luis Sanz Rodriguez significantly optimised the v 2.3 code and simplified the directional +// coefficients in an exact, shorter and more performant formula. +// In cooperation with Hanno Schwalm (hanno@schwalm-bremen.de) and Luis Sanz Rodriguez this has been tuned for performance. + void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) { // Test for RGB cfa @@ -60,7 +65,6 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) } std::unique_ptr stop; - if (measure) { std::cout << "Demosaicing " << W << "x" << H << " image using rcd with " << chunkSize << " tiles per thread" << std::endl; stop.reset(new StopWatch("rcd demosaic")); @@ -74,8 +78,8 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) } const unsigned int cfarray[2][2] = {{FC(0,0), FC(0,1)}, {FC(1,0), FC(1,1)}}; - constexpr int rcdBorder = 6; - constexpr int tileBorder = 9; + constexpr int tileBorder = 9; // avoid tile-overlap errors + constexpr int rcdBorder = 6; // for the outermost tiles we can have a smaller outer border constexpr int tileSize = 194; constexpr int tileSizeN = tileSize - 2 * tileBorder; const int numTh = H / (tileSizeN) + ((H % (tileSizeN)) ? 1 : 0); @@ -125,9 +129,8 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) cfa[indx] = rgb[c0][indx] = rgb[c1][indx] = LIM01(rawData[row][col] / scale); } } - /** - * STEP 1: Find cardinal and diagonal interpolation directions - */ + + // Step 1: Find cardinal and diagonal interpolation directions float bufferV[3][tileSize - 8]; // Step 1.1: Calculate the square of the vertical and horizontal color difference high pass filter @@ -138,7 +141,6 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) } // Step 1.2: Obtain the vertical and horizontal directional discrimination strength - float bufferH[tileSize - 6] ALIGNED16; float* V0 = bufferV[0]; float* V1 = bufferV[1]; @@ -162,11 +164,7 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) std::swap(V0, V1); } - /** - * STEP 2: Calculate the low pass filter - */ - // Step 2.1: Low pass filter incorporating green, red and blue local samples from the raw data - + // Step 2: Low pass filter incorporating green, red and blue local samples from the raw data for (int row = 2; row < tileRows - 2; ++row) { for (int col = 2 + (fc(cfarray, row, 0) & 1), indx = row * tileSize + col, lpindx = indx / 2; col < tilecols - 2; col += 2, indx += 2, ++lpindx) { lpf[lpindx] = cfa[indx] + @@ -175,10 +173,7 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) } } - /** - * STEP 3: Populate the green channel - */ - // Step 3.1: Populate the green channel at blue and red CFA positions + // Step 3: Populate the green channel at blue and red CFA positions for (int row = 4; row < tileRows - 4; ++row) { for (int col = 4 + (fc(cfarray, row, 0) & 1), indx = row * tileSize + col, lpindx = indx / 2; col < tilecols - 4; col += 2, indx += 2, ++lpindx) { // Cardinal gradients From 2ea7b02f2a05d2da3ad7b30692b03e81295e8ade Mon Sep 17 00:00:00 2001 From: Desmis Date: Sun, 17 Jan 2021 08:51:37 +0100 Subject: [PATCH 059/129] Local adjustments - GUI 'full image' - allows you to use the local adjustment tools on the whole image (#6063) * Init Full image auto mode * Add tooltip for full image * Change tootip * Added tooltip to Full image * Slighly change tooltip --- rtdata/languages/default | 3 ++- rtengine/iplocallab.cc | 2 ++ rtgui/controlspotpanel.cc | 47 ++++++++++++++++++++++++++++++++++++--- rtgui/locallab.cc | 16 +++++++++---- 4 files changed, 60 insertions(+), 8 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 5b7a358db..c0483e1ec 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2632,9 +2632,10 @@ TP_LOCALLAB_EV_VIS_ALL;Show all TP_LOCALLAB_EXCLUF;Excluding TP_LOCALLAB_EXCLUF_TOOLTIP;‘Excluding’ mode prevents adjacent spots from influencing certain parts of the image. Adjusting ‘Scope’ will extend the range of colors.\n You can also add tools to an Excluding spot and use them in the same way as for a normal spot. TP_LOCALLAB_EXCLUTYPE;Spot method -TP_LOCALLAB_EXCLUTYPE_TOOLTIP;Normal spot uses recursive data.\n\nExcluding spot reinitializes all local adjustment data.\nCan be used to totally or partially cancel a previous action or to carry out operations in Inverse mode +TP_LOCALLAB_EXCLUTYPE_TOOLTIP;Normal spot uses recursive data.\n\nExcluding spot reinitializes all local adjustment data.\nCan be used to totally or partially cancel a previous action or to carry out operations in Inverse mode.\n\n‘Full image’ allows you to use the local adjustment tools on the whole image.\n The RT Spot delimiters are set beyond the image preview boundaries.\n The transition is set to 100.\nNote, you may have to reposition the RT Spot slightly and adjust the Spot size to get the desired effect.\nPlease note: using Denoise or Wavelet or FFTW in full-image mode uses large amounts of memory and may cause the application to crash on lower capacity systems. TP_LOCALLAB_EXECLU;Excluding spot TP_LOCALLAB_EXNORM;Normal spot +TP_LOCALLAB_EXFULL;Full image TP_LOCALLAB_EXPCBDL_TOOLTIP;Can be used to remove marks on the sensor or lens by reducing the contrast on the appropriate detail level(s). TP_LOCALLAB_EXPCHROMA;Chroma compensation TP_LOCALLAB_EXPCHROMA_TOOLTIP;Use in association with ‘Exposure compensation f’ and ‘Contrast Attenuator f’ to avoid desaturating colors. diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 820e8c352..306c5609e 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -945,6 +945,8 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.excmet = 0; } else if (locallab.spots.at(sp).spotMethod == "exc") { lp.excmet = 1; + } else if (locallab.spots.at(sp).spotMethod == "full") { + lp.excmet = 2; } if (locallab.spots.at(sp).merMethod == "mone") { diff --git a/rtgui/controlspotpanel.cc b/rtgui/controlspotpanel.cc index 9ed4c95ee..87f6985c7 100644 --- a/rtgui/controlspotpanel.cc +++ b/rtgui/controlspotpanel.cc @@ -223,6 +223,7 @@ ControlSpotPanel::ControlSpotPanel(): spotMethod_->append(M("TP_LOCALLAB_EXNORM")); spotMethod_->append(M("TP_LOCALLAB_EXECLU")); + spotMethod_->append(M("TP_LOCALLAB_EXFULL")); spotMethod_->set_active(0); spotMethodconn_ = spotMethod_->signal_changed().connect( sigc::mem_fun( @@ -942,7 +943,6 @@ void ControlSpotPanel::prevMethodChanged() void ControlSpotPanel::spotMethodChanged() { - // printf("spotMethodChanged\n"); // Get selected control spot const auto s = treeview_->get_selection(); @@ -961,8 +961,47 @@ void ControlSpotPanel::spotMethodChanged() excluFrame->show(); } else if (spotMethod_->get_active_row_number() == 0) { // Normal case excluFrame->hide(); - } else { // Excluding case + locX_->setValue(150.); + adjusterChanged(locX_, 1.); + locXL_->setValue(150.); + adjusterChanged(locXL_, 1.); + locY_->setValue(150.); + adjusterChanged(locY_, 1.); + locYT_->setValue(150.); + adjusterChanged(locYT_, 1.); + shape_->set_active(0); + shapeChanged(); + transit_->setValue(60.); + adjusterChanged(transit_, 1.); + } else if (spotMethod_->get_active_row_number() == 1) { // Excluding case excluFrame->show(); + locX_->setValue(150.); + adjusterChanged(locX_, 1.); + locXL_->setValue(150.); + adjusterChanged(locXL_, 1.); + locY_->setValue(150.); + adjusterChanged(locY_, 1.); + locYT_->setValue(150.); + adjusterChanged(locYT_, 1.); + shape_->set_active(0); + shapeChanged(); + transit_->setValue(60.); + adjusterChanged(transit_, 1.); + } else if (spotMethod_->get_active_row_number() == 2) { // Full image case + excluFrame->hide(); + locX_->setValue(3000.); + adjusterChanged(locX_, 1.); + locXL_->setValue(3000.); + adjusterChanged(locXL_, 1.); + locY_->setValue(3000.); + adjusterChanged(locY_, 1.); + locYT_->setValue(3000.); + adjusterChanged(locYT_, 1.); + shape_->set_active(1); + shapeChanged(); + transit_->setValue(100.); + adjusterChanged(transit_, 1.); + } // Raise event @@ -1181,8 +1220,10 @@ void ControlSpotPanel::updateParamVisibility() excluFrame->show(); } else if (spotMethod_->get_active_row_number() == 0) { // Normal case excluFrame->hide(); - } else { // Excluding case + } else if (spotMethod_->get_active_row_number() == 1) { // Excluding case excluFrame->show(); + } else if (spotMethod_->get_active_row_number() == 2) {//full image + excluFrame->hide(); } /* diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 886fbaf64..0ea5394bf 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -269,8 +269,10 @@ void Locallab::read(const rtengine::procparams::ProcParams* pp, const ParamsEdit if (pp->locallab.spots.at(i).spotMethod == "norm") { r->spotMethod = 0; - } else { + } else if(pp->locallab.spots.at(i).spotMethod == "exc"){ r->spotMethod = 1; + } else if (pp->locallab.spots.at(i).spotMethod == "full"){ + r->spotMethod = 2; } r->sensiexclu = pp->locallab.spots.at(i).sensiexclu; @@ -426,8 +428,10 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited if (newSpot->spotMethod == "norm") { r->spotMethod = 0; - } else { + } else if(newSpot->spotMethod == "exc") { r->spotMethod = 1; + } else if(newSpot->spotMethod == "full") { + r->spotMethod = 2; } r->sensiexclu = newSpot->sensiexclu; @@ -711,8 +715,10 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited if (newSpot->spotMethod == "norm") { r->spotMethod = 0; - } else { + } else if (newSpot->spotMethod == "exc") { r->spotMethod = 1; + } else if (newSpot->spotMethod == "full") { + r->spotMethod = 2; } r->sensiexclu = newSpot->sensiexclu; @@ -878,8 +884,10 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited if (r->spotMethod == 0) { pp->locallab.spots.at(pp->locallab.selspot).spotMethod = "norm"; - } else { + } else if (r->spotMethod == 1){ pp->locallab.spots.at(pp->locallab.selspot).spotMethod = "exc"; + } else if (r->spotMethod == 2) { + pp->locallab.spots.at(pp->locallab.selspot).spotMethod = "full"; } pp->locallab.spots.at(pp->locallab.selspot).sensiexclu = r->sensiexclu; From 9541be0f55c7bb4d0b4009290f0c978aeb823959 Mon Sep 17 00:00:00 2001 From: Desmis Date: Sun, 17 Jan 2021 13:42:29 +0100 Subject: [PATCH 060/129] Local adjustments - French labels and tooltips (#6065) * First translation francais * 2nd French translation * Small changes tooltips french * Others change french tooltips --- rtdata/languages/Francais | 64 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 3 deletions(-) diff --git a/rtdata/languages/Francais b/rtdata/languages/Francais index ae2d78b2f..f49139365 100644 --- a/rtdata/languages/Francais +++ b/rtdata/languages/Francais @@ -1878,6 +1878,8 @@ TP_LOCALLAB_DENOIS;Ψ Réduction du bruit TP_LOCALLAB_DENOI_EXP;Réduction du bruit TP_LOCALLAB_DENOIQUA_TOOLTIP;Conservatif préserve les fréquences basses, alors que agressif tend à les effacer TP_LOCALLAB_DENOIEQUAL_TOOLTIP;Equilibre l'action de denoise luminance entre les ombres et les lumières +TP_LOCALLAB_DENOI1_EXP;De-bruite basé sur masque luminance +TP_LOCALLAB_DENOI2_EXP;Récupération basée sur masque luminance TP_LOCALLAB_DENOI_TOOLTIP;Ce module peut être utilisé seul (à la fin du processus), ou en complément de Réduction du bruit (au début).\nEtendue(deltaE)permet de différencier l'action.\nVous pouvez compléter avec "median" ou "Filtre guidé" (Adoucir Flou...).\nVous pouvez compléter l'action avec "Flou niveaux" "Ondelette pyramide" TP_LOCALLAB_DENOILUMDETAIL_TOOLTIP;Permet de récupérer les détails de luminance par mise en oeuvre progressive de la transformée de Fourier (DCT) TP_LOCALLAB_DENOICHROF_TOOLTIP;Agit sur les fins détails du bruit de chrominance @@ -1887,7 +1889,9 @@ TP_LOCALLAB_DENOITHR_TOOLTIP;Règle l'effet de bord pour privilégier l'action s TP_LOCALLAB_DENOIEQUALCHRO_TOOLTIP;Equilibre l'action de denoise chrominance entre les bleus-jaunes et les rouges-verts TP_LOCALLAB_DENOIBILAT_TOOLTIP;Traite le bruit d'impulsion (poivre et sel) TP_LOCALLAB_DEPTH;Profondeur -TP_LOCALLAB_DETAIL;Contrast local +TP_LOCALLAB_DETAIL;Contraste local +TP_LOCALLAB_DETAILFRA;Détection de bord + TP_LOCALLAB_DETAILSH;Details TP_LOCALLAB_DETAILTHR;Seuil Detail Luminance Chroma (DCT ƒ) TP_LOCALLAB_DUPLSPOTNAME;Copier @@ -1912,9 +1916,10 @@ TP_LOCALLAB_EV_VIS_ALL;Montrer tout TP_LOCALLAB_EXCLUF;Exclure TP_LOCALLAB_EXCLUF_TOOLTIP;Peut être utilsé pour exclure une partie des données - agir sur Etendue pour prendre en compte plus de couleurs.\n Vous pouvez utiliser tous les réglages pour ce type de RT-spot. TP_LOCALLAB_EXCLUTYPE;Spot méthode -TP_LOCALLAB_EXCLUTYPE_TOOLTIP;Spot Normal utilise les données récursives.\n\nSpot exclusion réinitialise les données d'origine.\nPeut être utilsé pour annuler totalement ou partiellement une action précédente ou pour réaliser un mode inverse +TP_LOCALLAB_EXCLUTYPE_TOOLTIP;Spot Normal utilise les données récursives.\n\nSpot exclusion réinitialise les données d'origine.\nPeut être utilsé pour annuler totalement ou partiellement une action précédente ou pour réaliser un mode inverse.\n\nImage entière vous permet d'utiliser 'local adjustments" sur le totalité de l'image.\nLes délimiteurs sont positionnés au delà de la prévisualisation\nTransition est mis à 100.\nVous pouvez avoir à repositionner le Spot ainsi que sa taille pour obtenir les effets désirés.\nNotez que l'utilisation de De-bruite, ondelettes, FFTW en image entière va utiliser de grosses quantités de mémoire, et peut amener l'application à 'planter' sur des systèmes à faible capacité. TP_LOCALLAB_EXECLU;Spot Exclusion TP_LOCALLAB_EXNORM;Spot Normal +TP_LOCALLAB_EXFULL;Image entière TP_LOCALLAB_EXPCBDL_TOOLTIP;Peut être utilisé pour retirer les marques sur le capteur ou la lentille. TP_LOCALLAB_EXPCHROMA;Chroma compensation TP_LOCALLAB_EXPCHROMA_TOOLTIP;Seulement en association avec compensation d'exposition et PDE Ipol.\nEvite la desaturation des couleurs @@ -1999,6 +2004,7 @@ TP_LOCALLAB_INDSL;Independant (souris + curseurs) TP_LOCALLAB_INVERS;Inverse TP_LOCALLAB_INVERS_TOOLTIP;Si sélectionné (inverse) moins de possibilités.\n\nAlternative\nPremier Spot:\n image entière - delimiteurs en dehors de la prévisualisation\n RT-spot forme sélection : rectangle. Transition 100\n\nDeuxième spot : Spot Exclusion TP_LOCALLAB_INVBL_TOOLTIP;Alternative\nPremier Spot:\n image entière - delimiteurs en dehors de la prévisualisation\n RT-spot forme sélection : rectangle. Transition 100\n\nDeuxième spot : Spot Exclusion +TP_LOCALLAB_INVMASK;Algorithme inverse TP_LOCALLAB_ISOGR;Plus gros (ISO) TP_LOCALLAB_LABBLURM;Masque Flouter TP_LOCALLAB_LABEL;Ajustements Locaux @@ -2041,6 +2047,7 @@ TP_LOCALLAB_LOGAUTO_TOOLTIP;Presser ce bouton va amner une évaluation an evalua TP_LOCALLAB_LOGBASE_TOOLTIP;Défaut = 2.\nValeurs inférieures à 2 réduisent l'action de l'algorithme, les ombres sont plus sombres, les hautes lumières plus brillantes.\nValeurs supérieures à 2 changent l'action de l'algorithme, les ombres sont plus grises, les hautes lumières lavées TP_LOCALLAB_LOGBLACKWHEV_TOOLTIP;Valeurs estimées de la plage Dynamique - Noir Ev et Blanc Ev TP_LOCALLAB_LOGENCOD_TOOLTIP;Autorise 'Tone Mapping' avec codage Logarithmique (ACES).\nUtile pour images ous-exposées, ou avec une plage dynamique élévée.\n\nDeux étapes dans le processus : 1) Calculer Plage Dynamique 2) Adaptation par utilisateur +TP_LOCALLAB_LOGEXP;Tous les outils TP_LOCALLAB_LOGFRA;Point gris source TP_LOCALLAB_LOGFRAME_TOOLTIP;Calcule ou utilise le niveau d'Exposition de l'image tôt dans le processus:\n Noir Ev, Blanc Ev et Point gris source.\n Prend en compte la compensation d'exposition principale. TP_LOCALLAB_LOGLIN;Logarithme mode @@ -2056,13 +2063,64 @@ TP_LOCALLAB_LUMAWHITESEST;Plus clair TP_LOCALLAB_LUMONLY;Luminance seulement TP_LOCALLAB_MASKCOM;Masque couleur Commun TP_LOCALLAB_MASKCOM_TOOLTIP;Ces masques travaillent comme les autres outils, ils prennet en compte Etendue.\nIls sont différents des autres masques qui complètent un outil (Couleur et Lumière, Exposition...) +TP_LOCALLAB_MASKDDECAY;Force des transitions +TP_LOCALLAB_MASKDECAY_TOOLTIP;Gère le taux des tranistions des niveaux gris dans le masque.\n Transition = 1 linéaire, Transition > 1 transitions paraboliques rapides, Transitions < 1 transitions progressives TP_LOCALLAB_MASFRAME;Masque et Fusion TP_LOCALLAB_MASFRAME_TOOLTIP;For all masks.\nTake into account deltaE image to avoid retouching the selection area when sliders gamma mask, slope mask, chroma mask and curves contrast , levels contrasts, and mask blur, structure(if enabled tool) are used.\nDisabled in Inverse TP_LOCALLAB_MASK;Masque TP_LOCALLAB_MASK2;Courbe de Contraste TP_LOCALLAB_MASKCOL;Masque Courbes TP_LOCALLAB_MASKCURVE_TOOLTIP;Si la courbe est au sommet, le masque est compétement noir aucune transformation n'est réalisée par le masque sur l'image.\nQuand vous descendez la courbe, progressivement le masque va se colorer et s'éclaicir, l'image change de plus en plus.\n\nIl est recommendé (pas obligatoire) de positionner le sommet des courbes curves sur la ligne de transition grise qui représnte les références (chroma, luma, couleur). +TP_LOCALLAB_MASKLCTHRMID;Zones grises de-bruite luminance +TP_LOCALLAB_MASKLCTHRMIDCH;Zones grises de-bruite chrominance +TP_LOCALLAB_MASKLC_TOOLTIP;Vous autorise à cibler le de-bruite en se basant sur les informations du masque dans L(L) ou LC(H) (Masque et Modifications).\n Les masques L(L) ou LC(H) doivent être activés pour utiliser cette fonction.\n si le masque est très sombre - sous le seuil 'sombre' - de-bruite sera accru si renforce > 1.\n si le masque est clair - au-dessus du seuil 'clair' - de-bruite sera progressivement réduit.\n entre les deux, de-bruite sera maintenu aux réglages sans masques. +TP_LOCALLAB_MASKLCTHR;Seuil luminance zones claires +TP_LOCALLAB_MASKLCTHRLOW;Seuil luminance zones sombres +TP_LOCALLAB_MASKLNOISELOW;Renforce de-bruite zones sombres et claires TP_LOCALLAB_MASKH;Courbe teinte +TP_LOCALLAB_MASKRECOTHRES;Seuil de Récupération +TP_LOCALLAB_MASKDE_TOOLTIP;Utilisé pour diriger l'action de de-bruite basé sur les informations des courbes masques L(L) ou LC(H) (Masque et modifications).\n Les masques L(L) ou LC(H) doivent être activés pour utiliser cette fonction.\n Si le masque est en dessous du seuil sombre le De-bruite sera appliqué progressivement.\n Si le masque est au-dessus du seuil 'clair', le De-bruite sera appliqué progressivement.\n Entre les deux, les réglages sans De-bruite seront maintenus, sauf si vous agissez sur les curseurs "Zones grise dé-bruite luminance" or "Zones grise de-bruite chrominance". +TP_LOCALLAB_MASKGF_TOOLTIP;Utilisé pour diriger l'action de Filtre Guidé basé sur les informations des courbes masques L(L) ou LC(H) (Masque et modifications).\n Les masques L(L) ou LC(H) doivent être activés pour utiliser cette fonction.\n Si le masque est en dessous du seuil sombre le Filtre Guidé sera appliqué progressivement.\n Si le masque est au-dessus du seuil 'clair', le Filtre Guidé sera appliqué progressivement.\n Entre les deux, les réglages sans Filtre Guidé seront maintenus. +TP_LOCALLAB_MASKRECOL_TOOLTIP;Utilisé pour moduler l'action des réglages de Couleur et Lumières en se basant sur les informations contenues dans les courbes des masques L(L) ou LC(H) (Masques et modifications).\n Les masques L(L) ou LC(H) doivent être activés pour utiliser cette fonction.\n Les zones ‘sombres’ et ‘claires’ en dessous du seuil sombre et au dessus du seuil clair seront restaurés progressivement à leurs valeurs originales avant d'avoir été modifiées par Couleurs et Lumières \n Entre ces 2 valeurs, les valeurs de Couleurs et Lumières seront appliquées +TP_LOCALLAB_MASKREEXP_TOOLTIP;Utilisé pour moduler l'action des réglages de Compression dynamique et Exposition en se basant sur les informations contenues dans les courbes des masques L(L) ou LC(H) (Masques et modifications).\n Les masques L(L) ou LC(H) doivent être activés pour utiliser cette fonction.\n Les zones ‘sombres’ et ‘claires’ en dessous du seuil sombre et au dessus du seuil clair seront restaurés progressivement à leurs valeurs originales avant d'avoir été modifiées par Compression dynamique et Exposition \n Entre ces 2 valeurs, les valeurs de Compression dynamique et Exposition seront appliquées +TP_LOCALLAB_MASKRESH_TOOLTIP;Utilisé pour moduler l'action des réglages de Ombres et Lumières en se basant sur les informations contenues dans les courbes des masques L(L) ou LC(H) (Masques et modifications).\n Les masques L(L) ou LC(H) doivent être activés pour utiliser cette fonction.\n Les zones ‘sombres’ et ‘claires’ en dessous du seuil sombre et au dessus du seuil clair seront restaurés progressivement à leurs valeurs originales avant d'avoir été modifiées par Ombres et Lumières \n Entre ces 2 valeurs, les valeurs de Ombres et Lumières seront appliquées +TP_LOCALLAB_MASKRESCB_TOOLTIP;Utilisé pour moduler l'action des réglages de CBDL (Luminance) en se basant sur les informations contenues dans les courbes des masques L(L) ou LC(H) (Masques et modifications).\n Les masques L(L) ou LC(H) doivent être activés pour utiliser cette fonction.\n Les zones ‘sombres’ et ‘claires’ en dessous du seuil sombre et au dessus du seuil clair seront restaurés progressivement à leurs valeurs originales avant d'avoir été modifiées par CBDL \n Entre ces 2 valeurs, les valeurs de CBDL seront appliquées +TP_LOCALLAB_MASKRESRETI_TOOLTIP;Utilisé pour moduler l'action des réglages de Retinex (Luminance) en se basant sur les informations contenues dans les courbes des masques L(L) ou LC(H) (Masques et modifications).\n Les masques L(L) ou LC(H) doivent être activés pour utiliser cette fonction.\n Les zones ‘sombres’ et ‘claires’ en dessous du seuil sombre et au dessus du seuil clair seront restaurés progressivement à leurs valeurs originales avant d'avoir été modifiées par Retinex \n Entre ces 2 valeurs, les valeurs de Retinex seront appliquées +TP_LOCALLAB_MASKRESTM_TOOLTIP;Utilisé pour moduler l'action des réglages de Compression tonale en se basant sur les informations contenues dans les courbes des masques L(L) ou LC(H) (Masques et modifications).\n Les masques L(L) ou LC(H) doivent être activés pour utiliser cette fonction.\n Les zones ‘sombres’ et ‘claires’ en dessous du seuil sombre et au dessus du seuil clair seront restaurés progressivement à leurs valeurs originales avant d'avoir été modifiées par Compression tonale \n Entre ces 2 valeurs, les valeurs de Compression tonale seront appliquées +TP_LOCALLAB_MASKRESVIB_TOOLTIP;Utilisé pour moduler l'action des réglages de Vibrance - Chaud et froid en se basant sur les informations contenues dans les courbes des masques L(L) ou LC(H) (Masques et modifications).\n Les masques L(L) ou LC(H) doivent être activés pour utiliser cette fonction.\n Les zones ‘sombres’ et ‘claires’ en dessous du seuil sombre et au dessus du seuil clair seront restaurés progressivement à leurs valeurs originales avant d'avoir été modifiées par Vibrance - Chaud et froid \n Entre ces 2 valeurs, les valeurs de Vibrance - Chaud et froid seront appliquées +TP_LOCALLAB_MASKRESWAV_TOOLTIP;Utilisé pour moduler l'action des réglages de Contraste local et ondelettes en se basant sur les informations contenues dans les courbes des masques L(L) ou LC(H) (Masques et modifications).\n Les masques L(L) ou LC(H) doivent être activés pour utiliser cette fonction.\n Les zones ‘sombres’ et ‘claires’ en dessous du seuil sombre et au dessus du seuil clair seront restaurés progressivement à leurs valeurs originales avant d'avoir été modifiées par Contraste local et ondelettes \n Entre ces 2 valeurs, les valeurs de Contraste local et Ondelettes seront appliquées +TP_LOCALLAB_MASKRELOG_TOOLTIP;Utilisé pour moduler l'action des réglages de Codage Log en se basant sur les informations contenues dans les courbes des masques L(L) ou LC(H) (Masques et modifications).\n Les masques L(L) ou LC(H) doivent être activés pour utiliser cette fonction.\n Les zones ‘sombres’ et ‘claires’ en dessous du seuil sombre et au dessus du seuil clair seront restaurés progressivement à leurs valeurs originales avant d'avoir été modifiées par Codage Log - peut être utilisé pour récupérer les hautes lumières de 'Couleur propagation' \n Entre ces 2 valeurs, les valeurs de Codage Log seront appliquées +TP_LOCALLAB_MASKHIGTHRESC_TOOLTIP;Limite des tons clairs au-dessus de laquelle Couleur et Lumière sera restauré progressivement à leurs valeurs avant d'être modifiés par Couleur et Lumières .\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris: ‘masque structure’, 'masque flouter', ‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’, ‘Niveau contraste local ondelettes’.\n Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées. Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 +TP_LOCALLAB_MASKHIGTHRESS_TOOLTIP;Limite des tons clairs au-dessus de laquelle Ombres et Lumière sera restauré progressivement à leurs valeurs avant d'être modifiés par Ombres et Lumières .\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris:‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’.\n Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées. Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 +TP_LOCALLAB_MASKHIGTHRESCB_TOOLTIP;Limite des tons clairs au-dessus de laquelle CBDL (luminance) sera restauré progressivement à leurs valeurs avant d'être modifiés par CBDL.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris:‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’.\n Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées. Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 +TP_LOCALLAB_MASKHIGTHRESRETI_TOOLTIP;Limite des tons clairs au-dessus de laquelle Retinex (luminance) sera restauré progressivement à leurs valeurs avant d'être modifiés par Retinex.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris:‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’.\n Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées. Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 +TP_LOCALLAB_MASKHIGTHRESTM_TOOLTIP;Limite des tons clairs au-dessus de laquelle Compression tonale sera restauré progressivement à leurs valeurs avant d'être modifiés par Compression tonale.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris:‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’.\n Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées. Soyez attentifs à ce que dans 'Réglages' Maqsue luminance arrière plan = 0 +TP_LOCALLAB_MASKHIGTHRESVIB_TOOLTIP;Limite des tons clairs au-dessus de laquelle Vibrance - Chaud Froid sera restauré progressivement à leurs valeurs avant d'être modifiés par Vibrance - Chaud Froid.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris:‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’.\n Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées. Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 +TP_LOCALLAB_MASKHIGTHRESWAV_TOOLTIP;Limite des tons clairs au-dessus de laquelle Contraste local - Ondelettes sera restauré progressivement à leurs valeurs avant d'être modifiés par Contraste local - Ondelettes.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris:‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’.\n Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées. Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 +TP_LOCALLAB_MASKHIGTHRESE_TOOLTIP;Limite des tons clairs au-dessus de laquelle Compression dynamique et Exposition sera restauré progressivement à leurs valeurs avant d'être modifiés par Compression dynamique et Exposition.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris:‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’.\n Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées. Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 +TP_LOCALLAB_MASKHIGTHRESL_TOOLTIP;Limite des tons clairs au-dessus de laquelle Codage Log sera restauré progressivement à leurs valeurs avant d'être modifiés par Codage Log.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris:‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’.\n Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées. Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 +TP_LOCALLAB_MASKHIGTHRESL_TOOLTIP;Limite des tons clairs au-dessus de laquelle Codage Log sera restauré progressivement à leurs valeurs avant d'être modifiés par Codage Log.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris:‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’.\n Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées. Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 +TP_LOCALLAB_MASKHIGTHRESD_TOOLTIP;Limite des tons clairs au-dessus de laquelle de-bruite sera appliquée progressivement.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris: ‘masque structure’,‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’, ‘Niveau contraste local ondelettes’.Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées.\n Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 +TP_LOCALLAB_MASKHIGTHRES_TOOLTIP;Limite des tons clairs au-dessus de laquelle Filtre Guidé sera appliquée progressivement.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris: ‘masque structure’,‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’, ‘Niveau contraste local ondelettes’.Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées.\n Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 + + +TP_LOCALLAB_MASKLOWTHRESC_TOOLTIP;Limite des tons sombres au-dessous de laquelle Couleur et Lumière sera restauré progressivement à leurs valeurs avant d'être modifiés par Couleur et Lumières .\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris: ‘masque structure’, 'masque flouter', ‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’, ‘Niveau contraste local ondelettes’.\n Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées. Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 +TP_LOCALLAB_MASKLOWTHRESS_TOOLTIP;Limite des tons sombres au-dessous de laquelle Ombres et Lumière sera restauré progressivement à leurs valeurs avant d'être modifiés par Ombres et Lumières .\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris:‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’.\n Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées. Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 +TP_LOCALLAB_MASKLOWTHRESCB_TOOLTIP;Limite des tons sombres au-dessous de laquelle CBDL (luminance) sera restauré progressivement à leurs valeurs avant d'être modifiés par CBDL.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris:‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’.\n Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées. Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 +TP_LOCALLAB_MASKLOWTHRESRETI_TOOLTIP;Limite des tons sombres au-dessous de laquelle Retinex (luminance) sera restauré progressivement à leurs valeurs avant d'être modifiés par Retinex.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris:‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’.\n Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées. Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 +TP_LOCALLAB_MASKLOWTHRESTM_TOOLTIP;Limite des tons sombres au-dessous de laquelle Compression tonale sera restauré progressivement à leurs valeurs avant d'être modifiés par Compression tonale.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris:‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’.\n Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées. Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 +TP_LOCALLAB_MASKLOWTHRESVIB_TOOLTIP;Limite des tons sombres au-dessous de laquelle Vibrance - Chaud Froid sera restauré progressivement à leurs valeurs avant d'être modifiés par Vibrance - Chaud Froid.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris:‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’.\n Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées. Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 +TP_LOCALLAB_MASKLOWTHRESWAV_TOOLTIP;Limite des tons sombres au-dessous de laquelle Contraste local - Ondelettes sera restauré progressivement à leurs valeurs avant d'être modifiés par Contraste local - Ondelettes.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris:‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’.\n Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées. Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 +TP_LOCALLAB_MASKLOWTHRESE_TOOLTIP;Limite des tons sombres au-dessous de laquelle Compression dynamique et Exposition sera restauré progressivement à leurs valeurs avant d'être modifiés par Compression dynamique et Exposition.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris:‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’.\n Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées. Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 +TP_LOCALLAB_MASKLOWTHRESL_TOOLTIP;Limite des tons sombres au-dessous de laquelle Codage Log sera restauré progressivement à leurs valeurs avant d'être modifiés par Codage Log.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris:‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’.\n Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées. Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 +TP_LOCALLAB_MASKLOWTHRESL_TOOLTIP;Limite des tons sombres au-dessous de laquelle Codage Log sera restauré progressivement à leurs valeurs avant d'être modifiés par Codage Log.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris:‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’.\n Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées. Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 +TP_LOCALLAB_MASKLOWTHRESD_TOOLTIP;Limite des tons sombres au-dessous de laquelle de-bruite sera appliquée progressivement.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris: ‘masque structure’,‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’, ‘Niveau contraste local ondelettes’.Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées.\n Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 +TP_LOCALLAB_MASKLOWTHRES_TOOLTIP;Limite des tons sombres au-dessous de laquelle Filtre Guidé sera appliquée progressivement.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris: ‘masque structure’,‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’, ‘Niveau contraste local ondelettes’.Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées.\n Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 + + + +TP_LOCALLAB_MASKUSABLE;Masque activé (Masque & modifications) +TP_LOCALLAB_MASKUNUSABLE;Masque désactivé (Masque & modifications) TP_LOCALLAB_MASK_TOOLTIP;Vous pouvez activer plusieurs masques pour un simple outil, ceci nécessite d'activer un autre outil (mais sans utilser l'outil : curseurs à 0,...)où est le masque que vous souhaitez activer.\n\nVous pouvez aussi dupliquer le RT-spot et le placer juste à côté de l'autre,les variations de références autorisent un travail fin sur les images. TP_LOCALLAB_MED;Medium TP_LOCALLAB_MEDIAN;Median Bas @@ -2375,7 +2433,7 @@ TP_LOCALLAB_WAVCOMPRE_TOOLTIP;Réalise un 'Tone-mapping' ou une réduction du co TP_LOCALLAB_WAVCOMP_TOOLTIP;Réalise un contrast local en fonction de la direction de la décomposition en ondelettes : horizontal, vertical, diagonal TP_LOCALLAB_WAVCON;Contraste par niveau TP_LOCALLAB_WAVCONTF_TOOLTIP;Similaire à Contrast By Detail Levels : en abscisse niveaux. -TP_LOCALLAB_WAVDEN;de-bruite luminance par niveau (0 1 2 + 3 et plus) +TP_LOCALLAB_WAVDEN;de-bruite luminance par niveau (0 1 2 -3 et plus) TP_LOCALLAB_WAVE;Ψ Ondelette TP_LOCALLAB_WAVEDG;Contrast Local TP_LOCALLAB_WAVEEDG_TOOLTIP;Améliore la netteté prenant en compte la notion de "ondelettes bords".\nNécessite au moins que les 4 premiers niveaux sont utilisables From d607028871579eb4bf14cf93bb8726679dd5933b Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sun, 17 Jan 2021 15:13:21 +0100 Subject: [PATCH 061/129] rcd demosaic: small change --- rtengine/rcd_demosaic.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtengine/rcd_demosaic.cc b/rtengine/rcd_demosaic.cc index d582c23dd..b12ce1473 100644 --- a/rtengine/rcd_demosaic.cc +++ b/rtengine/rcd_demosaic.cc @@ -218,7 +218,7 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) // Step 4.1: Obtain the P/Q diagonals directional discrimination strength for (int row = 4; row < tileRows - 4; ++row) { - for (int col = 4 + FC(row, 0) & 1, indx = row * tileSize + col, indx2 = indx / 2, indx3 = (indx - w1 - 1) / 2, indx4 = (indx + w1 - 1) / 2; col < tilecols - 4; col += 2, indx += 2, indx2++, indx3++, indx4++ ) { + for (int col = 4 + (fc(cfarray, row, 0) & 1), indx = row * tileSize + col, indx2 = indx / 2, indx3 = (indx - w1 - 1) / 2, indx4 = (indx + w1 - 1) / 2; col < tilecols - 4; col += 2, indx += 2, indx2++, indx3++, indx4++ ) { float P_Stat = std::max(epssq, P_CDiff_Hpf[indx3] + P_CDiff_Hpf[indx2] + P_CDiff_Hpf[indx4 + 1]); float Q_Stat = std::max(epssq, Q_CDiff_Hpf[indx3 + 1] + Q_CDiff_Hpf[indx2] + Q_CDiff_Hpf[indx4]); PQ_Dir[indx2] = P_Stat / (P_Stat + Q_Stat); From cbb7735fae6363906f2cbd810d295670b0ee8906 Mon Sep 17 00:00:00 2001 From: Desmis Date: Sun, 17 Jan 2021 17:21:53 +0100 Subject: [PATCH 062/129] Change 2 labels show modified areas --- rtdata/languages/Francais | 1 + rtdata/languages/default | 1 + rtgui/locallabtools.cc | 2 +- rtgui/locallabtools2.cc | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/rtdata/languages/Francais b/rtdata/languages/Francais index f49139365..70aebf664 100644 --- a/rtdata/languages/Francais +++ b/rtdata/languages/Francais @@ -2298,6 +2298,7 @@ TP_LOCALLAB_SHOWMASKTYP3;Flouter & Bruit + De-bruite TP_LOCALLAB_SHOWMASKTYP_TOOLTIP;Masque et modifications peuvent être choisis.\nFlouter et bruit: dans ce cas il n'est pas utilisé pour 'Réduction du bruit'.\nRéduction du bruit : dans ce cas il n'est pas utilisé pour 'flouter et bruit'.\n\nFlouter et bruit + Réduction du bruit : le masque est partagé, faire attention à 'montrer modifications' et 'Etendue' TP_LOCALLAB_SHOWMNONE;Montrer image modifiée TP_LOCALLAB_SHOWMODIF;Montrer modifications sans masque +TP_LOCALLAB_SHOWMODIF2;Montrer modifications TP_LOCALLAB_SHOWMODIFMASK;Montrer modifications avec masque TP_LOCALLAB_SHOWNORMAL;Normalise luminance (non) TP_LOCALLAB_SHOWPLUS;Masque et modifications - Adoucir-flouter & De-bruite diff --git a/rtdata/languages/default b/rtdata/languages/default index c0483e1ec..aa7f8a9dc 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -3030,6 +3030,7 @@ TP_LOCALLAB_SHOWMASKTYP3;Blur & Noise + Denoise TP_LOCALLAB_SHOWMASKTYP_TOOLTIP;Mask and modifications can be chosen.\nBlur and noise : in this case it is not used for 'denoise'.\nDenoise : in this case it is not used for 'blur and noise'.\n\nBlur and noise + denoise : mask is shared, be carefull to 'show modifications' and 'scope' TP_LOCALLAB_SHOWMNONE;Show modified image TP_LOCALLAB_SHOWMODIF;Show modified areas without mask +TP_LOCALLAB_SHOWMODIF2;Show modified areas TP_LOCALLAB_SHOWMODIFMASK;Show modified areas with mask TP_LOCALLAB_SHOWNORMAL;No luminance normalization TP_LOCALLAB_SHOWPLUS;Mask and modifications (Blur & Denoise) diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 244438e4b..812af59a7 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -5827,7 +5827,7 @@ LocallabSoft::LocallabSoft(): showmasksoftMethod->append(M("TP_LOCALLAB_SHOWFOURIER")); showmasksoftMethod->append(M("TP_LOCALLAB_SHOWPOISSON")); showmasksoftMethod->append(M("TP_LOCALLAB_SHOWNORMAL")); - showmasksoftMethod->append(M("TP_LOCALLAB_SHOWMODIF")); + showmasksoftMethod->append(M("TP_LOCALLAB_SHOWMODIF2")); showmasksoftMethod->set_active(0); showmasksoftMethodConn = showmasksoftMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabSoft::showmasksoftMethodChanged)); diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index bc45879d9..4907dd560 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -1985,7 +1985,7 @@ LocallabSharp::LocallabSharp(): inversshaConn = inverssha->signal_toggled().connect(sigc::mem_fun(*this, &LocallabSharp::inversshaChanged)); showmasksharMethod->append(M("TP_LOCALLAB_SHOWMNONE")); - showmasksharMethod->append(M("TP_LOCALLAB_SHOWMODIF")); + showmasksharMethod->append(M("TP_LOCALLAB_SHOWMODIF2")); showmasksharMethod->append(M("TP_LOCALLAB_SHOWREF")); showmasksharMethod->set_active(0); showmasksharMethod->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKCOL_TOOLTIP")); From c5f66924927140703745697bbe2470bf187f7261 Mon Sep 17 00:00:00 2001 From: Desmis Date: Mon, 18 Jan 2021 17:18:30 +0100 Subject: [PATCH 063/129] Others improvment french translation --- rtdata/languages/Francais | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/rtdata/languages/Francais b/rtdata/languages/Francais index 70aebf664..e9d891b8e 100644 --- a/rtdata/languages/Francais +++ b/rtdata/languages/Francais @@ -1363,6 +1363,7 @@ TP_COARSETRAF_TOOLTIP_ROTLEFT;Rotation vers la gauche\nRaccourci: [\n\nRa TP_COARSETRAF_TOOLTIP_ROTRIGHT;Rotation vers la droite\nRaccourci: ]\n\nRaccourci en mode Éditeur unique: Alt-] TP_COARSETRAF_TOOLTIP_VFLIP;Symétriser / axe horizontal TP_COLORAPP_ABSOLUTELUMINANCE;Luminance absolue +TP_COLORAPP_ADAPSCEN_TOOLTIP;Correspond à la luminance en candelas par m2 au moment de la prise de vue, calculée automatiquement à partir des données exif. TP_COLORAPP_ALGO;Algorithme TP_COLORAPP_ALGO_ALL;Tout TP_COLORAPP_ALGO_JC;Luminosité + Chroma (JC) @@ -1429,6 +1430,7 @@ TP_COLORAPP_TEMP_TOOLTIP;Pour sélectionner un illuminant, toujours régler Tein TP_COLORAPP_TONECIE;Compression Tonale utilisant CIECAM02 TP_COLORAPP_TONECIE_TOOLTIP;Si cette option est désactivée, la compression tonale est faite dans l'espace Lab.\nSi cette options est activée, la compression tonale est faite en utilisant CIECAM02.\nL'outil Compression Tonale doit être activé pour que ce réglage prenne effet TP_COLORAPP_VIEWING_ABSOLUTELUMINANCE_TOOLTIP;Luminance absolue de l'environnement de visionnage\n(souvent 16cd/m²) +TP_COLORAPP_YBOUT_TOOLTIP;Yb est la luminance relative de l'arrière plan, exprimée e % de gris. Un gris à 18% correspond à une luminance exprimée en CIE L de 50%.\nCette donnée prend en compte la luminance moyenne de l'image. TP_COLORAPP_WBCAM;BB [RT+CAT02] + [sortie] TP_COLORAPP_WBRT;BB [RT] + [sortie] TP_COLORTONING_AB;o C/L @@ -1891,7 +1893,6 @@ TP_LOCALLAB_DENOIBILAT_TOOLTIP;Traite le bruit d'impulsion (poivre et sel) TP_LOCALLAB_DEPTH;Profondeur TP_LOCALLAB_DETAIL;Contraste local TP_LOCALLAB_DETAILFRA;Détection de bord - TP_LOCALLAB_DETAILSH;Details TP_LOCALLAB_DETAILTHR;Seuil Detail Luminance Chroma (DCT ƒ) TP_LOCALLAB_DUPLSPOTNAME;Copier @@ -2042,19 +2043,40 @@ TP_LOCALLAB_LOC_CONTRASTPYR2LAB; Contr. par niveaux- Tone Mapping - Cont.Dir. TP_LOCALLAB_LOC_CONTRASTPYRLAB; Filtre Gradué - Netteté bords - Flouter TP_LOCALLAB_LOC_RESIDPYR;Image Residuelle TP_LOCALLAB_LOG;Codage log +TP_LOCALLAB_LOG1FRA;Ajustements Image +TP_LOCALLAB_LOG2FRA;Conditions de visionnage TP_LOCALLAB_LOGAUTO;Automatique -TP_LOCALLAB_LOGAUTO_TOOLTIP;Presser ce bouton va amner une évaluation an evaluation de l'amplitude dynamique et du point gris "source" (Si "Automatique" Source gris activé).\nPour être autorisé à retoucher les valeurs automatiques, presser le bouton à nouveau +TP_LOCALLAB_LOGAUTOGRAY_TOOLTIP;Calcule automatiquement la 'luminance moyenne' pour les conditons de prise de vue quand le bouton ‘Automatique’ dans Niveaux d'Exposition Relatif est pressé. +TP_LOCALLAB_LOGAUTO_TOOLTIP;Presser ce bouton va amener une évaluation an evaluation de l'amplitude dynamique et du point gris "source" (Si "Automatique" Source gris activé).\nPour être autorisé à retoucher les valeurs automatiques, presser le bouton à nouveau TP_LOCALLAB_LOGBASE_TOOLTIP;Défaut = 2.\nValeurs inférieures à 2 réduisent l'action de l'algorithme, les ombres sont plus sombres, les hautes lumières plus brillantes.\nValeurs supérieures à 2 changent l'action de l'algorithme, les ombres sont plus grises, les hautes lumières lavées TP_LOCALLAB_LOGBLACKWHEV_TOOLTIP;Valeurs estimées de la plage Dynamique - Noir Ev et Blanc Ev +TP_LOCALLAB_LOGCATAD_TOOLTIP;L'adaptation chromatique vous permet d'interpreter une couleur en se référant à son environnement spatio-temporel.\nUtile lorsque la balance des blancs est loin de D50.\nAdapte les couleurs à l'illuminant du périphérque de sortie. +TP_LOCALLAB_LOGCOLORFL;Niveau de couleurs (M) +TP_LOCALLAB_LOGCOLORF_TOOLTIP;Taux de perception de la teinte en relation au gris.\nIndicateur qu'un stimulus apparaît plus ou moins coloré. +TP_LOCALLAB_LOGCONQL;Contraste (Q) +TP_LOCALLAB_LOGCONTL;Contraste (J) +TP_LOCALLAB_LOGCONTL_TOOLTIP;Contraste (J) CIECAM16 prend en compte l'accroissement de la perception colorée avec la luminance. +TP_LOCALLAB_LOGCONTQ_TOOLTIP;Contraste (Q) CIECAM16 prend en compte l'accroissement de la perception colorée avec la brillance. +TP_LOCALLAB_LOGDETAIL_TOOLTIP;Agit principalment sur les hautes fréquences. TP_LOCALLAB_LOGENCOD_TOOLTIP;Autorise 'Tone Mapping' avec codage Logarithmique (ACES).\nUtile pour images ous-exposées, ou avec une plage dynamique élévée.\n\nDeux étapes dans le processus : 1) Calculer Plage Dynamique 2) Adaptation par utilisateur TP_LOCALLAB_LOGEXP;Tous les outils TP_LOCALLAB_LOGFRA;Point gris source TP_LOCALLAB_LOGFRAME_TOOLTIP;Calcule ou utilise le niveau d'Exposition de l'image tôt dans le processus:\n Noir Ev, Blanc Ev et Point gris source.\n Prend en compte la compensation d'exposition principale. +TP_LOCALLAB_LOGIMAGE_TOOLTIP;Prend en compte les variables Ciecam (principalement Contraste 'J' et Saturation 's', et aussi 'avancé' Contraste 'Q' , Brillance 'Q', Luminosité (J), Niveau de couleurs (M)). +TP_LOCALLAB_LOGLIGHTL;Luminosité (J) +TP_LOCALLAB_LOGLIGHTL_TOOLTIP;Proche de luminosité (L*a*b*), prend en compte l'accroissement de la perception colorée. +TP_LOCALLAB_LOGLIGHTQ;Brillance (Q) +TP_LOCALLAB_LOGLIGHTQ_TOOLTIP;Taux de perception de lumière émanant d'un stimulus.\nIndicateur qu'un stimulus apparaît être plus ou moins brillant, clair. TP_LOCALLAB_LOGLIN;Logarithme mode TP_LOCALLAB_LOGPFRA;Niveaux d'Exposition relatif +TP_LOCALLAB_LOGREPART;Force +TP_LOCALLAB_LOGSATURL_TOOLTIP;Saturation (s) CIECAM16 correspond à la couleur d'un stimulus en relation avec sa propre brillance.\nAgit principalement sur les tons moyens et hauts. +TP_LOCALLAB_LOGSCENE_TOOLTIP;Correspond aux conditions de prise de vue. +TP_LOCALLAB_LOGSURSOUR_TOOLTIP;Change les tons et couleurs en prenant en compte les conditions de prise de vue.\n\nMoyen: Environnement lumineux moyen (standard). L'image ne change pas.\n\nTamisé: Environnement tamisé. L'iamge va devenir un peu plus claire. TP_LOCALLAB_LOGSRCGREY_TOOLTIP;Estime la valeur du point gris de l'image, tôt dans le processus TP_LOCALLAB_LOGTARGGREY_TOOLTIP;Vous pouvez changer cette valeur pour l'adapter à votre goût. TP_LOCALLAB_LOG_TOOLNAME;Codage log - 0 +TP_LOCALLAB_LOGVIEWING_TOOLTIP;Correspond au medium sur lequel l'image finale sera vue (moniteur, TV, projecteur, imprimante,..), ainsi que son environnement. TP_LOCALLAB_LUM;Courbes LL - CC TP_LOCALLAB_LUMADARKEST;Plus Sombre TP_LOCALLAB_LUMASK;Maqsue Luminance arrière plan @@ -2102,8 +2124,6 @@ TP_LOCALLAB_MASKHIGTHRESL_TOOLTIP;Limite des tons clairs au-dessus de laquelle C TP_LOCALLAB_MASKHIGTHRESL_TOOLTIP;Limite des tons clairs au-dessus de laquelle Codage Log sera restauré progressivement à leurs valeurs avant d'être modifiés par Codage Log.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris:‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’.\n Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées. Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 TP_LOCALLAB_MASKHIGTHRESD_TOOLTIP;Limite des tons clairs au-dessus de laquelle de-bruite sera appliquée progressivement.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris: ‘masque structure’,‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’, ‘Niveau contraste local ondelettes’.Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées.\n Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 TP_LOCALLAB_MASKHIGTHRES_TOOLTIP;Limite des tons clairs au-dessus de laquelle Filtre Guidé sera appliquée progressivement.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris: ‘masque structure’,‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’, ‘Niveau contraste local ondelettes’.Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées.\n Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 - - TP_LOCALLAB_MASKLOWTHRESC_TOOLTIP;Limite des tons sombres au-dessous de laquelle Couleur et Lumière sera restauré progressivement à leurs valeurs avant d'être modifiés par Couleur et Lumières .\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris: ‘masque structure’, 'masque flouter', ‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’, ‘Niveau contraste local ondelettes’.\n Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées. Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 TP_LOCALLAB_MASKLOWTHRESS_TOOLTIP;Limite des tons sombres au-dessous de laquelle Ombres et Lumière sera restauré progressivement à leurs valeurs avant d'être modifiés par Ombres et Lumières .\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris:‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’.\n Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées. Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 TP_LOCALLAB_MASKLOWTHRESCB_TOOLTIP;Limite des tons sombres au-dessous de laquelle CBDL (luminance) sera restauré progressivement à leurs valeurs avant d'être modifiés par CBDL.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris:‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’.\n Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées. Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 @@ -2116,9 +2136,6 @@ TP_LOCALLAB_MASKLOWTHRESL_TOOLTIP;Limite des tons sombres au-dessous de laquelle TP_LOCALLAB_MASKLOWTHRESL_TOOLTIP;Limite des tons sombres au-dessous de laquelle Codage Log sera restauré progressivement à leurs valeurs avant d'être modifiés par Codage Log.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris:‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’.\n Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées. Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 TP_LOCALLAB_MASKLOWTHRESD_TOOLTIP;Limite des tons sombres au-dessous de laquelle de-bruite sera appliquée progressivement.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris: ‘masque structure’,‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’, ‘Niveau contraste local ondelettes’.Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées.\n Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 TP_LOCALLAB_MASKLOWTHRES_TOOLTIP;Limite des tons sombres au-dessous de laquelle Filtre Guidé sera appliquée progressivement.\n Vous pouvez utiliser certains des outils de ‘Masques et modifications’ pour changer les niveaux de gris: ‘masque structure’,‘rayon adoucir’, ‘Gamma et pente’, ‘courbe de Contraste’, ‘Niveau contraste local ondelettes’.Utiliser une ‘ancre de vérification couleur’ sur le masque pour voir quelle zones seront affectées.\n Soyez attentifs à ce que dans 'Réglages' Masque luminance arrière plan = 0 - - - TP_LOCALLAB_MASKUSABLE;Masque activé (Masque & modifications) TP_LOCALLAB_MASKUNUSABLE;Masque désactivé (Masque & modifications) TP_LOCALLAB_MASK_TOOLTIP;Vous pouvez activer plusieurs masques pour un simple outil, ceci nécessite d'activer un autre outil (mais sans utilser l'outil : curseurs à 0,...)où est le masque que vous souhaitez activer.\n\nVous pouvez aussi dupliquer le RT-spot et le placer juste à côté de l'autre,les variations de références autorisent un travail fin sur les images. @@ -2181,7 +2198,7 @@ TP_LOCALLAB_NOISECHROC_TOOLTIP;Si supérieur à zéro, algorithme haute qualité TP_LOCALLAB_NOISECHRODETAIL;Récupération des détails Chroma (DCT ƒ) TP_LOCALLAB_NOISECHROFINE;Chroma fin (Ond) TP_LOCALLAB_NOISEDETAIL_TOOLTIP;Désactivé si curseur = 100 -TP_LOCALLAB_NOISELEQUAL;Egalisateurs balnc-noir +TP_LOCALLAB_NOISELEQUAL;Egalisateurs blanc-noir TP_LOCALLAB_NOISELUMCOARSE;Luminance gros (ond) TP_LOCALLAB_NOISELUMDETAIL;Récupération Luminance fin(DCT ƒ) TP_LOCALLAB_NOISELUMFINE;Luminance fin 1 (ond) @@ -2327,6 +2344,7 @@ TP_LOCALLAB_SOFTRETI;Reduire artefact ΔE TP_LOCALLAB_SOFTRETI_TOOLTIP;Prend en compte ΔE pour améliorer Transmission map TP_LOCALLAB_SOFT_TOOLNAME;Lumière douce & Original Retinex - 6 TP_LOCALLAB_SOURCE_GRAY;Valeur +TP_LOCALLAB_SOURCE_ABS;Luminance absolue TP_LOCALLAB_SPECCASE; Cas spécifiques TP_LOCALLAB_SPECIAL;Usage Special des courbes RGB TP_LOCALLAB_SPECIAL_TOOLTIP;Seulement pour cette courbe RGB, désactive (ou réduit les effecs) de Etendue, masque...par exemple, si vous voulez rendre un effet "négatif". @@ -2800,6 +2818,7 @@ TP_WAVELET_DAUB6;D6 - standard plus TP_WAVELET_DAUB10;D10 - moyen TP_WAVELET_DAUB14;D14 - haut TP_WAVELET_DAUB_TOOLTIP;Change les coéf. de Daubechies:\nD4 = Standard,\nD14 = Souvent les meilleurs performances, demande 10% de temps de traitement supplémentaire.\n\nAffecte la détection des bords ainsi que la qualité générale des premiers niveaux. Cependant la qualité n'est pas strcitement à ces coéficients et peut varier en fonction des images et des usages. +TP_WAVELET_DENOISEHUE;Egalisateur teinte TP_WAVELET_DONE;Vertical TP_WAVELET_DTHR;Diagonal TP_WAVELET_DTWO;Horizontal From 26a97468d9cb0ca743fb906c512b8980cb26cfe3 Mon Sep 17 00:00:00 2001 From: Desmis Date: Tue, 19 Jan 2021 09:13:12 +0100 Subject: [PATCH 064/129] Fixed Bug issue #6067 - right side border with dynamic range --- rtengine/iplocallab.cc | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 306c5609e..669577e53 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -6545,7 +6545,7 @@ void optfft(int N_fftwsize, int &bfh, int &bfw, int &bfhr, int &bfwr, struct loc //optimize with size fftw bool reduW = false; bool reduH = false; - + bool exec = true; if (ystart == 0 && yend < H) { lp.ly -= (bfh - ftsizeH); } else if (ystart != 0 && yend == H) { @@ -6557,8 +6557,10 @@ void optfft(int N_fftwsize, int &bfh, int &bfw, int &bfhr, int &bfwr, struct loc lp.ly -= (bfh - ftsizeH); } } else if (ystart == 0 && yend == H) { - bfhr = ftsizeH; + // bfhr = ftsizeH; + bfhr = bfh; reduH = true; + exec = false; } if (xstart == 0 && xend < W) { @@ -6572,8 +6574,10 @@ void optfft(int N_fftwsize, int &bfh, int &bfw, int &bfhr, int &bfwr, struct loc lp.lx -= (bfw - ftsizeW); } } else if (xstart == 0 && xend == W) { - bfwr = ftsizeW; + // bfwr = ftsizeW; + bfwr = bfw; reduW = true; + exec = false; } //new values optimized @@ -6584,14 +6588,18 @@ void optfft(int N_fftwsize, int &bfh, int &bfw, int &bfhr, int &bfwr, struct loc bfh = bfhr = yend - ystart; bfw = bfwr = xend - xstart; - if (reduH) { + if (reduH && exec) { bfhr = ftsizeH; + } else { + bfhr = bfh; } - if (reduW) { + if (reduW && exec) { bfwr = ftsizeW; + } else { + bfwr = bfw; } - + if (settings->verbose) { printf("Nyst=%i Nyen=%i lp.yc=%f lp.lyT=%f lp.ly=%f bfh=%i bfhr=%i origH=%i ftsizeH=%i\n", ystart, yend, lp.yc, lp.lyT, lp.ly, bfh, bfhr, H, ftsizeH); printf("Nxst=%i Nxen=%i lp.xc=%f lp.lxL=%f lp.lx=%f bfw=%i bfwr=%i origW=%i ftsizeW=%i\n", xstart, xend, lp.xc, lp.lxL, lp.lx, bfw, bfwr, W, ftsizeW); From 8a1f1e9e227e4d1467ddcd298b50940cf005a140 Mon Sep 17 00:00:00 2001 From: Thanatomanic <6567747+Thanatomanic@users.noreply.github.com> Date: Wed, 20 Jan 2021 08:09:00 +0100 Subject: [PATCH 065/129] Update camconst.json with support for Nikon COOLPIX P950. Fixes #6066 --- rtengine/camconst.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/rtengine/camconst.json b/rtengine/camconst.json index 35b6715b9..850cc287c 100644 --- a/rtengine/camconst.json +++ b/rtengine/camconst.json @@ -1602,6 +1602,22 @@ Camera constants: } // No significant influence of ISO // No aperture scaling reported }, + + { // Quality B, samples provided by arvindpgh (#6066) + // Sensor shows some non-uniformity, need other sample to verify + // There seems to be some aperture scaling, but insufficient data to accurately determine + "make_model": "Nikon COOLPIX P950", + "dcraw_matrix": [ 13307,-5641,-1290,-2048,10581,1689,-64,1222,5176 ], // ColorMatrix2 from Adobe DNG Converter 13.1 + "ranges": { + "black": 200, + "white": [ + { "iso": [ 100 ], "levels": [ 3994, 4093, 3963 ] }, // LENR can be quite aggressive at higher ISO + { "iso": [ 200 ], "levels": [ 3993, 4092, 3962 ] }, + { "iso": [ 400 ], "levels": [ 3992, 4091, 3961 ] }, + { "iso": [ 800, 1600, 3200, 6400 ], "levels": [ 3996, 4095, 3965 ] } + ] + } + }, { // Quality B, no LENR samples "make_model": "Nikon D5", From 8bb06c2c4bbe902290241c2b8715695d34761a48 Mon Sep 17 00:00:00 2001 From: Desmis Date: Wed, 20 Jan 2021 18:12:37 +0100 Subject: [PATCH 066/129] Change some Denoise tooltips --- rtdata/languages/default | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index aa7f8a9dc..714e4faba 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2835,13 +2835,13 @@ TP_LOCALLAB_MASKHIGTHRESVIB_TOOLTIP;Light-tone limit above which Vibrance and Wa TP_LOCALLAB_MASKHIGTHRESWAV_TOOLTIP;Light-tone limit above which Local contrast and Wavelet will be restored progressively to their original values prior to being modified by the Local contrast and Wavelet settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESE_TOOLTIP;Light-tone limit above which 'Dynamic range and Exposure' will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKHIGTHRESL_TOOLTIP;Light-tone limit above which Log encoding will be restored progressively to their original values prior to being modified by the Log encoding settings .\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 -TP_LOCALLAB_MASKHIGTHRESD_TOOLTIP;Light-tone limit above which denoise will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 -TP_LOCALLAB_MASKHIGTHRES_TOOLTIP;Light-tone limit above which 'Guided Filter' will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKHIGTHRESD_TOOLTIP; The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (as determined by the mask).\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKHIGTHRES_TOOLTIP; The Guided Filter is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (as determined by the mask).\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLCTHR;Light area luminance threshold TP_LOCALLAB_MASKLCTHRLOW;Dark area luminance threshold TP_LOCALLAB_MASKLNOISELOW;Reinforce denoise in dark and light areas -TP_LOCALLAB_MASKLOWTHRES_TOOLTIP;Dark-tone limit below which 'Guided Filter' will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 -TP_LOCALLAB_MASKLOWTHRESD_TOOLTIP;Dark-tone limit below which denoise will be progressively applied.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKLOWTHRES_TOOLTIP;The Guided Filter is progressively increased from 0% at the threshold setting to 100% at the maximum black value (as determined by the mask).\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 +TP_LOCALLAB_MASKLOWTHRESD_TOOLTIP;The denoise is progressively increased from 0% at the threshold setting to 100% at the maximum black value (as determined by the mask).\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESC_TOOLTIP;Dark-tone limit below which Color and Light will be restored progressively to their original values prior to being modified by the Color and Light settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘structure mask’, 'blur mask', ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’, ‘Local contrast wavelet’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESL_TOOLTIP;Dark-tone limit below which Log encoding will be restored progressively to their original values prior to being modified by the Log encoding settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels:‘Smooth radius’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 TP_LOCALLAB_MASKLOWTHRESE_TOOLTIP;Dark-tone limit below which 'Dynamic range and Exposure' will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings.\n You can use certain tools in ‘Mask and modifications’ to change the gray levels: ‘Smooth radius’, ‘Gamma and slope’, ‘Contrast curve’.\n Use a ‘lockable color picker’ on the mask to see which areas will be affected. Be carefull in 'settings' to Background color mask = 0 From 6d138ae8fa5e5e23240f3cb3ef37f1322b13cfdd Mon Sep 17 00:00:00 2001 From: Thanatomanic <6567747+Thanatomanic@users.noreply.github.com> Date: Thu, 21 Jan 2021 21:20:06 +0100 Subject: [PATCH 067/129] Update issue templates In an attempt to enhance/professionalize our issue tracker, I've worked on some templates for issue submission. Please provide feedback. --- .github/ISSUE_TEMPLATE/bug_report.md | 40 +++++++++++++++++++ .../camera-support---color-calibration.md | 13 ++++++ .github/ISSUE_TEMPLATE/camera-support.md | 10 +++++ .../feature-request---enhancements.md | 15 +++++++ 4 files changed, 78 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/camera-support---color-calibration.md create mode 100644 .github/ISSUE_TEMPLATE/camera-support.md create mode 100644 .github/ISSUE_TEMPLATE/feature-request---enhancements.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..d6d418f42 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,40 @@ +--- +name: Bug report +about: Is something not working as it should? Please report it here. +title: '' +labels: '' +assignees: '' + +--- + + + +**Short description** + + +**Steps to reproduce** + + +**Expected behavior** + + +**Additional information** + diff --git a/.github/ISSUE_TEMPLATE/camera-support---color-calibration.md b/.github/ISSUE_TEMPLATE/camera-support---color-calibration.md new file mode 100644 index 000000000..eaf57e20f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/camera-support---color-calibration.md @@ -0,0 +1,13 @@ +--- +name: Camera support / color calibration +about: Report new file formats or requests for color calibration support here +title: '' +labels: '' +assignees: '' + +--- + + diff --git a/.github/ISSUE_TEMPLATE/camera-support.md b/.github/ISSUE_TEMPLATE/camera-support.md new file mode 100644 index 000000000..6d694f0a9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/camera-support.md @@ -0,0 +1,10 @@ +--- +name: Camera support +about: Report new file formats or requests for color calibration support here +title: '' +labels: '' +assignees: '' + +--- + + + + From 999eb30f5f956d7ba50dfc7993d7c6b04de97f40 Mon Sep 17 00:00:00 2001 From: Desmis Date: Sun, 24 Jan 2021 08:06:46 +0100 Subject: [PATCH 068/129] LA Denoise - change reparition basic standard advanced --- rtgui/locallabtools.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 812af59a7..41b75f17f 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -7627,6 +7627,7 @@ void LocallabBlur::convertParamToNormal() shadmaskblsha->setValue((double)defSpot.shadmaskblsha); LLmaskblshapewav->setCurve(defSpot.LLmaskblcurvewav); csThresholdblur->setValue(defSpot.csthresholdblur); + lnoiselow->setValue(defSpot.lnoiselow); // Enable all listeners enableListener(); @@ -7677,7 +7678,8 @@ void LocallabBlur::convertParamToSimple() recothres->setValue(defSpot.recothres); lowthres->setValue(defSpot.lowthres); higthres->setValue(defSpot.higthres); - + adjblur->setValue(defSpot.adjblur); + noisechrodetail->setValue(defSpot.noisechrodetail); // Enable all listeners enableListener(); } @@ -7701,6 +7703,9 @@ void LocallabBlur::updateGUIToMode(const modeType new_type) decayd->hide(); invmask->hide(); invmaskd->hide(); + adjblur->hide(); + noisechrodetail->hide(); + usemask->hide(); break; case Normal: @@ -7715,9 +7720,12 @@ void LocallabBlur::updateGUIToMode(const modeType new_type) csThresholdblur->hide(); // Specific Simple mode widgets are shown in Normal mode expmaskbl->show(); - expdenoise1->show(); + expdenoise1->hide(); expdenoise2->hide(); expdenoise3->show(); + adjblur->show(); + noisechrodetail->show(); + usemask->show(); if (blMethod->get_active_row_number() == 2) { expdenoise2->show(); } @@ -7779,6 +7787,9 @@ void LocallabBlur::updateGUIToMode(const modeType new_type) decayd->show(); invmask->show(); invmaskd->show(); + adjblur->show(); + noisechrodetail->show(); + usemask->show(); expmaskbl->show(); strumaskbl->show(); From 84cfedd2a2abf85e2606c7e2066d2cd1b41bdcf0 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sun, 24 Jan 2021 11:26:04 +0100 Subject: [PATCH 069/129] rcd: fix border issue --- rtengine/rcd_demosaic.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtengine/rcd_demosaic.cc b/rtengine/rcd_demosaic.cc index b12ce1473..3a88e1a9a 100644 --- a/rtengine/rcd_demosaic.cc +++ b/rtengine/rcd_demosaic.cc @@ -79,7 +79,7 @@ void RawImageSource::rcd_demosaic(size_t chunkSize, bool measure) const unsigned int cfarray[2][2] = {{FC(0,0), FC(0,1)}, {FC(1,0), FC(1,1)}}; constexpr int tileBorder = 9; // avoid tile-overlap errors - constexpr int rcdBorder = 6; // for the outermost tiles we can have a smaller outer border + constexpr int rcdBorder = 9; constexpr int tileSize = 194; constexpr int tileSizeN = tileSize - 2 * tileBorder; const int numTh = H / (tileSizeN) + ((H % (tileSizeN)) ? 1 : 0); From 78209d3c96d3c771a7e0f5f87d952a764a950b55 Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Sun, 24 Jan 2021 18:10:02 -0800 Subject: [PATCH 070/129] Fix color label with default profile bug Prevent the color label, rating, and trash status from being reset when resetting a photo to the default processing profile. Closes #5936. --- rtgui/filebrowser.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index a8ce94e7f..0d2451b59 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -985,11 +985,19 @@ void FileBrowser::menuItemActivated (Gtk::MenuItem* m) } for (size_t i = 0; i < mselected.size(); i++) { - mselected[i]->thumbnail->createProcParamsForUpdate (false, true); + const auto thumbnail = mselected[i]->thumbnail; + const auto rank = thumbnail->getRank(); + const auto colorLabel = thumbnail->getColorLabel(); + const auto stage = thumbnail->getStage(); + + thumbnail->createProcParamsForUpdate (false, true); + thumbnail->setRank(rank); + thumbnail->setColorLabel(colorLabel); + thumbnail->setStage(stage); // Empty run to update the thumb - rtengine::procparams::ProcParams params = mselected[i]->thumbnail->getProcParams (); - mselected[i]->thumbnail->setProcParams (params, nullptr, FILEBROWSER, true, true); + rtengine::procparams::ProcParams params = thumbnail->getProcParams (); + thumbnail->setProcParams (params, nullptr, FILEBROWSER, true, true); } if (!mselected.empty() && bppcl) { From 6d1ba3285bceec98c1e3bbe8979d5cdf54791155 Mon Sep 17 00:00:00 2001 From: Desmis Date: Mon, 25 Jan 2021 10:51:30 +0100 Subject: [PATCH 071/129] Change label CBDL for Contrast by Detail Levels --- rtdata/languages/default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 714e4faba..800db3dac 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2519,7 +2519,7 @@ TP_LOCALLAB_CBDL;Contrast by Detail Levels TP_LOCALLAB_CBDLCLARI_TOOLTIP;Enhances local contrast of the midtones. TP_LOCALLAB_CBDL_ADJ_TOOLTIP;Same as wavelets.\nThe first level (0) acts on 2x2 pixel details.\nThe last level (5) acts on 64x64 pixel details. TP_LOCALLAB_CBDL_THRES_TOOLTIP;Prevents the sharpening of noise -TP_LOCALLAB_CBDL_TOOLNAME;CBDL - 2 +TP_LOCALLAB_CBDL_TOOLNAME;Contrast by Detail Levels - 2 TP_LOCALLAB_CENTER_X;Center X TP_LOCALLAB_CENTER_Y;Center Y TP_LOCALLAB_CH;Curves CL - LC From a5280fddf58468deae9d7ac5dcfdd9fdf7ffec43 Mon Sep 17 00:00:00 2001 From: Desmis Date: Tue, 26 Jan 2021 08:10:19 +0100 Subject: [PATCH 072/129] Local adjustments - Enable Disable spot with Denoise --- rtengine/iplocallab.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 669577e53..c3cfd7e3d 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -11874,7 +11874,7 @@ void ImProcFunctions::Lab_Local( } //local denoise - if (lp.denoiena && (lp.noiself > 0.f || lp.noiself0 > 0.f || lp.noiself2 > 0.f || lp.wavcurvedenoi || lp.noiselc > 0.f || lp.noisecf > 0.f || lp.noisecc > 0.f )) {//disable denoise if not used + if (lp.activspot && lp.denoiena && (lp.noiself > 0.f || lp.noiself0 > 0.f || lp.noiself2 > 0.f || lp.wavcurvedenoi || lp.noiselc > 0.f || lp.noisecf > 0.f || lp.noisecc > 0.f )) {//disable denoise if not used float slidL[8] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; float slida[8] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; float slidb[8] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; From 727c9557b4f5ea2dde32f228997938988c81b3e7 Mon Sep 17 00:00:00 2001 From: Desmis Date: Thu, 28 Jan 2021 07:32:07 +0100 Subject: [PATCH 073/129] Local adjustments - Mask - Change behavior Laplacian (#6075) * Change Laplacian action in mask * Change tooltip Laplace --- rtdata/languages/default | 4 ++-- rtengine/improcfun.h | 2 ++ rtengine/iplocallab.cc | 31 +++++++++++++++++++++++++++++-- rtengine/ipretinex.cc | 32 ++++++++++++++++++++++++++++++-- 4 files changed, 63 insertions(+), 6 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 800db3dac..3b50d32c8 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2733,9 +2733,9 @@ TP_LOCALLAB_LAPLACC;ΔØ Mask Laplacian solve PDE TP_LOCALLAB_LAPLACE;Laplacian threshold ΔE TP_LOCALLAB_LAPLACEXP;Laplacian threshold TP_LOCALLAB_LAPMASKCOL;Laplacian threshold -TP_LOCALLAB_LAPRAD1_TOOLTIP;Avoid using “Smooth radius” and “Laplacian threshold” (advanced) together.\nTransforms the mask to eliminate values lower than the threshold.\nReduces artifacts and noise, and allows local contrast to be modified. +TP_LOCALLAB_LAPRAD1_TOOLTIP;Increases the contrast of the mask by increasing the luminance values of the lighter areas. Can be used in conjunction with the L(L) and LC(H) curves. TP_LOCALLAB_LAPRAD2_TOOLTIP;Smooth radius uses a guided filter to decrease artifacts and smooth out the transition -TP_LOCALLAB_LAPRAD_TOOLTIP;Avoid using “Smooth radius” and “Laplacian threshold” (advanced) together.\nSmooth radius uses a guided filter to decrease artifacts and smooth out the transition +TP_LOCALLAB_LAPRAD_TOOLTIP;Smooth radius uses a guided filter to decrease artifacts and smooth out the transition TP_LOCALLAB_LAP_MASK_TOOLTIP;Solve PDE for all Laplacian masks.\nIf enabled Laplacian threshold mask reduce artifacts and smooth result.\nIf disabled linear response. TP_LOCALLAB_LC_FFTW_TOOLTIP;FFT improves quality and allows the use of large radii, but increases processing time (depends on the area to be processed). Preferable to use only for large radii. The size of the area can be reduced by a few pixels to optimize the FFTW. This can reduce the processing time by a factor of 1.5 to 10. TP_LOCALLAB_LC_TOOLNAME;Local Contrast & Wavelets - 7 diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 4915e04e6..4436c2f1e 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -251,6 +251,8 @@ public: void deltaEforMask(float **rdE, int bfw, int bfh, LabImage* bufcolorig, const float hueref, const float chromaref, const float lumaref, float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope, float balance, float balanceh); void discrete_laplacian_threshold(float * data_out, const float * data_in, size_t nx, size_t ny, float t); + void laplacian(const array2D &src, array2D &dst, int bfw, int bfh, float threshold, float ceiling, float factor, bool multiThread); + void rex_poisson_dct(float * data, size_t nx, size_t ny, double m); void mean_dt(const float * data, size_t size, double& mean_p, double& dt_p); float *cos_table(size_t size); diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index c3cfd7e3d..6e6ab0a1b 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -4087,7 +4087,7 @@ static void showmask(int lumask, const local_params& lp, int xstart, int ystart, } } //from A.Griggio...very similar to discrete_laplacian_threhold...some differences with ceiling and data format -void laplacian(const array2D &src, array2D &dst, int bfw, int bfh, float threshold, float ceiling, float factor, bool multiThread) +void ImProcFunctions::laplacian(const array2D &src, array2D &dst, int bfw, int bfh, float threshold, float ceiling, float factor, bool multiThread) { const int W = bfw; const int H = bfh; @@ -4739,6 +4739,32 @@ void ImProcFunctions::maskcalccol(bool invmask, bool pde, int bfw, int bfh, int } } } + if (lap > 0.f && pde) { + array2D mask; + mask(bfw, bfh); + float amount = LIM01(float(lap)/100.f); + array2D LL(bfw, bfh, bufcolorig->L, ARRAY2D_BYREFERENCE); + laplacian(LL, mask, bfw, bfh, 25.f, 20000.f, amount, false); +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) if (multiThread) +#endif + for (int i = 0; i < bfh; ++i) { + for (int j = 0; j < bfw; ++j) { + mask[i][j] = LIM01(mask[i][j]); + } + } + for (int i = 0; i < 3; ++i) { + boxblur(static_cast(mask), static_cast(mask), 5 / sk, bfw, bfh, false); + } +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) if (multiThread) +#endif + for (int i = 0; i < bfh; ++i) { + for (int j = 0; j < bfw; ++j) { + bufmaskblurcol->L[i][j] += clipLoc(100000.f * (mask[i][j]));//increase strongly result + } + } + } std::unique_ptr bufprov; if (delt) { @@ -5019,7 +5045,7 @@ void ImProcFunctions::maskcalccol(bool invmask, bool pde, int bfw, int bfh, int } } } - +/* if (lap > 0.f) { const float *datain = bufmaskblurcol->L[0]; const std::unique_ptr data_tmp(new float[bfh * bfw]); @@ -5039,6 +5065,7 @@ void ImProcFunctions::maskcalccol(bool invmask, bool pde, int bfw, int bfh, int } } } + */ } const float radiusb = 1.f / sk; diff --git a/rtengine/ipretinex.cc b/rtengine/ipretinex.cc index b3b28d3ad..67db52e55 100644 --- a/rtengine/ipretinex.cc +++ b/rtengine/ipretinex.cc @@ -55,6 +55,7 @@ #define BENCHMARK #include "StopWatch.h" #include "guidedfilter.h" +#include "boxblur.h" #define clipretinex( val, minv, maxv ) (( val = (val < minv ? minv : val ) ) > maxv ? maxv : val ) #define CLIPLOC(x) LIM(x,0.f,32767.f) @@ -963,6 +964,33 @@ void ImProcFunctions::maskforretinex(int sp, int before, float ** luminance, flo } } + if (lap > 0.f && pde) { + array2D mask; + mask(W_L, H_L); + float amount = LIM01(float(lap)/100.f); + array2D LL(W_L, H_L, bufreti->L, ARRAY2D_BYREFERENCE); + ImProcFunctions::laplacian(LL, mask, W_L, H_L, 25.f, 20000.f, amount, false); +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) if (multiThread) +#endif + for (int i = 0; i < H_L; ++i) { + for (int j = 0; j < W_L; ++j) { + mask[i][j] = LIM01(mask[i][j]); + } + } + for (int i = 0; i < 3; ++i) { + boxblur(static_cast(mask), static_cast(mask), 5 / skip, W_L, H_L, false); + } +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) if (multiThread) +#endif + for (int i = 0; i < H_L; ++i) { + for (int j = 0; j < W_L; ++j) { + bufmaskblurreti->L[i][j] += CLIPLOC(100000.f * (mask[i][j]));//increase strongly result + } + } + } + if (delt) { float *rdE[H_L] ALIGNED16; @@ -994,7 +1022,7 @@ void ImProcFunctions::maskforretinex(int sp, int before, float ** luminance, flo } - +/* if (lap > 0.f) { float *datain = new float[H_L * W_L]; float *data_tmp = new float[H_L * W_L]; @@ -1029,7 +1057,7 @@ void ImProcFunctions::maskforretinex(int sp, int before, float ** luminance, flo delete [] data_tmp; } - +*/ //blend #ifdef _OPENMP #pragma omp parallel From 6b1e5d6181d809ea9689a2060b626bd6b066afa2 Mon Sep 17 00:00:00 2001 From: Desmis Date: Sat, 30 Jan 2021 07:35:07 +0100 Subject: [PATCH 074/129] Ciecam - Take into account issue #6022 choice between classic - symmetric - mixed - for cat02/16 (#6079) * Change mode cat02-16 auto * Change tooltip --- rtdata/languages/default | 12 ++- rtengine/procparams.cc | 4 + rtengine/procparams.h | 1 + rtgui/colorappearance.cc | 162 ++++++++++++++++++++++++++++++++++++++- rtgui/colorappearance.h | 5 +- rtgui/paramsedited.cc | 6 ++ rtgui/paramsedited.h | 1 + 7 files changed, 185 insertions(+), 6 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 3b50d32c8..dd57d7106 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1282,6 +1282,7 @@ HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance HISTORY_MSG_BLUWAV;Attenuation response +HISTORY_MSG_CATCAT;Cat02/16 mode HISTORY_MSG_CAT02PRESET;Cat02/16 automatic preset HISTORY_MSG_CATCOMPLEX;Ciecam complexity HISTORY_MSG_CATMODEL;CAM Model @@ -2033,6 +2034,11 @@ TP_COLORAPP_BADPIXSL_TOOLTIP;Suppression of hot/bad (brightly colored) pixels.\n TP_COLORAPP_BRIGHT;Brightness (Q) TP_COLORAPP_BRIGHT_TOOLTIP;Brightness in CIECAM02/16 is the amount of perceived light emanating from a stimulus and differs from L*a*b* and RGB brightness. TP_COLORAPP_CAT02ADAPTATION_TOOLTIP;When setting manually, values above 65 are recommended. +TP_COLORAPP_CATMET_TOOLTIP;Classic - traditional CIECAM operation. The chromatic adaptation transforms are applied separately on ‘Scene conditions’ and basic illuminant on the one hand, and on basic illuminant and ‘Viewing conditions’ on the other.\n\nSymmetric – The chromatic adaptation is based on the white balance. The ‘Scene conditions’, ‘Image adjustments’ and ‘Viewing conditions’ settings are neutralized.\n\nMixed – Same as the ‘Classic’ option but in this case, the chromatic adaptation is based on the white balance. +TP_COLORAPP_CATMOD;Cat02/16 mode +TP_COLORAPP_CATCLASSIC;Classic +TP_COLORAPP_CATSYMGEN;Automatic Symmetric +TP_COLORAPP_CATSYMSPE;Mixed TP_COLORAPP_CHROMA;Chroma (C) TP_COLORAPP_CHROMA_M;Colorfulness (M) TP_COLORAPP_CHROMA_M_TOOLTIP;Colorfulness in CIECAM02/16 is the perceived amount of hue in relation to gray, an indicator that a stimulus appears to be more or less colored. @@ -2054,7 +2060,7 @@ TP_COLORAPP_DATACIE;CIECAM02/16 output histograms in curves TP_COLORAPP_DATACIE_TOOLTIP;When enabled, histograms in CIECAM02/16 curves show approximate values/ranges for J or Q, and C, s or M after the CIECAM02/16 adjustments.\nThis selection does not impact the main histogram panel.\n\nWhen disabled, histograms in CIECAM02/16 curves show L*a*b* values before CIECAM02/16 adjustments. TP_COLORAPP_DEGREE_TOOLTIP;CAT02/16 is a chromatic adaptation, it converts the values of an image whose white point is that of a given illuminant (for example D65), into new values whose white point is that of the new illuminant - see WP Model (for example D50 or D55). TP_COLORAPP_DEGREOUT_TOOLTIP;CAT02/16 is a chromatic adaptation, it converts the values of an image whose white point is that of a given illuminant (for example D50), into new values whose white point is that of the new illuminant - see WP model (for example D75). -TP_COLORAPP_FREE;Free temp+green + CAT02/16 + [output] +TP_COLORAPP_FREE;Free temp + tint + CAT02/16 +[output] TP_COLORAPP_GAMUT;Gamut control (L*a*b*) TP_COLORAPP_GAMUT_TOOLTIP;Allow gamut control in L*a*b* mode. TP_COLORAPP_GEN;Settings - Preset @@ -2070,7 +2076,7 @@ TP_COLORAPP_IL75;D75 TP_COLORAPP_ILA;Incandescent StdA 2856K TP_COLORAPP_ILFREE;Free TP_COLORAPP_ILLUM;Illuminant -TP_COLORAPP_ILLUM_TOOLTIP;Select the illuminant closest to the shooting conditions.\nIn general D50, but it can change depending on the time and lattitude. +TP_COLORAPP_ILLUM_TOOLTIP;Select the illuminant closest to the shooting conditions.\nIn general D50, but it can change depending on the time and latitude. TP_COLORAPP_LABEL;Color Appearance & Lighting (CIECAM02/16) TP_COLORAPP_LABEL_CAM02;Image Adjustments TP_COLORAPP_LABEL_SCENE;Scene Conditions @@ -2079,7 +2085,7 @@ TP_COLORAPP_LIGHT;Lightness (J) TP_COLORAPP_LIGHT_TOOLTIP;Lightness in CIECAM02/16 is the clarity of a stimulus relative to the clarity of a stimulus that appears white under similar viewing conditions, differs from L*a*b* and RGB lightness. TP_COLORAPP_MEANLUMINANCE;Mean luminance (Yb%) TP_COLORAPP_MODEL;WP Model -TP_COLORAPP_MODEL_TOOLTIP;White-Point Model.\n\nWB [RT] + [output]: RT's white balance is used for the scene, CIECAM02/16 is set to D50, and the output device's white balance is set in Viewing Conditions.\n\nWB [RT+CAT02/16] + [output]: RT's white balance settings are used by CAT02 and the output device's white balance is set in Viewing Conditions.\n\nFree temp+green + CAT02/16 + [output]: temp and green are selected by the user, the output device's white balance is set in Viewing Conditions. +TP_COLORAPP_MODEL_TOOLTIP;White-Point Model.\n\nWB [RT] + [output]: RT's white balance is used for the scene, CIECAM02/16 is set to D50, and the output device's white balance is set in Viewing Conditions.\n\nWB [RT+CAT02/16] + [output]: RT's white balance settings are used by CAT02 and the output device's white balance is set in Viewing Conditions.\n\nFree temp + tint + CAT02/16 + [output]: temp and tint are selected by the user, the output device's white balance is set in Viewing Conditions. TP_COLORAPP_MODELCAT;CAM Model TP_COLORAPP_MODELCAT_TOOLTIP;Allows you to choose between CIECAM02 or CIECAM16.\n CIECAM02 will sometimes be more accurate.\n CIECAM16 should generate fewer artifacts TP_COLORAPP_MOD02;CIECAM02 diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index e77a4c57a..09c174462 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -1424,6 +1424,7 @@ ColorAppearanceParams::ColorAppearanceParams() : curveMode3(CtcMode::CHROMA), complexmethod("normal"), modelmethod("02"), + catmethod("clas"), surround("Average"), surrsrc("Average"), adapscen(2000.0), @@ -1474,6 +1475,7 @@ bool ColorAppearanceParams::operator ==(const ColorAppearanceParams& other) cons && curveMode3 == other.curveMode3 && complexmethod == other.complexmethod && modelmethod == other.modelmethod + && catmethod == other.catmethod && surround == other.surround && surrsrc == other.surrsrc && adapscen == other.adapscen @@ -5589,6 +5591,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->colorappearance.surround, "Color appearance", "Surround", colorappearance.surround, keyFile); saveToKeyfile(!pedited || pedited->colorappearance.complexmethod, "Color appearance", "complex", colorappearance.complexmethod, keyFile); saveToKeyfile(!pedited || pedited->colorappearance.modelmethod, "Color appearance", "ModelCat", colorappearance.modelmethod, keyFile); + saveToKeyfile(!pedited || pedited->colorappearance.catmethod, "Color appearance", "CatCat", colorappearance.catmethod, keyFile); saveToKeyfile(!pedited || pedited->colorappearance.surrsrc, "Color appearance", "Surrsrc", colorappearance.surrsrc, keyFile); saveToKeyfile(!pedited || pedited->colorappearance.adaplum, "Color appearance", "AdaptLum", colorappearance.adaplum, keyFile); saveToKeyfile(!pedited || pedited->colorappearance.badpixsl, "Color appearance", "Badpixsl", colorappearance.badpixsl, keyFile); @@ -7281,6 +7284,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) pedited->colorappearance.modelmethod = true; } } + assignFromKeyfile(keyFile, "Color appearance", "CatCat", pedited, colorappearance.catmethod, pedited->colorappearance.catmethod); assignFromKeyfile(keyFile, "Color appearance", "Surround", pedited, colorappearance.surround, pedited->colorappearance.surround); assignFromKeyfile(keyFile, "Color appearance", "Surrsrc", pedited, colorappearance.surrsrc, pedited->colorappearance.surrsrc); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 4efe4c2fc..15fb79702 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -674,6 +674,7 @@ struct ColorAppearanceParams { CtcMode curveMode3; Glib::ustring complexmethod; Glib::ustring modelmethod; + Glib::ustring catmethod; Glib::ustring surround; Glib::ustring surrsrc; diff --git a/rtgui/colorappearance.cc b/rtgui/colorappearance.cc index e2d49a6b4..968d3cc58 100644 --- a/rtgui/colorappearance.cc +++ b/rtgui/colorappearance.cc @@ -225,6 +225,7 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" EvCATillum = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_ILLUM"); EvCATcomplex = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_CATCOMPLEX"); EvCATmodel = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_CATMODEL"); + EvCATcat = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_CATCAT"); //preset button cat02/16 Gtk::Frame *genFrame; Gtk::VBox *genVBox; @@ -255,11 +256,23 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" modelHBox->pack_start(*modelLabel, Gtk::PACK_SHRINK, 4); modelHBox->pack_start(*modelmethod); genVBox->pack_start (*modelHBox, Gtk::PACK_SHRINK); + + catmethod = Gtk::manage (new MyComboBoxText ()); + catmethod->append(M("TP_COLORAPP_CATCLASSIC")); + catmethod->append(M("TP_COLORAPP_CATSYMGEN")); + catmethod->append(M("TP_COLORAPP_CATSYMSPE")); + catmethodconn = catmethod->signal_changed().connect(sigc::mem_fun(*this, &ColorAppearance::catmethodChanged)); + catmethod->set_tooltip_text(M("TP_COLORAPP_CATMET_TOOLTIP")); + Gtk::HBox* const catHBox = Gtk::manage(new Gtk::HBox()); + Gtk::Label* const catLabel = Gtk::manage(new Gtk::Label(M("TP_COLORAPP_CATMOD") + ":")); + catHBox->pack_start(*catLabel, Gtk::PACK_SHRINK, 4); + catHBox->pack_start(*catmethod); + genVBox->pack_start (*catHBox, Gtk::PACK_SHRINK); presetcat02 = Gtk::manage (new Gtk::CheckButton (M ("TP_COLORAPP_PRESETCAT02"))); presetcat02->set_tooltip_markup (M("TP_COLORAPP_PRESETCAT02_TIP")); presetcat02conn = presetcat02->signal_toggled().connect( sigc::mem_fun(*this, &ColorAppearance::presetcat02pressed)); - genVBox->pack_start (*presetcat02, Gtk::PACK_SHRINK); +// genVBox->pack_start (*presetcat02, Gtk::PACK_SHRINK); genFrame->add (*genVBox); pack_start (*genFrame, Gtk::PACK_EXPAND_WIDGET, 4); @@ -859,6 +872,7 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited) disableListener (); complexmethodconn.block(true); modelmethodconn.block(true); + catmethodconn.block(true); tcmodeconn.block (true); tcmode2conn.block (true); tcmode3conn.block (true); @@ -923,6 +937,9 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited) if (!pedited->colorappearance.modelmethod) { modelmethod->set_active_text(M("GENERAL_UNCHANGED")); } + if (!pedited->colorappearance.catmethod) { + catmethod->set_active_text(M("GENERAL_UNCHANGED")); + } if (!pedited->colorappearance.curveMode2) { toneCurveMode2->set_active (2); @@ -952,6 +969,16 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited) modelmethod->set_active(1); } + catmethod->set_active(0); + + if (pp->colorappearance.catmethod == "clas") { + catmethod->set_active(0); + } else if (pp->colorappearance.catmethod == "symg") { + catmethod->set_active(1); + } else if (pp->colorappearance.catmethod == "symc") { + catmethod->set_active(2); + } + surrsrcconn.block (true); if (pedited && !pedited->colorappearance.surrsrc) { @@ -1125,6 +1152,7 @@ void ColorAppearance::read (const ProcParams* pp, const ParamsEdited* pedited) tcmode3conn.block (false); tcmode2conn.block (false); tcmodeconn.block (false); + catmethodconn.block(false); modelmethodconn.block(false); complexmethodconn.block(false); enableListener (); @@ -1207,6 +1235,7 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited) if (pedited) { pedited->colorappearance.complexmethod = complexmethod->get_active_text() != M("GENERAL_UNCHANGED"); pedited->colorappearance.modelmethod = modelmethod->get_active_text() != M("GENERAL_UNCHANGED"); + pedited->colorappearance.catmethod = catmethod->get_active_text() != M("GENERAL_UNCHANGED"); pedited->colorappearance.degree = degree->getEditedState (); pedited->colorappearance.degreeout = degreeout->getEditedState (); pedited->colorappearance.adapscen = adapscen->getEditedState (); @@ -1266,6 +1295,13 @@ void ColorAppearance::write (ProcParams* pp, ParamsEdited* pedited) pp->colorappearance.modelmethod = "16"; } + if (catmethod->get_active_row_number() == 0) { + pp->colorappearance.catmethod = "clas"; + } else if (catmethod->get_active_row_number() == 1) { + pp->colorappearance.catmethod = "symg"; + } else if (catmethod->get_active_row_number() == 2) { + pp->colorappearance.catmethod = "symc"; + } if (surrsrc->get_active_row_number() == 0) { pp->colorappearance.surrsrc = "Average"; @@ -1366,6 +1402,10 @@ void ColorAppearance::convertParamToNormal() if (presetcat02->get_active ()) { wbmodel->set_active (2); } + if (catmethod->get_active_row_number() == 1 || catmethod->get_active_row_number() == 2) { + wbmodel->set_active (2); + } + greenout->setValue(def_params.greenout); badpixsl->setValue(def_params.badpixsl); @@ -1397,6 +1437,123 @@ void ColorAppearance::modelmethodChanged() } } +void ColorAppearance::catmethodChanged() +{ + + if (catmethod->get_active_row_number() == 1) { + disableListener(); + jlight->resetValue (false); + qbright->resetValue (false); + chroma->resetValue (false); + schroma->resetValue (false); + mchroma->resetValue (false); + rstprotection->resetValue (false); + contrast->resetValue (false); + qcontrast->resetValue (false); + colorh->resetValue (false); + tempout->resetValue (false); + greenout->resetValue (false); + ybout->resetValue (false); + tempsc->resetValue (false); + greensc->resetValue (false); + badpixsl->resetValue (false); + illum->set_active (2); + toneCurveMode->set_active (0); + toneCurveMode2->set_active (0); + toneCurveMode3->set_active (0); + shape->reset(); + shape2->reset(); + shape3->reset(); + gamutconn.block (true); + gamut->set_active (true); + gamutconn.block (false); + degree->setAutoValue (true); + degree->resetValue (false); + degree->setValue(90); + adapscen->resetValue (false); + adapscen->setAutoValue (true); + degreeout->resetValue (false); + degreeout->setAutoValue (true); + ybscen->resetValue (false); + ybscen->setAutoValue (true); + surrsrc->set_active (0); + wbmodel->set_active (2); + tempsc->resetValue (false); + greensc->resetValue (false); + adapscen->setValue(400.); + ybscen->setValue(18); + surround->set_active (0); + adaplum->setValue(400.); + degreeout->setValue(90); + ybout->setValue(18); + tempout->setValue (nexttemp); + +/* if(tempout->getAutoValue()) { + tempout->resetValue (false); + } else { + tempout->setValue (nexttemp); + tempout->setAutoValue (true); + } +*/ + greenout->setValue (nextgreen); + enableListener(); + + } else if (catmethod->get_active_row_number() == 0) { + disableListener(); + degree->setAutoValue (true); + degree->resetValue (false); + adapscen->resetValue (false); + adapscen->setAutoValue (true); + degreeout->resetValue (false); + degreeout->setAutoValue (true); + ybscen->resetValue (false); + ybscen->setAutoValue (true); + surrsrc->set_active (0); + wbmodel->set_active (0); + illum->set_active (2); + tempsc->resetValue (false); + greensc->resetValue (false); + adapscen->resetValue (false); + ybscen->resetValue (false); + surround->set_active (0); + adaplum->resetValue (false); + degreeout->resetValue (false); + ybout->resetValue (false); + tempout->resetValue (false); + greenout->resetValue (false); + enableListener(); + } else if (catmethod->get_active_row_number() == 2) { + disableListener(); + degree->setAutoValue (true); + degree->resetValue (false); + adapscen->resetValue (false); + adapscen->setAutoValue (true); + degreeout->resetValue (false); + degreeout->setAutoValue (true); + ybscen->resetValue (false); + ybscen->setAutoValue (true); + surrsrc->set_active (0); + wbmodel->set_active (2); + illum->set_active (2); + tempsc->resetValue (false); + greensc->resetValue (false); + adapscen->resetValue (false); + ybscen->resetValue (false); + surround->set_active (0); + adaplum->resetValue (false); + degreeout->resetValue (false); + ybout->resetValue (false); + // tempout->resetValue (false); + tempout->setValue (nexttemp); + greenout->resetValue (false); + enableListener(); + } + + if (listener && (multiImage || getEnabled())) { + listener->panelChanged(EvCATcat, catmethod->get_active_text()); + } +} + void ColorAppearance::curveChanged (CurveEditor* ce) { @@ -1548,7 +1705,7 @@ void ColorAppearance::badpix_toggled () { } */ -void ColorAppearance::presetcat02pressed () +void ColorAppearance::presetcat02pressed () //keep in case of... { if (presetcat02->get_active ()) { disableListener(); @@ -2275,6 +2432,7 @@ void ColorAppearance::setBatchMode (bool batchMode) complexmethod->append(M("GENERAL_UNCHANGED")); modelmethod->append(M("GENERAL_UNCHANGED")); + catmethod->append(M("GENERAL_UNCHANGED")); surround->append (M ("GENERAL_UNCHANGED")); surrsrc->append (M ("GENERAL_UNCHANGED")); wbmodel->append (M ("GENERAL_UNCHANGED")); diff --git a/rtgui/colorappearance.h b/rtgui/colorappearance.h index 194916cb0..07ca33b8e 100644 --- a/rtgui/colorappearance.h +++ b/rtgui/colorappearance.h @@ -79,6 +79,7 @@ public: void neutral_pressed (); void complexmethodChanged(); void modelmethodChanged(); + void catmethodChanged(); void convertParamToNormal(); void updateGUIToMode(int mode); @@ -110,6 +111,7 @@ private: rtengine::ProcEvent EvCATillum; rtengine::ProcEvent EvCATcomplex; rtengine::ProcEvent EvCATmodel; + rtengine::ProcEvent EvCATcat; bool bgTTipQuery (int x, int y, bool keyboard_tooltip, const Glib::RefPtr& tooltip); bool srTTipQuery (int x, int y, bool keyboard_tooltip, const Glib::RefPtr& tooltip); void foldAllButMe (GdkEventButton* event, MyExpander *expander); @@ -147,6 +149,7 @@ private: MyComboBoxText* toneCurveMode3; MyComboBoxText* complexmethod; MyComboBoxText* modelmethod; + MyComboBoxText* catmethod; //Adjuster* edge; Gtk::CheckButton* surrsource; @@ -173,7 +176,7 @@ private: sigc::connection surrconn; sigc::connection gamutconn, datacieconn, tonecieconn /*,badpixconn , sharpcieconn*/; sigc::connection tcmodeconn, tcmode2conn, tcmode3conn, neutralconn; - sigc::connection complexmethodconn, modelmethodconn; + sigc::connection complexmethodconn, modelmethodconn, catmethodconn; Gtk::HBox* alHBox; Gtk::HBox* wbmHBox; Gtk::HBox* illumHBox; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 42767391b..f1da3fca6 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -246,6 +246,7 @@ void ParamsEdited::set(bool v) colorappearance.curveMode3 = v; colorappearance.complexmethod = v; colorappearance.modelmethod = v; + colorappearance.catmethod = v; colorappearance.tempout = v; colorappearance.autotempout = v; colorappearance.greenout = v; @@ -918,6 +919,7 @@ void ParamsEdited::initFrom(const std::vector& colorappearance.curveMode3 = colorappearance.curveMode3 && p.colorappearance.curveMode3 == other.colorappearance.curveMode3; colorappearance.complexmethod = colorappearance.complexmethod && p.colorappearance.complexmethod == other.colorappearance.complexmethod; colorappearance.modelmethod = colorappearance.modelmethod && p.colorappearance.modelmethod == other.colorappearance.modelmethod; + colorappearance.catmethod = colorappearance.catmethod && p.colorappearance.catmethod == other.colorappearance.catmethod; colorappearance.tempout = colorappearance.tempout && p.colorappearance.tempout == other.colorappearance.tempout; colorappearance.autotempout = colorappearance.autotempout && p.colorappearance.autotempout == other.colorappearance.autotempout; colorappearance.greenout = colorappearance.greenout && p.colorappearance.greenout == other.colorappearance.greenout; @@ -2696,6 +2698,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.colorappearance.modelmethod = mods.colorappearance.modelmethod; } + if (colorappearance.catmethod) { + toEdit.colorappearance.catmethod = mods.colorappearance.catmethod; + } + if (colorappearance.enabled) { toEdit.colorappearance.enabled = mods.colorappearance.enabled; } diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 75893792a..f5e547fa5 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -268,6 +268,7 @@ struct ColorAppearanceParamsEdited { bool curveMode3; bool complexmethod; bool modelmethod; + bool catmethod; bool enabled; bool degree; bool autodegree; From 7a0d2dddc96437d44fd253cda4430f70ecdcfd96 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sun, 31 Jan 2021 14:09:41 +0100 Subject: [PATCH 075/129] Fix flat field correction for multiframe raw files --- rtengine/rawflatfield.cc | 2 +- rtengine/rawimagesource.cc | 4 ++-- rtengine/rawimagesource.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rtengine/rawflatfield.cc b/rtengine/rawflatfield.cc index cbc5e6bd6..22dbca852 100644 --- a/rtengine/rawflatfield.cc +++ b/rtengine/rawflatfield.cc @@ -263,7 +263,7 @@ void cfaboxblur(const float* const * riFlatFile, float* cfablur, int boxH, int b namespace rtengine { -void RawImageSource::processFlatField(const procparams::RAWParams &raw, const RawImage *riFlatFile, const float black[4]) +void RawImageSource::processFlatField(const procparams::RAWParams &raw, const RawImage *riFlatFile, array2D &rawData, const float black[4]) { // BENCHFUN std::unique_ptr cfablur(new float[H * W]); diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 689dddf20..de0f07422 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -2495,7 +2495,7 @@ void RawImageSource::copyOriginalPixels(const RAWParams &raw, RawImage *src, Raw if (riFlatFile && W == riFlatFile->get_width() && H == riFlatFile->get_height()) { - processFlatField(raw, riFlatFile, black); + processFlatField(raw, riFlatFile, rawData, black); } // flatfield } else if (ri->get_colors() == 1) { // Monochrome @@ -2517,7 +2517,7 @@ void RawImageSource::copyOriginalPixels(const RAWParams &raw, RawImage *src, Raw } } if (riFlatFile && W == riFlatFile->get_width() && H == riFlatFile->get_height()) { - processFlatField(raw, riFlatFile, black); + processFlatField(raw, riFlatFile, rawData, black); } // flatfield } else { // No bayer pattern diff --git a/rtengine/rawimagesource.h b/rtengine/rawimagesource.h index b463ea788..945c9da3d 100644 --- a/rtengine/rawimagesource.h +++ b/rtengine/rawimagesource.h @@ -137,7 +137,7 @@ public: return rgbSourceModified; // tracks whether cached rgb output of demosaic has been modified } - void processFlatField(const procparams::RAWParams &raw, const RawImage *riFlatFile, const float black[4]); + void processFlatField(const procparams::RAWParams &raw, const RawImage *riFlatFile, array2D &rawData, const float black[4]); void copyOriginalPixels(const procparams::RAWParams &raw, RawImage *ri, RawImage *riDark, RawImage *riFlatFile, array2D &rawData ); void scaleColors (int winx, int winy, int winw, int winh, const procparams::RAWParams &raw, array2D &rawData); // raw for cblack void WBauto(double &tempref, double &greenref, array2D &redloc, array2D &greenloc, array2D &blueloc, int bfw, int bfh, double &avg_rm, double &avg_gm, double &avg_bm, double &tempitc, double &greenitc, float &studgood, bool &twotimes, const procparams::WBParams & wbpar, int begx, int begy, int yEn, int xEn, int cx, int cy, const procparams::ColorManagementParams &cmp, const procparams::RAWParams &raw) override; From 408636141c8bc544d836ef144eb30eb570c0e157 Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Mon, 1 Feb 2021 10:22:38 +0100 Subject: [PATCH 076/129] Bumped date in license to 2021 --- LICENSE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.txt b/LICENSE.txt index 2ba8256ab..24b3ca2eb 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ RawTherapee - A powerful, cross-platform raw image processing program. Copyright (C) 2004-2012 Gabor Horvath - Copyright (C) 2010-2020 RawTherapee development team. + Copyright (C) 2010-2021 RawTherapee development team. RawTherapee is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by From cce2f5053e9582d6c4ceece01bf10357c1ef8480 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Tue, 2 Feb 2021 17:53:27 +0100 Subject: [PATCH 077/129] Colour propagation: reduce memory usage --- rtengine/hilite_recon.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rtengine/hilite_recon.cc b/rtengine/hilite_recon.cc index 331ea9db4..4902ad2c2 100644 --- a/rtengine/hilite_recon.cc +++ b/rtengine/hilite_recon.cc @@ -948,7 +948,6 @@ void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue array2D gbuf(W2, H2); array2D bbuf(W2, H2); array2D guide(W2, H2); - array2D Y(W2, H2); using rtengine::TMatrix; TMatrix ws = ICCStore::getInstance()->workingSpaceMatrix(params.icm.workingProfile); @@ -966,8 +965,7 @@ void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue #endif for (int y = 0; y < H2; ++y) { for (int x = 0; x < W2; ++x) { - Y[y][x] = rtengine::Color::rgbLuminance(static_cast(rbuf[y][x]), static_cast(gbuf[y][x]), static_cast(bbuf[y][x]), ws); - guide[y][x] = Color::igamma_srgb(Y[y][x]); + guide[y][x] = Color::igamma_srgb(Color::rgbLuminance(static_cast(rbuf[y][x]), static_cast(gbuf[y][x]), static_cast(bbuf[y][x]), ws)); } } } From 1640dfcea95134afab20a16e0621d800d0a5692c Mon Sep 17 00:00:00 2001 From: Pandagrapher Date: Wed, 3 Feb 2021 18:45:52 +0100 Subject: [PATCH 078/129] Avoid resetting spot shape when switching from Normal to Excluded spot --- rtgui/controlspotpanel.cc | 77 +++++++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 31 deletions(-) diff --git a/rtgui/controlspotpanel.cc b/rtgui/controlspotpanel.cc index 87f6985c7..99fa384ce 100644 --- a/rtgui/controlspotpanel.cc +++ b/rtgui/controlspotpanel.cc @@ -954,6 +954,7 @@ void ControlSpotPanel::spotMethodChanged() const auto iter = s->get_selected(); Gtk::TreeModel::Row row = *iter; + const int oldSpotMethod = row[spots_.spotMethod]; row[spots_.spotMethod] = spotMethod_->get_active_row_number(); // Update Control Spot GUI according to spotMethod_ combobox state (to be compliant with updateParamVisibility function) @@ -961,47 +962,61 @@ void ControlSpotPanel::spotMethodChanged() excluFrame->show(); } else if (spotMethod_->get_active_row_number() == 0) { // Normal case excluFrame->hide(); - locX_->setValue(150.); - adjusterChanged(locX_, 1.); - locXL_->setValue(150.); - adjusterChanged(locXL_, 1.); - locY_->setValue(150.); - adjusterChanged(locY_, 1.); - locYT_->setValue(150.); - adjusterChanged(locYT_, 1.); - shape_->set_active(0); - shapeChanged(); - transit_->setValue(60.); - adjusterChanged(transit_, 1.); + + // Reset spot shape only if previous spotMethod is Full image + if (oldSpotMethod == 2) { + disableParamlistener(true); + locX_->setValue(150.); + row[spots_.locX] = locX_->getIntValue(); + locXL_->setValue(150.); + row[spots_.locXL] = locXL_->getIntValue(); + locY_->setValue(150.); + row[spots_.locY] = locY_->getIntValue(); + locYT_->setValue(150.); + row[spots_.locYT] = locYT_->getIntValue(); + shape_->set_active(0); + row[spots_.shape] = shape_->get_active_row_number(); + transit_->setValue(60.); + row[spots_.transit] = transit_->getValue(); + disableParamlistener(false); + updateControlSpotCurve(row); + } } else if (spotMethod_->get_active_row_number() == 1) { // Excluding case excluFrame->show(); - locX_->setValue(150.); - adjusterChanged(locX_, 1.); - locXL_->setValue(150.); - adjusterChanged(locXL_, 1.); - locY_->setValue(150.); - adjusterChanged(locY_, 1.); - locYT_->setValue(150.); - adjusterChanged(locYT_, 1.); - shape_->set_active(0); - shapeChanged(); - transit_->setValue(60.); - adjusterChanged(transit_, 1.); + + // Reset spot shape only if previous spotMethod is Full image + if (oldSpotMethod == 2) { + disableParamlistener(true); + locX_->setValue(150.); + row[spots_.locX] = locX_->getIntValue(); + locXL_->setValue(150.); + row[spots_.locXL] = locXL_->getIntValue(); + locY_->setValue(150.); + row[spots_.locY] = locY_->getIntValue(); + locYT_->setValue(150.); + row[spots_.locYT] = locYT_->getIntValue(); + shape_->set_active(0); + row[spots_.shape] = shape_->get_active_row_number(); + transit_->setValue(60.); + row[spots_.transit] = transit_->getValue(); + disableParamlistener(false); + updateControlSpotCurve(row); + } } else if (spotMethod_->get_active_row_number() == 2) { // Full image case excluFrame->hide(); + locX_->setValue(3000.); - adjusterChanged(locX_, 1.); + row[spots_.locX] = locX_->getIntValue(); locXL_->setValue(3000.); - adjusterChanged(locXL_, 1.); + row[spots_.locXL] = locXL_->getIntValue(); locY_->setValue(3000.); - adjusterChanged(locY_, 1.); + row[spots_.locY] = locY_->getIntValue(); locYT_->setValue(3000.); - adjusterChanged(locYT_, 1.); + row[spots_.locYT] = locYT_->getIntValue(); shape_->set_active(1); - shapeChanged(); + row[spots_.shape] = shape_->get_active_row_number(); transit_->setValue(100.); - adjusterChanged(transit_, 1.); - + row[spots_.transit] = transit_->getValue(); } // Raise event From 1d98ff8ca49aab4d3b3daa85b2259e387ae9fe4b Mon Sep 17 00:00:00 2001 From: freddii Date: Fri, 5 Feb 2021 15:19:26 +0100 Subject: [PATCH 079/129] added german comment to rawtherapee.desktop.in (#6096) --- rtdata/rawtherapee.desktop.in | 1 + 1 file changed, 1 insertion(+) diff --git a/rtdata/rawtherapee.desktop.in b/rtdata/rawtherapee.desktop.in index 350afc45e..8db182587 100644 --- a/rtdata/rawtherapee.desktop.in +++ b/rtdata/rawtherapee.desktop.in @@ -8,6 +8,7 @@ GenericName[fr]=Éditeur d'images raw GenericName[pl]=Edytor zdjęć raw Comment=An advanced raw photo development program Comment[cs]=Program pro konverzi a zpracování digitálních raw fotografií +Comment[de]=Programm zur Konvertierung und Verarbeitung digitaler RAW-Fotos Comment[fr]=Logiciel de conversion et de traitement de photos numériques de format raw (but de capteur) Comment[pl]=Zaawansowany program do wywoływania zdjęć typu raw Icon=rawtherapee From 6ad419f189926c7ce290c1e38b954127d7329913 Mon Sep 17 00:00:00 2001 From: Desmis Date: Fri, 5 Feb 2021 16:24:43 +0100 Subject: [PATCH 080/129] Local adjustments - Denoise - improvments with Non Local means issue #6087 (#6091) * Improvment to denoise * Initialize nlmeans - thanks to Alberto and Ingo * Added 2 sliders max_patch and max_radius * Added Frame Non-local means * Improve GUI and tooltips - french * Change dfault detail - and comment code * Change label * Adapt English tooltip * Change GUI for NLmeans * Change order GUI denoise * Some changes to enable DCT - labels and tooltips * French labels tooltip * Change order combobox mode denoise - labels - tooltips * Change tooltip Denoise based on luminance mask * Change a tooltip * Removes unnecessary code * Nlmeans add gamma to preserve structure or reinforce denoise * Change gamma tooltip * Change tooltip Recovery denoise * Disabled nlmeans if skip > 5 * Change tooltip - size limit spot Nlmeans 150-150 * Change gamma Nlmeans * Supress display console * Speedup for gammalog and igammalog, #6087 * SSE code for (i)gammalog, #6087 Co-authored-by: Ingo Weyrich --- rtdata/languages/Francais | 19 +- rtdata/languages/default | 40 +++- rtengine/FTblockDN.cc | 1 + rtengine/improcfun.h | 7 + rtengine/iplocallab.cc | 440 +++++++++++++++++++++++++++++++++++++- rtengine/procevents.h | 5 + rtengine/procparams.cc | 20 ++ rtengine/procparams.h | 5 + rtengine/refreshmap.cc | 7 +- rtgui/locallabtools.cc | 144 +++++++++++-- rtgui/locallabtools.h | 7 +- rtgui/paramsedited.cc | 35 +++ rtgui/paramsedited.h | 5 + 13 files changed, 693 insertions(+), 42 deletions(-) diff --git a/rtdata/languages/Francais b/rtdata/languages/Francais index e9d891b8e..310dfcfd4 100644 --- a/rtdata/languages/Francais +++ b/rtdata/languages/Francais @@ -1878,7 +1878,7 @@ TP_LOCALLAB_DELTAD;Delta balance TP_LOCALLAB_DELTAEC;Masque ΔE Image TP_LOCALLAB_DENOIS;Ψ Réduction du bruit TP_LOCALLAB_DENOI_EXP;Réduction du bruit -TP_LOCALLAB_DENOIQUA_TOOLTIP;Conservatif préserve les fréquences basses, alors que agressif tend à les effacer +TP_LOCALLAB_DENOIQUA_TOOLTIP;Conservatif préserve les fréquences basses, alors que agressif tend à les effacer.\nConservatif et agressif utilisent les ondelletes et DCT et peuvent être utilisées en conjonction avec "débruitage par morceaux - luminance" TP_LOCALLAB_DENOIEQUAL_TOOLTIP;Equilibre l'action de denoise luminance entre les ombres et les lumières TP_LOCALLAB_DENOI1_EXP;De-bruite basé sur masque luminance TP_LOCALLAB_DENOI2_EXP;Récupération basée sur masque luminance @@ -2192,6 +2192,15 @@ TP_LOCALLAB_MRTHR;Image Originale TP_LOCALLAB_MRTWO;Short Curves 'L' Mask TP_LOCALLAB_MULTIPL_TOOLTIP;Autorise la retouche des tons sur une large plage : -18EV +4EV. Le remier curseur agit sur -18EV and -6EV. Le dernier curseur agit sur les tons au-dessus de 4EV TP_LOCALLAB_NEIGH;Rayon +TP_LOCALLAB_NLDENOISE_TOOLTIP;"Récupération des détails" agit sur un Laplacien pour privilégier l'action de denoise sur les aplats plutôt que sur les structures. +TP_LOCALLAB_NLDENOISENLPAT_TOOLTIP;Agir sur ce curseur pour adapter le niveau de débruitage à la taille des objets à traiter. +TP_LOCALLAB_NLDENOISENLRAD_TOOLTIP;Plus la valeur sera importante, plus le débruitage sera intense.\nMais cela a une forte incidence sur les temps de traitement. +TP_LOCALLAB_NLFRAME_TOOLTIP;"Débruitage par morceaux" réalise une moyenne de la totalité des valeurs des pixels contenus dans l'image, pondérées en fonction de leur similarité avec le résultat attendu (pixel cible).\nL'algoritme permet d’amoindrir la perte de détails au sein de l'image.\nSeul le bruit de luminance est pris en compte, le bruit de chrominance est traité de manière plus performante par le couple ondelettes / Fourier (DCT).\nPeut être utilisé en conjonction avec 'ondelettes' ou isolé.\nLa taille du RT-Spot doit être supérieure à 150x150 pixels (sortie TIF/JPG). +TP_LOCALLAB_NLFRA;Débruitage par morceaux - Luminance +TP_LOCALLAB_NLLUM;Force +TP_LOCALLAB_NLDET;Récupération des détails +TP_LOCALLAB_NLPAT;Taille maximum du morceau +TP_LOCALLAB_NLRAD;Taille maximum du rayon TP_LOCALLAB_NOISE_TOOLTIP;Ajoute du bruit de luminance TP_LOCALLAB_NOISECHROCOARSE;Chroma gros (Ond) TP_LOCALLAB_NOISECHROC_TOOLTIP;Si supérieur à zéro, algorithme haute qualité est activé.\nGros est sélectionné si curseur >=0.2 @@ -2211,7 +2220,7 @@ TP_LOCALLAB_OFFSETWAV;Décalage TP_LOCALLAB_OPACOL;Opacité TP_LOCALLAB_ORIGLC;Fusion seulement avec image originale TP_LOCALLAB_ORRETILAP_TOOLTIP;Agit sur un deuxième seuil Laplacien, pour prendre en compte ΔE pour différencier l'action nottament avec l'arrière plan (différent de Etendue) -TP_LOCALLAB_ORRETISTREN_TOOLTIP;Aagit sur un seuil Laplacien, plus grande est l'action, plus les différences de contraste seront réduites +TP_LOCALLAB_ORRETISTREN_TOOLTIP;Agit sur un seuil Laplacien, plus grande est l'action, plus les différences de contraste seront réduites TP_LOCALLAB_PASTELS2;Vibrance TP_LOCALLAB_PDE;Atténuation de Contraste - Compression dynamique TP_LOCALLAB_PDEFRA;Contraste atténuation ƒ @@ -2222,8 +2231,12 @@ TP_LOCALLAB_PREVSHOW;Montrer tous les réglages TP_LOCALLAB_PROXI;ΔE Affaiblissement TP_LOCALLAB_QUALCURV_METHOD;Types de Courbes TP_LOCALLAB_QUAL_METHOD;Qualité globale +TP_LOCALLAB_QUACONSER;Conservatif +TP_LOCALLAB_QUAAGRES;Aggressif +TP_LOCALLAB_QUANONEWAV;Débruitage par morceaux - luminance seulement +TP_LOCALLAB_QUANONEALL;Rien TP_LOCALLAB_RADIUS;Rayon -TP_LOCALLAB_RADIUS_TOOLTIP;Above Radius 30 Use Fast Fourier Transform +TP_LOCALLAB_RADIUS_TOOLTIP;Au-dessus de Rayon 30 Utilise 'Fast Fourier Transform' TP_LOCALLAB_RADMASKCOL;Rayon adoucir TP_LOCALLAB_RECT;Rectangle TP_LOCALLAB_RECURS;Réferences Récursives diff --git a/rtdata/languages/default b/rtdata/languages/default index dd57d7106..6b83c3c81 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1278,6 +1278,11 @@ HISTORY_MSG_1030;Local - reti recovery threshold HISTORY_MSG_1031;Local - reti threshold mask low HISTORY_MSG_1032;Local - reti threshold mask high HISTORY_MSG_1033;Local - reti decay +HISTORY_MSG_1034;Local - Nlmeans - strength +HISTORY_MSG_1035;Local - Nlmeans - detail +HISTORY_MSG_1036;Local - Nlmeans - patch +HISTORY_MSG_1037;Local - Nlmeans - radius +HISTORY_MSG_1038;Local - Nlmeans - gamma HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance @@ -2244,7 +2249,7 @@ TP_DIRPYRDENOISE_MAIN_GAMMA_TOOLTIP;Gamma varies noise reduction strength across TP_DIRPYRDENOISE_MAIN_MODE;Mode TP_DIRPYRDENOISE_MAIN_MODE_AGGRESSIVE;Aggressive TP_DIRPYRDENOISE_MAIN_MODE_CONSERVATIVE;Conservative -TP_DIRPYRDENOISE_MAIN_MODE_TOOLTIP;"Conservative" preserves low frequency chroma patterns, while "aggressive" obliterates them. +TP_DIRPYRDENOISE_MAIN_MODE_TOOLTIP;Conservative preserves low frequency chroma patterns, while aggressive obliterates them. TP_DIRPYRDENOISE_MEDIAN_METHOD;Median method TP_DIRPYRDENOISE_MEDIAN_METHOD_CHROMINANCE;Chroma only TP_DIRPYRDENOISE_MEDIAN_METHOD_LAB;L*a*b* @@ -2606,11 +2611,11 @@ TP_LOCALLAB_DENOIEQUAL_TOOLTIP;Allows you to carry out more or less noise reduct TP_LOCALLAB_DENOI1_EXP;Denoise based on luminance mask TP_LOCALLAB_DENOI2_EXP;Recovery based on luminance mask TP_LOCALLAB_DENOILUMDETAIL_TOOLTIP;Allows you to recover luminance detail by progressively applying a Fourier transform (DCT). -TP_LOCALLAB_DENOIQUA_TOOLTIP;Conservative mode preserves low frequency detail. “Aggressive” mode removes low frequency detail. +TP_LOCALLAB_DENOIQUA_TOOLTIP;Conservative mode preserves low frequency detail. Aggressive mode removes low frequency detail.\nConservative and Aggressive use wavelets and DCT, can be used in conjunction with "Non-local Means - Luminance". TP_LOCALLAB_DENOIS;Ψ Denoise TP_LOCALLAB_DENOITHR_TOOLTIP;Adjusts edge detection to help reduce noise in uniform, low-contrast areas. TP_LOCALLAB_DENOI_EXP;Denoise -TP_LOCALLAB_DENOI_TOOLTIP;This module can be used for noise reduction either on its own (at the end of the processing pipeline) or in addition to the Noise Reduction module in the Detail tab (which works at the beginning of the pipeline).\n Scope allows you to differentiate the action based on color (deltaE).\n\n You can refine the result with a "Median filter" or a "Guided Filter" (Soft radius). +TP_LOCALLAB_DENOI_TOOLTIP;This module can be used for noise reduction either on its own (at the end of the processing pipeline) or in addition to the Noise Reduction module in the Detail tab (which works at the beginning of the pipeline).\n Scope allows you to differentiate the action based on color (deltaE). TP_LOCALLAB_DEPTH;Depth TP_LOCALLAB_DETAIL;Local contrast TP_LOCALLAB_DETAILFRA;Edge detection @@ -2819,9 +2824,9 @@ TP_LOCALLAB_MASKCURVE_TOOLTIP;The 3 curves are set to 1 (maximum) by default:\nC TP_LOCALLAB_MASKDDECAY;Decay strength TP_LOCALLAB_MASKDECAY_TOOLTIP;Manages the rate of decay for the gray levels in the mask.\n Decay = 1 linear, Decay > 1 sharper parabolic transitions, Decay < 1 more gradual transitions TP_LOCALLAB_MASKH;Hue curve -TP_LOCALLAB_MASKLC_TOOLTIP;This allows you to target the denoise based on the image luminance information contained in the L(L) or LC(H) mask (Mask and Modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n if the mask is very dark - below the threshold 'dark' - denoise will be increased if reinforce > 1.\n if the mask is clear - above the threshold 'light' - denoise will be progressively cancelled.\n between the two, denoise will be maintained at the settings without mask. -TP_LOCALLAB_MASKDE_TOOLTIP;Used to direct the Denoise based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n If the mask is below the ‘dark’ threshold, then the Denoise will be applied progressively.\n if the mask is above the ‘light’ threshold, then the Denoise will be applied progressively.\n Between the two, the image settings without the Denoise will be maintained, unless you act on the sliders "Gray area luminance denoise" or "Gray area chrominance denoise". -TP_LOCALLAB_MASKGF_TOOLTIP;Used to direct the Guided Filter based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n If the mask is below the ‘dark’ threshold, then the GF will be applied progressively.\n if the mask is above the ‘light’ threshold, then the GF will be applied progressively.\n Between the two, the image settings without the GF will be maintained. +TP_LOCALLAB_MASKLC_TOOLTIP;This allows you to target the denoise based on the image luminance information contained in the L(L) or LC(H) mask (Mask and Modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n 'Dark area luminance threshold'. If 'Reinforce denoise in dark and light areas' > 1 the denoise is progressively increased from 0% at the threshold settings to 100% at the maximum black value (determined by mask).\n 'Light area luminance threshold' .The denoise is progressively decreased from 100% at the threshold setting to 0% at the maximum white value (determined by mask).\n In the area between the two thresholds, the denoise settings are not affected by the mask. +TP_LOCALLAB_MASKDE_TOOLTIP;Used to target the denoise as a function of the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n If the mask is below the ‘dark’ threshold, then the Denoise will be applied progressively.\n if the mask is above the ‘light’ threshold, then the Denoise will be applied progressively.\n Between the two, the image settings without the Denoise will be maintained, unless you adjust the sliders "Gray area luminance denoise" or "Gray area chrominance denoise". +TP_LOCALLAB_MASKGF_TOOLTIP;Used to target the Guided Filter as a function of the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n If the mask is below the ‘dark’ threshold, then the GF will be applied progressively.\n if the mask is above the ‘light’ threshold, then the GF will be applied progressively.\n Between the two, the image settings without the GF will be maintained. TP_LOCALLAB_MASKRECOL_TOOLTIP;Used to modulate the effect of the Color and Light settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Color and Light settings \n In between these two areas, the full value of the Color and Light settings will be applied TP_LOCALLAB_MASKREEXP_TOOLTIP;Used to modulate the effect of the 'Dynamic range and Exposure' settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the 'Dynamic range and Exposure' settings \n In between these two areas, the full value of the 'Dynamic range and Exposure' settings will be applied TP_LOCALLAB_MASKRESH_TOOLTIP;Used to modulate the effect of the Shadows Highlights settings based on the image luminance information contained in the L(L) or LC(H) masks (Mask and modifications).\n The L(L) mask or the LC(H) mask must be enabled to use this function.\n The ‘dark’ and ‘light’ areas below the dark threshold and above the light threshold will be restored progressively to their original values prior to being modified by the Shadows Highlights settings \n In between these two areas, the full value of the Shadows Highlights settings will be applied @@ -2917,6 +2922,17 @@ TP_LOCALLAB_MRTHR;Original Image TP_LOCALLAB_MRTWO;Short Curves 'L' Mask TP_LOCALLAB_MULTIPL_TOOLTIP;Wide-range tone adjustment: -18EV to +4EV. The first slider acts on very dark tones between -18EV and -6EV. The last slider acts on light tones up to 4EV TP_LOCALLAB_NEIGH;Radius +TP_LOCALLAB_NLDENOISE_TOOLTIP;“Detail recovery” acts on a Laplacian transform to target uniform areas rather than areas with detail. +TP_LOCALLAB_NLDENOISENLPAT_TOOLTIP;Use this slider to adapt the amount of denoise to the size of the objects to be processed. +TP_LOCALLAB_NLDENOISENLRAD_TOOLTIP;Higher values increase denoise at the expense of processing time. +TP_LOCALLAB_NLDENOISENLGAM_TOOLTIP;Lower values preserve details and texture, higher values increase denoise. +TP_LOCALLAB_NLFRA;Non-local Means - Luminance +TP_LOCALLAB_NLFRAME_TOOLTIP;Non-local means denoising takes a mean of all pixels in the image, weighted by how similar they are to the target pixel.\nReduces loss of detail compared with local mean algorithms.\nOnly luminance noise is taken into account. Chrominance noise is best processed using wavelets and Fourier transforms (DCT).\nCan be used in conjunction with 'Luminance denoise by level' or on its own.\nRT-Spot size must be greater than 150x150 pixels (Output). +TP_LOCALLAB_NLLUM;Strength +TP_LOCALLAB_NLDET;Detail recovery +TP_LOCALLAB_NLGAM;Gamma +TP_LOCALLAB_NLPAT;Maximum patch size +TP_LOCALLAB_NLRAD;Maximum radius size TP_LOCALLAB_NOISECHROCOARSE;Coarse chroma (Wav) TP_LOCALLAB_NOISECHROC_TOOLTIP;If superior to zero, high quality algorithm is enabled.\nCoarse is for slider >=0.02 TP_LOCALLAB_NOISECHRODETAIL;Chroma detail recovery (DCT ƒ) @@ -2948,6 +2964,10 @@ TP_LOCALLAB_PREVSHOW;Show additional settings TP_LOCALLAB_PROXI;ΔE decay TP_LOCALLAB_QUALCURV_METHOD;Curve type TP_LOCALLAB_QUAL_METHOD;Global quality +TP_LOCALLAB_QUACONSER;Conservative +TP_LOCALLAB_QUAAGRES;Aggressive +TP_LOCALLAB_QUANONEWAV;Non-local means only +TP_LOCALLAB_QUANONEALL;Off TP_LOCALLAB_RADIUS;Radius TP_LOCALLAB_RADIUS_TOOLTIP;Uses a Fast Fourier Transform for radius > 30 TP_LOCALLAB_RADMASKCOL;Smooth radius @@ -3130,7 +3150,7 @@ TP_LOCALLAB_VIS_TOOLTIP;Click to show/hide selected Control Spot.\nCtr TP_LOCALLAB_WAMASKCOL;Ψ Mask Wavelet level TP_LOCALLAB_WARM;Warm/Cool & Color artifacts TP_LOCALLAB_WARM_TOOLTIP;This slider uses the CIECAM algorithm and acts as a White Balance control to make the color temperature of the selected area warmer or cooler.\nIt can also reduce color artifacts in some cases. -TP_LOCALLAB_WASDEN_TOOLTIP;Luminance noise reduction: the left-hand side of the curve including the 'separation point' corresponds to the first 3 levels 0, 1, 2 (fine detail). The right hand side of the curve corresponds to the coarser details (level 3, 4, 5, 6). +TP_LOCALLAB_WASDEN_TOOLTIP;Luminance noise reduction: the left-hand side of the curve including the dark-gray/light-gray boundary corresponds to the first 3 levels 0, 1, 2 (fine detail). The right hand side of the curve corresponds to the coarser details (level 3, 4, 5, 6). TP_LOCALLAB_WAT_BALTHRES_TOOLTIP;Balances the action within each level. TP_LOCALLAB_WAT_BLURLC_TOOLTIP;The default blur setting affects all 3 L*a* b* components (luminance and colour).\nWhen checked, only luminance is blurred. TP_LOCALLAB_WAT_CLARIC_TOOLTIP;“Merge chroma” is used to select the intensity of the desired effect on chrominance. @@ -3689,7 +3709,7 @@ TP_WAVELET_MIXNOISE;Noise TP_WAVELET_NEUTRAL;Neutral TP_WAVELET_NOIS;Denoise TP_WAVELET_NOISE;Denoise and Refine -TP_WAVELET_NOISE_TOOLTIP;If level 4 luminance denoise superior to 50, mode Agressive is used.\nIf chrominance coarse superior to 20, mode Agressive is used. +TP_WAVELET_NOISE_TOOLTIP;If level 4 luminance denoise superior to 50, mode Aggressive is used.\nIf chrominance coarse superior to 20, mode Aggressive is used. TP_WAVELET_NPHIGH;High TP_WAVELET_NPLOW;Low TP_WAVELET_NPNONE;None @@ -3704,8 +3724,8 @@ TP_WAVELET_OPACITYWL_TOOLTIP;Modify the final local contrast at the end of the w TP_WAVELET_PASTEL;Pastel chroma TP_WAVELET_PROC;Process TP_WAVELET_PROTAB;Protection -TP_WAVELET_QUAAGRES;Agressive -TP_WAVELET_QUANONE;None +TP_WAVELET_QUAAGRES;Aggressive +TP_WAVELET_QUANONE;Off TP_WAVELET_QUACONSER;Conservative TP_WAVELET_RADIUS;Radius shadows - highlight TP_WAVELET_RANGEAB;Range a and b % diff --git a/rtengine/FTblockDN.cc b/rtengine/FTblockDN.cc index 66f12b668..474196843 100644 --- a/rtengine/FTblockDN.cc +++ b/rtengine/FTblockDN.cc @@ -436,6 +436,7 @@ void ImProcFunctions::Median_Denoise(float **src, float **dst, float upperBound, } + void ImProcFunctions::Tile_calc(int tilesize, int overlap, int kall, int imwidth, int imheight, int &numtiles_W, int &numtiles_H, int &tilewidth, int &tileheight, int &tileWskip, int &tileHskip) { diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 4436c2f1e..4c656fd9f 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -136,6 +136,11 @@ public: TYPE_7X7, TYPE_9X9 }; +enum class BlurType { + OFF, + BOX, + GAUSS +}; double lumimul[3]; @@ -252,6 +257,8 @@ public: float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope, float balance, float balanceh); void discrete_laplacian_threshold(float * data_out, const float * data_in, size_t nx, size_t ny, float t); void laplacian(const array2D &src, array2D &dst, int bfw, int bfh, float threshold, float ceiling, float factor, bool multiThread); + void detail_mask(const array2D &src, array2D &mask, int bfw, int bfh, float scaling, float threshold, float ceiling, float factor, BlurType blur_type, float blur, bool multithread); + void NLMeans(float **img, int strength, int detail_thresh, int patch, int radius, float gam, int bfw, int bfh, float scale, bool multithread); void rex_poisson_dct(float * data, size_t nx, size_t ny, double m); void mean_dt(const float * data, size_t size, double& mean_p, double& dt_p); diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 6e6ab0a1b..01fc1a9f4 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -50,7 +50,7 @@ #include "StopWatch.h" #include "guidedfilter.h" #include "boxblur.h" - +#include "rescale.h" #pragma GCC diagnostic warning "-Wall" #pragma GCC diagnostic warning "-Wextra" @@ -391,6 +391,29 @@ void SobelCannyLuma(float **sobelL, float **luma, int bfw, int bfh, float radius } } +float igammalog(float x, float p, float s, float g2, float g4) +{ + return x <= g2 ? x / s : pow_F((x + g4) / (1.f + g4), p);//continuous +} + +#ifdef __SSE2__ +vfloat igammalog(vfloat x, vfloat p, vfloat s, vfloat g2, vfloat g4) +{ + return x <= g2 ? x / s : pow_F((x + g4) / (1.f + g4), p);//continuous +} +#endif + +float gammalog(float x, float p, float s, float g3, float g4) +{ + return x <= g3 ? x * s : (1.f + g4) * xexpf(xlogf(x) / p) - g4;//continuous +} + +#ifdef __SSE2__ +vfloat gammalog(vfloat x, vfloat p, vfloat s, vfloat g3, vfloat g4) +{ + return x <= g3 ? x * s : (1.f + g4) * xexpf(xlogf(x) / p) - g4;//continuous +} +#endif } namespace rtengine @@ -627,6 +650,11 @@ struct local_params { int noiselequal; float noisechrodetail; float bilat; + int nlstr; + int nldet; + int nlpat; + int nlrad; + float nlgam; float noiselc; float noiselc4; float noiselc5; @@ -880,13 +908,19 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.chromet = 2; } + + + if (locallab.spots.at(sp).quamethod == "cons") { lp.quamet = 0; } else if (locallab.spots.at(sp).quamethod == "agre") { lp.quamet = 1; - } else if (locallab.spots.at(sp).quamethod == "none") { + } else if (locallab.spots.at(sp).quamethod == "nlmean") { lp.quamet = 2; + } else if (locallab.spots.at(sp).quamethod == "none") { + lp.quamet = 3; } +// printf("lpqualmet=%i\n", lp.quamet); if (locallab.spots.at(sp).shMethod == "std") { lp.shmeth = 0; @@ -1543,6 +1577,11 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.noisecc = local_noisecc; lp.sensden = local_sensiden; lp.bilat = locallab.spots.at(sp).bilateral; + lp.nldet = locallab.spots.at(sp).nldet; + lp.nlstr = locallab.spots.at(sp).nlstr; + lp.nlpat = locallab.spots.at(sp).nlpat; + lp.nlrad = locallab.spots.at(sp).nlrad; + lp.nlgam = locallab.spots.at(sp).nlgam; lp.adjch = (float) locallab.spots.at(sp).adjblur; lp.strengt = streng; lp.gamm = gam; @@ -3512,6 +3551,8 @@ void ImProcFunctions::InverseReti_Local(const struct local_params & lp, const fl } } + + void ImProcFunctions::InverseBlurNoise_Local(LabImage * originalmask, const struct local_params & lp, const float hueref, const float chromaref, const float lumaref, LabImage * original, LabImage * transformed, const LabImage * const tmp1, int cx, int cy, int sk) { // BENCHFUN @@ -8961,7 +9002,7 @@ void ImProcFunctions::fftw_denoise(int sk, int GW, int GH, int max_numblox_W, in void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * slidb, int aut, bool noiscfactiv, const struct local_params & lp, LabImage * originalmaskbl, LabImage * bufmaskblurbl, int levred, float huerefblur, float lumarefblur, float chromarefblur, LabImage * original, LabImage * transformed, int cx, int cy, int sk, const LocwavCurve& locwavCurvehue, bool locwavhueutili) { - + BENCHFUN //local denoise //all these variables are to prevent use of denoise when non necessary // but with qualmet = 2 (default for best quality) we must denoise chroma with little values to prevent artifacts due to variations of Hue @@ -8971,9 +9012,16 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl bool execdenoi = noiscfactiv && ((lp.colorena && execcolor) || (lp.tonemapena && lp.strengt != 0.f) || (lp.cbdlena && execbdl) || (lp.sfena && lp.strng > 0.f) || (lp.lcena && lp.lcamount > 0.f) || (lp.sharpena && lp.shrad > 0.42) || (lp.retiena && lp.str > 0.f) || (lp.exposena && lp.expcomp != 0.f) || (lp.expvib && lp.past != 0.f)); bool execmaskden = (lp.showmaskblmet == 2 || lp.enablMask || lp.showmaskblmet == 3 || lp.showmaskblmet == 4) && lp.smasktyp != 0; - if (((lp.noiself > 0.f || lp.noiself0 > 0.f || lp.noiself2 > 0.f || lp.wavcurvedenoi || lp.noiselc > 0.f || lp.noisecf > 0.f || lp.noisecc > 0.f + const int ys = rtengine::max(static_cast(lp.yc - lp.lyT) - cy, 0); + const int ye = rtengine::min(static_cast(lp.yc + lp.ly) - cy, original->H); + const int xs = rtengine::max(static_cast(lp.xc - lp.lxL) - cx, 0); + const int xe = rtengine::min(static_cast(lp.xc + lp.lx) - cx, original->W); + const int hspot = ye - ys; + const int wspot = xe - xs; + + if (((lp.noiself > 0.f || lp.noiself0 > 0.f || lp.noiself2 > 0.f || lp.nlstr > 0 || lp.wavcurvedenoi || lp.noiselc > 0.f || lp.noisecf > 0.f || lp.noisecc > 0.f // || lp.showmaskblmet == 2 || lp.enablMask || lp.showmaskblmet == 3 || lp.showmaskblmet == 4 || aut == 1 || aut == 2) && lp.denoiena) || execdenoi) { // sk == 1 ?? - || execmaskden || aut == 1 || aut == 2) && lp.denoiena && lp.quamet != 2) || execdenoi) { // sk == 1 ?? + || execmaskden || aut == 1 || aut == 2) && lp.denoiena && lp.quamet != 3) || execdenoi) { // sk == 1 ?? StopWatch Stop1("locallab Denoise called"); @@ -9221,7 +9269,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if ((lp.quamet == 0 && aut == 0) || (mxsl < 1.f && (aut == 1 || aut == 2))) { WaveletDenoiseAllL(Ldecomp, noisevarlum, madL, vari, edge, numThreads); - } else { + } else if (lp.quamet == 1){ WaveletDenoiseAll_BiShrinkL(Ldecomp, noisevarlum, madL, vari, edge, numThreads); @@ -9512,7 +9560,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if ((lp.quamet == 0 && aut == 0) || (maxccoarse < 0.1f && (aut == 1 || aut == 2))) { WaveletDenoiseAllAB(Ldecomp, adecomp, noisevarchrom, madL, variC, edge, noisevarab_r, true, false, false, numThreads); WaveletDenoiseAllAB(Ldecomp, bdecomp, noisevarchrom, madL, variCb, edge, noisevarab_r, true, false, false, numThreads); - } else { + } else if (lp.quamet == 1){ WaveletDenoiseAll_BiShrinkAB(Ldecomp, adecomp, noisevarchrom, madL, variC, edge, noisevarab_r, true, false, false, numThreads); WaveletDenoiseAllAB(Ldecomp, adecomp, noisevarchrom, madL, variC, edge, noisevarab_r, true, false, false, numThreads); @@ -9540,7 +9588,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } if (!Ldecomp.memory_allocation_failed() && aut == 0) { - if ((lp.noiself >= 0.01f || lp.noiself0 >= 0.01f || lp.noiself2 >= 0.01f || lp.wavcurvedenoi || lp.noiselc >= 0.01f) && levred == 7 && lp.noiseldetail != 100.f && lp.quamet != 2) { + if ((lp.noiself >= 0.01f || lp.noiself0 >= 0.01f || lp.noiself2 >= 0.01f || lp.wavcurvedenoi || lp.noiselc >= 0.01f) && levred == 7 && lp.noiseldetail != 100.f && lp.quamet < 2) { fftw_denoise(sk, GW, GH, max_numblox_W, min_numblox_W, tmp1.L, Lin, numThreads, lp, 0); } } @@ -9590,6 +9638,9 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } + if(lp.nlstr > 0 && (hspot > 150 && wspot > 150)) { + NLMeans(tmp1.L, lp.nlstr, lp.nldet, lp.nlpat, lp.nlrad, lp.nlgam, GW, GH, float (sk), multiThread); + } if(lp.smasktyp != 0) { if(lp.enablMask && lp.recothrd != 1.f && lp.smasktyp != 0) { LabImage tmp3(GW, GH); @@ -9915,7 +9966,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if ((lp.quamet == 0 && aut == 0) || (mxsl < 1.f && (aut == 1 || aut == 2))) { WaveletDenoiseAllL(Ldecomp, noisevarlum, madL, vari, edge, numThreads); - } else { + } else if (lp.quamet == 1) { WaveletDenoiseAll_BiShrinkL(Ldecomp, noisevarlum, madL, vari, edge, numThreads); WaveletDenoiseAllL(Ldecomp, noisevarlum, madL, vari, edge, numThreads); } @@ -10203,7 +10254,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if ((lp.quamet == 0 && aut == 0) || (maxccoarse < 0.1f && (aut == 1 || aut == 2))) { WaveletDenoiseAllAB(Ldecomp, adecomp, noisevarchrom, madL, variC, edge, noisevarab_r, true, false, false, numThreads); WaveletDenoiseAllAB(Ldecomp, bdecomp, noisevarchrom, madL, variCb, edge, noisevarab_r, true, false, false, numThreads); - } else { + } else if (lp.quamet == 1){ WaveletDenoiseAll_BiShrinkAB(Ldecomp, adecomp, noisevarchrom, madL, variC, edge, noisevarab_r, true, false, false, numThreads); WaveletDenoiseAllAB(Ldecomp, adecomp, noisevarchrom, madL, variC, edge, noisevarab_r, true, false, false, numThreads); @@ -10234,7 +10285,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if (!Ldecomp.memory_allocation_failed() && aut == 0) { - if ((lp.noiself >= 0.01f || lp.noiself0 >= 0.01f || lp.noiself2 >= 0.01f || lp.wavcurvedenoi || lp.noiselc >= 0.01f) && levred == 7 && lp.noiseldetail != 100.f && lp.quamet != 2) { + if ((lp.noiself >= 0.01f || lp.noiself0 >= 0.01f || lp.noiself2 >= 0.01f || lp.wavcurvedenoi || lp.noiselc >= 0.01f) && levred == 7 && lp.noiseldetail != 100.f && lp.quamet < 2) { fftw_denoise(sk, bfw, bfh, max_numblox_W, min_numblox_W, bufwv.L, Lin, numThreads, lp, 0); } } @@ -10281,6 +10332,12 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } } + + if(lp.nlstr > 0) { + NLMeans(bufwv.L, lp.nlstr, lp.nldet, lp.nlpat, lp.nlrad, lp.nlgam, bfw, bfh, 1.f, multiThread); + } + + if (lp.smasktyp != 0) { if(lp.enablMask && lp.recothrd != 1.f && lp.smasktyp != 0) { LabImage tmp3(bfw, bfh); @@ -10776,7 +10833,368 @@ void maskrecov(const LabImage * bufcolfin, LabImage * original, LabImage * bufma masklum.free(); } +//thanks to Alberto Griggio +void ImProcFunctions::detail_mask(const array2D &src, array2D &mask, int bfw, int bfh, float scaling, float threshold, float ceiling, float factor, BlurType blur_type, float blur, bool multithread) +{ + const int W = bfw; + const int H = bfh; + mask(W, H); + array2D L2(W/4, H/4);//ARRAY2D_ALIGNED); + array2D m2(W/4, H/4);//ARRAY2D_ALIGNED) + rescaleBilinear(src, L2, multithread); +#ifdef _OPENMP +# pragma omp parallel for if (multithread) +#endif + for (int y = 0; y < H/4; ++y) { + for (int x = 0; x < W/4; ++x) { + L2[y][x] = xlin2log(L2[y][x]/scaling, 50.f); + } + } + + laplacian(L2, m2, W / 4, H / 4, threshold/scaling, ceiling/scaling, factor, multithread); + + rescaleBilinear(m2, mask, multithread); + + const auto scurve = + [](float x) -> float + { + constexpr float b = 101.f; + constexpr float a = 2.23f; + return xlin2log(pow_F(x, a), b); + }; + + const float thr = 1.f - factor; +#ifdef _OPENMP +# pragma omp parallel for if (multithread) +#endif + + for (int y = 0; y < H; ++y) { + for (int x = 0; x < W; ++x) { + mask[y][x] = scurve(LIM01(mask[y][x] + thr)); + } + } + + if (blur_type == BlurType::GAUSS) { + +#ifdef _OPENMP +# pragma omp parallel if (multithread) +#endif + { + gaussianBlur(mask, mask, W, H, blur); + } + } else if (blur_type == BlurType::BOX) { + if (int(blur) > 0) { + for (int i = 0; i < 3; ++i) { + boxblur(static_cast(mask), static_cast(mask), blur, W, H, multithread); + } + } + } + +} + +// basic idea taken from Algorithm 3 in the paper: +// "Parameter-Free Fast Pixelwise Non-Local Means Denoising" http://www.ipol.im/pub/art/2014/120/ +// by Jacques Froment + +// thanks to Alberto Griggio for this wonderful code +// thanks to Ingo Weyrich for many speedup suggestions! +// adapted to Rawtherapee Local adjustments J.Desmis january 2021 +// + +void ImProcFunctions::NLMeans(float **img, int strength, int detail_thresh, int patch, int radius, float gam, int bfw, int bfh, float scale, bool multithread) +{ + if (!strength) { + return; + } + // printf("Scale=%f\n", scale); + if(scale > 5.f) {//avoid to small values - leads to crash - but enough to evaluate noise + return; + } + if(bfh < 150 || bfw < 150) { + return; + } + + BENCHFUN + const int W = bfw; + const int H = bfh; + float gamma = gam; + rtengine::GammaValues g_a; //gamma parameters + double pwr = 1.0 / gam;//default 3.0 - gamma Lab + double ts = 9.03296;//always the same 'slope' in the extrem shadows - slope Lab + rtengine::Color::calcGamma(pwr, ts, g_a); // call to calcGamma with selected gamma and slope + + //first change Lab L to pseudo linear with gamma = 3.f slope 9.032...and in range 0...65536, or with gamma slope Lab + +#ifdef _OPENMP +# pragma omp parallel for schedule(dynamic,16) if (multithread) +#endif + for (int y = 0; y < H; ++y) { + int x = 0; +#ifdef __SSE2__ + for (; x < W - 3; x += 4) { + STVFU(img[y][x], F2V(65536.f) * igammalog(LVFU(img[y][x]) / F2V(32768.f), F2V(gamma), F2V(ts), F2V(g_a[2]), F2V(g_a[4]))); + } +#endif + for (;x < W; ++x) { + img[y][x] = 65536.f * igammalog(img[y][x] / 32768.f, gamma, ts, g_a[2], g_a[4]); + } + } + + // these two can be changed if needed. increasing max_patch_radius doesn't + // affect performance, whereas max_search_radius *really* does + // (the complexity is O(max_search_radius^2 * W * H)) +// constexpr int max_patch_radius = 2; +// constexpr int max_search_radius = 5; + int max_patch_radius = patch; + int max_search_radius = radius; + + const int search_radius = int(std::ceil(float(max_search_radius) / scale)); + const int patch_radius = int(std::ceil(float(max_patch_radius) / scale)); + + // the strength parameter controls the scaling of the weights + // (called h^2 in the papers) + float eps = 1e-6f;//to avoid too low values and divide near by zero...when scale > 1 + const float h2 = eps + SQR(std::pow(float(strength) / 100.f, 0.9f) / 30.f / scale); +// printf("h2=%f\n", h2); + // this is the main difference between our version and more conventional + // nl-means implementations: instead of varying the patch size, we control + // the detail preservation by using a varying weight scaling for the + // pixels, depending on our estimate of how much details there are in the + // pixel neighborhood. We do this by computing a "detail mask", using a + // laplacian filter with additional averaging and smoothing. The + // detail_thresh parameter controls the degree of detail preservation: the + // (averaged, smoothed) laplacian is first normalized to [0,1], and then + // modified by compression and offseting depending on the detail_thresh + // parameter, i.e. mask[y][x] = mask[y][x] * (1 - f) + f, + // where f = detail_thresh / 100 + float amount = LIM(float(detail_thresh)/100.f, 0.f, 0.99f); + array2D mask(W, H);// ARRAY2D_ALIGNED); + + { + array2D LL(W, H, img, ARRAY2D_BYREFERENCE); + ImProcFunctions::detail_mask(LL, mask, W, H, 1.f, 1e-3f, 1.f, amount, BlurType::GAUSS, 2.f / scale, multithread); + + } + +//allocate dst - same type of datas as img + float** dst; + int wid = W; + int hei = H; + dst = new float*[hei]; + for (int i = 0; i < hei; ++i) { + dst[i] = new float[wid]; + } + const int border = search_radius + patch_radius; + const int WW = W + border * 2; + const int HH = H + border * 2; + + array2D src(WW, HH);//, ARRAY2D_ALIGNED); + +#ifdef _OPENMP +# pragma omp parallel for if (multithread) +#endif + for (int y = 0; y < HH; ++y) { + int yy = y <= border ? 0 : y >= H ? H-1 : y - border; + for (int x = 0; x < WW; ++x) { + int xx = x <= border ? 0 : x >= W ? W-1 : x - border; + float Y = img[yy][xx] / 65536.f; + src[y][x] = Y; + } + } + +#ifdef _OPENMP +# pragma omp parallel for if (multithread) +#endif + for (int y = 0; y < H; ++y) { + for (int x = 0; x < W; ++x) { + dst[y][x] = 0.f; + } + } + + constexpr int lutsz = 8192; + constexpr float lutfactor = 100.f / float(lutsz-1); + LUTf explut(lutsz); + for (int i = 0; i < lutsz; ++i) { + float x = float(i) * lutfactor; + explut[i] = xexpf(-x); + } + +#ifdef _OPENMP +# pragma omp parallel for if (multithread) +#endif + for (int y = 0; y < H; ++y) { + for (int x = 0; x < W; ++x) { + mask[y][x] = (1.f / (mask[y][x] * h2)) / lutfactor; + } + } + + // process by tiles to avoid numerical accuracy errors in the computation + // of the integral image + const int tile_size = 150; + const int ntiles_x = int(std::ceil(float(WW) / (tile_size-2*border))); + const int ntiles_y = int(std::ceil(float(HH) / (tile_size-2*border))); + const int ntiles = ntiles_x * ntiles_y; + +#ifdef __SSE2__ + const vfloat zerov = F2V(0.0); + const vfloat v1e_5f = F2V(1e-5f); + const vfloat v65536f = F2V(65536.f); +#endif + +#ifdef _OPENMP +# pragma omp parallel if (multithread) +#endif + { + +#ifdef __SSE2__ + // flush denormals to zero to avoid performance penalty + const auto oldMode = _MM_GET_FLUSH_ZERO_MODE(); + _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON); +#endif + +#ifdef _OPENMP +# pragma omp for schedule(dynamic, 2) +#endif + for (int tile = 0; tile < ntiles; ++tile) { + const int tile_y = tile / ntiles_x; + const int tile_x = tile % ntiles_x; + + const int start_y = tile_y * (tile_size - 2*border); + const int end_y = std::min(start_y + tile_size, HH); + const int TH = end_y - start_y; + + const int start_x = tile_x * (tile_size - 2*border); + const int end_x = std::min(start_x + tile_size, WW); + const int TW = end_x - start_x; + + const auto Y = [=](int y) -> int { return LIM(y+start_y, 0, HH-1); }; + const auto X = [=](int x) -> int { return LIM(x+start_x, 0, WW-1); }; + + const auto score = + [&](int tx, int ty, int zx, int zy) -> float + { + return SQR(src[Y(zy)][X(zx)] - src[Y(zy + ty)][X(zx + tx)]); + }; + + array2D St(TW, TH);//, ARRAY2D_ALIGNED); + array2D SW(TW, TH, ARRAY2D_CLEAR_DATA);//, ARRAY2D_ALIGNED|ARRAY2D_CLEAR_DATA); + + for (int ty = -search_radius; ty <= search_radius; ++ty) { + for (int tx = -search_radius; tx <= search_radius; ++tx) { + // Step 1 — Compute the integral image St + St[0][0] = 0.f; + for (int xx = 1; xx < TW; ++xx) { + St[0][xx] = St[0][xx-1] + score(tx, ty, xx, 0); + } + for (int yy = 1; yy < TH; ++yy) { + St[yy][0] = St[yy-1][0] + score(tx, ty, 0, yy); + } + for (int yy = 1; yy < TH; ++yy) { + for (int xx = 1; xx < TW; ++xx) { + // operation grouping tuned for performance (empirically) + St[yy][xx] = (St[yy][xx-1] + St[yy-1][xx]) - (St[yy-1][xx-1] - score(tx, ty, xx, yy)); + } + } + // Step 2 — Compute weight and estimate for patches + // V(x), V(y) with y = x + t + for (int yy = start_y+border; yy < end_y-border; ++yy) { + int y = yy - border; + int xx = start_x+border; +#ifdef __SSE2__ + for (; xx < end_x-border-3; xx += 4) { + int x = xx - border; + int sx = xx + tx; + int sy = yy + ty; + + int sty = yy - start_y; + int stx = xx - start_x; + + vfloat dist2 = LVFU(St[sty + patch_radius][stx + patch_radius]) + LVFU(St[sty - patch_radius][stx - patch_radius]) - LVFU(St[sty + patch_radius][stx - patch_radius]) - LVFU(St[sty - patch_radius][stx + patch_radius]); + dist2 = vmaxf(dist2, zerov); + vfloat d = dist2 * LVFU(mask[y][x]); + vfloat weight = explut[d]; + STVFU(SW[y-start_y][x-start_x], LVFU(SW[y-start_y][x-start_x]) + weight); + vfloat Y = weight * LVFU(src[sy][sx]); + STVFU(dst[y][x], LVFU(dst[y][x]) + Y); + } +#endif + for (; xx < end_x-border; ++xx) { + int x = xx - border; + int sx = xx + tx; + int sy = yy + ty; + + int sty = yy - start_y; + int stx = xx - start_x; + + float dist2 = St[sty + patch_radius][stx + patch_radius] + St[sty - patch_radius][stx - patch_radius] - St[sty + patch_radius][stx - patch_radius] - St[sty - patch_radius][stx + patch_radius]; + dist2 = std::max(dist2, 0.f); + float d = dist2 * mask[y][x]; + float weight = explut[d]; + SW[y-start_y][x-start_x] += weight; + float Y = weight * src[sy][sx]; + dst[y][x] += Y; + + assert(!xisinff(dst[y][x])); + assert(!xisnanf(dst[y][x])); + } + } + } + } +// printf("E\n"); + + // Compute final estimate at pixel x = (x1, x2) + for (int yy = start_y+border; yy < end_y-border; ++yy) { + int y = yy - border; + int xx = start_x+border; +#ifdef __SSE2__ + for (; xx < end_x-border-3; xx += 4) { + int x = xx - border; + + const vfloat Y = LVFU(dst[y][x]); + const vfloat f = (v1e_5f + LVFU(SW[y-start_y][x-start_x])); + STVFU(dst[y][x], (Y / f) * v65536f); + } +#endif + for (; xx < end_x-border; ++xx) { + int x = xx - border; + + const float Y = dst[y][x]; + const float f = (1e-5f + SW[y-start_y][x-start_x]); + dst[y][x] = (Y / f) * 65536.f; + + assert(!xisnanf(dst[y][x])); + } + } + } + +#ifdef __SSE2__ + _MM_SET_FLUSH_ZERO_MODE(oldMode); +#endif + + } // omp parallel + +#ifdef _OPENMP +# pragma omp parallel for schedule(dynamic,16) if (multithread) +#endif + for (int y = 0; y < H; ++y) {//apply inverse gamma 3.f and put result in range 32768.f + int x = 0; +#ifdef __SSE2__ + for (; x < W - 3; x += 4) { + STVFU(img[y][x], F2V(32768.f) * gammalog(LVFU(dst[y][x]) / F2V(65536.f), F2V(gamma), F2V(ts), F2V(g_a[3]), F2V(g_a[4]))); + } +#endif + for (; x < W; ++x) { + img[y][x] = 32768.f * gammalog(dst[y][x] / 65536.f, gamma, ts, g_a[3], g_a[4]); + } + } + + for (int i = 0; i < hei; ++i) { + delete[] dst[i]; + } + delete[] dst; + +} void ImProcFunctions::Lab_Local( int call, int sp, float** shbuffer, LabImage * original, LabImage * transformed, LabImage * reserved, LabImage * lastorig, int cx, int cy, int oW, int oH, int sk, diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 00f2d1916..62dff74e3 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -1056,6 +1056,11 @@ enum ProcEventCode { Evlocallablowthresr = 1030, Evlocallabhigthresr = 1031, Evlocallabdecayr = 1032, + Evlocallabnlstr = 1033, + Evlocallabnldet = 1034, + Evlocallabnlpat = 1035, + Evlocallabnlrad = 1036, + Evlocallabnlgam = 1037, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 09c174462..0bbcaa907 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3352,6 +3352,11 @@ LocallabParams::LocallabSpot::LocallabSpot() : noisechrodetail(50.), adjblur(0), bilateral(0), + nlstr(0), + nldet(50), + nlpat(2), + nlrad(5), + nlgam(3.), sensiden(60), detailthr(50), locwavcurveden{ @@ -4443,6 +4448,11 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && noisechrodetail == other.noisechrodetail && adjblur == other.adjblur && bilateral == other.bilateral + && nlstr == other.nlstr + && nldet == other.nldet + && nlpat == other.nlpat + && nlrad == other.nlrad + && nlgam == other.nlgam && sensiden == other.sensiden && detailthr == other.detailthr && locwavcurveden == other.locwavcurveden @@ -6077,6 +6087,11 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->noisechrodetail, "Locallab", "noisechrodetail_" + index_str, spot.noisechrodetail, keyFile); saveToKeyfile(!pedited || spot_edited->adjblur, "Locallab", "Adjblur_" + index_str, spot.adjblur, keyFile); saveToKeyfile(!pedited || spot_edited->bilateral, "Locallab", "Bilateral_" + index_str, spot.bilateral, keyFile); + saveToKeyfile(!pedited || spot_edited->nlstr, "Locallab", "Nlstr_" + index_str, spot.nlstr, keyFile); + saveToKeyfile(!pedited || spot_edited->nldet, "Locallab", "Nldet_" + index_str, spot.nldet, keyFile); + saveToKeyfile(!pedited || spot_edited->nlpat, "Locallab", "Nlpat_" + index_str, spot.nlpat, keyFile); + saveToKeyfile(!pedited || spot_edited->nlrad, "Locallab", "Nlrad_" + index_str, spot.nlrad, keyFile); + saveToKeyfile(!pedited || spot_edited->nlgam, "Locallab", "Nlgam_" + index_str, spot.nlgam, keyFile); saveToKeyfile(!pedited || spot_edited->sensiden, "Locallab", "Sensiden_" + index_str, spot.sensiden, keyFile); saveToKeyfile(!pedited || spot_edited->detailthr, "Locallab", "Detailthr_" + index_str, spot.detailthr, keyFile); saveToKeyfile(!pedited || spot_edited->locwavcurveden, "Locallab", "LocwavCurveden_" + index_str, spot.locwavcurveden, keyFile); @@ -7927,6 +7942,11 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "noisechrodetail_" + index_str, pedited, spot.noisechrodetail, spotEdited.noisechrodetail); assignFromKeyfile(keyFile, "Locallab", "Adjblur_" + index_str, pedited, spot.adjblur, spotEdited.adjblur); assignFromKeyfile(keyFile, "Locallab", "Bilateral_" + index_str, pedited, spot.bilateral, spotEdited.bilateral); + assignFromKeyfile(keyFile, "Locallab", "Nlstr_" + index_str, pedited, spot.nlstr, spotEdited.nlstr); + assignFromKeyfile(keyFile, "Locallab", "Nldet_" + index_str, pedited, spot.nldet, spotEdited.nldet); + assignFromKeyfile(keyFile, "Locallab", "Nlpat_" + index_str, pedited, spot.nlpat, spotEdited.nlpat); + assignFromKeyfile(keyFile, "Locallab", "Nlrad_" + index_str, pedited, spot.nlrad, spotEdited.nlrad); + assignFromKeyfile(keyFile, "Locallab", "Nlgam_" + index_str, pedited, spot.nlgam, spotEdited.nlgam); assignFromKeyfile(keyFile, "Locallab", "Sensiden_" + index_str, pedited, spot.sensiden, spotEdited.sensiden); assignFromKeyfile(keyFile, "Locallab", "Detailthr_" + index_str, pedited, spot.detailthr, spotEdited.detailthr); assignFromKeyfile(keyFile, "Locallab", "LocwavCurveden_" + index_str, pedited, spot.locwavcurveden, spotEdited.locwavcurveden); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 15fb79702..45ce8005d 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1258,6 +1258,11 @@ struct LocallabParams { double noisechrodetail; int adjblur; int bilateral; + int nlstr; + int nldet; + int nlpat; + int nlrad; + double nlgam; int sensiden; int detailthr; std::vector locwavcurveden; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 742aa3707..ad16b881d 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -1059,7 +1059,12 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabrecothrer LUMINANCECURVE, // Evlocallablowthresr LUMINANCECURVE, // Evlocallabhigthresr - LUMINANCECURVE // Evlocallabdecayr + LUMINANCECURVE, // Evlocallabdecayr + LUMINANCECURVE, // Evlocallabnlstr + LUMINANCECURVE, // Evlocallabnldet + LUMINANCECURVE, // Evlocallabnlpat + LUMINANCECURVE, // Evlocallabnlrad + LUMINANCECURVE // Evlocallabnlgam }; diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 41b75f17f..ce582b592 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -6258,6 +6258,12 @@ LocallabBlur::LocallabBlur(): decayd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKDDECAY"), 0.5, 4., 0.1, 2.))), invmaskd(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVMASK")))), invmask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVMASK")))), + nlFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_NLFRA")))), + nlstr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NLLUM"), 0, 100, 1, 0))), + nldet(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NLDET"), 0, 100, 1, 50))), + nlpat(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NLPAT"), 1, 5, 1, 2))), + nlrad(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NLRAD"), 3, 10, 1, 5))), + nlgam(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NLGAM"), 2., 5., 0.1, 3.))), bilateral(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BILATERAL"), 0, 100, 1, 0))), sensiden(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 60))), neutral(Gtk::manage (new Gtk::Button (M ("TP_RETINEX_NEUTRAL")))), @@ -6363,9 +6369,10 @@ LocallabBlur::LocallabBlur(): setExpandAlignProperties(expdenoise, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); - quamethod->append(M("TP_WAVELET_QUACONSER")); - quamethod->append(M("TP_WAVELET_QUAAGRES")); - quamethod->append(M("TP_WAVELET_QUANONE")); + quamethod->append(M("TP_LOCALLAB_QUANONEALL")); + quamethod->append(M("TP_LOCALLAB_QUACONSER")); + quamethod->append(M("TP_LOCALLAB_QUAAGRES")); + quamethod->append(M("TP_LOCALLAB_QUANONEWAV")); quamethodconn = quamethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabBlur::quamethodChanged)); Gtk::Label* const quaLabel = Gtk::manage(new Gtk::Label(M("TP_WAVELET_DENQUA") + ":")); quaHBox->pack_start(*quaLabel, Gtk::PACK_SHRINK, 4); @@ -6429,6 +6436,13 @@ LocallabBlur::LocallabBlur(): decayd->setAdjusterListener(this); bilateral->setAdjusterListener(this); + nlFrame->set_label_align(0.025, 0.5); + + nlstr->setAdjusterListener(this); + nldet->setAdjusterListener(this); + nlpat->setAdjusterListener(this); + nlrad->setAdjusterListener(this); + nlgam->setAdjusterListener(this); sensiden->setAdjusterListener(this); @@ -6566,17 +6580,28 @@ LocallabBlur::LocallabBlur(): wavBox1->pack_start(*levelthr, Gtk::PACK_SHRINK, 0); expdenoise1->add(*wavBox1, false); wavBox->pack_start(*expdenoise1); - wavBox->pack_start(*noisechrof); - wavBox->pack_start(*noisechroc); - wavBox->pack_start(*noisechrodetail); - wavBox->pack_start(*adjblur); ToolParamBlock* const detailBox = Gtk::manage(new ToolParamBlock()); detailBox->pack_start(*detailthr); detailBox->pack_start(*usemask, Gtk::PACK_SHRINK, 0); detailFrame->add(*detailBox); wavBox->pack_start(*detailFrame); + + ToolParamBlock* const nlbox = Gtk::manage(new ToolParamBlock()); + nlbox->pack_start(*nlstr); + nlbox->pack_start(*nldet); + nlbox->pack_start(*nlgam); + nlbox->pack_start(*nlpat); + nlbox->pack_start(*nlrad); + nlFrame->add(*nlbox); + wavBox->pack_start(*nlFrame); + + wavBox->pack_start(*noisechrof); + wavBox->pack_start(*noisechroc); + wavBox->pack_start(*noisechrodetail); + wavBox->pack_start(*adjblur); wavFrame->add(*wavBox); denoisebox->pack_start(*wavFrame); + ToolParamBlock* const wavBox3 = Gtk::manage(new ToolParamBlock()); wavBox3->pack_start(*maskusable3, Gtk::PACK_SHRINK, 0); wavBox3->pack_start(*maskunusable3, Gtk::PACK_SHRINK, 0); @@ -6683,6 +6708,12 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) detailthr->set_tooltip_text(M("TP_LOCALLAB_DENOITHR_TOOLTIP")); adjblur->set_tooltip_text(M("TP_LOCALLAB_DENOIEQUALCHRO_TOOLTIP")); bilateral->set_tooltip_text(M("TP_LOCALLAB_DENOIBILAT_TOOLTIP")); + nlFrame->set_tooltip_text(M("TP_LOCALLAB_NLFRAME_TOOLTIP")); + nlstr->set_tooltip_text(M("TP_LOCALLAB_NLDENOISE_TOOLTIP")); + nldet->set_tooltip_text(M("TP_LOCALLAB_NLDENOISE_TOOLTIP")); + nlpat->set_tooltip_text(M("TP_LOCALLAB_NLDENOISENLPAT_TOOLTIP")); + nlrad->set_tooltip_text(M("TP_LOCALLAB_NLDENOISENLRAD_TOOLTIP")); + nlgam->set_tooltip_text(M("TP_LOCALLAB_NLDENOISENLGAM_TOOLTIP")); noiselumc->set_tooltip_text(M("TP_LOCALLAB_NOISECHROC_TOOLTIP")); expmaskbl->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); showmaskblMethodtyp->set_tooltip_markup(M("TP_LOCALLAB_SHOWMASKTYP_TOOLTIP")); @@ -6742,6 +6773,12 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips) detailthr->set_tooltip_text(""); adjblur->set_tooltip_text(""); bilateral->set_tooltip_text(""); + nlFrame->set_tooltip_text(""); + nlstr->set_tooltip_text(""); + nldet->set_tooltip_text(""); + nlpat->set_tooltip_text(""); + nlrad->set_tooltip_text(""); + nlgam->set_tooltip_text(""); sensibn->set_tooltip_text(""); blurMethod->set_tooltip_markup(""); expdenoise->set_tooltip_markup(""); @@ -6793,8 +6830,13 @@ void LocallabBlur::neutral_pressed () detailthr->setValue(defSpot.detailthr);; adjblur->setValue(defSpot.adjblur); bilateral->setValue(defSpot.bilateral); + nlstr->setValue(defSpot.nlstr); + nldet->setValue(defSpot.nldet); + nlpat->setValue(defSpot.nlpat); + nlrad->setValue(defSpot.nlrad); + nlgam->setValue(defSpot.nlgam); sensiden->setValue(defSpot.sensiden); - quamethod->set_active (2); + quamethod->set_active (0); wavshapeden->setCurve(defSpot.locwavcurveden); wavhue->setCurve(defSpot.locwavcurvehue); usemask->set_active(defSpot.usemask); @@ -6942,12 +6984,14 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params chroMethod->set_active(2); } - if (spot.quamethod == "cons") { + if (spot.quamethod == "none") { quamethod->set_active(0); - } else if (spot.quamethod == "agre") { + } else if (spot.quamethod == "cons") { quamethod->set_active(1); - } else if (spot.quamethod == "none") { + } else if (spot.quamethod == "agre") { quamethod->set_active(2); + } else if (spot.quamethod == "nlmean") { + quamethod->set_active(3); } activlum->set_active(spot.activlum); @@ -6968,6 +7012,11 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params detailthr->setValue((double)spot.detailthr); adjblur->setValue((double)spot.adjblur); bilateral->setValue((double)spot.bilateral); + nlstr->setValue((double)spot.nlstr); + nldet->setValue((double)spot.nldet); + nlpat->setValue((double)spot.nlpat); + nlrad->setValue((double)spot.nlrad); + nlgam->setValue((double)spot.nlgam); sensiden->setValue((double)spot.sensiden); if (spot.showmaskblMethodtyp == "blur") { @@ -7081,11 +7130,13 @@ void LocallabBlur::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped } if (quamethod->get_active_row_number() == 0) { - spot.quamethod = "cons"; - } else if (quamethod->get_active_row_number() == 1) { - spot.quamethod = "agre"; - } else if (quamethod->get_active_row_number() == 2) { spot.quamethod = "none"; + } else if (quamethod->get_active_row_number() == 1) { + spot.quamethod = "cons"; + } else if (quamethod->get_active_row_number() == 2) { + spot.quamethod = "agre"; + } else if (quamethod->get_active_row_number() == 3) { + spot.quamethod = "nlmean"; } spot.activlum = activlum->get_active(); @@ -7107,6 +7158,11 @@ void LocallabBlur::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.adjblur = adjblur->getIntValue(); spot.bilateral = bilateral->getIntValue(); spot.sensiden = sensiden->getIntValue(); + spot.nlstr = nlstr->getIntValue(); + spot.nldet = nldet->getIntValue(); + spot.nlpat = nlpat->getIntValue(); + spot.nlrad = nlrad->getIntValue(); + spot.nlgam = nlgam->getValue(); if (showmaskblMethodtyp->get_active_row_number() == 0) { spot.showmaskblMethodtyp = "blur"; @@ -7181,6 +7237,11 @@ void LocallabBlur::setDefaults(const rtengine::procparams::ProcParams* defParams detailthr->setDefault((double)defSpot.detailthr); adjblur->setDefault((double)defSpot.adjblur); bilateral->setDefault((double)defSpot.bilateral); + nlstr->setDefault((double)defSpot.nlstr); + nldet->setDefault((double)defSpot.nldet); + nlpat->setDefault((double)defSpot.nlpat); + nlrad->setDefault((double)defSpot.nlrad); + nlgam->setDefault(defSpot.nlgam); sensiden->setDefault((double)defSpot.sensiden); strumaskbl->setDefault(defSpot.strumaskbl); blendmaskbl->setDefault((double)defSpot.blendmaskbl); @@ -7455,6 +7516,41 @@ void LocallabBlur::adjusterChanged(Adjuster* a, double newval) } } + if (a == nlstr) { + if (listener) { + listener->panelChanged(Evlocallabnlstr, + nlstr->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == nldet) { + if (listener) { + listener->panelChanged(Evlocallabnldet, + nldet->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == nlpat) { + if (listener) { + listener->panelChanged(Evlocallabnlpat, + nlpat->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == nlrad) { + if (listener) { + listener->panelChanged(Evlocallabnlrad, + nlrad->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + + if (a == nlgam) { + if (listener) { + listener->panelChanged(Evlocallabnlgam, + nlgam->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + if (a == sensiden) { if (listener) { listener->panelChanged(Evlocallabsensiden, @@ -7628,7 +7724,8 @@ void LocallabBlur::convertParamToNormal() LLmaskblshapewav->setCurve(defSpot.LLmaskblcurvewav); csThresholdblur->setValue(defSpot.csthresholdblur); lnoiselow->setValue(defSpot.lnoiselow); - + nlrad->setValue(defSpot.nlrad); + // Enable all listeners enableListener(); } @@ -7680,6 +7777,10 @@ void LocallabBlur::convertParamToSimple() higthres->setValue(defSpot.higthres); adjblur->setValue(defSpot.adjblur); noisechrodetail->setValue(defSpot.noisechrodetail); + nlpat->setValue(defSpot.nlpat); + nlrad->setValue(defSpot.nlrad); + nlgam->setValue(defSpot.nlgam); + // Enable all listeners enableListener(); } @@ -7706,6 +7807,9 @@ void LocallabBlur::updateGUIToMode(const modeType new_type) adjblur->hide(); noisechrodetail->hide(); usemask->hide(); + nlpat->hide(); + nlrad->hide(); + nlgam->hide(); break; case Normal: @@ -7726,6 +7830,10 @@ void LocallabBlur::updateGUIToMode(const modeType new_type) adjblur->show(); noisechrodetail->show(); usemask->show(); + nlpat->show(); + nlrad->hide(); + nlgam->show(); + if (blMethod->get_active_row_number() == 2) { expdenoise2->show(); } @@ -7799,6 +7907,10 @@ void LocallabBlur::updateGUIToMode(const modeType new_type) shadmaskblsha->show(); mask2blCurveEditorGwav->show(); csThresholdblur->show(); + nlpat->show(); + nlrad->show(); + nlgam->show(); + if(lnoiselow->getValue()!= 1.) { if (showmaskblMethodtyp->get_active_row_number() == 0) { showmaskblMethodtyp->set_active(2); diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index d8fb1ab29..6319cf1af 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -732,7 +732,12 @@ private: Gtk::CheckButton* const invmaskd; Gtk::CheckButton* const invmask; - + Gtk::Frame* const nlFrame; + Adjuster* const nlstr; + Adjuster* const nldet; + Adjuster* const nlpat; + Adjuster* const nlrad; + Adjuster* const nlgam; Adjuster* const bilateral; Adjuster* const sensiden; Gtk::Button* neutral; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index f1da3fca6..d202577cf 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1330,6 +1330,11 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).noisechrodetail = locallab.spots.at(j).noisechrodetail && pSpot.noisechrodetail == otherSpot.noisechrodetail; locallab.spots.at(j).adjblur = locallab.spots.at(j).adjblur && pSpot.adjblur == otherSpot.adjblur; locallab.spots.at(j).bilateral = locallab.spots.at(j).bilateral && pSpot.bilateral == otherSpot.bilateral; + locallab.spots.at(j).nlstr = locallab.spots.at(j).nlstr && pSpot.nlstr == otherSpot.nlstr; + locallab.spots.at(j).nldet = locallab.spots.at(j).nldet && pSpot.nldet == otherSpot.nldet; + locallab.spots.at(j).nlpat = locallab.spots.at(j).nlpat && pSpot.nlpat == otherSpot.nlpat; + locallab.spots.at(j).nlrad = locallab.spots.at(j).nlrad && pSpot.nlrad == otherSpot.nlrad; + locallab.spots.at(j).nlgam = locallab.spots.at(j).nlgam && pSpot.nlgam == otherSpot.nlgam; locallab.spots.at(j).sensiden = locallab.spots.at(j).sensiden && pSpot.sensiden == otherSpot.sensiden; locallab.spots.at(j).detailthr = locallab.spots.at(j).detailthr && pSpot.detailthr == otherSpot.detailthr; locallab.spots.at(j).locwavcurveden = locallab.spots.at(j).locwavcurveden && pSpot.locwavcurveden == otherSpot.locwavcurveden; @@ -4285,6 +4290,26 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).bilateral = mods.locallab.spots.at(i).bilateral; } + if (locallab.spots.at(i).nlstr) { + toEdit.locallab.spots.at(i).nlstr = mods.locallab.spots.at(i).nlstr; + } + + if (locallab.spots.at(i).nldet) { + toEdit.locallab.spots.at(i).nldet = mods.locallab.spots.at(i).nldet; + } + + if (locallab.spots.at(i).nlpat) { + toEdit.locallab.spots.at(i).nlpat = mods.locallab.spots.at(i).nlpat; + } + + if (locallab.spots.at(i).nlrad) { + toEdit.locallab.spots.at(i).nlrad = mods.locallab.spots.at(i).nlrad; + } + + if (locallab.spots.at(i).nlgam) { + toEdit.locallab.spots.at(i).nlgam = mods.locallab.spots.at(i).nlgam; + } + if (locallab.spots.at(i).sensiden) { toEdit.locallab.spots.at(i).sensiden = mods.locallab.spots.at(i).sensiden; } @@ -6873,6 +6898,11 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : noisechrodetail(v), adjblur(v), bilateral(v), + nlstr(v), + nldet(v), + nlpat(v), + nlrad(v), + nlgam(v), sensiden(v), detailthr(v), locwavcurveden(v), @@ -7439,6 +7469,11 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) noisechrodetail = v; adjblur = v; bilateral = v; + nlstr = v; + nldet = v; + nlpat = v; + nlrad = v; + nlgam = v; sensiden = v; detailthr = v; locwavcurveden = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index f5e547fa5..3b524c23f 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -666,6 +666,11 @@ public: bool noisechrodetail; bool adjblur; bool bilateral; + bool nlstr; + bool nldet; + bool nlpat; + bool nlrad; + bool nlgam; bool sensiden; bool detailthr; bool locwavcurveden; From 3a6f91e9965bba8ca183f6805189da9b9ecbc3e7 Mon Sep 17 00:00:00 2001 From: Thanatomanic <6567747+Thanatomanic@users.noreply.github.com> Date: Sat, 6 Feb 2021 08:54:24 +0100 Subject: [PATCH 081/129] Updated issue templates. More compact. --- .github/ISSUE_TEMPLATE/bug_report.md | 18 +++++++++--------- .../camera-support---color-calibration.md | 4 ++-- .github/ISSUE_TEMPLATE/camera-support.md | 10 ---------- .../feature-request---enhancements.md | 6 +++--- 4 files changed, 14 insertions(+), 24 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/camera-support.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index d6d418f42..fb9105078 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -8,32 +8,32 @@ assignees: '' --- **Short description** - + **Steps to reproduce** - **Expected behavior** - + **Additional information** - +Requests without providing the necessary information will be deleted. --> diff --git a/.github/ISSUE_TEMPLATE/camera-support.md b/.github/ISSUE_TEMPLATE/camera-support.md deleted file mode 100644 index 6d694f0a9..000000000 --- a/.github/ISSUE_TEMPLATE/camera-support.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -name: Camera support -about: Report new file formats or requests for color calibration support here -title: '' -labels: '' -assignees: '' - ---- - - - + From d369efb0456f54f8c83fa301db86a44b809ea779 Mon Sep 17 00:00:00 2001 From: Desmis Date: Sun, 7 Feb 2021 07:47:30 +0100 Subject: [PATCH 082/129] Local adjustments - Placement of LA in the processing order - issue #6069 (#6080) * LA change location in pipeline * Improvment to events * Second improvment events * Another change events * Change all events TRANSFORM to HDR * Change in Log encoding for exposure now after * Small change in Log encoding for calculation Black Ev and White Ev * Change events for log encoding * Add M_INIT | M_LINDENOISE | M_HDR to dcrop.cc * Avoid unnecessary convertion from rgb to lab and back if local adjustments are not used, #6069 * Tooltip preview dE - disabled when BW * Fixed issue 6092 - preview dE when BW is enabled Co-authored-by: Ingo Weyrich --- rtdata/languages/default | 4 +- rtengine/dcrop.cc | 585 +++++++-------- rtengine/improccoordinator.cc | 512 ++++++------- rtengine/iplocallab.cc | 16 +- rtengine/refreshmap.cc | 1296 ++++++++++++++++----------------- rtengine/simpleprocess.cc | 286 ++++---- 6 files changed, 1365 insertions(+), 1334 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 6b83c3c81..8fcd53686 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1951,7 +1951,7 @@ TOOLBAR_TOOLTIP_COLORPICKER;Lockable Color Picker\n\nWhen the tool is active:\n- TOOLBAR_TOOLTIP_CROP;Crop selection.\nShortcut: c\nMove the crop using Shift+mouse drag. TOOLBAR_TOOLTIP_HAND;Hand tool.\nShortcut: h TOOLBAR_TOOLTIP_PERSPECTIVE;Perspective Correction\n\nEdit control lines to correct perspective distortion. Click this button again to apply correction. -TOOLBAR_TOOLTIP_STRAIGHTEN;Straighten / fine rotation.\nShortcut: s\n\nIndicate the vertical or horizontal by drawing a guide line over the image preview. Angle of rotation will be shown next to the guide line. Center of rotation is the geometrical center of the image. +TOOLBAR_TOOLTIP_STRAIGHTEN;Straighten / fine rotation.\nShortcut: s\n\nIndicate the vertical or horizontal by drawing a guide line over the image. Angle of rotation will be shown next to the guide line. Center of rotation is the geometrical center of the image. TOOLBAR_TOOLTIP_WB;Spot white balance.\nShortcut: w TP_BWMIX_ALGO;Algorithm OYCPM TP_BWMIX_ALGO_LI;Linear @@ -2557,7 +2557,7 @@ TP_LOCALLAB_CLARI_TOOLTIP;Levels 0 to 4 (included): ‘Sharp mask’ is enabled\ TP_LOCALLAB_CLIPTM;Clip restored data (gain) TP_LOCALLAB_COFR;Color & Light TP_LOCALLAB_COLORDE;ΔE preview color - intensity -TP_LOCALLAB_COLORDEPREV_TOOLTIP;Preview ΔE button will only work if you have activated one (and only one) of the tools in "Add tool to current spot" menu.\nTo be able to preview ΔE with several tools enabled, use Mask and modifications - Preview ΔE +TP_LOCALLAB_COLORDEPREV_TOOLTIP;Preview ΔE button will only work if you have activated one (and only one) of the tools in "Add tool to current spot" menu.\nTo be able to preview ΔE with several tools enabled, use Mask and modifications - Preview ΔE. TP_LOCALLAB_COLORDE_TOOLTIP;Show a blue color-preview for ΔE selection if negative and green if positive.\n\nMask and modifications (show modified areas without mask): show actual modifications if positive, show enhanced modifications (luminance only) with blue and yellow if negative. TP_LOCALLAB_COLORSCOPE;Scope (color tools) TP_LOCALLAB_COLORSCOPE_TOOLTIP;Common Scope slider for Color and Light, Shadows/Highlights, Vibrance.\nOther tools have their own scope controls. diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index a787f1300..9669418e0 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -646,7 +646,8 @@ void Crop::update(int todo) parent->adnListener->noiseChanged(0.f, 0.f); } - if (todo & M_LINDENOISE) { + if (todo & (M_INIT | M_LINDENOISE | M_HDR)) { + if (skip == 1 && denoiseParams.enabled) { float nresi, highresi; @@ -810,6 +811,303 @@ void Crop::update(int todo) } + + if ((todo & (M_AUTOEXP | M_RGBCURVE)) && params.locallab.enabled && !params.locallab.spots.empty()) { + + //I made a little change here. Rather than have luminanceCurve (and others) use in/out lab images, we can do more if we copy right here. + parent->ipf.rgb2lab(*baseCrop, *laboCrop, params.icm.workingProfile); + + + labnCrop->CopyFrom(laboCrop); + + const std::unique_ptr reservCrop(new LabImage(*laboCrop, true)); + const std::unique_ptr lastorigCrop(new LabImage(*laboCrop, true)); + auto& lllocalcurve2 = parent->lllocalcurve; + auto& cllocalcurve2 = parent->cllocalcurve; + auto& lclocalcurve2 = parent->lclocalcurve; + auto& cclocalcurve2 = parent->cclocalcurve; + auto& rgblocalcurve2 = parent->rgblocalcurve; + auto& exlocalcurve2 = parent->exlocalcurve; + auto& lmasklocalcurve2 = parent->lmasklocalcurve; + auto& lmaskexplocalcurve2 = parent->lmaskexplocalcurve; + auto& lmaskSHlocalcurve2 = parent->lmaskSHlocalcurve; + auto& lmaskviblocalcurve2 = parent->lmaskviblocalcurve; + auto& lmasktmlocalcurve2 = parent->lmasktmlocalcurve; + auto& lmaskretilocalcurve2 = parent->lmaskretilocalcurve; + auto& lmaskcblocalcurve2 = parent->lmaskcblocalcurve; + auto& lmaskbllocalcurve2 = parent->lmaskbllocalcurve; + auto& lmasklclocalcurve2 = parent->lmasklclocalcurve; + auto& lmaskloglocalcurve2 = parent->lmaskloglocalcurve; + auto& hltonecurveloc2 = parent->hltonecurveloc; + auto& shtonecurveloc2 = parent->shtonecurveloc; + auto& tonecurveloc2 = parent->tonecurveloc; + auto& lightCurveloc2 = parent->lightCurveloc; + auto& locRETgainCurve = parent->locRETgainCurve; + auto& locRETtransCurve = parent->locRETtransCurve; + auto& loclhCurve = parent->loclhCurve; + auto& lochhCurve = parent->lochhCurve; + auto& locchCurve = parent->locchCurve; + auto& locccmasCurve = parent->locccmasCurve; + auto& locllmasCurve = parent->locllmasCurve; + auto& lochhmasCurve = parent->lochhmasCurve; + auto& lochhhmasCurve = parent->lochhhmasCurve; + auto& locccmasexpCurve = parent->locccmasexpCurve; + auto& locllmasexpCurve = parent->locllmasexpCurve; + auto& lochhmasexpCurve = parent->lochhmasexpCurve; + auto& locccmasSHCurve = parent->locccmasSHCurve; + auto& locllmasSHCurve = parent->locllmasSHCurve; + auto& lochhmasSHCurve = parent->lochhmasSHCurve; + auto& locccmasvibCurve = parent->locccmasvibCurve; + auto& locllmasvibCurve = parent->locllmasvibCurve; + auto& lochhmasvibCurve = parent->lochhmasvibCurve; + auto& locccmaslcCurve = parent->locccmaslcCurve; + auto& locllmaslcCurve = parent->locllmaslcCurve; + auto& lochhmaslcCurve = parent->lochhmaslcCurve; + auto& locccmascbCurve = parent->locccmascbCurve; + auto& locllmascbCurve = parent->locllmascbCurve; + auto& lochhmascbCurve = parent->lochhmascbCurve; + auto& locccmasretiCurve = parent->locccmasretiCurve; + auto& locllmasretiCurve = parent->locllmasretiCurve; + auto& lochhmasretiCurve = parent->lochhmasretiCurve; + auto& locccmastmCurve = parent->locccmastmCurve; + auto& locllmastmCurve = parent->locllmastmCurve; + auto& lochhmastmCurve = parent->lochhmastmCurve; + auto& locccmasblCurve = parent->locccmasblCurve; + auto& locllmasblCurve = parent->locllmasblCurve; + auto& lochhmasblCurve = parent->lochhmasblCurve; + auto& locccmaslogCurve = parent->locccmaslogCurve; + auto& locllmaslogCurve = parent->locllmaslogCurve; + auto& lochhmaslogCurve = parent->lochhmaslogCurve; + + auto& locccmas_Curve = parent->locccmas_Curve; + auto& locllmas_Curve = parent->locllmas_Curve; + auto& lochhmas_Curve = parent->lochhmas_Curve; + auto& lochhhmas_Curve = parent->lochhhmas_Curve; + auto& locwavCurve = parent->locwavCurve; + auto& loclmasCurveblwav = parent->loclmasCurveblwav; + auto& loclmasCurvecolwav = parent->loclmasCurvecolwav; + auto& loclevwavCurve = parent->loclevwavCurve; + auto& locconwavCurve = parent->locconwavCurve; + auto& loccompwavCurve = parent->loccompwavCurve; + auto& loccomprewavCurve = parent->loccomprewavCurve; + auto& locedgwavCurve = parent->locedgwavCurve; + auto& locwavCurvehue = parent->locwavCurvehue; + auto& locwavCurveden = parent->locwavCurveden; + auto& lmasklocal_curve2 = parent->lmasklocal_curve; + auto& loclmasCurve_wav = parent->loclmasCurve_wav; + + for (int sp = 0; sp < (int)params.locallab.spots.size(); sp++) { + locRETgainCurve.Set(params.locallab.spots.at(sp).localTgaincurve); + locRETtransCurve.Set(params.locallab.spots.at(sp).localTtranscurve); + const bool LHutili = loclhCurve.Set(params.locallab.spots.at(sp).LHcurve); + const bool HHutili = lochhCurve.Set(params.locallab.spots.at(sp).HHcurve); + const bool CHutili = locchCurve.Set(params.locallab.spots.at(sp).CHcurve); + const bool lcmasutili = locccmasCurve.Set(params.locallab.spots.at(sp).CCmaskcurve); + const bool llmasutili = locllmasCurve.Set(params.locallab.spots.at(sp).LLmaskcurve); + const bool lhmasutili = lochhmasCurve.Set(params.locallab.spots.at(sp).HHmaskcurve); + const bool lhhmasutili = lochhhmasCurve.Set(params.locallab.spots.at(sp).HHhmaskcurve); + const bool lcmasexputili = locccmasexpCurve.Set(params.locallab.spots.at(sp).CCmaskexpcurve); + const bool llmasexputili = locllmasexpCurve.Set(params.locallab.spots.at(sp).LLmaskexpcurve); + const bool lhmasexputili = lochhmasexpCurve.Set(params.locallab.spots.at(sp).HHmaskexpcurve); + const bool lcmasSHutili = locccmasSHCurve.Set(params.locallab.spots.at(sp).CCmaskSHcurve); + const bool llmasSHutili = locllmasSHCurve.Set(params.locallab.spots.at(sp).LLmaskSHcurve); + const bool lhmasSHutili = lochhmasSHCurve.Set(params.locallab.spots.at(sp).HHmaskSHcurve); + const bool lcmasvibutili = locccmasvibCurve.Set(params.locallab.spots.at(sp).CCmaskvibcurve); + const bool llmasvibutili = locllmasvibCurve.Set(params.locallab.spots.at(sp).LLmaskvibcurve); + const bool lhmasvibutili = lochhmasvibCurve.Set(params.locallab.spots.at(sp).HHmaskvibcurve); + const bool lcmascbutili = locccmascbCurve.Set(params.locallab.spots.at(sp).CCmaskcbcurve); + const bool llmascbutili = locllmascbCurve.Set(params.locallab.spots.at(sp).LLmaskcbcurve); + const bool lhmascbutili = lochhmascbCurve.Set(params.locallab.spots.at(sp).HHmaskcbcurve); + const bool lcmasretiutili = locccmasretiCurve.Set(params.locallab.spots.at(sp).CCmaskreticurve); + const bool llmasretiutili = locllmasretiCurve.Set(params.locallab.spots.at(sp).LLmaskreticurve); + const bool lhmasretiutili = lochhmasretiCurve.Set(params.locallab.spots.at(sp).HHmaskreticurve); + const bool lcmastmutili = locccmastmCurve.Set(params.locallab.spots.at(sp).CCmasktmcurve); + const bool llmastmutili = locllmastmCurve.Set(params.locallab.spots.at(sp).LLmasktmcurve); + const bool lhmastmutili = lochhmastmCurve.Set(params.locallab.spots.at(sp).HHmasktmcurve); + const bool lcmasblutili = locccmasblCurve.Set(params.locallab.spots.at(sp).CCmaskblcurve); + const bool llmasblutili = locllmasblCurve.Set(params.locallab.spots.at(sp).LLmaskblcurve); + const bool lhmasblutili = lochhmasblCurve.Set(params.locallab.spots.at(sp).HHmaskblcurve); + const bool lcmaslogutili = locccmaslogCurve.Set(params.locallab.spots.at(sp).CCmaskcurveL); + const bool llmaslogutili = locllmaslogCurve.Set(params.locallab.spots.at(sp).LLmaskcurveL); + const bool lhmaslogutili = lochhmaslogCurve.Set(params.locallab.spots.at(sp).HHmaskcurveL); + + const bool lcmas_utili = locccmas_Curve.Set(params.locallab.spots.at(sp).CCmask_curve); + const bool llmas_utili = locllmas_Curve.Set(params.locallab.spots.at(sp).LLmask_curve); + const bool lhmas_utili = lochhmas_Curve.Set(params.locallab.spots.at(sp).HHmask_curve); + const bool lhhmas_utili = lochhhmas_Curve.Set(params.locallab.spots.at(sp).HHhmask_curve); + const bool lmasutili_wav = loclmasCurve_wav.Set(params.locallab.spots.at(sp).LLmask_curvewav); + const bool lmasutiliblwav = loclmasCurveblwav.Set(params.locallab.spots.at(sp).LLmaskblcurvewav); + const bool lmasutilicolwav = loclmasCurvecolwav.Set(params.locallab.spots.at(sp).LLmaskcolcurvewav); + const bool lcmaslcutili = locccmaslcCurve.Set(params.locallab.spots.at(sp).CCmasklccurve); + const bool llmaslcutili = locllmaslcCurve.Set(params.locallab.spots.at(sp).LLmasklccurve); + const bool lhmaslcutili = lochhmaslcCurve.Set(params.locallab.spots.at(sp).HHmasklccurve); + const bool locwavutili = locwavCurve.Set(params.locallab.spots.at(sp).locwavcurve); + const bool locwavhueutili = locwavCurvehue.Set(params.locallab.spots.at(sp).locwavcurvehue); + const bool locwavdenutili = locwavCurveden.Set(params.locallab.spots.at(sp).locwavcurveden); + const bool loclevwavutili = loclevwavCurve.Set(params.locallab.spots.at(sp).loclevwavcurve); + const bool locconwavutili = locconwavCurve.Set(params.locallab.spots.at(sp).locconwavcurve); + const bool loccompwavutili = loccompwavCurve.Set(params.locallab.spots.at(sp).loccompwavcurve); + const bool loccomprewavutili = loccomprewavCurve.Set(params.locallab.spots.at(sp).loccomprewavcurve); + const bool locedgwavutili = locedgwavCurve.Set(params.locallab.spots.at(sp).locedgwavcurve); + const bool locallutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).llcurve, lllocalcurve2, skip); + const bool localclutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).clcurve, cllocalcurve2, skip); + const bool locallcutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).lccurve, lclocalcurve2, skip); + const bool localrgbutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).rgbcurve, rgblocalcurve2, skip); + const bool localcutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).cccurve, cclocalcurve2, skip); + const bool localexutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).excurve, exlocalcurve2, skip); + const bool localmaskutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmaskcurve, lmasklocalcurve2, skip); + const bool localmaskexputili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmaskexpcurve, lmaskexplocalcurve2, skip); + const bool localmaskSHutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).LmaskSHcurve, lmaskSHlocalcurve2, skip); + const bool localmaskvibutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmaskvibcurve, lmaskviblocalcurve2, skip); + const bool localmasktmutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmasktmcurve, lmasktmlocalcurve2, skip); + const bool localmaskretiutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmaskreticurve, lmaskretilocalcurve2, skip); + const bool localmaskcbutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmaskcbcurve, lmaskcblocalcurve2, skip); + const bool localmasklcutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmasklccurve, lmasklclocalcurve2, skip); + const bool localmaskblutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmaskblcurve, lmaskbllocalcurve2, skip); + const bool localmasklogutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).LmaskcurveL, lmaskloglocalcurve2, skip); + const bool localmask_utili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmask_curve, lmasklocal_curve2, skip); + + double ecomp = params.locallab.spots.at(sp).expcomp; + double black = params.locallab.spots.at(sp).black; + double hlcompr = params.locallab.spots.at(sp).hlcompr; + double hlcomprthresh = params.locallab.spots.at(sp).hlcomprthresh; + double shcompr = params.locallab.spots.at(sp).shcompr; + double br = params.locallab.spots.at(sp).lightness; + if(black < 0. && params.locallab.spots.at(sp).expMethod == "pde" ) { + black *= 1.5; + } + + double cont = params.locallab.spots.at(sp).contrast; + double huere, chromare, lumare, huerefblu, chromarefblu, lumarefblu, sobelre; + huerefblu = parent->huerefblurs[sp]; + chromarefblu = parent->chromarefblurs[sp]; + lumarefblu = parent->lumarefblurs[sp]; + huere = parent->huerefs[sp]; + chromare = parent->chromarefs[sp]; + lumare = parent->lumarefs[sp]; + sobelre = parent->sobelrefs[sp]; + const float avge = parent->avgs[sp]; + + float minCD; + float maxCD; + float mini; + float maxi; + float Tmean; + float Tsigma; + float Tmin; + float Tmax; + int lastsav; + CurveFactory::complexCurvelocal(ecomp, black / 65535., hlcompr, hlcomprthresh, shcompr, br, cont, lumare, + hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, avge, + skip); + // Locallab mask are only shown for selected spot + if (sp == params.locallab.selspot) { + parent->ipf.Lab_Local(1, sp, (float**)shbuffer, labnCrop, labnCrop, reservCrop.get(), lastorigCrop.get(), cropx / skip, cropy / skip, skips(parent->fw, skip), skips(parent->fh, skip), skip, locRETgainCurve, locRETtransCurve, + lllocalcurve2,locallutili, + cllocalcurve2, localclutili, + lclocalcurve2, locallcutili, + loclhCurve, lochhCurve, locchCurve, + lmasklocalcurve2, localmaskutili, + lmaskexplocalcurve2, localmaskexputili, + lmaskSHlocalcurve2, localmaskSHutili, + lmaskviblocalcurve2, localmaskvibutili, + lmasktmlocalcurve2, localmasktmutili, + lmaskretilocalcurve2, localmaskretiutili, + lmaskcblocalcurve2, localmaskcbutili, + lmaskbllocalcurve2, localmaskblutili, + lmasklclocalcurve2, localmasklcutili, + lmaskloglocalcurve2, localmasklogutili, + lmasklocal_curve2, localmask_utili, + + locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili, lochhhmasCurve, lhhmasutili, locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, + locccmasSHCurve, lcmasSHutili, locllmasSHCurve, llmasSHutili, lochhmasSHCurve, lhmasSHutili, + locccmasvibCurve, lcmasvibutili, locllmasvibCurve, llmasvibutili, lochhmasvibCurve, lhmasvibutili, + locccmascbCurve, lcmascbutili, locllmascbCurve, llmascbutili, lochhmascbCurve, lhmascbutili, + locccmasretiCurve, lcmasretiutili, locllmasretiCurve, llmasretiutili, lochhmasretiCurve, lhmasretiutili, + locccmastmCurve, lcmastmutili, locllmastmCurve, llmastmutili, lochhmastmCurve, lhmastmutili, + locccmasblCurve, lcmasblutili, locllmasblCurve, llmasblutili, lochhmasblCurve, lhmasblutili, + locccmaslcCurve, lcmaslcutili, locllmaslcCurve, llmaslcutili, lochhmaslcCurve, lhmaslcutili, + locccmaslogCurve, lcmaslogutili, locllmaslogCurve, llmaslogutili, lochhmaslogCurve, lhmaslogutili, + + locccmas_Curve, lcmas_utili, locllmas_Curve, llmas_utili, lochhmas_Curve, lhmas_utili, + lochhhmas_Curve, lhhmas_utili, + loclmasCurveblwav,lmasutiliblwav, + loclmasCurvecolwav,lmasutilicolwav, + locwavCurve, locwavutili, + loclevwavCurve, loclevwavutili, + locconwavCurve, locconwavutili, + loccompwavCurve, loccompwavutili, + loccomprewavCurve, loccomprewavutili, + locwavCurvehue, locwavhueutili, + locwavCurveden, locwavdenutili, + locedgwavCurve, locedgwavutili, + loclmasCurve_wav,lmasutili_wav, + LHutili, HHutili, CHutili, cclocalcurve2, localcutili, rgblocalcurve2, localrgbutili, localexutili, exlocalcurve2, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, + huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, lastsav, + parent->previewDeltaE, parent->locallColorMask, parent->locallColorMaskinv, parent->locallExpMask, parent->locallExpMaskinv, parent->locallSHMask, parent->locallSHMaskinv, parent->locallvibMask, parent->localllcMask, parent->locallsharMask, parent->locallcbMask, parent->locallretiMask, parent->locallsoftMask, parent->localltmMask, parent->locallblMask, + parent->localllogMask, parent->locall_Mask, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax); + if(parent->previewDeltaE) { + params.blackwhite.enabled = false; + } + + } else { + parent->ipf.Lab_Local(1, sp, (float**)shbuffer, labnCrop, labnCrop, reservCrop.get(), lastorigCrop.get(), cropx / skip, cropy / skip, skips(parent->fw, skip), skips(parent->fh, skip), skip, locRETgainCurve, locRETtransCurve, + lllocalcurve2,locallutili, + cllocalcurve2, localclutili, + lclocalcurve2, locallcutili, + loclhCurve, lochhCurve, locchCurve, + lmasklocalcurve2, localmaskutili, + lmaskexplocalcurve2, localmaskexputili, + lmaskSHlocalcurve2, localmaskSHutili, + lmaskviblocalcurve2, localmaskvibutili, + lmasktmlocalcurve2, localmasktmutili, + lmaskretilocalcurve2, localmaskretiutili, + lmaskcblocalcurve2, localmaskcbutili, + lmaskbllocalcurve2, localmaskblutili, + lmasklclocalcurve2, localmasklcutili, + lmaskloglocalcurve2, localmasklogutili, + lmasklocal_curve2, localmask_utili, + + locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili,lochhhmasCurve, lhhmasutili, locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, + locccmasSHCurve, lcmasSHutili, locllmasSHCurve, llmasSHutili, lochhmasSHCurve, lhmasSHutili, + locccmasvibCurve, lcmasvibutili, locllmasvibCurve, llmasvibutili, lochhmasvibCurve, lhmasvibutili, + locccmascbCurve, lcmascbutili, locllmascbCurve, llmascbutili, lochhmascbCurve, lhmascbutili, + locccmasretiCurve, lcmasretiutili, locllmasretiCurve, llmasretiutili, lochhmasretiCurve, lhmasretiutili, + locccmastmCurve, lcmastmutili, locllmastmCurve, llmastmutili, lochhmastmCurve, lhmastmutili, + locccmasblCurve, lcmasblutili, locllmasblCurve, llmasblutili, lochhmasblCurve, lhmasblutili, + locccmaslcCurve, lcmaslcutili, locllmaslcCurve, llmaslcutili, lochhmaslcCurve, lhmaslcutili, + locccmaslogCurve, lcmaslogutili, locllmaslogCurve, llmaslogutili, lochhmaslogCurve, lhmaslogutili, + + locccmas_Curve, lcmas_utili, locllmas_Curve, llmas_utili, lochhmas_Curve, lhmas_utili, + lochhhmas_Curve, lhhmas_utili, + + loclmasCurveblwav,lmasutiliblwav, + loclmasCurvecolwav,lmasutilicolwav, + locwavCurve, locwavutili, + loclevwavCurve, loclevwavutili, + locconwavCurve, locconwavutili, + loccompwavCurve, loccompwavutili, + loccomprewavCurve, loccomprewavutili, + locwavCurvehue, locwavhueutili, + locwavCurveden, locwavdenutili, + locedgwavCurve, locedgwavutili, + loclmasCurve_wav,lmasutili_wav, + LHutili, HHutili, CHutili, cclocalcurve2, localcutili, rgblocalcurve2, localrgbutili, localexutili, exlocalcurve2, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, + huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, lastsav, false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax); + } + if (sp + 1u < params.locallab.spots.size()) { + // do not copy for last spot as it is not needed anymore + lastorigCrop->CopyFrom(labnCrop); + } + + if (skip <= 2) { + Glib::usleep(settings->cropsleep); //wait to avoid crash when crop 100% and move window + } + } + parent->ipf.lab2rgb(*labnCrop, *baseCrop, params.icm.workingProfile); + } + if (todo & M_RGBCURVE) { Imagefloat *workingCrop = baseCrop; /* @@ -863,291 +1161,6 @@ void Crop::update(int todo) //I made a little change here. Rather than have luminanceCurve (and others) use in/out lab images, we can do more if we copy right here. labnCrop->CopyFrom(laboCrop); - if (params.locallab.enabled && !params.locallab.spots.empty()) { - const std::unique_ptr reservCrop(new LabImage(*laboCrop, true)); - const std::unique_ptr lastorigCrop(new LabImage(*laboCrop, true)); - auto& lllocalcurve2 = parent->lllocalcurve; - auto& cllocalcurve2 = parent->cllocalcurve; - auto& lclocalcurve2 = parent->lclocalcurve; - auto& cclocalcurve2 = parent->cclocalcurve; - auto& rgblocalcurve2 = parent->rgblocalcurve; - auto& exlocalcurve2 = parent->exlocalcurve; - auto& lmasklocalcurve2 = parent->lmasklocalcurve; - auto& lmaskexplocalcurve2 = parent->lmaskexplocalcurve; - auto& lmaskSHlocalcurve2 = parent->lmaskSHlocalcurve; - auto& lmaskviblocalcurve2 = parent->lmaskviblocalcurve; - auto& lmasktmlocalcurve2 = parent->lmasktmlocalcurve; - auto& lmaskretilocalcurve2 = parent->lmaskretilocalcurve; - auto& lmaskcblocalcurve2 = parent->lmaskcblocalcurve; - auto& lmaskbllocalcurve2 = parent->lmaskbllocalcurve; - auto& lmasklclocalcurve2 = parent->lmasklclocalcurve; - auto& lmaskloglocalcurve2 = parent->lmaskloglocalcurve; - auto& hltonecurveloc2 = parent->hltonecurveloc; - auto& shtonecurveloc2 = parent->shtonecurveloc; - auto& tonecurveloc2 = parent->tonecurveloc; - auto& lightCurveloc2 = parent->lightCurveloc; - auto& locRETgainCurve = parent->locRETgainCurve; - auto& locRETtransCurve = parent->locRETtransCurve; - auto& loclhCurve = parent->loclhCurve; - auto& lochhCurve = parent->lochhCurve; - auto& locchCurve = parent->locchCurve; - auto& locccmasCurve = parent->locccmasCurve; - auto& locllmasCurve = parent->locllmasCurve; - auto& lochhmasCurve = parent->lochhmasCurve; - auto& lochhhmasCurve = parent->lochhhmasCurve; - auto& locccmasexpCurve = parent->locccmasexpCurve; - auto& locllmasexpCurve = parent->locllmasexpCurve; - auto& lochhmasexpCurve = parent->lochhmasexpCurve; - auto& locccmasSHCurve = parent->locccmasSHCurve; - auto& locllmasSHCurve = parent->locllmasSHCurve; - auto& lochhmasSHCurve = parent->lochhmasSHCurve; - auto& locccmasvibCurve = parent->locccmasvibCurve; - auto& locllmasvibCurve = parent->locllmasvibCurve; - auto& lochhmasvibCurve = parent->lochhmasvibCurve; - auto& locccmaslcCurve = parent->locccmaslcCurve; - auto& locllmaslcCurve = parent->locllmaslcCurve; - auto& lochhmaslcCurve = parent->lochhmaslcCurve; - auto& locccmascbCurve = parent->locccmascbCurve; - auto& locllmascbCurve = parent->locllmascbCurve; - auto& lochhmascbCurve = parent->lochhmascbCurve; - auto& locccmasretiCurve = parent->locccmasretiCurve; - auto& locllmasretiCurve = parent->locllmasretiCurve; - auto& lochhmasretiCurve = parent->lochhmasretiCurve; - auto& locccmastmCurve = parent->locccmastmCurve; - auto& locllmastmCurve = parent->locllmastmCurve; - auto& lochhmastmCurve = parent->lochhmastmCurve; - auto& locccmasblCurve = parent->locccmasblCurve; - auto& locllmasblCurve = parent->locllmasblCurve; - auto& lochhmasblCurve = parent->lochhmasblCurve; - auto& locccmaslogCurve = parent->locccmaslogCurve; - auto& locllmaslogCurve = parent->locllmaslogCurve; - auto& lochhmaslogCurve = parent->lochhmaslogCurve; - - auto& locccmas_Curve = parent->locccmas_Curve; - auto& locllmas_Curve = parent->locllmas_Curve; - auto& lochhmas_Curve = parent->lochhmas_Curve; - auto& lochhhmas_Curve = parent->lochhhmas_Curve; - auto& locwavCurve = parent->locwavCurve; - auto& loclmasCurveblwav = parent->loclmasCurveblwav; - auto& loclmasCurvecolwav = parent->loclmasCurvecolwav; - auto& loclevwavCurve = parent->loclevwavCurve; - auto& locconwavCurve = parent->locconwavCurve; - auto& loccompwavCurve = parent->loccompwavCurve; - auto& loccomprewavCurve = parent->loccomprewavCurve; - auto& locedgwavCurve = parent->locedgwavCurve; - auto& locwavCurvehue = parent->locwavCurvehue; - auto& locwavCurveden = parent->locwavCurveden; - auto& lmasklocal_curve2 = parent->lmasklocal_curve; - auto& loclmasCurve_wav = parent->loclmasCurve_wav; - - for (int sp = 0; sp < (int)params.locallab.spots.size(); sp++) { - locRETgainCurve.Set(params.locallab.spots.at(sp).localTgaincurve); - locRETtransCurve.Set(params.locallab.spots.at(sp).localTtranscurve); - const bool LHutili = loclhCurve.Set(params.locallab.spots.at(sp).LHcurve); - const bool HHutili = lochhCurve.Set(params.locallab.spots.at(sp).HHcurve); - const bool CHutili = locchCurve.Set(params.locallab.spots.at(sp).CHcurve); - const bool lcmasutili = locccmasCurve.Set(params.locallab.spots.at(sp).CCmaskcurve); - const bool llmasutili = locllmasCurve.Set(params.locallab.spots.at(sp).LLmaskcurve); - const bool lhmasutili = lochhmasCurve.Set(params.locallab.spots.at(sp).HHmaskcurve); - const bool lhhmasutili = lochhhmasCurve.Set(params.locallab.spots.at(sp).HHhmaskcurve); - const bool lcmasexputili = locccmasexpCurve.Set(params.locallab.spots.at(sp).CCmaskexpcurve); - const bool llmasexputili = locllmasexpCurve.Set(params.locallab.spots.at(sp).LLmaskexpcurve); - const bool lhmasexputili = lochhmasexpCurve.Set(params.locallab.spots.at(sp).HHmaskexpcurve); - const bool lcmasSHutili = locccmasSHCurve.Set(params.locallab.spots.at(sp).CCmaskSHcurve); - const bool llmasSHutili = locllmasSHCurve.Set(params.locallab.spots.at(sp).LLmaskSHcurve); - const bool lhmasSHutili = lochhmasSHCurve.Set(params.locallab.spots.at(sp).HHmaskSHcurve); - const bool lcmasvibutili = locccmasvibCurve.Set(params.locallab.spots.at(sp).CCmaskvibcurve); - const bool llmasvibutili = locllmasvibCurve.Set(params.locallab.spots.at(sp).LLmaskvibcurve); - const bool lhmasvibutili = lochhmasvibCurve.Set(params.locallab.spots.at(sp).HHmaskvibcurve); - const bool lcmascbutili = locccmascbCurve.Set(params.locallab.spots.at(sp).CCmaskcbcurve); - const bool llmascbutili = locllmascbCurve.Set(params.locallab.spots.at(sp).LLmaskcbcurve); - const bool lhmascbutili = lochhmascbCurve.Set(params.locallab.spots.at(sp).HHmaskcbcurve); - const bool lcmasretiutili = locccmasretiCurve.Set(params.locallab.spots.at(sp).CCmaskreticurve); - const bool llmasretiutili = locllmasretiCurve.Set(params.locallab.spots.at(sp).LLmaskreticurve); - const bool lhmasretiutili = lochhmasretiCurve.Set(params.locallab.spots.at(sp).HHmaskreticurve); - const bool lcmastmutili = locccmastmCurve.Set(params.locallab.spots.at(sp).CCmasktmcurve); - const bool llmastmutili = locllmastmCurve.Set(params.locallab.spots.at(sp).LLmasktmcurve); - const bool lhmastmutili = lochhmastmCurve.Set(params.locallab.spots.at(sp).HHmasktmcurve); - const bool lcmasblutili = locccmasblCurve.Set(params.locallab.spots.at(sp).CCmaskblcurve); - const bool llmasblutili = locllmasblCurve.Set(params.locallab.spots.at(sp).LLmaskblcurve); - const bool lhmasblutili = lochhmasblCurve.Set(params.locallab.spots.at(sp).HHmaskblcurve); - const bool lcmaslogutili = locccmaslogCurve.Set(params.locallab.spots.at(sp).CCmaskcurveL); - const bool llmaslogutili = locllmaslogCurve.Set(params.locallab.spots.at(sp).LLmaskcurveL); - const bool lhmaslogutili = lochhmaslogCurve.Set(params.locallab.spots.at(sp).HHmaskcurveL); - - const bool lcmas_utili = locccmas_Curve.Set(params.locallab.spots.at(sp).CCmask_curve); - const bool llmas_utili = locllmas_Curve.Set(params.locallab.spots.at(sp).LLmask_curve); - const bool lhmas_utili = lochhmas_Curve.Set(params.locallab.spots.at(sp).HHmask_curve); - const bool lhhmas_utili = lochhhmas_Curve.Set(params.locallab.spots.at(sp).HHhmask_curve); - const bool lmasutili_wav = loclmasCurve_wav.Set(params.locallab.spots.at(sp).LLmask_curvewav); - const bool lmasutiliblwav = loclmasCurveblwav.Set(params.locallab.spots.at(sp).LLmaskblcurvewav); - const bool lmasutilicolwav = loclmasCurvecolwav.Set(params.locallab.spots.at(sp).LLmaskcolcurvewav); - const bool lcmaslcutili = locccmaslcCurve.Set(params.locallab.spots.at(sp).CCmasklccurve); - const bool llmaslcutili = locllmaslcCurve.Set(params.locallab.spots.at(sp).LLmasklccurve); - const bool lhmaslcutili = lochhmaslcCurve.Set(params.locallab.spots.at(sp).HHmasklccurve); - const bool locwavutili = locwavCurve.Set(params.locallab.spots.at(sp).locwavcurve); - const bool locwavhueutili = locwavCurvehue.Set(params.locallab.spots.at(sp).locwavcurvehue); - const bool locwavdenutili = locwavCurveden.Set(params.locallab.spots.at(sp).locwavcurveden); - const bool loclevwavutili = loclevwavCurve.Set(params.locallab.spots.at(sp).loclevwavcurve); - const bool locconwavutili = locconwavCurve.Set(params.locallab.spots.at(sp).locconwavcurve); - const bool loccompwavutili = loccompwavCurve.Set(params.locallab.spots.at(sp).loccompwavcurve); - const bool loccomprewavutili = loccomprewavCurve.Set(params.locallab.spots.at(sp).loccomprewavcurve); - const bool locedgwavutili = locedgwavCurve.Set(params.locallab.spots.at(sp).locedgwavcurve); - const bool locallutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).llcurve, lllocalcurve2, skip); - const bool localclutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).clcurve, cllocalcurve2, skip); - const bool locallcutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).lccurve, lclocalcurve2, skip); - const bool localrgbutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).rgbcurve, rgblocalcurve2, skip); - const bool localcutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).cccurve, cclocalcurve2, skip); - const bool localexutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).excurve, exlocalcurve2, skip); - const bool localmaskutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmaskcurve, lmasklocalcurve2, skip); - const bool localmaskexputili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmaskexpcurve, lmaskexplocalcurve2, skip); - const bool localmaskSHutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).LmaskSHcurve, lmaskSHlocalcurve2, skip); - const bool localmaskvibutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmaskvibcurve, lmaskviblocalcurve2, skip); - const bool localmasktmutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmasktmcurve, lmasktmlocalcurve2, skip); - const bool localmaskretiutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmaskreticurve, lmaskretilocalcurve2, skip); - const bool localmaskcbutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmaskcbcurve, lmaskcblocalcurve2, skip); - const bool localmasklcutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmasklccurve, lmasklclocalcurve2, skip); - const bool localmaskblutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmaskblcurve, lmaskbllocalcurve2, skip); - const bool localmasklogutili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).LmaskcurveL, lmaskloglocalcurve2, skip); - const bool localmask_utili = CurveFactory::diagonalCurve2Lut(params.locallab.spots.at(sp).Lmask_curve, lmasklocal_curve2, skip); - - double ecomp = params.locallab.spots.at(sp).expcomp; - double black = params.locallab.spots.at(sp).black; - double hlcompr = params.locallab.spots.at(sp).hlcompr; - double hlcomprthresh = params.locallab.spots.at(sp).hlcomprthresh; - double shcompr = params.locallab.spots.at(sp).shcompr; - double br = params.locallab.spots.at(sp).lightness; - if(black < 0. && params.locallab.spots.at(sp).expMethod == "pde" ) { - black *= 1.5; - } - - double cont = params.locallab.spots.at(sp).contrast; - double huere, chromare, lumare, huerefblu, chromarefblu, lumarefblu, sobelre; - huerefblu = parent->huerefblurs[sp]; - chromarefblu = parent->chromarefblurs[sp]; - lumarefblu = parent->lumarefblurs[sp]; - huere = parent->huerefs[sp]; - chromare = parent->chromarefs[sp]; - lumare = parent->lumarefs[sp]; - sobelre = parent->sobelrefs[sp]; - const float avge = parent->avgs[sp]; - - float minCD; - float maxCD; - float mini; - float maxi; - float Tmean; - float Tsigma; - float Tmin; - float Tmax; - int lastsav; - CurveFactory::complexCurvelocal(ecomp, black / 65535., hlcompr, hlcomprthresh, shcompr, br, cont, lumare, - hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, avge, - skip); - // Locallab mask are only shown for selected spot - if (sp == params.locallab.selspot) { - parent->ipf.Lab_Local(1, sp, (float**)shbuffer, labnCrop, labnCrop, reservCrop.get(), lastorigCrop.get(), cropx / skip, cropy / skip, skips(parent->fw, skip), skips(parent->fh, skip), skip, locRETgainCurve, locRETtransCurve, - lllocalcurve2,locallutili, - cllocalcurve2, localclutili, - lclocalcurve2, locallcutili, - loclhCurve, lochhCurve, locchCurve, - lmasklocalcurve2, localmaskutili, - lmaskexplocalcurve2, localmaskexputili, - lmaskSHlocalcurve2, localmaskSHutili, - lmaskviblocalcurve2, localmaskvibutili, - lmasktmlocalcurve2, localmasktmutili, - lmaskretilocalcurve2, localmaskretiutili, - lmaskcblocalcurve2, localmaskcbutili, - lmaskbllocalcurve2, localmaskblutili, - lmasklclocalcurve2, localmasklcutili, - lmaskloglocalcurve2, localmasklogutili, - lmasklocal_curve2, localmask_utili, - - locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili, lochhhmasCurve, lhhmasutili, locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, - locccmasSHCurve, lcmasSHutili, locllmasSHCurve, llmasSHutili, lochhmasSHCurve, lhmasSHutili, - locccmasvibCurve, lcmasvibutili, locllmasvibCurve, llmasvibutili, lochhmasvibCurve, lhmasvibutili, - locccmascbCurve, lcmascbutili, locllmascbCurve, llmascbutili, lochhmascbCurve, lhmascbutili, - locccmasretiCurve, lcmasretiutili, locllmasretiCurve, llmasretiutili, lochhmasretiCurve, lhmasretiutili, - locccmastmCurve, lcmastmutili, locllmastmCurve, llmastmutili, lochhmastmCurve, lhmastmutili, - locccmasblCurve, lcmasblutili, locllmasblCurve, llmasblutili, lochhmasblCurve, lhmasblutili, - locccmaslcCurve, lcmaslcutili, locllmaslcCurve, llmaslcutili, lochhmaslcCurve, lhmaslcutili, - locccmaslogCurve, lcmaslogutili, locllmaslogCurve, llmaslogutili, lochhmaslogCurve, lhmaslogutili, - - locccmas_Curve, lcmas_utili, locllmas_Curve, llmas_utili, lochhmas_Curve, lhmas_utili, - lochhhmas_Curve, lhhmas_utili, - loclmasCurveblwav,lmasutiliblwav, - loclmasCurvecolwav,lmasutilicolwav, - locwavCurve, locwavutili, - loclevwavCurve, loclevwavutili, - locconwavCurve, locconwavutili, - loccompwavCurve, loccompwavutili, - loccomprewavCurve, loccomprewavutili, - locwavCurvehue, locwavhueutili, - locwavCurveden, locwavdenutili, - locedgwavCurve, locedgwavutili, - loclmasCurve_wav,lmasutili_wav, - LHutili, HHutili, CHutili, cclocalcurve2, localcutili, rgblocalcurve2, localrgbutili, localexutili, exlocalcurve2, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, - huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, lastsav, - parent->previewDeltaE, parent->locallColorMask, parent->locallColorMaskinv, parent->locallExpMask, parent->locallExpMaskinv, parent->locallSHMask, parent->locallSHMaskinv, parent->locallvibMask, parent->localllcMask, parent->locallsharMask, parent->locallcbMask, parent->locallretiMask, parent->locallsoftMask, parent->localltmMask, parent->locallblMask, - parent->localllogMask, parent->locall_Mask, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax); - } else { - parent->ipf.Lab_Local(1, sp, (float**)shbuffer, labnCrop, labnCrop, reservCrop.get(), lastorigCrop.get(), cropx / skip, cropy / skip, skips(parent->fw, skip), skips(parent->fh, skip), skip, locRETgainCurve, locRETtransCurve, - lllocalcurve2,locallutili, - cllocalcurve2, localclutili, - lclocalcurve2, locallcutili, - loclhCurve, lochhCurve, locchCurve, - lmasklocalcurve2, localmaskutili, - lmaskexplocalcurve2, localmaskexputili, - lmaskSHlocalcurve2, localmaskSHutili, - lmaskviblocalcurve2, localmaskvibutili, - lmasktmlocalcurve2, localmasktmutili, - lmaskretilocalcurve2, localmaskretiutili, - lmaskcblocalcurve2, localmaskcbutili, - lmaskbllocalcurve2, localmaskblutili, - lmasklclocalcurve2, localmasklcutili, - lmaskloglocalcurve2, localmasklogutili, - lmasklocal_curve2, localmask_utili, - - locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili,lochhhmasCurve, lhhmasutili, locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, - locccmasSHCurve, lcmasSHutili, locllmasSHCurve, llmasSHutili, lochhmasSHCurve, lhmasSHutili, - locccmasvibCurve, lcmasvibutili, locllmasvibCurve, llmasvibutili, lochhmasvibCurve, lhmasvibutili, - locccmascbCurve, lcmascbutili, locllmascbCurve, llmascbutili, lochhmascbCurve, lhmascbutili, - locccmasretiCurve, lcmasretiutili, locllmasretiCurve, llmasretiutili, lochhmasretiCurve, lhmasretiutili, - locccmastmCurve, lcmastmutili, locllmastmCurve, llmastmutili, lochhmastmCurve, lhmastmutili, - locccmasblCurve, lcmasblutili, locllmasblCurve, llmasblutili, lochhmasblCurve, lhmasblutili, - locccmaslcCurve, lcmaslcutili, locllmaslcCurve, llmaslcutili, lochhmaslcCurve, lhmaslcutili, - locccmaslogCurve, lcmaslogutili, locllmaslogCurve, llmaslogutili, lochhmaslogCurve, lhmaslogutili, - - locccmas_Curve, lcmas_utili, locllmas_Curve, llmas_utili, lochhmas_Curve, lhmas_utili, - lochhhmas_Curve, lhhmas_utili, - - loclmasCurveblwav,lmasutiliblwav, - loclmasCurvecolwav,lmasutilicolwav, - locwavCurve, locwavutili, - loclevwavCurve, loclevwavutili, - locconwavCurve, locconwavutili, - loccompwavCurve, loccompwavutili, - loccomprewavCurve, loccomprewavutili, - locwavCurvehue, locwavhueutili, - locwavCurveden, locwavdenutili, - locedgwavCurve, locedgwavutili, - loclmasCurve_wav,lmasutili_wav, - LHutili, HHutili, CHutili, cclocalcurve2, localcutili, rgblocalcurve2, localrgbutili, localexutili, exlocalcurve2, hltonecurveloc2, shtonecurveloc2, tonecurveloc2, lightCurveloc2, - huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, lastsav, false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax); - } - - if (sp + 1u < params.locallab.spots.size()) { - // do not copy for last spot as it is not needed anymore - lastorigCrop->CopyFrom(labnCrop); - } - - if (skip <= 2) { - Glib::usleep(settings->cropsleep); //wait to avoid crash when crop 100% and move window - } - } - } - bool utili = parent->utili; bool autili = parent->autili; bool butili = parent->butili; diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 466ebf23f..240c3da2a 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -862,7 +862,266 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) */ } + // if ((todo & (M_LUMINANCE + M_COLOR)) || (todo & M_AUTOEXP)) { + // if (todo & M_RGBCURVE) { + if (((todo & (M_AUTOEXP | M_RGBCURVE)) || (todo & M_CROP)) && params->locallab.enabled && !params->locallab.spots.empty()) { + + ipf.rgb2lab(*oprevi, *oprevl, params->icm.workingProfile); + nprevl->CopyFrom(oprevl); + // int maxspot = 1; + //************************************************************* + // locallab + //************************************************************* + + /* + * This file is part of RawTherapee. + * + * Copyright (c) 2004-2010 Gabor Horvath + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + * 2017 2018 Jacques Desmis + * 2019 Pierre Cabrera + */ + const std::unique_ptr reserv(new LabImage(*oprevl, true)); + const std::unique_ptr lastorigimp(new LabImage(*oprevl, true)); + float **shbuffer = nullptr; + int sca = 1; + double huere, chromare, lumare, huerefblu, chromarefblu, lumarefblu, sobelre; + float avge; + std::vector locallref; + std::vector locallretiminmax; + huerefs.resize(params->locallab.spots.size()); + huerefblurs.resize(params->locallab.spots.size()); + chromarefblurs.resize(params->locallab.spots.size()); + lumarefblurs.resize(params->locallab.spots.size()); + chromarefs.resize(params->locallab.spots.size()); + lumarefs.resize(params->locallab.spots.size()); + sobelrefs.resize(params->locallab.spots.size()); + avgs.resize(params->locallab.spots.size()); + + for (int sp = 0; sp < (int)params->locallab.spots.size(); sp++) { + // Set local curves of current spot to LUT + locRETgainCurve.Set(params->locallab.spots.at(sp).localTgaincurve); + locRETtransCurve.Set(params->locallab.spots.at(sp).localTtranscurve); + const bool LHutili = loclhCurve.Set(params->locallab.spots.at(sp).LHcurve); + const bool HHutili = lochhCurve.Set(params->locallab.spots.at(sp).HHcurve); + const bool CHutili = locchCurve.Set(params->locallab.spots.at(sp).CHcurve); + const bool lcmasutili = locccmasCurve.Set(params->locallab.spots.at(sp).CCmaskcurve); + const bool llmasutili = locllmasCurve.Set(params->locallab.spots.at(sp).LLmaskcurve); + const bool lhmasutili = lochhmasCurve.Set(params->locallab.spots.at(sp).HHmaskcurve); + const bool lhhmasutili = lochhhmasCurve.Set(params->locallab.spots.at(sp).HHhmaskcurve); + const bool llmasexputili = locllmasexpCurve.Set(params->locallab.spots.at(sp).LLmaskexpcurve); + const bool lcmasexputili = locccmasexpCurve.Set(params->locallab.spots.at(sp).CCmaskexpcurve); + const bool lhmasexputili = lochhmasexpCurve.Set(params->locallab.spots.at(sp).HHmaskexpcurve); + const bool llmasSHutili = locllmasSHCurve.Set(params->locallab.spots.at(sp).LLmaskSHcurve); + const bool lcmasSHutili = locccmasSHCurve.Set(params->locallab.spots.at(sp).CCmaskSHcurve); + const bool lhmasSHutili = lochhmasSHCurve.Set(params->locallab.spots.at(sp).HHmaskSHcurve); + const bool llmasvibutili = locllmasvibCurve.Set(params->locallab.spots.at(sp).LLmaskvibcurve); + const bool lcmasvibutili = locccmasvibCurve.Set(params->locallab.spots.at(sp).CCmaskvibcurve); + const bool lhmasvibutili = lochhmasvibCurve.Set(params->locallab.spots.at(sp).HHmaskvibcurve); + const bool llmascbutili = locllmascbCurve.Set(params->locallab.spots.at(sp).LLmaskcbcurve); + const bool lcmascbutili = locccmascbCurve.Set(params->locallab.spots.at(sp).CCmaskcbcurve); + const bool lhmascbutili = lochhmascbCurve.Set(params->locallab.spots.at(sp).HHmaskcbcurve); + const bool llmaslcutili = locllmaslcCurve.Set(params->locallab.spots.at(sp).LLmasklccurve); + const bool lcmaslcutili = locccmaslcCurve.Set(params->locallab.spots.at(sp).CCmasklccurve); + const bool lhmaslcutili = lochhmaslcCurve.Set(params->locallab.spots.at(sp).HHmasklccurve); + const bool llmasretiutili = locllmasretiCurve.Set(params->locallab.spots.at(sp).LLmaskreticurve); + const bool lcmasretiutili = locccmasretiCurve.Set(params->locallab.spots.at(sp).CCmaskreticurve); + const bool lhmasretiutili = lochhmasretiCurve.Set(params->locallab.spots.at(sp).HHmaskreticurve); + const bool llmastmutili = locllmastmCurve.Set(params->locallab.spots.at(sp).LLmasktmcurve); + const bool lcmastmutili = locccmastmCurve.Set(params->locallab.spots.at(sp).CCmasktmcurve); + const bool lhmastmutili = lochhmastmCurve.Set(params->locallab.spots.at(sp).HHmasktmcurve); + const bool llmasblutili = locllmasblCurve.Set(params->locallab.spots.at(sp).LLmaskblcurve); + const bool lcmasblutili = locccmasblCurve.Set(params->locallab.spots.at(sp).CCmaskblcurve); + const bool lhmasblutili = lochhmasblCurve.Set(params->locallab.spots.at(sp).HHmaskblcurve); + const bool llmaslogutili = locllmaslogCurve.Set(params->locallab.spots.at(sp).LLmaskcurveL); + const bool lcmaslogutili = locccmaslogCurve.Set(params->locallab.spots.at(sp).CCmaskcurveL); + const bool lhmaslogutili = lochhmaslogCurve.Set(params->locallab.spots.at(sp).HHmaskcurveL); + + const bool lcmas_utili = locccmas_Curve.Set(params->locallab.spots.at(sp).CCmask_curve); + const bool llmas_utili = locllmas_Curve.Set(params->locallab.spots.at(sp).LLmask_curve); + const bool lhmas_utili = lochhmas_Curve.Set(params->locallab.spots.at(sp).HHmask_curve); + const bool lhhmas_utili = lochhhmas_Curve.Set(params->locallab.spots.at(sp).HHhmask_curve); + const bool lmasutiliblwav = loclmasCurveblwav.Set(params->locallab.spots.at(sp).LLmaskblcurvewav); + const bool lmasutilicolwav = loclmasCurvecolwav.Set(params->locallab.spots.at(sp).LLmaskcolcurvewav); + const bool locwavutili = locwavCurve.Set(params->locallab.spots.at(sp).locwavcurve); + const bool loclevwavutili = loclevwavCurve.Set(params->locallab.spots.at(sp).loclevwavcurve); + const bool locconwavutili = locconwavCurve.Set(params->locallab.spots.at(sp).locconwavcurve); + const bool loccompwavutili = loccompwavCurve.Set(params->locallab.spots.at(sp).loccompwavcurve); + const bool loccomprewavutili = loccomprewavCurve.Set(params->locallab.spots.at(sp).loccomprewavcurve); + const bool locwavhueutili = locwavCurvehue.Set(params->locallab.spots.at(sp).locwavcurvehue); + const bool locwavdenutili = locwavCurveden.Set(params->locallab.spots.at(sp).locwavcurveden); + const bool locedgwavutili = locedgwavCurve.Set(params->locallab.spots.at(sp).locedgwavcurve); + const bool lmasutili_wav = loclmasCurve_wav.Set(params->locallab.spots.at(sp).LLmask_curvewav); + const bool locallutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).llcurve, lllocalcurve, sca); + const bool localclutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).clcurve, cllocalcurve, sca); + const bool locallcutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).lccurve, lclocalcurve, sca); + const bool localcutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).cccurve, cclocalcurve, sca); + const bool localrgbutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).rgbcurve, rgblocalcurve, sca); + const bool localexutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).excurve, exlocalcurve, sca); + const bool localmaskutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmaskcurve, lmasklocalcurve, sca); + const bool localmaskexputili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmaskexpcurve, lmaskexplocalcurve, sca); + const bool localmaskSHutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).LmaskSHcurve, lmaskSHlocalcurve, sca); + const bool localmaskvibutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmaskvibcurve, lmaskviblocalcurve, sca); + const bool localmasktmutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmasktmcurve, lmasktmlocalcurve, sca); + const bool localmaskretiutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmaskreticurve, lmaskretilocalcurve, sca); + const bool localmaskcbutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmaskcbcurve, lmaskcblocalcurve, sca); + const bool localmaskblutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmaskblcurve, lmaskbllocalcurve, sca); + const bool localmasklcutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmasklccurve, lmasklclocalcurve, sca); + const bool localmasklogutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).LmaskcurveL, lmaskloglocalcurve, sca); + const bool localmask_utili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmask_curve, lmasklocal_curve, sca); + double ecomp = params->locallab.spots.at(sp).expcomp; + double black = params->locallab.spots.at(sp).black; + double hlcompr = params->locallab.spots.at(sp).hlcompr; + double hlcomprthresh = params->locallab.spots.at(sp).hlcomprthresh; + double shcompr = params->locallab.spots.at(sp).shcompr; + double br = params->locallab.spots.at(sp).lightness; + double cont = params->locallab.spots.at(sp).contrast; + + if (black < 0. && params->locallab.spots.at(sp).expMethod == "pde") { + black *= 1.5; + } + + // Reference parameters computation + if (params->locallab.spots.at(sp).spotMethod == "exc") { + ipf.calc_ref(sp, reserv.get(), reserv.get(), 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge, locwavCurveden, locwavdenutili); + } else { + ipf.calc_ref(sp, nprevl, nprevl, 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge, locwavCurveden, locwavdenutili); + } + + double huerblu = huerefblurs[sp] = huerefblu; + double chromarblu = chromarefblurs[sp] = chromarefblu; + double lumarblu = lumarefblurs[sp] = lumarefblu; + double huer = huerefs[sp] = huere; + double chromar = chromarefs[sp] = chromare; + double lumar = lumarefs[sp] = lumare ; + double sobeler = sobelrefs[sp] = sobelre; + float avg = avgs[sp] = avge; + CurveFactory::complexCurvelocal(ecomp, black / 65535., hlcompr, hlcomprthresh, shcompr, br, cont, lumar, + hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, avg, + sca); + + // Save Locallab mask curve references for current spot + LocallabListener::locallabRef spotref; + spotref.huer = huer; + spotref.lumar = lumar; + spotref.chromar = chromar; + locallref.push_back(spotref); + // Locallab tools computation + /* Notes: + * - shbuffer is used as nullptr + */ + + // Locallab mask is only showed in detailed image + float minCD; + float maxCD; + float mini; + float maxi; + float Tmean; + float Tsigma; + float Tmin; + float Tmax; + int lastsav; + ipf.Lab_Local(3, sp, (float**)shbuffer, nprevl, nprevl, reserv.get(), lastorigimp.get(), 0, 0, pW, pH, scale, locRETgainCurve, locRETtransCurve, + lllocalcurve, locallutili, + cllocalcurve, localclutili, + lclocalcurve, locallcutili, + loclhCurve, lochhCurve, locchCurve, + lmasklocalcurve, localmaskutili, + lmaskexplocalcurve, localmaskexputili, + lmaskSHlocalcurve, localmaskSHutili, + lmaskviblocalcurve, localmaskvibutili, + lmasktmlocalcurve, localmasktmutili, + lmaskretilocalcurve, localmaskretiutili, + lmaskcblocalcurve, localmaskcbutili, + lmaskbllocalcurve, localmaskblutili, + lmasklclocalcurve, localmasklcutili, + lmaskloglocalcurve, localmasklogutili, + lmasklocal_curve, localmask_utili, + + locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili, lochhhmasCurve, lhhmasutili, locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, + locccmasSHCurve, lcmasSHutili, locllmasSHCurve, llmasSHutili, lochhmasSHCurve, lhmasSHutili, + locccmasvibCurve, lcmasvibutili, locllmasvibCurve, llmasvibutili, lochhmasvibCurve, lhmasvibutili, + locccmascbCurve, lcmascbutili, locllmascbCurve, llmascbutili, lochhmascbCurve, lhmascbutili, + locccmasretiCurve, lcmasretiutili, locllmasretiCurve, llmasretiutili, lochhmasretiCurve, lhmasretiutili, + locccmastmCurve, lcmastmutili, locllmastmCurve, llmastmutili, lochhmastmCurve, lhmastmutili, + locccmasblCurve, lcmasblutili, locllmasblCurve, llmasblutili, lochhmasblCurve, lhmasblutili, + locccmaslcCurve, lcmaslcutili, locllmaslcCurve, llmaslcutili, lochhmaslcCurve, lhmaslcutili, + locccmaslogCurve, lcmaslogutili, locllmaslogCurve, llmaslogutili, lochhmaslogCurve, lhmaslogutili, + + locccmas_Curve, lcmas_utili, locllmas_Curve, llmas_utili, lochhmas_Curve, lhmas_utili, + lochhhmas_Curve, lhhmas_utili, + loclmasCurveblwav, lmasutiliblwav, + loclmasCurvecolwav, lmasutilicolwav, + locwavCurve, locwavutili, + loclevwavCurve, loclevwavutili, + locconwavCurve, locconwavutili, + loccompwavCurve, loccompwavutili, + loccomprewavCurve, loccomprewavutili, + locwavCurvehue, locwavhueutili, + locwavCurveden, locwavdenutili, + locedgwavCurve, locedgwavutili, + loclmasCurve_wav, lmasutili_wav, + LHutili, HHutili, CHutili, cclocalcurve, localcutili, rgblocalcurve, localrgbutili, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, + huerblu, chromarblu, lumarblu, huer, chromar, lumar, sobeler, lastsav, false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax); + + if (sp + 1u < params->locallab.spots.size()) { + // do not copy for last spot as it is not needed anymore + lastorigimp->CopyFrom(nprevl); + } + + // Save Locallab Retinex min/max for current spot + LocallabListener::locallabRetiMinMax retiMinMax; + retiMinMax.cdma = maxCD; + retiMinMax.cdmin = minCD; + retiMinMax.mini = mini; + retiMinMax.maxi = maxi; + retiMinMax.Tmean = Tmean; + retiMinMax.Tsigma = Tsigma; + retiMinMax.Tmin = Tmin; + retiMinMax.Tmax = Tmax; + locallretiminmax.push_back(retiMinMax); + + // Recalculate references after + if (params->locallab.spots.at(sp).spotMethod == "exc") { + ipf.calc_ref(sp, reserv.get(), reserv.get(), 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huer, chromar, lumar, sobeler, avg, locwavCurveden, locwavdenutili); + } else { + ipf.calc_ref(sp, nprevl, nprevl, 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huer, chromar, lumar, sobeler, avg, locwavCurveden, locwavdenutili); + } + + // Update Locallab reference values according to recurs parameter + if (params->locallab.spots.at(sp).recurs) { + locallref.at(sp).chromar = chromar; + locallref.at(sp).lumar = lumar; + locallref.at(sp).huer = huer; + } + } + + // Transmit Locallab reference values and Locallab Retinex min/max to LocallabListener + if (locallListener) { + locallListener->refChanged(locallref, params->locallab.selspot); + locallListener->minmaxChanged(locallretiminmax, params->locallab.selspot); + } + ipf.lab2rgb(*nprevl, *oprevi, params->icm.workingProfile); + //************************************************************* + // end locallab + //************************************************************* + + } + if ((todo & M_RGBCURVE) || (todo & M_CROP)) { //complexCurve also calculated pre-curves histogram depending on crop CurveFactory::complexCurve(params->toneCurve.expcomp, params->toneCurve.black / 65535.0, @@ -1026,259 +1285,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) if ((todo & (M_LUMINANCE + M_COLOR)) || (todo & M_AUTOEXP)) { nprevl->CopyFrom(oprevl); - // int maxspot = 1; - //************************************************************* - // locallab - //************************************************************* - - if (params->locallab.enabled && !params->locallab.spots.empty()) { - /* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - * 2017 2018 Jacques Desmis - * 2019 Pierre Cabrera - */ - const std::unique_ptr reserv(new LabImage(*oprevl, true)); - const std::unique_ptr lastorigimp(new LabImage(*oprevl, true)); - float **shbuffer = nullptr; - int sca = 1; - double huere, chromare, lumare, huerefblu, chromarefblu, lumarefblu, sobelre; - float avge; - std::vector locallref; - std::vector locallretiminmax; - huerefs.resize(params->locallab.spots.size()); - huerefblurs.resize(params->locallab.spots.size()); - chromarefblurs.resize(params->locallab.spots.size()); - lumarefblurs.resize(params->locallab.spots.size()); - chromarefs.resize(params->locallab.spots.size()); - lumarefs.resize(params->locallab.spots.size()); - sobelrefs.resize(params->locallab.spots.size()); - avgs.resize(params->locallab.spots.size()); - - for (int sp = 0; sp < (int)params->locallab.spots.size(); sp++) { - // Set local curves of current spot to LUT - locRETgainCurve.Set(params->locallab.spots.at(sp).localTgaincurve); - locRETtransCurve.Set(params->locallab.spots.at(sp).localTtranscurve); - const bool LHutili = loclhCurve.Set(params->locallab.spots.at(sp).LHcurve); - const bool HHutili = lochhCurve.Set(params->locallab.spots.at(sp).HHcurve); - const bool CHutili = locchCurve.Set(params->locallab.spots.at(sp).CHcurve); - const bool lcmasutili = locccmasCurve.Set(params->locallab.spots.at(sp).CCmaskcurve); - const bool llmasutili = locllmasCurve.Set(params->locallab.spots.at(sp).LLmaskcurve); - const bool lhmasutili = lochhmasCurve.Set(params->locallab.spots.at(sp).HHmaskcurve); - const bool lhhmasutili = lochhhmasCurve.Set(params->locallab.spots.at(sp).HHhmaskcurve); - const bool llmasexputili = locllmasexpCurve.Set(params->locallab.spots.at(sp).LLmaskexpcurve); - const bool lcmasexputili = locccmasexpCurve.Set(params->locallab.spots.at(sp).CCmaskexpcurve); - const bool lhmasexputili = lochhmasexpCurve.Set(params->locallab.spots.at(sp).HHmaskexpcurve); - const bool llmasSHutili = locllmasSHCurve.Set(params->locallab.spots.at(sp).LLmaskSHcurve); - const bool lcmasSHutili = locccmasSHCurve.Set(params->locallab.spots.at(sp).CCmaskSHcurve); - const bool lhmasSHutili = lochhmasSHCurve.Set(params->locallab.spots.at(sp).HHmaskSHcurve); - const bool llmasvibutili = locllmasvibCurve.Set(params->locallab.spots.at(sp).LLmaskvibcurve); - const bool lcmasvibutili = locccmasvibCurve.Set(params->locallab.spots.at(sp).CCmaskvibcurve); - const bool lhmasvibutili = lochhmasvibCurve.Set(params->locallab.spots.at(sp).HHmaskvibcurve); - const bool llmascbutili = locllmascbCurve.Set(params->locallab.spots.at(sp).LLmaskcbcurve); - const bool lcmascbutili = locccmascbCurve.Set(params->locallab.spots.at(sp).CCmaskcbcurve); - const bool lhmascbutili = lochhmascbCurve.Set(params->locallab.spots.at(sp).HHmaskcbcurve); - const bool llmaslcutili = locllmaslcCurve.Set(params->locallab.spots.at(sp).LLmasklccurve); - const bool lcmaslcutili = locccmaslcCurve.Set(params->locallab.spots.at(sp).CCmasklccurve); - const bool lhmaslcutili = lochhmaslcCurve.Set(params->locallab.spots.at(sp).HHmasklccurve); - const bool llmasretiutili = locllmasretiCurve.Set(params->locallab.spots.at(sp).LLmaskreticurve); - const bool lcmasretiutili = locccmasretiCurve.Set(params->locallab.spots.at(sp).CCmaskreticurve); - const bool lhmasretiutili = lochhmasretiCurve.Set(params->locallab.spots.at(sp).HHmaskreticurve); - const bool llmastmutili = locllmastmCurve.Set(params->locallab.spots.at(sp).LLmasktmcurve); - const bool lcmastmutili = locccmastmCurve.Set(params->locallab.spots.at(sp).CCmasktmcurve); - const bool lhmastmutili = lochhmastmCurve.Set(params->locallab.spots.at(sp).HHmasktmcurve); - const bool llmasblutili = locllmasblCurve.Set(params->locallab.spots.at(sp).LLmaskblcurve); - const bool lcmasblutili = locccmasblCurve.Set(params->locallab.spots.at(sp).CCmaskblcurve); - const bool lhmasblutili = lochhmasblCurve.Set(params->locallab.spots.at(sp).HHmaskblcurve); - const bool llmaslogutili = locllmaslogCurve.Set(params->locallab.spots.at(sp).LLmaskcurveL); - const bool lcmaslogutili = locccmaslogCurve.Set(params->locallab.spots.at(sp).CCmaskcurveL); - const bool lhmaslogutili = lochhmaslogCurve.Set(params->locallab.spots.at(sp).HHmaskcurveL); - - const bool lcmas_utili = locccmas_Curve.Set(params->locallab.spots.at(sp).CCmask_curve); - const bool llmas_utili = locllmas_Curve.Set(params->locallab.spots.at(sp).LLmask_curve); - const bool lhmas_utili = lochhmas_Curve.Set(params->locallab.spots.at(sp).HHmask_curve); - const bool lhhmas_utili = lochhhmas_Curve.Set(params->locallab.spots.at(sp).HHhmask_curve); - const bool lmasutiliblwav = loclmasCurveblwav.Set(params->locallab.spots.at(sp).LLmaskblcurvewav); - const bool lmasutilicolwav = loclmasCurvecolwav.Set(params->locallab.spots.at(sp).LLmaskcolcurvewav); - const bool locwavutili = locwavCurve.Set(params->locallab.spots.at(sp).locwavcurve); - const bool loclevwavutili = loclevwavCurve.Set(params->locallab.spots.at(sp).loclevwavcurve); - const bool locconwavutili = locconwavCurve.Set(params->locallab.spots.at(sp).locconwavcurve); - const bool loccompwavutili = loccompwavCurve.Set(params->locallab.spots.at(sp).loccompwavcurve); - const bool loccomprewavutili = loccomprewavCurve.Set(params->locallab.spots.at(sp).loccomprewavcurve); - const bool locwavhueutili = locwavCurvehue.Set(params->locallab.spots.at(sp).locwavcurvehue); - const bool locwavdenutili = locwavCurveden.Set(params->locallab.spots.at(sp).locwavcurveden); - const bool locedgwavutili = locedgwavCurve.Set(params->locallab.spots.at(sp).locedgwavcurve); - const bool lmasutili_wav = loclmasCurve_wav.Set(params->locallab.spots.at(sp).LLmask_curvewav); - const bool locallutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).llcurve, lllocalcurve, sca); - const bool localclutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).clcurve, cllocalcurve, sca); - const bool locallcutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).lccurve, lclocalcurve, sca); - const bool localcutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).cccurve, cclocalcurve, sca); - const bool localrgbutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).rgbcurve, rgblocalcurve, sca); - const bool localexutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).excurve, exlocalcurve, sca); - const bool localmaskutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmaskcurve, lmasklocalcurve, sca); - const bool localmaskexputili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmaskexpcurve, lmaskexplocalcurve, sca); - const bool localmaskSHutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).LmaskSHcurve, lmaskSHlocalcurve, sca); - const bool localmaskvibutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmaskvibcurve, lmaskviblocalcurve, sca); - const bool localmasktmutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmasktmcurve, lmasktmlocalcurve, sca); - const bool localmaskretiutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmaskreticurve, lmaskretilocalcurve, sca); - const bool localmaskcbutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmaskcbcurve, lmaskcblocalcurve, sca); - const bool localmaskblutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmaskblcurve, lmaskbllocalcurve, sca); - const bool localmasklcutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmasklccurve, lmasklclocalcurve, sca); - const bool localmasklogutili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).LmaskcurveL, lmaskloglocalcurve, sca); - const bool localmask_utili = CurveFactory::diagonalCurve2Lut(params->locallab.spots.at(sp).Lmask_curve, lmasklocal_curve, sca); - double ecomp = params->locallab.spots.at(sp).expcomp; - double black = params->locallab.spots.at(sp).black; - double hlcompr = params->locallab.spots.at(sp).hlcompr; - double hlcomprthresh = params->locallab.spots.at(sp).hlcomprthresh; - double shcompr = params->locallab.spots.at(sp).shcompr; - double br = params->locallab.spots.at(sp).lightness; - double cont = params->locallab.spots.at(sp).contrast; - - if (black < 0. && params->locallab.spots.at(sp).expMethod == "pde") { - black *= 1.5; - } - - // Reference parameters computation - if (params->locallab.spots.at(sp).spotMethod == "exc") { - ipf.calc_ref(sp, reserv.get(), reserv.get(), 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge, locwavCurveden, locwavdenutili); - } else { - ipf.calc_ref(sp, nprevl, nprevl, 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, avge, locwavCurveden, locwavdenutili); - } - - double huerblu = huerefblurs[sp] = huerefblu; - double chromarblu = chromarefblurs[sp] = chromarefblu; - double lumarblu = lumarefblurs[sp] = lumarefblu; - double huer = huerefs[sp] = huere; - double chromar = chromarefs[sp] = chromare; - double lumar = lumarefs[sp] = lumare ; - double sobeler = sobelrefs[sp] = sobelre; - float avg = avgs[sp] = avge; - CurveFactory::complexCurvelocal(ecomp, black / 65535., hlcompr, hlcomprthresh, shcompr, br, cont, lumar, - hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, avg, - sca); - - // Save Locallab mask curve references for current spot - LocallabListener::locallabRef spotref; - spotref.huer = huer; - spotref.lumar = lumar; - spotref.chromar = chromar; - locallref.push_back(spotref); - - // Locallab tools computation - /* Notes: - * - shbuffer is used as nullptr - */ - // Locallab mask is only showed in detailed image - float minCD; - float maxCD; - float mini; - float maxi; - float Tmean; - float Tsigma; - float Tmin; - float Tmax; - int lastsav; - ipf.Lab_Local(3, sp, (float**)shbuffer, nprevl, nprevl, reserv.get(), lastorigimp.get(), 0, 0, pW, pH, scale, locRETgainCurve, locRETtransCurve, - lllocalcurve, locallutili, - cllocalcurve, localclutili, - lclocalcurve, locallcutili, - loclhCurve, lochhCurve, locchCurve, - lmasklocalcurve, localmaskutili, - lmaskexplocalcurve, localmaskexputili, - lmaskSHlocalcurve, localmaskSHutili, - lmaskviblocalcurve, localmaskvibutili, - lmasktmlocalcurve, localmasktmutili, - lmaskretilocalcurve, localmaskretiutili, - lmaskcblocalcurve, localmaskcbutili, - lmaskbllocalcurve, localmaskblutili, - lmasklclocalcurve, localmasklcutili, - lmaskloglocalcurve, localmasklogutili, - lmasklocal_curve, localmask_utili, - - locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili, lochhhmasCurve, lhhmasutili, locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, - locccmasSHCurve, lcmasSHutili, locllmasSHCurve, llmasSHutili, lochhmasSHCurve, lhmasSHutili, - locccmasvibCurve, lcmasvibutili, locllmasvibCurve, llmasvibutili, lochhmasvibCurve, lhmasvibutili, - locccmascbCurve, lcmascbutili, locllmascbCurve, llmascbutili, lochhmascbCurve, lhmascbutili, - locccmasretiCurve, lcmasretiutili, locllmasretiCurve, llmasretiutili, lochhmasretiCurve, lhmasretiutili, - locccmastmCurve, lcmastmutili, locllmastmCurve, llmastmutili, lochhmastmCurve, lhmastmutili, - locccmasblCurve, lcmasblutili, locllmasblCurve, llmasblutili, lochhmasblCurve, lhmasblutili, - locccmaslcCurve, lcmaslcutili, locllmaslcCurve, llmaslcutili, lochhmaslcCurve, lhmaslcutili, - locccmaslogCurve, lcmaslogutili, locllmaslogCurve, llmaslogutili, lochhmaslogCurve, lhmaslogutili, - - locccmas_Curve, lcmas_utili, locllmas_Curve, llmas_utili, lochhmas_Curve, lhmas_utili, - lochhhmas_Curve, lhhmas_utili, - loclmasCurveblwav, lmasutiliblwav, - loclmasCurvecolwav, lmasutilicolwav, - locwavCurve, locwavutili, - loclevwavCurve, loclevwavutili, - locconwavCurve, locconwavutili, - loccompwavCurve, loccompwavutili, - loccomprewavCurve, loccomprewavutili, - locwavCurvehue, locwavhueutili, - locwavCurveden, locwavdenutili, - locedgwavCurve, locedgwavutili, - loclmasCurve_wav, lmasutili_wav, - LHutili, HHutili, CHutili, cclocalcurve, localcutili, rgblocalcurve, localrgbutili, localexutili, exlocalcurve, hltonecurveloc, shtonecurveloc, tonecurveloc, lightCurveloc, - huerblu, chromarblu, lumarblu, huer, chromar, lumar, sobeler, lastsav, false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax); - - if (sp + 1u < params->locallab.spots.size()) { - // do not copy for last spot as it is not needed anymore - lastorigimp->CopyFrom(nprevl); - } - - // Save Locallab Retinex min/max for current spot - LocallabListener::locallabRetiMinMax retiMinMax; - retiMinMax.cdma = maxCD; - retiMinMax.cdmin = minCD; - retiMinMax.mini = mini; - retiMinMax.maxi = maxi; - retiMinMax.Tmean = Tmean; - retiMinMax.Tsigma = Tsigma; - retiMinMax.Tmin = Tmin; - retiMinMax.Tmax = Tmax; - locallretiminmax.push_back(retiMinMax); - - // Recalculate references after - if (params->locallab.spots.at(sp).spotMethod == "exc") { - ipf.calc_ref(sp, reserv.get(), reserv.get(), 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huer, chromar, lumar, sobeler, avg, locwavCurveden, locwavdenutili); - } else { - ipf.calc_ref(sp, nprevl, nprevl, 0, 0, pW, pH, scale, huerefblu, chromarefblu, lumarefblu, huer, chromar, lumar, sobeler, avg, locwavCurveden, locwavdenutili); - } - - // Update Locallab reference values according to recurs parameter - if (params->locallab.spots.at(sp).recurs) { - locallref.at(sp).chromar = chromar; - locallref.at(sp).lumar = lumar; - locallref.at(sp).huer = huer; - } - } - - // Transmit Locallab reference values and Locallab Retinex min/max to LocallabListener - if (locallListener) { - locallListener->refChanged(locallref, params->locallab.selspot); - locallListener->minmaxChanged(locallretiminmax, params->locallab.selspot); - } - } - - //************************************************************* - // end locallab - //************************************************************* - histCCurve.clear(); histLCurve.clear(); ipf.chromiLuminanceCurve(nullptr, pW, nprevl, nprevl, chroma_acurve, chroma_bcurve, satcurve, lhskcurve, clcurve, lumacurve, utili, autili, butili, ccutili, cclutili, clcutili, histCCurve, histLCurve); diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 01fc1a9f4..ee8df87e5 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -2013,7 +2013,10 @@ void ImProcFunctions::getAutoLogloc(int sp, ImageSource *imgsrc, float *sourceg, imgsrc->convertColorSpace(&img, params->icm, imgsrc->getWB()); float minVal = RT_INFINITY; float maxVal = -RT_INFINITY; - const float ec = std::pow(2.f, params->toneCurve.expcomp); + float ec = 1.f; + if(params->toneCurve.autoexp) {//take into account exposure, only if autoexp, in other cases now it's after LA + ec = std::pow(2.f, params->toneCurve.expcomp); + } constexpr float noise = 1e-5; const int h = fh / SCALE; @@ -2041,7 +2044,7 @@ void ImProcFunctions::getAutoLogloc(int sp, ImageSource *imgsrc, float *sourceg, } } } - + maxVal *= 1.2f; //or 1.5f;slightly increase max //approximation sourcegray yb source = 0.4 * yb if (maxVal > minVal) { @@ -2050,7 +2053,7 @@ void ImProcFunctions::getAutoLogloc(int sp, ImageSource *imgsrc, float *sourceg, if (settings->verbose) { std::cout << "AutoLog: min = " << minVal << ", max = " << maxVal - << ", DR = " << dynamic_range << std::endl; + << ", Dynamic Range = " << dynamic_range << std::endl; } if (Autogr[sp]) { @@ -2107,9 +2110,12 @@ void ImProcFunctions::getAutoLogloc(int sp, ImageSource *imgsrc, float *sourceg, } } } + constexpr float MIN_WHITE = 2.f; + constexpr float MAX_BLACK = -3.5f; + const float gray = sourceg[sp] / 100.f; - whiteev[sp] = xlogf(maxVal / gray) / log2; - blackev[sp] = whiteev[sp] - dynamic_range; + whiteev[sp] = rtengine::max(xlogf(maxVal / gray) / log2, MIN_WHITE); + blackev[sp] = rtengine::min(whiteev[sp] - dynamic_range, MAX_BLACK); //calculate La - Absolute luminance shooting diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index ad16b881d..1adb3853d 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -31,13 +31,13 @@ int refreshmap[rtengine::NUMOFEVENTS] = { ALL, // EvProfileLoaded, ALL, // EvProfileChanged, ALL, // EvHistoryBrowsed, - RGBCURVE, // EvBrightness, - RGBCURVE, // EvContrast, - RGBCURVE, // EvBlack, - RGBCURVE, // EvExpComp, - RGBCURVE, // EvHLCompr, - RGBCURVE, // EvSHCompr, - RGBCURVE, // EvToneCurve1, + AUTOEXP, // EvBrightness, + AUTOEXP, // EvContrast, + AUTOEXP, // EvBlack, + AUTOEXP, // EvExpComp, + AUTOEXP, // EvHLCompr, + AUTOEXP, // EvSHCompr, + AUTOEXP, // EvToneCurve1, AUTOEXP, // EvAutoExp, AUTOEXP, // EvClip, LUMINANCECURVE, // EvLBrightness, @@ -60,16 +60,16 @@ int refreshmap[rtengine::NUMOFEVENTS] = { SHARPENING, // EvShrDAmount, SHARPENING, // EvShrDDamping, SHARPENING, // EvShrDIterations, - TRANSFORM, // EvLCPUseDist, + HDR, // EvLCPUseDist, DARKFRAME, // EvLCPUseVign, - TRANSFORM, // EvLCPUseCA, + HDR, // EvLCPUseCA, M_VOID, // EvFixedExp ALLNORAW, // EvWBMethod, ALLNORAW, // EvWBTemp, ALLNORAW, // EvWBGreen, - RGBCURVE, // EvToneCurveMode1, - RGBCURVE, // EvToneCurve2, - RGBCURVE, // EvToneCurveMode2, + AUTOEXP, // EvToneCurveMode1, + AUTOEXP, // EvToneCurve2, + AUTOEXP, // EvToneCurveMode2, 0, // EvLDNRadius: obsolete, 0, // EvLDNEdgeTolerance: obsolete, 0, // EvCDNEnabled:obsolete, @@ -77,29 +77,29 @@ int refreshmap[rtengine::NUMOFEVENTS] = { RGBCURVE | M_AUTOEXP, // EvDCPToneCurve, ALLNORAW, // EvDCPIlluminant, RETINEX, // EvSHEnabled, - RGBCURVE, // EvSHHighlights, - RGBCURVE, // EvSHShadows, - RGBCURVE, // EvSHHLTonalW, - RGBCURVE, // EvSHSHTonalW, - RGBCURVE, // EvSHLContrast, + AUTOEXP, // EvSHHighlights, + AUTOEXP, // EvSHShadows, + AUTOEXP, // EvSHHLTonalW, + AUTOEXP, // EvSHSHTonalW, + AUTOEXP, // EvSHLContrast, RETINEX, // EvSHRadius, ALLNORAW, // EvCTRotate, ALLNORAW, // EvCTHFlip, ALLNORAW, // EvCTVFlip, - TRANSFORM, // EvROTDegree, - TRANSFORM, // EvTransAutoFill, - TRANSFORM, // EvDISTAmount, + HDR, // EvROTDegree, + HDR, // EvTransAutoFill, + HDR, // EvDISTAmount, ALL, // EvBookmarkSelected, CROP, // EvCrop, - TRANSFORM, // EvCACorr, + HDR, // EvCACorr, ALLNORAW, // EvHREnabled, ALLNORAW, // EvHRAmount, ALLNORAW, // EvHRMethod, DEMOSAIC, // EvWProfile, OUTPUTPROFILE, // EvOProfile, ALLNORAW, // EvIProfile, - TRANSFORM, // EvVignettingAmount, - RGBCURVE, // EvChMixer, + HDR, // EvVignettingAmount, + AUTOEXP, // EvChMixer, RESIZE, // EvResizeScale, RESIZE, // EvResizeMethod, EXIF, // EvExif, @@ -110,9 +110,9 @@ int refreshmap[rtengine::NUMOFEVENTS] = { RESIZE, // EvResizeEnabled ALL, // EvProfileChangeNotification RETINEX, // EvShrHighQuality - TRANSFORM, // EvPerspCorr + HDR, // EvPerspCorr DARKFRAME, // EvLCPFile - RGBCURVE, // EvRGBrCurveLumamode + AUTOEXP, // EvRGBrCurveLumamode IMPULSEDENOISE, // EvIDNEnabled, IMPULSEDENOISE, // EvIDNThresh, ALLNORAW, // EvDPDNEnabled, @@ -126,15 +126,15 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // EvLbCurve, DEMOSAIC, // EvDemosaicMethod DARKFRAME, // EvPreProcessHotPixel - RGBCURVE, // EvSaturation, - RGBCURVE, // EvHSVEqualizerH, - RGBCURVE, // EvHSVEqualizerS, - RGBCURVE, // EvHSVEqualizerV, - RGBCURVE, // EvHSVEqEnabled, + AUTOEXP, // EvSaturation, + AUTOEXP, // EvHSVEqualizerH, + AUTOEXP, // EvHSVEqualizerS, + AUTOEXP, // EvHSVEqualizerV, + AUTOEXP, // EvHSVEqEnabled, DEFRINGE, // EvDefringeEnabled, DEFRINGE, // EvDefringeRadius, DEFRINGE, // EvDefringeThreshold, - RGBCURVE, // EvHLComprThreshold, + AUTOEXP, // EvHLComprThreshold, RESIZE, // EvResizeBoundingBox RESIZE, // EvResizeAppliesTo LUMINANCECURVE, // EvCBAvoidClip, @@ -156,7 +156,7 @@ int refreshmap[rtengine::NUMOFEVENTS] = { FLATFIELD, // EvFlatFieldAutoSelect, FLATFIELD, // EvFlatFieldBlurRadius, FLATFIELD, // EvFlatFieldBlurType, - TRANSFORM, // EvAutoDIST, + HDR, // EvAutoDIST, ALLNORAW, // EvDPDNLumCurve, ALLNORAW, // EvDPDNChromCurve, GAMMA, // EvGAMMA @@ -177,26 +177,26 @@ int refreshmap[rtengine::NUMOFEVENTS] = { SHARPENING, // EvSharpenMicroEnabled SHARPENING, // EvSharpenMicroMatrix DEMOSAIC, // EvDemosaicALLEnhanced Disabled but not removed for now, may be reintroduced some day - RGBCURVE, // EvVibranceEnabled - RGBCURVE, // EvVibrancePastels - RGBCURVE, // EvVibranceSaturated - RGBCURVE, // EvVibranceProtectSkins - RGBCURVE, // EvVibranceAvoidColorShift - RGBCURVE, // EvVibrancePastSatTog - RGBCURVE, // EvVibrancePastSatThreshold + AUTOEXP, // EvVibranceEnabled + AUTOEXP, // EvVibrancePastels + AUTOEXP, // EvVibranceSaturated + AUTOEXP, // EvVibranceProtectSkins + AUTOEXP, // EvVibranceAvoidColorShift + AUTOEXP, // EvVibrancePastSatTog + AUTOEXP, // EvVibrancePastSatThreshold SHARPENING, // EvEPDStrength SHARPENING, // EvEPDEdgeStopping SHARPENING, // EvEPDScale SHARPENING, // EvEPDReweightingIterates SHARPENING, // EvEPDEnabled - RGBCURVE, // EvRGBrCurve - RGBCURVE, // EvRGBgCurve - RGBCURVE, // EvRGBbCurve - RGBCURVE, // EvNeutralExp + AUTOEXP, // EvRGBrCurve + AUTOEXP, // EvRGBgCurve + AUTOEXP, // EvRGBbCurve + AUTOEXP, // EvNeutralExp DEMOSAIC | M_PREPROC, // EvDemosaicMethodPreProc LUMINANCECURVE, // EvLCCurve LUMINANCECURVE, // EvLCHCurve - RGBCURVE, // EvVibranceSkinTonesCurve + AUTOEXP, // EvVibranceSkinTonesCurve LUMINANCECURVE, // EvLLCCurve LUMINANCECURVE, // EvLLCredsk ALLNORAW, // EvDPDNLdetail @@ -236,81 +236,81 @@ int refreshmap[rtengine::NUMOFEVENTS] = { DEFRINGE, // EvPFCurve ALLNORAW, // EvWBequal ALLNORAW, // EvWBequalbo - TRANSFORM, // EvGradientDegree - TRANSFORM, // EvGradientEnabled - TRANSFORM, // EvPCVignetteStrength - TRANSFORM, // EvPCVignetteEnabled - RGBCURVE, // EvBWChmixEnabled - RGBCURVE, // EvBWred - RGBCURVE, // EvBWgreen - RGBCURVE, // EvBWblue - RGBCURVE, // EvBWredgam - RGBCURVE, // EvBWgreengam - RGBCURVE, // EvBWbluegam - RGBCURVE, // EvBWfilter - RGBCURVE, // EvBWsetting - RGBCURVE, // EvBWoran - RGBCURVE, // EvBWyell - RGBCURVE, // EvBWcyan - RGBCURVE, // EvBWmag - RGBCURVE, // EvBpur - RGBCURVE, // EvBWLuminanceEqual - RGBCURVE, // EvBWChmixEnabledLm - RGBCURVE, // EvBWmethod - RGBCURVE, // EvBWBeforeCurve - RGBCURVE, // EvBWBeforeCurveMode - RGBCURVE, // EvBWAfterCurve - RGBCURVE, // EvBWAfterCurveMode - RGBCURVE, // EvAutoch + HDR, // EvGradientDegree + HDR, // EvGradientEnabled + HDR, // EvPCVignetteStrength + HDR, // EvPCVignetteEnabled + AUTOEXP, // EvBWChmixEnabled + AUTOEXP, // EvBWred + AUTOEXP, // EvBWgreen + AUTOEXP, // EvBWblue + AUTOEXP, // EvBWredgam + AUTOEXP, // EvBWgreengam + AUTOEXP, // EvBWbluegam + AUTOEXP, // EvBWfilter + AUTOEXP, // EvBWsetting + AUTOEXP, // EvBWoran + AUTOEXP, // EvBWyell + AUTOEXP, // EvBWcyan + AUTOEXP, // EvBWmag + AUTOEXP, // EvBpur + AUTOEXP, // EvBWLuminanceEqual + AUTOEXP, // EvBWChmixEnabledLm + AUTOEXP, // EvBWmethod + AUTOEXP, // EvBWBeforeCurve + AUTOEXP, // EvBWBeforeCurveMode + AUTOEXP, // EvBWAfterCurve + AUTOEXP, // EvBWAfterCurveMode + AUTOEXP, // EvAutoch 0, // --unused-- - RGBCURVE, // EvNeutralBW - TRANSFORM, // EvGradientFeather - TRANSFORM, // EvGradientStrength - TRANSFORM, // EvGradientCenter - TRANSFORM, // EvPCVignetteFeather - TRANSFORM, // EvPCVignetteRoundness - TRANSFORM, // EvVignettingRadius, - TRANSFORM, // EvVignettingStrength - TRANSFORM, // EvVignettingCenter + AUTOEXP, // EvNeutralBW + HDR, // EvGradientFeather + HDR, // EvGradientStrength + HDR, // EvGradientCenter + HDR, // EvPCVignetteFeather + HDR, // EvPCVignetteRoundness + HDR, // EvVignettingRadius, + HDR, // EvVignettingStrength + HDR, // EvVignettingCenter LUMINANCECURVE, // EvLCLCurve LUMINANCECURVE, // EvLLHCurve LUMINANCECURVE, // EvLHHCurve ALLNORAW, // EvDirPyrEqualizerThreshold ALLNORAW, // EvDPDNenhance - RGBCURVE, // EvBWMethodalg + AUTOEXP, // EvBWMethodalg ALLNORAW, // EvDirPyrEqualizerSkin ALLNORAW, // EvDirPyrEqlgamutlab ALLNORAW, // EvDirPyrEqualizerHueskin ALLNORAW, // EvDPDNmedian ALLNORAW, // EvDPDNmedmet - RGBCURVE, // EvColorToningEnabled - RGBCURVE, // EvColorToningColor - RGBCURVE, // EvColorToningOpacity - RGBCURVE, // EvColorToningCLCurve - RGBCURVE, // EvColorToningMethod - RGBCURVE, // EvColorToningLLCurve - RGBCURVE, // EvColorToningredlow - RGBCURVE, // EvColorToninggreenlow - RGBCURVE, // EvColorToningbluelow - RGBCURVE, // EvColorToningredmed - RGBCURVE, // EvColorToninggreenmed - RGBCURVE, // EvColorToningbluemed - RGBCURVE, // EvColorToningredhigh - RGBCURVE, // EvColorToninggreenhigh - RGBCURVE, // EvColorToningbluehigh - RGBCURVE, // EvColorToningbalance - RGBCURVE, // EvColorToningNeutral - RGBCURVE, // EvColorToningsatlow - RGBCURVE, // EvColorToningsathigh - RGBCURVE, // EvColorToningTwocolor - RGBCURVE, // EvColorToningNeutralcur - RGBCURVE, // EvColorToningLumamode - RGBCURVE, // EvColorToningShadows - RGBCURVE, // EvColorToningHighights - RGBCURVE, // EvColorToningSatProtection - RGBCURVE, // EvColorToningSatThreshold - RGBCURVE, // EvColorToningStrength - RGBCURVE, // EvColorToningautosat + AUTOEXP, // EvColorToningEnabled + AUTOEXP, // EvColorToningColor + AUTOEXP, // EvColorToningOpacity + AUTOEXP, // EvColorToningCLCurve + AUTOEXP, // EvColorToningMethod + AUTOEXP, // EvColorToningLLCurve + AUTOEXP, // EvColorToningredlow + AUTOEXP, // EvColorToninggreenlow + AUTOEXP, // EvColorToningbluelow + AUTOEXP, // EvColorToningredmed + AUTOEXP, // EvColorToninggreenmed + AUTOEXP, // EvColorToningbluemed + AUTOEXP, // EvColorToningredhigh + AUTOEXP, // EvColorToninggreenhigh + AUTOEXP, // EvColorToningbluehigh + AUTOEXP, // EvColorToningbalance + AUTOEXP, // EvColorToningNeutral + AUTOEXP, // EvColorToningsatlow + AUTOEXP, // EvColorToningsathigh + AUTOEXP, // EvColorToningTwocolor + AUTOEXP, // EvColorToningNeutralcur + AUTOEXP, // EvColorToningLumamode + AUTOEXP, // EvColorToningShadows + AUTOEXP, // EvColorToningHighights + AUTOEXP, // EvColorToningSatProtection + AUTOEXP, // EvColorToningSatThreshold + AUTOEXP, // EvColorToningStrength + AUTOEXP, // EvColorToningautosat ALLNORAW, // EvDPDNmetmed ALLNORAW, // EvDPDNrgbmet ALLNORAW, // EvDPDNpasses @@ -319,9 +319,9 @@ int refreshmap[rtengine::NUMOFEVENTS] = { DARKFRAME, // EvPreProcessExpBlackRed DARKFRAME, // EvPreProcessExpBlackGreen DARKFRAME, // EvPreProcessExpBlackBlue - RGBCURVE, // EvFilmSimulationEnabled - RGBCURVE, // EvFilmSimulationStrength - RGBCURVE, // EvFilmSimulationFilename + AUTOEXP, // EvFilmSimulationEnabled + AUTOEXP, // EvFilmSimulationStrength + AUTOEXP, // EvFilmSimulationFilename ALLNORAW, // EvDPDNLCurve ALLNORAW, // EvDPDNsmet DARKFRAME, // EvPreProcessDeadPixel @@ -518,553 +518,553 @@ int refreshmap[rtengine::NUMOFEVENTS] = { HDR, // EvTMFattalThreshold HDR, // EvTMFattalAmount ALLNORAW, // EvWBEnabled - RGBCURVE, // EvRGBEnabled + AUTOEXP, // EvRGBEnabled LUMINANCECURVE, // EvLEnabled DEMOSAIC, // EvPdShrEnabled CAPTURESHARPEN, // EvPdShrMaskToggled - LUMINANCECURVE, // EvLocallabSpotDeleted + AUTOEXP, // 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 - LUMINANCECURVE, // EvLocallabSpotSensiexclu - LUMINANCECURVE, // EvLocallabSpotStruc - LUMINANCECURVE, // EvlocallabEnabled - LUMINANCECURVE, // EvLocenacolor - LUMINANCECURVE, // Evlocallabcurvactiv - LUMINANCECURVE, // Evlocallablightness - LUMINANCECURVE, // Evlocallabcontrast - LUMINANCECURVE, // Evlocallabchroma - LUMINANCECURVE, // Evlocallabsensi - LUMINANCECURVE, // EvlocallabqualitycurveMethod - LUMINANCECURVE, // Evlocallabllshape - LUMINANCECURVE, // Evlocallabccshape - LUMINANCECURVE, // EvlocallabLHshape - LUMINANCECURVE, // EvlocallabHHshape - LUMINANCECURVE, // Evlocallabinvers - LUMINANCECURVE, // EvLocenaexpose - LUMINANCECURVE, // Evlocallabexpcomp - LUMINANCECURVE, // Evlocallabhlcompr - LUMINANCECURVE, // Evlocallabhlcomprthresh - LUMINANCECURVE, // Evlocallabblack - LUMINANCECURVE, // Evlocallabshcompr - LUMINANCECURVE, // Evlocallabwarm - LUMINANCECURVE, // Evlocallabsensiex - LUMINANCECURVE, // Evlocallabshapeexpos - LUMINANCECURVE, // EvLocenavibrance - LUMINANCECURVE, // EvlocallabSaturated - LUMINANCECURVE, // EvlocallabPastels - LUMINANCECURVE, // EvlocallabPastSatThreshold - LUMINANCECURVE, // EvlocallabProtectSkins - LUMINANCECURVE, // EvlocallabAvoidColorShift - LUMINANCECURVE, // EvlocallabPastSatTog - LUMINANCECURVE, // Evlocallabsensiv - LUMINANCECURVE, // EvlocallabSkinTonesCurve - LUMINANCECURVE, // EvLocenablur - LUMINANCECURVE, // Evlocallabradius - LUMINANCECURVE, // Evlocallabstrength - LUMINANCECURVE, // Evlocallabsensibn - LUMINANCECURVE, // EvlocallabblurMethod - LUMINANCECURVE, // Evlocallabactivlum - LUMINANCECURVE, // EvLocenatonemap - LUMINANCECURVE, // Evlocallabstren - LUMINANCECURVE, // Evlocallabgamma - LUMINANCECURVE, // Evlocallabestop - LUMINANCECURVE, // Evlocallabscaltm - LUMINANCECURVE, // Evlocallabrewei - LUMINANCECURVE, // Evlocallabsensitm - LUMINANCECURVE, // EvLocenareti - LUMINANCECURVE, // EvlocallabretinexMethod - LUMINANCECURVE, // Evlocallabstr - LUMINANCECURVE, // Evlocallabchrrt - LUMINANCECURVE, // Evlocallabneigh - LUMINANCECURVE, // Evlocallabvart - LUMINANCECURVE, // Evlocallabsensih - LUMINANCECURVE, // EvlocallabCTgainCurve - LUMINANCECURVE, // Evlocallabinversret - LUMINANCECURVE, // EvLocenasharp - LUMINANCECURVE, // Evlocallabsharradius - LUMINANCECURVE, // Evlocallabsharamount - LUMINANCECURVE, // Evlocallabshardamping - LUMINANCECURVE, // Evlocallabshariter - LUMINANCECURVE, // Evlocallabsensis - LUMINANCECURVE, // Evlocallabinverssha - LUMINANCECURVE, // EvLocenacbdl - LUMINANCECURVE, // EvlocallabEqualizer - LUMINANCECURVE, // Evlocallabchromacbdl - LUMINANCECURVE, // EvlocallabThresho - LUMINANCECURVE, // Evlocallabsensicb - LUMINANCECURVE, // EvLocenadenoi - LUMINANCECURVE, // Evlocallabnoiselumf - LUMINANCECURVE, // Evlocallabnoiselumc - LUMINANCECURVE, // Evlocallabnoiselumdetail - LUMINANCECURVE, // Evlocallabnoiselequal - LUMINANCECURVE, // Evlocallabnoisechrof - LUMINANCECURVE, // Evlocallabnoisechroc - LUMINANCECURVE, // Evlocallabnoisechrodetail - LUMINANCECURVE, // Evlocallabadjblur - LUMINANCECURVE, // Evlocallabbilateral - LUMINANCECURVE, // Evlocallabsensiden - LUMINANCECURVE, // Evlocallabavoid - LUMINANCECURVE, // Evlocallabsharcontrast - LUMINANCECURVE, // EvLocenacontrast - LUMINANCECURVE, // Evlocallablcradius - LUMINANCECURVE, // Evlocallablcamount - LUMINANCECURVE, // Evlocallablcdarkness - LUMINANCECURVE, // Evlocallablclightness - LUMINANCECURVE, // Evlocallabsensilc - LUMINANCECURVE, // Evlocallabdehaz - LUMINANCECURVE, // EvLocenasoft - LUMINANCECURVE, // EvLocallabstreng - LUMINANCECURVE, // EvLocallabsensisf - LUMINANCECURVE, // Evlocallabsharblur - LUMINANCECURVE, // EvLocenalabregion - LUMINANCECURVE, // EvlocallabshowmaskMethod - LUMINANCECURVE, // EvLocallabSpotSelectedWithMask - LUMINANCECURVE, // EvlocallabCCmaskshape - LUMINANCECURVE, // EvlocallabLLmaskshape - LUMINANCECURVE, // EvlocallabCCmaskexpshape - LUMINANCECURVE, // EvlocallabLLmaskexpshape - LUMINANCECURVE, // EvlocallabHHmaskshape - LUMINANCECURVE, // Evlocallabstructcol - LUMINANCECURVE, // Evlocallabstructexp - LUMINANCECURVE, // EvlocallabHHmaskexpshape - LUMINANCECURVE, // Evlocallabblendmaskcol - LUMINANCECURVE, // Evlocallabblendmaskexp - LUMINANCECURVE, // Evlocallabblurexpde - LUMINANCECURVE, // EvLocallabEnaColorMask - LUMINANCECURVE, // EvLocallabEnaExpMask - LUMINANCECURVE, // Evlocallabblurcolde - LUMINANCECURVE, // Evlocallabinversex - LUMINANCECURVE, // Evlocallabstructexclu - LUMINANCECURVE, // Evlocallabexpchroma - LUMINANCECURVE, // EvLocallabLabGridValue - LUMINANCECURVE, // EvLocallabLabstrengthgrid - LUMINANCECURVE, // EvLocallabgridMethod - LUMINANCECURVE, // EvLocenashadhigh - LUMINANCECURVE, // EvLocallabhighlights - LUMINANCECURVE, // EvLocallabh_tonalwidth - LUMINANCECURVE, // EvLocallabshadows - LUMINANCECURVE, // EvLocallabs_tonalwidth - LUMINANCECURVE, // EvLocallabsh_radius - LUMINANCECURVE, // EvLocallabsensihs - LUMINANCECURVE, // Evlocallabradmaskcol - LUMINANCECURVE, // Evlocallabradmaskexp - LUMINANCECURVE, // EvlocallabToolAdded - LUMINANCECURVE, // EvlocallabCCmaskSHshape - LUMINANCECURVE, // EvlocallabLLmaskSHshape - LUMINANCECURVE, // EvlocallabHHmaskSHshape - LUMINANCECURVE, // EvlocallabblendmaskSH - LUMINANCECURVE, // EvLocallabEnaSHMask - LUMINANCECURVE, // EvlocallabradmaskSH - LUMINANCECURVE, // EvlocallabblurSHde - LUMINANCECURVE, // Evlocallabinverssh - LUMINANCECURVE, // EvLocallabSpotbalan - LUMINANCECURVE, // EvLocallabchromaskexp - LUMINANCECURVE, // EvLocallabgammaskexp - LUMINANCECURVE, // EvLocallabslomaskexp - LUMINANCECURVE, // EvLocallabsoftradiusexp - LUMINANCECURVE, // EvLocallabchromaskcol - LUMINANCECURVE, // EvLocallabgammaskcol - LUMINANCECURVE, // EvLocallabslomaskcol - LUMINANCECURVE, // EvLocallabchromaskSH - LUMINANCECURVE, // EvLocallabgammaskSH - LUMINANCECURVE, // EvLocallabslomaskSH - LUMINANCECURVE, // EvLocallabsoftradiuscol - LUMINANCECURVE, // EvLocallabsoftradiusret - LUMINANCECURVE, // EvLocallabsoftradiuscb - LUMINANCECURVE, // EvLocallabSpotTransitweak - LUMINANCECURVE, // EvLocallabclarityml - LUMINANCECURVE, // EvLocallabcontresid - LUMINANCECURVE, // Evlocallabnoiselumf0 - LUMINANCECURVE, // Evlocallabnoiselumf2 + AUTOEXP, // EvLocallabSpotShape + AUTOEXP, // EvLocallabSpotSpotMethod + AUTOEXP, // EvLocallabSpotShapeMethod + AUTOEXP, // EvLocallabSpotLocX + AUTOEXP, // EvLocallabSpotLocXL + AUTOEXP, // EvLocallabSpotLocY + AUTOEXP, // EvLocallabSpotLocYT + AUTOEXP, // EvLocallabSpotCenter + AUTOEXP, // EvLocallabSpotCircrad + AUTOEXP, // EvLocallabSpotQualityMethod + AUTOEXP, // EvLocallabSpotTransit + AUTOEXP, // EvLocallabSpotThresh + AUTOEXP, // EvLocallabSpotIter + AUTOEXP, // EvLocallabSpotSensiexclu + AUTOEXP, // EvLocallabSpotStruc + AUTOEXP, // EvlocallabEnabled + AUTOEXP, // EvLocenacolor + AUTOEXP, // Evlocallabcurvactiv + AUTOEXP, // Evlocallablightness + AUTOEXP, // Evlocallabcontrast + AUTOEXP, // Evlocallabchroma + AUTOEXP, // Evlocallabsensi + AUTOEXP, // EvlocallabqualitycurveMethod + AUTOEXP, // Evlocallabllshape + AUTOEXP, // Evlocallabccshape + AUTOEXP, // EvlocallabLHshape + AUTOEXP, // EvlocallabHHshape + AUTOEXP, // Evlocallabinvers + AUTOEXP, // EvLocenaexpose + AUTOEXP, // Evlocallabexpcomp + AUTOEXP, // Evlocallabhlcompr + AUTOEXP, // Evlocallabhlcomprthresh + AUTOEXP, // Evlocallabblack + AUTOEXP, // Evlocallabshcompr + AUTOEXP, // Evlocallabwarm + AUTOEXP, // Evlocallabsensiex + AUTOEXP, // Evlocallabshapeexpos + AUTOEXP, // EvLocenavibrance + AUTOEXP, // EvlocallabSaturated + AUTOEXP, // EvlocallabPastels + AUTOEXP, // EvlocallabPastSatThreshold + AUTOEXP, // EvlocallabProtectSkins + AUTOEXP, // EvlocallabAvoidColorShift + AUTOEXP, // EvlocallabPastSatTog + AUTOEXP, // Evlocallabsensiv + AUTOEXP, // EvlocallabSkinTonesCurve + AUTOEXP, // EvLocenablur + AUTOEXP, // Evlocallabradius + AUTOEXP, // Evlocallabstrength + AUTOEXP, // Evlocallabsensibn + AUTOEXP, // EvlocallabblurMethod + AUTOEXP, // Evlocallabactivlum + AUTOEXP, // EvLocenatonemap + AUTOEXP, // Evlocallabstren + AUTOEXP, // Evlocallabgamma + AUTOEXP, // Evlocallabestop + AUTOEXP, // Evlocallabscaltm + AUTOEXP, // Evlocallabrewei + AUTOEXP, // Evlocallabsensitm + AUTOEXP, // EvLocenareti + AUTOEXP, // EvlocallabretinexMethod + AUTOEXP, // Evlocallabstr + AUTOEXP, // Evlocallabchrrt + AUTOEXP, // Evlocallabneigh + AUTOEXP, // Evlocallabvart + AUTOEXP, // Evlocallabsensih + AUTOEXP, // EvlocallabCTgainCurve + AUTOEXP, // Evlocallabinversret + AUTOEXP, // EvLocenasharp + AUTOEXP, // Evlocallabsharradius + AUTOEXP, // Evlocallabsharamount + AUTOEXP, // Evlocallabshardamping + AUTOEXP, // Evlocallabshariter + AUTOEXP, // Evlocallabsensis + AUTOEXP, // Evlocallabinverssha + AUTOEXP, // EvLocenacbdl + AUTOEXP, // EvlocallabEqualizer + AUTOEXP, // Evlocallabchromacbdl + AUTOEXP, // EvlocallabThresho + AUTOEXP, // Evlocallabsensicb + AUTOEXP, // EvLocenadenoi + AUTOEXP, // Evlocallabnoiselumf + AUTOEXP, // Evlocallabnoiselumc + AUTOEXP, // Evlocallabnoiselumdetail + AUTOEXP, // Evlocallabnoiselequal + AUTOEXP, // Evlocallabnoisechrof + AUTOEXP, // Evlocallabnoisechroc + AUTOEXP, // Evlocallabnoisechrodetail + AUTOEXP, // Evlocallabadjblur + AUTOEXP, // Evlocallabbilateral + AUTOEXP, // Evlocallabsensiden + AUTOEXP, // Evlocallabavoid + AUTOEXP, // Evlocallabsharcontrast + AUTOEXP, // EvLocenacontrast + AUTOEXP, // Evlocallablcradius + AUTOEXP, // Evlocallablcamount + AUTOEXP, // Evlocallablcdarkness + AUTOEXP, // Evlocallablclightness + AUTOEXP, // Evlocallabsensilc + AUTOEXP, // Evlocallabdehaz + AUTOEXP, // EvLocenasoft + AUTOEXP, // EvLocallabstreng + AUTOEXP, // EvLocallabsensisf + AUTOEXP, // Evlocallabsharblur + AUTOEXP, // EvLocenalabregion + AUTOEXP, // EvlocallabshowmaskMethod + AUTOEXP, // EvLocallabSpotSelectedWithMask + AUTOEXP, // EvlocallabCCmaskshape + AUTOEXP, // EvlocallabLLmaskshape + AUTOEXP, // EvlocallabCCmaskexpshape + AUTOEXP, // EvlocallabLLmaskexpshape + AUTOEXP, // EvlocallabHHmaskshape + AUTOEXP, // Evlocallabstructcol + AUTOEXP, // Evlocallabstructexp + AUTOEXP, // EvlocallabHHmaskexpshape + AUTOEXP, // Evlocallabblendmaskcol + AUTOEXP, // Evlocallabblendmaskexp + AUTOEXP, // Evlocallabblurexpde + AUTOEXP, // EvLocallabEnaColorMask + AUTOEXP, // EvLocallabEnaExpMask + AUTOEXP, // Evlocallabblurcolde + AUTOEXP, // Evlocallabinversex + AUTOEXP, // Evlocallabstructexclu + AUTOEXP, // Evlocallabexpchroma + AUTOEXP, // EvLocallabLabGridValue + AUTOEXP, // EvLocallabLabstrengthgrid + AUTOEXP, // EvLocallabgridMethod + AUTOEXP, // EvLocenashadhigh + AUTOEXP, // EvLocallabhighlights + AUTOEXP, // EvLocallabh_tonalwidth + AUTOEXP, // EvLocallabshadows + AUTOEXP, // EvLocallabs_tonalwidth + AUTOEXP, // EvLocallabsh_radius + AUTOEXP, // EvLocallabsensihs + AUTOEXP, // Evlocallabradmaskcol + AUTOEXP, // Evlocallabradmaskexp + AUTOEXP, // EvlocallabToolAdded + AUTOEXP, // EvlocallabCCmaskSHshape + AUTOEXP, // EvlocallabLLmaskSHshape + AUTOEXP, // EvlocallabHHmaskSHshape + AUTOEXP, // EvlocallabblendmaskSH + AUTOEXP, // EvLocallabEnaSHMask + AUTOEXP, // EvlocallabradmaskSH + AUTOEXP, // EvlocallabblurSHde + AUTOEXP, // Evlocallabinverssh + AUTOEXP, // EvLocallabSpotbalan + AUTOEXP, // EvLocallabchromaskexp + AUTOEXP, // EvLocallabgammaskexp + AUTOEXP, // EvLocallabslomaskexp + AUTOEXP, // EvLocallabsoftradiusexp + AUTOEXP, // EvLocallabchromaskcol + AUTOEXP, // EvLocallabgammaskcol + AUTOEXP, // EvLocallabslomaskcol + AUTOEXP, // EvLocallabchromaskSH + AUTOEXP, // EvLocallabgammaskSH + AUTOEXP, // EvLocallabslomaskSH + AUTOEXP, // EvLocallabsoftradiuscol + AUTOEXP, // EvLocallabsoftradiusret + AUTOEXP, // EvLocallabsoftradiuscb + AUTOEXP, // EvLocallabSpotTransitweak + AUTOEXP, // EvLocallabclarityml + AUTOEXP, // EvLocallabcontresid + AUTOEXP, // Evlocallabnoiselumf0 + AUTOEXP, // Evlocallabnoiselumf2 0, // Evlocallabblurcbdl - LUMINANCECURVE, // Evlocallabblendmaskcb - LUMINANCECURVE, // Evlocallabradmaskcb - LUMINANCECURVE, // Evlocallabchromaskcb - LUMINANCECURVE, // Evlocallabgammaskcb - LUMINANCECURVE, // Evlocallabslomaskcb - LUMINANCECURVE, // EvlocallabCCmaskcbshape - LUMINANCECURVE, // EvlocallabLLmaskcbshape - LUMINANCECURVE, // EvlocallabHHmaskcbshape - LUMINANCECURVE, // EvLocallabEnacbMask + AUTOEXP, // Evlocallabblendmaskcb + AUTOEXP, // Evlocallabradmaskcb + AUTOEXP, // Evlocallabchromaskcb + AUTOEXP, // Evlocallabgammaskcb + AUTOEXP, // Evlocallabslomaskcb + AUTOEXP, // EvlocallabCCmaskcbshape + AUTOEXP, // EvlocallabLLmaskcbshape + AUTOEXP, // EvlocallabHHmaskcbshape + AUTOEXP, // EvLocallabEnacbMask M_VOID, // EvlocallabToolRemovedWithoutRefresh - LUMINANCECURVE, // Evlocallabsoftradiustm - LUMINANCECURVE, // EvLocallabSpotTransitgrad - LUMINANCECURVE, // Evlocallabamount - LUMINANCECURVE, // Evlocallabsatur - LUMINANCECURVE, // EvlocallabCCmaskretishape - LUMINANCECURVE, // EvlocallabLLmaskretishape - LUMINANCECURVE, // EvlocallabHHmaskretishape - LUMINANCECURVE, // EvLocallabEnaretiMask - LUMINANCECURVE, // Evlocallabblendmaskreti - LUMINANCECURVE, // Evlocallabradmaskreti - LUMINANCECURVE, // Evlocallabchromaskreti - LUMINANCECURVE, // Evlocallabgammaskreti - LUMINANCECURVE, // Evlocallabslomaskreti - LUMINANCECURVE, // EvlocallabToolRemovedWithRefresh - LUMINANCECURVE, // EvLocallabEnaretiMasktmap - LUMINANCECURVE, // Evlocallabscalereti - LUMINANCECURVE, // Evlocallabdarkness - LUMINANCECURVE, // Evlocallablightnessreti - LUMINANCECURVE, // Evlocallablimd - LUMINANCECURVE, // Evlocallablaplace - LUMINANCECURVE, // EvlocallabsoftMethod - LUMINANCECURVE, // Evlocallabequilret - LUMINANCECURVE, // Evlocallabequiltm - LUMINANCECURVE, // Evlocallabfftwlc - LUMINANCECURVE, // Evlocallabfftwreti - LUMINANCECURVE, // EvlocallabshowmasksoftMethod - LUMINANCECURVE, // Evlocallabshadex - LUMINANCECURVE, // EvlocallabexpMethod - LUMINANCECURVE, // EvLocallablaplacexp - LUMINANCECURVE, // EvLocallabbalanexp - LUMINANCECURVE, // EvLocallablinear - LUMINANCECURVE, // EvlocallabCCmasktmshape - LUMINANCECURVE, // EvlocallabLLmasktmshape - LUMINANCECURVE, // EvlocallabHHmasktmshape - LUMINANCECURVE, // EvLocallabEnatmMask - LUMINANCECURVE, // Evlocallabblendmasktm - LUMINANCECURVE, // Evlocallabradmasktm - LUMINANCECURVE, // Evlocallabchromasktm - LUMINANCECURVE, // Evlocallabgammasktm - LUMINANCECURVE, // Evlocallabslomasktm - LUMINANCECURVE, // EvlocallabshowmasktmMethod - LUMINANCECURVE, // EvlocallablocalcontMethod - LUMINANCECURVE, // Evlocallabwavcurve - LUMINANCECURVE, // Evlocallablevelwav - LUMINANCECURVE, // Evlocallabresidcont - LUMINANCECURVE, // EvlocallabCCmaskblshape - LUMINANCECURVE, // EvlocallabLLmaskblshape - LUMINANCECURVE, // EvlocallabHHmaskblshape - LUMINANCECURVE, // EvLocallabEnablMask - LUMINANCECURVE, // EvlocallabshowmaskblMethod - LUMINANCECURVE, // Evlocallabblendmaskbl - LUMINANCECURVE, // Evlocallabradmaskbl - LUMINANCECURVE, // Evlocallabchromaskbl - LUMINANCECURVE, // Evlocallabgammaskbl - LUMINANCECURVE, // Evlocallabslomaskbl - LUMINANCECURVE, // EvlocallabblMethod - LUMINANCECURVE, // EvlocallabmedMethod - LUMINANCECURVE, // Evlocallabitera - LUMINANCECURVE, // Evlocallabguidbl - LUMINANCECURVE, // Evlocallabepsbl - LUMINANCECURVE, // EvlocallabshowmaskcolMethodinv - LUMINANCECURVE, // EvlocallabshowmaskexpMethodinv - LUMINANCECURVE, // EvlocallabshowmaskSHMethodinv - LUMINANCECURVE, // Evlocallabclarilres - LUMINANCECURVE, // Evlocallabclarisoft - LUMINANCECURVE, // Evlocallabclaricres - LUMINANCECURVE, // Evlocallabresidchro - LUMINANCECURVE, // Evlocallabgamm - LUMINANCECURVE, // Evlocallabfatamount - LUMINANCECURVE, // Evlocallabfatdetail - LUMINANCECURVE, // Evlocallabfatanchor - LUMINANCECURVE, // Evlocallabfatlevel - LUMINANCECURVE, // EvlocallabSpotCreated - LUMINANCECURVE, // EvlocallabexnoiseMethod - LUMINANCECURVE, // Evlocallabdepth - LUMINANCECURVE, // Evlocallabloglin - LUMINANCECURVE, // EvlocallabdehazeSaturation - LUMINANCECURVE, // Evlocallaboffs - LUMINANCECURVE, // EvlocallabCTtransCurve - LUMINANCECURVE, // Evlocallabcliptm - LUMINANCECURVE, // Evlocallabenatmmaskaft - LUMINANCECURVE, // EvlocallabenaExpmaskaft - LUMINANCECURVE, // Evlocallablapmasktm - LUMINANCECURVE, // Evlocallablapmaskreti - LUMINANCECURVE, // Evlocallablapmaskexp - LUMINANCECURVE, // Evlocallablapmaskcol - LUMINANCECURVE, // EvlocallablapmaskSH - LUMINANCECURVE, // Evlocallablapmaskcb - LUMINANCECURVE, // Evlocallablapmaskbl - LUMINANCECURVE, // Evlocallablaplac - LUMINANCECURVE, // Evlocallabdetailthr - LUMINANCECURVE, // Evlocallabfftwbl - LUMINANCECURVE, // Evlocallabisogr - LUMINANCECURVE, // Evlocallabstrengr - LUMINANCECURVE, // Evlocallabscalegr - LUMINANCECURVE, // EvlocallabLmaskshape - LUMINANCECURVE, // EvlocallabLmaskexpshape - LUMINANCECURVE, // EvlocallabLmaskSHshape - LUMINANCECURVE, // EvlocallabLmasktmshape - LUMINANCECURVE, // EvlocallabLmaskretishape - LUMINANCECURVE, // EvlocallabLmaskcbshape - LUMINANCECURVE, // EvlocallabLmaskblshape - LUMINANCECURVE, // EvlocallabLLmaskblshapewav - LUMINANCECURVE, // Evlocallabshadmaskbl - LUMINANCECURVE, // EvlocallabLLmaskcolshapewav - LUMINANCECURVE, // Evlocallabshadmaskcol - LUMINANCECURVE, // EvlocallabcsThreshold - LUMINANCECURVE, // EvlocallabcsThresholdblur - LUMINANCECURVE, // EvlocallabcsThresholdcol - LUMINANCECURVE, // Evlocallabdeltae - LUMINANCECURVE, // EvLocallabSpotscopemask - LUMINANCECURVE, // EvlocallabshMethod - LUMINANCECURVE, // EvlocallabEqualizersh - LUMINANCECURVE, // EvlocallabdetailSH - LUMINANCECURVE, // EvlocallabfatamountSH - LUMINANCECURVE, // EvlocallabfatanchorSH - LUMINANCECURVE, // Evlocallabshortc - LUMINANCECURVE, // EvLocallabSpotlumask - LUMINANCECURVE, // EvlocallabgamSH - LUMINANCECURVE, // EvlocallabsloSH - LUMINANCECURVE, // Evlocallabsavrest - LUMINANCECURVE, // Evlocallabrecurs - LUMINANCECURVE, // EvLocallabmergecolMethod - LUMINANCECURVE, // EvLocallabopacol - LUMINANCECURVE, // Evlocallabrgbshape - LUMINANCECURVE, // EvLocallabtoneMethod - LUMINANCECURVE, // EvLocallabspecial - LUMINANCECURVE, // EvLocallabconthrcol - LUMINANCECURVE, // EvLocallabmerMethod - LUMINANCECURVE, // EvLocallabstrumaskcol - LUMINANCECURVE, // EvLocallabstrumaskbl - LUMINANCECURVE, // EvLocallabtoolcol - LUMINANCECURVE, // Evlocallabtoolbl - LUMINANCECURVE, // EvlocallabHHhmaskshape - LUMINANCECURVE, // EvlocallabCCmaskvibshape - LUMINANCECURVE, // EvlocallabLLmaskvibshape - LUMINANCECURVE, // EvlocallabHHmaskvibshape - LUMINANCECURVE, // EvlocallabshowmaskvibMethod - LUMINANCECURVE, // EvLocallabEnavibMask - LUMINANCECURVE, // Evlocallabblendmaskvi - LUMINANCECURVE, // Evlocallabradmaskvib - LUMINANCECURVE, // Evlocallabchromaskvib - LUMINANCECURVE, // Evlocallabgammaskvib - LUMINANCECURVE, // Evlocallabslomaskvib - LUMINANCECURVE, // Evlocallablapmaskvib - LUMINANCECURVE, // EvlocallabLmaskvibshape - LUMINANCECURVE, // EvLocallabLabGridmergValue - LUMINANCECURVE, // EvLocallabmercol - LUMINANCECURVE, // EvLocallabmerlucol - LUMINANCECURVE, // Evlocallabstrmaskexp - LUMINANCECURVE, // Evlocallabangmaskexp - LUMINANCECURVE, // Evlocallabstrexp - LUMINANCECURVE, // Evlocallabangexp - LUMINANCECURVE, // EvlocallabstrSH - LUMINANCECURVE, // EvlocallabangSH - LUMINANCECURVE, // Evlocallabstrcol - LUMINANCECURVE, // Evlocallabangcol - LUMINANCECURVE, // Evlocallabstrcolab - LUMINANCECURVE, // EvLocallabSpotfeather - LUMINANCECURVE, // Evlocallabstrcolh - LUMINANCECURVE, // Evlocallabstrvib - LUMINANCECURVE, // Evlocallabangvib - LUMINANCECURVE, // Evlocallabstrvibab - LUMINANCECURVE, // Evlocallabstrvibh - LUMINANCECURVE, // EvLocallabSpotcomplexMethod - LUMINANCECURVE, // Evlocallabclshape - LUMINANCECURVE, // Evlocallablcshape - LUMINANCECURVE, // Evlocallabblurcol - LUMINANCECURVE, // Evlocallabcontcol - LUMINANCECURVE, // EvLocallabfftColorMask - RGBCURVE | M_AUTOEXP, // EvLocenalog - AUTOEXP, // EvLocallabAuto - LUMINANCECURVE, // EvlocallabsourceGray - AUTOEXP, // EvlocallabsourceGrayAuto - AUTOEXP, // EvlocallabAutoGray - LUMINANCECURVE, // EvlocallabblackEv - LUMINANCECURVE, // EvlocallabwhiteEv - LUMINANCECURVE, // EvlocallabtargetGray - LUMINANCECURVE, // Evlocallabdetail - LUMINANCECURVE, // Evlocallabsensilog + AUTOEXP, // Evlocallabsoftradiustm + AUTOEXP, // EvLocallabSpotTransitgrad + AUTOEXP, // Evlocallabamount + AUTOEXP, // Evlocallabsatur + AUTOEXP, // EvlocallabCCmaskretishape + AUTOEXP, // EvlocallabLLmaskretishape + AUTOEXP, // EvlocallabHHmaskretishape + AUTOEXP, // EvLocallabEnaretiMask + AUTOEXP, // Evlocallabblendmaskreti + AUTOEXP, // Evlocallabradmaskreti + AUTOEXP, // Evlocallabchromaskreti + AUTOEXP, // Evlocallabgammaskreti + AUTOEXP, // Evlocallabslomaskreti + AUTOEXP, // EvlocallabToolRemovedWithRefresh + AUTOEXP, // EvLocallabEnaretiMasktmap + AUTOEXP, // Evlocallabscalereti + AUTOEXP, // Evlocallabdarkness + AUTOEXP, // Evlocallablightnessreti + AUTOEXP, // Evlocallablimd + AUTOEXP, // Evlocallablaplace + AUTOEXP, // EvlocallabsoftMethod + AUTOEXP, // Evlocallabequilret + AUTOEXP, // Evlocallabequiltm + AUTOEXP, // Evlocallabfftwlc + AUTOEXP, // Evlocallabfftwreti + AUTOEXP, // EvlocallabshowmasksoftMethod + AUTOEXP, // Evlocallabshadex + AUTOEXP, // EvlocallabexpMethod + AUTOEXP, // EvLocallablaplacexp + AUTOEXP, // EvLocallabbalanexp + AUTOEXP, // EvLocallablinear + AUTOEXP, // EvlocallabCCmasktmshape + AUTOEXP, // EvlocallabLLmasktmshape + AUTOEXP, // EvlocallabHHmasktmshape + AUTOEXP, // EvLocallabEnatmMask + AUTOEXP, // Evlocallabblendmasktm + AUTOEXP, // Evlocallabradmasktm + AUTOEXP, // Evlocallabchromasktm + AUTOEXP, // Evlocallabgammasktm + AUTOEXP, // Evlocallabslomasktm + AUTOEXP, // EvlocallabshowmasktmMethod + AUTOEXP, // EvlocallablocalcontMethod + AUTOEXP, // Evlocallabwavcurve + AUTOEXP, // Evlocallablevelwav + AUTOEXP, // Evlocallabresidcont + AUTOEXP, // EvlocallabCCmaskblshape + AUTOEXP, // EvlocallabLLmaskblshape + AUTOEXP, // EvlocallabHHmaskblshape + AUTOEXP, // EvLocallabEnablMask + AUTOEXP, // EvlocallabshowmaskblMethod + AUTOEXP, // Evlocallabblendmaskbl + AUTOEXP, // Evlocallabradmaskbl + AUTOEXP, // Evlocallabchromaskbl + AUTOEXP, // Evlocallabgammaskbl + AUTOEXP, // Evlocallabslomaskbl + AUTOEXP, // EvlocallabblMethod + AUTOEXP, // EvlocallabmedMethod + AUTOEXP, // Evlocallabitera + AUTOEXP, // Evlocallabguidbl + AUTOEXP, // Evlocallabepsbl + AUTOEXP, // EvlocallabshowmaskcolMethodinv + AUTOEXP, // EvlocallabshowmaskexpMethodinv + AUTOEXP, // EvlocallabshowmaskSHMethodinv + AUTOEXP, // Evlocallabclarilres + AUTOEXP, // Evlocallabclarisoft + AUTOEXP, // Evlocallabclaricres + AUTOEXP, // Evlocallabresidchro + AUTOEXP, // Evlocallabgamm + AUTOEXP, // Evlocallabfatamount + AUTOEXP, // Evlocallabfatdetail + AUTOEXP, // Evlocallabfatanchor + AUTOEXP, // Evlocallabfatlevel + AUTOEXP, // EvlocallabSpotCreated + AUTOEXP, // EvlocallabexnoiseMethod + AUTOEXP, // Evlocallabdepth + AUTOEXP, // Evlocallabloglin + AUTOEXP, // EvlocallabdehazeSaturation + AUTOEXP, // Evlocallaboffs + AUTOEXP, // EvlocallabCTtransCurve + AUTOEXP, // Evlocallabcliptm + AUTOEXP, // Evlocallabenatmmaskaft + AUTOEXP, // EvlocallabenaExpmaskaft + AUTOEXP, // Evlocallablapmasktm + AUTOEXP, // Evlocallablapmaskreti + AUTOEXP, // Evlocallablapmaskexp + AUTOEXP, // Evlocallablapmaskcol + AUTOEXP, // EvlocallablapmaskSH + AUTOEXP, // Evlocallablapmaskcb + AUTOEXP, // Evlocallablapmaskbl + AUTOEXP, // Evlocallablaplac + AUTOEXP, // Evlocallabdetailthr + AUTOEXP, // Evlocallabfftwbl + AUTOEXP, // Evlocallabisogr + AUTOEXP, // Evlocallabstrengr + AUTOEXP, // Evlocallabscalegr + AUTOEXP, // EvlocallabLmaskshape + AUTOEXP, // EvlocallabLmaskexpshape + AUTOEXP, // EvlocallabLmaskSHshape + AUTOEXP, // EvlocallabLmasktmshape + AUTOEXP, // EvlocallabLmaskretishape + AUTOEXP, // EvlocallabLmaskcbshape + AUTOEXP, // EvlocallabLmaskblshape + AUTOEXP, // EvlocallabLLmaskblshapewav + AUTOEXP, // Evlocallabshadmaskbl + AUTOEXP, // EvlocallabLLmaskcolshapewav + AUTOEXP, // Evlocallabshadmaskcol + AUTOEXP, // EvlocallabcsThreshold + AUTOEXP, // EvlocallabcsThresholdblur + AUTOEXP, // EvlocallabcsThresholdcol + AUTOEXP, // Evlocallabdeltae + AUTOEXP, // EvLocallabSpotscopemask + AUTOEXP, // EvlocallabshMethod + AUTOEXP, // EvlocallabEqualizersh + AUTOEXP, // EvlocallabdetailSH + AUTOEXP, // EvlocallabfatamountSH + AUTOEXP, // EvlocallabfatanchorSH + AUTOEXP, // Evlocallabshortc + AUTOEXP, // EvLocallabSpotlumask + AUTOEXP, // EvlocallabgamSH + AUTOEXP, // EvlocallabsloSH + AUTOEXP, // Evlocallabsavrest + AUTOEXP, // Evlocallabrecurs + AUTOEXP, // EvLocallabmergecolMethod + AUTOEXP, // EvLocallabopacol + AUTOEXP, // Evlocallabrgbshape + AUTOEXP, // EvLocallabtoneMethod + AUTOEXP, // EvLocallabspecial + AUTOEXP, // EvLocallabconthrcol + AUTOEXP, // EvLocallabmerMethod + AUTOEXP, // EvLocallabstrumaskcol + AUTOEXP, // EvLocallabstrumaskbl + AUTOEXP, // EvLocallabtoolcol + AUTOEXP, // Evlocallabtoolbl + AUTOEXP, // EvlocallabHHhmaskshape + AUTOEXP, // EvlocallabCCmaskvibshape + AUTOEXP, // EvlocallabLLmaskvibshape + AUTOEXP, // EvlocallabHHmaskvibshape + AUTOEXP, // EvlocallabshowmaskvibMethod + AUTOEXP, // EvLocallabEnavibMask + AUTOEXP, // Evlocallabblendmaskvi + AUTOEXP, // Evlocallabradmaskvib + AUTOEXP, // Evlocallabchromaskvib + AUTOEXP, // Evlocallabgammaskvib + AUTOEXP, // Evlocallabslomaskvib + AUTOEXP, // Evlocallablapmaskvib + AUTOEXP, // EvlocallabLmaskvibshape + AUTOEXP, // EvLocallabLabGridmergValue + AUTOEXP, // EvLocallabmercol + AUTOEXP, // EvLocallabmerlucol + AUTOEXP, // Evlocallabstrmaskexp + AUTOEXP, // Evlocallabangmaskexp + AUTOEXP, // Evlocallabstrexp + AUTOEXP, // Evlocallabangexp + AUTOEXP, // EvlocallabstrSH + AUTOEXP, // EvlocallabangSH + AUTOEXP, // Evlocallabstrcol + AUTOEXP, // Evlocallabangcol + AUTOEXP, // Evlocallabstrcolab + AUTOEXP, // EvLocallabSpotfeather + AUTOEXP, // Evlocallabstrcolh + AUTOEXP, // Evlocallabstrvib + AUTOEXP, // Evlocallabangvib + AUTOEXP, // Evlocallabstrvibab + AUTOEXP, // Evlocallabstrvibh + AUTOEXP, // EvLocallabSpotcomplexMethod + AUTOEXP, // Evlocallabclshape + AUTOEXP, // Evlocallablcshape + AUTOEXP, // Evlocallabblurcol + AUTOEXP, // Evlocallabcontcol + AUTOEXP, // EvLocallabfftColorMask + AUTOEXP | M_AUTOEXP, // EvLocenalog + HDR, // EvLocallabAuto + AUTOEXP, // EvlocallabsourceGray + HDR, // EvlocallabsourceGrayAuto + HDR, // EvlocallabAutoGray + AUTOEXP, // EvlocallabblackEv + AUTOEXP, // EvlocallabwhiteEv + AUTOEXP, // EvlocallabtargetGray + AUTOEXP, // Evlocallabdetail + AUTOEXP, // Evlocallabsensilog AUTOEXP, // Evlocallabfullimage - LUMINANCECURVE, // Evlocallabbaselog - LUMINANCECURVE, // Evlocallabresidblur - LUMINANCECURVE, // Evlocallabblurlc - LUMINANCECURVE, // Evlocallablevelblur - LUMINANCECURVE, // EvlocallabwavCurvelev - LUMINANCECURVE, // EvlocallabwavCurvecon - LUMINANCECURVE, // Evlocallabsigma - LUMINANCECURVE, // Evlocallaboriglc - LUMINANCECURVE, // Evlocallabsigmadc - LUMINANCECURVE, // Evlocallabdeltad - LUMINANCECURVE, // EvlocallabwavCurvecomp - LUMINANCECURVE, // Evlocallabfatres - LUMINANCECURVE, // EvLocallabSpotbalanh - LUMINANCECURVE, // EvlocallabwavCurveden - LUMINANCECURVE, // EvlocallabHHmasklcshape - LUMINANCECURVE, // EvlocallabCCmasklcshape - LUMINANCECURVE, // EvlocallabLLmasklcshape - LUMINANCECURVE, // EvlocallabEnalcMask - LUMINANCECURVE, // EvlocallabshowmasklcMethod - LUMINANCECURVE, // Evlocallabblendmasklc - LUMINANCECURVE, // Evlocallabradmasklc - LUMINANCECURVE, // Evlocallabchromasklc - LUMINANCECURVE, // EvlocallabLmasklcshape - LUMINANCECURVE, // Evlocallabchromalev - LUMINANCECURVE, // Evlocallabchromablu - LUMINANCECURVE, // Evlocallaboffset - LUMINANCECURVE, // Evlocallabwavblur - LUMINANCECURVE, // Evlocallabwavcont - LUMINANCECURVE, // Evlocallabwavcomp - LUMINANCECURVE, // Evlocallabwavcompre - LUMINANCECURVE, // EvlocallabwavCurvecompre - LUMINANCECURVE, // Evlocallabresidcomp - LUMINANCECURVE, // Evlocallabthreswav - LUMINANCECURVE, // Evlocallabstrwav - LUMINANCECURVE, // Evlocallabangwav - LUMINANCECURVE, // Evlocallabwavgradl - LUMINANCECURVE, // Evlocallabstrlog - LUMINANCECURVE, // Evlocallabanglog - LUMINANCECURVE, // EvLocallabSpotcolorde - LUMINANCECURVE, // EvlocallabshowmasksharMethod - LUMINANCECURVE, // Evlocallabshowreset - LUMINANCECURVE, // Evlocallabstrengthw - LUMINANCECURVE, // Evlocallabradiusw - LUMINANCECURVE, // Evlocallabdetailw - LUMINANCECURVE, // Evlocallabgradw - LUMINANCECURVE, // Evlocallabtloww - LUMINANCECURVE, // Evlocallabthigw - LUMINANCECURVE, // EvlocallabwavCurveedg - LUMINANCECURVE, // EvlocallablocaledgMethod - LUMINANCECURVE, // Evlocallabwavedg - LUMINANCECURVE, // Evlocallabedgw - LUMINANCECURVE, // Evlocallabbasew - LUMINANCECURVE, // EvlocallablocalneiMethod - LUMINANCECURVE, // Evlocallabwaveshow - LUMINANCECURVE, // EvLocallabSpotwavMethod - LUMINANCECURVE, // EvlocallabchroMethod - LUMINANCECURVE, // Evlocallabstrbl - LUMINANCECURVE, // Evlocallabsigmadr - LUMINANCECURVE, // Evlocallabsigmabl - LUMINANCECURVE, // Evlocallabsigmaed - LUMINANCECURVE, // Evlocallabresidsha - LUMINANCECURVE, // Evlocallabresidshathr - LUMINANCECURVE, // Evlocallabresidhi - LUMINANCECURVE, // Evlocallabresidhithr - LUMINANCECURVE, // Evlocallabsigmalc - LUMINANCECURVE, // Evlocallabsigmalc2 - LUMINANCECURVE, // Evlocallabblwh - LUMINANCECURVE, // EvlocallabcomplexityWithRefresh + AUTOEXP, // Evlocallabbaselog + AUTOEXP, // Evlocallabresidblur + AUTOEXP, // Evlocallabblurlc + AUTOEXP, // Evlocallablevelblur + AUTOEXP, // EvlocallabwavCurvelev + AUTOEXP, // EvlocallabwavCurvecon + AUTOEXP, // Evlocallabsigma + AUTOEXP, // Evlocallaboriglc + AUTOEXP, // Evlocallabsigmadc + AUTOEXP, // Evlocallabdeltad + AUTOEXP, // EvlocallabwavCurvecomp + AUTOEXP, // Evlocallabfatres + AUTOEXP, // EvLocallabSpotbalanh + AUTOEXP, // EvlocallabwavCurveden + AUTOEXP, // EvlocallabHHmasklcshape + AUTOEXP, // EvlocallabCCmasklcshape + AUTOEXP, // EvlocallabLLmasklcshape + AUTOEXP, // EvlocallabEnalcMask + AUTOEXP, // EvlocallabshowmasklcMethod + AUTOEXP, // Evlocallabblendmasklc + AUTOEXP, // Evlocallabradmasklc + AUTOEXP, // Evlocallabchromasklc + AUTOEXP, // EvlocallabLmasklcshape + AUTOEXP, // Evlocallabchromalev + AUTOEXP, // Evlocallabchromablu + AUTOEXP, // Evlocallaboffset + AUTOEXP, // Evlocallabwavblur + AUTOEXP, // Evlocallabwavcont + AUTOEXP, // Evlocallabwavcomp + AUTOEXP, // Evlocallabwavcompre + AUTOEXP, // EvlocallabwavCurvecompre + AUTOEXP, // Evlocallabresidcomp + AUTOEXP, // Evlocallabthreswav + AUTOEXP, // Evlocallabstrwav + AUTOEXP, // Evlocallabangwav + AUTOEXP, // Evlocallabwavgradl + AUTOEXP, // Evlocallabstrlog + AUTOEXP, // Evlocallabanglog + AUTOEXP, // EvLocallabSpotcolorde + AUTOEXP, // EvlocallabshowmasksharMethod + AUTOEXP, // Evlocallabshowreset + AUTOEXP, // Evlocallabstrengthw + AUTOEXP, // Evlocallabradiusw + AUTOEXP, // Evlocallabdetailw + AUTOEXP, // Evlocallabgradw + AUTOEXP, // Evlocallabtloww + AUTOEXP, // Evlocallabthigw + AUTOEXP, // EvlocallabwavCurveedg + AUTOEXP, // EvlocallablocaledgMethod + AUTOEXP, // Evlocallabwavedg + AUTOEXP, // Evlocallabedgw + AUTOEXP, // Evlocallabbasew + AUTOEXP, // EvlocallablocalneiMethod + AUTOEXP, // Evlocallabwaveshow + AUTOEXP, // EvLocallabSpotwavMethod + AUTOEXP, // EvlocallabchroMethod + AUTOEXP, // Evlocallabstrbl + AUTOEXP, // Evlocallabsigmadr + AUTOEXP, // Evlocallabsigmabl + AUTOEXP, // Evlocallabsigmaed + AUTOEXP, // Evlocallabresidsha + AUTOEXP, // Evlocallabresidshathr + AUTOEXP, // Evlocallabresidhi + AUTOEXP, // Evlocallabresidhithr + AUTOEXP, // Evlocallabsigmalc + AUTOEXP, // Evlocallabsigmalc2 + AUTOEXP, // Evlocallabblwh + AUTOEXP, // EvlocallabcomplexityWithRefresh 0, // can be reused - LUMINANCECURVE, // EvLocallabSpotcolorscope - LUMINANCECURVE, // EvlocallabshowmasktypMethod - LUMINANCECURVE, // Evlocallabshadmaskblsha - LUMINANCECURVE, // EvLocenamask - LUMINANCECURVE, // Evlocallabsensimask - LUMINANCECURVE, // Evlocallabblendmask - LUMINANCECURVE, // EvLocallabEna_Mask - LUMINANCECURVE, // Evlocallabradmask - LUMINANCECURVE, // Evlocallablapmask - LUMINANCECURVE, // Evlocallabchromask - LUMINANCECURVE, // Evlocallabgammask - LUMINANCECURVE, // Evlocallabslopmask - LUMINANCECURVE, // EvlocallabCCmask_shape - LUMINANCECURVE, // EvlocallabLLmask_shape - LUMINANCECURVE, // EvlocallabHHmask_shape - LUMINANCECURVE, // EvLocallabtoolmask - LUMINANCECURVE, // Evlocallabstrumaskmask - LUMINANCECURVE, // EvlocallabHHhmask_shape - LUMINANCECURVE, // EvLocallabfftmask - LUMINANCECURVE, // Evlocallabblurmask - LUMINANCECURVE, // Evlocallabcontmask - LUMINANCECURVE, // Evlocallabshadmask - LUMINANCECURVE, // EvlocallabLmask_shape - LUMINANCECURVE, // EvlocallabLLmask_shapewav - LUMINANCECURVE, // EvlocallabcsThresholdmask - LUMINANCECURVE, // Evlocallabstr_mask - LUMINANCECURVE, // Evlocallabang_mask - LUMINANCECURVE, // Evlocallabsoftradiusmask - LUMINANCECURVE, // Evlocallabblendmaskab - LUMINANCECURVE, // EvLocallabSpotprevMethod - LUMINANCECURVE, // Evlocallabactiv - LUMINANCECURVE, // EvlocallabCHshape - LUMINANCECURVE, //EvlocallabquaMethod - LUMINANCECURVE, //Evlocallabhishow - LUMINANCECURVE, // Evlocallabinvbl - LUMINANCECURVE, // Evlocallabcatad - LUMINANCECURVE, // Evlocallabciecam - LUMINANCECURVE, // Evlocallabsourceabs - LUMINANCECURVE, // Evlocallabtargabs - LUMINANCECURVE, // Evlocallabsurround - LUMINANCECURVE, // Evlocallabsaturl - LUMINANCECURVE, // Evlocallabcontl - LUMINANCECURVE, //EvlocallabCCmaskshapeL - LUMINANCECURVE, //EvlocallabLLmaskshapeL - LUMINANCECURVE, // EvlocallabHHmaskshapeL - LUMINANCECURVE, // EvlocallabenaLMask - LUMINANCECURVE, // EvlocallabblendmaskL - LUMINANCECURVE, // EvlocallabradmaskL - LUMINANCECURVE, // EvlocallabchromaskL - LUMINANCECURVE, //EvlocallabLmaskshapeL - LUMINANCECURVE, // Evlocallablightl - LUMINANCECURVE, // EvlocallabLshapeL - LUMINANCECURVE, // Evlocallabcontq - LUMINANCECURVE, // Evlocallabsursour - LUMINANCECURVE, // Evlocallablightq - LUMINANCECURVE, // Evlocallabcolorfl - LUMINANCECURVE, // Evlocallabrepar - LUMINANCECURVE, //EvlocallabwavCurvehue - LUMINANCECURVE, // Evlocallablevelthr - LUMINANCECURVE, // Evlocallablevelthrlow - LUMINANCECURVE, //Evlocallabusemask1 - LUMINANCECURVE, // Evlocallablnoiselow - LUMINANCECURVE, // Evlocallabrecothres - LUMINANCECURVE, // Evlocallablowthres - LUMINANCECURVE, // Evlocallabhigthres - LUMINANCECURVE, // Evlocallabrecothresd - LUMINANCECURVE, // Evlocallablowthresd - LUMINANCECURVE, // Evlocallabhigthresd - LUMINANCECURVE, // Evlocallabinvmaskd - LUMINANCECURVE, // Evlocallabinvmask - LUMINANCECURVE, // Evlocallabdecayd - LUMINANCECURVE, // Evlocallabrecothresc - LUMINANCECURVE, // Evlocallablowthresc - LUMINANCECURVE, // Evlocallabhigthresc - LUMINANCECURVE, // Evlocallabdecayc - LUMINANCECURVE, // Evlocallabmidthresd - LUMINANCECURVE, // Evlocallabrecothresl - LUMINANCECURVE, // Evlocallablowthresl - LUMINANCECURVE, // Evlocallabhigthresl - LUMINANCECURVE, // Evlocallabdecayl - LUMINANCECURVE, // Evlocallabrecothrese - LUMINANCECURVE, // Evlocallablowthrese - LUMINANCECURVE, // Evlocallabhigthrese - LUMINANCECURVE, // Evlocallabdecaye - LUMINANCECURVE, // Evlocallabrecothress - LUMINANCECURVE, // Evlocallablowthress - LUMINANCECURVE, // Evlocallabhigthress - LUMINANCECURVE, // Evlocallabdecays - LUMINANCECURVE, // Evlocallabrecothrev - LUMINANCECURVE, // Evlocallablowthresv - LUMINANCECURVE, // Evlocallabhigthresv - LUMINANCECURVE, // Evlocallabdecayv - LUMINANCECURVE, // Evlocallabrecothrew - LUMINANCECURVE, // Evlocallablowthresw - LUMINANCECURVE, // Evlocallabhigthresw - LUMINANCECURVE, // Evlocallabdecayw - LUMINANCECURVE, // Evlocallabmidthresdch - LUMINANCECURVE, // Evlocallabrecothret - LUMINANCECURVE, // Evlocallablowthrest - LUMINANCECURVE, // Evlocallabhigthrest - LUMINANCECURVE, // Evlocallabdecayt - LUMINANCECURVE, // Evlocallabrecothrecb - LUMINANCECURVE, // Evlocallablowthrescb - LUMINANCECURVE, // Evlocallabhigthrescb - LUMINANCECURVE, // Evlocallabdecaycb - LUMINANCECURVE, // Evlocallabrecothrer - LUMINANCECURVE, // Evlocallablowthresr - LUMINANCECURVE, // Evlocallabhigthresr - LUMINANCECURVE, // Evlocallabdecayr - LUMINANCECURVE, // Evlocallabnlstr - LUMINANCECURVE, // Evlocallabnldet - LUMINANCECURVE, // Evlocallabnlpat - LUMINANCECURVE, // Evlocallabnlrad - LUMINANCECURVE // Evlocallabnlgam + AUTOEXP, // EvLocallabSpotcolorscope + AUTOEXP, // EvlocallabshowmasktypMethod + AUTOEXP, // Evlocallabshadmaskblsha + AUTOEXP, // EvLocenamask + AUTOEXP, // Evlocallabsensimask + AUTOEXP, // Evlocallabblendmask + AUTOEXP, // EvLocallabEna_Mask + AUTOEXP, // Evlocallabradmask + AUTOEXP, // Evlocallablapmask + AUTOEXP, // Evlocallabchromask + AUTOEXP, // Evlocallabgammask + AUTOEXP, // Evlocallabslopmask + AUTOEXP, // EvlocallabCCmask_shape + AUTOEXP, // EvlocallabLLmask_shape + AUTOEXP, // EvlocallabHHmask_shape + AUTOEXP, // EvLocallabtoolmask + AUTOEXP, // Evlocallabstrumaskmask + AUTOEXP, // EvlocallabHHhmask_shape + AUTOEXP, // EvLocallabfftmask + AUTOEXP, // Evlocallabblurmask + AUTOEXP, // Evlocallabcontmask + AUTOEXP, // Evlocallabshadmask + AUTOEXP, // EvlocallabLmask_shape + AUTOEXP, // EvlocallabLLmask_shapewav + AUTOEXP, // EvlocallabcsThresholdmask + AUTOEXP, // Evlocallabstr_mask + AUTOEXP, // Evlocallabang_mask + AUTOEXP, // Evlocallabsoftradiusmask + AUTOEXP, // Evlocallabblendmaskab + AUTOEXP, // EvLocallabSpotprevMethod + AUTOEXP, // Evlocallabactiv + AUTOEXP, // EvlocallabCHshape + AUTOEXP, //EvlocallabquaMethod + AUTOEXP, //Evlocallabhishow + AUTOEXP, // Evlocallabinvbl + AUTOEXP, // Evlocallabcatad + AUTOEXP, // Evlocallabciecam + AUTOEXP, // Evlocallabsourceabs + AUTOEXP, // Evlocallabtargabs + AUTOEXP, // Evlocallabsurround + AUTOEXP, // Evlocallabsaturl + AUTOEXP, // Evlocallabcontl + AUTOEXP, //EvlocallabCCmaskshapeL + AUTOEXP, //EvlocallabLLmaskshapeL + AUTOEXP, // EvlocallabHHmaskshapeL + AUTOEXP, // EvlocallabenaLMask + AUTOEXP, // EvlocallabblendmaskL + AUTOEXP, // EvlocallabradmaskL + AUTOEXP, // EvlocallabchromaskL + AUTOEXP, //EvlocallabLmaskshapeL + AUTOEXP, // Evlocallablightl + AUTOEXP, // EvlocallabLshapeL + AUTOEXP, // Evlocallabcontq + AUTOEXP, // Evlocallabsursour + AUTOEXP, // Evlocallablightq + AUTOEXP, // Evlocallabcolorfl + AUTOEXP, // Evlocallabrepar + AUTOEXP, //EvlocallabwavCurvehue + AUTOEXP, // Evlocallablevelthr + AUTOEXP, // Evlocallablevelthrlow + AUTOEXP, //Evlocallabusemask1 + AUTOEXP, // Evlocallablnoiselow + AUTOEXP, // Evlocallabrecothres + AUTOEXP, // Evlocallablowthres + AUTOEXP, // Evlocallabhigthres + AUTOEXP, // Evlocallabrecothresd + AUTOEXP, // Evlocallablowthresd + AUTOEXP, // Evlocallabhigthresd + AUTOEXP, // Evlocallabinvmaskd + AUTOEXP, // Evlocallabinvmask + AUTOEXP, // Evlocallabdecayd + AUTOEXP, // Evlocallabrecothresc + AUTOEXP, // Evlocallablowthresc + AUTOEXP, // Evlocallabhigthresc + AUTOEXP, // Evlocallabdecayc + AUTOEXP, // Evlocallabmidthresd + AUTOEXP, // Evlocallabrecothresl + AUTOEXP, // Evlocallablowthresl + AUTOEXP, // Evlocallabhigthresl + AUTOEXP, // Evlocallabdecayl + AUTOEXP, // Evlocallabrecothrese + AUTOEXP, // Evlocallablowthrese + AUTOEXP, // Evlocallabhigthrese + AUTOEXP, // Evlocallabdecaye + AUTOEXP, // Evlocallabrecothress + AUTOEXP, // Evlocallablowthress + AUTOEXP, // Evlocallabhigthress + AUTOEXP, // Evlocallabdecays + AUTOEXP, // Evlocallabrecothrev + AUTOEXP, // Evlocallablowthresv + AUTOEXP, // Evlocallabhigthresv + AUTOEXP, // Evlocallabdecayv + AUTOEXP, // Evlocallabrecothrew + AUTOEXP, // Evlocallablowthresw + AUTOEXP, // Evlocallabhigthresw + AUTOEXP, // Evlocallabdecayw + AUTOEXP, // Evlocallabmidthresdch + AUTOEXP, // Evlocallabrecothret + AUTOEXP, // Evlocallablowthrest + AUTOEXP, // Evlocallabhigthrest + AUTOEXP, // Evlocallabdecayt + AUTOEXP, // Evlocallabrecothrecb + AUTOEXP, // Evlocallablowthrescb + AUTOEXP, // Evlocallabhigthrescb + AUTOEXP, // Evlocallabdecaycb + AUTOEXP, // Evlocallabrecothrer + AUTOEXP, // Evlocallablowthresr + AUTOEXP, // Evlocallabhigthresr + AUTOEXP, // Evlocallabdecayr + AUTOEXP, // Evlocallabnlstr + AUTOEXP, // Evlocallabnldet + AUTOEXP, // Evlocallabnlpat + AUTOEXP, // Evlocallabnlrad + AUTOEXP // Evlocallabnlgam }; diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 7573f70c1..2c8f05b45 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -941,151 +941,14 @@ private: */ // RGB processing - curve1(65536); - curve2(65536); - curve(65536, 0); - satcurve(65536, 0); - lhskcurve(65536, 0); - lumacurve(32770, 0); // lumacurve[32768] and lumacurve[32769] will be set to 32768 and 32769 later to allow linear interpolation - clcurve(65536, 0); - wavclCurve(65536, 0); - - //if(params.blackwhite.enabled) params.toneCurve.hrenabled=false; - - CurveFactory::complexCurve(expcomp, black / 65535.0, hlcompr, hlcomprthresh, params.toneCurve.shcompr, bright, contr, - params.toneCurve.curve, params.toneCurve.curve2, - hist16, curve1, curve2, curve, dummy, customToneCurve1, customToneCurve2); - - CurveFactory::RGBCurve(params.rgbCurves.rcurve, rCurve, 1); - CurveFactory::RGBCurve(params.rgbCurves.gcurve, gCurve, 1); - CurveFactory::RGBCurve(params.rgbCurves.bcurve, bCurve, 1); - - bool opautili = false; - - if (params.colorToning.enabled) { - TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix(params.icm.workingProfile); - double wp[3][3] = { - {wprof[0][0], wprof[0][1], wprof[0][2]}, - {wprof[1][0], wprof[1][1], wprof[1][2]}, - {wprof[2][0], wprof[2][1], wprof[2][2]} - }; - params.colorToning.getCurves(ctColorCurve, ctOpacityCurve, wp, opautili); - clToningcurve(65536, 0); - CurveFactory::diagonalCurve2Lut(params.colorToning.clcurve, clToningcurve, 1); - cl2Toningcurve(65536, 0); - CurveFactory::diagonalCurve2Lut(params.colorToning.cl2curve, cl2Toningcurve, 1); - } - labView = new LabImage(fw, fh); - if (params.blackwhite.enabled) { - CurveFactory::curveBW(params.blackwhite.beforeCurve, params.blackwhite.afterCurve, hist16, dummy, customToneCurvebw1, customToneCurvebw2, 1); - } - - double rrm, ggm, bbm; - float autor, autog, autob; - float satLimit = float (params.colorToning.satProtectionThreshold) / 100.f * 0.7f + 0.3f; - float satLimitOpacity = 1.f - (float (params.colorToning.saturatedOpacity) / 100.f); - - if (params.colorToning.enabled && params.colorToning.autosat && params.colorToning.method != "LabGrid") { //for colortoning evaluation of saturation settings - float moyS = 0.f; - float eqty = 0.f; - ipf.moyeqt(baseImg, moyS, eqty); //return image : mean saturation and standard dev of saturation - float satp = ((moyS + 1.5f * eqty) - 0.3f) / 0.7f; //1.5 sigma ==> 93% pixels with high saturation -0.3 / 0.7 convert to Hombre scale - - if (satp >= 0.92f) { - satp = 0.92f; //avoid values too high (out of gamut) - } - - if (satp <= 0.15f) { - satp = 0.15f; //avoid too low values - } - - satLimit = 100.f * satp; - - satLimitOpacity = 100.f * (moyS - 0.85f * eqty); //-0.85 sigma==>20% pixels with low saturation - } - - autor = -9000.f; // This will ask to compute the "auto" values for the B&W tool (have to be inferior to -5000) - DCPProfileApplyState as; - DCPProfile *dcpProf = imgsrc->getDCP(params.icm, as); - - LUTu histToneCurve; - - ipf.rgbProc(baseImg, labView, nullptr, curve1, curve2, curve, params.toneCurve.saturation, rCurve, gCurve, bCurve, satLimit, satLimitOpacity, ctColorCurve, ctOpacityCurve, opautili, clToningcurve, cl2Toningcurve, customToneCurve1, customToneCurve2, customToneCurvebw1, customToneCurvebw2, rrm, ggm, bbm, autor, autog, autob, expcomp, hlcompr, hlcomprthresh, dcpProf, as, histToneCurve, options.chunkSizeRGB, options.measure); - - if (settings->verbose) { - printf ("Output image / Auto B&W coefs: R=%.2f G=%.2f B=%.2f\n", static_cast(autor), static_cast(autog), static_cast(autob)); - } - - // if clut was used and size of clut cache == 1 we free the memory used by the clutstore (default clut cache size = 1 for 32 bit OS) - if (params.filmSimulation.enabled && !params.filmSimulation.clutFilename.empty() && options.clutCacheSize == 1) { - CLUTStore::getInstance().clearCache(); - } - - // freeing up some memory - customToneCurve1.Reset(); - customToneCurve2.Reset(); - ctColorCurve.Reset(); - ctOpacityCurve.Reset(); - noiseLCurve.Reset(); - noiseCCurve.Reset(); - customToneCurvebw1.Reset(); - customToneCurvebw2.Reset(); - - // Freeing baseImg because not used anymore - delete baseImg; - baseImg = nullptr; - - if (pl) { - pl->setProgress(0.55); - } - - //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - // start tile processing...??? - - - if (params.labCurve.contrast != 0) { //only use hist16 for contrast - hist16.clear(); - -#ifdef _OPENMP - #pragma omp parallel -#endif - { - LUTu hist16thr(hist16.getSize()); // one temporary lookup table per thread - hist16thr.clear(); -#ifdef _OPENMP - #pragma omp for schedule(static) nowait -#endif - - for (int i = 0; i < fh; i++) - for (int j = 0; j < fw; j++) { - hist16thr[(int)((labView->L[i][j]))]++; - } - -#ifdef _OPENMP - #pragma omp critical -#endif - { - hist16 += hist16thr; - } - } - } - - bool utili; - CurveFactory::complexLCurve(params.labCurve.brightness, params.labCurve.contrast, params.labCurve.lcurve, hist16, lumacurve, dummy, 1, utili); - - const bool clcutili = CurveFactory::diagonalCurve2Lut(params.labCurve.clcurve, clcurve, 1); - - bool ccutili, cclutili; - CurveFactory::complexsgnCurve(autili, butili, ccutili, cclutili, params.labCurve.acurve, params.labCurve.bcurve, params.labCurve.cccurve, - params.labCurve.lccurve, curve1, curve2, satcurve, lhskcurve, 1); - - if (params.locallab.enabled && params.locallab.spots.size() > 0) { + ipf.rgb2lab(*baseImg, *labView, params.icm.workingProfile); + MyTime t1, t2; t1.set(); + const std::unique_ptr reservView(new LabImage(*labView, true)); const std::unique_ptr lastorigView(new LabImage(*labView, true)); LocretigainCurve locRETgainCurve; @@ -1334,6 +1197,7 @@ private: } t2.set(); + ipf.lab2rgb(*labView, *baseImg, params.icm.workingProfile); if (settings->verbose) { printf("Total local:- %d usec\n", t2.etime(t1)); @@ -1341,6 +1205,148 @@ private: } + + curve1(65536); + curve2(65536); + curve(65536, 0); + satcurve(65536, 0); + lhskcurve(65536, 0); + lumacurve(32770, 0); // lumacurve[32768] and lumacurve[32769] will be set to 32768 and 32769 later to allow linear interpolation + clcurve(65536, 0); + wavclCurve(65536, 0); + + //if(params.blackwhite.enabled) params.toneCurve.hrenabled=false; + + CurveFactory::complexCurve(expcomp, black / 65535.0, hlcompr, hlcomprthresh, params.toneCurve.shcompr, bright, contr, + params.toneCurve.curve, params.toneCurve.curve2, + hist16, curve1, curve2, curve, dummy, customToneCurve1, customToneCurve2); + + CurveFactory::RGBCurve(params.rgbCurves.rcurve, rCurve, 1); + CurveFactory::RGBCurve(params.rgbCurves.gcurve, gCurve, 1); + CurveFactory::RGBCurve(params.rgbCurves.bcurve, bCurve, 1); + + bool opautili = false; + + if (params.colorToning.enabled) { + TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix(params.icm.workingProfile); + double wp[3][3] = { + {wprof[0][0], wprof[0][1], wprof[0][2]}, + {wprof[1][0], wprof[1][1], wprof[1][2]}, + {wprof[2][0], wprof[2][1], wprof[2][2]} + }; + params.colorToning.getCurves(ctColorCurve, ctOpacityCurve, wp, opautili); + clToningcurve(65536, 0); + CurveFactory::diagonalCurve2Lut(params.colorToning.clcurve, clToningcurve, 1); + cl2Toningcurve(65536, 0); + CurveFactory::diagonalCurve2Lut(params.colorToning.cl2curve, cl2Toningcurve, 1); + } + +// labView = new LabImage(fw, fh); + + if (params.blackwhite.enabled) { + CurveFactory::curveBW(params.blackwhite.beforeCurve, params.blackwhite.afterCurve, hist16, dummy, customToneCurvebw1, customToneCurvebw2, 1); + } + + double rrm, ggm, bbm; + float autor, autog, autob; + float satLimit = float (params.colorToning.satProtectionThreshold) / 100.f * 0.7f + 0.3f; + float satLimitOpacity = 1.f - (float (params.colorToning.saturatedOpacity) / 100.f); + + if (params.colorToning.enabled && params.colorToning.autosat && params.colorToning.method != "LabGrid") { //for colortoning evaluation of saturation settings + float moyS = 0.f; + float eqty = 0.f; + ipf.moyeqt(baseImg, moyS, eqty); //return image : mean saturation and standard dev of saturation + float satp = ((moyS + 1.5f * eqty) - 0.3f) / 0.7f; //1.5 sigma ==> 93% pixels with high saturation -0.3 / 0.7 convert to Hombre scale + + if (satp >= 0.92f) { + satp = 0.92f; //avoid values too high (out of gamut) + } + + if (satp <= 0.15f) { + satp = 0.15f; //avoid too low values + } + + satLimit = 100.f * satp; + + satLimitOpacity = 100.f * (moyS - 0.85f * eqty); //-0.85 sigma==>20% pixels with low saturation + } + + autor = -9000.f; // This will ask to compute the "auto" values for the B&W tool (have to be inferior to -5000) + DCPProfileApplyState as; + DCPProfile *dcpProf = imgsrc->getDCP(params.icm, as); + + LUTu histToneCurve; + + ipf.rgbProc(baseImg, labView, nullptr, curve1, curve2, curve, params.toneCurve.saturation, rCurve, gCurve, bCurve, satLimit, satLimitOpacity, ctColorCurve, ctOpacityCurve, opautili, clToningcurve, cl2Toningcurve, customToneCurve1, customToneCurve2, customToneCurvebw1, customToneCurvebw2, rrm, ggm, bbm, autor, autog, autob, expcomp, hlcompr, hlcomprthresh, dcpProf, as, histToneCurve, options.chunkSizeRGB, options.measure); + + if (settings->verbose) { + printf ("Output image / Auto B&W coefs: R=%.2f G=%.2f B=%.2f\n", static_cast(autor), static_cast(autog), static_cast(autob)); + } + + // if clut was used and size of clut cache == 1 we free the memory used by the clutstore (default clut cache size = 1 for 32 bit OS) + if (params.filmSimulation.enabled && !params.filmSimulation.clutFilename.empty() && options.clutCacheSize == 1) { + CLUTStore::getInstance().clearCache(); + } + + // freeing up some memory + customToneCurve1.Reset(); + customToneCurve2.Reset(); + ctColorCurve.Reset(); + ctOpacityCurve.Reset(); + noiseLCurve.Reset(); + noiseCCurve.Reset(); + customToneCurvebw1.Reset(); + customToneCurvebw2.Reset(); + + // Freeing baseImg because not used anymore + delete baseImg; + baseImg = nullptr; + + if (pl) { + pl->setProgress(0.55); + } + + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + // start tile processing...??? + + + if (params.labCurve.contrast != 0) { //only use hist16 for contrast + hist16.clear(); + +#ifdef _OPENMP + #pragma omp parallel +#endif + { + LUTu hist16thr(hist16.getSize()); // one temporary lookup table per thread + hist16thr.clear(); +#ifdef _OPENMP + #pragma omp for schedule(static) nowait +#endif + + for (int i = 0; i < fh; i++) + for (int j = 0; j < fw; j++) { + hist16thr[(int)((labView->L[i][j]))]++; + } + +#ifdef _OPENMP + #pragma omp critical +#endif + { + hist16 += hist16thr; + } + } + } + + bool utili; + CurveFactory::complexLCurve(params.labCurve.brightness, params.labCurve.contrast, params.labCurve.lcurve, hist16, lumacurve, dummy, 1, utili); + + const bool clcutili = CurveFactory::diagonalCurve2Lut(params.labCurve.clcurve, clcurve, 1); + + bool ccutili, cclutili; + CurveFactory::complexsgnCurve(autili, butili, ccutili, cclutili, params.labCurve.acurve, params.labCurve.bcurve, params.labCurve.cccurve, + params.labCurve.lccurve, curve1, curve2, satcurve, lhskcurve, 1); + ipf.chromiLuminanceCurve(nullptr, 1, labView, labView, curve1, curve2, satcurve, lhskcurve, clcurve, lumacurve, utili, autili, butili, ccutili, cclutili, clcutili, dummy, dummy); if ((params.colorappearance.enabled && !params.colorappearance.tonecie) || (!params.colorappearance.enabled)) { From e586f1b53eca8cd79e3c55b2d1c8c3404ae591e4 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Mon, 8 Feb 2021 14:37:50 +0100 Subject: [PATCH 083/129] Fix broken PENTAX *ist D decoding --- rtengine/dcraw.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index 300f107aa..bd2e8546c 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -10108,7 +10108,6 @@ konica_400z: } } else if (!strcmp(model,"*ist D")) { load_raw = &CLASS unpacked_load_raw; - data_error = -1; } else if (!strcmp(model,"*ist DS")) { height -= 2; } else if (!strcmp(make,"Samsung") && raw_width == 4704) { From 9b0bbdd27606ff8c2b5f9cd5c5f515762a7d641d Mon Sep 17 00:00:00 2001 From: Desmis Date: Tue, 9 Feb 2021 07:31:54 +0100 Subject: [PATCH 084/129] Local adjustments - Neutralize process after LA when when the user uses preview deltaE (#6099) * Add others methods RGB process - to preview dE * added others process to neutralize preview dE * Added others process to neutralize preview dE * Change scope placement for all tools --- rtengine/dcrop.cc | 23 +++++++++++++++++++++-- rtgui/locallabtools.cc | 8 +++++--- rtgui/locallabtools2.cc | 15 ++++++++++----- 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 9669418e0..832bff104 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -1046,10 +1046,29 @@ void Crop::update(int todo) huerefblu, chromarefblu, lumarefblu, huere, chromare, lumare, sobelre, lastsav, parent->previewDeltaE, parent->locallColorMask, parent->locallColorMaskinv, parent->locallExpMask, parent->locallExpMaskinv, parent->locallSHMask, parent->locallSHMaskinv, parent->locallvibMask, parent->localllcMask, parent->locallsharMask, parent->locallcbMask, parent->locallretiMask, parent->locallsoftMask, parent->localltmMask, parent->locallblMask, parent->localllogMask, parent->locall_Mask, minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax); - if(parent->previewDeltaE) { + if(parent->previewDeltaE || parent->locallColorMask == 5 || parent->locallvibMask == 4 || parent->locallExpMask == 5 || parent->locallSHMask == 4 || parent->localllcMask == 4 || parent->localltmMask == 4 || parent->localllogMask == 4 || parent->locallsoftMask == 6 || parent->localllcMask == 4) { params.blackwhite.enabled = false; + params.colorToning.enabled = false; + params.rgbCurves.enabled = false; + params.chmixer.enabled = false; + params.hsvequalizer.enabled = false; + params.filmSimulation.enabled = false; + params.toneCurve.black = 0.f; + params.toneCurve.saturation = 0.f; + params.toneCurve.brightness= 0.f; + params.toneCurve.contrast = 0.f; + params.toneCurve.hlcompr = 0.f; + //these 3 are "before" LA + //params.toneCurve.expcomp = 0; + //params.toneCurve.curve = { 0 }; + //params.toneCurve.curve2 = { 0 }; + params.colorappearance.enabled = false; + params.vibrance.enabled = false; + params.labCurve.enabled = false; + params.wavelet.enabled = false; + params.epd.enabled = false; + params.softlight.enabled = false; } - } else { parent->ipf.Lab_Local(1, sp, (float**)shbuffer, labnCrop, labnCrop, reservCrop.get(), lastorigCrop.get(), cropx / skip, cropy / skip, skips(parent->fw, skip), skips(parent->fh, skip), skip, locRETgainCurve, locRETtransCurve, lllocalcurve2,locallutili, diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index ce582b592..ade34c754 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -1,4 +1,5 @@ /* + * * This file is part of RawTherapee. * * Copyright (c) 2004-2010 Gabor Horvath frame @@ -5838,6 +5839,7 @@ LocallabSoft::LocallabSoft(): sensisf->setAdjusterListener(this); // Add Soft light specific widgets to GUI + pack_start(*sensisf); pack_start(*softMethod); Gtk::Label* const labelsoftmethod = Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_SHOWDCT") + ":")); ctboxsoftmethod->pack_start(*labelsoftmethod, Gtk::PACK_SHRINK, 4); @@ -5845,7 +5847,6 @@ LocallabSoft::LocallabSoft(): pack_start(*ctboxsoftmethod); pack_start(*streng); pack_start(*laplace); - pack_start(*sensisf); } bool LocallabSoft::isMaskViewActive() @@ -6529,6 +6530,7 @@ LocallabBlur::LocallabBlur(): // Add Blur, Noise & Denoise specific widgets to GUI ToolParamBlock* const blnoisebox = Gtk::manage(new ToolParamBlock()); + blnoisebox->pack_start(*sensibn); blnoisebox->pack_start(*blMethod); blnoisebox->pack_start(*fftwbl, Gtk::PACK_SHRINK, 0); blnoisebox->pack_start(*radius); @@ -6553,7 +6555,7 @@ LocallabBlur::LocallabBlur(): wavBox2->pack_start(*invmask); expdenoise2->add(*wavBox2, false); blnoisebox->pack_start(*expdenoise2); - blnoisebox->pack_start(*sensibn); +// blnoisebox->pack_start(*sensibn); // blnoisebox->pack_start(*blurMethod); blnoisebox->pack_start(*invbl); blnoisebox->pack_start(*chroMethod); @@ -6585,6 +6587,7 @@ LocallabBlur::LocallabBlur(): detailBox->pack_start(*usemask, Gtk::PACK_SHRINK, 0); detailFrame->add(*detailBox); wavBox->pack_start(*detailFrame); + denoisebox->pack_start(*sensiden); ToolParamBlock* const nlbox = Gtk::manage(new ToolParamBlock()); nlbox->pack_start(*nlstr); @@ -6615,7 +6618,6 @@ LocallabBlur::LocallabBlur(): expdenoise3->add(*wavBox3, false); denoisebox->pack_start(*expdenoise3); denoisebox->pack_start(*bilateral); - denoisebox->pack_start(*sensiden); denoisebox->pack_start(*neutral); expdenoise->add(*denoisebox, false); diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index 4907dd560..44550e261 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -235,6 +235,7 @@ LocallabTone::LocallabTone(): // Add Tone Mapping specific widgets to GUI // pack_start(*amount); // To use if we change transit_shapedetect parameters + pack_start(*sensitm); pack_start(*stren); pack_start(*equiltm); pack_start(*gamma); @@ -243,7 +244,7 @@ LocallabTone::LocallabTone(): pack_start(*scaltm); pack_start(*rewei); // pack_start(*softradiustm); // Always bad with TM ?? - pack_start(*sensitm); +// pack_start(*sensitm); ToolParamBlock* const tmBox3 = Gtk::manage(new ToolParamBlock()); tmBox3->pack_start(*maskusablet, Gtk::PACK_SHRINK, 0); tmBox3->pack_start(*maskunusablet, Gtk::PACK_SHRINK, 0); @@ -1992,13 +1993,14 @@ LocallabSharp::LocallabSharp(): showmasksharMethodConn = showmasksharMethod->signal_changed().connect(sigc::mem_fun(*this, &LocallabSharp::showmasksharMethodChanged)); // Add Sharpening specific widgets to GUI + pack_start(*sensisha); pack_start(*sharcontrast); pack_start(*sharblur); pack_start(*sharradius); pack_start(*sharamount); pack_start(*shardamping); pack_start(*shariter); - pack_start(*sensisha); +// pack_start(*sensisha); pack_start(*inverssha); sharFrame->set_label_align(0.025, 0.5); ToolParamBlock* const sharfBox = Gtk::manage(new ToolParamBlock()); @@ -2648,6 +2650,7 @@ LocallabContrast::LocallabContrast(): mask2lcCurveEditorG->curveListComplete(); // Add Local contrast specific widgets to GUI + pack_start(*sensilc); pack_start(*localcontMethod); pack_start(*lcradius); pack_start(*lcamount); @@ -2675,7 +2678,7 @@ LocallabContrast::LocallabContrast(): resiBox->pack_start(*shresFrame); expresidpyr->add(*resiBox, false); pack_start(*expresidpyr); - pack_start(*sensilc); +// pack_start(*sensilc); Gtk::HSeparator* const separatorcontr = Gtk::manage(new Gtk::HSeparator()); pack_start(*separatorcontr); ToolParamBlock* const clariBox = Gtk::manage(new ToolParamBlock()); @@ -4401,6 +4404,7 @@ LocallabCBDL::LocallabCBDL(): lumaneutralPressedConn = lumaneutralButton->signal_pressed().connect(sigc::mem_fun(*this, &LocallabCBDL::lumaneutralPressed)); lumacontrastPlusPressedConn = lumacontrastPlusButton->signal_pressed().connect(sigc::mem_fun(*this, &LocallabCBDL::lumacontrastPlusPressed)); + pack_start(*sensicb); // Add CBDL specific widgets to GUI ToolParamBlock* const levBox = Gtk::manage(new ToolParamBlock()); @@ -4428,7 +4432,7 @@ LocallabCBDL::LocallabCBDL(): residFrame->add(*residBox); pack_start(*residFrame); pack_start(*softradiuscb); - pack_start(*sensicb); +// pack_start(*sensicb); ToolParamBlock* const cbBox3 = Gtk::manage(new ToolParamBlock()); cbBox3->pack_start(*maskusablecb, Gtk::PACK_SHRINK, 0); cbBox3->pack_start(*maskunusablecb, Gtk::PACK_SHRINK, 0); @@ -5255,6 +5259,7 @@ LocallabLog::LocallabLog(): mask2CurveEditorL->curveListComplete(); // Add Log encoding specific widgets to GUI + pack_start(*sensilog); pack_start(*repar); pack_start(*ciecam); logPFrame->set_label_align(0.025, 0.5); @@ -5323,7 +5328,7 @@ LocallabLog::LocallabLog(): pack_start(*exprecovl, false, false); // pack_start(*baselog); - pack_start(*sensilog); +// pack_start(*sensilog); pack_start(*expmaskL, false, false); // Gtk::Frame* const gradlogFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRADLOGFRA"))); From b7b5d48d2f2663593eb11f8561b6181180b56729 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Tue, 9 Feb 2021 12:38:39 +0100 Subject: [PATCH 085/129] Automatic distortion correction crashes on particular image, fixes #6104 --- rtengine/klt/trackFeatures.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtengine/klt/trackFeatures.cc b/rtengine/klt/trackFeatures.cc index 8c0cd5ba6..b4f13c53c 100644 --- a/rtengine/klt/trackFeatures.cc +++ b/rtengine/klt/trackFeatures.cc @@ -460,7 +460,7 @@ static int _trackFeature( /* Check whether window is out of bounds */ if (*x2-hw < 0.0f || nc-(*x2+hw) < one_plus_eps || - *y2-hh < 0.0f || nr-(*y2+hh) < one_plus_eps) + *y2-hh < 0.0f || nr-(*y2+hh) < one_plus_eps || std::isnan(*x2) || std::isnan(*y2)) status = KLT_OOB; /* Check whether residue is too large */ From c3df0b1d86b44711836b323da70b19852b84d8f0 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sun, 14 Feb 2021 17:48:10 +0100 Subject: [PATCH 086/129] LUT.h : fix cppcheck warnings --- rtengine/LUT.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/rtengine/LUT.h b/rtengine/LUT.h index 416ae689a..b1dc4d26c 100644 --- a/rtengine/LUT.h +++ b/rtengine/LUT.h @@ -110,7 +110,7 @@ public: /// The user have to handle it itself, even if some method can (re)initialize it bool dirty; - LUT(int s, int flags = LUT_CLIP_BELOW | LUT_CLIP_ABOVE, bool initZero = false) + explicit LUT(int s, int flags = LUT_CLIP_BELOW | LUT_CLIP_ABOVE, bool initZero = false) { #ifndef NDEBUG @@ -141,7 +141,7 @@ public: } } - LUT(const std::vector& input, int flags = LUT_CLIP_BELOW | LUT_CLIP_ABOVE) : + explicit LUT(const std::vector& input, int flags = LUT_CLIP_BELOW | LUT_CLIP_ABOVE) : maxs(input.size() - 2), maxsf(maxs), data(new T[input.size() + 3]), // Add a few extra elements so [](vfloat) won't access out-of-bounds memory. @@ -362,11 +362,11 @@ public: // of [values[0][0] ... values[3][0]] and the second [values[0][1] ... values[3][1]]. __m128i temp0 = _mm_unpacklo_epi32(values[0], values[1]); __m128i temp1 = _mm_unpacklo_epi32(values[2], values[3]); - vfloat lower = _mm_castsi128_ps(_mm_unpacklo_epi64(temp0, temp1)); - vfloat upper = _mm_castsi128_ps(_mm_unpackhi_epi64(temp0, temp1)); + vfloat lowerVal = _mm_castsi128_ps(_mm_unpacklo_epi64(temp0, temp1)); + vfloat upperVal = _mm_castsi128_ps(_mm_unpackhi_epi64(temp0, temp1)); vfloat diff = vmaxf(ZEROV, indexv) - _mm_cvtepi32_ps(indexes); - return vintpf(diff, upper, lower); + return vintpf(diff, upperVal, lowerVal); } // NOTE: This version requires LUTs which clip at upper and lower bounds @@ -394,11 +394,11 @@ public: // of [values[0][0] ... values[3][0]] and the second [values[0][1] ... values[3][1]]. __m128i temp0 = _mm_unpacklo_epi32(values[0], values[1]); __m128i temp1 = _mm_unpacklo_epi32(values[2], values[3]); - vfloat lower = _mm_castsi128_ps(_mm_unpacklo_epi64(temp0, temp1)); - vfloat upper = _mm_castsi128_ps(_mm_unpackhi_epi64(temp0, temp1)); + vfloat lowerVal = _mm_castsi128_ps(_mm_unpacklo_epi64(temp0, temp1)); + vfloat upperVal = _mm_castsi128_ps(_mm_unpackhi_epi64(temp0, temp1)); vfloat diff = vclampf(indexv, ZEROV, sizev) - _mm_cvtepi32_ps(indexes); // this automagically uses ZEROV in case indexv is NaN - return vintpf(diff, upper, lower); + return vintpf(diff, upperVal, lowerVal); } // NOTE: This version requires LUTs which do not clip at upper and lower bounds @@ -425,11 +425,11 @@ public: // of [values[0][0] ... values[3][0]] and the second [values[0][1] ... values[3][1]]. __m128i temp0 = _mm_unpacklo_epi32(values[0], values[1]); __m128i temp1 = _mm_unpacklo_epi32(values[2], values[3]); - vfloat lower = _mm_castsi128_ps(_mm_unpacklo_epi64(temp0, temp1)); - vfloat upper = _mm_castsi128_ps(_mm_unpackhi_epi64(temp0, temp1)); + vfloat lowerVal = _mm_castsi128_ps(_mm_unpacklo_epi64(temp0, temp1)); + vfloat upperVal = _mm_castsi128_ps(_mm_unpackhi_epi64(temp0, temp1)); vfloat diff = indexv - _mm_cvtepi32_ps(indexes); - return vintpf(diff, upper, lower); + return vintpf(diff, upperVal, lowerVal); } // vectorized LUT access with integer indices. Clips at lower and upper bounds From a1f3edbeabbc81963a9bd0fea77441817ff6a9be Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sun, 14 Feb 2021 17:48:37 +0100 Subject: [PATCH 087/129] delayed.h : fix cppcheck warnings --- rtgui/delayed.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtgui/delayed.h b/rtgui/delayed.h index b57d7300b..80d91a3be 100644 --- a/rtgui/delayed.h +++ b/rtgui/delayed.h @@ -80,7 +80,7 @@ public: { } - DelayedCall(unsigned int _min_delay_ms, unsigned int _max_delay_ms = 0) : + explicit DelayedCall(unsigned int _min_delay_ms, unsigned int _max_delay_ms = 0) : DelayedCall({}, _min_delay_ms, _max_delay_ms) { } @@ -152,7 +152,7 @@ class DelayedConnection final : public rtengine::NonCopyable { public: - DelayedConnection(unsigned int _min_delay_ms, unsigned int _max_delay_ms = 0) : + explicit DelayedConnection(unsigned int _min_delay_ms, unsigned int _max_delay_ms = 0) : min_delay_ms(_min_delay_ms), max_delay_ms(_max_delay_ms) { From 0cc6ae979f5b64664320c88ff8aec279f776c86e Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Tue, 16 Feb 2021 12:12:25 +0100 Subject: [PATCH 088/129] silence warnings, #6105 --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index cc5c2b09b..2be1b6744 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -144,6 +144,10 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=delete-incomplete") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-math-errno") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-math-errno") +# suppress warning https://github.com/Beep6581/RawTherapee/issues/6105 +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-attributes") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes") + # Special treatment for x87 and x86-32 SSE (see GitHub issue #4324) include(FindX87Math) if(HAVE_X87_MATH) From fc031ccb5ad9a6780f0f02c0a61f841629dc6cfa Mon Sep 17 00:00:00 2001 From: Thanatomanic <6567747+Thanatomanic@users.noreply.github.com> Date: Wed, 17 Feb 2021 11:44:25 +0100 Subject: [PATCH 089/129] Remove deprecated GTK3 code, fixes #6103 (#6113) Replaces the following deprecated Gtk classes throughout the codebase by their non-deprecated counterparts. Style, HBox, VBox, HPaned, VPaned, HScrollbar, VScrollbar, VSeparator, HSeparator, Stock, Table, VScale and HScale. --- rtgui/adjuster.cc | 2 +- rtgui/batchqueuepanel.cc | 18 +++--- rtgui/batchqueuepanel.h | 6 +- rtgui/bayerpreprocess.cc | 6 +- rtgui/bayerprocess.cc | 22 ++++---- rtgui/bayerprocess.h | 12 ++-- rtgui/blackwhite.cc | 26 ++++----- rtgui/blackwhite.h | 16 +++--- rtgui/chmixer.cc | 4 +- rtgui/coarsepanel.h | 2 +- rtgui/colorappearance.cc | 41 +++++++------- rtgui/colorappearance.h | 6 +- rtgui/coloredbar.h | 2 +- rtgui/colortoning.cc | 30 +++++----- rtgui/colortoning.h | 12 ++-- rtgui/controlspotpanel.cc | 32 ++++++----- rtgui/controlspotpanel.h | 4 +- rtgui/crop.cc | 4 +- rtgui/darkframe.cc | 2 +- rtgui/darkframe.h | 2 +- rtgui/dirbrowser.cc | 2 +- rtgui/dirbrowser.h | 2 +- rtgui/dirpyrdenoise.cc | 22 ++++---- rtgui/dirpyrdenoise.h | 12 ++-- rtgui/dirpyrequalizer.cc | 16 +++--- rtgui/dirpyrequalizer.h | 4 +- rtgui/dynamicprofilepanel.cc | 11 ++-- rtgui/dynamicprofilepanel.h | 2 +- rtgui/editorpanel.cc | 31 +++++----- rtgui/editorpanel.h | 2 +- rtgui/editwindow.cc | 4 +- rtgui/exifpanel.cc | 9 +-- rtgui/exifpanel.h | 2 +- rtgui/exportpanel.cc | 33 +++++------ rtgui/exportpanel.h | 4 +- rtgui/favoritbrowser.cc | 3 +- rtgui/favoritbrowser.h | 2 +- rtgui/filecatalog.cc | 46 +++++++-------- rtgui/filecatalog.h | 24 ++++---- rtgui/filepanel.cc | 14 ++--- rtgui/filepanel.h | 8 +-- rtgui/filmnegative.cc | 2 +- rtgui/filterpanel.cc | 31 +++++----- rtgui/filterpanel.h | 2 +- rtgui/flatfield.cc | 4 +- rtgui/flatfield.h | 2 +- rtgui/gradient.cc | 2 +- rtgui/gradient.h | 2 +- rtgui/guiutils.cc | 10 ++-- rtgui/guiutils.h | 14 +++-- rtgui/histogrampanel.cc | 2 +- rtgui/history.cc | 9 +-- rtgui/history.h | 4 +- rtgui/icmpanel.cc | 14 ++--- rtgui/icmpanel.h | 6 +- rtgui/imageareapanel.cc | 3 +- rtgui/imageareapanel.h | 2 +- rtgui/indclippedpanel.h | 2 +- rtgui/iptcpanel.cc | 9 +-- rtgui/iptcpanel.h | 2 +- rtgui/labcurve.cc | 6 +- rtgui/labcurve.h | 2 +- rtgui/labgrid.h | 2 +- rtgui/lensgeom.cc | 2 +- rtgui/locallab.cc | 7 ++- rtgui/locallab.h | 2 +- rtgui/locallabtools.cc | 29 +++++++--- rtgui/locallabtools.h | 34 +++++------ rtgui/locallabtools2.cc | 60 ++++++++++++-------- rtgui/metadatapanel.cc | 3 +- rtgui/metadatapanel.h | 2 +- rtgui/navigator.cc | 85 +++++++++++++++------------- rtgui/partialpastedlg.cc | 37 ++++++------ rtgui/partialpastedlg.h | 2 +- rtgui/pdsharpening.cc | 4 +- rtgui/perspective.cc | 20 +++---- rtgui/perspective.h | 4 +- rtgui/placesbrowser.cc | 3 +- rtgui/placesbrowser.h | 2 +- rtgui/preferences.cc | 106 +++++++++++++++++++---------------- rtgui/preferences.h | 2 +- rtgui/preprocess.cc | 2 +- rtgui/preprocesswb.cc | 2 +- rtgui/previewmodepanel.cc | 2 +- rtgui/previewmodepanel.h | 2 +- rtgui/prsharpening.cc | 20 +++---- rtgui/prsharpening.h | 12 ++-- rtgui/recentbrowser.cc | 3 +- rtgui/recentbrowser.h | 2 +- rtgui/renamedlg.cc | 27 +++++---- rtgui/resize.cc | 32 +++++++---- rtgui/resize.h | 2 +- rtgui/retinex.cc | 2 +- rtgui/rgbcurves.cc | 2 +- rtgui/rtwindow.cc | 2 +- rtgui/saveasdlg.cc | 8 +-- rtgui/shadowshighlights.cc | 8 +-- rtgui/sharpening.cc | 20 +++---- rtgui/sharpening.h | 12 ++-- rtgui/shcselector.cc | 2 +- rtgui/shcselector.h | 2 +- rtgui/thresholdadjuster.cc | 5 +- rtgui/thresholdadjuster.h | 4 +- rtgui/thresholdselector.cc | 2 +- rtgui/thresholdselector.h | 2 +- rtgui/thumbbrowserbase.cc | 3 + rtgui/thumbbrowserbase.h | 4 +- rtgui/tonecurve.cc | 14 ++--- rtgui/tonecurve.h | 4 +- rtgui/toolbar.h | 2 +- rtgui/toolpanel.cc | 4 +- rtgui/toolpanel.h | 4 +- rtgui/toolpanelcoord.cc | 2 +- rtgui/toolpanelcoord.h | 2 +- rtgui/wavelet.cc | 88 +++++++++++++++-------------- rtgui/wavelet.h | 20 +++---- rtgui/whitebalance.cc | 4 +- rtgui/xtransprocess.cc | 8 +-- rtgui/xtransprocess.h | 4 +- 119 files changed, 737 insertions(+), 641 deletions(-) diff --git a/rtgui/adjuster.cc b/rtgui/adjuster.cc index 6f8c0e83a..a2f96cac3 100644 --- a/rtgui/adjuster.cc +++ b/rtgui/adjuster.cc @@ -132,7 +132,7 @@ Adjuster::Adjuster( // A label is provided, spreading the widgets in 2 rows attach_next_to(*label, Gtk::POS_LEFT, 1, 1); attach_next_to(*spin, Gtk::POS_RIGHT, 1, 1); - // A second HBox is necessary + // A second Grid is necessary grid = Gtk::manage(new Gtk::Grid()); grid->attach_next_to(*slider, Gtk::POS_LEFT, 1, 1); diff --git a/rtgui/batchqueuepanel.cc b/rtgui/batchqueuepanel.cc index aacf190cc..8a6dd25b4 100644 --- a/rtgui/batchqueuepanel.cc +++ b/rtgui/batchqueuepanel.cc @@ -42,10 +42,10 @@ static Glib::ustring makeFolderLabel(Glib::ustring path) BatchQueuePanel::BatchQueuePanel (FileCatalog* aFileCatalog) : parent(nullptr) { - + set_orientation(Gtk::ORIENTATION_VERTICAL); batchQueue = Gtk::manage( new BatchQueue(aFileCatalog) ); - Gtk::VBox* batchQueueButtonBox = Gtk::manage (new Gtk::VBox); + Gtk::Box* batchQueueButtonBox = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); batchQueueButtonBox->set_name("BatchQueueButtons"); qStartStop = Gtk::manage (new Gtk::Switch()); @@ -67,8 +67,8 @@ BatchQueuePanel::BatchQueuePanel (FileCatalog* aFileCatalog) : parent(nullptr) // Output directory selection fdir = Gtk::manage (new Gtk::Frame (M("QUEUE_LOCATION_TITLE"))); fdir->set_label_align(0.025, 0.5); - Gtk::VBox* odvb = Gtk::manage (new Gtk::VBox ()); - Gtk::HBox* hb2 = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* odvb = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); + Gtk::Box* hb2 = Gtk::manage (new Gtk::Box ()); useTemplate = Gtk::manage (new Gtk::RadioButton (M("QUEUE_LOCATION_TEMPLATE") + ":")); hb2->pack_start (*useTemplate, Gtk::PACK_SHRINK, 4); outdirTemplate = Gtk::manage (new Gtk::Entry ()); @@ -76,7 +76,7 @@ BatchQueuePanel::BatchQueuePanel (FileCatalog* aFileCatalog) : parent(nullptr) odvb->pack_start (*hb2, Gtk::PACK_SHRINK, 4); outdirTemplate->set_tooltip_markup (M("QUEUE_LOCATION_TEMPLATE_TOOLTIP")); useTemplate->set_tooltip_markup (M("QUEUE_LOCATION_TEMPLATE_TOOLTIP")); - Gtk::HBox* hb3 = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* hb3 = Gtk::manage (new Gtk::Box ()); useFolder = Gtk::manage (new Gtk::RadioButton (M("QUEUE_LOCATION_FOLDER") + ":")); hb3->pack_start (*useFolder, Gtk::PACK_SHRINK, 4); @@ -130,7 +130,7 @@ BatchQueuePanel::BatchQueuePanel (FileCatalog* aFileCatalog) : parent(nullptr) saveFormatPanel->setListener (this); // setup button bar - topBox = Gtk::manage (new Gtk::HBox ()); + topBox = Gtk::manage (new Gtk::Box ()); pack_start (*topBox, Gtk::PACK_SHRINK); topBox->set_name("BatchQueueButtonsMainContainer"); @@ -142,12 +142,12 @@ BatchQueuePanel::BatchQueuePanel (FileCatalog* aFileCatalog) : parent(nullptr) pack_start (*batchQueue); // lower box with thumbnail zoom - bottomBox = Gtk::manage (new Gtk::HBox ()); + bottomBox = Gtk::manage (new Gtk::Box ()); pack_start (*bottomBox, Gtk::PACK_SHRINK); // thumbnail zoom - Gtk::HBox* zoomBox = Gtk::manage (new Gtk::HBox ()); - zoomBox->pack_start (*Gtk::manage (new Gtk::VSeparator), Gtk::PACK_SHRINK, 4); + Gtk::Box* zoomBox = Gtk::manage (new Gtk::Box ()); + zoomBox->pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)), Gtk::PACK_SHRINK, 4); Gtk::Label* zoomLabel = Gtk::manage (new Gtk::Label (Glib::ustring("") + M("FILEBROWSER_THUMBSIZE") + ":")); zoomLabel->set_use_markup (true); zoomBox->pack_start (*zoomLabel, Gtk::PACK_SHRINK, 4); diff --git a/rtgui/batchqueuepanel.h b/rtgui/batchqueuepanel.h index 7c0a367d4..db4e243e9 100644 --- a/rtgui/batchqueuepanel.h +++ b/rtgui/batchqueuepanel.h @@ -30,7 +30,7 @@ class RTWindow; class FileCatalog; class Thumbnail; -class BatchQueuePanel : public Gtk::VBox, +class BatchQueuePanel : public Gtk::Box, public BatchQueueListener, public FormatChangeListener { @@ -51,8 +51,8 @@ class BatchQueuePanel : public Gtk::VBox, RTWindow* parent; BatchQueue* batchQueue; - Gtk::HBox* bottomBox; - Gtk::HBox* topBox; + Gtk::Box* bottomBox; + Gtk::Box* topBox; std::atomic queueShouldRun; diff --git a/rtgui/bayerpreprocess.cc b/rtgui/bayerpreprocess.cc index 2a1896d80..793496b5f 100644 --- a/rtgui/bayerpreprocess.cc +++ b/rtgui/bayerpreprocess.cc @@ -48,7 +48,7 @@ BayerPreProcess::BayerPreProcess() : FoldableToolPanel(this, "bayerpreprocess", greenEqThreshold->show(); - Gtk::HBox *hb = Gtk::manage(new Gtk::HBox()); + Gtk::Box *hb = Gtk::manage(new Gtk::Box()); hb->pack_start(*Gtk::manage(new Gtk::Label(M("TP_PREPROCESS_LINEDENOISE_DIRECTION") + ": ")), Gtk::PACK_SHRINK, 0); lineDenoiseDirection = Gtk::manage(new MyComboBoxText()); lineDenoiseDirection->append(M("TP_PREPROCESS_LINEDENOISE_DIRECTION_HORIZONTAL")); @@ -63,7 +63,7 @@ BayerPreProcess::BayerPreProcess() : FoldableToolPanel(this, "bayerpreprocess", pack_start(*lineDenoise, Gtk::PACK_SHRINK, 4); pack_start(*hb, Gtk::PACK_SHRINK, 4); - pack_start(*Gtk::manage(new Gtk::HSeparator())); + pack_start(*Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL))); pack_start(*greenEqThreshold, Gtk::PACK_SHRINK, 4); @@ -71,7 +71,7 @@ BayerPreProcess::BayerPreProcess() : FoldableToolPanel(this, "bayerpreprocess", pdafLinesFilter->show(); pdafLinesFilter->signal_toggled().connect(sigc::mem_fun(*this, &BayerPreProcess::pdafLinesFilterChanged), true); - pack_start(*Gtk::manage(new Gtk::HSeparator())); + pack_start(*Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL))); pack_start(*pdafLinesFilter, Gtk::PACK_SHRINK, 4); } diff --git a/rtgui/bayerprocess.cc b/rtgui/bayerprocess.cc index d219dbdd1..6da15951f 100644 --- a/rtgui/bayerprocess.cc +++ b/rtgui/bayerprocess.cc @@ -40,7 +40,7 @@ BayerProcess::BayerProcess () : EvDemosaicAutoContrast = m->newEvent(DEMOSAIC, "HISTORY_MSG_DUALDEMOSAIC_AUTO_CONTRAST"); EvDemosaicPixelshiftDemosaicMethod = m->newEvent(DEMOSAIC, "HISTORY_MSG_PIXELSHIFT_DEMOSAIC"); - Gtk::HBox* hb1 = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* hb1 = Gtk::manage (new Gtk::Box ()); hb1->pack_start (*Gtk::manage (new Gtk::Label ( M("TP_RAW_DMETHOD") + ": ")), Gtk::PACK_SHRINK, 4); method = Gtk::manage (new MyComboBoxText ()); @@ -54,7 +54,7 @@ BayerProcess::BayerProcess () : hb1->pack_end (*method, Gtk::PACK_EXPAND_WIDGET, 4); pack_start( *hb1, Gtk::PACK_SHRINK, 4); - dualDemosaicOptions = Gtk::manage(new Gtk::VBox()); + dualDemosaicOptions = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); dualDemosaicContrast = Gtk::manage(new Adjuster(M("TP_RAW_DUALDEMOSAICCONTRAST"), 0, 100, 1, 20)); dualDemosaicContrast->setAdjusterListener(this); @@ -66,7 +66,7 @@ BayerProcess::BayerProcess () : dualDemosaicOptions->pack_start(*dualDemosaicContrast); pack_start( *dualDemosaicOptions, Gtk::PACK_SHRINK, 4); - borderbox = Gtk::manage(new Gtk::HBox()); + borderbox = Gtk::manage(new Gtk::Box()); border = Gtk::manage(new Adjuster(M("TP_RAW_BORDER"), 0, 16, 1, 4)); border->setAdjusterListener (this); @@ -76,7 +76,7 @@ BayerProcess::BayerProcess () : borderbox->pack_start(*border); pack_start(*borderbox, Gtk::PACK_SHRINK, 4); - imageNumberBox = Gtk::manage (new Gtk::HBox ()); + imageNumberBox = Gtk::manage (new Gtk::Box ()); imageNumberBox->pack_start (*Gtk::manage (new Gtk::Label ( M("TP_RAW_IMAGENUM") + ": ")), Gtk::PACK_SHRINK, 4); imageNumber = Gtk::manage (new MyComboBoxText ()); imageNumber->append("1"); @@ -88,7 +88,7 @@ BayerProcess::BayerProcess () : imageNumberBox->pack_end (*imageNumber, Gtk::PACK_EXPAND_WIDGET, 4); pack_start( *imageNumberBox, Gtk::PACK_SHRINK, 4); - pack_start( *Gtk::manage( new Gtk::HSeparator()), Gtk::PACK_SHRINK, 0 ); + pack_start( *Gtk::manage( new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)), Gtk::PACK_SHRINK, 0 ); ccSteps = Gtk::manage (new Adjuster (M("TP_RAW_FALSECOLOR"), 0, 5, 1, 0 )); ccSteps->setAdjusterListener (this); @@ -97,7 +97,7 @@ BayerProcess::BayerProcess () : ccSteps->show(); pack_start( *ccSteps, Gtk::PACK_SHRINK, 4); - dcbOptions = Gtk::manage (new Gtk::VBox ()); + dcbOptions = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); dcbIterations = Gtk::manage (new Adjuster (M("TP_RAW_DCBITERATIONS"), 0, 5, 1, 2)); dcbIterations->setAdjusterListener (this); @@ -111,7 +111,7 @@ BayerProcess::BayerProcess () : dcbOptions->pack_start(*dcbEnhance); pack_start( *dcbOptions, Gtk::PACK_SHRINK, 4); - lmmseOptions = Gtk::manage (new Gtk::VBox ()); + lmmseOptions = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); lmmseIterations = Gtk::manage (new Adjuster (M("TP_RAW_LMMSEITERATIONS"), 0, 6, 1, 2)); lmmseIterations->setAdjusterListener (this); @@ -128,7 +128,7 @@ BayerProcess::BayerProcess () : pixelShiftFrame = Gtk::manage(new Gtk::Frame(M("TP_RAW_PIXELSHIFT"))); - Gtk::VBox *pixelShiftMainVBox = Gtk::manage (new Gtk::VBox ()); + Gtk::Box *pixelShiftMainVBox = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); pixelShiftMainVBox->set_border_width(0); pixelShiftEqualBright = Gtk::manage (new CheckBox(M("TP_RAW_PIXELSHIFTEQUALBRIGHT"), multiImage)); @@ -141,7 +141,7 @@ BayerProcess::BayerProcess () : pixelShiftEqualBrightChannel->set_tooltip_text (M("TP_RAW_PIXELSHIFTEQUALBRIGHTCHANNEL_TOOLTIP")); pixelShiftMainVBox->pack_start(*pixelShiftEqualBrightChannel); - Gtk::HBox* hb3 = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* hb3 = Gtk::manage (new Gtk::Box ()); hb3->pack_start (*Gtk::manage (new Gtk::Label ( M("TP_RAW_PIXELSHIFTMOTIONMETHOD") + ": ")), Gtk::PACK_SHRINK, 4); pixelShiftMotionMethod = Gtk::manage (new MyComboBoxText ()); pixelShiftMotionMethod->append(M("TP_RAW_PIXELSHIFTMM_OFF")); @@ -152,7 +152,7 @@ BayerProcess::BayerProcess () : hb3->pack_start(*pixelShiftMotionMethod); pixelShiftMainVBox->pack_start(*hb3); - pixelShiftOptions = Gtk::manage (new Gtk::VBox ()); + pixelShiftOptions = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); pixelShiftOptions->set_border_width(0); pixelShiftShowMotion = Gtk::manage (new CheckBox(M("TP_RAW_PIXELSHIFTSHOWMOTION"), multiImage)); @@ -166,7 +166,7 @@ BayerProcess::BayerProcess () : pixelShiftMainVBox->pack_start(*pixelShiftShowMotionMaskOnly); - Gtk::HBox* hb4 = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* hb4 = Gtk::manage (new Gtk::Box ()); hb4->pack_start (*Gtk::manage (new Gtk::Label ( M("TP_RAW_PIXELSHIFTDMETHOD") + ": ")), Gtk::PACK_SHRINK, 4); pixelShiftDemosaicMethod = Gtk::manage (new MyComboBoxText ()); for(const auto method_string : procparams::RAWParams::BayerSensor::getPSDemosaicMethodStrings()) { diff --git a/rtgui/bayerprocess.h b/rtgui/bayerprocess.h index f8348e02b..c2af5a987 100644 --- a/rtgui/bayerprocess.h +++ b/rtgui/bayerprocess.h @@ -37,18 +37,18 @@ class BayerProcess final : protected: MyComboBoxText* method; - Gtk::HBox* borderbox; - Gtk::HBox *imageNumberBox; + Gtk::Box* borderbox; + Gtk::Box *imageNumberBox; Adjuster* border; MyComboBoxText* imageNumber; Adjuster* ccSteps; - Gtk::VBox *dcbOptions; + Gtk::Box *dcbOptions; Adjuster* dcbIterations; CheckBox* dcbEnhance; - Gtk::VBox *lmmseOptions; + Gtk::Box *lmmseOptions; Adjuster* lmmseIterations; Gtk::Frame *pixelShiftFrame; - Gtk::VBox *pixelShiftOptions; + Gtk::Box *pixelShiftOptions; MyComboBoxText* pixelShiftMotionMethod; MyComboBoxText* pixelShiftDemosaicMethod; CheckBox* pixelShiftShowMotion; @@ -63,7 +63,7 @@ protected: Adjuster* pixelShiftSmooth; Adjuster* pixelShiftEperIso; Adjuster* pixelShiftSigma; - Gtk::VBox *dualDemosaicOptions; + Gtk::Box *dualDemosaicOptions; Adjuster* dualDemosaicContrast; int oldMethod; bool lastAutoContrast; diff --git a/rtgui/blackwhite.cc b/rtgui/blackwhite.cc index 11eab3447..e713f1450 100644 --- a/rtgui/blackwhite.cc +++ b/rtgui/blackwhite.cc @@ -45,7 +45,7 @@ BlackWhite::BlackWhite (): FoldableToolPanel(this, "blackwhite", M("TP_BWMIX_LAB //----------- Method combobox ------------------------------ - Gtk::HBox* metHBox = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* metHBox = Gtk::manage (new Gtk::Box ()); metHBox->set_spacing (2); Gtk::Label* metLabel = Gtk::manage (new Gtk::Label (M("TP_BWMIX_MET") + ":")); metHBox->pack_start (*metLabel, Gtk::PACK_SHRINK); @@ -62,7 +62,7 @@ BlackWhite::BlackWhite (): FoldableToolPanel(this, "blackwhite", M("TP_BWMIX_LAB //----------- Luminance equalizer ------------------------------ - luminanceSep = Gtk::manage (new Gtk::HSeparator()); + luminanceSep = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); pack_start (*luminanceSep); std::vector bottomMilestones; @@ -92,10 +92,10 @@ BlackWhite::BlackWhite (): FoldableToolPanel(this, "blackwhite", M("TP_BWMIX_LAB mixerFrame->set_label_align(0.025, 0.5); pack_start (*mixerFrame, Gtk::PACK_SHRINK, 0); - mixerVBox = Gtk::manage (new Gtk::VBox ()); + mixerVBox = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); mixerVBox->set_spacing(4); - autoHBox = Gtk::manage (new Gtk::HBox ()); + autoHBox = Gtk::manage (new Gtk::Box ()); autoch = Gtk::manage (new Gtk::ToggleButton (M("TP_BWMIX_AUTOCH"))); autoconn = autoch->signal_toggled().connect( sigc::mem_fun(*this, &BlackWhite::autoch_toggled) ); @@ -111,9 +111,9 @@ BlackWhite::BlackWhite (): FoldableToolPanel(this, "blackwhite", M("TP_BWMIX_LAB //----------- Presets combobox ------------------------------ - mixerVBox->pack_start (*Gtk::manage (new Gtk::HSeparator())); + mixerVBox->pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL))); - settingHBox = Gtk::manage (new Gtk::HBox ()); + settingHBox = Gtk::manage (new Gtk::Box ()); settingHBox->set_spacing (2); settingHBox->set_tooltip_markup (M("TP_BWMIX_SETTING_TOOLTIP")); Gtk::Label *settingLabel = Gtk::manage (new Gtk::Label (M("TP_BWMIX_SETTING") + ":")); @@ -147,7 +147,7 @@ BlackWhite::BlackWhite (): FoldableToolPanel(this, "blackwhite", M("TP_BWMIX_LAB //----------- Complementary Color checkbox ------------------------------ - enabledccSep = Gtk::manage (new Gtk::HSeparator()); + enabledccSep = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); mixerVBox->pack_start (*enabledccSep); enabledcc = Gtk::manage (new Gtk::CheckButton (M("TP_BWMIX_CC_ENABLED"))); @@ -161,10 +161,10 @@ BlackWhite::BlackWhite (): FoldableToolPanel(this, "blackwhite", M("TP_BWMIX_LAB //----------- Color Filters ------------------------------ - filterSep = Gtk::manage (new Gtk::HSeparator()); + filterSep = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); mixerVBox->pack_start (*filterSep); - filterHBox = Gtk::manage (new Gtk::HBox ()); + filterHBox = Gtk::manage (new Gtk::Box ()); filterHBox->set_spacing (2); filterHBox->set_tooltip_markup (M("TP_BWMIX_FILTER_TOOLTIP")); Gtk::Label *filterLabel = Gtk::manage (new Gtk::Label (M("TP_BWMIX_FILTER") + ":")); @@ -200,7 +200,7 @@ BlackWhite::BlackWhite (): FoldableToolPanel(this, "blackwhite", M("TP_BWMIX_LAB imgIcon[9] = Gtk::manage (new RTImage ("circle-empty-green-small.png")); imgIcon[10] = Gtk::manage (new RTImage ("circle-empty-blue-small.png")); - mixerVBox->pack_start (*Gtk::manage (new Gtk::HSeparator())); + mixerVBox->pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL))); mixerRed = Gtk::manage(new Adjuster (/*M("TP_BWMIX_RED")*/"", -100, 200, 1, 33, imgIcon[0])); @@ -223,10 +223,10 @@ BlackWhite::BlackWhite (): FoldableToolPanel(this, "blackwhite", M("TP_BWMIX_LAB mixerBlue->show(); mixerVBox->pack_start( *mixerBlue, Gtk::PACK_SHRINK, 0); - filterSep2 = Gtk::manage (new Gtk::HSeparator()); + filterSep2 = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); mixerVBox->pack_start (*filterSep2); - algoHBox = Gtk::manage (new Gtk::HBox ()); + algoHBox = Gtk::manage (new Gtk::Box ()); algoHBox->set_spacing (2); algoHBox->set_tooltip_markup (M("TP_BWMIX_ALGO_TOOLTIP")); @@ -284,7 +284,7 @@ BlackWhite::BlackWhite (): FoldableToolPanel(this, "blackwhite", M("TP_BWMIX_LAB gammaFrame->set_label_align(0.025, 0.5); pack_start (*gammaFrame, Gtk::PACK_SHRINK, 0); - Gtk::VBox *gammaVBox = Gtk::manage (new Gtk::VBox()); + Gtk::Box* gammaVBox = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); gammaVBox->set_spacing(4); diff --git a/rtgui/blackwhite.h b/rtgui/blackwhite.h index 1aed86997..505d842db 100644 --- a/rtgui/blackwhite.h +++ b/rtgui/blackwhite.h @@ -90,7 +90,7 @@ private: void hideGamma(); FlatCurveEditor* luminanceCurve; - Gtk::HSeparator* luminanceSep; + Gtk::Separator* luminanceSep; CurveEditorGroup* luminanceCEG; CurveEditorGroup* beforeCurveCEG; DiagonalCurveEditor* beforeCurve; @@ -99,13 +99,13 @@ private: DiagonalCurveEditor* afterCurve; MyComboBoxText* afterCurveMode; Gtk::ToggleButton* autoch; - Gtk::HBox* autoHBox; + Gtk::Box* autoHBox; Gtk::Button* neutral; Gtk::Label* RGBLabels; MyComboBoxText* algo; sigc::connection algoconn; Gtk::Label* alLabel; - Gtk::HBox* algoHBox; + Gtk::Box* algoHBox; Adjuster *mixerRed; Adjuster *mixerGreen; @@ -120,20 +120,20 @@ private: Adjuster *mixerPurple; MyComboBoxText* method; sigc::connection methodconn; - Gtk::HBox* filterHBox; - Gtk::HSeparator* filterSep, *filterSep2; + Gtk::Box* filterHBox; + Gtk::Separator* filterSep, *filterSep2; MyComboBoxText* filter; sigc::connection filterconn; - Gtk::HBox* settingHBox; + Gtk::Box* settingHBox; MyComboBoxText* setting; sigc::connection settingconn; Gtk::Frame* mixerFrame; - Gtk::VBox * mixerVBox; + Gtk::Box* mixerVBox; Gtk::Frame* gammaFrame; Gtk::Image *imgIcon[11]; - Gtk::HSeparator* enabledccSep; + Gtk::Separator* enabledccSep; Gtk::CheckButton* enabledcc; bool lastEnabledcc, lastAuto; sigc::connection enaccconn, tcmodeconn, tcmodeconn2, autoconn, neutralconn; diff --git a/rtgui/chmixer.cc b/rtgui/chmixer.cc index 4b243f13c..619d7be3e 100644 --- a/rtgui/chmixer.cc +++ b/rtgui/chmixer.cc @@ -47,7 +47,7 @@ ChMixer::ChMixer (): FoldableToolPanel(this, "chmixer", M("TP_CHMIXER_LABEL"), f red[1] = Gtk::manage (new Adjuster ("", -RANGE, RANGE, 0.1, 0, imgIcon[1])); red[2] = Gtk::manage (new Adjuster ("", -RANGE, RANGE, 0.1, 0, imgIcon[2])); - Gtk::HSeparator* rsep = Gtk::manage (new Gtk::HSeparator ()); + Gtk::Separator* rsep = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); pack_start (*rlabel); @@ -66,7 +66,7 @@ ChMixer::ChMixer (): FoldableToolPanel(this, "chmixer", M("TP_CHMIXER_LABEL"), f green[1] = Gtk::manage (new Adjuster ("", -RANGE, RANGE, 0.1, 100, imgIcon[4])); green[2] = Gtk::manage (new Adjuster ("", -RANGE, RANGE, 0.1, 0, imgIcon[5])); - Gtk::HSeparator* gsep = Gtk::manage (new Gtk::HSeparator ()); + Gtk::Separator* gsep = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); pack_start (*glabel); diff --git a/rtgui/coarsepanel.h b/rtgui/coarsepanel.h index b7b4f8cf7..a74c05b15 100644 --- a/rtgui/coarsepanel.h +++ b/rtgui/coarsepanel.h @@ -23,7 +23,7 @@ #include "toolpanel.h" class CoarsePanel final : - public Gtk::HBox, + public Gtk::Box, public ToolPanel { diff --git a/rtgui/colorappearance.cc b/rtgui/colorappearance.cc index 968d3cc58..8b57aadb4 100644 --- a/rtgui/colorappearance.cc +++ b/rtgui/colorappearance.cc @@ -228,11 +228,11 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" EvCATcat = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_CATCAT"); //preset button cat02/16 Gtk::Frame *genFrame; - Gtk::VBox *genVBox; + Gtk::Box* genVBox; genFrame = Gtk::manage (new Gtk::Frame (M ("TP_COLORAPP_GEN")) ); genFrame->set_label_align (0.025, 0.5); genFrame->set_tooltip_markup (M ("TP_COLORAPP_GEN_TOOLTIP")); - genVBox = Gtk::manage ( new Gtk::VBox()); + genVBox = Gtk::manage ( new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); genVBox->set_spacing (2); complexmethod = Gtk::manage (new MyComboBoxText ()); @@ -240,7 +240,7 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" complexmethod->append(M("TP_WAVELET_COMPEXPERT")); complexmethodconn = complexmethod->signal_changed().connect(sigc::mem_fun(*this, &ColorAppearance::complexmethodChanged)); complexmethod->set_tooltip_text(M("TP_WAVELET_COMPLEX_TOOLTIP")); - Gtk::HBox* const complexHBox = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const complexHBox = Gtk::manage(new Gtk::Box()); Gtk::Label* const complexLabel = Gtk::manage(new Gtk::Label(M("TP_WAVELET_COMPLEXLAB") + ":")); complexHBox->pack_start(*complexLabel, Gtk::PACK_SHRINK, 4); complexHBox->pack_start(*complexmethod); @@ -251,7 +251,7 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" modelmethod->append(M("TP_COLORAPP_MOD16")); modelmethodconn = modelmethod->signal_changed().connect(sigc::mem_fun(*this, &ColorAppearance::modelmethodChanged)); modelmethod->set_tooltip_text(M("TP_COLORAPP_MODELCAT_TOOLTIP")); - Gtk::HBox* const modelHBox = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const modelHBox = Gtk::manage(new Gtk::Box()); Gtk::Label* const modelLabel = Gtk::manage(new Gtk::Label(M("TP_COLORAPP_MODELCAT") + ":")); modelHBox->pack_start(*modelLabel, Gtk::PACK_SHRINK, 4); modelHBox->pack_start(*modelmethod); @@ -263,7 +263,7 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" catmethod->append(M("TP_COLORAPP_CATSYMSPE")); catmethodconn = catmethod->signal_changed().connect(sigc::mem_fun(*this, &ColorAppearance::catmethodChanged)); catmethod->set_tooltip_text(M("TP_COLORAPP_CATMET_TOOLTIP")); - Gtk::HBox* const catHBox = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const catHBox = Gtk::manage(new Gtk::Box()); Gtk::Label* const catLabel = Gtk::manage(new Gtk::Label(M("TP_COLORAPP_CATMOD") + ":")); catHBox->pack_start(*catLabel, Gtk::PACK_SHRINK, 4); catHBox->pack_start(*catmethod); @@ -283,12 +283,12 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" // Process 1 frame Gtk::Frame *p1Frame; // Vertical box container for the content of the Process 1 frame - Gtk::VBox *p1VBox; + Gtk::Box* p1VBox; p1Frame = Gtk::manage (new Gtk::Frame (M ("TP_COLORAPP_LABEL_SCENE")) ); p1Frame->set_label_align (0.025, 0.5); p1Frame->set_tooltip_markup (M ("TP_COLORAPP_SOURCEF_TOOLTIP")); - p1VBox = Gtk::manage ( new Gtk::VBox()); + p1VBox = Gtk::manage ( new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); p1VBox->set_spacing (2); degree = Gtk::manage (new Adjuster (M ("TP_COLORAPP_CIECAT_DEGREE"), 0., 100., 1., 90.)); @@ -305,7 +305,7 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" // surrsource->set_tooltip_markup (M ("TP_COLORAPP_SURSOURCE_TOOLTIP")); - Gtk::HBox* surrHBox1 = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* surrHBox1 = Gtk::manage (new Gtk::Box ()); surrHBox1->set_spacing (2); surrHBox1->set_tooltip_markup (M ("TP_COLORAPP_SURSOURCE_TOOLTIP")); Gtk::Label* surrLabel1 = Gtk::manage (new Gtk::Label (M ("TP_COLORAPP_SURROUNDSRC") + ":")); @@ -323,8 +323,7 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" -// Gtk::HBox* wbmHBox = Gtk::manage (new Gtk::HBox ()); - wbmHBox = Gtk::manage (new Gtk::HBox ()); + wbmHBox = Gtk::manage (new Gtk::Box ()); wbmHBox->set_spacing (2); wbmHBox->set_tooltip_markup (M ("TP_COLORAPP_MODEL_TOOLTIP")); @@ -340,8 +339,7 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" p1VBox->pack_start (*wbmHBox); -// Gtk::HBox* illumHBox = Gtk::manage (new Gtk::HBox ()); - illumHBox = Gtk::manage (new Gtk::HBox ()); + illumHBox = Gtk::manage (new Gtk::Box ()); illumHBox->set_spacing (2); illumHBox->set_tooltip_markup (M ("TP_COLORAPP_ILLUM_TOOLTIP")); Gtk::Label* illumLab = Gtk::manage (new Gtk::Label (M ("TP_COLORAPP_ILLUM") + ":")); @@ -412,18 +410,17 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" /* Gtk::Frame *p2Frame; // Vertical box container for the content of the Process 1 frame - Gtk::VBox *p2VBox; + Gtk::Box* p2VBox; p2Frame = Gtk::manage (new Gtk::Frame (M ("TP_COLORAPP_LABEL_CAM02")) ); p2Frame->set_label_align (0.025, 0.5); */ - Gtk::VBox *p2VBox; + Gtk::Box* p2VBox; - p2VBox = Gtk::manage ( new Gtk::VBox()); + p2VBox = Gtk::manage ( new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); p2VBox->set_spacing (2); -// Gtk::HBox* alHBox = Gtk::manage (new Gtk::HBox ()); - alHBox = Gtk::manage (new Gtk::HBox ()); + alHBox = Gtk::manage (new Gtk::Box ()); alHBox->set_spacing (2); alHBox->set_tooltip_markup (M ("TP_COLORAPP_ALGO_TOOLTIP")); Gtk::Label* alLabel = Gtk::manage (new Gtk::Label (M ("TP_COLORAPP_ALGO") + ":")); @@ -437,7 +434,7 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" alHBox->pack_start (*algo); p2VBox->pack_start (*alHBox); - p2VBox->pack_start (*Gtk::manage (new Gtk::HSeparator()), Gtk::PACK_EXPAND_WIDGET, 4); + p2VBox->pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)), Gtk::PACK_EXPAND_WIDGET, 4); jlight = Gtk::manage (new Adjuster (M ("TP_COLORAPP_LIGHT"), -100.0, 100.0, 0.1, 0.)); jlight->setAdjusterListener (this); @@ -524,7 +521,7 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" sharpcieconn = sharpcie->signal_toggled().connect( sigc::mem_fun(*this, &ColorAppearance::sharpcie_toggled) ); p2VBox->pack_start (*sharpcie); */ - p2VBox->pack_start (*Gtk::manage (new Gtk::HSeparator()), Gtk::PACK_EXPAND_WIDGET, 4); + p2VBox->pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)), Gtk::PACK_EXPAND_WIDGET, 4); toneCurveMode = Gtk::manage (new MyComboBoxText ()); toneCurveMode->append (M ("TP_COLORAPP_TCMODE_LIGHTNESS")); @@ -641,13 +638,13 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" // Process 3 frame Gtk::Frame *p3Frame; // Vertical box container for the content of the Process 3 frame - Gtk::VBox *p3VBox; + Gtk::Box* p3VBox; p3Frame = Gtk::manage (new Gtk::Frame (M ("TP_COLORAPP_LABEL_VIEWING")) ); // "Editing viewing conditions" ??? p3Frame->set_label_align (0.025, 0.5); p3Frame->set_tooltip_markup (M ("TP_COLORAPP_VIEWINGF_TOOLTIP")); - p3VBox = Gtk::manage ( new Gtk::VBox()); + p3VBox = Gtk::manage ( new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); p3VBox->set_spacing (2); Gtk::Image* itempL1 = Gtk::manage (new RTImage ("circle-blue-small.png")); @@ -697,7 +694,7 @@ ColorAppearance::ColorAppearance () : FoldableToolPanel (this, "colorappearance" p3VBox->pack_start (*greenout); p3VBox->pack_start (*ybout); - Gtk::HBox* surrHBox = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* surrHBox = Gtk::manage (new Gtk::Box ()); surrHBox->set_spacing (2); surrHBox->set_tooltip_markup (M ("TP_COLORAPP_SURROUND_TOOLTIP")); Gtk::Label* surrLabel = Gtk::manage (new Gtk::Label (M ("TP_COLORAPP_SURROUND") + ":")); diff --git a/rtgui/colorappearance.h b/rtgui/colorappearance.h index 07ca33b8e..ce1971e85 100644 --- a/rtgui/colorappearance.h +++ b/rtgui/colorappearance.h @@ -177,9 +177,9 @@ private: sigc::connection gamutconn, datacieconn, tonecieconn /*,badpixconn , sharpcieconn*/; sigc::connection tcmodeconn, tcmode2conn, tcmode3conn, neutralconn; sigc::connection complexmethodconn, modelmethodconn, catmethodconn; - Gtk::HBox* alHBox; - Gtk::HBox* wbmHBox; - Gtk::HBox* illumHBox; + Gtk::Box* alHBox; + Gtk::Box* wbmHBox; + Gtk::Box* illumHBox; CurveEditorGroup* curveEditorG; CurveEditorGroup* curveEditorG2; CurveEditorGroup* curveEditorG3; diff --git a/rtgui/coloredbar.h b/rtgui/coloredbar.h index 69cfa47d1..f5156129e 100644 --- a/rtgui/coloredbar.h +++ b/rtgui/coloredbar.h @@ -27,7 +27,7 @@ * * WARNING: If the color has no gradient defined or can't get colors from the provider, * the bar will have undefined data, and the calling class will have to draw - * the bar itself, i.e. use render_background (depending on its Gtk::Style) + * the bar itself, i.e. use render_background (depending on its Gtk::StyleContext) * */ class ColoredBar final : private BackBuffer, public ColorCaller diff --git a/rtgui/colortoning.cc b/rtgui/colortoning.cc index f730e8175..d3c485baa 100644 --- a/rtgui/colortoning.cc +++ b/rtgui/colortoning.cc @@ -51,7 +51,7 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR method->set_active (0); method->set_tooltip_text (M("TP_COLORTONING_METHOD_TOOLTIP")); - ctbox = Gtk::manage (new Gtk::HBox ()); + ctbox = Gtk::manage (new Gtk::Box ()); Gtk::Label* lab = Gtk::manage (new Gtk::Label (M("TP_COLORTONING_METHOD"))); ctbox->pack_start (*lab, Gtk::PACK_SHRINK, 4); ctbox->pack_start (*method); @@ -61,7 +61,7 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR //----------- Color curve ------------------------------ - colorSep = Gtk::manage (new Gtk::HSeparator()); + colorSep = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); pack_start (*colorSep); colorCurveEditorG = new CurveEditorGroup (options.lastColorToningCurvesDir, M("TP_COLORTONING_COLOR")); @@ -202,18 +202,18 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR //----------- Saturation and strength ------------------------------ -// satLimiterSep = Gtk::manage (new Gtk::HSeparator()); +// satLimiterSep = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); // pack_start (*satLimiterSep, Gtk::PACK_SHRINK); // Gtk::Frame *p1Frame; // Vertical box container for the content of the Process 1 frame - Gtk::VBox *p1VBox; + Gtk::Box* p1VBox; p1Frame = Gtk::manage (new Gtk::Frame(M("TP_COLORTONING_SA")) ); p1Frame->set_label_align(0.025, 0.5); - p1VBox = Gtk::manage ( new Gtk::VBox()); + p1VBox = Gtk::manage ( new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); p1VBox->set_spacing(2); autosat = Gtk::manage (new Gtk::CheckButton (M("TP_COLORTONING_AUTOSAT"))); @@ -244,10 +244,10 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR // --------------------Sliders BW Colortoning ------------------- - chanMixerBox = Gtk::manage (new Gtk::VBox()); - Gtk::VBox *chanMixerHLBox = Gtk::manage (new Gtk::VBox()); - Gtk::VBox *chanMixerMidBox = Gtk::manage (new Gtk::VBox()); - Gtk::VBox *chanMixerShadowsBox = Gtk::manage (new Gtk::VBox()); + chanMixerBox = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); + Gtk::Box* chanMixerHLBox = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); + Gtk::Box* chanMixerMidBox = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); + Gtk::Box* chanMixerShadowsBox = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); Gtk::Image* iblueR = Gtk::manage (new RTImage ("circle-blue-small.png")); Gtk::Image* iyelL = Gtk::manage (new RTImage ("circle-yellow-small.png")); @@ -312,7 +312,7 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR pack_start( *strength, Gtk::PACK_SHRINK, 2); //I have moved after Chanmixer //--------------------- Reset sliders --------------------------- - neutrHBox = Gtk::manage (new Gtk::HBox ()); + neutrHBox = Gtk::manage (new Gtk::Box()); neutral = Gtk::manage (new Gtk::Button (M("TP_COLORTONING_NEUTRAL"))); neutral->set_tooltip_text (M("TP_COLORTONING_NEUTRAL_TIP")); @@ -378,7 +378,7 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR EvLabRegionMaskBlur = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_COLORTONING_LABREGION_MASKBLUR"); EvLabRegionShowMask = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_COLORTONING_LABREGION_SHOWMASK"); EvLabRegionChannel = m->newEvent(LUMINANCECURVE, "HISTORY_MSG_COLORTONING_LABREGION_CHANNEL"); - labRegionBox = Gtk::manage(new Gtk::VBox()); + labRegionBox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); labRegionList = Gtk::manage(new Gtk::ListViewText(3)); labRegionList->set_size_request(-1, 150); @@ -388,9 +388,9 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR labRegionList->set_column_title(2, M("TP_COLORTONING_LABREGION_MASK")); labRegionList->set_activate_on_single_click(true); labRegionSelectionConn = labRegionList->get_selection()->signal_changed().connect(sigc::mem_fun(this, &ColorToning::onLabRegionSelectionChanged)); - Gtk::HBox *hb = Gtk::manage(new Gtk::HBox()); + Gtk::Box *hb = Gtk::manage(new Gtk::Box()); hb->pack_start(*labRegionList, Gtk::PACK_EXPAND_WIDGET); - Gtk::VBox *vb = Gtk::manage(new Gtk::VBox()); + Gtk::Box* vb = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); labRegionAdd = Gtk::manage(new Gtk::Button()); labRegionAdd->add(*Gtk::manage(new RTImage("add-small.png"))); labRegionAdd->signal_clicked().connect(sigc::mem_fun(*this, &ColorToning::labRegionAddPressed)); @@ -433,7 +433,7 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR labRegionPower->setLogScale(4, 0.1); labRegionBox->pack_start(*labRegionPower); - hb = Gtk::manage(new Gtk::HBox()); + hb = Gtk::manage(new Gtk::Box()); labRegionChannel = Gtk::manage(new MyComboBoxText()); labRegionChannel->append(M("TP_COLORTONING_LABREGION_CHANNEL_ALL")); labRegionChannel->append(M("TP_COLORTONING_LABREGION_CHANNEL_R")); @@ -446,7 +446,7 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR hb->pack_start(*labRegionChannel); labRegionBox->pack_start(*hb); - labRegionBox->pack_start(*Gtk::manage(new Gtk::HSeparator())); + labRegionBox->pack_start(*Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL))); CurveEditorGroup *labRegionEditorG = Gtk::manage(new CurveEditorGroup(options.lastColorToningCurvesDir, M("TP_COLORTONING_LABREGION_MASK"))); labRegionEditorG->setCurveListener(this); diff --git a/rtgui/colortoning.h b/rtgui/colortoning.h index f1024f41c..be3a83c2d 100644 --- a/rtgui/colortoning.h +++ b/rtgui/colortoning.h @@ -79,8 +79,8 @@ private: void labRegionShow(int idx, bool list_only=false); void labRegionGet(int idx); - //Gtk::HSeparator* satLimiterSep; - Gtk::HSeparator* colorSep; + //Gtk::Separator* satLimiterSep; + Gtk::Separator* colorSep; CurveEditorGroup* colorCurveEditorG; CurveEditorGroup* opacityCurveEditorG; CurveEditorGroup* clCurveEditorG; @@ -89,10 +89,10 @@ private: FlatCurveEditor* colorShape; DiagonalCurveEditor* clshape; DiagonalCurveEditor* cl2shape; - Gtk::HBox* ctbox; + Gtk::Box* ctbox; Gtk::Frame *p1Frame; - Gtk::VBox* chanMixerBox; + Gtk::Box* chanMixerBox; MyComboBoxText* method; sigc::connection methodconn; MyComboBoxText* twocolor; @@ -116,7 +116,7 @@ private: Gtk::Image* irg; Gtk::Button* neutral; - Gtk::HBox* neutrHBox; + Gtk::Box* neutrHBox; int nextbw; int nextsatth; int nextsatpr; @@ -147,7 +147,7 @@ private: rtengine::ProcEvent EvLabRegionShowMask; rtengine::ProcEvent EvLabRegionChannel; - Gtk::VBox *labRegionBox; + Gtk::Box* labRegionBox; Gtk::ListViewText *labRegionList; Gtk::Button *labRegionAdd; Gtk::Button *labRegionRemove; diff --git a/rtgui/controlspotpanel.cc b/rtgui/controlspotpanel.cc index 99fa384ce..3fa325e0f 100644 --- a/rtgui/controlspotpanel.cc +++ b/rtgui/controlspotpanel.cc @@ -95,8 +95,8 @@ ControlSpotPanel::ControlSpotPanel(): expMaskMerge_(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_MASFRAME")))), preview_(Gtk::manage(new Gtk::ToggleButton(M("TP_LOCALLAB_PREVIEW")))), - ctboxshape(Gtk::manage(new Gtk::HBox())), - ctboxshapemethod(Gtk::manage(new Gtk::HBox())), + ctboxshape(Gtk::manage(new Gtk::Box())), + ctboxshapemethod(Gtk::manage(new Gtk::Box())), controlPanelListener(nullptr), lastObject_(-1), @@ -111,7 +111,7 @@ ControlSpotPanel::ControlSpotPanel(): const bool showtooltip = options.showtooltip; pack_start(*hishow_); - Gtk::HBox* const ctboxprevmethod = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const ctboxprevmethod = Gtk::manage(new Gtk::Box()); prevMethod_->append(M("TP_LOCALLAB_PREVHIDE")); prevMethod_->append(M("TP_LOCALLAB_PREVSHOW")); prevMethod_->set_active(0); @@ -123,7 +123,9 @@ ControlSpotPanel::ControlSpotPanel(): pack_start(*ctboxprevmethod); - Gtk::HBox* const hbox1_ = Gtk::manage(new Gtk::HBox(true, 4)); + Gtk::Box* const hbox1_ = Gtk::manage(new Gtk::Box()); + hbox1_->set_spacing(4); + hbox1_->set_homogeneous(true); buttonaddconn_ = button_add_->signal_clicked().connect( sigc::mem_fun(*this, &ControlSpotPanel::on_button_add)); buttondeleteconn_ = button_delete_->signal_clicked().connect( @@ -136,7 +138,9 @@ ControlSpotPanel::ControlSpotPanel(): hbox1_->pack_start(*button_duplicate_); pack_start(*hbox1_); - Gtk::HBox* const hbox2_ = Gtk::manage(new Gtk::HBox(true, 4)); + Gtk::Box* const hbox2_ = Gtk::manage(new Gtk::Box()); + hbox2_->set_spacing(4); + hbox2_->set_homogeneous(true); buttonrenameconn_ = button_rename_->signal_clicked().connect( sigc::mem_fun(*this, &ControlSpotPanel::on_button_rename)); buttonvisibilityconn_ = button_visibility_->signal_button_release_event().connect( @@ -194,11 +198,10 @@ ControlSpotPanel::ControlSpotPanel(): scrolledwindow_->set_min_content_height(150); pack_start(*scrolledwindow_); - Gtk::HBox* const ctboxactivmethod = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const ctboxactivmethod = Gtk::manage(new Gtk::Box()); ctboxactivmethod->pack_start(*activ_); pack_start(*ctboxactivmethod); -// Gtk::HBox* const ctboxshape = Gtk::manage(new Gtk::HBox()); Gtk::Label* const labelshape = Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_SHAPETYPE") + ":")); ctboxshape->pack_start(*labelshape, Gtk::PACK_SHRINK, 4); shape_->append(M("TP_LOCALLAB_ELI")); @@ -213,7 +216,7 @@ ControlSpotPanel::ControlSpotPanel(): shape_->set_tooltip_text(M("TP_LOCALLAB_SHAPE_TOOLTIP")); } - Gtk::HBox* const ctboxspotmethod = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const ctboxspotmethod = Gtk::manage(new Gtk::Box()); Gtk::Label* const labelspotmethod = Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_EXCLUTYPE") + ":")); ctboxspotmethod->pack_start(*labelspotmethod, Gtk::PACK_SHRINK, 4); @@ -254,7 +257,6 @@ ControlSpotPanel::ControlSpotPanel(): pack_start(*excluFrame); -// Gtk::HBox* const ctboxshapemethod = Gtk::manage(new Gtk::HBox()); Gtk::Label* const labelshapemethod = Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_STYPE") + ":")); ctboxshapemethod->pack_start(*labelshapemethod, Gtk::PACK_SHRINK, 4); @@ -298,7 +300,7 @@ ControlSpotPanel::ControlSpotPanel(): circrad_->set_tooltip_text(M("TP_LOCALLAB_CIRCRAD_TOOLTIP")); } - Gtk::HBox* const ctboxqualitymethod = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const ctboxqualitymethod = Gtk::manage(new Gtk::Box()); Gtk::Label* const labelqualitymethod = Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_QUAL_METHOD") + ":")); ctboxqualitymethod->pack_start(*labelqualitymethod, Gtk::PACK_SHRINK, 4); @@ -413,7 +415,7 @@ ControlSpotPanel::ControlSpotPanel(): specCaseBox->pack_start(*recurs_); specCaseBox->pack_start(*ctboxshapemethod); - Gtk::HBox* const ctboxwavmethod = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const ctboxwavmethod = Gtk::manage(new Gtk::Box()); Gtk::Label* const labelwavmethod = Gtk::manage(new Gtk::Label(M("TP_WAVELET_DAUBLOCAL") + ":")); ctboxwavmethod->pack_start(*labelwavmethod, Gtk::PACK_SHRINK, 4); @@ -472,10 +474,10 @@ ControlSpotPanel::ControlSpotPanel(): expMaskMerge_->add(*maskBox, false); pack_start(*expMaskMerge_, false, false); - Gtk::HSeparator *separatormet = Gtk::manage(new Gtk::HSeparator()); + Gtk::Separator *separatormet = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); pack_start(*separatormet, Gtk::PACK_SHRINK, 2); - Gtk::HBox* const ctboxcomplexmethod = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const ctboxcomplexmethod = Gtk::manage(new Gtk::Box()); if (showtooltip) { ctboxcomplexmethod->set_tooltip_markup(M("TP_LOCALLAB_COMPLEXMETHOD_TOOLTIP")); @@ -498,7 +500,7 @@ ControlSpotPanel::ControlSpotPanel(): ctboxcomplexmethod->pack_start(*complexMethod_); // pack_start(*ctboxcomplexmethod); /* - Gtk::HBox* const ctboxwavmethod = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const ctboxwavmethod = Gtk::manage(new Gtk::Box()); Gtk::Label* const labelwavmethod = Gtk::manage(new Gtk::Label(M("TP_WAVELET_DAUBLOCAL") + ":")); ctboxwavmethod->pack_start(*labelwavmethod, Gtk::PACK_SHRINK, 4); @@ -2782,7 +2784,7 @@ ControlSpotPanel::RenameDialog::RenameDialog(const Glib::ustring &actualname, Gt newname_(Gtk::manage(new Gtk::Entry())) { // Entry widget - Gtk::HBox* const hb = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const hb = Gtk::manage(new Gtk::Box()); hb->pack_start(*Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_REN_DIALOG_LAB"))), false, false, 4); newname_->set_text(actualname); hb->pack_start(*newname_); diff --git a/rtgui/controlspotpanel.h b/rtgui/controlspotpanel.h index f8ef41dc0..5cbf19e69 100644 --- a/rtgui/controlspotpanel.h +++ b/rtgui/controlspotpanel.h @@ -424,8 +424,8 @@ private: Gtk::ToggleButton* const preview_; sigc::connection previewConn_; - Gtk::HBox* const ctboxshape; - Gtk::HBox* const ctboxshapemethod; + Gtk::Box* const ctboxshape; + Gtk::Box* const ctboxshapemethod; // Internal variables ControlPanelListener* controlPanelListener; diff --git a/rtgui/crop.cc b/rtgui/crop.cc index 961f1908b..ea8906535 100644 --- a/rtgui/crop.cc +++ b/rtgui/crop.cc @@ -192,7 +192,7 @@ Crop::Crop(): methodgrid->attach (*resetCrop, 2, 2, 2, 1); pack_start (*methodgrid, Gtk::PACK_EXPAND_WIDGET, 0 ); - Gtk::HSeparator* methodseparator = Gtk::manage (new Gtk::HSeparator()); + Gtk::Separator* methodseparator = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); methodseparator->get_style_context()->add_class("grid-row-separator"); pack_start (*methodseparator, Gtk::PACK_SHRINK, 0); @@ -242,7 +242,7 @@ Crop::Crop(): ppigrid->set_column_homogeneous (true); setExpandAlignProperties(ppigrid, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); - Gtk::HSeparator* ppiseparator = Gtk::manage (new Gtk::HSeparator()); + Gtk::Separator* ppiseparator = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); ppiseparator->get_style_context()->add_class("grid-row-separator"); Gtk::Grid* ppisubgrid = Gtk::manage(new Gtk::Grid()); diff --git a/rtgui/darkframe.cc b/rtgui/darkframe.cc index 74ef1384a..b6b1201a7 100644 --- a/rtgui/darkframe.cc +++ b/rtgui/darkframe.cc @@ -32,7 +32,7 @@ using namespace rtengine::procparams; DarkFrame::DarkFrame () : FoldableToolPanel(this, "darkframe", M("TP_DARKFRAME_LABEL")), dfChanged(false), lastDFauto(false), dfp(nullptr), israw(true) { - hbdf = Gtk::manage(new Gtk::HBox()); + hbdf = Gtk::manage(new Gtk::Box()); hbdf->set_spacing(4); darkFrameFile = Gtk::manage(new MyFileChooserButton(M("TP_DARKFRAME_LABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN)); bindCurrentFolder (*darkFrameFile, options.lastDarkframeDir); diff --git a/rtgui/darkframe.h b/rtgui/darkframe.h index 30696e3db..58e8b4842 100644 --- a/rtgui/darkframe.h +++ b/rtgui/darkframe.h @@ -49,7 +49,7 @@ class DarkFrame final: protected: MyFileChooserButton *darkFrameFile; - Gtk::HBox *hbdf; + Gtk::Box *hbdf; Gtk::Button *btnReset; Gtk::Label *dfLabel; Gtk::Label *dfInfo; diff --git a/rtgui/dirbrowser.cc b/rtgui/dirbrowser.cc index 10ef61566..2be1e3f3a 100644 --- a/rtgui/dirbrowser.cc +++ b/rtgui/dirbrowser.cc @@ -91,7 +91,7 @@ DirBrowser::DirBrowser () : dirTreeModel(), , volumes(0) #endif { - + set_orientation(Gtk::ORIENTATION_VERTICAL); dirtree = Gtk::manage ( new Gtk::TreeView() ); scrolledwindow4 = Gtk::manage ( new Gtk::ScrolledWindow() ); crt.property_ellipsize() = Pango::ELLIPSIZE_END; diff --git a/rtgui/dirbrowser.h b/rtgui/dirbrowser.h index 6ead83919..0254d6eb5 100644 --- a/rtgui/dirbrowser.h +++ b/rtgui/dirbrowser.h @@ -23,7 +23,7 @@ #include "guiutils.h" -class DirBrowser : public Gtk::VBox +class DirBrowser : public Gtk::Box { public: typedef sigc::signal DirSelectionSignal; diff --git a/rtgui/dirpyrdenoise.cc b/rtgui/dirpyrdenoise.cc index 168993271..3bf7c21f4 100644 --- a/rtgui/dirpyrdenoise.cc +++ b/rtgui/dirpyrdenoise.cc @@ -48,10 +48,10 @@ DirPyrDenoise::DirPyrDenoise () : FoldableToolPanel(this, "dirpyrdenoise", M("TP Gtk::Frame* lumaFrame = Gtk::manage (new Gtk::Frame (M("TP_DIRPYRDENOISE_LUMINANCE_FRAME")) ); lumaFrame->set_label_align(0.025, 0.5); - Gtk::VBox * lumaVBox = Gtk::manage ( new Gtk::VBox()); + Gtk::Box* lumaVBox = Gtk::manage ( new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); lumaVBox->set_spacing(2); - ctboxL = Gtk::manage (new Gtk::HBox ()); + ctboxL = Gtk::manage (new Gtk::Box ()); Gtk::Label* labmL = Gtk::manage (new Gtk::Label (M("TP_DIRPYRDENOISE_LUMINANCE_CONTROL") + ":")); ctboxL->pack_start (*labmL, Gtk::PACK_SHRINK, 1); @@ -83,10 +83,10 @@ DirPyrDenoise::DirPyrDenoise () : FoldableToolPanel(this, "dirpyrdenoise", M("TP Gtk::Frame* chromaFrame = Gtk::manage (new Gtk::Frame (M("TP_DIRPYRDENOISE_CHROMINANCE_FRAME")) ); chromaFrame->set_label_align(0.025, 0.5); - Gtk::VBox *chromaVBox = Gtk::manage ( new Gtk::VBox()); + Gtk::Box* chromaVBox = Gtk::manage ( new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); chromaVBox->set_spacing(2); - ctboxC = Gtk::manage (new Gtk::HBox ()); + ctboxC = Gtk::manage (new Gtk::Box ()); Gtk::Label* labmC = Gtk::manage (new Gtk::Label (M("TP_DIRPYRDENOISE_CHROMINANCE_METHOD") + ":")); ctboxC->pack_start (*labmC, Gtk::PACK_SHRINK, 1); @@ -99,7 +99,7 @@ DirPyrDenoise::DirPyrDenoise () : FoldableToolPanel(this, "dirpyrdenoise", M("TP Cmethodconn = Cmethod->signal_changed().connect ( sigc::mem_fun(*this, &DirPyrDenoise::CmethodChanged) ); Cmethod->set_tooltip_markup (M("TP_DIRPYRDENOISE_CHROMINANCE_METHOD_TOOLTIP")); - ctboxC2 = Gtk::manage (new Gtk::HBox ()); + ctboxC2 = Gtk::manage (new Gtk::Box ()); Gtk::Label* labmC2 = Gtk::manage (new Gtk::Label (M("TP_DIRPYRDENOISE_CHROMINANCE_METHOD") + ":")); ctboxC2->pack_start (*labmC2, Gtk::PACK_SHRINK, 1); ctboxC2->set_tooltip_markup (M("TP_DIRPYRDENOISE_CHROMINANCE_METHODADVANCED_TOOLTIP")); @@ -121,7 +121,7 @@ DirPyrDenoise::DirPyrDenoise () : FoldableToolPanel(this, "dirpyrdenoise", M("TP redchro = Gtk::manage (new Adjuster (M("TP_DIRPYRDENOISE_CHROMINANCE_REDGREEN"), -100, 100, 0.1, 0)); bluechro = Gtk::manage (new Adjuster (M("TP_DIRPYRDENOISE_CHROMINANCE_BLUEYELLOW"), -100, 100, 0.1, 0)); - Gtk::HBox* hb1 = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* hb1 = Gtk::manage (new Gtk::Box ()); hb1->pack_start (*Gtk::manage (new Gtk::Label ( M("TP_DIRPYRDENOISE_MAIN_COLORSPACE") + ": ")), Gtk::PACK_SHRINK, 1); hb1->set_tooltip_markup (M("TP_DIRPYRDENOISE_MAIN_COLORSPACE_TOOLTIP")); @@ -166,7 +166,7 @@ DirPyrDenoise::DirPyrDenoise () : FoldableToolPanel(this, "dirpyrdenoise", M("TP Gtk::Frame* medianFrame = Gtk::manage (new Gtk::Frame ()); - Gtk::VBox *medianVBox = Gtk::manage ( new Gtk::VBox()); + Gtk::Box* medianVBox = Gtk::manage ( new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); medianVBox->set_spacing(2); median = Gtk::manage (new Gtk::CheckButton (M("TP_DIRPYRDENOISE_MEDIAN_METHOD_LABEL") + ":")); @@ -203,19 +203,19 @@ DirPyrDenoise::DirPyrDenoise () : FoldableToolPanel(this, "dirpyrdenoise", M("TP medmethod->set_tooltip_text (M("TP_DIRPYRDENOISE_MEDIAN_TYPE_TOOLTIP")); medmethodconn = medmethod->signal_changed().connect ( sigc::mem_fun(*this, &DirPyrDenoise::medmethodChanged) ); - ctboxm = Gtk::manage (new Gtk::HBox ()); + ctboxm = Gtk::manage (new Gtk::Box ()); Gtk::Label* labmm = Gtk::manage (new Gtk::Label (M("TP_DIRPYRDENOISE_MEDIAN_METHOD") + ":")); ctboxm->pack_start (*labmm, Gtk::PACK_SHRINK, 1); - ctbox = Gtk::manage (new Gtk::HBox ()); + ctbox = Gtk::manage (new Gtk::Box ()); Gtk::Label* labm = Gtk::manage (new Gtk::Label (M("TP_DIRPYRDENOISE_MEDIAN_TYPE") + ":")); ctbox->pack_start (*labm, Gtk::PACK_SHRINK, 1); - ctboxrgb = Gtk::manage (new Gtk::HBox ()); + ctboxrgb = Gtk::manage (new Gtk::Box ()); Gtk::Label* labrgb = Gtk::manage (new Gtk::Label (M("TP_DIRPYRDENOISE_MEDIAN_TYPE") + ":")); ctboxrgb->pack_start (*labrgb, Gtk::PACK_SHRINK, 1); - Gtk::HBox* hb11 = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* hb11 = Gtk::manage (new Gtk::Box ()); hb11->pack_start (*Gtk::manage (new Gtk::Label ( M("TP_DIRPYRDENOISE_MAIN_MODE") + ": ")), Gtk::PACK_SHRINK, 1); hb11->set_tooltip_markup (M("TP_DIRPYRDENOISE_MAIN_MODE_TOOLTIP")); diff --git a/rtgui/dirpyrdenoise.h b/rtgui/dirpyrdenoise.h index c754e705c..71c9b1894 100644 --- a/rtgui/dirpyrdenoise.h +++ b/rtgui/dirpyrdenoise.h @@ -115,21 +115,21 @@ private: sigc::connection smethodconn; MyComboBoxText* medmethod; sigc::connection medmethodconn; - Gtk::HBox* ctbox; + Gtk::Box* ctbox; MyComboBoxText* methodmed; sigc::connection methodmedconn; - Gtk::HBox* ctboxm; + Gtk::Box* ctboxm; MyComboBoxText* rgbmethod; sigc::connection rgbmethodconn; - Gtk::HBox* ctboxrgb; + Gtk::Box* ctboxrgb; double nextchroma; double nextred; double nextblue; double nextnresid; double nexthighresid; - Gtk::HBox* ctboxL; - Gtk::HBox* ctboxC; - Gtk::HBox* ctboxC2; + Gtk::Box* ctboxL; + Gtk::Box* ctboxC; + Gtk::Box* ctboxC2; int nexttileX; int nexttileY; int nextprevX; diff --git a/rtgui/dirpyrequalizer.cc b/rtgui/dirpyrequalizer.cc index 34aecf095..9393d7c42 100644 --- a/rtgui/dirpyrequalizer.cc +++ b/rtgui/dirpyrequalizer.cc @@ -53,11 +53,11 @@ DirPyrEqualizer::DirPyrEqualizer () : FoldableToolPanel(this, "dirpyrequalizer", Color::hsv2rgb01(0.3240, 0.5, 0.5, r, g, b); milestones.push_back( GradientMilestone(1. , r, g, b) ); // hsv: 0.324 rad: 2.5 - Gtk::VBox * cbVBox = Gtk::manage ( new Gtk::VBox()); + Gtk::Box* cbVBox = Gtk::manage ( new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); cbVBox->set_border_width(4); cbVBox->set_spacing(2); - cdbox = Gtk::manage (new Gtk::HBox ()); + cdbox = Gtk::manage (new Gtk::Box ()); labmcd = Gtk::manage (new Gtk::Label (M("TP_CBDL_METHOD") + ":")); cdbox->pack_start (*labmcd, Gtk::PACK_SHRINK, 1); @@ -71,7 +71,9 @@ DirPyrEqualizer::DirPyrEqualizer () : FoldableToolPanel(this, "dirpyrequalizer", cbVBox->pack_start(*cdbox); pack_start(*cbVBox); - Gtk::HBox * buttonBox1 = Gtk::manage (new Gtk::HBox(true, 10)); + Gtk::Box * buttonBox1 = Gtk::manage (new Gtk::Box()); + buttonBox1->set_spacing(10); + buttonBox1->set_homogeneous(true); pack_start(*buttonBox1); Gtk::Button * lumacontrastMinusButton = Gtk::manage (new Gtk::Button(M("TP_DIRPYREQUALIZER_LUMACONTRAST_MINUS"))); @@ -88,7 +90,7 @@ DirPyrEqualizer::DirPyrEqualizer () : FoldableToolPanel(this, "dirpyrequalizer", buttonBox1->show_all_children(); - Gtk::HSeparator *separator2 = Gtk::manage (new Gtk::HSeparator()); + Gtk::Separator *separator2 = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); pack_start(*separator2, Gtk::PACK_SHRINK, 2); for(int i = 0; i < 6; i++) { @@ -106,17 +108,17 @@ DirPyrEqualizer::DirPyrEqualizer () : FoldableToolPanel(this, "dirpyrequalizer", pack_start(*multiplier[i]); } - Gtk::HSeparator *separator3 = Gtk::manage (new Gtk::HSeparator()); + Gtk::Separator *separator3 = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); pack_start(*separator3, Gtk::PACK_SHRINK, 2); threshold = Gtk::manage ( new Adjuster (M("TP_DIRPYREQUALIZER_THRESHOLD"), 0, 1, 0.01, 0.2) ); threshold->setAdjusterListener(this); pack_start(*threshold); - Gtk::HSeparator *separator4 = Gtk::manage (new Gtk::HSeparator()); + Gtk::Separator *separator4 = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); pack_start(*separator4, Gtk::PACK_SHRINK, 2); /* - algoHBox = Gtk::manage (new Gtk::HBox ()); + algoHBox = Gtk::manage (new Gtk::Box ()); algoHBox->set_spacing (2); algoHBox->set_tooltip_markup (M("TP_DIRPYREQUALIZER_ALGO_TOOLTIP")); */ diff --git a/rtgui/dirpyrequalizer.h b/rtgui/dirpyrequalizer.h index 84924099e..bb03e1a53 100644 --- a/rtgui/dirpyrequalizer.h +++ b/rtgui/dirpyrequalizer.h @@ -42,7 +42,7 @@ protected: // MyComboBoxText* algo; // sigc::connection algoconn; // Gtk::Label* alLabel; - // Gtk::HBox* algoHBox; + // Gtk::Box* algoHBox; sigc::connection gamutlabConn; sigc::connection lumaneutralPressedConn; @@ -50,7 +50,7 @@ protected: sigc::connection lumacontrastMinusPressedConn; sigc::connection cbdlMethodConn; Gtk::Label* labmcd; - Gtk::HBox* cdbox; + Gtk::Box* cdbox; MyComboBoxText* cbdlMethod; bool lastgamutlab; diff --git a/rtgui/dynamicprofilepanel.cc b/rtgui/dynamicprofilepanel.cc index d7ed8ee97..865603b3a 100644 --- a/rtgui/dynamicprofilepanel.cc +++ b/rtgui/dynamicprofilepanel.cc @@ -35,7 +35,7 @@ DynamicProfilePanel::EditDialog::EditDialog (const Glib::ustring &title, Gtk::Wi Gtk::Dialog (title, parent) { profilepath_ = Gtk::manage (new ProfileStoreComboBox()); - Gtk::HBox *hb = Gtk::manage (new Gtk::HBox()); + Gtk::Box *hb = Gtk::manage (new Gtk::Box()); hb->pack_start (*Gtk::manage (new Gtk::Label (M ("DYNPROFILEEDITOR_PROFILE"))), false, false, 4); hb->pack_start (*profilepath_, true, true, 2); get_content_area()->pack_start (*hb, Gtk::PACK_SHRINK, 4); @@ -49,7 +49,7 @@ DynamicProfilePanel::EditDialog::EditDialog (const Glib::ustring &title, Gtk::Wi imagetype_->append(M("DYNPROFILEEDITOR_IMGTYPE_HDR")); imagetype_->append(M("DYNPROFILEEDITOR_IMGTYPE_PS")); imagetype_->set_active(0); - hb = Gtk::manage (new Gtk::HBox()); + hb = Gtk::manage (new Gtk::Box()); hb->pack_start (*Gtk::manage (new Gtk::Label (M ("EXIFFILTER_IMAGETYPE"))), false, false, 4); hb->pack_start (*imagetype_, true, true, 2); get_content_area()->pack_start (*hb, Gtk::PACK_SHRINK, 4); @@ -195,7 +195,7 @@ void DynamicProfilePanel::EditDialog::set_ranges() void DynamicProfilePanel::EditDialog::add_range (const Glib::ustring &name, Gtk::SpinButton *&from, Gtk::SpinButton *&to) { - Gtk::HBox *hb = Gtk::manage (new Gtk::HBox()); + Gtk::Box *hb = Gtk::manage (new Gtk::Box()); hb->pack_start (*Gtk::manage (new Gtk::Label (name)), false, false, 4); from = Gtk::manage (new Gtk::SpinButton()); to = Gtk::manage (new Gtk::SpinButton()); @@ -210,7 +210,7 @@ void DynamicProfilePanel::EditDialog::add_range (const Glib::ustring &name, void DynamicProfilePanel::EditDialog::add_optional (const Glib::ustring &name, Gtk::CheckButton *&check, Gtk::Entry *&field) { check = Gtk::manage (new Gtk::CheckButton (name)); - Gtk::HBox *hb = Gtk::manage (new Gtk::HBox()); + Gtk::Box *hb = Gtk::manage (new Gtk::Box()); hb->pack_start (*check, Gtk::PACK_SHRINK, 4); field = Gtk::manage (new Gtk::Entry()); hb->pack_start (*field, true, true, 2); @@ -231,10 +231,13 @@ DynamicProfilePanel::DynamicProfilePanel(): button_edit_ (M ("DYNPROFILEEDITOR_EDIT")), button_delete_ (M ("DYNPROFILEEDITOR_DELETE")) { + set_orientation(Gtk::ORIENTATION_VERTICAL); + add (vbox_); treeview_.set_grid_lines (Gtk::TREE_VIEW_GRID_LINES_VERTICAL); scrolledwindow_.add (treeview_); + scrolledwindow_.set_vexpand(); scrolledwindow_.set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); diff --git a/rtgui/dynamicprofilepanel.h b/rtgui/dynamicprofilepanel.h index 5796c9c85..972ca1c4a 100644 --- a/rtgui/dynamicprofilepanel.h +++ b/rtgui/dynamicprofilepanel.h @@ -25,7 +25,7 @@ #include "../rtengine/dynamicprofile.h" class DynamicProfilePanel : - public Gtk::VBox + public Gtk::Box { public: DynamicProfilePanel(); diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index beda3bba4..909b491f6 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -477,6 +477,7 @@ EditorPanel::EditorPanel (FilePanel* filePanel) histogram_observable(nullptr), histogram_scope_type(ScopeType::NONE) { + set_orientation(Gtk::ORIENTATION_VERTICAL); epih = new EditorPanelIdleHelper; epih->epanel = this; epih->destroyed = false; @@ -540,10 +541,10 @@ EditorPanel::EditorPanel (FilePanel* filePanel) iBeforeLockON = new RTImage ("padlock-locked-small.png"); iBeforeLockOFF = new RTImage ("padlock-unlocked-small.png"); - Gtk::VSeparator* vsept = Gtk::manage (new Gtk::VSeparator ()); - Gtk::VSeparator* vsepz = Gtk::manage (new Gtk::VSeparator ()); - Gtk::VSeparator* vsepi = Gtk::manage (new Gtk::VSeparator ()); - Gtk::VSeparator* vseph = Gtk::manage (new Gtk::VSeparator ()); + Gtk::Separator* vsept = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)); + Gtk::Separator* vsepz = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)); + Gtk::Separator* vsepi = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)); + Gtk::Separator* vseph = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)); hidehp = Gtk::manage (new Gtk::ToggleButton ()); @@ -572,13 +573,13 @@ EditorPanel::EditorPanel (FilePanel* filePanel) tbTopPanel_1->set_image (*iTopPanel_1_Hide); } - Gtk::VSeparator* vsepcl = Gtk::manage (new Gtk::VSeparator ()); - Gtk::VSeparator* vsepz2 = Gtk::manage (new Gtk::VSeparator ()); - Gtk::VSeparator* vsepz3 = Gtk::manage (new Gtk::VSeparator ()); - Gtk::VSeparator* vsepz4 = Gtk::manage (new Gtk::VSeparator ()); + Gtk::Separator* vsepcl = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)); + Gtk::Separator* vsepz2 = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)); + Gtk::Separator* vsepz3 = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)); + Gtk::Separator* vsepz4 = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)); - Gtk::VSeparator* vsep1 = Gtk::manage (new Gtk::VSeparator ()); - Gtk::VSeparator* vsep2 = Gtk::manage (new Gtk::VSeparator ()); + Gtk::Separator* vsep1 = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)); + Gtk::Separator* vsep2 = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)); // Histogram profile toggle controls toggleHistogramProfile = Gtk::manage (new Gtk::ToggleButton ()); @@ -588,7 +589,7 @@ EditorPanel::EditorPanel (FilePanel* filePanel) toggleHistogramProfile->set_active (options.rtSettings.HistogramWorking); toggleHistogramProfile->set_tooltip_markup ( (M ("PREFERENCES_HISTOGRAM_TOOLTIP"))); - Gtk::VSeparator* vsep3 = Gtk::manage (new Gtk::VSeparator ()); + Gtk::Separator* vsep3 = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)); iareapanel = new ImageAreaPanel (); tpc->setEditProvider (iareapanel->imageArea); @@ -605,7 +606,7 @@ EditorPanel::EditorPanel (FilePanel* filePanel) toolBarPanel->pack_start (*vsept, Gtk::PACK_SHRINK, 2); if (tbTopPanel_1) { - Gtk::VSeparator* vsep = Gtk::manage (new Gtk::VSeparator ()); + Gtk::Separator* vsep = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)); toolBarPanel->pack_end (*tbTopPanel_1, Gtk::PACK_SHRINK, 1); toolBarPanel->pack_end (*vsep, Gtk::PACK_SHRINK, 2); } @@ -754,7 +755,7 @@ EditorPanel::EditorPanel (FilePanel* filePanel) colorMgmtToolBar->pack_right_in (iops); if (!simpleEditor && !options.tabbedUI) { - Gtk::VSeparator* vsep3 = Gtk::manage (new Gtk::VSeparator ()); + Gtk::Separator* vsep3 = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)); iops->attach_next_to (*vsep3, Gtk::POS_RIGHT, 1, 1); iops->attach_next_to (*navPrev, Gtk::POS_RIGHT, 1, 1); iops->attach_next_to (*navSync, Gtk::POS_RIGHT, 1, 1); @@ -996,7 +997,7 @@ void EditorPanel::setAspect () void EditorPanel::on_realize () { realized = true; - Gtk::VBox::on_realize (); + Gtk::Box::on_realize (); // This line is needed to avoid autoexpansion of the window :-/ //vboxright->set_size_request (options.toolPanelWidth, -1); tpc->updateToolState(); @@ -2190,7 +2191,7 @@ void EditorPanel::beforeAfterToggled () history->blistenerLock ? tbBeforeLock->set_image (*iBeforeLockON) : tbBeforeLock->set_image (*iBeforeLockOFF); tbBeforeLock->set_active (history->blistenerLock); - beforeBox = Gtk::manage (new Gtk::VBox ()); + beforeBox = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); beforeBox->pack_start (*beforeHeaderBox, Gtk::PACK_SHRINK, 2); beforeBox->pack_start (*beforeIarea); diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index a277ffd3a..e89689f0f 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -55,7 +55,7 @@ struct EditorPanelIdleHelper { class RTWindow; class EditorPanel final : - public Gtk::VBox, + public Gtk::Box, public PParamsChangeListener, public rtengine::ProgressListener, public ThumbnailListener, diff --git a/rtgui/editwindow.cc b/rtgui/editwindow.cc index 8841d3d42..3ae3e47fa 100644 --- a/rtgui/editwindow.cc +++ b/rtgui/editwindow.cc @@ -71,7 +71,7 @@ EditWindow::EditWindow (RTWindow* p) : resolution(RTScalable::baseDPI), parent(p signal_key_press_event().connect(sigc::mem_fun(*this, &EditWindow::keyPressed)); - Gtk::VBox* mainBox = Gtk::manage(new Gtk::VBox()); + Gtk::Box* mainBox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); mainBox->pack_start(*mainNB); add(*mainBox); @@ -215,7 +215,7 @@ void EditWindow::addEditorPanel (EditorPanel* ep, const std::string &name) ep->setParentWindow(this); // construct closeable tab for the image - Gtk::HBox* hb = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* hb = Gtk::manage (new Gtk::Box ()); hb->pack_start (*Gtk::manage (new RTImage ("aperture.png"))); hb->pack_start (*Gtk::manage (new Gtk::Label (Glib::path_get_basename (name)))); hb->set_tooltip_markup (name); diff --git a/rtgui/exifpanel.cc b/rtgui/exifpanel.cc index 3f6bbacb5..6fc79d004 100644 --- a/rtgui/exifpanel.cc +++ b/rtgui/exifpanel.cc @@ -33,6 +33,7 @@ ExifPanel::ExifPanel() : changeList(new rtengine::procparams::ExifPairs), defChangeList(new rtengine::procparams::ExifPairs) { + set_orientation(Gtk::ORIENTATION_VERTICAL); recursiveOp = true; exifTree = Gtk::manage (new Gtk::TreeView()); @@ -475,11 +476,11 @@ void ExifPanel::addPressed () { Gtk::Dialog* dialog = new Gtk::Dialog (M ("EXIFPANEL_ADDTAGDLG_TITLE"), * ((Gtk::Window*)get_toplevel()), true); - dialog->add_button (Gtk::Stock::OK, Gtk::RESPONSE_OK); - dialog->add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); + dialog->add_button ("_OK", Gtk::RESPONSE_OK); + dialog->add_button ("_Cancel", Gtk::RESPONSE_CANCEL); - Gtk::HBox* hb1 = new Gtk::HBox (); - Gtk::HBox* hb2 = new Gtk::HBox (); + Gtk::Box* hb1 = new Gtk::Box (); + Gtk::Box* hb2 = new Gtk::Box (); Gtk::Label* tlabel = new Gtk::Label (M ("EXIFPANEL_ADDTAGDLG_SELECTTAG") + ":"); MyComboBoxText* tcombo = new MyComboBoxText (); diff --git a/rtgui/exifpanel.h b/rtgui/exifpanel.h index d336d83f9..4c28af289 100644 --- a/rtgui/exifpanel.h +++ b/rtgui/exifpanel.h @@ -26,7 +26,7 @@ #include "../rtexif/rtexif.h" class ExifPanel final : - public Gtk::VBox, + public Gtk::Box, public ToolPanel { diff --git a/rtgui/exportpanel.cc b/rtgui/exportpanel.cc index b18cee496..a4ce63c1d 100644 --- a/rtgui/exportpanel.cc +++ b/rtgui/exportpanel.cc @@ -30,9 +30,10 @@ using namespace rtengine::procparams; ExportPanel::ExportPanel () : listener (nullptr) { + set_orientation(Gtk::ORIENTATION_VERTICAL); /*enabled = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_ENABLE")) ); pack_start(*enabled, Gtk::PACK_SHRINK, 4); - pack_start (*Gtk::manage(new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 2);*/ + pack_start (*Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)), Gtk::PACK_SHRINK, 2);*/ Gtk::Label* labExportTitle = Gtk::manage ( new Gtk::Label (M ("EXPORT_FASTEXPORTOPTIONS")) ); labExportTitle->set_use_markup (true); @@ -43,7 +44,7 @@ ExportPanel::ExportPanel () : listener (nullptr) Gtk::RadioButton::Group pipeline_group; use_fast_pipeline = Gtk::manage ( new Gtk::RadioButton (pipeline_group, M ("EXPORT_USE_FAST_PIPELINE"))); use_normal_pipeline = Gtk::manage ( new Gtk::RadioButton (pipeline_group, M ("EXPORT_USE_NORMAL_PIPELINE"))); - bypass_box = Gtk::manage (new Gtk::VBox()); + bypass_box = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); bypass_ALL = Gtk::manage ( new Gtk::CheckButton (M ("EXPORT_BYPASS_ALL"))); use_fast_pipeline->set_tooltip_text (M ("EXPORT_USE_FAST_PIPELINE_TIP")); bypass_sharpening = Gtk::manage ( new Gtk::CheckButton (M ("EXPORT_BYPASS_SHARPENING"))); @@ -64,9 +65,9 @@ ExportPanel::ExportPanel () : listener (nullptr) Gtk::Frame *bayerFrame = Gtk::manage ( new Gtk::Frame (M ("TP_RAW_SENSOR_BAYER_LABEL"))); bayerFrame->set_label_align(0.025, 0.5); - Gtk::VBox* bayerFrameVBox = Gtk::manage (new Gtk::VBox ()); + Gtk::Box* bayerFrameVBox = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); - Gtk::HBox* hb_raw_bayer_method = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* hb_raw_bayer_method = Gtk::manage (new Gtk::Box ()); hb_raw_bayer_method->pack_start (*Gtk::manage (new Gtk::Label ( M ("EXPORT_RAW_DMETHOD") + ": ")), Gtk::PACK_SHRINK, 4); raw_bayer_method = Gtk::manage (new MyComboBoxText ()); @@ -88,9 +89,9 @@ ExportPanel::ExportPanel () : listener (nullptr) Gtk::Frame *xtransFrame = Gtk::manage ( new Gtk::Frame (M ("TP_RAW_SENSOR_XTRANS_LABEL"))); xtransFrame->set_label_align(0.025, 0.5); - Gtk::VBox* xtransFrameVBox = Gtk::manage (new Gtk::VBox ()); + Gtk::Box* xtransFrameVBox = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); - Gtk::HBox* hb_raw_xtrans_method = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* hb_raw_xtrans_method = Gtk::manage (new Gtk::Box ()); hb_raw_xtrans_method->pack_start (*Gtk::manage (new Gtk::Label ( M ("EXPORT_RAW_DMETHOD") + ": ")), Gtk::PACK_SHRINK, 4); raw_xtrans_method = Gtk::manage (new MyComboBoxText ()); @@ -104,18 +105,18 @@ ExportPanel::ExportPanel () : listener (nullptr) // ---------------------------------------------------------------- // start global packing - Gtk::HBox* lblbox = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* lblbox = Gtk::manage (new Gtk::Box ()); lblbox->pack_start (*Gtk::manage (new Gtk::Label (M ("EXPORT_PIPELINE"))), Gtk::PACK_SHRINK, 4); pack_start (*lblbox, Gtk::PACK_SHRINK, 4); pack_start (*use_fast_pipeline, Gtk::PACK_SHRINK, 4); pack_start (*use_normal_pipeline, Gtk::PACK_SHRINK, 4); - bypass_box->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 4); - lblbox = Gtk::manage (new Gtk::HBox ()); + bypass_box->pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)), Gtk::PACK_SHRINK, 4); + lblbox = Gtk::manage (new Gtk::Box ()); lblbox->pack_start (*Gtk::manage (new Gtk::Label (M ("EXPORT_BYPASS"))), Gtk::PACK_SHRINK, 4); bypass_box->pack_start (*lblbox, Gtk::PACK_SHRINK, 4); bypass_box->pack_start (*bypass_ALL, Gtk::PACK_SHRINK, 4); - // bypass_box->pack_start(*Gtk::manage(new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 4); + // bypass_box->pack_start(*Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)), Gtk::PACK_SHRINK, 4); bypass_box->pack_start (*bypass_sharpening, Gtk::PACK_SHRINK, 4); bypass_box->pack_start (*bypass_sharpenEdge, Gtk::PACK_SHRINK, 4); bypass_box->pack_start (*bypass_sharpenMicro, Gtk::PACK_SHRINK, 4); @@ -148,16 +149,16 @@ ExportPanel::ExportPanel () : listener (nullptr) pack_start (*bypass_box, Gtk::PACK_SHRINK); - pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 2); + pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)), Gtk::PACK_SHRINK, 2); // Resize options - Gtk::HBox* rmbox = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* rmbox = Gtk::manage (new Gtk::Box ()); rmbox->pack_start (*Gtk::manage (new Gtk::Label (M ("TP_RESIZE_LABEL"))), Gtk::PACK_SHRINK, 4); pack_start (*rmbox, Gtk::PACK_SHRINK, 4); - Gtk::HBox* wbox = Gtk::manage (new Gtk::HBox ()); - Gtk::HBox* hbox = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* wbox = Gtk::manage (new Gtk::Box ()); + Gtk::Box* hbox = Gtk::manage (new Gtk::Box ()); MaxWidth = Gtk::manage (new MySpinButton ()); MaxHeight = Gtk::manage (new MySpinButton ()); wbox->pack_start (*Gtk::manage (new Gtk::Label (M ("EXPORT_MAXWIDTH"))), Gtk::PACK_SHRINK, 4); @@ -189,8 +190,8 @@ ExportPanel::ExportPanel () : listener (nullptr) // add panel ending - Gtk::VBox* vboxpe = Gtk::manage (new Gtk::VBox ()); - Gtk::HSeparator* hseptpe = Gtk::manage (new Gtk::HSeparator ()); + Gtk::Box* vboxpe = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); + Gtk::Separator* hseptpe = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); Gtk::Image* peImg = Gtk::manage (new RTImage ("ornament1.png")); vboxpe->pack_start (*hseptpe, Gtk::PACK_SHRINK, 4); vboxpe->pack_start (*peImg); diff --git a/rtgui/exportpanel.h b/rtgui/exportpanel.h index 7ae7e043c..18c4bda49 100644 --- a/rtgui/exportpanel.h +++ b/rtgui/exportpanel.h @@ -31,12 +31,12 @@ public: virtual void exportRequested() = 0; }; -class ExportPanel : public Gtk::VBox +class ExportPanel : public Gtk::Box { protected: - Gtk::VBox *bypass_box; + Gtk::Box* bypass_box; //Gtk::CheckButton* enabled; Gtk::RadioButton* use_fast_pipeline; Gtk::RadioButton* use_normal_pipeline; diff --git a/rtgui/favoritbrowser.cc b/rtgui/favoritbrowser.cc index 06a9cf3be..0481847cb 100644 --- a/rtgui/favoritbrowser.cc +++ b/rtgui/favoritbrowser.cc @@ -22,6 +22,7 @@ FavoritBrowser::FavoritBrowser () : listener (NULL) { + set_orientation(Gtk::ORIENTATION_VERTICAL); scrollw = Gtk::manage (new Gtk::ScrolledWindow ()); scrollw->set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); @@ -66,7 +67,7 @@ FavoritBrowser::FavoritBrowser () : listener (NULL) del->set_valign(Gtk::ALIGN_START); del->set_image (*Gtk::manage (new RTImage ("remove-small.png"))); del->get_style_context()->add_class("Right"); - Gtk::HBox* buttonBox = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* buttonBox = Gtk::manage (new Gtk::Box ()); buttonBox->pack_start (*add); buttonBox->pack_start (*del); diff --git a/rtgui/favoritbrowser.h b/rtgui/favoritbrowser.h index 7a73b98af..ff57a38dc 100644 --- a/rtgui/favoritbrowser.h +++ b/rtgui/favoritbrowser.h @@ -24,7 +24,7 @@ #include "dirselectionlistener.h" class FavoritBrowser : - public Gtk::VBox, + public Gtk::Box, public DirSelectionListener { class FavoritColumns : diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index 08bcc276b..dbea4ade9 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -66,6 +66,8 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : toolBar(tb) { + set_orientation(Gtk::ORIENTATION_VERTICAL); + inTabMode = false; set_name ("FileBrowser"); @@ -78,7 +80,7 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : set_size_request(0, 250); // construct trash panel with the extra "empty trash" button - trashButtonBox = Gtk::manage( new Gtk::VBox ); + trashButtonBox = Gtk::manage( new Gtk::Box(Gtk::ORIENTATION_VERTICAL) ); Gtk::Button* emptyT = Gtk::manage( new Gtk::Button ()); emptyT->set_tooltip_markup (M("FILEBROWSER_EMPTYTRASHHINT")); emptyT->set_image (*Gtk::manage(new RTImage ("trash-delete.png"))); @@ -88,7 +90,7 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : trashButtonBox->show (); //initialize hbToolBar1 - hbToolBar1 = Gtk::manage(new Gtk::HBox ()); + hbToolBar1 = Gtk::manage(new Gtk::Box ()); //setup BrowsePath iRefreshWhite = new RTImage("refresh-small.png"); @@ -97,7 +99,7 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : BrowsePath = Gtk::manage(new Gtk::Entry ()); BrowsePath->set_width_chars (50); BrowsePath->set_tooltip_markup (M("FILEBROWSER_BROWSEPATHHINT")); - Gtk::HBox* hbBrowsePath = Gtk::manage(new Gtk::HBox ()); + Gtk::Box* hbBrowsePath = Gtk::manage(new Gtk::Box ()); buttonBrowsePath = Gtk::manage(new Gtk::Button ()); buttonBrowsePath->set_image (*iRefreshWhite); buttonBrowsePath->set_tooltip_markup (M("FILEBROWSER_BROWSEPATHBUTTONHINT")); @@ -118,7 +120,7 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : Query->set_width_chars (20); // TODO !!! add this value to options? Query->set_max_width_chars (20); Query->set_tooltip_markup (M("FILEBROWSER_QUERYHINT")); - Gtk::HBox* hbQuery = Gtk::manage(new Gtk::HBox ()); + Gtk::Box* hbQuery = Gtk::manage(new Gtk::Box ()); buttonQueryClear = Gtk::manage(new Gtk::Button ()); buttonQueryClear->set_image (*iQueryClear); buttonQueryClear->set_tooltip_markup (M("FILEBROWSER_QUERYBUTTONHINT")); @@ -141,7 +143,7 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : } // setup button bar - buttonBar = Gtk::manage( new Gtk::HBox () ); + buttonBar = Gtk::manage( new Gtk::Box () ); buttonBar->set_name ("ToolBarPanelFileBrowser"); MyScrolledToolbar *stb = Gtk::manage(new MyScrolledToolbar()); stb->set_name("FileBrowserIconToolbar"); @@ -159,7 +161,7 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : tbLeftPanel_1->signal_toggled().connect( sigc::mem_fun(*this, &FileCatalog::tbLeftPanel_1_toggled) ); buttonBar->pack_start (*tbLeftPanel_1, Gtk::PACK_SHRINK); - vSepiLeftPanel = new Gtk::VSeparator (); + vSepiLeftPanel = new Gtk::Separator(Gtk::ORIENTATION_VERTICAL); buttonBar->pack_start (*vSepiLeftPanel, Gtk::PACK_SHRINK); iFilterClear = new RTImage ("filter-clear.png"); @@ -172,12 +174,12 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : bFilterClear->signal_button_press_event().connect (sigc::mem_fun(*this, &FileCatalog::capture_event), false); bCateg[0] = bFilterClear->signal_toggled().connect (sigc::bind(sigc::mem_fun(*this, &FileCatalog::categoryButtonToggled), bFilterClear, true)); buttonBar->pack_start (*bFilterClear, Gtk::PACK_SHRINK); - buttonBar->pack_start (*Gtk::manage(new Gtk::VSeparator), Gtk::PACK_SHRINK); + buttonBar->pack_start (*Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)), Gtk::PACK_SHRINK); - fltrVbox1 = Gtk::manage (new Gtk::VBox()); - fltrRankbox = Gtk::manage (new Gtk::HBox()); + fltrVbox1 = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); + fltrRankbox = Gtk::manage (new Gtk::Box()); fltrRankbox->get_style_context()->add_class("smallbuttonbox"); - fltrLabelbox = Gtk::manage (new Gtk::HBox()); + fltrLabelbox = Gtk::manage (new Gtk::Box()); fltrLabelbox->get_style_context()->add_class("smallbuttonbox"); iUnRanked = new RTImage ("star-gold-hollow-small.png"); @@ -253,12 +255,12 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : bCLabel[3]->set_tooltip_markup (M("FILEBROWSER_SHOWCOLORLABEL4HINT")); bCLabel[4]->set_tooltip_markup (M("FILEBROWSER_SHOWCOLORLABEL5HINT")); - buttonBar->pack_start (*Gtk::manage(new Gtk::VSeparator), Gtk::PACK_SHRINK); + buttonBar->pack_start (*Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)), Gtk::PACK_SHRINK); - fltrVbox2 = Gtk::manage (new Gtk::VBox()); - fltrEditedBox = Gtk::manage (new Gtk::HBox()); + fltrVbox2 = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); + fltrEditedBox = Gtk::manage (new Gtk::Box()); fltrEditedBox->get_style_context()->add_class("smallbuttonbox"); - fltrRecentlySavedBox = Gtk::manage (new Gtk::HBox()); + fltrRecentlySavedBox = Gtk::manage (new Gtk::Box()); fltrRecentlySavedBox->get_style_context()->add_class("smallbuttonbox"); // bEdited @@ -315,7 +317,7 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : fltrVbox2->pack_start (*fltrRecentlySavedBox, Gtk::PACK_SHRINK, 0); buttonBar->pack_start (*fltrVbox2, Gtk::PACK_SHRINK); - buttonBar->pack_start (*Gtk::manage(new Gtk::VSeparator), Gtk::PACK_SHRINK); + buttonBar->pack_start (*Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)), Gtk::PACK_SHRINK); // Trash iTrashShowEmpty = new RTImage("trash-empty-show.png") ; @@ -348,7 +350,7 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : buttonBar->pack_start (*bTrash, Gtk::PACK_SHRINK); buttonBar->pack_start (*bNotTrash, Gtk::PACK_SHRINK); buttonBar->pack_start (*bOriginal, Gtk::PACK_SHRINK); - buttonBar->pack_start (*Gtk::manage(new Gtk::VSeparator), Gtk::PACK_SHRINK); + buttonBar->pack_start (*Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)), Gtk::PACK_SHRINK); fileBrowser->trash_changed().connect( sigc::mem_fun(*this, &FileCatalog::trashChanged) ); // 0 - bFilterClear @@ -406,7 +408,7 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : buttonBar->pack_start (*exifInfo, Gtk::PACK_SHRINK); // thumbnail zoom - Gtk::HBox* zoomBox = Gtk::manage( new Gtk::HBox () ); + Gtk::Box* zoomBox = Gtk::manage( new Gtk::Box () ); zoomInButton = Gtk::manage( new Gtk::Button () ); zoomInButton->set_image (*Gtk::manage(new RTImage ("magnifier-plus.png"))); zoomInButton->signal_pressed().connect (sigc::mem_fun(*this, &FileCatalog::zoomIn)); @@ -421,7 +423,7 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : zoomBox->pack_end (*zoomOutButton, Gtk::PACK_SHRINK); buttonBar->pack_start (*zoomBox, Gtk::PACK_SHRINK); - buttonBar->pack_start (*Gtk::manage(new Gtk::VSeparator), Gtk::PACK_SHRINK); + buttonBar->pack_start (*Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)), Gtk::PACK_SHRINK); //iRightArrow = new RTImage("right.png"); //iRightArrow_red = new RTImage("right_red.png"); @@ -443,12 +445,12 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : buttonBar->pack_end (*tbRightPanel_1, Gtk::PACK_SHRINK); buttonBar->pack_end (*coarsePanel, Gtk::PACK_SHRINK); - buttonBar->pack_end (*Gtk::manage(new Gtk::VSeparator), Gtk::PACK_SHRINK, 4); + buttonBar->pack_end (*Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)), Gtk::PACK_SHRINK, 4); buttonBar->pack_end (*toolBar, Gtk::PACK_SHRINK); - buttonBar->pack_end (*Gtk::manage(new Gtk::VSeparator), Gtk::PACK_SHRINK, 4); + buttonBar->pack_end (*Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)), Gtk::PACK_SHRINK, 4); // add default panel - hBox = Gtk::manage( new Gtk::HBox () ); + hBox = Gtk::manage( new Gtk::Box () ); hBox->show (); hBox->pack_end (*fileBrowser); hBox->set_name ("FilmstripPanel"); @@ -525,7 +527,7 @@ void FileCatalog::exifInfoButtonToggled() void FileCatalog::on_realize() { - Gtk::VBox::on_realize(); + Gtk::Box::on_realize(); Pango::FontDescription fontd = get_pango_context()->get_font_description (); fileBrowser->get_pango_context()->set_font_description (fontd); // batchQueue->get_pango_context()->set_font_description (fontd); diff --git a/rtgui/filecatalog.h b/rtgui/filecatalog.h index 194153921..c7c4f3155 100644 --- a/rtgui/filecatalog.h +++ b/rtgui/filecatalog.h @@ -43,7 +43,7 @@ class ToolBar; * - handling the thumbnail toolbar, * - monitoring the directory (for any change) */ -class FileCatalog final : public Gtk::VBox, +class FileCatalog final : public Gtk::Box, public PreviewLoaderListener, public FilterPanelListener, public FileBrowserListener, @@ -55,7 +55,7 @@ public: private: FilePanel* filepanel; - Gtk::HBox* hBox; + Gtk::Box* hBox; Glib::ustring selectedDirectory; int selectedDirectoryId; bool enabled; @@ -69,19 +69,19 @@ private: ImageAreaToolListener* iatlistener; DirSelectionSlot selectDir; - Gtk::HBox* buttonBar; - Gtk::HBox* hbToolBar1; + Gtk::Box* buttonBar; + Gtk::Box* hbToolBar1; MyScrolledToolbar* hbToolBar1STB; - Gtk::HBox* fltrRankbox; - Gtk::HBox* fltrLabelbox; - Gtk::VBox* fltrVbox1; + Gtk::Box* fltrRankbox; + Gtk::Box* fltrLabelbox; + Gtk::Box* fltrVbox1; - Gtk::HBox* fltrEditedBox; - Gtk::HBox* fltrRecentlySavedBox; - Gtk::VBox* fltrVbox2; + Gtk::Box* fltrEditedBox; + Gtk::Box* fltrRecentlySavedBox; + Gtk::Box* fltrVbox2; - Gtk::VSeparator* vSepiLeftPanel; + Gtk::Separator* vSepiLeftPanel; Gtk::ToggleButton* tbLeftPanel_1; Gtk::ToggleButton* tbRightPanel_1; @@ -119,7 +119,7 @@ private: double vScrollPos[18]; int lastScrollPos; - Gtk::VBox* trashButtonBox; + Gtk::Box* trashButtonBox; Gtk::Button* zoomInButton; Gtk::Button* zoomOutButton; diff --git a/rtgui/filepanel.cc b/rtgui/filepanel.cc index 17a5c9c5b..a09a82597 100644 --- a/rtgui/filepanel.cc +++ b/rtgui/filepanel.cc @@ -34,7 +34,7 @@ FilePanel::FilePanel () : parent(nullptr), error(0) { // Contains everything except for the batch Tool Panel and tabs (Fast Export, Inspect, etc) - dirpaned = Gtk::manage ( new Gtk::HPaned () ); + dirpaned = Gtk::manage ( new Gtk::Paned () ); dirpaned->set_position (options.dirBrowserWidth); // The directory tree @@ -45,12 +45,12 @@ FilePanel::FilePanel () : parent(nullptr), error(0) recentBrowser = Gtk::manage ( new RecentBrowser () ); // The whole left panel. Contains Places, Recent Folders and Folders. - placespaned = Gtk::manage ( new Gtk::VPaned () ); + placespaned = Gtk::manage ( new Gtk::Paned (Gtk::ORIENTATION_VERTICAL) ); placespaned->set_name ("PlacesPaned"); placespaned->set_size_request(250, 100); placespaned->set_position (options.dirBrowserHeight); - Gtk::VBox* obox = Gtk::manage (new Gtk::VBox ()); + Gtk::Box* obox = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); obox->get_style_context()->add_class ("plainback"); obox->pack_start (*recentBrowser, Gtk::PACK_SHRINK, 4); obox->pack_start (*dirBrowser); @@ -79,11 +79,11 @@ FilePanel::FilePanel () : parent(nullptr), error(0) recentBrowser->setDirSelector (sigc::mem_fun (dirBrowser, &DirBrowser::selectDir)); fileCatalog->setFileSelectionListener (this); - rightBox = Gtk::manage ( new Gtk::HBox () ); + rightBox = Gtk::manage ( new Gtk::Box () ); rightBox->set_size_request(350, 100); rightNotebook = Gtk::manage ( new Gtk::Notebook () ); rightNotebookSwitchConn = rightNotebook->signal_switch_page().connect_notify( sigc::mem_fun(*this, &FilePanel::on_NB_switch_page) ); - //Gtk::VBox* taggingBox = Gtk::manage ( new Gtk::VBox () ); + //Gtk::Box* taggingBox = Gtk::manage ( new Gtk::Box(Gtk::ORIENTATION_VERTICAL) ); history = Gtk::manage ( new History (false) ); @@ -130,7 +130,7 @@ FilePanel::FilePanel () : parent(nullptr), error(0) exportLab->set_name ("LabelRightNotebook"); exportLab->set_angle (90); - tpcPaned = Gtk::manage ( new Gtk::VPaned () ); + tpcPaned = Gtk::manage ( new Gtk::Paned (Gtk::ORIENTATION_VERTICAL) ); tpcPaned->pack1 (*tpc->toolPanelNotebook, false, true); tpcPaned->pack2 (*history, true, false); @@ -177,7 +177,7 @@ FilePanel::~FilePanel () void FilePanel::on_realize () { - Gtk::HPaned::on_realize (); + Gtk::Paned::on_realize (); tpc->closeAllTools(); } diff --git a/rtgui/filepanel.h b/rtgui/filepanel.h index cbfe8e53e..65e1ea548 100644 --- a/rtgui/filepanel.h +++ b/rtgui/filepanel.h @@ -37,7 +37,7 @@ class RTWindow; class DirBrowser; class FilePanel final : - public Gtk::HPaned, + public Gtk::Paned, public FileSelectionListener, public rtengine::NonCopyable { @@ -46,9 +46,9 @@ public: ~FilePanel () override; Gtk::Paned* placespaned; - Gtk::HPaned* dirpaned; + Gtk::Paned* dirpaned; - Gtk::HBox* rightBox; + Gtk::Box* rightBox; DirBrowser* dirBrowser; FilterPanel* filterPanel; @@ -90,7 +90,7 @@ private: RecentBrowser* recentBrowser; Inspector* inspectorPanel; - Gtk::VPaned* tpcPaned; + Gtk::Paned* tpcPaned; BatchToolPanelCoordinator* tpc; History* history; RTWindow* parent; diff --git a/rtgui/filmnegative.cc b/rtgui/filmnegative.cc index 4df9e9a09..5fc15b5ba 100644 --- a/rtgui/filmnegative.cc +++ b/rtgui/filmnegative.cc @@ -259,7 +259,7 @@ FilmNegative::FilmNegative() : // pack_start(*oldMethod, Gtk::PACK_SHRINK, 0); - Gtk::HSeparator* const sep = Gtk::manage(new Gtk::HSeparator()); + Gtk::Separator* const sep = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); sep->get_style_context()->add_class("grid-row-separator"); pack_start(*sep, Gtk::PACK_SHRINK, 0); diff --git a/rtgui/filterpanel.cc b/rtgui/filterpanel.cc index 2c4fc52d2..c407b88d7 100644 --- a/rtgui/filterpanel.cc +++ b/rtgui/filterpanel.cc @@ -25,14 +25,15 @@ using namespace rtengine; FilterPanel::FilterPanel () : listener (nullptr) { + set_orientation(Gtk::ORIENTATION_VERTICAL); enabled = Gtk::manage (new Gtk::CheckButton (M("EXIFFILTER_METADATAFILTER"))); pack_start (*enabled, Gtk::PACK_SHRINK, 2); - pack_start (*Gtk::manage(new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 2); + pack_start (*Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)), Gtk::PACK_SHRINK, 2); enaFNumber = Gtk::manage (new Gtk::CheckButton (M("EXIFFILTER_APERTURE") + ":")); - Gtk::VBox* fnvb = Gtk::manage(new Gtk::VBox ()); - Gtk::HBox* fnhb = Gtk::manage(new Gtk::HBox ()); + Gtk::Box* fnvb = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); + Gtk::Box* fnhb = Gtk::manage(new Gtk::Box ()); fnvb->pack_start (*enaFNumber, Gtk::PACK_SHRINK, 0); fnumberFrom = Gtk::manage(new Gtk::Entry ()); fnumberFrom->set_width_chars(1); @@ -45,8 +46,8 @@ FilterPanel::FilterPanel () : listener (nullptr) pack_start (*fnvb, Gtk::PACK_SHRINK, 4); enaShutter = Gtk::manage(new Gtk::CheckButton(M("EXIFFILTER_SHUTTER") + ":")); - Gtk::VBox* svb = Gtk::manage(new Gtk::VBox ()); - Gtk::HBox* shb = Gtk::manage(new Gtk::HBox ()); + Gtk::Box* svb = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); + Gtk::Box* shb = Gtk::manage(new Gtk::Box ()); svb->pack_start (*enaShutter, Gtk::PACK_SHRINK, 0); shutterFrom = Gtk::manage(new Gtk::Entry ()); shutterFrom->set_width_chars(1); @@ -59,8 +60,8 @@ FilterPanel::FilterPanel () : listener (nullptr) pack_start (*svb, Gtk::PACK_SHRINK, 4); enaISO = Gtk::manage(new Gtk::CheckButton(M("EXIFFILTER_ISO") + ":")); - Gtk::VBox* ivb = Gtk::manage(new Gtk::VBox ()); - Gtk::HBox* ihb = Gtk::manage(new Gtk::HBox ()); + Gtk::Box* ivb = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); + Gtk::Box* ihb = Gtk::manage(new Gtk::Box ()); ivb->pack_start (*enaISO, Gtk::PACK_SHRINK, 0); isoFrom = Gtk::manage(new Gtk::Entry ()); isoFrom->set_width_chars(1); @@ -73,8 +74,8 @@ FilterPanel::FilterPanel () : listener (nullptr) pack_start (*ivb, Gtk::PACK_SHRINK, 4); enaFocalLen = Gtk::manage(new Gtk::CheckButton(M("EXIFFILTER_FOCALLEN") + ":")); - Gtk::VBox* fvb = Gtk::manage(new Gtk::VBox ()); - Gtk::HBox* fhb = Gtk::manage(new Gtk::HBox ()); + Gtk::Box* fvb = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); + Gtk::Box* fhb = Gtk::manage(new Gtk::Box ()); fvb->pack_start (*enaFocalLen, Gtk::PACK_SHRINK, 0); focalFrom = Gtk::manage(new Gtk::Entry ()); focalFrom->set_width_chars(1); @@ -87,7 +88,7 @@ FilterPanel::FilterPanel () : listener (nullptr) pack_start (*fvb, Gtk::PACK_SHRINK, 4); enaExpComp = Gtk::manage(new Gtk::CheckButton(M("EXIFFILTER_EXPOSURECOMPENSATION") + ":")); - Gtk::VBox* evb = Gtk::manage(new Gtk::VBox ()); + Gtk::Box* evb = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); evb->pack_start (*enaExpComp, Gtk::PACK_SHRINK, 0); expcomp = Gtk::manage(new Gtk::ListViewText (1, false, Gtk::SELECTION_MULTIPLE)); expcomp->set_headers_visible (false); @@ -99,7 +100,7 @@ FilterPanel::FilterPanel () : listener (nullptr) pack_start (*evb, Gtk::PACK_SHRINK, 4); enaCamera = Gtk::manage(new Gtk::CheckButton(M("EXIFFILTER_CAMERA") + ":")); - Gtk::VBox* cvb = Gtk::manage(new Gtk::VBox ()); + Gtk::Box* cvb = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); cvb->pack_start (*enaCamera, Gtk::PACK_SHRINK, 0); camera = Gtk::manage(new Gtk::ListViewText (1, false, Gtk::SELECTION_MULTIPLE)); camera->set_headers_visible (false); @@ -111,7 +112,7 @@ FilterPanel::FilterPanel () : listener (nullptr) pack_start (*cvb, Gtk::PACK_EXPAND_WIDGET, 4); enaLens = Gtk::manage(new Gtk::CheckButton(M("EXIFFILTER_LENS") + ":")); - Gtk::VBox* lvb = Gtk::manage(new Gtk::VBox ()); + Gtk::Box* lvb = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); lvb->pack_start (*enaLens, Gtk::PACK_SHRINK, 0); lens = Gtk::manage(new Gtk::ListViewText (1, false, Gtk::SELECTION_MULTIPLE)); lens->set_headers_visible (false); @@ -123,7 +124,7 @@ FilterPanel::FilterPanel () : listener (nullptr) pack_start (*lvb, Gtk::PACK_EXPAND_WIDGET, 4); enaFiletype = Gtk::manage(new Gtk::CheckButton(M("EXIFFILTER_FILETYPE") + ":")); - Gtk::VBox* ftvb = Gtk::manage(new Gtk::VBox ()); + Gtk::Box* ftvb = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); ftvb->pack_start (*enaFiletype, Gtk::PACK_SHRINK, 0); filetype = Gtk::manage(new Gtk::ListViewText (1, false, Gtk::SELECTION_MULTIPLE)); filetype->set_headers_visible (false); @@ -135,8 +136,8 @@ FilterPanel::FilterPanel () : listener (nullptr) pack_start (*ftvb, Gtk::PACK_EXPAND_WIDGET, 4); // add panel ending - Gtk::VBox* vboxpe = Gtk::manage (new Gtk::VBox ()); - Gtk::HSeparator* hseptpe = Gtk::manage (new Gtk::HSeparator ()); + Gtk::Box* vboxpe = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); + Gtk::Separator* hseptpe = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); Gtk::Image* peImg = Gtk::manage (new RTImage("ornament1.png")); vboxpe->pack_start(*hseptpe, Gtk::PACK_SHRINK, 4); vboxpe->pack_start(*peImg); diff --git a/rtgui/filterpanel.h b/rtgui/filterpanel.h index 25a368b27..77c2d063e 100644 --- a/rtgui/filterpanel.h +++ b/rtgui/filterpanel.h @@ -29,7 +29,7 @@ public: virtual void exifFilterChanged () = 0; }; -class FilterPanel : public Gtk::VBox +class FilterPanel : public Gtk::Box { protected: diff --git a/rtgui/flatfield.cc b/rtgui/flatfield.cc index 69d14c463..71fa0aab6 100644 --- a/rtgui/flatfield.cc +++ b/rtgui/flatfield.cc @@ -32,7 +32,7 @@ using namespace rtengine::procparams; FlatField::FlatField () : FoldableToolPanel(this, "flatfield", M("TP_FLATFIELD_LABEL")) { - hbff = Gtk::manage(new Gtk::HBox()); + hbff = Gtk::manage(new Gtk::Box()); flatFieldFile = Gtk::manage(new MyFileChooserButton(M("TP_FLATFIELD_LABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN)); bindCurrentFolder (*flatFieldFile, options.lastFlatfieldDir); ffLabel = Gtk::manage(new Gtk::Label(M("GENERAL_FILE"))); @@ -51,7 +51,7 @@ FlatField::FlatField () : FoldableToolPanel(this, "flatfield", M("TP_FLATFIELD_L flatFieldBlurRadius->show(); - Gtk::HBox* hbffbt = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* hbffbt = Gtk::manage (new Gtk::Box ()); hbffbt->pack_start (*Gtk::manage (new Gtk::Label ( M("TP_FLATFIELD_BLURTYPE") + ":")), Gtk::PACK_SHRINK); flatFieldBlurType = Gtk::manage (new MyComboBoxText ()); flatFieldBlurType->append(M("TP_FLATFIELD_BT_AREA")); diff --git a/rtgui/flatfield.h b/rtgui/flatfield.h index 5cbc49684..0d6f167e1 100644 --- a/rtgui/flatfield.h +++ b/rtgui/flatfield.h @@ -55,7 +55,7 @@ protected: Adjuster* flatFieldClipControl; Adjuster* flatFieldBlurRadius; MyComboBoxText* flatFieldBlurType; - Gtk::HBox *hbff; + Gtk::Box *hbff; bool ffChanged; bool lastFFAutoSelect; bool lastFFAutoClipCtrl; diff --git a/rtgui/gradient.cc b/rtgui/gradient.cc index 8229e883a..b0c6000be 100644 --- a/rtgui/gradient.cc +++ b/rtgui/gradient.cc @@ -15,7 +15,7 @@ using namespace rtengine::procparams; Gradient::Gradient () : FoldableToolPanel(this, "gradient", M("TP_GRADIENT_LABEL"), false, true), EditSubscriber(ET_OBJECTS), lastObject(-1), draggedPointOldAngle(-1000.) { - editHBox = Gtk::manage (new Gtk::HBox()); + editHBox = Gtk::manage (new Gtk::Box()); edit = Gtk::manage (new Gtk::ToggleButton()); edit->get_style_context()->add_class("independent"); edit->add (*Gtk::manage (new RTImage ("crosshair-adjust.png"))); diff --git a/rtgui/gradient.h b/rtgui/gradient.h index f2be47ccc..64eabefae 100644 --- a/rtgui/gradient.h +++ b/rtgui/gradient.h @@ -21,7 +21,7 @@ private: int lastObject; protected: - Gtk::HBox *editHBox; + Gtk::Box *editHBox; Gtk::ToggleButton* edit; Adjuster* degree; Adjuster* feather; diff --git a/rtgui/guiutils.cc b/rtgui/guiutils.cc index 93629d5fd..601fa422c 100644 --- a/rtgui/guiutils.cc +++ b/rtgui/guiutils.cc @@ -573,12 +573,13 @@ MyExpander::MyExpander(bool useEnabled, Gtk::Widget* titleWidget) : child(nullptr), headerWidget(nullptr), statusImage(nullptr), label(nullptr), useEnabled(useEnabled) { + set_orientation(Gtk::ORIENTATION_VERTICAL); set_spacing(0); set_name("MyExpander"); set_can_focus(false); setExpandAlignProperties(this, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL); - headerHBox = Gtk::manage( new Gtk::HBox()); + headerHBox = Gtk::manage( new Gtk::Box()); headerHBox->set_can_focus(false); setExpandAlignProperties(headerHBox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL); @@ -628,12 +629,13 @@ MyExpander::MyExpander(bool useEnabled, Glib::ustring titleLabel) : child(nullptr), headerWidget(nullptr), label(nullptr), useEnabled(useEnabled) { + set_orientation(Gtk::ORIENTATION_VERTICAL); set_spacing(0); set_name("MyExpander"); set_can_focus(false); setExpandAlignProperties(this, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL); - headerHBox = Gtk::manage( new Gtk::HBox()); + headerHBox = Gtk::manage( new Gtk::Box()); headerHBox->set_can_focus(false); setExpandAlignProperties(headerHBox, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL); @@ -1237,7 +1239,7 @@ bool MyHScale::on_scroll_event (GdkEventScroll* event) // event->delta_x, event->delta_y, (int)event->direction, (int)event->type, event->send_event); // If Shift is pressed, the widget is modified if (event->state & GDK_SHIFT_MASK) { - Gtk::HScale::on_scroll_event(event); + Gtk::Scale::on_scroll_event(event); return true; } @@ -1267,7 +1269,7 @@ MyFileChooserButton::MyFileChooserButton(const Glib::ustring &title, Gtk::FileCh box_.pack_start(lbl_, true, true); Gtk::Image *img = Gtk::manage(new Gtk::Image()); img->set_from_icon_name("folder-open", Gtk::ICON_SIZE_BUTTON); - box_.pack_start(*Gtk::manage(new Gtk::VSeparator()), false, false, 5); + box_.pack_start(*Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)), false, false, 5); box_.pack_start(*img, false, false); box_.show_all_children(); add(box_); diff --git a/rtgui/guiutils.h b/rtgui/guiutils.h index d4c91734a..d90d45370 100644 --- a/rtgui/guiutils.h +++ b/rtgui/guiutils.h @@ -185,7 +185,7 @@ public: * * Warning: once you've instantiated this class with a text label or a widget label, you won't be able to revert to the other solution. */ -class MyExpander final : public Gtk::VBox +class MyExpander final : public Gtk::Box { public: typedef sigc::signal type_signal_enabled_toggled; @@ -199,7 +199,7 @@ private: bool enabled; /// Enabled feature (default to true) bool inconsistent; /// True if the enabled button is inconsistent Gtk::EventBox *titleEvBox; /// EventBox of the title, to get a connector from it - Gtk::HBox *headerHBox; + Gtk::Box *headerHBox; bool flushEvent; /// Flag to control the weird event mechanism of Gtk (please prove me wrong!) ExpanderBox* expBox; /// Frame that includes the child and control its visibility Gtk::EventBox *imageEvBox; /// Enable/Disable or Open/Close arrow event box @@ -373,13 +373,15 @@ public: }; /** - * @brief subclass of Gtk::HScale in order to handle the scrollwheel + * @brief subclass of Gtk::Scale in order to handle the scrollwheel */ -class MyHScale final : public Gtk::HScale +class MyHScale final : public Gtk::Scale { +protected: bool on_scroll_event (GdkEventScroll* event) override; bool on_key_press_event (GdkEventKey* event) override; + }; /** @@ -391,7 +393,7 @@ private: Glib::ustring title_; Gtk::FileChooserAction action_; - Gtk::HBox box_; + Gtk::Box box_; Gtk::Label lbl_; std::string filename_; std::string current_folder_; @@ -473,7 +475,7 @@ typedef enum RTNav { /** * @brief Handle the switch between text and image to be displayed in the HBox (to be used in a button/toolpanel) */ -class TextOrIcon final : public Gtk::HBox +class TextOrIcon final : public Gtk::Box { public: diff --git a/rtgui/histogrampanel.cc b/rtgui/histogrampanel.cc index 83db36cb4..9123e7841 100644 --- a/rtgui/histogrampanel.cc +++ b/rtgui/histogrampanel.cc @@ -329,7 +329,7 @@ HistogramPanel::HistogramPanel () : optionButtons->add(*showBAR); optionButtons->add(*brightnessWidget); - Gtk::VSeparator* separator = Gtk::manage(new Gtk::VSeparator()); + Gtk::Separator* separator = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)); setExpandAlignProperties(separator, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); persistentButtons->add(*scopeHistBtn); persistentButtons->add(*scopeHistRawBtn); diff --git a/rtgui/history.cc b/rtgui/history.cc index 1a9cc1258..e30b3e8ce 100644 --- a/rtgui/history.cc +++ b/rtgui/history.cc @@ -31,6 +31,7 @@ using namespace rtengine::procparams; History::History (bool bookmarkSupport) : historyVPaned (nullptr), blistener (nullptr), tpc (nullptr), bmnum (1) { + set_orientation(Gtk::ORIENTATION_VERTICAL); blistenerLock = false; // sets default that the Before preview will not be locked /* @@ -91,7 +92,7 @@ History::History (bool bookmarkSupport) : historyVPaned (nullptr), blistener (nu // Bookmark List // ~~~~~~~~~~~~~ - Gtk::HBox* ahbox = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* ahbox = Gtk::manage (new Gtk::Box ()); addBookmark = Gtk::manage (new Gtk::Button ()); // M("HISTORY_NEWSNAPSHOT") setExpandAlignProperties (addBookmark, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); //addBookmark->get_style_context()->set_junction_sides(Gtk::JUNCTION_RIGHT); @@ -116,14 +117,14 @@ History::History (bool bookmarkSupport) : historyVPaned (nullptr), blistener (nu Gtk::Frame* bmFrame = Gtk::manage (new Gtk::Frame (M ("HISTORY_SNAPSHOTS"))); bmFrame->set_name ("Snapshots"); - Gtk::VBox* bmBox = Gtk::manage (new Gtk::VBox ()); + Gtk::Box* bmBox = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); bmFrame->add (*bmBox); bmBox->pack_start (*bscrollw, Gtk::PACK_EXPAND_WIDGET, 4); bmBox->pack_end (*ahbox, Gtk::PACK_SHRINK, 4); bmBox->set_size_request (-1, 60); if (bookmarkSupport) { - historyVPaned = Gtk::manage ( new Gtk::VPaned () ); + historyVPaned = Gtk::manage ( new Gtk::Paned (Gtk::ORIENTATION_VERTICAL) ); historyVPaned->pack1 (*histFrame, true, true); historyVPaned->pack2 (*bmFrame, false, false); pack_start (*historyVPaned); @@ -450,7 +451,7 @@ bool History::on_query_tooltip (int x, int y, bool keyboard_tooltip, const Glib: Gtk::Label *left = Gtk::manage (new Gtk::Label(param+" :")); Gtk::Label *right = Gtk::manage (new Gtk::Label(val)); right->set_justify(Gtk::JUSTIFY_LEFT); - Gtk::HBox *hbox = Gtk::manage (new Gtk::HBox()); + Gtk::Box *hbox = Gtk::manage (new Gtk::Box()); hbox->set_spacing(5); hbox->pack_start(*left, Gtk::PACK_SHRINK, 0); hbox->pack_start(*right, Gtk::PACK_SHRINK, 0); diff --git a/rtgui/history.h b/rtgui/history.h index faebe4765..197e5690b 100644 --- a/rtgui/history.h +++ b/rtgui/history.h @@ -33,7 +33,7 @@ public: virtual void historyBeforeLineChanged(const rtengine::procparams::ProcParams& params) = 0; }; -class History : public Gtk::VBox, public PParamsChangeListener +class History : public Gtk::Box, public PParamsChangeListener { public: @@ -72,7 +72,7 @@ public: BookmarkColumns bookmarkColumns; protected: - Gtk::VPaned* historyVPaned; + Gtk::Paned* historyVPaned; Gtk::TreeView* hTreeView; Glib::RefPtr historyModel; diff --git a/rtgui/icmpanel.cc b/rtgui/icmpanel.cc index 4a67d076f..e0fd7cd96 100644 --- a/rtgui/icmpanel.cc +++ b/rtgui/icmpanel.cc @@ -62,7 +62,7 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha Gtk::Frame *iFrame = Gtk::manage(new Gtk::Frame(M("TP_ICM_INPUTPROFILE"))); iFrame->set_label_align(0.025, 0.5); - iVBox = Gtk::manage(new Gtk::VBox()); + iVBox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); inone = Gtk::manage(new Gtk::RadioButton(M("TP_ICM_INPUTNONE"))); inone->set_tooltip_text(M("TP_ICM_INPUTNONE_TOOLTIP")); @@ -81,7 +81,7 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha iVBox->pack_start(*icameraICC, Gtk::PACK_SHRINK); ifromfile = Gtk::manage(new Gtk::RadioButton(M("TP_ICM_INPUTCUSTOM") + ":")); - Gtk::HBox* ffbox = Gtk::manage(new Gtk::HBox()); + Gtk::Box* ffbox = Gtk::manage(new Gtk::Box()); ifromfile->set_tooltip_text(M("TP_ICM_INPUTCUSTOM_TOOLTIP")); ffbox->pack_start(*ifromfile, Gtk::PACK_SHRINK); ffbox->pack_start(*ipDialog); @@ -171,7 +171,7 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha Gtk::Frame *wFrame = Gtk::manage(new Gtk::Frame(M("TP_ICM_WORKINGPROFILE"))); wFrame->set_label_align(0.025, 0.5); - Gtk::VBox *wProfVBox = Gtk::manage(new Gtk::VBox()); + Gtk::Box* wProfVBox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); wProfNames = Gtk::manage(new MyComboBoxText()); wProfVBox->pack_start(*wProfNames, Gtk::PACK_SHRINK); @@ -188,7 +188,7 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha //-----------------gamma TRC working - wTRCHBox = Gtk::manage(new Gtk::HBox()); + wTRCHBox = Gtk::manage(new Gtk::Box()); Gtk::Label* wtrclab = Gtk::manage(new Gtk::Label(M("TP_ICM_WORKING_TRC"))); @@ -230,7 +230,7 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha Gtk::Frame *oFrame = Gtk::manage(new Gtk::Frame(M("TP_ICM_OUTPUTPROFILE"))); oFrame->set_label_align(0.025, 0.5); - Gtk::VBox *oProfVBox = Gtk::manage(new Gtk::VBox()); + Gtk::Box* oProfVBox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); oProfNames = Gtk::manage(new MyComboBoxText()); oProfVBox->pack_start(*oProfNames, Gtk::PACK_SHRINK); @@ -247,7 +247,7 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha oProfNames->set_active(0); // Rendering intent - Gtk::HBox *riHBox = Gtk::manage(new Gtk::HBox()); + Gtk::Box *riHBox = Gtk::manage(new Gtk::Box()); Gtk::Label* outputIntentLbl = Gtk::manage(new Gtk::Label(M("TP_ICM_PROFILEINTENT"))); riHBox->pack_start(*outputIntentLbl, Gtk::PACK_SHRINK); oRendIntent.reset(new PopUpButton()); @@ -964,7 +964,7 @@ void ICMPanel::saveReferencePressed() Gtk::CheckButton applyWB(M("TP_ICM_SAVEREFERENCE_APPLYWB")); applyWB.set_tooltip_text(M("TP_ICM_SAVEREFERENCE_APPLYWB_TOOLTIP")); - Gtk::HBox* hbox = Gtk::manage(new Gtk::HBox()); + Gtk::Box* hbox = Gtk::manage(new Gtk::Box()); hbox->pack_end(applyWB, Gtk::PACK_SHRINK, 2); Gtk::Box *box = dialog.get_content_area(); box->pack_end(*hbox, Gtk::PACK_SHRINK, 2); diff --git a/rtgui/icmpanel.h b/rtgui/icmpanel.h index cc46c5d37..81a011c59 100644 --- a/rtgui/icmpanel.h +++ b/rtgui/icmpanel.h @@ -50,7 +50,7 @@ protected: Adjuster* wSlope; Gtk::Label* labmga; - Gtk::HBox* gabox; + Gtk::Box* gabox; //bool freegamma; @@ -80,8 +80,8 @@ private: rtengine::ProcEvent EvICMslop; rtengine::ProcEvent EvICMtrcinMethod; - Gtk::VBox* iVBox; - Gtk::HBox* wTRCHBox; + Gtk::Box* iVBox; + Gtk::Box* wTRCHBox; Gtk::CheckButton* obpc; Gtk::RadioButton* inone; diff --git a/rtgui/imageareapanel.cc b/rtgui/imageareapanel.cc index f693c3181..ee153026d 100644 --- a/rtgui/imageareapanel.cc +++ b/rtgui/imageareapanel.cc @@ -20,10 +20,11 @@ ImageAreaPanel::ImageAreaPanel () : before(nullptr), after(nullptr) { + set_orientation(Gtk::ORIENTATION_VERTICAL); imageArea = new ImageArea (this); - Gtk::HBox* hb1 = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* hb1 = Gtk::manage (new Gtk::Box ()); Gtk::Frame* frame = Gtk::manage (new Gtk::Frame ()); frame->add (*imageArea); diff --git a/rtgui/imageareapanel.h b/rtgui/imageareapanel.h index f52ca9060..8572d41d6 100644 --- a/rtgui/imageareapanel.h +++ b/rtgui/imageareapanel.h @@ -23,7 +23,7 @@ class ImageArea; class ImageAreaPanel final : - public Gtk::VBox + public Gtk::Box { protected: diff --git a/rtgui/indclippedpanel.h b/rtgui/indclippedpanel.h index 1017b58f1..6be0a6c40 100644 --- a/rtgui/indclippedpanel.h +++ b/rtgui/indclippedpanel.h @@ -24,7 +24,7 @@ class ImageArea; class IndicateClippedPanel : - public Gtk::HBox + public Gtk::Box { protected: diff --git a/rtgui/iptcpanel.cc b/rtgui/iptcpanel.cc index 25cd20560..1134b36da 100644 --- a/rtgui/iptcpanel.cc +++ b/rtgui/iptcpanel.cc @@ -31,6 +31,7 @@ IPTCPanel::IPTCPanel () : embeddedData(new rtengine::procparams::IPTCPairs) { + set_orientation(Gtk::ORIENTATION_VERTICAL); set_spacing (4); Gtk::Grid* iptc = Gtk::manage( new Gtk::Grid () ); @@ -90,7 +91,7 @@ IPTCPanel::IPTCPanel () : // -------------------------- - Gtk::HSeparator* hsep1 = Gtk::manage( new Gtk::HSeparator () ); + Gtk::Separator* hsep1 = Gtk::manage( new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL) ); setExpandAlignProperties(hsep1, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); iptc->attach (*hsep1, 0, row++, 2, 1); @@ -134,7 +135,7 @@ IPTCPanel::IPTCPanel () : iptc->attach (*scrolledWindowkw, 0, row++, 2, 1); // -------------------------- - Gtk::HSeparator* hsep2 = Gtk::manage( new Gtk::HSeparator () ); + Gtk::Separator* hsep2 = Gtk::manage( new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL) ); setExpandAlignProperties(hsep2, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); iptc->attach (*hsep2, 0, row++, 2, 1); // -------------------------- @@ -187,7 +188,7 @@ IPTCPanel::IPTCPanel () : iptc->attach (*scrolledWindowsc, 0, row++, 2, 1); // -------------------------- - Gtk::HSeparator* hsep3 = Gtk::manage( new Gtk::HSeparator () ); + Gtk::Separator* hsep3 = Gtk::manage( new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL) ); setExpandAlignProperties(hsep3, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); iptc->attach (*hsep3, 0, row++, 2, 1); // -------------------------- @@ -247,7 +248,7 @@ IPTCPanel::IPTCPanel () : // -------------------------- - Gtk::HSeparator* hsep4 = Gtk::manage( new Gtk::HSeparator () ); + Gtk::Separator* hsep4 = Gtk::manage( new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL) ); setExpandAlignProperties(hsep4, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); iptc->attach (*hsep4, 0, row++, 2, 1); diff --git a/rtgui/iptcpanel.h b/rtgui/iptcpanel.h index 100904d1a..da52fa7d2 100644 --- a/rtgui/iptcpanel.h +++ b/rtgui/iptcpanel.h @@ -26,7 +26,7 @@ #include "toolpanel.h" class IPTCPanel final : - public Gtk::VBox, + public Gtk::Box, public ToolPanel { diff --git a/rtgui/labcurve.cc b/rtgui/labcurve.cc index 27a8bee52..dca1dfd45 100644 --- a/rtgui/labcurve.cc +++ b/rtgui/labcurve.cc @@ -57,7 +57,7 @@ LCurve::LCurve () : FoldableToolPanel(this, "labcurves", M("TP_LABCURVE_LABEL"), chromaticity->setLogScale(2, 0, true); //%%%%%%%%%%%%%%%%%% - Gtk::HSeparator *hsep2 = Gtk::manage (new Gtk::HSeparator()); + Gtk::Separator* hsep2 = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); hsep2->show (); pack_start (*hsep2, Gtk::PACK_EXPAND_WIDGET, 4); @@ -81,7 +81,7 @@ LCurve::LCurve () : FoldableToolPanel(this, "labcurves", M("TP_LABCURVE_LABEL"), //%%%%%%%%%%%%%%%%%%% - Gtk::HSeparator *hsep3 = Gtk::manage (new Gtk::HSeparator()); + Gtk::Separator* hsep3 = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); hsep3->show (); pack_start (*hsep3, Gtk::PACK_EXPAND_WIDGET, 4); @@ -217,7 +217,7 @@ LCurve::LCurve () : FoldableToolPanel(this, "labcurves", M("TP_LABCURVE_LABEL"), curveEditorG->curveListComplete(); pack_start (*curveEditorG, Gtk::PACK_SHRINK, 4); - Gtk::HSeparator *hsepdh = Gtk::manage (new Gtk::HSeparator()); + Gtk::Separator* hsepdh = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); hsepdh->show (); pack_start (*hsepdh, Gtk::PACK_EXPAND_WIDGET, 4); diff --git a/rtgui/labcurve.h b/rtgui/labcurve.h index e8488a8c6..dfb79ae7a 100644 --- a/rtgui/labcurve.h +++ b/rtgui/labcurve.h @@ -53,7 +53,7 @@ protected: FlatCurveEditor* lhshape; FlatCurveEditor* hhshape; Gtk::Label* labmdh; - Gtk::HBox* dhbox; + Gtk::Box* dhbox; DiagonalCurveEditor* clshape; DiagonalCurveEditor* cdshape; diff --git a/rtgui/labgrid.h b/rtgui/labgrid.h index 4693c897c..78179210c 100644 --- a/rtgui/labgrid.h +++ b/rtgui/labgrid.h @@ -96,7 +96,7 @@ public: }; -class LabGrid: public Gtk::HBox { +class LabGrid: public Gtk::Box { private: LabGridArea grid; diff --git a/rtgui/lensgeom.cc b/rtgui/lensgeom.cc index 762726107..8bdbf6dd4 100644 --- a/rtgui/lensgeom.cc +++ b/rtgui/lensgeom.cc @@ -33,7 +33,7 @@ LensGeometry::LensGeometry () : FoldableToolPanel(this, "lensgeom", M("TP_LENSGE auto m = ProcEventMapper::getInstance(); EvTransMethod = m->newEvent(TRANSFORM, "HISTORY_MSG_TRANS_METHOD"); - Gtk::HBox* hb1 = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* hb1 = Gtk::manage (new Gtk::Box ()); hb1->pack_start (*Gtk::manage (new Gtk::Label ( M("TP_RAW_DMETHOD") + ": ")), Gtk::PACK_SHRINK, 4); method = Gtk::manage (new MyComboBoxText ()); method->append(M("TP_LENSGEOM_LOG")); diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 0ea5394bf..1b2dbf349 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -38,6 +38,7 @@ LocallabToolList::LocallabToolList(): // Tool list listener listListener(nullptr) { + set_orientation(Gtk::ORIENTATION_VERTICAL); list->set_model(listTreeModel); list->pack_start(toolRow.name); listConn = list->signal_changed().connect(sigc::mem_fun(*this, &LocallabToolList::toolRowSelected)); @@ -167,6 +168,8 @@ Locallab::Locallab(): // Other widgets resetshowButton(Gtk::manage(new Gtk::Button(M("TP_LOCALLAB_RESETSHOW")))) { + set_orientation(Gtk::ORIENTATION_VERTICAL); + // Create panel widget to receive Locallab GUI elements ToolVBox* const panel = Gtk::manage(new ToolVBox()); panel->set_spacing(2); @@ -177,7 +180,7 @@ Locallab::Locallab(): panel->pack_start(*expsettings->getExpander(), false, false); // Add separator - Gtk::HSeparator* const separator = Gtk::manage(new Gtk::HSeparator()); + Gtk::Separator* const separator = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); panel->pack_start(*separator, false, false); // Add tool list widget @@ -203,7 +206,7 @@ Locallab::Locallab(): panel->pack_start(*toolpanel, false, false); // Add separator - // Gtk::HSeparator* const separator2 = Gtk::manage(new Gtk::HSeparator()); + // Gtk::Separator* const separator2 = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); // panel->pack_start(*separator2, false, false); // Add mask reset button to panel widget diff --git a/rtgui/locallab.h b/rtgui/locallab.h index 511e28c03..1c3c06167 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -40,7 +40,7 @@ public: /* ==== LocallabToolList ==== */ class LocallabToolList: - public Gtk::VBox + public Gtk::Box { private: // Tree model to manage ComboBox rows diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index ade34c754..97ddfe924 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -132,7 +132,7 @@ LocallabTool::LocallabTool(Gtk::Box* content, Glib::ustring toolName, Glib::ustr complexity(Gtk::manage(new MyComboBoxText())) { // Create expander title bar - Gtk::HBox* const titleBox = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const titleBox = Gtk::manage(new Gtk::Box()); Gtk::Label* const titleLabel = Gtk::manage(new Gtk::Label()); titleLabel->set_markup(Glib::ustring("") + escapeHtmlChars(UILabel) + Glib::ustring("")); titleLabel->set_alignment(Gtk::ALIGN_START, Gtk::ALIGN_CENTER); @@ -156,7 +156,7 @@ LocallabTool::LocallabTool(Gtk::Box* content, Glib::ustring toolName, Glib::ustr titleBox->pack_end(*complexity, Gtk::PACK_SHRINK, 2); } - Gtk::VSeparator* const separator = Gtk::manage(new Gtk::VSeparator()); + Gtk::Separator* const separator = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)); titleBox->pack_end(*separator, Gtk::PACK_SHRINK, 0); if (need100Percent) { @@ -499,6 +499,9 @@ LocallabColor::LocallabColor(): LLmaskcolshapewav(static_cast(mask2CurveEditorGwav->addCurve(CT_Flat, "L(L)", nullptr, false, false))), csThresholdcol(Gtk::manage(new ThresholdAdjuster(M("TP_LOCALLAB_CSTHRESHOLDBLUR"), 0, 9, 0, 0, 6, 5, 0, false))) { + + set_orientation(Gtk::ORIENTATION_VERTICAL); + float R, G, B; std::vector six_shape; @@ -821,7 +824,7 @@ LocallabColor::LocallabColor(): expgradcol->add(*gradcolBox, false); pack_start(*expgradcol, false, false); ToolParamBlock* const curvBox = Gtk::manage(new ToolParamBlock()); - Gtk::HBox* const qualcurvbox = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const qualcurvbox = Gtk::manage(new Gtk::Box()); qualcurvbox->pack_start(*labqualcurv, Gtk::PACK_SHRINK, 4); qualcurvbox->pack_start(*qualitycurveMethod); curvBox->pack_start(*qualcurvbox); @@ -839,7 +842,7 @@ LocallabColor::LocallabColor(): Gtk::Frame* const merge1colFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_MERGE1COLFRA"))); merge1colFrame->set_label_align(0.025, 0.5); ToolParamBlock* const mergecolBox = Gtk::manage(new ToolParamBlock()); - Gtk::HSeparator* const separatormer = Gtk::manage(new Gtk::HSeparator()); + Gtk::Separator* const separatormer = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); mergecolBox->pack_start(*separatormer, Gtk::PACK_SHRINK, 2); mergecolBox->pack_start(*mergecolMethod); mergecolBox->pack_start(*mercol); @@ -2530,6 +2533,8 @@ LocallabExposure::LocallabExposure(): mask2expCurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_MASK2"))), Lmaskexpshape(static_cast(mask2expCurveEditorG->addCurve(CT_Diagonal, "L(L)"))) { + set_orientation(Gtk::ORIENTATION_VERTICAL); + const LocallabParams::LocallabSpot defSpot; // Parameter Exposure specific widgets @@ -2687,7 +2692,7 @@ LocallabExposure::LocallabExposure(): pdeBox->pack_start(*linear); pdeBox->pack_start(*balanexp); pdeBox->pack_start(*gamm); - Gtk::HBox* const ctboxexpmethod = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const ctboxexpmethod = Gtk::manage(new Gtk::Box()); // Gtk::Label* const labelexpmethod = Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_NOISEMETH") + ":")); ctboxexpmethod->pack_start(*labelexpmethod, Gtk::PACK_SHRINK, 4); ctboxexpmethod->pack_start(*exnoiseMethod); @@ -3819,6 +3824,8 @@ LocallabShadow::LocallabShadow(): fatamountSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_FATAMOUNT"), 1., 100., 1., 1.))), fatanchorSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_FATANCHOR"), 1., 100., 1., 50., Gtk::manage(new RTImage("circle-black-small.png")), Gtk::manage(new RTImage("circle-white-small.png"))))) { + set_orientation(Gtk::ORIENTATION_VERTICAL); + const LocallabParams::LocallabSpot defSpot; // Parameter Shadow highlight specific widgets @@ -4888,6 +4895,8 @@ LocallabVibrance::LocallabVibrance(): mask2vibCurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_MASK2"))), Lmaskvibshape(static_cast(mask2vibCurveEditorG->addCurve(CT_Diagonal, "L(L)"))) { + set_orientation(Gtk::ORIENTATION_VERTICAL); + float R, G, B; const LocallabParams::LocallabSpot defSpot; @@ -5811,12 +5820,14 @@ LocallabSoft::LocallabSoft(): // Soft light specific widgets softMethod(Gtk::manage(new MyComboBoxText())), - ctboxsoftmethod(Gtk::manage(new Gtk::HBox())), + ctboxsoftmethod(Gtk::manage(new Gtk::Box())), showmasksoftMethod(Gtk::manage(new MyComboBoxText())), streng(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRENG"), 1, 100, 1, 1))), laplace(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LAPLACE"), 0., 100., 0.5, 25.))), sensisf(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 1, 100, 1, 30))) { + set_orientation(Gtk::ORIENTATION_VERTICAL); + // Parameter Soft light specific widgets softMethod->append(M("TP_LOCALLAB_SOFTM")); softMethod->append(M("TP_LOCALLAB_RETIM")); @@ -6291,9 +6302,11 @@ LocallabBlur::LocallabBlur(): Lmaskblshape(static_cast(mask2blCurveEditorG->addCurve(CT_Diagonal, "L(L)"))), mask2blCurveEditorGwav(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_WAVMASK"))), LLmaskblshapewav(static_cast(mask2blCurveEditorGwav->addCurve(CT_Flat, "L(L)", nullptr, false, false))), - quaHBox(Gtk::manage(new Gtk::HBox())), + quaHBox(Gtk::manage(new Gtk::Box())), csThresholdblur(Gtk::manage(new ThresholdAdjuster(M("TP_LOCALLAB_CSTHRESHOLDBLUR"), 0, 9, 0, 0, 6, 5, 0, false))) { + set_orientation(Gtk::ORIENTATION_VERTICAL); + const LocallabParams::LocallabSpot defSpot; // Parameter Blur, Noise & Denoise specific widgets @@ -6629,7 +6642,7 @@ LocallabBlur::LocallabBlur(): maskblBox->pack_start(*maskblCurveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor maskblBox->pack_start(*strumaskbl, Gtk::PACK_SHRINK, 0); maskblBox->pack_start(*toolbl, Gtk::PACK_SHRINK, 0); - Gtk::HSeparator* const separatorstrubl = Gtk::manage(new Gtk::HSeparator()); + Gtk::Separator* const separatorstrubl = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); maskblBox->pack_start(*separatorstrubl, Gtk::PACK_SHRINK, 2); maskblBox->pack_start(*blendmaskbl, Gtk::PACK_SHRINK, 0); toolblFrame->set_label_align(0.025, 0.5); diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index 6319cf1af..a86626e74 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -170,7 +170,7 @@ private: /* ==== LocallabColor ==== */ class LocallabColor: - public Gtk::VBox, + public Gtk::Box, public LocallabTool, public ThresholdAdjusterListener { @@ -321,7 +321,7 @@ private: /* ==== LocallabExposure ==== */ class LocallabExposure: - public Gtk::VBox, + public Gtk::Box, public LocallabTool { private: @@ -433,7 +433,7 @@ private: /* ==== LocallabShadow ==== */ class LocallabShadow: - public Gtk::VBox, + public Gtk::Box, public LocallabTool { private: @@ -523,7 +523,7 @@ private: /* ==== LocallabVibrance ==== */ class LocallabVibrance: - public Gtk::VBox, + public Gtk::Box, public LocallabTool, public ThresholdAdjusterListener, public ThresholdCurveProvider @@ -615,13 +615,13 @@ private: /* ==== LocallabSoft ==== */ class LocallabSoft: - public Gtk::VBox, + public Gtk::Box, public LocallabTool { private: // Soft light specific widgets MyComboBoxText* const softMethod; - Gtk::HBox* const ctboxsoftmethod; + Gtk::Box* const ctboxsoftmethod; MyComboBoxText* const showmasksoftMethod; Adjuster* const streng; Adjuster* const laplace; @@ -661,7 +661,7 @@ private: /* ==== LocallabBlur ==== */ class LocallabBlur: - public Gtk::VBox, + public Gtk::Box, public LocallabTool, public ThresholdAdjusterListener // public ThresholdCurveProvider @@ -764,7 +764,7 @@ private: DiagonalCurveEditor* const Lmaskblshape; CurveEditorGroup* const mask2blCurveEditorGwav; FlatCurveEditor* const LLmaskblshapewav; - Gtk::HBox* const quaHBox; + Gtk::Box* const quaHBox; ThresholdAdjuster* const csThresholdblur; sigc::connection blMethodConn, fftwblConn, invblConn, medMethodConn, blurMethodConn, chroMethodConn, activlumConn, showmaskblMethodConn, showmaskblMethodtypConn, enablMaskConn, toolblConn; @@ -824,7 +824,7 @@ private: /* ==== LocallabTone ==== */ class LocallabTone: - public Gtk::VBox, + public Gtk::Box, public LocallabTool { private: @@ -900,7 +900,7 @@ private: /* ==== LocallabRetinex ==== */ class LocallabRetinex: - public Gtk::VBox, + public Gtk::Box, public LocallabTool { private: @@ -1007,7 +1007,7 @@ private: /* ==== LocallabSharp ==== */ class LocallabSharp: - public Gtk::VBox, + public Gtk::Box, public LocallabTool { private: @@ -1052,7 +1052,7 @@ private: /* ==== LocallabContrast ==== */ class LocallabContrast: - public Gtk::VBox, + public Gtk::Box, public LocallabTool, public ThresholdAdjusterListener @@ -1209,7 +1209,7 @@ private: /* ==== LocallabCBDL ==== */ class LocallabCBDL: - public Gtk::VBox, + public Gtk::Box, public LocallabTool { private: @@ -1289,7 +1289,7 @@ private: /* ==== LocallabLog ==== */ class LocallabLog: - public Gtk::VBox, + public Gtk::Box, public LocallabTool { private: @@ -1305,7 +1305,7 @@ private: Adjuster* const sourceGray; Adjuster* const sourceabs; MyComboBoxText* const sursour; - Gtk::HBox* const surHBox; + Gtk::Box* const surHBox; Gtk::Frame* const log1Frame; Gtk::Frame* const log2Frame; Adjuster* const targetGray; @@ -1322,7 +1322,7 @@ private: DiagonalCurveEditor* const LshapeL; Adjuster* const targabs; MyComboBoxText* const surround; - Gtk::HBox* const surrHBox; + Gtk::Box* const surrHBox; Adjuster* const baselog; MyExpander* const exprecovl; @@ -1398,7 +1398,7 @@ private: /* ==== LocallabMask ==== */ class LocallabMask: - public Gtk::VBox, + public Gtk::Box, public LocallabTool, public ThresholdAdjusterListener { diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index 44550e261..523b0a3af 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -152,6 +152,8 @@ LocallabTone::LocallabTone(): mask2tmCurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_MASK2"))), Lmasktmshape(static_cast(mask2tmCurveEditorG->addCurve(CT_Diagonal, "L(L)"))) { + set_orientation(Gtk::ORIENTATION_VERTICAL); + const LocallabParams::LocallabSpot defSpot; // Parameter Tone Mapping specific widgets @@ -828,6 +830,8 @@ LocallabRetinex::LocallabRetinex(): Lmaskretishape(static_cast(mask2retiCurveEditorG->addCurve(CT_Diagonal, "L(L)"))), inversret(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVERS")))) { + set_orientation(Gtk::ORIENTATION_VERTICAL); + const LocallabParams::LocallabSpot defSpot; // Parameter Retinex specific widgets @@ -1968,6 +1972,8 @@ LocallabSharp::LocallabSharp(): sharFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_SHARFRAME")))), showmasksharMethod(Gtk::manage(new MyComboBoxText())) { + set_orientation(Gtk::ORIENTATION_VERTICAL); + // Parameter Sharpening specific widgets sharcontrast->setAdjusterListener(this); @@ -2316,7 +2322,7 @@ LocallabContrast::LocallabContrast(): wavshape(static_cast(LocalcurveEditorwav->addCurve(CT_Flat, "", nullptr, false, false))), csThreshold(Gtk::manage(new ThresholdAdjuster(M("TP_LOCALLAB_CSTHRESHOLD"), 0, 9, 0, 0, 6, 6, 0, false))), levelwav(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LEVELWAV"), 1, 9, 1, 4))), - expresidpyr(Gtk::manage(new MyExpander(false, Gtk::manage(new Gtk::HBox())))), + expresidpyr(Gtk::manage(new MyExpander(false, Gtk::manage(new Gtk::Box())))), residcont(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDCONT"), -100, 100, 1, 0))), residchro(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDCHRO"), -100., 100., 1., 0.))), residsha(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDSHA"), -100., 100., 1., 0.))), @@ -2329,7 +2335,7 @@ LocallabContrast::LocallabContrast(): claricres(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CLARICRES"), -20., 100., 0.5, 0.))), clarisoft(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOFTRADIUSCOL"), 0.0, 100.0, 0.5, 1.))), origlc(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ORIGLC")))), - expcontrastpyr(Gtk::manage(new MyExpander(false, Gtk::manage(new Gtk::HBox())))), + expcontrastpyr(Gtk::manage(new MyExpander(false, Gtk::manage(new Gtk::Box())))), wavgradl(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_GRALWFRA")))), sigmalc2(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SIGMAWAV"), 0.2, 2.5, 0.01, 1.))), strwav(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADSTR"), -4.0, 4.0, 0.05, 0.))), @@ -2358,7 +2364,7 @@ LocallabContrast::LocallabContrast(): wavshapelev(static_cast(LocalcurveEditorwavlev->addCurve(CT_Flat, "", nullptr, false, false))), residblur(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDBLUR"), 0., 100., 0.5, 0.))), blurlc(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_BLURLC")))), - expcontrastpyr2(Gtk::manage(new MyExpander(false, Gtk::manage(new Gtk::HBox())))), + expcontrastpyr2(Gtk::manage(new MyExpander(false, Gtk::manage(new Gtk::Box())))), wavcont(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_CONTFRA")))), sigma(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SIGMAWAV"), 0.2, 2.5, 0.01, 1.))), offset(Gtk::manage(new Adjuster(M("TP_LOCALLAB_OFFSETWAV"), 0.33, 1.66, 0.01, 1., Gtk::manage(new RTImage("circle-black-small.png")), Gtk::manage(new RTImage("circle-white-small.png"))))), @@ -2399,6 +2405,8 @@ LocallabContrast::LocallabContrast(): mask2lcCurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_MASK2"))), Lmasklcshape(static_cast(mask2lcCurveEditorG->addCurve(CT_Diagonal, "L(L)"))) { + set_orientation(Gtk::ORIENTATION_VERTICAL); + const LocallabParams::LocallabSpot defSpot; // Parameter Local contrast specific widgets @@ -2431,7 +2439,7 @@ LocallabContrast::LocallabContrast(): levelwav->setAdjusterListener(this); - Gtk::HBox* const LresTitleHBox = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const LresTitleHBox = Gtk::manage(new Gtk::Box()); Gtk::Label* const LresLabel = Gtk::manage(new Gtk::Label()); LresLabel->set_markup(Glib::ustring("") + escapeHtmlChars(M("TP_LOCALLAB_LOC_RESIDPYR")) + Glib::ustring("")); LresLabel->set_alignment(Gtk::ALIGN_START, Gtk::ALIGN_CENTER); @@ -2464,7 +2472,7 @@ LocallabContrast::LocallabContrast(): origlcConn = origlc->signal_toggled().connect(sigc::mem_fun(*this, &LocallabContrast::origlcChanged)); - Gtk::HBox* const LCTitleHBox = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const LCTitleHBox = Gtk::manage(new Gtk::Box()); Gtk::Label* const LCLabel = Gtk::manage(new Gtk::Label()); LCLabel->set_markup(Glib::ustring("") + escapeHtmlChars(M("TP_LOCALLAB_LOC_CONTRASTPYR")) + Glib::ustring("") + escapeHtmlChars(M("TP_LOCALLAB_LOC_CONTRASTPYRLAB"))); LCLabel->set_alignment(Gtk::ALIGN_START, Gtk::ALIGN_CENTER); @@ -2541,7 +2549,7 @@ LocallabContrast::LocallabContrast(): blurlcConn = blurlc->signal_toggled().connect(sigc::mem_fun(*this, &LocallabContrast::blurlcChanged)); - Gtk::HBox* const LCTitleHBox2 = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const LCTitleHBox2 = Gtk::manage(new Gtk::Box()); Gtk::Label* const LCLabel2 = Gtk::manage(new Gtk::Label()); LCLabel2->set_markup(Glib::ustring("") + escapeHtmlChars(M("TP_LOCALLAB_LOC_CONTRASTPYR2")) + Glib::ustring("") + escapeHtmlChars(M("TP_LOCALLAB_LOC_CONTRASTPYR2LAB"))); LCLabel2->set_alignment(Gtk::ALIGN_START, Gtk::ALIGN_CENTER); @@ -2679,7 +2687,7 @@ LocallabContrast::LocallabContrast(): expresidpyr->add(*resiBox, false); pack_start(*expresidpyr); // pack_start(*sensilc); - Gtk::HSeparator* const separatorcontr = Gtk::manage(new Gtk::HSeparator()); + Gtk::Separator* const separatorcontr = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); pack_start(*separatorcontr); ToolParamBlock* const clariBox = Gtk::manage(new ToolParamBlock()); clariBox->pack_start(*clarilres); @@ -2709,20 +2717,20 @@ LocallabContrast::LocallabContrast(): edgsBox->pack_start(*waveshow); edgsBoxshow->pack_start(*radiusw); edgsBoxshow->pack_start(*detailw); - Gtk::HBox* const edbox = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const edbox = Gtk::manage(new Gtk::Box()); Gtk::Label* const labmedgr = Gtk::manage(new Gtk::Label(M("TP_WAVELET_MEDGREINF") + ":")); edbox->pack_start(*labmedgr, Gtk::PACK_SHRINK, 1); edbox->pack_start(*localedgMethod); edgsBoxshow->pack_start(*edbox); - Gtk::HSeparator* const separatoredg2 = Gtk::manage(new Gtk::HSeparator()); + Gtk::Separator* const separatoredg2 = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); edgsBoxshow->pack_start(*separatoredg2); edgsBoxshow->pack_start(*tloww); edgsBoxshow->pack_start(*thigw); - Gtk::HSeparator* const separatoredg = Gtk::manage(new Gtk::HSeparator()); + Gtk::Separator* const separatoredg = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); edgsBoxshow->pack_start(*separatoredg); edgsBoxshow->pack_start(*edgw); edgsBoxshow->pack_start(*basew); - Gtk::HBox* const ctboxNP = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const ctboxNP = Gtk::manage(new Gtk::Box()); Gtk::Label* const labmNP = Gtk::manage(new Gtk::Label(M("TP_WAVELET_NPTYPE") + ":")); ctboxNP->pack_start(*labmNP, Gtk::PACK_SHRINK, 1); ctboxNP->pack_start(*localneiMethod); @@ -2733,13 +2741,13 @@ LocallabContrast::LocallabContrast(): Gtk::Frame* const blurlevelFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_BLURLEVELFRA"))); blurlevelFrame->set_label_align(0.025, 0.5); blurlevelFrame->set_label_widget(*wavblur); - Gtk::VBox* const blurlevcontBox = Gtk::manage(new Gtk::VBox()); + Gtk::Box* const blurlevcontBox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); blurlevcontBox->set_spacing(2); blurlevcontBox->pack_start(*levelblur); blurlevcontBox->pack_start(*sigmabl); blurlevcontBox->pack_start(*chromablu); blurlevcontBox->pack_start(*LocalcurveEditorwavlev, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - Gtk::HSeparator* const separatorblu = Gtk::manage(new Gtk::HSeparator()); + Gtk::Separator* const separatorblu = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); blurlevcontBox->pack_start(*separatorblu); blurlevcontBox->pack_start(*residblur); blurlevcontBox->pack_start(*blurlc); @@ -2751,7 +2759,7 @@ LocallabContrast::LocallabContrast(): Gtk::Frame* const contFrame2 = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_CONTFRA"))); contFrame2->set_label_align(0.025, 0.5); contFrame2->set_label_widget(*wavcont); - Gtk::VBox* const contlevBox = Gtk::manage(new Gtk::VBox()); + Gtk::Box* const contlevBox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); contlevBox->set_spacing(2); contlevBox->pack_start(*sigma); contlevBox->pack_start(*offset); @@ -2762,7 +2770,7 @@ LocallabContrast::LocallabContrast(): Gtk::Frame* const compreFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_COMPREFRA"))); compreFrame->set_label_align(0.025, 0.5); compreFrame->set_label_widget(*wavcompre); - Gtk::VBox* const compreBox = Gtk::manage(new Gtk::VBox()); + Gtk::Box* const compreBox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); compreBox->set_spacing(2); compreBox->pack_start(*LocalcurveEditorwavcompre, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor compreBox->pack_start(*sigmadr); @@ -2773,12 +2781,12 @@ LocallabContrast::LocallabContrast(): Gtk::Frame* const compFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_COMPFRA"))); compFrame->set_label_align(0.025, 0.5); compFrame->set_label_widget(*wavcomp); - Gtk::VBox* const compBox = Gtk::manage(new Gtk::VBox()); + Gtk::Box* const compBox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); compBox->set_spacing(2); compBox->pack_start(*sigmadc); compBox->pack_start(*deltad); compBox->pack_start(*LocalcurveEditorwavcomp, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor - // Gtk::HSeparator* const separatorcomp = Gtk::manage(new Gtk::HSeparator()); + // Gtk::Separator* const separatorcomp = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); // compBox->pack_start(*separatorcomp); // compBox->pack_start(*fatres); compFrame->add(*compBox); @@ -4325,6 +4333,8 @@ LocallabCBDL::LocallabCBDL(): lumaneutralButton(Gtk::manage(new Gtk::Button(M("TP_DIRPYREQUALIZER_LUMANEUTRAL")))), lumacontrastPlusButton(Gtk::manage(new Gtk::Button(M("TP_DIRPYREQUALIZER_LUMACONTRAST_PLUS")))) { + set_orientation(Gtk::ORIENTATION_VERTICAL); + const LocallabParams::LocallabSpot defSpot; // Parameter CBDL specific widgets @@ -4408,7 +4418,9 @@ LocallabCBDL::LocallabCBDL(): // Add CBDL specific widgets to GUI ToolParamBlock* const levBox = Gtk::manage(new ToolParamBlock()); - Gtk::HBox* buttonBox = Gtk::manage(new Gtk::HBox(true, 10)); + Gtk::Box* buttonBox = Gtk::manage(new Gtk::Box()); + buttonBox->set_spacing(10); + buttonBox->set_homogeneous(true); buttonBox->pack_start(*lumacontrastMinusButton); buttonBox->pack_start(*lumaneutralButton); buttonBox->pack_start(*lumacontrastPlusButton); @@ -4418,7 +4430,7 @@ LocallabCBDL::LocallabCBDL(): levBox->pack_start(*adj); } - Gtk::HSeparator* const separator = Gtk::manage(new Gtk::HSeparator()); + Gtk::Separator* const separator = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); levBox->pack_start(*separator, Gtk::PACK_SHRINK, 2); levBox->pack_start(*chromacbdl); levBox->pack_start(*threshold); @@ -5077,7 +5089,7 @@ LocallabLog::LocallabLog(): sourceGray(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOURCE_GRAY"), 1.0, 100.0, 0.1, 10.0))), sourceabs(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOURCE_ABS"), 0.01, 16384.0, 0.01, 2000.0))), sursour(Gtk::manage (new MyComboBoxText ())), - surHBox(Gtk::manage(new Gtk::HBox())), + surHBox(Gtk::manage(new Gtk::Box())), log1Frame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LOG1FRA")))), log2Frame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LOG2FRA")))), targetGray(Gtk::manage(new Adjuster(M("TP_LOCALLAB_TARGET_GRAY"), 5.0, 80.0, 0.1, 18.0))), @@ -5094,7 +5106,7 @@ LocallabLog::LocallabLog(): LshapeL(static_cast(CurveEditorL->addCurve(CT_Diagonal, "Q(Q)"))), targabs(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOURCE_ABS"), 0.01, 16384.0, 0.01, 16.0))), surround(Gtk::manage (new MyComboBoxText ())), - surrHBox(Gtk::manage(new Gtk::HBox())), + surrHBox(Gtk::manage(new Gtk::Box())), baselog(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BASELOG"), 1.3, 3., 0.05, 2.))),//, Gtk::manage(new RTImage("circle-black-small.png")), Gtk::manage(new RTImage("circle-white-small.png"))))), exprecovl(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI2_EXP")))), maskusablel(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUSABLE")))), @@ -5123,6 +5135,8 @@ LocallabLog::LocallabLog(): { + set_orientation(Gtk::ORIENTATION_VERTICAL); + // Parameter Log encoding specific widgets autoconn = autocompute->signal_toggled().connect(sigc::mem_fun(*this, &LocallabLog::autocomputeToggled)); const LocallabParams::LocallabSpot defSpot; @@ -5202,7 +5216,6 @@ LocallabLog::LocallabLog(): -// Gtk::HBox* surrHBox = Gtk::manage (new Gtk::HBox ()); surrHBox->set_spacing (2); surrHBox->set_tooltip_markup (M ("TP_COLORAPP_SURROUND_TOOLTIP")); Gtk::Label* surrLabel = Gtk::manage (new Gtk::Label (M ("TP_COLORAPP_SURROUND") + ":")); @@ -6378,6 +6391,9 @@ LocallabMask::LocallabMask(): str_mask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADSTR"), -2., 2., 0.05, 0.))), ang_mask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADANG"), -180., 180., 0.1, 0.))) { + + set_orientation(Gtk::ORIENTATION_VERTICAL); + const LocallabParams::LocallabSpot defSpot; // Parameter Mask common specific widgets diff --git a/rtgui/metadatapanel.cc b/rtgui/metadatapanel.cc index f92152763..e26444ccc 100644 --- a/rtgui/metadatapanel.cc +++ b/rtgui/metadatapanel.cc @@ -28,8 +28,9 @@ using namespace rtengine::procparams; MetaDataPanel::MetaDataPanel() : EvMetaDataMode(ProcEventMapper::getInstance()->newEvent(M_VOID, "HISTORY_MSG_METADATA_MODE")) { + set_orientation(Gtk::ORIENTATION_VERTICAL); - Gtk::HBox *box = Gtk::manage(new Gtk::HBox()); + Gtk::Box *box = Gtk::manage(new Gtk::Box()); box->pack_start(*Gtk::manage(new Gtk::Label(M("TP_METADATA_MODE") + ": ")), Gtk::PACK_SHRINK, 4); metadataMode = Gtk::manage(new MyComboBoxText()); metadataMode->append(M("TP_METADATA_TUNNEL")); diff --git a/rtgui/metadatapanel.h b/rtgui/metadatapanel.h index b39ffd2c1..bc74ac484 100644 --- a/rtgui/metadatapanel.h +++ b/rtgui/metadatapanel.h @@ -24,7 +24,7 @@ #include "exifpanel.h" #include "iptcpanel.h" -class MetaDataPanel: public Gtk::VBox, public ToolPanel { +class MetaDataPanel: public Gtk::Box, public ToolPanel { private: rtengine::ProcEvent EvMetaDataMode; MyComboBoxText *metadataMode; diff --git a/rtgui/navigator.cc b/rtgui/navigator.cc index 71e7e3d1d..bca024a16 100644 --- a/rtgui/navigator.cc +++ b/rtgui/navigator.cc @@ -73,7 +73,7 @@ Navigator::Navigator() : set_label (M("MAIN_MSG_NAVIGATOR")); set_name("Navigator"); - Gtk::VBox* mbox = Gtk::manage (new Gtk::VBox ()); + Gtk::Box* mbox = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); previewWindow = Gtk::manage (new PreviewWindow ()); mbox->pack_start (*previewWindow, Gtk::PACK_SHRINK, 2); dimension = Gtk::manage (new Gtk::Label ()); @@ -102,6 +102,17 @@ Navigator::Navigator() : lLAB_A->set_alignment(Gtk::ALIGN_START); lLAB_B->set_alignment(Gtk::ALIGN_START); lLAB_L->set_alignment(Gtk::ALIGN_START); + + // expand labels + lR->set_hexpand(); + lG->set_hexpand(); + lB->set_hexpand(); + lH->set_hexpand(); + lS->set_hexpand(); + lV->set_hexpand(); + lLAB_A->set_hexpand(); + lLAB_B->set_hexpand(); + lLAB_L->set_hexpand(); //values R = Gtk::manage (new Gtk::Label ()); @@ -172,70 +183,64 @@ Navigator::Navigator() : */ // setup the tables - Gtk::Table* table0 = Gtk::manage (new Gtk::Table (1, 3)); //rows, cols The main table container + Gtk::Grid* table0 = Gtk::manage (new Gtk::Grid()); //rows, cols The main table container // let's pack tables1,2-3 into table0 // RGB Gtk::EventBox *evBox1 = Gtk::manage (new Gtk::EventBox()); - Gtk::HBox* hbox1 = Gtk::manage (new Gtk::HBox ()); // container - Gtk::Table* table1 = Gtk::manage (new Gtk::Table (3, 2)); - - table1->attach (*lR, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 4, 0); - table1->attach (*R, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 0, 0); - - table1->attach (*lG, 0, 1, 1, 2, Gtk::SHRINK, Gtk::SHRINK, 4, 0); - table1->attach (*G, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 0, 0); - - table1->attach (*lB, 0, 1, 2, 3, Gtk::SHRINK, Gtk::SHRINK, 4, 0); - table1->attach (*B, 1, 2, 2, 3, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 0, 0); + Gtk::Box* hbox1 = Gtk::manage (new Gtk::Box ()); + Gtk::Grid* table1 = Gtk::manage (new Gtk::Grid()); + + table1->attach(*lR, 0, 0); + table1->attach(*R, 1, 0); + table1->attach(*lG, 0, 1); + table1->attach(*G, 1, 1); + table1->attach(*lB, 0, 2); + table1->attach(*B, 1, 2); evBox1->add (*table1); evBox1->signal_button_release_event().connect_notify( sigc::mem_fun(*this, &Navigator::cycleUnitsRGB)); hbox1->pack_start (*evBox1, Gtk::PACK_EXPAND_WIDGET, 4); - hbox1->pack_start (*Gtk::manage (new Gtk::VSeparator()), Gtk::PACK_SHRINK, 4); - table0->attach (*hbox1, 0, 1, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 0, 0); + hbox1->pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)), Gtk::PACK_SHRINK, 4); + table0->attach(*hbox1, 0, 0); // HSV Gtk::EventBox *evBox2 = Gtk::manage (new Gtk::EventBox()); - Gtk::HBox* hbox2 = Gtk::manage (new Gtk::HBox ()); // container - Gtk::Table* table2 = Gtk::manage (new Gtk::Table (3, 2)); + Gtk::Box* hbox2 = Gtk::manage (new Gtk::Box ()); + Gtk::Grid* table2 = Gtk::manage (new Gtk::Grid()); - table2->attach (*lH, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 4, 0); - table2->attach (*H, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 0, 0); - - table2->attach (*lS, 0, 1, 1, 2, Gtk::SHRINK, Gtk::SHRINK, 4, 0); - table2->attach (*S, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 0, 0); - - table2->attach (*lV, 0, 1, 2, 3, Gtk::SHRINK, Gtk::SHRINK, 4, 0); - table2->attach (*V, 1, 2, 2, 3, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 0, 0); + table2->attach(*lH, 0, 0); + table2->attach(*H, 1, 0); + table2->attach(*lS, 0, 1); + table2->attach(*S, 1, 1); + table2->attach(*lV, 0, 2); + table2->attach(*V, 1, 2); evBox2->add (*table2); evBox2->signal_button_release_event().connect_notify( sigc::mem_fun(*this, &Navigator::cycleUnitsHSV)); hbox2->pack_start (*evBox2, Gtk::PACK_EXPAND_WIDGET, 4); - hbox2->pack_start (*Gtk::manage (new Gtk::VSeparator()), Gtk::PACK_SHRINK, 4); - table0->attach (*hbox2, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 0, 0); + hbox2->pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)), Gtk::PACK_SHRINK, 4); + table0->attach(*hbox2, 1, 0); // LAB - Gtk::HBox* hbox3 = Gtk::manage (new Gtk::HBox ()); // container - Gtk::Table* table3 = Gtk::manage (new Gtk::Table (3, 2)); + Gtk::Box* hbox3 = Gtk::manage (new Gtk::Box ()); + Gtk::Grid* table3 = Gtk::manage (new Gtk::Grid()); - table3->attach (*lLAB_L, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 4, 0); - table3->attach (*LAB_L, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 0, 0); - - table3->attach (*lLAB_A, 0, 1, 1, 2, Gtk::SHRINK, Gtk::SHRINK, 4, 0); - table3->attach (*LAB_A, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 0, 0); - - table3->attach (*lLAB_B, 0, 1, 2, 3, Gtk::SHRINK, Gtk::SHRINK, 4, 0); - table3->attach (*LAB_B, 1, 2, 2, 3, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 0, 0); + table3->attach(*lLAB_L, 0, 0); + table3->attach(*LAB_L, 1, 0); + table3->attach(*lLAB_A, 0, 1); + table3->attach(*LAB_A, 1, 1); + table3->attach(*lLAB_B, 0, 2); + table3->attach(*LAB_B, 1, 2); hbox3->pack_start (*table3, Gtk::PACK_EXPAND_WIDGET, 4); - hbox3->pack_start (*Gtk::manage (new Gtk::HBox()), Gtk::PACK_SHRINK, 2); - table0->attach (*hbox3, 2, 3, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 0, 0); + hbox3->pack_start (*Gtk::manage (new Gtk::Box()), Gtk::PACK_SHRINK, 2); + table0->attach(*hbox3, 2, 0); - table0->set_homogeneous(true); // all cells will be the same size as the largest cell. + table0->set_column_homogeneous(true); // all cells will have equal width mbox->pack_start (*table0, Gtk::PACK_EXPAND_WIDGET, 2); add (*mbox); diff --git a/rtgui/partialpastedlg.cc b/rtgui/partialpastedlg.cc index 83a3b7cc0..c759bcd44 100644 --- a/rtgui/partialpastedlg.cc +++ b/rtgui/partialpastedlg.cc @@ -35,6 +35,9 @@ PartialSpotWidget::PartialSpotWidget(): // Widget listener selListener(nullptr) { + + set_orientation(Gtk::ORIENTATION_VERTICAL); + // Configure tree view treeview->set_model(treemodel); treeview->set_enable_search(false); @@ -311,13 +314,13 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren //--- raw_preprocwb = Gtk::manage (new Gtk::CheckButton (M("PARTIALPASTE_PREPROCWB"))); - Gtk::VBox* vboxes[9]; - Gtk::HSeparator* hseps[9]; + Gtk::Box* vboxes[9]; + Gtk::Separator* hseps[9]; for (int i = 0; i < 9; i++) { - vboxes[i] = Gtk::manage (new Gtk::VBox ()); + vboxes[i] = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); vboxes[i]->set_name("PartialPasteGroupContainer"); - hseps[i] = Gtk::manage (new Gtk::HSeparator ()); + hseps[i] = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); hseps[i]->set_name("PartialPasteHeaderSep"); } @@ -402,35 +405,35 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren vboxes[8]->pack_start (*raw_dcb_iterations, Gtk::PACK_SHRINK, 2); vboxes[8]->pack_start (*raw_dcb_enhance, Gtk::PACK_SHRINK, 2); vboxes[8]->pack_start (*raw_lmmse_iterations, Gtk::PACK_SHRINK, 2); - vboxes[8]->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 0); + vboxes[8]->pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)), Gtk::PACK_SHRINK, 0); vboxes[8]->pack_start (*raw_linenoise, Gtk::PACK_SHRINK, 2); vboxes[8]->pack_start (*raw_greenthresh, Gtk::PACK_SHRINK, 2); vboxes[8]->pack_start (*raw_hotpix_filt, Gtk::PACK_SHRINK, 2); vboxes[8]->pack_start (*raw_deadpix_filt, Gtk::PACK_SHRINK, 2); vboxes[8]->pack_start (*raw_pdaf_lines_filter, Gtk::PACK_SHRINK, 2); - vboxes[8]->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 0); + vboxes[8]->pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)), Gtk::PACK_SHRINK, 0); vboxes[8]->pack_start (*raw_expos, Gtk::PACK_SHRINK, 2); vboxes[8]->pack_start (*raw_black, Gtk::PACK_SHRINK, 2); vboxes[8]->pack_start (*raw_preprocwb, Gtk::PACK_SHRINK, 2); - vboxes[8]->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 0); + vboxes[8]->pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)), Gtk::PACK_SHRINK, 0); vboxes[8]->pack_start (*df_file, Gtk::PACK_SHRINK, 2); vboxes[8]->pack_start (*df_AutoSelect, Gtk::PACK_SHRINK, 2); - vboxes[8]->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 0); + vboxes[8]->pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)), Gtk::PACK_SHRINK, 0); vboxes[8]->pack_start (*ff_file, Gtk::PACK_SHRINK, 2); vboxes[8]->pack_start (*ff_AutoSelect, Gtk::PACK_SHRINK, 2); vboxes[8]->pack_start (*ff_BlurType, Gtk::PACK_SHRINK, 2); vboxes[8]->pack_start (*ff_BlurRadius, Gtk::PACK_SHRINK, 2); vboxes[8]->pack_start (*ff_ClipControl, Gtk::PACK_SHRINK, 2); - vboxes[8]->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 0); + vboxes[8]->pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)), Gtk::PACK_SHRINK, 0); vboxes[8]->pack_start (*raw_ca_autocorrect, Gtk::PACK_SHRINK, 2); vboxes[8]->pack_start (*raw_caredblue, Gtk::PACK_SHRINK, 2); vboxes[8]->pack_start (*raw_ca_avoid_colourshift, Gtk::PACK_SHRINK, 2); - vboxes[8]->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 0); + vboxes[8]->pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)), Gtk::PACK_SHRINK, 0); vboxes[8]->pack_start (*captureSharpening, Gtk::PACK_SHRINK, 2); - Gtk::VBox* vbCol1 = Gtk::manage (new Gtk::VBox ()); - Gtk::VBox* vbCol2 = Gtk::manage (new Gtk::VBox ()); - Gtk::VBox* vbCol3 = Gtk::manage (new Gtk::VBox ()); + Gtk::Box* vbCol1 = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); + Gtk::Box* vbCol2 = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); + Gtk::Box* vbCol3 = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); for (int i = 0; i < 3; i++) { vbCol1->pack_start (*vboxes[i], Gtk::PACK_SHRINK, 2); @@ -444,18 +447,18 @@ PartialPasteDlg::PartialPasteDlg (const Glib::ustring &title, Gtk::Window* paren vbCol3->pack_start (*vboxes[i], Gtk::PACK_SHRINK, 2); } - Gtk::VBox* vbtop = Gtk::manage (new Gtk::VBox ()); + Gtk::Box* vbtop = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); vbtop->pack_start (*everything, Gtk::PACK_SHRINK, 2); Gtk::Dialog::get_content_area()->pack_start (*vbtop, Gtk::PACK_SHRINK, 2); - Gtk::HBox* hbmain = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* hbmain = Gtk::manage (new Gtk::Box ()); hbmain->pack_start (*vbCol1); - Gtk::VSeparator *vsep1 = Gtk::manage (new Gtk::VSeparator ()); + Gtk::Separator *vsep1 = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)); setExpandAlignProperties(vsep1, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL); hbmain->pack_start (*vsep1); hbmain->pack_start (*vbCol2); - Gtk::VSeparator *vsep2 = Gtk::manage (new Gtk::VSeparator ()); + Gtk::Separator *vsep2 = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)); setExpandAlignProperties(vsep2, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL); hbmain->pack_start (*vsep2); hbmain->pack_start (*vbCol3); diff --git a/rtgui/partialpastedlg.h b/rtgui/partialpastedlg.h index 94bc2868c..c61408df7 100644 --- a/rtgui/partialpastedlg.h +++ b/rtgui/partialpastedlg.h @@ -54,7 +54,7 @@ public: /* ==== PartialSpotWidget ==== */ class PartialSpotWidget: - public Gtk::VBox + public Gtk::Box { private: // Tree model to manage spot selection widget diff --git a/rtgui/pdsharpening.cc b/rtgui/pdsharpening.cc index 1b98fd3ac..45d5b545c 100644 --- a/rtgui/pdsharpening.cc +++ b/rtgui/pdsharpening.cc @@ -45,7 +45,7 @@ PdSharpening::PdSharpening() : EvPdShrAutoContrast = m->newEvent(CAPTURESHARPEN, "HISTORY_MSG_PDSHARPEN_AUTO_CONTRAST"); EvPdShrAutoRadius = m->newEvent(CAPTURESHARPEN, "HISTORY_MSG_PDSHARPEN_AUTO_RADIUS"); - Gtk::HBox* hb = Gtk::manage(new Gtk::HBox()); + Gtk::Box* hb = Gtk::manage(new Gtk::Box()); hb->show(); contrast = Gtk::manage(new Adjuster(M("TP_SHARPENING_CONTRAST"), 0, 200, 1, 10)); contrast->setAdjusterListener(this); @@ -57,7 +57,7 @@ PdSharpening::PdSharpening() : pack_start(*hb); - Gtk::VBox* rld = Gtk::manage(new Gtk::VBox()); + Gtk::Box* rld = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); dradius = Gtk::manage(new Adjuster(M("TP_SHARPENING_RADIUS"), 0.4, 2.0, 0.01, 0.75)); dradius->addAutoButton(); dradius->setAutoValue(true); diff --git a/rtgui/perspective.cc b/rtgui/perspective.cc index 55013ec4a..b3fabd31a 100644 --- a/rtgui/perspective.cc +++ b/rtgui/perspective.cc @@ -135,7 +135,7 @@ PerspCorrection::PerspCorrection () : FoldableToolPanel(this, "perspective", M(" Gtk::Image* ipers_rotate_left = Gtk::manage(new RTImage("rotate-right-small.png")); Gtk::Image* ipers_rotate_right = Gtk::manage(new RTImage("rotate-left-small.png")); - Gtk::HBox* method_hbox = Gtk::manage (new Gtk::HBox()); + Gtk::Box* method_hbox = Gtk::manage (new Gtk::Box()); Gtk::Label* method_label = Gtk::manage (new Gtk::Label (M("TP_PERSPECTIVE_METHOD") + ": ")); method = Gtk::manage (new MyComboBoxText ()); method->append (M("TP_PERSPECTIVE_METHOD_SIMPLE")); @@ -144,7 +144,7 @@ PerspCorrection::PerspCorrection () : FoldableToolPanel(this, "perspective", M(" method_hbox->pack_start(*method); pack_start(*method_hbox); - simple = Gtk::manage( new Gtk::VBox() ); + simple = Gtk::manage( new Gtk::Box(Gtk::ORIENTATION_VERTICAL) ); vert = Gtk::manage (new Adjuster (M("TP_PERSPECTIVE_VERTICAL"), -100, 100, 0.1, 0, ipersVL, ipersVR)); vert->setAdjusterListener (this); @@ -152,13 +152,13 @@ PerspCorrection::PerspCorrection () : FoldableToolPanel(this, "perspective", M(" horiz = Gtk::manage (new Adjuster (M("TP_PERSPECTIVE_HORIZONTAL"), -100, 100, 0.1, 0, ipersHL, ipersHR)); horiz->setAdjusterListener (this); - camera_based = Gtk::manage( new Gtk::VBox() ); + camera_based = Gtk::manage( new Gtk::Box(Gtk::ORIENTATION_VERTICAL) ); Gtk::Frame* camera_frame = Gtk::manage (new Gtk::Frame (M("TP_PERSPECTIVE_CAMERA_FRAME"))); camera_frame->set_label_align(0.025, 0.5); - Gtk::VBox* camera_vbox = Gtk::manage (new Gtk::VBox()); + Gtk::Box* camera_vbox = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); camera_focal_length = Gtk::manage (new Adjuster (M("TP_PERSPECTIVE_CAMERA_FOCAL_LENGTH"), 0.5, 2000, 0.01, 24)); camera_focal_length->setAdjusterListener (this); @@ -207,7 +207,7 @@ PerspCorrection::PerspCorrection () : FoldableToolPanel(this, "perspective", M(" lines = std::unique_ptr(new ControlLineManager()); lines->callbacks = std::make_shared(this); - Gtk::HBox* control_lines_box = Gtk::manage (new Gtk::HBox()); + Gtk::Box* control_lines_box = Gtk::manage (new Gtk::Box()); Gtk::Label* control_lines_label = Gtk::manage (new Gtk::Label (M("TP_PERSPECTIVE_CONTROL_LINES") + ": ")); control_lines_label->set_tooltip_markup( M("TP_PERSPECTIVE_CONTROL_LINES_TOOLTIP") ); control_lines_box->pack_start(*control_lines_label, Gtk::PACK_SHRINK); @@ -228,7 +228,7 @@ PerspCorrection::PerspCorrection () : FoldableToolPanel(this, "perspective", M(" auto_pitch_yaw->set_image(*ipers_auto_pitch_yaw); auto_pitch_yaw->signal_pressed().connect( sigc::bind(sigc::mem_fun(*this, &PerspCorrection::autoCorrectionPressed), auto_pitch_yaw) ); - Gtk::HBox* auto_hbox = Gtk::manage (new Gtk::HBox()); + Gtk::Box* auto_hbox = Gtk::manage (new Gtk::Box()); Gtk::Label* auto_label = Gtk::manage (new Gtk::Label (M("GENERAL_AUTO") + ": ")); auto_hbox->pack_start(*auto_label, Gtk::PACK_SHRINK); @@ -236,7 +236,7 @@ PerspCorrection::PerspCorrection () : FoldableToolPanel(this, "perspective", M(" (M("TP_PERSPECTIVE_POST_CORRECTION_ADJUSTMENT_FRAME"))); pca_frame->set_label_align(0.025, 0.5); - Gtk::VBox* pca_vbox = Gtk::manage (new Gtk::VBox()); + Gtk::Box* pca_vbox = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); projection_shift_horiz = Gtk::manage (new Adjuster (M("TP_PERSPECTIVE_PROJECTION_SHIFT_HORIZONTAL"), -100, 100, 0.01, 0)); projection_shift_horiz->setAdjusterListener (this); @@ -251,7 +251,7 @@ PerspCorrection::PerspCorrection () : FoldableToolPanel(this, "perspective", M(" (M("TP_PERSPECTIVE_RECOVERY_FRAME"))); recovery_frame->set_label_align(0.025, 0.5); - Gtk::VBox* recovery_vbox = Gtk::manage (new Gtk::VBox()); + Gtk::Box* recovery_vbox = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); projection_pitch = Gtk::manage (new Adjuster (M("TP_PERSPECTIVE_PROJECTION_PITCH"), -60, 60, 0.1, 0, ipers_proj_pitch_left, ipers_proj_pitch_right)); projection_pitch->setAdjusterListener (this); @@ -273,9 +273,9 @@ PerspCorrection::PerspCorrection () : FoldableToolPanel(this, "perspective", M(" camera_vbox->pack_start (*camera_roll); camera_vbox->pack_start (*camera_pitch); camera_vbox->pack_start (*camera_yaw); - camera_vbox->pack_start (*Gtk::manage (new Gtk::HSeparator())); + camera_vbox->pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL))); camera_vbox->pack_start (*control_lines_box); - camera_vbox->pack_start (*Gtk::manage (new Gtk::HSeparator())); + camera_vbox->pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL))); camera_vbox->pack_start (*auto_hbox); camera_frame->add(*camera_vbox); camera_based->pack_start(*camera_frame); diff --git a/rtgui/perspective.h b/rtgui/perspective.h index 6ba169b60..3c677ba6e 100644 --- a/rtgui/perspective.h +++ b/rtgui/perspective.h @@ -42,13 +42,13 @@ class PerspCorrection final : protected: bool render = true; MyComboBoxText* method; - Gtk::VBox* simple; + Gtk::Box* simple; Adjuster* horiz; Adjuster* vert; Gtk::Button* auto_pitch; Gtk::Button* auto_yaw; Gtk::Button* auto_pitch_yaw; - Gtk::VBox* camera_based; + Gtk::Box* camera_based; Adjuster* camera_crop_factor; Adjuster* camera_focal_length; Adjuster* camera_pitch; diff --git a/rtgui/placesbrowser.cc b/rtgui/placesbrowser.cc index f1450cea2..3440080f8 100644 --- a/rtgui/placesbrowser.cc +++ b/rtgui/placesbrowser.cc @@ -31,7 +31,8 @@ PlacesBrowser::PlacesBrowser () { - + set_orientation(Gtk::ORIENTATION_VERTICAL); + scrollw = Gtk::manage (new Gtk::ScrolledWindow ()); scrollw->set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); pack_start (*scrollw); diff --git a/rtgui/placesbrowser.h b/rtgui/placesbrowser.h index d4640fff4..64cd30e3c 100644 --- a/rtgui/placesbrowser.h +++ b/rtgui/placesbrowser.h @@ -23,7 +23,7 @@ #include class PlacesBrowser : - public Gtk::VBox + public Gtk::Box { public: typedef sigc::slot DirSelectionSlot; diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 3177f3cd4..5ab2ecd36 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -35,7 +35,7 @@ namespace { void placeSpinBox(Gtk::Container* where, Gtk::SpinButton* &spin, const std::string &labelText, int digits, int inc0, int inc1, int maxLength, int range0, int range1, const std::string &toolTip = "") { - Gtk::HBox* HB = Gtk::manage ( new Gtk::HBox () ); + Gtk::Box* HB = Gtk::manage ( new Gtk::Box () ); HB->set_spacing (4); if (!toolTip.empty()) { HB->set_tooltip_text (M (toolTip)); @@ -147,12 +147,12 @@ Gtk::Widget* Preferences::getBatchProcPanel() swBatchProc = Gtk::manage(new Gtk::ScrolledWindow()); swBatchProc->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); - Gtk::VBox* vbBatchProc = Gtk::manage (new Gtk::VBox ()); + Gtk::Box* vbBatchProc = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); Gtk::ScrolledWindow* behscrollw = Gtk::manage(new Gtk::ScrolledWindow()); behscrollw->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); behscrollw->set_size_request(-1, 60); - Gtk::VBox* vbbeh = Gtk::manage(new Gtk::VBox()); + Gtk::Box* vbbeh = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); vbbeh->pack_start(*behscrollw, Gtk::PACK_EXPAND_WIDGET); Gtk::Frame* behFrame = Gtk::manage(new Gtk::Frame(M("PREFERENCES_BEHAVIOR"))); behFrame->add(*vbbeh); @@ -452,7 +452,7 @@ Gtk::Widget* Preferences::getBatchProcPanel() behAddAll->signal_clicked().connect(sigc::mem_fun(*this, &Preferences::behAddAllPressed)); behSetAll->signal_clicked().connect(sigc::mem_fun(*this, &Preferences::behSetAllPressed)); - Gtk::HBox* buttonpanel1 = Gtk::manage(new Gtk::HBox()); + Gtk::Box* buttonpanel1 = Gtk::manage(new Gtk::Box()); buttonpanel1->pack_end(*behSetAll, Gtk::PACK_SHRINK, 4); buttonpanel1->pack_end(*behAddAll, Gtk::PACK_SHRINK, 4); vbbeh->pack_start(*buttonpanel1, Gtk::PACK_SHRINK, 4); @@ -510,10 +510,10 @@ Gtk::Widget* Preferences::getImageProcessingPanel () swImageProcessing = Gtk::manage(new Gtk::ScrolledWindow()); swImageProcessing->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); - Gtk::VBox* vbImageProcessing = Gtk::manage (new Gtk::VBox ()); + Gtk::Box* vbImageProcessing = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); Gtk::Frame* fpp = Gtk::manage(new Gtk::Frame(M("PREFERENCES_IMPROCPARAMS"))); - Gtk::VBox* vbpp = Gtk::manage(new Gtk::VBox()); + Gtk::Box* vbpp = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); Gtk::Label* drlab = Gtk::manage(new Gtk::Label(M("PREFERENCES_FORRAW") + ":", Gtk::ALIGN_START)); rprofiles = Gtk::manage(new ProfileStoreComboBox()); const ProfileStoreEntry* dynpse = ProfileStore::getInstance()->getInternalDynamicPSE(); @@ -527,12 +527,15 @@ Gtk::Widget* Preferences::getImageProcessingPanel () iprofiles->set_size_request(50, -1); setExpandAlignProperties(iprofiles, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL); ipconn = iprofiles->signal_changed().connect(sigc::mem_fun(*this, &Preferences::forImageComboChanged)); - Gtk::Table* defpt = Gtk::manage(new Gtk::Table(2, 2)); - defpt->attach(*drlab, 0, 1, 0, 1, Gtk::FILL, Gtk::SHRINK, 2, 2); - defpt->attach(*rprofiles, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL | Gtk::SHRINK, Gtk::SHRINK, 2, 2); - defpt->attach(*drimg, 0, 1, 1, 2, Gtk::FILL, Gtk::SHRINK, 2, 2); - defpt->attach(*iprofiles, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL | Gtk::SHRINK, Gtk::SHRINK, 2, 2); + + Gtk::Grid* defpt = Gtk::manage(new Gtk::Grid()); + defpt->set_row_spacing(2); + defpt->attach(*drlab, 0, 0); + defpt->attach(*rprofiles, 1, 0); + defpt->attach(*drimg, 0, 1); + defpt->attach(*iprofiles, 1, 1); vbpp->pack_start(*defpt, Gtk::PACK_SHRINK, 4); + useBundledProfiles = Gtk::manage(new Gtk::CheckButton(M("PREFERENCES_USEBUNDLEDPROFILES"))); bpconn = useBundledProfiles->signal_clicked().connect(sigc::mem_fun(*this, &Preferences::bundledProfilesChanged)); vbpp->pack_start(*useBundledProfiles, Gtk::PACK_SHRINK, 4); @@ -544,39 +547,42 @@ Gtk::Widget* Preferences::getImageProcessingPanel () Gtk::Label* cplab = Gtk::manage(new Gtk::Label(M("PREFERENCES_CUSTPROFBUILDPATH") + ":", Gtk::ALIGN_START)); txtCustProfBuilderPath = Gtk::manage(new Gtk::Entry()); txtCustProfBuilderPath->set_tooltip_markup(M("PREFERENCES_CUSTPROFBUILDHINT")); + txtCustProfBuilderPath->set_hexpand(); Gtk::Label* cpltypelab = Gtk::manage(new Gtk::Label(M("PREFERENCES_CUSTPROFBUILDKEYFORMAT") + ":", Gtk::ALIGN_START)); custProfBuilderLabelType = Gtk::manage(new Gtk::ComboBoxText()); custProfBuilderLabelType->append(M("PREFERENCES_CUSTPROFBUILDKEYFORMAT_TID")); custProfBuilderLabelType->append(M("PREFERENCES_CUSTPROFBUILDKEYFORMAT_NAME")); custProfBuilderLabelType->append(M("PREFERENCES_CUSTPROFBUILDKEYFORMAT_TID") + "_" + M("PREFERENCES_CUSTPROFBUILDKEYFORMAT_NAME")); - Gtk::Table* cpbt = Gtk::manage(new Gtk::Table(2, 2)); - cpbt->attach(*cplab, 0, 1, 0, 1, Gtk::FILL, Gtk::SHRINK, 2, 2); - cpbt->attach(*txtCustProfBuilderPath, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL | Gtk::SHRINK, Gtk::SHRINK, 2, 2); - cpbt->attach(*cpltypelab, 0, 1, 1, 2, Gtk::FILL, Gtk::SHRINK, 2, 2); - cpbt->attach(*custProfBuilderLabelType, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL | Gtk::SHRINK, Gtk::SHRINK, 2, 2); + Gtk::Grid* cpbt = Gtk::manage(new Gtk::Grid()); + cpbt->set_row_spacing(2); + cpbt->attach(*cplab, 0, 0); + cpbt->attach(*txtCustProfBuilderPath, 1, 0); + cpbt->attach(*cpltypelab, 0, 1); + cpbt->attach(*custProfBuilderLabelType, 1, 1); cpfrm->add(*cpbt); vbImageProcessing->pack_start (*cpfrm, Gtk::PACK_SHRINK, 4); Gtk::Frame* fdp = Gtk::manage(new Gtk::Frame(M("PREFERENCES_PROFILEHANDLING"))); - Gtk::Table* vbdp = Gtk::manage(new Gtk::Table(2, 2)); + Gtk::Grid* vbdp = Gtk::manage(new Gtk::Grid()); saveParamsPreference = Gtk::manage(new Gtk::ComboBoxText()); saveParamsPreference->append(M("PREFERENCES_PROFILESAVEINPUT")); saveParamsPreference->append(M("PREFERENCES_PROFILESAVECACHE")); saveParamsPreference->append(M("PREFERENCES_PROFILESAVEBOTH")); Gtk::Label *splab = Gtk::manage (new Gtk::Label (M ("PREFERENCES_PROFILESAVELOCATION") + ":", Gtk::ALIGN_START)); - vbdp->attach(*splab, 0, 1, 0, 1, Gtk::FILL, Gtk::SHRINK, 2, 2); - vbdp->attach(*saveParamsPreference, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL | Gtk::SHRINK, Gtk::SHRINK, 2, 2); Gtk::Label* lplab = Gtk::manage (new Gtk::Label (M ("PREFERENCES_PROFILELOADPR") + ":", Gtk::ALIGN_START)); loadParamsPreference = Gtk::manage(new Gtk::ComboBoxText()); loadParamsPreference->append(M("PREFERENCES_PROFILEPRCACHE")); loadParamsPreference->append(M("PREFERENCES_PROFILEPRFILE")); - vbdp->attach(*lplab, 0, 1, 1, 2, Gtk::FILL, Gtk::SHRINK, 2, 2); - vbdp->attach(*loadParamsPreference, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL | Gtk::SHRINK, Gtk::SHRINK, 2, 2); + vbdp->set_row_spacing(2); + vbdp->attach(*splab, 0, 0); + vbdp->attach(*saveParamsPreference, 1, 0); + vbdp->attach(*lplab, 0, 1); + vbdp->attach(*loadParamsPreference, 1, 1); fdp->add(*vbdp); vbImageProcessing->pack_start (*fdp, Gtk::PACK_SHRINK, 4); // Gtk::Frame* fdf = Gtk::manage (new Gtk::Frame (M ("PREFERENCES_DARKFRAME")) ); -// Gtk::HBox* hb42 = Gtk::manage (new Gtk::HBox ()); +// Gtk::Box* hb42 = Gtk::manage (new Gtk::Box ()); // darkFrameDir = Gtk::manage (new Gtk::FileChooserButton (M ("PREFERENCES_DIRDARKFRAMES"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER)); // Directories Gtk::Frame* cdf = Gtk::manage(new Gtk::Frame(M("PREFERENCES_DIRECTORIES"))); @@ -654,11 +660,12 @@ Gtk::Widget* Preferences::getPerformancePanel() swPerformance = Gtk::manage(new Gtk::ScrolledWindow()); swPerformance->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); - Gtk::VBox* vbPerformance = Gtk::manage ( new Gtk::VBox () ); + Gtk::Box* vbPerformance = Gtk::manage ( new Gtk::Box(Gtk::ORIENTATION_VERTICAL) ); vbPerformance->set_spacing (4); Gtk::Frame* fprevdemo = Gtk::manage(new Gtk::Frame(M("PREFERENCES_PREVDEMO"))); - Gtk::HBox* hbprevdemo = Gtk::manage(new Gtk::HBox(false, 4)); + Gtk::Box* hbprevdemo = Gtk::manage(new Gtk::Box()); + hbprevdemo->set_spacing(4); Gtk::Label* lprevdemo = Gtk::manage (new Gtk::Label (M("PREFERENCES_PREVDEMO_LABEL"), Gtk::ALIGN_START)); cprevdemo = Gtk::manage(new Gtk::ComboBoxText()); cprevdemo->append(M("PREFERENCES_PREVDEMO_FAST")); @@ -670,7 +677,8 @@ Gtk::Widget* Preferences::getPerformancePanel() vbPerformance->pack_start (*fprevdemo, Gtk::PACK_SHRINK, 4); Gtk::Frame* ftiffserialize = Gtk::manage(new Gtk::Frame(M("PREFERENCES_SERIALIZE_TIFF_READ"))); - Gtk::HBox* htiffserialize = Gtk::manage(new Gtk::HBox(false, 4)); + Gtk::Box* htiffserialize = Gtk::manage(new Gtk::Box()); + htiffserialize->set_spacing(4); ctiffserialize = Gtk::manage(new Gtk::CheckButton(M("PREFERENCES_SERIALIZE_TIFF_READ_LABEL"))); ctiffserialize->set_tooltip_text(M("PREFERENCES_SERIALIZE_TIFF_READ_TOOLTIP")); htiffserialize->pack_start(*ctiffserialize); @@ -687,9 +695,9 @@ Gtk::Widget* Preferences::getPerformancePanel() Gtk::Frame* fchunksize = Gtk::manage ( new Gtk::Frame (M ("PREFERENCES_CHUNKSIZES")) ); fchunksize->set_label_align(0.025, 0.5); - Gtk::VBox* chunkSizeVB = Gtk::manage ( new Gtk::VBox () ); + Gtk::Box* chunkSizeVB = Gtk::manage ( new Gtk::Box(Gtk::ORIENTATION_VERTICAL) ); - Gtk::HBox* measureHB = Gtk::manage ( new Gtk::HBox () ); + Gtk::Box* measureHB = Gtk::manage ( new Gtk::Box () ); measureHB->set_spacing (4); measureCB = Gtk::manage ( new Gtk::CheckButton (M ("PREFERENCES_PERFORMANCE_MEASURE")) ); measureCB->set_tooltip_text (M ("PREFERENCES_PERFORMANCE_MEASURE_HINT")); @@ -708,10 +716,10 @@ Gtk::Widget* Preferences::getPerformancePanel() Gtk::Frame* finspect = Gtk::manage ( new Gtk::Frame (M ("PREFERENCES_INSPECT_LABEL")) ); finspect->set_label_align(0.025, 0.5); - Gtk::VBox *inspectorvb = Gtk::manage(new Gtk::VBox()); + Gtk::Box* inspectorvb = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); placeSpinBox(inspectorvb, maxInspectorBuffersSB, "PREFERENCES_INSPECT_MAXBUFFERS_LABEL", 0, 1, 5, 2, 1, 12, "PREFERENCES_INSPECT_MAXBUFFERS_TOOLTIP"); - Gtk::HBox *insphb = Gtk::manage(new Gtk::HBox()); + Gtk::Box* insphb = Gtk::manage(new Gtk::Box()); thumbnailInspectorMode = Gtk::manage(new Gtk::ComboBoxText()); thumbnailInspectorMode->append(M("PREFERENCES_THUMBNAIL_INSPECTOR_JPEG")); thumbnailInspectorMode->append(M("PREFERENCES_THUMBNAIL_INSPECTOR_RAW")); @@ -724,7 +732,7 @@ Gtk::Widget* Preferences::getPerformancePanel() Gtk::Frame* threadsFrame = Gtk::manage ( new Gtk::Frame (M ("PREFERENCES_PERFORMANCE_THREADS")) ); threadsFrame->set_label_align(0.025, 0.5); - Gtk::VBox* threadsVBox = Gtk::manage ( new Gtk::VBox (Gtk::PACK_SHRINK, 4) ); + Gtk::Box* threadsVBox = Gtk::manage ( new Gtk::Box(Gtk::ORIENTATION_VERTICAL) ); #ifdef _OPENMP int maxThreadNumber = omp_get_max_threads(); @@ -748,7 +756,7 @@ Gtk::Widget* Preferences::getColorManPanel () swColorMan = Gtk::manage(new Gtk::ScrolledWindow()); swColorMan->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); - Gtk::VBox* vbColorMan = Gtk::manage (new Gtk::VBox ()); + Gtk::Box* vbColorMan = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); vbColorMan->set_spacing (4); iccDir = Gtk::manage(new MyFileChooserButton(M("PREFERENCES_ICCDIR"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER)); @@ -1095,7 +1103,7 @@ Gtk::Widget* Preferences::getGeneralPanel() pseudoHiDPI = Gtk::manage(new Gtk::CheckButton(M("PREFERENCES_APPEARANCE_PSEUDOHIDPI") + Glib::ustring (" (") + M ("PREFERENCES_APPLNEXTSTARTUP") + ")")); setExpandAlignProperties(pseudoHiDPI, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); - Gtk::VSeparator *vSep = Gtk::manage(new Gtk::VSeparator()); + Gtk::Separator *vSep = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)); appearanceGrid->attach(*themeLbl, 0, 0, 1, 1); @@ -1252,7 +1260,7 @@ Gtk::Widget* Preferences::getFileBrowserPanel() swFileBrowser = Gtk::manage(new Gtk::ScrolledWindow()); swFileBrowser->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); - Gtk::VBox* vbFileBrowser = Gtk::manage ( new Gtk::VBox () ); + Gtk::Box* vbFileBrowser = Gtk::manage ( new Gtk::Box(Gtk::ORIENTATION_VERTICAL) ); Gtk::Frame* fsd = Gtk::manage(new Gtk::Frame(M("PREFERENCES_STARTUPIMDIR"))); @@ -1270,11 +1278,11 @@ Gtk::Widget* Preferences::getFileBrowserPanel() sdhome->set_group(opts); sdother->set_group(opts); - Gtk::VBox* vbsd = Gtk::manage(new Gtk::VBox()); + Gtk::Box* vbsd = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); vbsd->pack_start(*sdcurrent, Gtk::PACK_SHRINK, 0); vbsd->pack_start(*sdlast, Gtk::PACK_SHRINK, 0); vbsd->pack_start(*sdhome, Gtk::PACK_SHRINK, 0); - Gtk::HBox* otherbox = Gtk::manage(new Gtk::HBox()); + Gtk::Box* otherbox = Gtk::manage(new Gtk::Box()); otherbox->pack_start(*sdother, Gtk::PACK_SHRINK); otherbox->pack_start(*startupdir); otherbox->pack_end(*sdselect, Gtk::PACK_SHRINK, 4); @@ -1292,9 +1300,9 @@ Gtk::Widget* Preferences::getFileBrowserPanel() showDateTime = Gtk::manage(new Gtk::CheckButton(M("PREFERENCES_SHOWDATETIME"))); showBasicExif = Gtk::manage(new Gtk::CheckButton(M("PREFERENCES_SHOWBASICEXIF"))); showExpComp = Gtk::manage(new Gtk::CheckButton(M("PREFERENCES_SHOWEXPOSURECOMPENSATION"))); - Gtk::VBox* vbro = Gtk::manage(new Gtk::VBox()); - Gtk::HBox* hbro1 = Gtk::manage(new Gtk::HBox()); - Gtk::HBox* hbro0 = Gtk::manage(new Gtk::HBox()); + Gtk::Box* vbro = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); + Gtk::Box* hbro1 = Gtk::manage(new Gtk::Box()); + Gtk::Box* hbro0 = Gtk::manage(new Gtk::Box()); overlayedFileNames = Gtk::manage(new Gtk::CheckButton(M("PREFERENCES_OVERLAY_FILENAMES"))); filmStripOverlayedFileNames = Gtk::manage(new Gtk::CheckButton(M("PREFERENCES_OVERLAY_FILENAMES_FILMSTRIP"))); sameThumbSize = Gtk::manage(new Gtk::CheckButton(M("PREFERENCES_FSTRIP_SAME_THUMB_HEIGHT"))); @@ -1318,7 +1326,7 @@ Gtk::Widget* Preferences::getFileBrowserPanel() vbro->pack_start(*sameThumbSize, Gtk::PACK_SHRINK, 0); vbro->pack_start(*ckbInternalThumbIfUntouched, Gtk::PACK_SHRINK, 0); - Gtk::HBox* hbrecent = Gtk::manage(new Gtk::HBox()); + Gtk::Box* hbrecent = Gtk::manage(new Gtk::Box()); Gtk::Label* labrecent = Gtk::manage (new Gtk::Label (M("PREFERENCES_MAXRECENTFOLDERS") + ":", Gtk::ALIGN_START)); maxRecentFolders = Gtk::manage(new Gtk::SpinButton()); hbrecent->pack_start(*labrecent, Gtk::PACK_SHRINK, 4); @@ -1358,8 +1366,8 @@ Gtk::Widget* Preferences::getFileBrowserPanel() Gtk::Frame* fre = Gtk::manage(new Gtk::Frame(M("PREFERENCES_PARSEDEXT"))); - Gtk::VBox* vbre = Gtk::manage(new Gtk::VBox()); - Gtk::HBox* hb0 = Gtk::manage(new Gtk::HBox()); + Gtk::Box* vbre = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); + Gtk::Box* hb0 = Gtk::manage(new Gtk::Box()); Gtk::Label* elab = Gtk::manage (new Gtk::Label (M("PREFERENCES_PARSEDEXTADD") + ":", Gtk::ALIGN_START)); hb0->pack_start(*elab, Gtk::PACK_SHRINK, 4); extension = Gtk::manage(new Gtk::Entry()); @@ -1403,7 +1411,7 @@ Gtk::Widget* Preferences::getFileBrowserPanel() // Cache Gtk::Frame* frc = Gtk::manage (new Gtk::Frame(M("PREFERENCES_CACHEOPTS"))); - Gtk::VBox* vbc = Gtk::manage (new Gtk::VBox()); + Gtk::Box* vbc = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); frc->add(*vbc); Gtk::Grid* cacheGrid = Gtk::manage(new Gtk::Grid()); @@ -1426,7 +1434,7 @@ Gtk::Widget* Preferences::getFileBrowserPanel() // Separation is needed so that a button is not accidentally clicked when one wanted // to click a spinbox. Ideally, the separation wouldn't require attaching a widget, but how? - Gtk::HSeparator *cacheSeparator = Gtk::manage (new Gtk::HSeparator()); + Gtk::Separator *cacheSeparator = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); cacheSeparator->get_style_context()->add_class("grid-row-separator"); Gtk::Label* clearThumbsLbl = Gtk::manage (new Gtk::Label(M("PREFERENCES_CACHECLEAR_ALLBUTPROFILES"))); @@ -1462,8 +1470,8 @@ Gtk::Widget* Preferences::getFileBrowserPanel() clearSafetyLbl->set_line_wrap(true); vbc->pack_start(*clearSafetyLbl, Gtk::PACK_SHRINK, 4); - Gtk::HBox* hb6 = Gtk::manage(new Gtk::HBox()); - Gtk::VBox* vb6 = Gtk::manage(new Gtk::VBox()); + Gtk::Box* hb6 = Gtk::manage(new Gtk::Box()); + Gtk::Box* vb6 = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); vb6->pack_start(*fro); vb6->pack_start(*frmnu); @@ -1494,20 +1502,20 @@ Gtk::Widget* Preferences::getSoundsPanel () swSounds = Gtk::manage(new Gtk::ScrolledWindow()); swSounds->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); - Gtk::VBox* vbSounds = Gtk::manage(new Gtk::VBox ()); + Gtk::Box* vbSounds = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); ckbSndEnable = Gtk::manage(new Gtk::CheckButton(M("GENERAL_ENABLE"))); sndEnableConn = ckbSndEnable->signal_toggled().connect(sigc::mem_fun(*this, &Preferences::sndEnableToggled)); vbSounds->pack_start (*ckbSndEnable, Gtk::PACK_SHRINK, 4); - Gtk::HBox* hblSndHelp = Gtk::manage(new Gtk::HBox()); + Gtk::Box* hblSndHelp = Gtk::manage(new Gtk::Box()); Gtk::Label* lSndHelp = Gtk::manage (new Gtk::Label (M("PREFERENCES_SND_HELP"), Gtk::ALIGN_START)); hblSndHelp->pack_start(*lSndHelp, Gtk::PACK_SHRINK, 4); vbSounds->pack_start (*hblSndHelp, Gtk::PACK_SHRINK, 4); // BatchQueueDone - Gtk::HBox* pBatchQueueDone = Gtk::manage(new Gtk::HBox()); + Gtk::Box* pBatchQueueDone = Gtk::manage(new Gtk::Box()); Gtk::Label* lSndBatchQueueDone = Gtk::manage (new Gtk::Label (M("PREFERENCES_SND_QUEUEDONE") + Glib::ustring (":"), Gtk::ALIGN_START)); pBatchQueueDone->pack_start (*lSndBatchQueueDone, Gtk::PACK_SHRINK, 4); @@ -1518,7 +1526,7 @@ Gtk::Widget* Preferences::getSoundsPanel () vbSounds->pack_start (*pBatchQueueDone, Gtk::PACK_SHRINK, 4); // LngEditProcDone - Gtk::HBox* pSndLngEditProcDone = Gtk::manage(new Gtk::HBox()); + Gtk::Box* pSndLngEditProcDone = Gtk::manage(new Gtk::Box()); Gtk::Label* lSndLngEditProcDone = Gtk::manage (new Gtk::Label (M("PREFERENCES_SND_LNGEDITPROCDONE") + Glib::ustring (":"), Gtk::ALIGN_START)); pSndLngEditProcDone->pack_start(*lSndLngEditProcDone, Gtk::PACK_SHRINK, 4); diff --git a/rtgui/preferences.h b/rtgui/preferences.h index 60ca00ea2..df4e3327a 100644 --- a/rtgui/preferences.h +++ b/rtgui/preferences.h @@ -138,7 +138,7 @@ class Preferences final : Gtk::ComboBoxText* dnliss; Gtk::Frame* waveletFrame; - Gtk::HBox* waveletTileSizeHBox; + Gtk::Box* waveletTileSizeHBox; Gtk::Label* waveletTileSizeLabel; Gtk::ComboBoxText* waveletTileSizeCombo; diff --git a/rtgui/preprocess.cc b/rtgui/preprocess.cc index f33a87a28..b9326e3ad 100644 --- a/rtgui/preprocess.cc +++ b/rtgui/preprocess.cc @@ -31,7 +31,7 @@ using namespace rtengine::procparams; PreProcess::PreProcess () : FoldableToolPanel(this, "preprocess", M("TP_PREPROCESS_LABEL"), options.prevdemo != PD_Sidecar) { - Gtk::HBox* hotdeadPixel = Gtk::manage( new Gtk::HBox () ); + Gtk::Box* hotdeadPixel = Gtk::manage( new Gtk::Box () ); hotdeadPixel->set_spacing(4); hotPixel = Gtk::manage(new Gtk::CheckButton((M("TP_PREPROCESS_HOTPIXFILT")))); deadPixel = Gtk::manage(new Gtk::CheckButton((M("TP_PREPROCESS_DEADPIXFILT")))); diff --git a/rtgui/preprocesswb.cc b/rtgui/preprocesswb.cc index 170371318..dddd7fdc2 100644 --- a/rtgui/preprocesswb.cc +++ b/rtgui/preprocesswb.cc @@ -34,7 +34,7 @@ PreprocessWB::PreprocessWB() : evPreprocessWBMode(ProcEventMapper::getInstance()->newEvent(FIRST, "HISTORY_MSG_PREPROCWB_MODE")), mode(Gtk::manage(new MyComboBoxText())) { - Gtk::HBox *hb = Gtk::manage(new Gtk::HBox()); + Gtk::Box *hb = Gtk::manage(new Gtk::Box()); hb->pack_start(*Gtk::manage(new Gtk::Label(M("TP_PREPROCWB_MODE") + ": ")), Gtk::PACK_SHRINK, 0); mode->append(M("TP_PREPROCWB_MODE_CAMERA")); diff --git a/rtgui/previewmodepanel.cc b/rtgui/previewmodepanel.cc index 37b3f6468..586923173 100644 --- a/rtgui/previewmodepanel.cc +++ b/rtgui/previewmodepanel.cc @@ -105,7 +105,7 @@ PreviewModePanel::PreviewModePanel (ImageArea* ia) : imageArea(ia) pack_start (*backColor3, Gtk::PACK_SHRINK, 0); pack_start (*backColor2, Gtk::PACK_SHRINK, 0); - pack_start (*Gtk::manage (new Gtk::VSeparator ()), Gtk::PACK_SHRINK, 2); + pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)), Gtk::PACK_SHRINK, 2); pack_start (*previewR, Gtk::PACK_SHRINK, 0); pack_start (*previewG, Gtk::PACK_SHRINK, 0); diff --git a/rtgui/previewmodepanel.h b/rtgui/previewmodepanel.h index 4121dfb92..d475fd4a4 100644 --- a/rtgui/previewmodepanel.h +++ b/rtgui/previewmodepanel.h @@ -22,7 +22,7 @@ class ImageArea; class PreviewModePanel : - public Gtk::HBox + public Gtk::Box { protected: diff --git a/rtgui/prsharpening.cc b/rtgui/prsharpening.cc index d065dbc07..c79fff1a1 100644 --- a/rtgui/prsharpening.cc +++ b/rtgui/prsharpening.cc @@ -35,7 +35,7 @@ PrSharpening::PrSharpening () : FoldableToolPanel(this, "prsharpening", M("TP_PR //setEnabledTooltipMarkup(M("TP_PRSHARPENING_TOOLTIP")); - Gtk::HBox* hb = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* hb = Gtk::manage (new Gtk::Box ()); hb->show (); contrast = Gtk::manage(new Adjuster (M("TP_SHARPENING_CONTRAST"), 0, 200, 1, 15)); contrast->setAdjusterListener (this); @@ -52,7 +52,7 @@ PrSharpening::PrSharpening () : FoldableToolPanel(this, "prsharpening", M("TP_PR hb->pack_start(*method); pack_start (*hb); - rld = new Gtk::VBox (); + rld = new Gtk::Box(Gtk::ORIENTATION_VERTICAL); dradius = Gtk::manage (new Adjuster (M("TP_SHARPENING_EDRADIUS"), 0.4, 2.5, 0.01, 0.45)); damount = Gtk::manage (new Adjuster (M("TP_SHARPENING_RLD_AMOUNT"), 0.0, 100, 1, 100)); ddamping = Gtk::manage (new Adjuster (M("TP_SHARPENING_RLD_DAMPING"), 0, 100, 1, 0)); @@ -67,10 +67,10 @@ PrSharpening::PrSharpening () : FoldableToolPanel(this, "prsharpening", M("TP_PR diter->show (); rld->show (); - usm = new Gtk::VBox (); + usm = new Gtk::Box(Gtk::ORIENTATION_VERTICAL); usm->show (); - Gtk::HSeparator *hsep6a = Gtk::manage (new Gtk::HSeparator()); + Gtk::Separator* hsep6a = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); amount = Gtk::manage (new Adjuster (M("TP_SHARPENING_AMOUNT"), 1, 1000, 1, 200)); radius = Gtk::manage (new Adjuster (M("TP_SHARPENING_RADIUS"), 0.3, 3, 0.01, 0.5)); threshold = Gtk::manage (new ThresholdAdjuster (M("TP_SHARPENING_THRESHOLD"), 0., 2000., 20., 80., 2000., 1200., 0, false)); @@ -88,10 +88,10 @@ PrSharpening::PrSharpening () : FoldableToolPanel(this, "prsharpening", M("TP_PR amount->show (); threshold->show (); - Gtk::HSeparator *hsep6 = Gtk::manage (new Gtk::HSeparator()); + Gtk::Separator* hsep6 = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); edgesonly = Gtk::manage (new Gtk::CheckButton (M("TP_SHARPENING_ONLYEDGES"))); edgesonly->set_active (false); - edgebox = new Gtk::VBox (); + edgebox = new Gtk::Box(Gtk::ORIENTATION_VERTICAL); eradius = Gtk::manage (new Adjuster (M("TP_SHARPENING_EDRADIUS"), 0.5, 2.5, 0.1, 1.9)); etolerance = Gtk::manage (new Adjuster (M("TP_SHARPENING_EDTOLERANCE"), 10, 10000, 100, 1800)); usm->pack_start(*hsep6, Gtk::PACK_SHRINK, 2); @@ -99,7 +99,7 @@ PrSharpening::PrSharpening () : FoldableToolPanel(this, "prsharpening", M("TP_PR edgebox->pack_start(*eradius); edgebox->pack_start(*etolerance); edgebox->show (); - edgebin = Gtk::manage (new Gtk::VBox ()); + edgebin = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); usm->pack_start (*edgebin); edgebin->show (); hsep6->show(); @@ -107,16 +107,16 @@ PrSharpening::PrSharpening () : FoldableToolPanel(this, "prsharpening", M("TP_PR eradius->show(); etolerance->show(); - Gtk::HSeparator *hsep6b = Gtk::manage (new Gtk::HSeparator()); + Gtk::Separator* hsep6b = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); halocontrol = Gtk::manage (new Gtk::CheckButton (M("TP_SHARPENING_HALOCONTROL"))); halocontrol->set_active (false); - hcbox = new Gtk::VBox (); + hcbox = new Gtk::Box(Gtk::ORIENTATION_VERTICAL); hcamount = Gtk::manage (new Adjuster (M("TP_SHARPENING_HCAMOUNT"), 1, 100, 1, 75)); usm->pack_start(*hsep6b, Gtk::PACK_SHRINK, 2); usm->pack_start(*halocontrol); hcbox->pack_start(*hcamount); hcbox->show (); - hcbin = Gtk::manage (new Gtk::VBox ()); + hcbin = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); usm->pack_start (*hcbin); hcbin->show (); hsep6b->show (); diff --git a/rtgui/prsharpening.h b/rtgui/prsharpening.h index 9738a5cd4..4128bc4c5 100644 --- a/rtgui/prsharpening.h +++ b/rtgui/prsharpening.h @@ -38,18 +38,18 @@ protected: Adjuster* damount; Adjuster* ddamping; Adjuster* diter; - Gtk::VBox* usm; - Gtk::VBox* rld; + Gtk::Box* usm; + Gtk::Box* rld; Adjuster* radius; Adjuster* amount; Adjuster* eradius; Adjuster* etolerance; Adjuster* hcamount; - Gtk::VBox* edgebin; - Gtk::VBox* hcbin; - Gtk::VBox* edgebox; - Gtk::VBox* hcbox; + Gtk::Box* edgebin; + Gtk::Box* hcbin; + Gtk::Box* edgebox; + Gtk::Box* hcbox; ThresholdAdjuster* threshold; Gtk::CheckButton* edgesonly; bool lastEdgesOnly; diff --git a/rtgui/recentbrowser.cc b/rtgui/recentbrowser.cc index 90fe69216..9d3cc1f12 100644 --- a/rtgui/recentbrowser.cc +++ b/rtgui/recentbrowser.cc @@ -24,7 +24,8 @@ using namespace rtengine; RecentBrowser::RecentBrowser () { - + set_orientation(Gtk::ORIENTATION_VERTICAL); + recentDirs = Gtk::manage (new MyComboBoxText ()); Gtk::Frame* frame = Gtk::manage (new Gtk::Frame (M("MAIN_FRAME_RECENT"))); diff --git a/rtgui/recentbrowser.h b/rtgui/recentbrowser.h index bc8374087..68b3359b2 100644 --- a/rtgui/recentbrowser.h +++ b/rtgui/recentbrowser.h @@ -23,7 +23,7 @@ #include "guiutils.h" class RecentBrowser : - public Gtk::VBox + public Gtk::Box { public: typedef sigc::slot DirSelectionSlot; diff --git a/rtgui/renamedlg.cc b/rtgui/renamedlg.cc index 8908d3419..f76626798 100644 --- a/rtgui/renamedlg.cc +++ b/rtgui/renamedlg.cc @@ -25,21 +25,26 @@ RenameDialog::RenameDialog (Gtk::Window* parent) : Gtk::Dialog (M("FILEBROWSER_RENAMEDLGLABEL"), *parent, true), p(parent), imageData(nullptr) { - Gtk::Table* names = Gtk::manage (new Gtk::Table (2, 2)); + Gtk::Grid* names = Gtk::manage (new Gtk::Grid()); Gtk::Label* onlab = Gtk::manage (new Gtk::Label (M("FILEBROWSER_CURRENT_NAME"))); + onlab->set_halign(Gtk::ALIGN_START); Gtk::Label* nnlab = Gtk::manage (new Gtk::Label (M("FILEBROWSER_NEW_NAME"))); - oldName = Gtk::manage (new Gtk::Label ("alma")); - newName = Gtk::manage (new Gtk::Entry ()); - - names->attach (*onlab, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - names->attach (*oldName, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); - names->attach (*nnlab, 0, 1, 1, 2, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - names->attach (*newName, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + nnlab->set_halign(Gtk::ALIGN_START); + oldName = Gtk::manage (new Gtk::Label("alma")); + oldName->set_halign(Gtk::ALIGN_START); + newName = Gtk::manage (new Gtk::Entry()); + newName->set_hexpand(); + newName->set_halign(Gtk::ALIGN_FILL); + + names->attach(*onlab, 0, 0); + names->attach(*oldName, 1, 0); + names->attach(*nnlab, 0, 1); + names->attach(*newName, 1, 1); get_content_area()->pack_start (*names, Gtk::PACK_SHRINK, 4); // Issue 316 -// Gtk::HBox* tbox = Gtk::manage (new Gtk::HBox()); +// Gtk::Box* tbox = Gtk::manage (new Gtk::Box()); // useTmpl = Gtk::manage (new Gtk::CheckButton (M("FILEBROWSER_USETEMPLATE"))); // templates = Gtk::manage (new MyComboBox ()); // templateModel = Gtk::ListStore::create (templateColumns); @@ -51,8 +56,8 @@ RenameDialog::RenameDialog (Gtk::Window* parent) // get_content_area()->pack_start (*tbox, Gtk::PACK_SHRINK, 4); - add_button (Gtk::Stock::OK, Gtk::RESPONSE_OK); - add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); + add_button ("_OK", Gtk::RESPONSE_OK); + add_button ("_Cancel", Gtk::RESPONSE_CANCEL); // Issue 316 // all = add_button ("All", RESPONSE_ALL); diff --git a/rtgui/resize.cc b/rtgui/resize.cc index a65875426..ff3c622aa 100644 --- a/rtgui/resize.cc +++ b/rtgui/resize.cc @@ -37,26 +37,33 @@ Resize::Resize () : FoldableToolPanel(this, "resize", M("TP_RESIZE_LABEL"), fals cropw = 0; croph = 0; - Gtk::Table* combos = Gtk::manage (new Gtk::Table (2, 2)); + Gtk::Grid* combos = Gtk::manage (new Gtk::Grid()); + combos->set_row_spacing(4); appliesTo = Gtk::manage (new MyComboBoxText ()); appliesTo->append (M("TP_RESIZE_CROPPEDAREA")); appliesTo->append (M("TP_RESIZE_FULLIMAGE")); appliesTo->set_active (0); + appliesTo->set_hexpand(); + appliesTo->set_halign(Gtk::ALIGN_FILL); Gtk::Label *label = Gtk::manage (new Gtk::Label (M("TP_RESIZE_APPLIESTO"), Gtk::ALIGN_START)); - combos->attach (*label, 0, 1, 0, 1, Gtk::SHRINK | Gtk::FILL, Gtk::SHRINK, 2, 2); - combos->attach (*appliesTo, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + + combos->attach(*label, 0, 0); + combos->attach(*appliesTo, 1, 0); // See Resize::methodChanged() when adding a new method. method = Gtk::manage (new MyComboBoxText ()); method->append (M("TP_RESIZE_LANCZOS")); method->append (M("TP_RESIZE_NEAREST")); method->set_active (0); + method->set_hexpand(); + method->set_halign(Gtk::ALIGN_FILL); label = Gtk::manage (new Gtk::Label (M("TP_RESIZE_METHOD"), Gtk::ALIGN_START)); - combos->attach (*label, 0, 1, 1, 2, Gtk::SHRINK | Gtk::FILL, Gtk::SHRINK, 2, 2); - combos->attach (*method, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + + combos->attach(*label, 0, 1); + combos->attach(*method, 1, 1); spec = Gtk::manage (new MyComboBoxText ()); spec->append (M("TP_RESIZE_SCALE")); @@ -64,10 +71,13 @@ Resize::Resize () : FoldableToolPanel(this, "resize", M("TP_RESIZE_LABEL"), fals spec->append (M("TP_RESIZE_HEIGHT")); spec->append (M("TP_RESIZE_FITBOX")); spec->set_active (0); + spec->set_hexpand(); + spec->set_halign(Gtk::ALIGN_FILL); label = Gtk::manage (new Gtk::Label (M("TP_RESIZE_SPECIFY"), Gtk::ALIGN_START)); - combos->attach (*label, 0, 1, 2, 3, Gtk::SHRINK | Gtk::FILL, Gtk::SHRINK, 2, 2); - combos->attach (*spec, 1, 2, 2, 3, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + + combos->attach(*label, 0, 2); + combos->attach(*spec, 1, 2); pack_start (*combos, Gtk::PACK_SHRINK, 4); @@ -76,11 +86,11 @@ Resize::Resize () : FoldableToolPanel(this, "resize", M("TP_RESIZE_LABEL"), fals pack_start (*scale, Gtk::PACK_SHRINK, 4); - sizeBox = Gtk::manage (new Gtk::VBox ()); + sizeBox = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); - Gtk::HBox* sbox = Gtk::manage (new Gtk::HBox ()); - Gtk::HBox* wbox = Gtk::manage (new Gtk::HBox ()); - Gtk::HBox* hbox = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* sbox = Gtk::manage (new Gtk::Box ()); + Gtk::Box* wbox = Gtk::manage (new Gtk::Box ()); + Gtk::Box* hbox = Gtk::manage (new Gtk::Box ()); w = Gtk::manage (new MySpinButton ()); h = Gtk::manage (new MySpinButton ()); wbox->set_spacing(3); diff --git a/rtgui/resize.h b/rtgui/resize.h index 41b54509e..ec4907fd1 100644 --- a/rtgui/resize.h +++ b/rtgui/resize.h @@ -70,7 +70,7 @@ private: rtengine::ProcEvent EvResizeAllowUpscaling; Adjuster* scale; - Gtk::VBox* sizeBox; + Gtk::Box* sizeBox; MyComboBoxText* appliesTo; MyComboBoxText* method; MyComboBoxText* spec; diff --git a/rtgui/retinex.cc b/rtgui/retinex.cc index 0a40ced9d..a9d7cc376 100644 --- a/rtgui/retinex.cc +++ b/rtgui/retinex.cc @@ -41,7 +41,7 @@ Retinex::Retinex () : FoldableToolPanel (this, "retinex", M ("TP_RETINEX_LABEL") complexmethod->append(M("TP_WAVELET_COMPEXPERT")); complexmethodconn = complexmethod->signal_changed().connect(sigc::mem_fun(*this, &Retinex::complexmethodChanged)); complexmethod->set_tooltip_text(M("TP_WAVELET_COMPLEX_TOOLTIP")); - Gtk::HBox* const complexHBox = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const complexHBox = Gtk::manage(new Gtk::Box()); Gtk::Label* const complexLabel = Gtk::manage(new Gtk::Label(M("TP_WAVELET_COMPLEXLAB") + ":")); complexHBox->pack_start(*complexLabel, Gtk::PACK_SHRINK, 4); complexHBox->pack_start(*complexmethod); diff --git a/rtgui/rgbcurves.cc b/rtgui/rgbcurves.cc index d501cf449..5e7616e70 100644 --- a/rtgui/rgbcurves.cc +++ b/rtgui/rgbcurves.cc @@ -36,7 +36,7 @@ RGBCurves::RGBCurves () : FoldableToolPanel(this, "rgbcurves", M("TP_RGBCURVES_L lumamode->show (); pack_start (*lumamode); - Gtk::HSeparator *hsep1 = Gtk::manage (new Gtk::HSeparator()); + Gtk::Separator *hsep1 = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); hsep1->show (); pack_start (*hsep1); diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index e1d8c1f84..c0042f949 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -354,7 +354,7 @@ RTWindow::RTWindow () mainNB->set_current_page (mainNB->page_num (*fpanel)); - //Gtk::VBox* mainBox = Gtk::manage (new Gtk::VBox ()); + //Gtk::Box* mainBox = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); //mainBox->pack_start (*mainNB); // filling bottom box diff --git a/rtgui/saveasdlg.cc b/rtgui/saveasdlg.cc index ebf2f5b4a..a4062d502 100644 --- a/rtgui/saveasdlg.cc +++ b/rtgui/saveasdlg.cc @@ -127,22 +127,22 @@ SaveAsDialog::SaveAsDialog (const Glib::ustring &initialDir, Gtk::Window* parent // pack everything // ~~~~~~~~~~~~~~~ - Gtk::VBox* vbox_bottomRight = Gtk::manage(new Gtk::VBox ()); + Gtk::Box* vbox_bottomRight = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); // There is no queue in simple mode, so no need to choose if (!simpleEditor) { vbox_bottomRight->pack_start (*saveMethod[0], Gtk::PACK_SHRINK, 2); vbox_bottomRight->pack_start (*saveMethod[1], Gtk::PACK_SHRINK, 2); vbox_bottomRight->pack_start (*saveMethod[2], Gtk::PACK_SHRINK, 2); - vbox_bottomRight->pack_start (*Gtk::manage(new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 5); + vbox_bottomRight->pack_start (*Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)), Gtk::PACK_SHRINK, 5); } vbox_bottomRight->pack_start (*forceFormatOpts, Gtk::PACK_SHRINK, 4); vbox_bottomRight->pack_start (*autoSuffix, Gtk::PACK_SHRINK, 4); - Gtk::HBox* hbox_bottom = Gtk::manage( new Gtk::HBox() ); + Gtk::Box* hbox_bottom = Gtk::manage( new Gtk::Box() ); hbox_bottom->pack_start (*formatOpts, Gtk::PACK_EXPAND_WIDGET, 2); - hbox_bottom->pack_start (*Gtk::manage(new Gtk::VSeparator ()), Gtk::PACK_SHRINK, 2); + hbox_bottom->pack_start (*Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)), Gtk::PACK_SHRINK, 2); hbox_bottom->pack_start (*vbox_bottomRight, Gtk::PACK_EXPAND_WIDGET, 2); box->pack_start (*fchooser); diff --git a/rtgui/shadowshighlights.cc b/rtgui/shadowshighlights.cc index 3e3c277c7..f6ab4811a 100644 --- a/rtgui/shadowshighlights.cc +++ b/rtgui/shadowshighlights.cc @@ -30,7 +30,7 @@ ShadowsHighlights::ShadowsHighlights () : FoldableToolPanel(this, "shadowshighli auto m = ProcEventMapper::getInstance(); EvSHColorspace = m->newEvent(RGBCURVE, "HISTORY_MSG_SH_COLORSPACE"); - Gtk::HBox* hb = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* hb = Gtk::manage (new Gtk::Box ()); hb->pack_start(*Gtk::manage(new Gtk::Label(M("TP_DIRPYRDENOISE_MAIN_COLORSPACE") + ": ")), Gtk::PACK_SHRINK); colorspace = Gtk::manage(new MyComboBoxText()); colorspace->append(M("TP_DIRPYRDENOISE_MAIN_COLORSPACE_RGB")); @@ -38,21 +38,21 @@ ShadowsHighlights::ShadowsHighlights () : FoldableToolPanel(this, "shadowshighli hb->pack_start(*colorspace); pack_start(*hb); - pack_start (*Gtk::manage (new Gtk::HSeparator())); + pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL))); highlights = Gtk::manage (new Adjuster (M("TP_SHADOWSHLIGHTS_HIGHLIGHTS"), 0, 100, 1, 0)); h_tonalwidth = Gtk::manage (new Adjuster (M("TP_SHADOWSHLIGHTS_HLTONALW"), 10, 100, 1, 70)); pack_start (*highlights); pack_start (*h_tonalwidth); - pack_start (*Gtk::manage (new Gtk::HSeparator())); + pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL))); shadows = Gtk::manage (new Adjuster (M("TP_SHADOWSHLIGHTS_SHADOWS"), 0, 100, 1, 0)); s_tonalwidth = Gtk::manage (new Adjuster (M("TP_SHADOWSHLIGHTS_SHTONALW"), 10, 100, 1, 30)); pack_start (*shadows); pack_start (*s_tonalwidth); - pack_start (*Gtk::manage (new Gtk::HSeparator())); + pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL))); radius = Gtk::manage (new Adjuster (M("TP_SHADOWSHLIGHTS_RADIUS"), 1, 100, 1, 40)); pack_start (*radius); diff --git a/rtgui/sharpening.cc b/rtgui/sharpening.cc index e16511279..687358349 100644 --- a/rtgui/sharpening.cc +++ b/rtgui/sharpening.cc @@ -29,7 +29,7 @@ Sharpening::Sharpening () : FoldableToolPanel(this, "sharpening", M("TP_SHARPENI EvSharpenContrast = m->newEvent(SHARPENING, "HISTORY_MSG_SHARPENING_CONTRAST"); EvSharpenBlur = m->newEvent(SHARPENING, "HISTORY_MSG_SHARPENING_BLUR"); - Gtk::HBox* hb = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* hb = Gtk::manage (new Gtk::Box ()); hb->show (); contrast = Gtk::manage(new Adjuster (M("TP_SHARPENING_CONTRAST"), 0, 200, 1, 20)); contrast->setAdjusterListener (this); @@ -50,7 +50,7 @@ Sharpening::Sharpening () : FoldableToolPanel(this, "sharpening", M("TP_SHARPENI hb->pack_start(*method); pack_start (*hb); - rld = new Gtk::VBox (); + rld = new Gtk::Box(Gtk::ORIENTATION_VERTICAL); dradius = Gtk::manage (new Adjuster (M("TP_SHARPENING_EDRADIUS"), 0.4, 2.5, 0.01, 0.75)); damount = Gtk::manage (new Adjuster (M("TP_SHARPENING_RLD_AMOUNT"), 0.0, 100, 1, 100)); ddamping = Gtk::manage (new Adjuster (M("TP_SHARPENING_RLD_DAMPING"), 0, 100, 1, 0)); @@ -65,11 +65,11 @@ Sharpening::Sharpening () : FoldableToolPanel(this, "sharpening", M("TP_SHARPENI diter->show (); rld->show (); - usm = new Gtk::VBox (); + usm = new Gtk::Box(Gtk::ORIENTATION_VERTICAL); usm->show (); - Gtk::HSeparator *hsep6a = Gtk::manage (new Gtk::HSeparator()); + Gtk::Separator* hsep6a = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); amount = Gtk::manage (new Adjuster (M("TP_SHARPENING_AMOUNT"), 1, 1000, 1, 200)); radius = Gtk::manage (new Adjuster (M("TP_SHARPENING_RADIUS"), 0.3, 3, 0.01, 0.5)); threshold = Gtk::manage (new ThresholdAdjuster (M("TP_SHARPENING_THRESHOLD"), 0., 2000., 20., 80., 2000., 1200., 0, false)); @@ -86,10 +86,10 @@ Sharpening::Sharpening () : FoldableToolPanel(this, "sharpening", M("TP_SHARPENI threshold->show (); amount->show (); - Gtk::HSeparator *hsep6 = Gtk::manage (new Gtk::HSeparator()); + Gtk::Separator* hsep6 = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); edgesonly = Gtk::manage (new Gtk::CheckButton (M("TP_SHARPENING_ONLYEDGES"))); edgesonly->set_active (false); - edgebox = new Gtk::VBox (); + edgebox = new Gtk::Box(Gtk::ORIENTATION_VERTICAL); eradius = Gtk::manage (new Adjuster (M("TP_SHARPENING_EDRADIUS"), 0.5, 2.5, 0.1, 1.9)); etolerance = Gtk::manage (new Adjuster (M("TP_SHARPENING_EDTOLERANCE"), 10, 10000, 100, 1800)); usm->pack_start(*hsep6, Gtk::PACK_SHRINK, 2); @@ -97,7 +97,7 @@ Sharpening::Sharpening () : FoldableToolPanel(this, "sharpening", M("TP_SHARPENI edgebox->pack_start(*eradius); edgebox->pack_start(*etolerance); edgebox->show (); - edgebin = Gtk::manage (new Gtk::VBox ()); + edgebin = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); usm->pack_start (*edgebin); edgebin->show (); hsep6->show(); @@ -105,16 +105,16 @@ Sharpening::Sharpening () : FoldableToolPanel(this, "sharpening", M("TP_SHARPENI eradius->show(); etolerance->show(); - Gtk::HSeparator *hsep6b = Gtk::manage (new Gtk::HSeparator()); + Gtk::Separator* hsep6b = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); halocontrol = Gtk::manage (new Gtk::CheckButton (M("TP_SHARPENING_HALOCONTROL"))); halocontrol->set_active (false); - hcbox = new Gtk::VBox (); + hcbox = new Gtk::Box(Gtk::ORIENTATION_VERTICAL); hcamount = Gtk::manage (new Adjuster (M("TP_SHARPENING_HCAMOUNT"), 1, 100, 1, 75)); usm->pack_start(*hsep6b, Gtk::PACK_SHRINK, 2); usm->pack_start(*halocontrol); hcbox->pack_start(*hcamount); hcbox->show (); - hcbin = Gtk::manage (new Gtk::VBox ()); + hcbin = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); usm->pack_start (*hcbin); hcbin->show (); hsep6b->show (); diff --git a/rtgui/sharpening.h b/rtgui/sharpening.h index bd5e6f1b7..aa65b3662 100644 --- a/rtgui/sharpening.h +++ b/rtgui/sharpening.h @@ -39,18 +39,18 @@ protected: Adjuster* damount; Adjuster* ddamping; Adjuster* diter; - Gtk::VBox* usm; - Gtk::VBox* rld; + Gtk::Box* usm; + Gtk::Box* rld; Adjuster* radius; Adjuster* amount; Adjuster* eradius; Adjuster* etolerance; Adjuster* hcamount; - Gtk::VBox* edgebin; - Gtk::VBox* hcbin; - Gtk::VBox* edgebox; - Gtk::VBox* hcbox; + Gtk::Box* edgebin; + Gtk::Box* hcbin; + Gtk::Box* edgebox; + Gtk::Box* hcbox; ThresholdAdjuster* threshold; Gtk::CheckButton* edgesonly; bool lastEdgesOnly; diff --git a/rtgui/shcselector.cc b/rtgui/shcselector.cc index e8aca4071..ad2c28aaa 100644 --- a/rtgui/shcselector.cc +++ b/rtgui/shcselector.cc @@ -321,7 +321,7 @@ bool SHCSelector::on_motion_notify_event (GdkEventMotion* event) return true; } -void SHCSelector::styleChanged (const Glib::RefPtr& style) +void SHCSelector::styleChanged (const Glib::RefPtr& style) { setDirty(true); diff --git a/rtgui/shcselector.h b/rtgui/shcselector.h index e03ca8e06..2422fdf56 100644 --- a/rtgui/shcselector.h +++ b/rtgui/shcselector.h @@ -78,7 +78,7 @@ public: void setDefaults (double spos, double cpos, double hpos); void setPositions (double spos, double cpos, double hpos); void getPositions (double& spos, double& cpos, double& hpos); - void styleChanged (const Glib::RefPtr& style); + void styleChanged (const Glib::RefPtr& style); bool reset (); void refresh(); }; diff --git a/rtgui/thresholdadjuster.cc b/rtgui/thresholdadjuster.cc index c6ba96111..1f8b1c967 100644 --- a/rtgui/thresholdadjuster.cc +++ b/rtgui/thresholdadjuster.cc @@ -34,6 +34,7 @@ ThresholdAdjuster::ThresholdAdjuster (Glib::ustring label, : tSelector(minValueBottom, maxValueBottom, defBottom, labelBottom, precisionBottom, minValueTop, maxValueTop, defTop, labelTop, precisionTop, curveProvider) { + set_orientation(Gtk::ORIENTATION_VERTICAL); initialDefaultVal[ThresholdSelector::TS_BOTTOMLEFT] = defBottom; initialDefaultVal[ThresholdSelector::TS_TOPLEFT] = defTop; initialDefaultVal[ThresholdSelector::TS_BOTTOMRIGHT] = 0.; // unused @@ -46,6 +47,7 @@ ThresholdAdjuster::ThresholdAdjuster (Glib::ustring label, double minValue, doub double defTop, unsigned int precision, bool startAtOne, bool editedCheckBox) : tSelector(minValue, maxValue, defBottom, defTop, precision, startAtOne) { + set_orientation(Gtk::ORIENTATION_VERTICAL); initialDefaultVal[ThresholdSelector::TS_BOTTOMLEFT] = defBottom; initialDefaultVal[ThresholdSelector::TS_TOPLEFT] = defTop; initialDefaultVal[ThresholdSelector::TS_BOTTOMRIGHT] = maxValue; @@ -60,6 +62,7 @@ ThresholdAdjuster::ThresholdAdjuster (Glib::ustring label, double minValue, doub : tSelector(minValue, maxValue, defBottomLeft, defTopLeft, defBottomRight, defTopRight, precision, startAtOne) { + set_orientation(Gtk::ORIENTATION_VERTICAL); initialDefaultVal[ThresholdSelector::TS_BOTTOMLEFT] = defBottomLeft; initialDefaultVal[ThresholdSelector::TS_TOPLEFT] = defTopLeft; initialDefaultVal[ThresholdSelector::TS_BOTTOMRIGHT] = defBottomRight; @@ -81,7 +84,7 @@ void ThresholdAdjuster::initObject (Glib::ustring label, bool editedcb) set_name("ThresholdAdjuster"); - hbox = Gtk::manage (new Gtk::HBox ()); + hbox = Gtk::manage (new Gtk::Box ()); this->label = Gtk::manage (new Gtk::Label (label, Gtk::ALIGN_START)); diff --git a/rtgui/thresholdadjuster.h b/rtgui/thresholdadjuster.h index b28f68dee..8f67d5ef5 100644 --- a/rtgui/thresholdadjuster.h +++ b/rtgui/thresholdadjuster.h @@ -46,11 +46,11 @@ public: }; -class ThresholdAdjuster : public Gtk::VBox +class ThresholdAdjuster : public Gtk::Box { protected: - Gtk::HBox* hbox; + Gtk::Box* hbox; Gtk::Label* label; ThresholdSelector tSelector; //MySpinButton* spin; diff --git a/rtgui/thresholdselector.cc b/rtgui/thresholdselector.cc index 35d08279c..61043525c 100644 --- a/rtgui/thresholdselector.cc +++ b/rtgui/thresholdselector.cc @@ -714,7 +714,7 @@ void ThresholdSelector::findSecondaryMovedCursor(guint state) } } -void ThresholdSelector::styleChanged (const Glib::RefPtr& style) +void ThresholdSelector::styleChanged (const Glib::RefPtr& style) { queue_draw (); diff --git a/rtgui/thresholdselector.h b/rtgui/thresholdselector.h index 4ae86560e..bf1d7c952 100644 --- a/rtgui/thresholdselector.h +++ b/rtgui/thresholdselector.h @@ -215,7 +215,7 @@ public: { return doubleThresh; } - void styleChanged (const Glib::RefPtr& style); + void styleChanged (const Glib::RefPtr& style); unsigned int getPrecision () { return precisionTop; diff --git a/rtgui/thumbbrowserbase.cc b/rtgui/thumbbrowserbase.cc index c611b252d..06c662e51 100644 --- a/rtgui/thumbbrowserbase.cc +++ b/rtgui/thumbbrowserbase.cc @@ -34,6 +34,9 @@ ThumbBrowserBase::ThumbBrowserBase () { inW = -1; inH = -1; + + hscroll.set_orientation(Gtk::ORIENTATION_HORIZONTAL); + vscroll.set_orientation(Gtk::ORIENTATION_VERTICAL); setExpandAlignProperties(&internal, true, true, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL); setExpandAlignProperties(&hscroll, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); diff --git a/rtgui/thumbbrowserbase.h b/rtgui/thumbbrowserbase.h index 69017b183..2d41cdfab 100644 --- a/rtgui/thumbbrowserbase.h +++ b/rtgui/thumbbrowserbase.h @@ -116,8 +116,8 @@ protected: virtual int getThumbnailHeight () = 0; Internal internal; - Gtk::HScrollbar hscroll; - Gtk::VScrollbar vscroll; + Gtk::Scrollbar hscroll; + Gtk::Scrollbar vscroll; int inW, inH; diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc index dc9b17fa9..5e6f1fe31 100644 --- a/rtgui/tonecurve.cc +++ b/rtgui/tonecurve.cc @@ -52,11 +52,11 @@ ToneCurve::ToneCurve () : FoldableToolPanel(this, "tonecurve", M("TP_EXPOSURE_LA //----------- OOG clamping ---------------------------------- clampOOG = Gtk::manage(new Gtk::CheckButton(M("TP_EXPOSURE_CLAMPOOG"))); pack_start(*clampOOG); - pack_start (*Gtk::manage (new Gtk::HSeparator())); + pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL))); clampOOG->signal_toggled().connect(sigc::mem_fun(*this, &ToneCurve::clampOOGChanged)); //----------- Auto Levels ---------------------------------- - abox = Gtk::manage (new Gtk::HBox ()); + abox = Gtk::manage (new Gtk::Box ()); abox->set_spacing (4); autolevels = Gtk::manage (new Gtk::ToggleButton (M("TP_EXPOSURE_AUTOLEVELS"))); @@ -88,7 +88,7 @@ ToneCurve::ToneCurve () : FoldableToolPanel(this, "tonecurve", M("TP_EXPOSURE_LA pack_start (*abox); //-------------- Highlight Reconstruction ----------------- - pack_start (*Gtk::manage (new Gtk::HSeparator())); + pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL))); hrenabled = Gtk::manage (new Gtk::CheckButton (M("TP_HLREC_LABEL"))); hrenabled->set_active (false); @@ -102,7 +102,7 @@ ToneCurve::ToneCurve () : FoldableToolPanel(this, "tonecurve", M("TP_EXPOSURE_LA method->append (M("TP_HLREC_BLEND")); method->set_active (0); - hlrbox = Gtk::manage (new Gtk::HBox ()); + hlrbox = Gtk::manage (new Gtk::Box ()); Gtk::Label* lab = Gtk::manage (new Gtk::Label (M("TP_HLREC_METHOD"))); hlrbox->pack_start (*lab, Gtk::PACK_SHRINK, 4); hlrbox->pack_start (*method); @@ -112,7 +112,7 @@ ToneCurve::ToneCurve () : FoldableToolPanel(this, "tonecurve", M("TP_EXPOSURE_LA methconn = method->signal_changed().connect ( sigc::mem_fun(*this, &ToneCurve::methodChanged) ); //----------- Exposure Compensation --------------------- - pack_start (*Gtk::manage (new Gtk::HSeparator())); + pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL))); expcomp = Gtk::manage (new Adjuster (M("TP_EXPOSURE_EXPCOMP"), -5, 12, 0.05, 0)); expcomp->setLogScale(2, 0, true); @@ -131,7 +131,7 @@ ToneCurve::ToneCurve () : FoldableToolPanel(this, "tonecurve", M("TP_EXPOSURE_LA shcompr = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRSHADOWS"), 0, 100, 1, 50)); pack_start (*shcompr); - pack_start (*Gtk::manage (new Gtk::HSeparator())); + pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL))); //---------Brightness / Contrast ------------------------- brightness = Gtk::manage (new Adjuster (M("TP_EXPOSURE_BRIGHTNESS"), -100, 100, 1, 0)); @@ -146,7 +146,7 @@ ToneCurve::ToneCurve () : FoldableToolPanel(this, "tonecurve", M("TP_EXPOSURE_LA saturation->setLogScale(2, 0, true); //----------- Curve 1 ------------------------------ - pack_start (*Gtk::manage (new Gtk::HSeparator())); + pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL))); histmatching = Gtk::manage(new Gtk::ToggleButton(M("TP_EXPOSURE_HISTMATCHING"))); histmatching->set_tooltip_markup(M("TP_EXPOSURE_HISTMATCHING_TOOLTIP")); diff --git a/rtgui/tonecurve.h b/rtgui/tonecurve.h index e0482c5da..9439d422e 100644 --- a/rtgui/tonecurve.h +++ b/rtgui/tonecurve.h @@ -48,8 +48,8 @@ protected: sigc::connection enaconn; bool lasthrEnabled; - Gtk::HBox* abox; - Gtk::HBox* hlrbox; + Gtk::Box* abox; + Gtk::Box* hlrbox; Gtk::ToggleButton* autolevels; Gtk::Label* lclip; diff --git a/rtgui/toolbar.h b/rtgui/toolbar.h index 85a0c3345..41ae2c680 100644 --- a/rtgui/toolbar.h +++ b/rtgui/toolbar.h @@ -39,7 +39,7 @@ public: virtual void editModeSwitchedOff() = 0; }; -class ToolBar final : public Gtk::HBox +class ToolBar final : public Gtk::Box { private: std::unique_ptr handimg; diff --git a/rtgui/toolpanel.cc b/rtgui/toolpanel.cc index 710a19c87..cfc53639b 100644 --- a/rtgui/toolpanel.cc +++ b/rtgui/toolpanel.cc @@ -27,6 +27,7 @@ using namespace rtengine::procparams; ToolVBox::ToolVBox() { + set_orientation(Gtk::ORIENTATION_VERTICAL); //GTK318 #if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 20 set_spacing(1); // Vertical space between tools @@ -36,6 +37,7 @@ ToolVBox::ToolVBox() { } ToolParamBlock::ToolParamBlock() { + set_orientation(Gtk::ORIENTATION_VERTICAL); //GTK318 #if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 20 set_spacing(2); // Vertical space between parameters in a single tool @@ -52,7 +54,7 @@ FoldableToolPanel::FoldableToolPanel(Gtk::Box* content, Glib::ustring toolName, // exp->set_use_markup (true); if (need11) { - Gtk::HBox *titleHBox = Gtk::manage(new Gtk::HBox()); + Gtk::Box *titleHBox = Gtk::manage(new Gtk::Box()); Gtk::Label *label = Gtk::manage(new Gtk::Label()); label->set_markup(escapeHtmlChars(UILabel)); diff --git a/rtgui/toolpanel.h b/rtgui/toolpanel.h index 12b3eebcc..f07f5f0a1 100644 --- a/rtgui/toolpanel.h +++ b/rtgui/toolpanel.h @@ -49,7 +49,7 @@ public: /// @brief This class control the space around the group of tools inside a tab, as well as the space separating each tool. */ class ToolVBox : - public Gtk::VBox + public Gtk::Box { public: ToolVBox(); @@ -57,7 +57,7 @@ public: /// @brief This class control the space around a tool's block of parameter. */ class ToolParamBlock : - public Gtk::VBox + public Gtk::Box { public: ToolParamBlock(); diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index 9ccc9f8ba..56d83e107 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -191,7 +191,7 @@ ToolPanelCoordinator::ToolPanelCoordinator (bool batch) : ipc (nullptr), favorit // load panel endings for (int i = 0; i < 8; i++) { - vbPanelEnd[i] = Gtk::manage (new Gtk::VBox ()); + vbPanelEnd[i] = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); imgPanelEnd[i] = Gtk::manage (new RTImage ("ornament1.png")); imgPanelEnd[i]->show(); vbPanelEnd[i]->pack_start(*imgPanelEnd[i], Gtk::PACK_SHRINK); diff --git a/rtgui/toolpanelcoord.h b/rtgui/toolpanelcoord.h index b39906459..675b77de7 100644 --- a/rtgui/toolpanelcoord.h +++ b/rtgui/toolpanelcoord.h @@ -193,7 +193,7 @@ protected: TextOrIcon* toiL; Gtk::Image* imgPanelEnd[8]; - Gtk::VBox* vbPanelEnd[8]; + Gtk::Box* vbPanelEnd[8]; Gtk::ScrolledWindow* favoritePanelSW; Gtk::ScrolledWindow* exposurePanelSW; diff --git a/rtgui/wavelet.cc b/rtgui/wavelet.cc index 2057847df..448141497 100644 --- a/rtgui/wavelet.cc +++ b/rtgui/wavelet.cc @@ -69,8 +69,8 @@ Wavelet::Wavelet() : curveEditorbl(new CurveEditorGroup(options.lastWaveletCurvesDir, M("TP_WAVELET_BLCURVE"))), curveEditorRES(new CurveEditorGroup(options.lastWaveletCurvesDir)), curveEditorGAM(new CurveEditorGroup(options.lastWaveletCurvesDir)), - separatorNeutral(Gtk::manage(new Gtk::HSeparator())), - separatoredge(Gtk::manage(new Gtk::HSeparator())), + separatorNeutral(Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL))), + separatoredge(Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL))), opaCurveEditorG(new CurveEditorGroup(options.lastWaveletCurvesDir, M("TP_WAVELET_COLORT"))), opacityCurveEditorG(new CurveEditorGroup(options.lastWaveletCurvesDir, M("TP_WAVELET_OPACITY"))), CurveEditorwavnoise(new CurveEditorGroup(options.lastWaveletCurvesDir, M("TP_WAVELET_DENOISE"))), @@ -209,14 +209,14 @@ Wavelet::Wavelet() : exptoning(Gtk::manage(new MyExpander(true, M("TP_WAVELET_TON")))), expclari(Gtk::manage(new MyExpander(true, M("TP_WAVELET_CLARI")))), expbl(Gtk::manage(new MyExpander(true, M("TP_WAVELET_BL")))), - neutrHBox(Gtk::manage(new Gtk::HBox())), - usharpHBox(Gtk::manage(new Gtk::HBox())), - ctboxch(Gtk::manage(new Gtk::HBox())), - quaHBox(Gtk::manage(new Gtk::HBox())), - sliHBox(Gtk::manage(new Gtk::HBox())), - denHBox(Gtk::manage(new Gtk::HBox())), - mixHBox(Gtk::manage(new Gtk::HBox())), - ctboxBA(Gtk::manage(new Gtk::VBox())) + neutrHBox(Gtk::manage(new Gtk::Box())), + usharpHBox(Gtk::manage(new Gtk::Box())), + ctboxch(Gtk::manage(new Gtk::Box())), + quaHBox(Gtk::manage(new Gtk::Box())), + sliHBox(Gtk::manage(new Gtk::Box())), + denHBox(Gtk::manage(new Gtk::Box())), + mixHBox(Gtk::manage(new Gtk::Box())), + ctboxBA(Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL))) { CurveListener::setMulti(true); @@ -319,7 +319,7 @@ Wavelet::Wavelet() : complexmethod->append(M("TP_WAVELET_COMPEXPERT")); complexmethodconn = complexmethod->signal_changed().connect(sigc::mem_fun(*this, &Wavelet::complexmethodChanged)); complexmethod->set_tooltip_text(M("TP_WAVELET_COMPLEX_TOOLTIP")); - Gtk::HBox* const complexHBox = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const complexHBox = Gtk::manage(new Gtk::Box()); Gtk::Label* const complexLabel = Gtk::manage(new Gtk::Label(M("TP_WAVELET_COMPLEXLAB") + ":")); complexHBox->pack_start(*complexLabel, Gtk::PACK_SHRINK, 4); complexHBox->pack_start(*complexmethod); @@ -330,7 +330,7 @@ Wavelet::Wavelet() : // Tilesmethod->append(M("TP_WAVELET_TILESLIT")); Tilesmethodconn = Tilesmethod->signal_changed().connect(sigc::mem_fun(*this, &Wavelet::TilesmethodChanged)); Tilesmethod->set_tooltip_text(M("TP_WAVELET_TILES_TOOLTIP")); - Gtk::HBox* const tilesizeHBox = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const tilesizeHBox = Gtk::manage(new Gtk::Box()); Gtk::Label* const tilesizeLabel = Gtk::manage(new Gtk::Label(M("TP_WAVELET_TILESIZE") + ":")); tilesizeHBox->pack_start(*tilesizeLabel, Gtk::PACK_SHRINK, 4); tilesizeHBox->pack_start(*Tilesmethod); @@ -344,7 +344,7 @@ Wavelet::Wavelet() : daubcoeffmethodconn = daubcoeffmethod->signal_changed().connect(sigc::mem_fun(*this, &Wavelet::daubcoeffmethodChanged)); daubcoeffmethod->set_tooltip_text(M("TP_WAVELET_DAUB_TOOLTIP")); Gtk::Label* const daubcoeffLabel = Gtk::manage(new Gtk::Label(M("TP_WAVELET_DAUB") + ":")); - Gtk::HBox* const daubcoeffHBox = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const daubcoeffHBox = Gtk::manage(new Gtk::Box()); daubcoeffHBox->pack_start(*daubcoeffLabel, Gtk::PACK_SHRINK, 4); daubcoeffHBox->pack_start(*daubcoeffmethod); @@ -352,7 +352,7 @@ Wavelet::Wavelet() : Backmethod->append(M("TP_WAVELET_B1")); Backmethod->append(M("TP_WAVELET_B2")); Backmethodconn = Backmethod->signal_changed().connect(sigc::mem_fun(*this, &Wavelet::BackmethodChanged)); - Gtk::HBox* const backgroundHBox = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const backgroundHBox = Gtk::manage(new Gtk::Box()); Gtk::Label* const backgroundLabel = Gtk::manage(new Gtk::Label(M("TP_WAVELET_BACKGROUND") + ":")); backgroundHBox->pack_start(*backgroundLabel, Gtk::PACK_SHRINK, 4); backgroundHBox->pack_start(*Backmethod); @@ -362,7 +362,7 @@ Wavelet::Wavelet() : CLmethod->append(M("TP_WAVELET_LEVDIR_SUP")); CLmethod->append(M("TP_WAVELET_LEVDIR_ALL")); CLmethodconn = CLmethod->signal_changed().connect(sigc::mem_fun(*this, &Wavelet::CLmethodChanged)); - Gtk::HBox* const levdirMainHBox = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const levdirMainHBox = Gtk::manage(new Gtk::Box()); Gtk::Label* const levdirMainLabel = Gtk::manage(new Gtk::Label(M("TP_WAVELET_PROC") + ":")); levdirMainHBox->pack_start(*levdirMainLabel, Gtk::PACK_SHRINK, 4); levdirMainHBox->pack_start(*CLmethod); //same @@ -387,7 +387,7 @@ Wavelet::Wavelet() : Dirmethod->append(M("TP_WAVELET_DALL")); Lmethodconn = Lmethod->signal_changed().connect(sigc::mem_fun(*this, &Wavelet::LmethodChanged)); Dirmethodconn = Dirmethod->signal_changed().connect(sigc::mem_fun(*this, &Wavelet::DirmethodChanged)); - Gtk::HBox* const levdirSubHBox = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const levdirSubHBox = Gtk::manage(new Gtk::Box()); levdirSubHBox->pack_start(*Lmethod); levdirSubHBox->pack_start(*Dirmethod, Gtk::PACK_EXPAND_WIDGET, 2); // same, but 2 not 4? @@ -403,7 +403,9 @@ Wavelet::Wavelet() : // Contrast ToolParamBlock* const levBox = Gtk::manage(new ToolParamBlock()); - Gtk::HBox* const buttonBox = Gtk::manage(new Gtk::HBox(true, 10)); + Gtk::Box* const buttonBox = Gtk::manage(new Gtk::Box()); + buttonBox->set_spacing(10); + buttonBox->set_homogeneous(true); levBox->pack_start(*buttonBox, Gtk::PACK_SHRINK, 2); Gtk::Button* const contrastMinusButton = Gtk::manage(new Gtk::Button(M("TP_WAVELET_CONTRAST_MINUS"))); @@ -442,7 +444,7 @@ Wavelet::Wavelet() : } levBox->pack_start(*sup); sup->setAdjusterListener(this); - Gtk::HSeparator* const separatorcont = Gtk::manage(new Gtk::HSeparator()); + Gtk::Separator* const separatorcont = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); levBox->pack_start(*separatorcont); sigma->setAdjusterListener(this); @@ -458,7 +460,7 @@ Wavelet::Wavelet() : wavLabels->show(); levBox->pack_start(*wavLabels); - Gtk::VBox* const contrastSHVBox = Gtk::manage(new Gtk::VBox); + Gtk::Box* const contrastSHVBox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); contrastSHVBox->set_spacing(2); HSmethod->append(M("TP_WAVELET_HS1")); @@ -509,7 +511,7 @@ Wavelet::Wavelet() : ToolParamBlock* const chBox = Gtk::manage(new ToolParamBlock()); Gtk::Label* const labmch = Gtk::manage(new Gtk::Label(M("TP_WAVELET_CHTYPE") + ":")); -// Gtk::HBox* const ctboxch = Gtk::manage(new Gtk::HBox()); +// Gtk::Box* const ctboxch = Gtk::manage(new Gtk::Box()); ctboxch->pack_start(*labmch, Gtk::PACK_SHRINK, 1); CHmethod->append(M("TP_WAVELET_CH1")); @@ -519,7 +521,7 @@ Wavelet::Wavelet() : ctboxch->pack_start(*CHmethod); chBox->pack_start(*ctboxch); - Gtk::HBox* const ctboxCH = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const ctboxCH = Gtk::manage(new Gtk::Box()); ctboxCH->pack_start(*labmC, Gtk::PACK_SHRINK, 1); CHSLmethod->append(M("TP_WAVELET_CHSL")); @@ -527,7 +529,7 @@ Wavelet::Wavelet() : CHSLmethodconn = CHSLmethod->signal_changed().connect(sigc::mem_fun(*this, &Wavelet::CHSLmethodChanged)); ctboxCH->pack_start(*CHSLmethod); - Gtk::HSeparator* const separatorChromaMethod = Gtk::manage(new Gtk::HSeparator()); + Gtk::Separator* const separatorChromaMethod = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); chBox->pack_start(*separatorChromaMethod, Gtk::PACK_SHRINK, 2); chroma->set_tooltip_text(M("TP_WAVELET_CHRO_TOOLTIP")); @@ -549,7 +551,9 @@ Wavelet::Wavelet() : chBox->pack_start(*chro); chBox->pack_start(*sigmacol); - Gtk::HBox* const buttonchBox = Gtk::manage(new Gtk::HBox(true, 10)); + Gtk::Box* const buttonchBox = Gtk::manage(new Gtk::Box()); + buttonchBox->set_spacing(10); + buttonchBox->set_homogeneous(true); neutralchPressedConn = neutralchButton->signal_pressed().connect(sigc::mem_fun(*this, &Wavelet::neutralchPressed)); chBox->pack_start(*separatorNeutral, Gtk::PACK_SHRINK, 2); buttonchBox->pack_start(*neutralchButton); @@ -687,7 +691,7 @@ Wavelet::Wavelet() : denmethod->append(M("TP_WAVELET_DEN12LOW")); denmethodconn = denmethod->signal_changed().connect(sigc::mem_fun(*this, &Wavelet::denmethodChanged)); denmethod->set_tooltip_text(M("TP_WAVELET_DENEQUAL_TOOLTIP")); -// Gtk::HBox* const denHBox = Gtk::manage(new Gtk::HBox()); +// Gtk::Box* const denHBox = Gtk::manage(new Gtk::Box()); Gtk::Label* const denLabel = Gtk::manage(new Gtk::Label(M("TP_WAVELET_DENCONTRAST") + ":")); denHBox->pack_start(*denLabel, Gtk::PACK_SHRINK, 4); denHBox->pack_start(*denmethod); @@ -817,7 +821,7 @@ Wavelet::Wavelet() : edgBox->pack_start(*edgthresh); Gtk::Label* const labmedgr = Gtk::manage(new Gtk::Label(M("TP_WAVELET_MEDGREINF") + ":")); - Gtk::HBox* const edbox = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const edbox = Gtk::manage(new Gtk::Box()); edbox->pack_start(*labmedgr, Gtk::PACK_SHRINK, 1); Medgreinf->append(M("TP_WAVELET_RE1")); @@ -828,11 +832,11 @@ Wavelet::Wavelet() : edbox->pack_start(*Medgreinf); edgBox->pack_start(*edbox); - Gtk::HSeparator* const separatorlc = Gtk::manage(new Gtk::HSeparator()); + Gtk::Separator* const separatorlc = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); edgBox->pack_start(*separatorlc, Gtk::PACK_SHRINK, 2); Gtk::Label* const labmED = Gtk::manage(new Gtk::Label(M("TP_WAVELET_EDTYPE") + ":")); - Gtk::HBox* const ctboxED = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const ctboxED = Gtk::manage(new Gtk::Box()); ctboxED->pack_start(*labmED, Gtk::PACK_SHRINK, 1); EDmethod->append(M("TP_WAVELET_EDSL")); @@ -865,10 +869,10 @@ Wavelet::Wavelet() : medianlevConn = medianlev->signal_toggled().connect(sigc::mem_fun(*this, &Wavelet::medianlevToggled)); medianlev->set_tooltip_text(M("TP_WAVELET_MEDILEV_TOOLTIP")); - Gtk::HSeparator* const separatored1 = Gtk::manage(new Gtk::HSeparator()); + Gtk::Separator* const separatored1 = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); edgBox->pack_start(*separatored1, Gtk::PACK_SHRINK, 2); - Gtk::HBox* const eddebox = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const eddebox = Gtk::manage(new Gtk::Box()); edgBox->pack_start(*eddebox); edgBox->pack_start(*medianlev); @@ -896,11 +900,11 @@ Wavelet::Wavelet() : edgeampli->setAdjusterListener(this); edgBox->pack_start(*edgeampli); - Gtk::VBox* const ctboxES = Gtk::manage(new Gtk::VBox()); + Gtk::Box* const ctboxES = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); ctboxES->set_spacing(2); - Gtk::HBox* const ctboxNP = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const ctboxNP = Gtk::manage(new Gtk::Box()); ctboxNP->pack_start(*labmNP, Gtk::PACK_SHRINK, 1); NPmethod->append(M("TP_WAVELET_NPNONE")); @@ -1040,10 +1044,10 @@ Wavelet::Wavelet() : chromaFrame->add(*chromaBox); Gtk::Label* const labmTM = Gtk::manage(new Gtk::Label(M("TP_WAVELET_TMTYPE") + ":")); - Gtk::HBox* const ctboxTM = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const ctboxTM = Gtk::manage(new Gtk::Box()); ctboxTM->pack_start(*labmTM, Gtk::PACK_SHRINK, 1); -// Gtk::HSeparator* const separatorR0 = Gtk::manage(new Gtk::HSeparator()); +// Gtk::Separator* const separatorR0 = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); // resBox->pack_start(*separatorR0, Gtk::PACK_SHRINK, 2); TMmethod->append(M("TP_WAVELET_COMPCONT")); @@ -1077,7 +1081,7 @@ Wavelet::Wavelet() : contFrame->add(*contBox); resBox->pack_start(*contFrame); -// Gtk::HSeparator* const separatorR1 = Gtk::manage(new Gtk::HSeparator()); +// Gtk::Separator* const separatorR1 = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); // resBox->pack_start(*separatorR1, Gtk::PACK_SHRINK, 2); hueskin2->set_tooltip_markup(M("TP_WAVELET_HUESKY_TOOLTIP")); @@ -1104,11 +1108,11 @@ Wavelet::Wavelet() : resBox->pack_start(*curveEditorRES, Gtk::PACK_SHRINK, 4); // Toning and Color Balance - Gtk::HSeparator* const separatorCB = Gtk::manage(new Gtk::HSeparator()); + Gtk::Separator* const separatorCB = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); - Gtk::VBox* const chanMixerHLBox = Gtk::manage(new Gtk::VBox()); - Gtk::VBox* const chanMixerMidBox = Gtk::manage(new Gtk::VBox()); - Gtk::VBox* const chanMixerShadowsBox = Gtk::manage(new Gtk::VBox()); + Gtk::Box* const chanMixerHLBox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); + Gtk::Box* const chanMixerMidBox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); + Gtk::Box* const chanMixerShadowsBox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); cbenab->set_active(true); cbenabConn = cbenab->signal_toggled().connect(sigc::mem_fun(*this, &Wavelet::cbenabToggled)); @@ -1172,14 +1176,14 @@ Wavelet::Wavelet() : resBox->pack_start(*neutrHBox); // Final Touchup - // Gtk::VBox* const ctboxBA = Gtk::manage(new Gtk::VBox()); + // Gtk::Box* const ctboxBA = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); ctboxBA->set_spacing(2); - //Gtk::HSeparator *separatorfin = Gtk::manage (new Gtk::HSeparator()); + //Gtk::Separator *separatorfin = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); //ctboxBA->pack_start(*separatorfin, Gtk::PACK_SHRINK, 2); Gtk::Label* const labmBA = Gtk::manage(new Gtk::Label(M("TP_WAVELET_BATYPE") + ":")); - Gtk::HBox* const ctboxFI = Gtk::manage(new Gtk::HBox()); + Gtk::Box* const ctboxFI = Gtk::manage(new Gtk::Box()); ctboxFI->pack_start(*labmBA, Gtk::PACK_SHRINK, 1); BAmethod->append(M("TP_WAVELET_BANONE")); @@ -1211,7 +1215,7 @@ Wavelet::Wavelet() : iter->set_tooltip_text(M("TP_WAVELET_ITER_TOOLTIP")); sigmadir->setAdjusterListener(this); -// Gtk::HSeparator* const separatorbalend = Gtk::manage(new Gtk::HSeparator()); +// Gtk::Separator* const separatorbalend = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); opacityCurveEditorWL->setCurveListener(this); diff --git a/rtgui/wavelet.h b/rtgui/wavelet.h index c7e002a64..bdbf7bbc3 100644 --- a/rtgui/wavelet.h +++ b/rtgui/wavelet.h @@ -197,8 +197,8 @@ private: CurveEditorGroup* const curveEditorbl; CurveEditorGroup* const curveEditorRES; CurveEditorGroup* const curveEditorGAM; - Gtk::HSeparator* const separatorNeutral; - Gtk::HSeparator* const separatoredge; + Gtk::Separator* const separatorNeutral; + Gtk::Separator* const separatoredge; CurveEditorGroup* const opaCurveEditorG; FlatCurveEditor* opacityShapeRG; @@ -387,14 +387,14 @@ private: MyExpander* const expclari; MyExpander* const expbl; - Gtk::HBox* const neutrHBox; - Gtk::HBox* const usharpHBox; - Gtk::HBox* const ctboxch; - Gtk::HBox* const quaHBox; - Gtk::HBox* const sliHBox; - Gtk::HBox* const denHBox; - Gtk::HBox* const mixHBox; - Gtk::VBox* const ctboxBA;// = Gtk::manage(new Gtk::VBox()); + Gtk::Box* const neutrHBox; + Gtk::Box* const usharpHBox; + Gtk::Box* const ctboxch; + Gtk::Box* const quaHBox; + Gtk::Box* const sliHBox; + Gtk::Box* const denHBox; + Gtk::Box* const mixHBox; + Gtk::Box* const ctboxBA;// = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); sigc::connection enableChromaConn, enableContrastConn, enableEdgeConn, enabletmConn, enableFinalConn, enableclariConn; sigc::connection enableNoiseConn, enableResidConn, enableToningConn; diff --git a/rtgui/whitebalance.cc b/rtgui/whitebalance.cc index 5d1c907df..ba8ad6157 100644 --- a/rtgui/whitebalance.cc +++ b/rtgui/whitebalance.cc @@ -311,7 +311,7 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, "whitebalance", M("TP_WB spotgrid->attach (*wbsizehelper, 2, 0, 1, 1); pack_start (*spotgrid, Gtk::PACK_SHRINK, 0 ); - Gtk::HSeparator *separator = Gtk::manage (new Gtk::HSeparator()); + Gtk::Separator *separator = Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)); separator->get_style_context()->add_class("grid-row-separator"); pack_start (*separator, Gtk::PACK_SHRINK, 0); @@ -341,7 +341,7 @@ WhiteBalance::WhiteBalance () : FoldableToolPanel(this, "whitebalance", M("TP_WB equal->show (); tempBias->show (); - /* Gtk::HBox* boxgreen = Gtk::manage (new Gtk::HBox ()); + /* Gtk::Box* boxgreen = Gtk::manage (new Gtk::Box ()); boxgreen->show (); boxgreen->pack_start(*igreenL); diff --git a/rtgui/xtransprocess.cc b/rtgui/xtransprocess.cc index db63c68be..89fd0f8a4 100644 --- a/rtgui/xtransprocess.cc +++ b/rtgui/xtransprocess.cc @@ -34,7 +34,7 @@ XTransProcess::XTransProcess () : FoldableToolPanel(this, "xtransprocess", M("TP EvDemosaicContrast = m->newEvent(DEMOSAIC, "HISTORY_MSG_DUALDEMOSAIC_CONTRAST"); EvDemosaicAutoContrast = m->newEvent(DEMOSAIC, "HISTORY_MSG_DUALDEMOSAIC_AUTO_CONTRAST"); - Gtk::HBox* hb1 = Gtk::manage (new Gtk::HBox ()); + Gtk::Box* hb1 = Gtk::manage (new Gtk::Box ()); hb1->pack_start (*Gtk::manage (new Gtk::Label ( M("TP_RAW_DMETHOD") + ": ")), Gtk::PACK_SHRINK, 4); method = Gtk::manage (new MyComboBoxText ()); @@ -72,7 +72,7 @@ XTransProcess::XTransProcess () : FoldableToolPanel(this, "xtransprocess", M("TP hb1->pack_end (*method, Gtk::PACK_EXPAND_WIDGET, 4); pack_start( *hb1, Gtk::PACK_SHRINK, 4); - dualDemosaicOptions = Gtk::manage (new Gtk::VBox ()); + dualDemosaicOptions = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); dualDemosaicContrast = Gtk::manage(new Adjuster (M("TP_RAW_DUALDEMOSAICCONTRAST"), 0, 100, 1, 20)); dualDemosaicContrast->setAdjusterListener (this); @@ -85,7 +85,7 @@ XTransProcess::XTransProcess () : FoldableToolPanel(this, "xtransprocess", M("TP dualDemosaicOptions->pack_start(*dualDemosaicContrast); pack_start( *dualDemosaicOptions, Gtk::PACK_SHRINK, 4); - borderbox = Gtk::manage(new Gtk::HBox()); + borderbox = Gtk::manage(new Gtk::Box()); border = Gtk::manage(new Adjuster(M("TP_RAW_BORDER"), 0, 16, 1, 7)); border->setAdjusterListener (this); @@ -95,7 +95,7 @@ XTransProcess::XTransProcess () : FoldableToolPanel(this, "xtransprocess", M("TP borderbox->pack_start(*border); pack_start(*borderbox, Gtk::PACK_SHRINK, 4); - pack_start( *Gtk::manage( new Gtk::HSeparator()), Gtk::PACK_SHRINK, 0 ); + pack_start( *Gtk::manage( new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL)), Gtk::PACK_SHRINK, 0 ); ccSteps = Gtk::manage (new Adjuster (M("TP_RAW_FALSECOLOR"), 0, 5, 1, 0 )); ccSteps->setAdjusterListener (this); diff --git a/rtgui/xtransprocess.h b/rtgui/xtransprocess.h index fc0dd7502..4725f4a6d 100644 --- a/rtgui/xtransprocess.h +++ b/rtgui/xtransprocess.h @@ -36,10 +36,10 @@ class XTransProcess final : protected: MyComboBoxText* method; - Gtk::HBox* borderbox; + Gtk::Box* borderbox; Adjuster* border; Adjuster* ccSteps; - Gtk::VBox *dualDemosaicOptions; + Gtk::Box* dualDemosaicOptions; Adjuster* dualDemosaicContrast; bool lastAutoContrast; From 036a590db17990b84bc21ee4c0f92f2715bc86f5 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Wed, 17 Feb 2021 13:41:25 +0100 Subject: [PATCH 090/129] Fix adjuster default value --- rtgui/locallabtools.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 97ddfe924..7f7ec4fc8 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -6215,7 +6215,7 @@ LocallabBlur::LocallabBlur(): radius(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RADIUS"), MINRAD, MAXRAD, 0.1, 1.5, nullptr, nullptr, &blurSlider2radius, &blurRadius2Slider))), strength(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRENGTH"), 0, 100, 1, 0))), grainFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRAINFRA")))), - isogr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_ISOGR"), 20, 6400, 1, 0))), + isogr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_ISOGR"), 400, 6400, 1, 0))), strengr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRENGR"), 0, 100, 1, 0))), scalegr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SCALEGR"), 0, 100, 1, 100))), medMethod(Gtk::manage(new MyComboBoxText())), From d29d5e144b64b26a5617ec9055425fefcc40195f Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Wed, 17 Feb 2021 15:38:29 +0100 Subject: [PATCH 091/129] Update locallabtools.cc Fix wrong fix from last commit... --- rtgui/locallabtools.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 7f7ec4fc8..26e6f3cff 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -6215,7 +6215,7 @@ LocallabBlur::LocallabBlur(): radius(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RADIUS"), MINRAD, MAXRAD, 0.1, 1.5, nullptr, nullptr, &blurSlider2radius, &blurRadius2Slider))), strength(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRENGTH"), 0, 100, 1, 0))), grainFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRAINFRA")))), - isogr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_ISOGR"), 400, 6400, 1, 0))), + isogr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_ISOGR"), 20, 6400, 1, 400))), strengr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRENGR"), 0, 100, 1, 0))), scalegr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SCALEGR"), 0, 100, 1, 100))), medMethod(Gtk::manage(new MyComboBoxText())), From de15da1d59c27a3cb6e1d6c25364c5e1bcf8bd0c Mon Sep 17 00:00:00 2001 From: Thanatomanic <6567747+Thanatomanic@users.noreply.github.com> Date: Thu, 18 Feb 2021 13:36:54 +0100 Subject: [PATCH 092/129] Fix new color propagation method (#6109) * Fixed artifacts thanks to Alberto * Added blur to Color propagation * Clean format code - small improvments * color propagation: Enable old mode at blur = 0 * Improve GUI * color propagation: smooth progress bar for blur > 0 * change label * Some cleanups * color propagation: small speedup for blur > 0 * color propagation: speedup for blur > 0 when region with clipped highlights is small * Speed-up for blur=1 - clean GUI code * color propagation: cleanups * Harmonize events in tonecurve.cc * tonecurve.cc : cleanup * Highlight reconstruction: small changes to gui * Use Gtk::Box instead of Gtk::VBox * Change maximum number of blur levels to 4 * Suppress BENCHFUN * Suppress bad commit locallabtools Co-authored-by: Desmis Co-authored-by: Ingo Weyrich --- rtdata/languages/default | 2 + rtengine/array2D.h | 20 ++ rtengine/color.h | 5 + rtengine/hilite_recon.cc | 191 +++++----- rtengine/imagesource.h | 1 - rtengine/procparams.cc | 5 + rtengine/procparams.h | 1 + rtengine/rawimagesource.cc | 2 +- rtengine/rawimagesource.h | 2 +- rtengine/rescale.h | 27 +- rtgui/paramsedited.cc | 6 + rtgui/paramsedited.h | 1 + rtgui/tonecurve.cc | 711 +++++++++++++++++++------------------ rtgui/tonecurve.h | 2 + 14 files changed, 527 insertions(+), 449 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 8fcd53686..54907f6f0 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1322,6 +1322,7 @@ HISTORY_MSG_FILMNEGATIVE_ENABLED;Film Negative HISTORY_MSG_FILMNEGATIVE_REF_SPOT;FN - Reference input HISTORY_MSG_FILMNEGATIVE_VALUES;Film negative values HISTORY_MSG_HISTMATCHING;Auto-matched tone curve +HISTORY_MSG_HLBL;Color propagation - blur HISTORY_MSG_ICM_OUTPUT_PRIMARIES;Output - Primaries HISTORY_MSG_ICM_OUTPUT_TEMP;Output - ICC-v4 illuminant D HISTORY_MSG_ICM_OUTPUT_TYPE;Output - Type @@ -2367,6 +2368,7 @@ TP_GRADIENT_STRENGTH_TOOLTIP;Filter strength in stops. TP_HLREC_BLEND;Blend TP_HLREC_CIELAB;CIELab Blending TP_HLREC_COLOR;Color Propagation +TP_HLREC_HLBLUR;Blur TP_HLREC_ENA_TOOLTIP;Could be activated by Auto Levels. TP_HLREC_LABEL;Highlight reconstruction TP_HLREC_LUMINANCE;Luminance Recovery diff --git a/rtengine/array2D.h b/rtengine/array2D.h index ca4db3d06..ba2e6a5d3 100644 --- a/rtengine/array2D.h +++ b/rtengine/array2D.h @@ -124,6 +124,26 @@ public: } } + // creator type 3 + array2D(int w, int h, int startx, int starty, T ** source, unsigned int flags = 0) : width(w) + { + rows.resize(h); + if (!(flags & ARRAY2D_BYREFERENCE)) { + buffer.resize(h * width); + T* start = buffer.data(); + for (ssize_t i = 0; i < h; ++i) { + rows[i] = start + i * width; + for (ssize_t j = 0; j < width; ++j) { + rows[i][j] = source[i + starty][j + startx]; + } + } + } else { + for (ssize_t i = 0; i < h; ++i) { + rows[i] = source[i + starty] + startx; + } + } + } + array2D(const array2D& other) : width(other.width), buffer(other.buffer) diff --git a/rtengine/color.h b/rtengine/color.h index b6bf60818..0fae99a5d 100644 --- a/rtengine/color.h +++ b/rtengine/color.h @@ -206,6 +206,11 @@ public: return static_cast(r) * workingspace[1][0] + static_cast(g) * workingspace[1][1] + static_cast(b) * workingspace[1][2]; } + static float rgbLuminance(float r, float g, float b, const float workingspace[3]) + { + return r * workingspace[0] + g * workingspace[1] + b * workingspace[2]; + } + #ifdef __SSE2__ static vfloat rgbLuminance(vfloat r, vfloat g, vfloat b, const vfloat workingspace[3]) { diff --git a/rtengine/hilite_recon.cc b/rtengine/hilite_recon.cc index 4902ad2c2..a45e5d345 100644 --- a/rtengine/hilite_recon.cc +++ b/rtengine/hilite_recon.cc @@ -32,8 +32,8 @@ #include "opthelper.h" #include "rawimagesource.h" #include "rt_math.h" -#define BENCHMARK -#include "StopWatch.h" +//#define BENCHMARK +//#include "StopWatch.h" #include "guidedfilter.h" #include "settings.h" #include "gauss.h" @@ -299,9 +299,9 @@ extern const Settings *settings; using namespace procparams; const ProcParams params; -void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue) +void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue, int blur) { - BENCHFUN + // BENCHFUN double progress = 0.0; if (plistener) { @@ -318,7 +318,7 @@ void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue constexpr float threshpct = 0.25f; constexpr float maxpct = 0.95f; constexpr float epsilon = 0.00001f; - //%%%%%%%%%%%%%%%%%%%% + //for blend algorithm: constexpr float blendthresh = 1.0; // Transform matrixes rgb>lab and back @@ -424,11 +424,6 @@ void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue return; } - // if (plistener) { - // progress += 0.05; - // plistener->setProgress(progress); - // } - constexpr int blurBorder = 256; minx = std::max(0, minx - blurBorder); miny = std::max(0, miny - blurBorder); @@ -442,21 +437,8 @@ void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue array2D temp(bufferWidth, blurHeight); // allocate temporary buffer // blur RGB channels - boxblur2(red, channelblur[0], temp, miny, minx, blurHeight, blurWidth, bufferWidth, 4); - - // if (plistener) { - // progress += 0.07; - // plistener->setProgress(progress); - // } - boxblur2(green, channelblur[1], temp, miny, minx, blurHeight, blurWidth, bufferWidth, 4); - - // if (plistener) { -// progress += 0.07; - // plistener->setProgress(progress); - // } - boxblur2(blue, channelblur[2], temp, miny, minx, blurHeight, blurWidth, bufferWidth, 4); if (plistener) { @@ -470,7 +452,7 @@ void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue #endif for (int i = 0; i < blurHeight; ++i) { for (int j = 0; j < blurWidth; ++j) { - channelblur[0][i][j] = fabsf(channelblur[0][i][j] - red[i + miny][j + minx]) + fabsf(channelblur[1][i][j] - green[i + miny][j + minx]) + fabsf(channelblur[2][i][j] - blue[i + miny][j + minx]); + channelblur[0][i][j] = std::fabs(channelblur[0][i][j] - red[i + miny][j + minx]) + std::fabs(channelblur[1][i][j] - green[i + miny][j + minx]) + std::fabs(channelblur[2][i][j] - blue[i + miny][j + minx]); } } @@ -529,7 +511,7 @@ void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue } array2D hilite_full4(bufferWidth, blurHeight); - //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + //blur highlight data boxblur2(hilite_full[3], hilite_full4, temp, 0, 0, blurHeight, blurWidth, bufferWidth, 1); @@ -566,9 +548,7 @@ void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue multi_array2D hilite(hfw + 1, hfh + 1, ARRAY2D_CLEAR_DATA, 48); - //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // blur and resample highlight data; range=size of blur, pitch=sample spacing - array2D temp2(blurWidth / pitch + (blurWidth % pitch == 0 ? 0 : 1), blurHeight); for (int m = 0; m < 4; ++m) { @@ -651,11 +631,11 @@ void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue } if (hilite[3][2][j] <= epsilon) { - hilite_dir[0 + c][0][j] = hilite_dir0[c][j][2]; + hilite_dir[0 + c][0][j] = hilite_dir0[c][j][2]; } if (hilite[3][3][j] <= epsilon) { - hilite_dir[0 + c][1][j] = hilite_dir0[c][j][3]; + hilite_dir[0 + c][1][j] = hilite_dir0[c][j][3]; } if (hilite[3][hfh - 3][j] <= epsilon) { @@ -938,38 +918,43 @@ void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue hilite[c].free(); } - //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // now reconstruct clipped channels using color ratios //using code from ART - thanks to Alberto Griggio - const int W2 = float(W) / 2.f + 0.5f; - const int H2 = float(H) / 2.f + 0.5f; + const int W2 = blur > 0 ? blurWidth / 2.f + 0.5f : 0; + const int H2 = blur > 0 ? blurHeight / 2.f + 0.5f : 0; array2D mask(W2, H2, ARRAY2D_CLEAR_DATA); array2D rbuf(W2, H2); array2D gbuf(W2, H2); array2D bbuf(W2, H2); array2D guide(W2, H2); - using rtengine::TMatrix; - TMatrix ws = ICCStore::getInstance()->workingSpaceMatrix(params.icm.workingProfile); - - { - array2D rsrc(W, H, red, ARRAY2D_BYREFERENCE); - array2D gsrc(W, H, green, ARRAY2D_BYREFERENCE); - array2D bsrc(W, H, blue, ARRAY2D_BYREFERENCE); - rescaleNearest(rsrc, rbuf, true); - rescaleNearest(gsrc, gbuf, true); - rescaleNearest(bsrc, bbuf, true); + if (blur > 0) { + array2D rbuffer(blurWidth, blurHeight, minx, miny, red, ARRAY2D_BYREFERENCE); + rescaleNearest(rbuffer, rbuf, true); + array2D gbuffer(blurWidth, blurHeight, minx, miny, green, ARRAY2D_BYREFERENCE); + rescaleNearest(gbuffer, gbuf, true); + array2D bbuffer(blurWidth, blurHeight, minx, miny, blue, ARRAY2D_BYREFERENCE); + rescaleNearest(bbuffer, bbuf, true); + LUTf gamma(65536); #ifdef _OPENMP -# pragma omp parallel for + #pragma omp parallel for +#endif + for (int i = 0; i < 65536; ++i) { + gamma[i] = pow_F(i / 65535.f, 2.2f); + } + + const float xyzcam[3] = {static_cast(imatrices.xyz_cam[1][0]), static_cast(imatrices.xyz_cam[1][1]), static_cast(imatrices.xyz_cam[1][2])}; +#ifdef _OPENMP + #pragma omp parallel for #endif for (int y = 0; y < H2; ++y) { for (int x = 0; x < W2; ++x) { - guide[y][x] = Color::igamma_srgb(Color::rgbLuminance(static_cast(rbuf[y][x]), static_cast(gbuf[y][x]), static_cast(bbuf[y][x]), ws)); + guide[y][x] = gamma[Color::rgbLuminance(rbuf[y][x], gbuf[y][x], bbuf[y][x], xyzcam)]; } } } -//end addind code ART +//end adding code ART #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) @@ -1050,21 +1035,20 @@ void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue // Copy converted pixel back if (pixel[0] > blendpt) { const float rfrac = LIM01(medFactor[0] * (pixel[0] - blendpt)); - rgb_blend[0] = rfrac * rgb[0] + (1.f - rfrac) * pixel[0]; + rgb_blend[0] = intp(rfrac, rgb[0], pixel[0]); } if (pixel[1] > blendpt) { const float gfrac = LIM01(medFactor[1] * (pixel[1] - blendpt)); - rgb_blend[1] = gfrac * rgb[1] + (1.f - gfrac) * pixel[1]; + rgb_blend[1] = intp(gfrac, rgb[1], pixel[1]); } if (pixel[2] > blendpt) { const float bfrac = LIM01(medFactor[2] * (pixel[2] - blendpt)); - rgb_blend[2] = bfrac * rgb[2] + (1.f - bfrac) * pixel[2]; + rgb_blend[2] = intp(bfrac, rgb[2], pixel[2]); } //end of HLRecovery_blend estimation - //%%%%%%%%%%%%%%%%%%%%%%% //there are clipped highlights //first, determine weighted average of unclipped extensions (weighting is by 'hue' proximity) @@ -1090,7 +1074,7 @@ void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue } for (int dir = 0; dir < 2; ++dir) { - const float Yhi2 = 1.f / ( hilite_dir[dir * 4 + 0][i1][j1] + hilite_dir[dir * 4 + 1][i1][j1] + hilite_dir[dir * 4 + 2][i1][j1]); + const float Yhi2 = 1.f / (hilite_dir[dir * 4 + 0][i1][j1] + hilite_dir[dir * 4 + 1][i1][j1] + hilite_dir[dir * 4 + 2][i1][j1]); if (Yhi2 < 2.f) { const float dirwt = 1.f / ((1.f + 65535.f * (SQR(rgb_blend[0] - hilite_dir[dir * 4 + 0][i1][j1] * Yhi2) + @@ -1119,10 +1103,11 @@ void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue if (UNLIKELY(!totwt)) { continue; } + //using code from ART - thanks to Alberto Griggio float maskval = 1.f; - int yy = i + miny; - int xx = j + minx; + const int yy = i + miny; + const int xx = j + minx; //now correct clipped channels if (pixel[0] > max_f[0] && pixel[1] > max_f[1] && pixel[2] > max_f[2]) { @@ -1160,63 +1145,81 @@ void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue if (Y > whitept) { const float mult = whitept / Y; - - red[yy][xx] *= mult; + red[yy][xx] *= mult; green[yy][xx] *= mult; - blue[yy][xx] *= mult; + blue[yy][xx] *= mult; } - int ii = (yy) / 2; - int jj = (xx) / 2; - rbuf[ii][jj] = red[yy][xx]; - gbuf[ii][jj] = green[yy][xx]; - bbuf[ii][jj] = blue[yy][xx]; - mask[ii][jj] = maskval; + if (blur > 0) { + const int ii = i / 2; + const int jj = j / 2; + rbuf[ii][jj] = red[yy][xx]; + gbuf[ii][jj] = green[yy][xx]; + bbuf[ii][jj] = blue[yy][xx]; + mask[ii][jj] = maskval; + } } } - if (plistener) { - progress += 0.05; - plistener->setProgress(progress); - } - -// #ifdef _OPENMP -// #pragma omp parallel -// #endif - { - //gaussianBlur(mask, mask, W/2, H/2, 5); - // gaussianBlur(rbuf, rbuf, W/2, H/2, 1); - // gaussianBlur(gbuf, gbuf, W/2, H/2, 1); - // gaussianBlur(bbuf, bbuf, W/2, H/2, 1); - guidedFilter(guide, mask, mask, 2, 0.001f, true, 1); - guidedFilter(guide, rbuf, rbuf, 3, 0.01f * 65535.f, true, 1); - guidedFilter(guide, gbuf, gbuf, 3, 0.01f * 65535.f, true, 1); - guidedFilter(guide, bbuf, bbuf, 3, 0.01f * 65535.f, true, 1); - } + if (blur > 0) { + if (plistener) { + progress += 0.05; + plistener->setProgress(progress); + } + blur = rtengine::LIM(blur - 1, 0, 3); - { + constexpr float vals[4][3] = {{4.0f, 0.3f, 0.3f}, + // {3.5f, 0.5f, 0.2f}, + {3.0f, 1.0f, 0.1f}, + {3.0f, 2.0f, 0.01f}, + {2.0f, 3.0f, 0.001f} + }; + + const float rad1 = vals[blur][0]; + const float rad2 = vals[blur][1]; + const float th = vals[blur][2]; + + guidedFilter(guide, mask, mask, rad1, th, true, 1); + if (plistener) { + progress += 0.03; + plistener->setProgress(progress); + } + if (blur > 0) { //no use of 2nd guidedFilter if Blur = 0 (slider to 1)..speed-up and very small differences. + guidedFilter(guide, rbuf, rbuf, rad2, 0.01f * 65535.f, true, 1); + if (plistener) { + progress += 0.03; + plistener->setProgress(progress); + } + guidedFilter(guide, gbuf, gbuf, rad2, 0.01f * 65535.f, true, 1); + if (plistener) { + progress += 0.03; + plistener->setProgress(progress); + } + guidedFilter(guide, bbuf, bbuf, rad2, 0.01f * 65535.f, true, 1); + if (plistener) { + progress += 0.03; + plistener->setProgress(progress); + } + } #ifdef _OPENMP - #pragma omp parallel for + #pragma omp parallel for schedule(dynamic,16) #endif - for (int y = 0; y < H; ++y) { - float fy = y * 0.5f; - int yy = y / 2; - for (int x = 0; x < W; ++x) { - float fx = x * 0.5f; - int xx = x / 2; - float m = mask[yy][xx]; + for (int y = 0; y < blurHeight; ++y) { + const float fy = y * 0.5f; + const int yy = y / 2; + for (int x = 0; x < blurWidth; ++x) { + const int xx = x / 2; + const float m = mask[yy][xx]; if (m > 0.f) { - red[y][x] = intp(m, getBilinearValue(rbuf, fx, fy), red[y][x]); - green[y][x] = intp(m, getBilinearValue(gbuf, fx, fy), green[y][x]); - blue[y][x] = intp(m, getBilinearValue(bbuf, fx, fy), blue[y][x]); + const float fx = x * 0.5f; + red[y + miny][x + minx] = intp(m, getBilinearValue(rbuf, fx, fy), red[y + miny][x + minx]); + green[y + miny][x + minx] = intp(m, getBilinearValue(gbuf, fx, fy), green[y + miny][x + minx]); + blue[y + miny][x + minx] = intp(m, getBilinearValue(bbuf, fx, fy), blue[y + miny][x + minx]); } } } } - - - if (plistener) { plistener->setProgress(1.00); } diff --git a/rtengine/imagesource.h b/rtengine/imagesource.h index a1c3731f1..25c024ed2 100644 --- a/rtengine/imagesource.h +++ b/rtengine/imagesource.h @@ -98,7 +98,6 @@ public: virtual void retinexPrepareBuffers (const procparams::ColorManagementParams& cmp, const procparams::RetinexParams &retinexParams, multi_array2D &conversionBuffer, LUTu &lhist16RETI) {}; virtual void flush () = 0; virtual void HLRecovery_Global (const procparams::ToneCurveParams &hrp) {}; - virtual void HLRecovery_inpaint (float** red, float** green, float** blue) {}; virtual bool isRGBSourceModified () const = 0; // tracks whether cached rgb output of demosaic has been modified diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 0bbcaa907..5a1bb0ff8 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -385,6 +385,7 @@ ToneCurveParams::ToneCurveParams() : saturation(0), shcompr(50), hlcompr(0), + hlbl(0), hlcomprthresh(0), histmatching(false), fromHistMatching(false), @@ -410,6 +411,7 @@ bool ToneCurveParams::isPanningRelatedChange(const ToneCurveParams& other) const && saturation == other.saturation && shcompr == other.shcompr && hlcompr == other.hlcompr + && hlbl == other.hlbl && hlcomprthresh == other.hlcomprthresh && histmatching == other.histmatching && clampOOG == other.clampOOG); @@ -433,6 +435,7 @@ bool ToneCurveParams::operator ==(const ToneCurveParams& other) const && saturation == other.saturation && shcompr == other.shcompr && hlcompr == other.hlcompr + && hlbl == other.hlbl && hlcomprthresh == other.hlcomprthresh && histmatching == other.histmatching && fromHistMatching == other.fromHistMatching @@ -5399,6 +5402,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo // Highlight recovery saveToKeyfile(!pedited || pedited->toneCurve.hrenabled, "HLRecovery", "Enabled", toneCurve.hrenabled, keyFile); saveToKeyfile(!pedited || pedited->toneCurve.method, "HLRecovery", "Method", toneCurve.method, keyFile); + saveToKeyfile(!pedited || pedited->toneCurve.hlbl, "HLRecovery", "Hlbl", toneCurve.hlbl, keyFile); const std::map tc_mapping = { {ToneCurveMode::STD, "Standard"}, @@ -6924,6 +6928,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) if (keyFile.has_group("HLRecovery")) { assignFromKeyfile(keyFile, "HLRecovery", "Enabled", pedited, toneCurve.hrenabled, pedited->toneCurve.hrenabled); assignFromKeyfile(keyFile, "HLRecovery", "Method", pedited, toneCurve.method, pedited->toneCurve.method); + assignFromKeyfile(keyFile, "HLRecovery", "Hlbl", pedited, toneCurve.hlbl, pedited->toneCurve.hlbl); } if (keyFile.has_group("Channel Mixer")) { diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 45ce8005d..1a215b3d0 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -297,6 +297,7 @@ struct ToneCurveParams { int saturation; int shcompr; int hlcompr; // Highlight Recovery's compression + int hlbl; // Highlight Recovery's compression int hlcomprthresh; // Highlight Recovery's threshold bool histmatching; // histogram matching bool fromHistMatching; diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index de0f07422..7ae919e0a 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -2438,7 +2438,7 @@ void RawImageSource::HLRecovery_Global(const ToneCurveParams &hrp) printf ("Applying Highlight Recovery: Color propagation...\n"); } - HLRecovery_inpaint (red, green, blue); + HLRecovery_inpaint (red, green, blue, hrp.hlbl); rgbSourceModified = true; } } diff --git a/rtengine/rawimagesource.h b/rtengine/rawimagesource.h index 945c9da3d..16677b1da 100644 --- a/rtengine/rawimagesource.h +++ b/rtengine/rawimagesource.h @@ -195,7 +195,7 @@ public: static void inverse33(const double (*coeff)[3], double (*icoeff)[3]); void MSR(float** luminance, float **originalLuminance, float **exLuminance, const LUTf& mapcurve, bool mapcontlutili, int width, int height, const procparams::RetinexParams &deh, const RetinextransmissionCurve & dehatransmissionCurve, const RetinexgaintransmissionCurve & dehagaintransmissionCurve, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax); - void HLRecovery_inpaint (float** red, float** green, float** blue) override; + void HLRecovery_inpaint (float** red, float** green, float** blue, int blur); static void HLRecovery_Luminance (float* rin, float* gin, float* bin, float* rout, float* gout, float* bout, int width, float maxval); static void HLRecovery_CIELab (float* rin, float* gin, float* bin, float* rout, float* gout, float* bout, int width, float maxval, double cam[3][3], double icam[3][3]); static void HLRecovery_blend (float* rin, float* gin, float* bin, int width, float maxval, float* hlmax); diff --git a/rtengine/rescale.h b/rtengine/rescale.h index 3126a7c58..2a5892224 100644 --- a/rtengine/rescale.h +++ b/rtengine/rescale.h @@ -35,23 +35,22 @@ inline float getBilinearValue(const array2D &src, float x, float y) const int H = src.getHeight(); // Get integer and fractional parts of numbers - int xi = x; - int yi = y; - float xf = x - xi; - float yf = y - yi; - int xi1 = std::min(xi + 1, W - 1); - int yi1 = std::min(yi + 1, H - 1); + const int xi = x; + const int yi = y; + const float xf = x - xi; + const float yf = y - yi; + const int xi1 = std::min(xi + 1, W - 1); + const int yi1 = std::min(yi + 1, H - 1); - float bl = src[yi][xi]; - float br = src[yi][xi1]; - float tl = src[yi1][xi]; - float tr = src[yi1][xi1]; + const float bl = src[yi][xi]; + const float br = src[yi][xi1]; + const float tl = src[yi1][xi]; + const float tr = src[yi1][xi1]; // interpolate - float b = xf * br + (1.f - xf) * bl; - float t = xf * tr + (1.f - xf) * tl; - float pxf = yf * t + (1.f - yf) * b; - return pxf; + const float b = intp(xf, br, bl); + const float t = intp(xf, tr, tl); + return intp(yf, t, b); } diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index d202577cf..a75fe8562 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -47,6 +47,7 @@ void ParamsEdited::set(bool v) toneCurve.saturation = v; toneCurve.shcompr = v; toneCurve.hlcompr = v; + toneCurve.hlbl = v; toneCurve.hlcomprthresh = v; toneCurve.autoexp = v; toneCurve.clip = v; @@ -720,6 +721,7 @@ void ParamsEdited::initFrom(const std::vector& toneCurve.saturation = toneCurve.saturation && p.toneCurve.saturation == other.toneCurve.saturation; toneCurve.shcompr = toneCurve.shcompr && p.toneCurve.shcompr == other.toneCurve.shcompr; toneCurve.hlcompr = toneCurve.hlcompr && p.toneCurve.hlcompr == other.toneCurve.hlcompr; + toneCurve.hlbl = toneCurve.hlbl && p.toneCurve.hlbl == other.toneCurve.hlbl; toneCurve.hlcomprthresh = toneCurve.hlcomprthresh && p.toneCurve.hlcomprthresh == other.toneCurve.hlcomprthresh; toneCurve.autoexp = toneCurve.autoexp && p.toneCurve.autoexp == other.toneCurve.autoexp; toneCurve.clip = toneCurve.clip && p.toneCurve.clip == other.toneCurve.clip; @@ -2008,6 +2010,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.toneCurve.method = mods.toneCurve.method; } + if (toneCurve.hlbl) { + toEdit.toneCurve.hlbl = mods.toneCurve.hlbl; + } + if (toneCurve.histmatching) { toEdit.toneCurve.histmatching = mods.toneCurve.histmatching; } diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 3b524c23f..ec1d9b8f4 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -51,6 +51,7 @@ struct ToneCurveParamsEdited { bool saturation; bool shcompr; bool hlcompr; + bool hlbl; bool hlcomprthresh; bool autoexp; bool clip; diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc index 5e6f1fe31..8a33575ca 100644 --- a/rtgui/tonecurve.cc +++ b/rtgui/tonecurve.cc @@ -21,12 +21,9 @@ #include #include "tonecurve.h" - -#include "adjuster.h" #include "curveeditor.h" #include "curveeditorgroup.h" #include "eventmapper.h" -#include "ppversion.h" #include "options.h" #include "../rtengine/procparams.h" @@ -36,18 +33,19 @@ using namespace rtengine; using namespace rtengine::procparams; -ToneCurve::ToneCurve () : FoldableToolPanel(this, "tonecurve", M("TP_EXPOSURE_LABEL")) +ToneCurve::ToneCurve() : FoldableToolPanel(this, "tonecurve", M("TP_EXPOSURE_LABEL")) { auto m = ProcEventMapper::getInstance(); EvHistMatching = m->newEvent(AUTOEXP, "HISTORY_MSG_HISTMATCHING"); EvHistMatchingBatch = m->newEvent(M_VOID, "HISTORY_MSG_HISTMATCHING"); EvClampOOG = m->newEvent(DARKFRAME, "HISTORY_MSG_CLAMPOOG"); + EvHLbl = m->newEvent(DEMOSAIC, "HISTORY_MSG_HLBL"); CurveListener::setMulti(true); std::vector bottomMilestones; - bottomMilestones.push_back( GradientMilestone(0., 0., 0., 0.) ); - bottomMilestones.push_back( GradientMilestone(1., 1., 1., 1.) ); + bottomMilestones.push_back(GradientMilestone(0., 0., 0., 0.)); + bottomMilestones.push_back(GradientMilestone(1., 1., 1., 1.)); //----------- OOG clamping ---------------------------------- clampOOG = Gtk::manage(new Gtk::CheckButton(M("TP_EXPOSURE_CLAMPOOG"))); @@ -59,33 +57,33 @@ ToneCurve::ToneCurve () : FoldableToolPanel(this, "tonecurve", M("TP_EXPOSURE_LA abox = Gtk::manage (new Gtk::Box ()); abox->set_spacing (4); - autolevels = Gtk::manage (new Gtk::ToggleButton (M("TP_EXPOSURE_AUTOLEVELS"))); - autolevels->set_tooltip_markup (M("TP_EXPOSURE_AUTOLEVELS_TIP")); - autoconn = autolevels->signal_toggled().connect( sigc::mem_fun(*this, &ToneCurve::autolevels_toggled) ); + autolevels = Gtk::manage(new Gtk::ToggleButton(M("TP_EXPOSURE_AUTOLEVELS"))); + autolevels->set_tooltip_markup(M("TP_EXPOSURE_AUTOLEVELS_TIP")); + autoconn = autolevels->signal_toggled().connect(sigc::mem_fun(*this, &ToneCurve::autolevels_toggled)); - lclip = Gtk::manage (new Gtk::Label (M("TP_EXPOSURE_CLIP"))); - lclip->set_tooltip_text (M("TP_EXPOSURE_CLIP_TIP")); + lclip = Gtk::manage(new Gtk::Label(M("TP_EXPOSURE_CLIP"))); + lclip->set_tooltip_text(M("TP_EXPOSURE_CLIP_TIP")); - sclip = Gtk::manage (new MySpinButton ()); - sclip->set_range (0.0, 0.99); - sclip->set_increments (0.01, 0.10); - sclip->set_value (0.02); - sclip->set_digits (2); + sclip = Gtk::manage(new MySpinButton()); + sclip->set_range(0.0, 0.99); + sclip->set_increments(0.01, 0.10); + sclip->set_value(0.02); + sclip->set_digits(2); sclip->set_width_chars(4); sclip->set_max_width_chars(4); - sclip->signal_value_changed().connect( sigc::mem_fun(*this, &ToneCurve::clip_changed) ); + sclip->signal_value_changed().connect(sigc::mem_fun(*this, &ToneCurve::clip_changed)); - neutral = Gtk::manage (new Gtk::Button (M("TP_NEUTRAL"))); - neutral->set_tooltip_text (M("TP_NEUTRAL_TIP")); - neutralconn = neutral->signal_pressed().connect( sigc::mem_fun(*this, &ToneCurve::neutral_pressed) ); + neutral = Gtk::manage(new Gtk::Button(M("TP_NEUTRAL"))); + neutral->set_tooltip_text(M("TP_NEUTRAL_TIP")); + neutralconn = neutral->signal_pressed().connect(sigc::mem_fun(*this, &ToneCurve::neutral_pressed)); neutral->show(); - abox->pack_start (*autolevels, true, true, 0); + abox->pack_start(*autolevels, true, true, 0); // pack_end is used for these controls as autolevels is replaceable using pack_start in batchmode - abox->pack_end (*neutral, true, true, 0); - abox->pack_end (*sclip, false, false, 0); - abox->pack_end (*lclip, false, false, 0); - pack_start (*abox); + abox->pack_end(*neutral, true, true, 0); + abox->pack_end(*sclip, false, false, 0); + abox->pack_end(*lclip, false, false, 0); + pack_start(*abox); //-------------- Highlight Reconstruction ----------------- pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL))); @@ -93,20 +91,31 @@ ToneCurve::ToneCurve () : FoldableToolPanel(this, "tonecurve", M("TP_EXPOSURE_LA hrenabled = Gtk::manage (new Gtk::CheckButton (M("TP_HLREC_LABEL"))); hrenabled->set_active (false); hrenabled->set_tooltip_markup (M("TP_HLREC_ENA_TOOLTIP")); - pack_start (*hrenabled); method = Gtk::manage (new MyComboBoxText ()); method->append (M("TP_HLREC_LUMINANCE")); method->append (M("TP_HLREC_CIELAB")); method->append (M("TP_HLREC_COLOR")); method->append (M("TP_HLREC_BLEND")); + Gtk::Box *hrVBox; + hrVBox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); + hrVBox->set_spacing(2); + + method->set_active(0); + Gtk::Frame* const hrFrame = Gtk::manage(new Gtk::Frame()); + hrFrame->set_label_align(0.025, 0.5); + hrFrame->set_label_widget(*hrenabled); - method->set_active (0); hlrbox = Gtk::manage (new Gtk::Box ()); Gtk::Label* lab = Gtk::manage (new Gtk::Label (M("TP_HLREC_METHOD"))); - hlrbox->pack_start (*lab, Gtk::PACK_SHRINK, 4); + hlrbox->pack_start (*lab, Gtk::PACK_SHRINK); hlrbox->pack_start (*method); - pack_start (*hlrbox); + hlbl = Gtk::manage(new Adjuster(M("TP_HLREC_HLBLUR"), 0, 4, 1, 0)); + + hrVBox->pack_start(*hlrbox, Gtk::PACK_SHRINK); + hrVBox->pack_start(*hlbl); + hrFrame->add(*hrVBox); + pack_start(*hrFrame); enaconn = hrenabled->signal_toggled().connect( sigc::mem_fun(*this, &ToneCurve::hrenabledChanged) ); methconn = method->signal_changed().connect ( sigc::mem_fun(*this, &ToneCurve::methodChanged) ); @@ -114,32 +123,32 @@ ToneCurve::ToneCurve () : FoldableToolPanel(this, "tonecurve", M("TP_EXPOSURE_LA //----------- Exposure Compensation --------------------- pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL))); - expcomp = Gtk::manage (new Adjuster (M("TP_EXPOSURE_EXPCOMP"), -5, 12, 0.05, 0)); + expcomp = Gtk::manage(new Adjuster(M("TP_EXPOSURE_EXPCOMP"), -5, 12, 0.05, 0)); expcomp->setLogScale(2, 0, true); - pack_start (*expcomp); + pack_start(*expcomp); //----------- Highlight recovery & threshold ------------- - hlcompr = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTS"), 0, 500, 1, 0)); - pack_start (*hlcompr); - hlcomprthresh = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTSTHRESHOLD"), 0, 100, 1, 0)); - pack_start (*hlcomprthresh); + hlcompr = Gtk::manage(new Adjuster(M("TP_EXPOSURE_COMPRHIGHLIGHTS"), 0, 500, 1, 0)); + pack_start(*hlcompr); + hlcomprthresh = Gtk::manage(new Adjuster(M("TP_EXPOSURE_COMPRHIGHLIGHTSTHRESHOLD"), 0, 100, 1, 0)); + pack_start(*hlcomprthresh); //----------- Black Level & Compression ------------------- - black = Gtk::manage (new Adjuster (M("TP_EXPOSURE_BLACKLEVEL"), -16384, 32768, 50, 0)); + black = Gtk::manage(new Adjuster(M("TP_EXPOSURE_BLACKLEVEL"), -16384, 32768, 50, 0)); black->setLogScale(10, 0, true); - pack_start (*black); - shcompr = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRSHADOWS"), 0, 100, 1, 50)); - pack_start (*shcompr); + pack_start(*black); + shcompr = Gtk::manage(new Adjuster(M("TP_EXPOSURE_COMPRSHADOWS"), 0, 100, 1, 50)); + pack_start(*shcompr); pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_HORIZONTAL))); //---------Brightness / Contrast ------------------------- - brightness = Gtk::manage (new Adjuster (M("TP_EXPOSURE_BRIGHTNESS"), -100, 100, 1, 0)); - pack_start (*brightness); - contrast = Gtk::manage (new Adjuster (M("TP_EXPOSURE_CONTRAST"), -100, 100, 1, 0)); - pack_start (*contrast); - saturation = Gtk::manage (new Adjuster (M("TP_EXPOSURE_SATURATION"), -100, 100, 1, 0)); - pack_start (*saturation); + brightness = Gtk::manage(new Adjuster(M("TP_EXPOSURE_BRIGHTNESS"), -100, 100, 1, 0)); + pack_start(*brightness); + contrast = Gtk::manage(new Adjuster(M("TP_EXPOSURE_CONTRAST"), -100, 100, 1, 0)); + pack_start(*contrast); + saturation = Gtk::manage(new Adjuster(M("TP_EXPOSURE_SATURATION"), -100, 100, 1, 0)); + pack_start(*saturation); brightness->setLogScale(2, 0, true); contrast->setLogScale(2, 0, true); @@ -153,18 +162,18 @@ ToneCurve::ToneCurve () : FoldableToolPanel(this, "tonecurve", M("TP_EXPOSURE_LA histmatchconn = histmatching->signal_toggled().connect(sigc::mem_fun(*this, &ToneCurve::histmatchingToggled)); pack_start(*histmatching, true, true, 2); - toneCurveMode = Gtk::manage (new MyComboBoxText ()); - toneCurveMode->append (M("TP_EXPOSURE_TCMODE_STANDARD")); - toneCurveMode->append (M("TP_EXPOSURE_TCMODE_WEIGHTEDSTD")); - toneCurveMode->append (M("TP_EXPOSURE_TCMODE_FILMLIKE")); - toneCurveMode->append (M("TP_EXPOSURE_TCMODE_SATANDVALBLENDING")); - toneCurveMode->append (M("TP_EXPOSURE_TCMODE_LUMINANCE")); - toneCurveMode->append (M("TP_EXPOSURE_TCMODE_PERCEPTUAL")); - toneCurveMode->set_active (0); + toneCurveMode = Gtk::manage(new MyComboBoxText()); + toneCurveMode->append(M("TP_EXPOSURE_TCMODE_STANDARD")); + toneCurveMode->append(M("TP_EXPOSURE_TCMODE_WEIGHTEDSTD")); + toneCurveMode->append(M("TP_EXPOSURE_TCMODE_FILMLIKE")); + toneCurveMode->append(M("TP_EXPOSURE_TCMODE_SATANDVALBLENDING")); + toneCurveMode->append(M("TP_EXPOSURE_TCMODE_LUMINANCE")); + toneCurveMode->append(M("TP_EXPOSURE_TCMODE_PERCEPTUAL")); + toneCurveMode->set_active(0); toneCurveMode->set_tooltip_text(M("TP_EXPOSURE_TCMODE_LABEL1")); - curveEditorG = new CurveEditorGroup (options.lastToneCurvesDir, M("TP_EXPOSURE_CURVEEDITOR1")); - curveEditorG->setCurveListener (this); + curveEditorG = new CurveEditorGroup(options.lastToneCurvesDir, M("TP_EXPOSURE_CURVEEDITOR1")); + curveEditorG->setCurveListener(this); shape = static_cast(curveEditorG->addCurve(CT_Diagonal, "", toneCurveMode)); shape->setEditID(EUID_ToneCurve1, BT_IMAGEFLOAT); @@ -174,24 +183,24 @@ ToneCurve::ToneCurve () : FoldableToolPanel(this, "tonecurve", M("TP_EXPOSURE_LA // This will add the reset button at the end of the curveType buttons curveEditorG->curveListComplete(); - pack_start( *curveEditorG, Gtk::PACK_SHRINK, 2); + pack_start(*curveEditorG, Gtk::PACK_SHRINK, 2); - tcmodeconn = toneCurveMode->signal_changed().connect( sigc::mem_fun(*this, &ToneCurve::curveMode1Changed), true ); + tcmodeconn = toneCurveMode->signal_changed().connect(sigc::mem_fun(*this, &ToneCurve::curveMode1Changed), true); //----------- Curve 2 ------------------------------ - toneCurveMode2 = Gtk::manage (new MyComboBoxText ()); - toneCurveMode2->append (M("TP_EXPOSURE_TCMODE_STANDARD")); - toneCurveMode2->append (M("TP_EXPOSURE_TCMODE_WEIGHTEDSTD")); - toneCurveMode2->append (M("TP_EXPOSURE_TCMODE_FILMLIKE")); - toneCurveMode2->append (M("TP_EXPOSURE_TCMODE_SATANDVALBLENDING")); - toneCurveMode2->append (M("TP_EXPOSURE_TCMODE_LUMINANCE")); - toneCurveMode2->append (M("TP_EXPOSURE_TCMODE_PERCEPTUAL")); - toneCurveMode2->set_active (0); + toneCurveMode2 = Gtk::manage(new MyComboBoxText()); + toneCurveMode2->append(M("TP_EXPOSURE_TCMODE_STANDARD")); + toneCurveMode2->append(M("TP_EXPOSURE_TCMODE_WEIGHTEDSTD")); + toneCurveMode2->append(M("TP_EXPOSURE_TCMODE_FILMLIKE")); + toneCurveMode2->append(M("TP_EXPOSURE_TCMODE_SATANDVALBLENDING")); + toneCurveMode2->append(M("TP_EXPOSURE_TCMODE_LUMINANCE")); + toneCurveMode2->append(M("TP_EXPOSURE_TCMODE_PERCEPTUAL")); + toneCurveMode2->set_active(0); toneCurveMode2->set_tooltip_text(M("TP_EXPOSURE_TCMODE_LABEL2")); - curveEditorG2 = new CurveEditorGroup (options.lastToneCurvesDir, M("TP_EXPOSURE_CURVEEDITOR2")); - curveEditorG2->setCurveListener (this); + curveEditorG2 = new CurveEditorGroup(options.lastToneCurvesDir, M("TP_EXPOSURE_CURVEEDITOR2")); + curveEditorG2->setCurveListener(this); shape2 = static_cast(curveEditorG2->addCurve(CT_Diagonal, "", toneCurveMode2)); shape2->setEditID(EUID_ToneCurve2, BT_IMAGEFLOAT); @@ -202,22 +211,23 @@ ToneCurve::ToneCurve () : FoldableToolPanel(this, "tonecurve", M("TP_EXPOSURE_LA curveEditorG2->curveListComplete(); curveEditorG2->setTooltip(M("TP_EXPOSURE_CURVEEDITOR2_TOOLTIP")); - pack_start( *curveEditorG2, Gtk::PACK_SHRINK, 2); + pack_start(*curveEditorG2, Gtk::PACK_SHRINK, 2); - tcmode2conn = toneCurveMode2->signal_changed().connect( sigc::mem_fun(*this, &ToneCurve::curveMode2Changed), true ); + tcmode2conn = toneCurveMode2->signal_changed().connect(sigc::mem_fun(*this, &ToneCurve::curveMode2Changed), true); // --------- Set Up Listeners ------------- - expcomp->setAdjusterListener (this); - brightness->setAdjusterListener (this); - black->setAdjusterListener (this); - hlcompr->setAdjusterListener (this); - hlcomprthresh->setAdjusterListener (this); - shcompr->setAdjusterListener (this); - contrast->setAdjusterListener (this); - saturation->setAdjusterListener (this); + expcomp->setAdjusterListener(this); + brightness->setAdjusterListener(this); + black->setAdjusterListener(this); + hlcompr->setAdjusterListener(this); + hlbl->setAdjusterListener(this); + hlcomprthresh->setAdjusterListener(this); + shcompr->setAdjusterListener(this); + contrast->setAdjusterListener(this); + saturation->setAdjusterListener(this); } -ToneCurve::~ToneCurve () +ToneCurve::~ToneCurve() { idle_register.destroy(); @@ -225,38 +235,39 @@ ToneCurve::~ToneCurve () delete curveEditorG2; } -void ToneCurve::read (const ProcParams* pp, const ParamsEdited* pedited) +void ToneCurve::read(const ProcParams* pp, const ParamsEdited* pedited) { - disableListener (); + disableListener(); tcmodeconn.block(true); tcmode2conn.block(true); - autoconn.block (true); + autoconn.block(true); - autolevels->set_active (pp->toneCurve.autoexp); + autolevels->set_active(pp->toneCurve.autoexp); lastAuto = pp->toneCurve.autoexp; - sclip->set_value (pp->toneCurve.clip); + sclip->set_value(pp->toneCurve.clip); - expcomp->setValue (pp->toneCurve.expcomp); - black->setValue (pp->toneCurve.black); - hlcompr->setValue (pp->toneCurve.hlcompr); - hlcomprthresh->setValue (pp->toneCurve.hlcomprthresh); - shcompr->setValue (pp->toneCurve.shcompr); + expcomp->setValue(pp->toneCurve.expcomp); + black->setValue(pp->toneCurve.black); + hlcompr->setValue(pp->toneCurve.hlcompr); + hlbl->setValue(pp->toneCurve.hlbl); + hlcomprthresh->setValue(pp->toneCurve.hlcomprthresh); + shcompr->setValue(pp->toneCurve.shcompr); if (!black->getAddMode() && !batchMode) { - shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect + shcompr->set_sensitive(!((int)black->getValue() == 0)); //at black=0 shcompr value has no effect } if (!hlcompr->getAddMode() && !batchMode) { - hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect + hlcomprthresh->set_sensitive(!((int)hlcompr->getValue() == 0)); //at hlcompr=0 hlcomprthresh value has no effect } - brightness->setValue (pp->toneCurve.brightness); - contrast->setValue (pp->toneCurve.contrast); - saturation->setValue (pp->toneCurve.saturation); - shape->setCurve (pp->toneCurve.curve); - shape2->setCurve (pp->toneCurve.curve2); + brightness->setValue(pp->toneCurve.brightness); + contrast->setValue(pp->toneCurve.contrast); + saturation->setValue(pp->toneCurve.saturation); + shape->setCurve(pp->toneCurve.curve); + shape2->setCurve(pp->toneCurve.curve2); toneCurveMode->set_active(rtengine::toUnderlying(pp->toneCurve.curveMode)); toneCurveMode2->set_active(rtengine::toUnderlying(pp->toneCurve.curveMode2)); @@ -266,19 +277,20 @@ void ToneCurve::read (const ProcParams* pp, const ParamsEdited* pedited) clampOOG->set_active(pp->toneCurve.clampOOG); if (pedited) { - expcomp->setEditedState (pedited->toneCurve.expcomp ? Edited : UnEdited); - black->setEditedState (pedited->toneCurve.black ? Edited : UnEdited); - hlcompr->setEditedState (pedited->toneCurve.hlcompr ? Edited : UnEdited); - hlcomprthresh->setEditedState (pedited->toneCurve.hlcomprthresh ? Edited : UnEdited); - shcompr->setEditedState (pedited->toneCurve.shcompr ? Edited : UnEdited); - brightness->setEditedState (pedited->toneCurve.brightness ? Edited : UnEdited); - contrast->setEditedState (pedited->toneCurve.contrast ? Edited : UnEdited); - saturation->setEditedState (pedited->toneCurve.saturation ? Edited : UnEdited); - autolevels->set_inconsistent (!pedited->toneCurve.autoexp); + expcomp->setEditedState(pedited->toneCurve.expcomp ? Edited : UnEdited); + black->setEditedState(pedited->toneCurve.black ? Edited : UnEdited); + hlcompr->setEditedState(pedited->toneCurve.hlcompr ? Edited : UnEdited); + hlbl->setEditedState(pedited->toneCurve.hlbl ? Edited : UnEdited); + hlcomprthresh->setEditedState(pedited->toneCurve.hlcomprthresh ? Edited : UnEdited); + shcompr->setEditedState(pedited->toneCurve.shcompr ? Edited : UnEdited); + brightness->setEditedState(pedited->toneCurve.brightness ? Edited : UnEdited); + contrast->setEditedState(pedited->toneCurve.contrast ? Edited : UnEdited); + saturation->setEditedState(pedited->toneCurve.saturation ? Edited : UnEdited); + autolevels->set_inconsistent(!pedited->toneCurve.autoexp); clipDirty = pedited->toneCurve.clip; - shape->setUnChanged (!pedited->toneCurve.curve); - shape2->setUnChanged (!pedited->toneCurve.curve2); - hrenabled->set_inconsistent (!pedited->toneCurve.hrenabled); + shape->setUnChanged(!pedited->toneCurve.curve); + shape2->setUnChanged(!pedited->toneCurve.curve2); + hrenabled->set_inconsistent(!pedited->toneCurve.hrenabled); if (!pedited->toneCurve.curveMode) { toneCurveMode->set_active(6); @@ -292,70 +304,65 @@ void ToneCurve::read (const ProcParams* pp, const ParamsEdited* pedited) clampOOG->set_inconsistent(!pedited->toneCurve.clampOOG); } - enaconn.block (true); - hrenabled->set_active (pp->toneCurve.hrenabled); - enaconn.block (false); + enaconn.block(true); + hrenabled->set_active(pp->toneCurve.hrenabled); + enaconn.block(false); if (pedited && !pedited->toneCurve.method) { - method->set_active (4); + method->set_active(4); } else if (pp->toneCurve.method == "Luminance") { - method->set_active (0); + method->set_active(0); } else if (pp->toneCurve.method == "CIELab blending") { - method->set_active (1); + method->set_active(1); } else if (pp->toneCurve.method == "Color") { - method->set_active (2); + method->set_active(2); } else if (pp->toneCurve.method == "Blend") { - method->set_active (3); + method->set_active(3); } - if (!batchMode) { - if (hrenabled->get_active()) { - hlrbox->show(); - } else { - hlrbox->hide(); - } - } + hrenabledChanged(); lasthrEnabled = pp->toneCurve.hrenabled; - autoconn.block (false); + autoconn.block(false); tcmode2conn.block(false); tcmodeconn.block(false); - enableListener (); + enableListener(); } -void ToneCurve::autoOpenCurve () +void ToneCurve::autoOpenCurve() { shape->openIfNonlinear(); shape2->openIfNonlinear(); } -void ToneCurve::setEditProvider (EditDataProvider *provider) +void ToneCurve::setEditProvider(EditDataProvider *provider) { shape->setEditProvider(provider); shape2->setEditProvider(provider); } -void ToneCurve::write (ProcParams* pp, ParamsEdited* pedited) +void ToneCurve::write(ProcParams* pp, ParamsEdited* pedited) { pp->toneCurve.autoexp = autolevels->get_active(); - pp->toneCurve.clip = sclip->get_value (); - pp->toneCurve.expcomp = expcomp->getValue (); - pp->toneCurve.black = (int)black->getValue (); - pp->toneCurve.hlcompr = (int)hlcompr->getValue (); - pp->toneCurve.hlcomprthresh = (int)hlcomprthresh->getValue (); - pp->toneCurve.shcompr = (int)shcompr->getValue (); - pp->toneCurve.brightness = (int)brightness->getValue (); - pp->toneCurve.contrast = (int)contrast->getValue (); - pp->toneCurve.saturation = (int)saturation->getValue (); - pp->toneCurve.curve = shape->getCurve (); - pp->toneCurve.curve2 = shape2->getCurve (); + pp->toneCurve.clip = sclip->get_value(); + pp->toneCurve.expcomp = expcomp->getValue(); + pp->toneCurve.black = black->getValue(); + pp->toneCurve.hlcompr = hlcompr->getValue(); + pp->toneCurve.hlbl = hlbl->getValue(); + pp->toneCurve.hlcomprthresh = hlcomprthresh->getValue(); + pp->toneCurve.shcompr = shcompr->getValue(); + pp->toneCurve.brightness = brightness->getValue(); + pp->toneCurve.contrast = contrast->getValue(); + pp->toneCurve.saturation = saturation->getValue(); + pp->toneCurve.curve = shape->getCurve(); + pp->toneCurve.curve2 = shape2->getCurve(); int tcMode = toneCurveMode->get_active_row_number(); - if (tcMode == 0) { + if (tcMode == 0) { pp->toneCurve.curveMode = ToneCurveMode::STD; } else if (tcMode == 1) { pp->toneCurve.curveMode = ToneCurveMode::WEIGHTEDSTD; @@ -371,7 +378,7 @@ void ToneCurve::write (ProcParams* pp, ParamsEdited* pedited) tcMode = toneCurveMode2->get_active_row_number(); - if (tcMode == 0) { + if (tcMode == 0) { pp->toneCurve.curveMode2 = ToneCurveMode::STD; } else if (tcMode == 1) { pp->toneCurve.curveMode2 = ToneCurveMode::WEIGHTEDSTD; @@ -390,22 +397,23 @@ void ToneCurve::write (ProcParams* pp, ParamsEdited* pedited) pp->toneCurve.clampOOG = clampOOG->get_active(); if (pedited) { - pedited->toneCurve.expcomp = expcomp->getEditedState (); - pedited->toneCurve.black = black->getEditedState (); - pedited->toneCurve.hlcompr = hlcompr->getEditedState (); - pedited->toneCurve.hlcomprthresh = hlcomprthresh->getEditedState (); - pedited->toneCurve.shcompr = shcompr->getEditedState (); - pedited->toneCurve.brightness = brightness->getEditedState (); - pedited->toneCurve.contrast = contrast->getEditedState (); - pedited->toneCurve.saturation = saturation->getEditedState (); - pedited->toneCurve.autoexp = !autolevels->get_inconsistent(); - pedited->toneCurve.clip = clipDirty; - pedited->toneCurve.curve = !shape->isUnChanged (); - pedited->toneCurve.curve2 = !shape2->isUnChanged (); - pedited->toneCurve.curveMode = toneCurveMode->get_active_row_number() != 6; + pedited->toneCurve.expcomp = expcomp->getEditedState(); + pedited->toneCurve.black = black->getEditedState(); + pedited->toneCurve.hlcompr = hlcompr->getEditedState(); + pedited->toneCurve.hlbl = hlbl->getEditedState(); + pedited->toneCurve.hlcomprthresh = hlcomprthresh->getEditedState(); + pedited->toneCurve.shcompr = shcompr->getEditedState(); + pedited->toneCurve.brightness = brightness->getEditedState(); + pedited->toneCurve.contrast = contrast->getEditedState(); + pedited->toneCurve.saturation = saturation->getEditedState(); + pedited->toneCurve.autoexp = !autolevels->get_inconsistent(); + pedited->toneCurve.clip = clipDirty; + pedited->toneCurve.curve = !shape->isUnChanged(); + pedited->toneCurve.curve2 = !shape2->isUnChanged(); + pedited->toneCurve.curveMode = toneCurveMode->get_active_row_number() != 6; pedited->toneCurve.curveMode2 = toneCurveMode2->get_active_row_number() != 6; - pedited->toneCurve.method = method->get_active_row_number() != 4; - pedited->toneCurve.hrenabled = !hrenabled->get_inconsistent(); + pedited->toneCurve.method = method->get_active_row_number() != 4; + pedited->toneCurve.hrenabled = !hrenabled->get_inconsistent(); pedited->toneCurve.histmatching = !histmatching->get_inconsistent(); pedited->toneCurve.fromHistMatching = true; pedited->toneCurve.clampOOG = !clampOOG->get_inconsistent(); @@ -424,60 +432,72 @@ void ToneCurve::write (ProcParams* pp, ParamsEdited* pedited) } } -void ToneCurve::hrenabledChanged () +void ToneCurve::hrenabledChanged() { if (multiImage) { if (hrenabled->get_inconsistent()) { - hrenabled->set_inconsistent (false); - enaconn.block (true); - hrenabled->set_active (false); - enaconn.block (false); + hrenabled->set_inconsistent(false); + enaconn.block(true); + hrenabled->set_active(false); + enaconn.block(false); } else if (lasthrEnabled) { - hrenabled->set_inconsistent (true); + hrenabled->set_inconsistent(true); } - lasthrEnabled = hrenabled->get_active (); + lasthrEnabled = hrenabled->get_active(); } if (!batchMode) { if (hrenabled->get_active()) { hlrbox->show(); + hlrbox->set_sensitive(true); + if (method->get_active_row_number() == 2) { + hlbl->show(); + } else { + hlbl->hide(); + } } else { - hlrbox->hide(); + hlrbox->show(); + hlrbox->set_sensitive(false); + hlbl->hide(); } - } + } if (listener) { // Switch off auto exposure if user changes enabled manually - if (autolevels->get_active() ) { + if (autolevels->get_active()) { autoconn.block(true); - autolevels->set_active (false); + autolevels->set_active(false); autoconn.block(false); - autolevels->set_inconsistent (false); + autolevels->set_inconsistent(false); } setHistmatching(false); - if (hrenabled->get_active ()) { - listener->panelChanged (EvHREnabled, M("GENERAL_ENABLED")); + if (hrenabled->get_active()) { + listener->panelChanged(EvHREnabled, M("GENERAL_ENABLED")); } else { - listener->panelChanged (EvHREnabled, M("GENERAL_DISABLED")); + listener->panelChanged(EvHREnabled, M("GENERAL_DISABLED")); } } } -void ToneCurve::methodChanged () +void ToneCurve::methodChanged() { + if (method->get_active_row_number() == 2) { + hlbl->show(); + } else { + hlbl->hide(); + } if (listener) { setHistmatching(false); - if (hrenabled->get_active ()) { - listener->panelChanged (EvHRMethod, method->get_active_text ()); + if (hrenabled->get_active()) { + listener->panelChanged(EvHRMethod, method->get_active_text()); } } } - void ToneCurve::clampOOGChanged() { if (listener) { @@ -485,96 +505,96 @@ void ToneCurve::clampOOGChanged() } } - - -void ToneCurve::setRaw (bool raw) +void ToneCurve::setRaw(bool raw) { - disableListener (); - method->set_sensitive (raw); - hrenabled->set_sensitive (raw); + disableListener(); + method->set_sensitive(raw); + hlbl->set_sensitive(raw); + hrenabled->set_sensitive(raw); histmatching->set_sensitive(raw); - enableListener (); + enableListener(); } - -void ToneCurve::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited) +void ToneCurve::setDefaults(const ProcParams* defParams, const ParamsEdited* pedited) { - expcomp->setDefault (defParams->toneCurve.expcomp); - brightness->setDefault (defParams->toneCurve.brightness); - black->setDefault (defParams->toneCurve.black); - hlcompr->setDefault (defParams->toneCurve.hlcompr); - hlcomprthresh->setDefault (defParams->toneCurve.hlcomprthresh); - shcompr->setDefault (defParams->toneCurve.shcompr); - contrast->setDefault (defParams->toneCurve.contrast); - saturation->setDefault (defParams->toneCurve.saturation); + expcomp->setDefault(defParams->toneCurve.expcomp); + brightness->setDefault(defParams->toneCurve.brightness); + black->setDefault(defParams->toneCurve.black); + hlcompr->setDefault(defParams->toneCurve.hlcompr); + hlbl->setDefault(defParams->toneCurve.hlbl); + hlcomprthresh->setDefault(defParams->toneCurve.hlcomprthresh); + shcompr->setDefault(defParams->toneCurve.shcompr); + contrast->setDefault(defParams->toneCurve.contrast); + saturation->setDefault(defParams->toneCurve.saturation); if (pedited) { - expcomp->setDefaultEditedState (pedited->toneCurve.expcomp ? Edited : UnEdited); - black->setDefaultEditedState (pedited->toneCurve.black ? Edited : UnEdited); - hlcompr->setDefaultEditedState (pedited->toneCurve.hlcompr ? Edited : UnEdited); - hlcomprthresh->setDefaultEditedState (pedited->toneCurve.hlcomprthresh ? Edited : UnEdited); - shcompr->setDefaultEditedState (pedited->toneCurve.shcompr ? Edited : UnEdited); - brightness->setDefaultEditedState (pedited->toneCurve.brightness ? Edited : UnEdited); - contrast->setDefaultEditedState (pedited->toneCurve.contrast ? Edited : UnEdited); - saturation->setDefaultEditedState (pedited->toneCurve.saturation ? Edited : UnEdited); + expcomp->setDefaultEditedState(pedited->toneCurve.expcomp ? Edited : UnEdited); + black->setDefaultEditedState(pedited->toneCurve.black ? Edited : UnEdited); + hlcompr->setDefaultEditedState(pedited->toneCurve.hlcompr ? Edited : UnEdited); + hlbl->setDefaultEditedState(pedited->toneCurve.hlbl ? Edited : UnEdited); + hlcomprthresh->setDefaultEditedState(pedited->toneCurve.hlcomprthresh ? Edited : UnEdited); + shcompr->setDefaultEditedState(pedited->toneCurve.shcompr ? Edited : UnEdited); + brightness->setDefaultEditedState(pedited->toneCurve.brightness ? Edited : UnEdited); + contrast->setDefaultEditedState(pedited->toneCurve.contrast ? Edited : UnEdited); + saturation->setDefaultEditedState(pedited->toneCurve.saturation ? Edited : UnEdited); } else { - expcomp->setDefaultEditedState (Irrelevant); - black->setDefaultEditedState (Irrelevant); - hlcompr->setDefaultEditedState (Irrelevant); - hlcomprthresh->setDefaultEditedState (Irrelevant); - shcompr->setDefaultEditedState (Irrelevant); - brightness->setDefaultEditedState (Irrelevant); - contrast->setDefaultEditedState (Irrelevant); - saturation->setDefaultEditedState (Irrelevant); + expcomp->setDefaultEditedState(Irrelevant); + black->setDefaultEditedState(Irrelevant); + hlcompr->setDefaultEditedState(Irrelevant); + hlbl->setDefaultEditedState(Irrelevant); + hlcomprthresh->setDefaultEditedState(Irrelevant); + shcompr->setDefaultEditedState(Irrelevant); + brightness->setDefaultEditedState(Irrelevant); + contrast->setDefaultEditedState(Irrelevant); + saturation->setDefaultEditedState(Irrelevant); } + } -void ToneCurve::curveChanged (CurveEditor* ce) +void ToneCurve::curveChanged(CurveEditor* ce) { if (listener) { setHistmatching(false); if (ce == shape) { - listener->panelChanged (EvToneCurve1, M("HISTORY_CUSTOMCURVE")); + listener->panelChanged(EvToneCurve1, M("HISTORY_CUSTOMCURVE")); } else if (ce == shape2) { - listener->panelChanged (EvToneCurve2, M("HISTORY_CUSTOMCURVE")); + listener->panelChanged(EvToneCurve2, M("HISTORY_CUSTOMCURVE")); } } } -void ToneCurve::curveMode1Changed () +void ToneCurve::curveMode1Changed() { - //if (listener) listener->panelChanged (EvToneCurveMode, toneCurveMode->get_active_text()); if (listener) { setHistmatching(false); - Glib::signal_idle().connect (sigc::mem_fun(*this, &ToneCurve::curveMode1Changed_)); + Glib::signal_idle().connect(sigc::mem_fun(*this, &ToneCurve::curveMode1Changed_)); } } -bool ToneCurve::curveMode1Changed_ () +bool ToneCurve::curveMode1Changed_() { if (listener) { - listener->panelChanged (EvToneCurveMode1, toneCurveMode->get_active_text()); + listener->panelChanged(EvToneCurveMode1, toneCurveMode->get_active_text()); } return false; } -void ToneCurve::curveMode2Changed () +void ToneCurve::curveMode2Changed() { - //if (listener) listener->panelChanged (EvToneCurveMode, toneCurveMode->get_active_text()); if (listener) { setHistmatching(false); - Glib::signal_idle().connect (sigc::mem_fun(*this, &ToneCurve::curveMode2Changed_)); + Glib::signal_idle().connect(sigc::mem_fun(*this, &ToneCurve::curveMode2Changed_)); } } -bool ToneCurve::curveMode2Changed_ () +bool ToneCurve::curveMode2Changed_() { if (listener) { - listener->panelChanged (EvToneCurveMode2, toneCurveMode2->get_active_text()); + listener->panelChanged(EvToneCurveMode2, toneCurveMode2->get_active_text()); } return false; @@ -601,9 +621,9 @@ void ToneCurve::adjusterChanged(Adjuster* a, double newval) // Switch off auto exposure if user changes sliders manually if (autolevels->get_active() && (a == expcomp || a == brightness || a == contrast || a == black || a == hlcompr || a == hlcomprthresh)) { autoconn.block(true); - autolevels->set_active (false); + autolevels->set_active(false); autoconn.block(false); - autolevels->set_inconsistent (false); + autolevels->set_inconsistent(false); } if (!listener) { @@ -617,39 +637,41 @@ void ToneCurve::adjusterChanged(Adjuster* a, double newval) Glib::ustring costr; if (a == expcomp) { - costr = Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(2), a->getValue()); + costr = Glib::ustring::format(std::setw(3), std::fixed, std::setprecision(2), a->getValue()); } else { - costr = Glib::ustring::format ((int)a->getValue()); + costr = Glib::ustring::format((int)a->getValue()); } if (a == expcomp) { - listener->panelChanged (EvExpComp, costr); + listener->panelChanged(EvExpComp, costr); } else if (a == brightness) { - listener->panelChanged (EvBrightness, costr); + listener->panelChanged(EvBrightness, costr); } else if (a == black) { - listener->panelChanged (EvBlack, costr); + listener->panelChanged(EvBlack, costr); if (!black->getAddMode() && !batchMode) { - shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect + shcompr->set_sensitive(!((int)black->getValue() == 0)); //at black=0 shcompr value has no effect } } else if (a == contrast) { - listener->panelChanged (EvContrast, costr); + listener->panelChanged(EvContrast, costr); } else if (a == saturation) { - listener->panelChanged (EvSaturation, costr); + listener->panelChanged(EvSaturation, costr); + } else if (a == hlbl) { + listener->panelChanged(EvHLbl, costr); } else if (a == hlcompr) { - listener->panelChanged (EvHLCompr, costr); + listener->panelChanged(EvHLCompr, costr); if (!hlcompr->getAddMode() && !batchMode) { - hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect + hlcomprthresh->set_sensitive(!((int)hlcompr->getValue() == 0)); //at hlcompr=0 hlcomprthresh value has no effect } } else if (a == hlcomprthresh) { - listener->panelChanged (EvHLComprThreshold, costr); + listener->panelChanged(EvHLComprThreshold, costr); } else if (a == shcompr) { - listener->panelChanged (EvSHCompr, costr); + listener->panelChanged(EvSHCompr, costr); } } -void ToneCurve::neutral_pressed () +void ToneCurve::neutral_pressed() { // This method deselects auto levels and HL reconstruction auto // and sets neutral values to params in exposure panel @@ -657,215 +679,222 @@ void ToneCurve::neutral_pressed () setHistmatching(false); if (batchMode) { - autolevels->set_inconsistent (false); - autoconn.block (true); - autolevels->set_active (false); - autoconn.block (false); + autolevels->set_inconsistent(false); + autoconn.block(true); + autolevels->set_active(false); + autoconn.block(false); - lastAuto = autolevels->get_active (); + lastAuto = autolevels->get_active(); } else { //!batchMode - autolevels->set_active (false); - autolevels->set_inconsistent (false); + autolevels->set_active(false); + autolevels->set_inconsistent(false); } expcomp->setValue(0); hlcompr->setValue(0); + hlbl->setValue(0); hlcomprthresh->setValue(0); brightness->setValue(0); black->setValue(0); shcompr->setValue(50); - enaconn.block (true); - hrenabled->set_active (false); - enaconn.block (false); + enaconn.block(true); + hrenabled->set_active(false); + enaconn.block(false); if (!batchMode) { - hlrbox->hide(); + hlrbox->show(); + hlrbox->set_sensitive(false); + hlbl->hide(); } if (!black->getAddMode() && !batchMode) { - shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect + shcompr->set_sensitive(!((int)black->getValue() == 0)); //at black=0 shcompr value has no effect } if (!hlcompr->getAddMode() && !batchMode) { - hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect + hlcomprthresh->set_sensitive(!((int)hlcompr->getValue() == 0)); //at hlcompr=0 hlcomprthresh value has no effect } contrast->setValue(0); //saturation->setValue(0); - listener->panelChanged (EvNeutralExp, M("GENERAL_ENABLED")); + listener->panelChanged(EvNeutralExp, M("GENERAL_ENABLED")); } -void ToneCurve::autolevels_toggled () + +void ToneCurve::autolevels_toggled() { setHistmatching(false); - if (batchMode) { if (autolevels->get_inconsistent()) { - autolevels->set_inconsistent (false); - autoconn.block (true); - autolevels->set_active (false); - autoconn.block (false); + autolevels->set_inconsistent(false); + autoconn.block(true); + autolevels->set_active(false); + autoconn.block(false); } else if (lastAuto) { - autolevels->set_inconsistent (true); + autolevels->set_inconsistent(true); } - lastAuto = autolevels->get_active (); + lastAuto = autolevels->get_active(); - expcomp->setEditedState (UnEdited); - brightness->setEditedState (UnEdited); - contrast->setEditedState (UnEdited); - black->setEditedState (UnEdited); - hlcompr->setEditedState (UnEdited); - hlcomprthresh->setEditedState (UnEdited); + expcomp->setEditedState(UnEdited); + brightness->setEditedState(UnEdited); + contrast->setEditedState(UnEdited); + black->setEditedState(UnEdited); + hlcompr->setEditedState(UnEdited); + hlcomprthresh->setEditedState(UnEdited); if (expcomp->getAddMode()) { - expcomp->setValue (0); + expcomp->setValue(0); } if (brightness->getAddMode()) { - brightness->setValue (0); + brightness->setValue(0); } if (contrast->getAddMode()) { - contrast->setValue (0); + contrast->setValue(0); } if (black->getAddMode()) { - black->setValue (0); + black->setValue(0); } if (hlcompr->getAddMode()) { - hlcompr->setValue (0); + hlcompr->setValue(0); } if (hlcomprthresh->getAddMode()) { - hlcomprthresh->setValue (0); + hlcomprthresh->setValue(0); } if (listener) { if (!autolevels->get_inconsistent()) { - if (autolevels->get_active ()) { - listener->panelChanged (EvAutoExp, M("GENERAL_ENABLED")); + if (autolevels->get_active()) { + listener->panelChanged(EvAutoExp, M("GENERAL_ENABLED")); } else { - listener->panelChanged (EvFixedExp, M("GENERAL_DISABLED")); + listener->panelChanged(EvFixedExp, M("GENERAL_DISABLED")); } } } } else if (/* !batchMode && */ listener) { if (autolevels->get_active()) { - listener->panelChanged (EvAutoExp, M("GENERAL_ENABLED")); - waitForAutoExp (); + listener->panelChanged(EvAutoExp, M("GENERAL_ENABLED")); + waitForAutoExp(); if (!black->getAddMode()) { - shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect + shcompr->set_sensitive(!((int)black->getValue() == 0)); //at black=0 shcompr value has no effect } if (!hlcompr->getAddMode() && !batchMode) { - hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect + hlcomprthresh->set_sensitive(!((int)hlcompr->getValue() == 0)); //at hlcompr=0 hlcomprthresh value has no effect } } else { - listener->panelChanged (EvFixedExp, M("GENERAL_DISABLED")); + listener->panelChanged(EvFixedExp, M("GENERAL_DISABLED")); } } } -void ToneCurve::clip_changed () +void ToneCurve::clip_changed() { clipDirty = true; if (autolevels->get_active() && listener) { - Glib::signal_idle().connect (sigc::mem_fun(*this, &ToneCurve::clip_changed_)); + Glib::signal_idle().connect(sigc::mem_fun(*this, &ToneCurve::clip_changed_)); } } -bool ToneCurve::clip_changed_ () +bool ToneCurve::clip_changed_() { if (listener) { - listener->panelChanged (EvClip, Glib::ustring::format (std::setprecision(5), sclip->get_value())); + listener->panelChanged(EvClip, Glib::ustring::format(std::setprecision(5), sclip->get_value())); if (!batchMode) { - waitForAutoExp (); + waitForAutoExp(); } } return false; } -void ToneCurve::waitForAutoExp () +void ToneCurve::waitForAutoExp() { - sclip->set_sensitive (false); - expcomp->setEnabled (false); - brightness->setEnabled (false); - contrast->setEnabled (false); - black->setEnabled (false); - hlcompr->setEnabled (false); - hlcomprthresh->setEnabled (false); - shcompr->setEnabled (false); - contrast->setEnabled (false); - saturation->setEnabled (false); - curveEditorG->set_sensitive (false); - toneCurveMode->set_sensitive (false); - curveEditorG2->set_sensitive (false); - toneCurveMode2->set_sensitive (false); + sclip->set_sensitive(false); + expcomp->setEnabled(false); + brightness->setEnabled(false); + contrast->setEnabled(false); + black->setEnabled(false); + hlcompr->setEnabled(false); + hlcomprthresh->setEnabled(false); + shcompr->setEnabled(false); + contrast->setEnabled(false); + saturation->setEnabled(false); + curveEditorG->set_sensitive(false); + toneCurveMode->set_sensitive(false); + curveEditorG2->set_sensitive(false); + toneCurveMode2->set_sensitive(false); hrenabled->set_sensitive(false); method->set_sensitive(false); + hlbl->set_sensitive(false); histmatching->set_sensitive(false); } -void ToneCurve::enableAll () +void ToneCurve::enableAll() { - sclip->set_sensitive (true); - expcomp->setEnabled (true); - brightness->setEnabled (true); - black->setEnabled (true); - hlcompr->setEnabled (true); - hlcomprthresh->setEnabled (true); - shcompr->setEnabled (true); - contrast->setEnabled (true); - saturation->setEnabled (true); - curveEditorG->set_sensitive (true); - toneCurveMode->set_sensitive (true); - curveEditorG2->set_sensitive (true); - toneCurveMode2->set_sensitive (true); + sclip->set_sensitive(true); + expcomp->setEnabled(true); + brightness->setEnabled(true); + black->setEnabled(true); + hlcompr->setEnabled(true); + hlbl->setEnabled(true); + hlcomprthresh->setEnabled(true); + shcompr->setEnabled(true); + contrast->setEnabled(true); + saturation->setEnabled(true); + curveEditorG->set_sensitive(true); + toneCurveMode->set_sensitive(true); + curveEditorG2->set_sensitive(true); + toneCurveMode2->set_sensitive(true); hrenabled->set_sensitive(true); method->set_sensitive(true); + hlbl->set_sensitive(true); histmatching->set_sensitive(true); } -void ToneCurve::setBatchMode (bool batchMode) +void ToneCurve::setBatchMode(bool batchMode) { - ToolPanel::setBatchMode (batchMode); - method->append (M("GENERAL_UNCHANGED")); + ToolPanel::setBatchMode(batchMode); + method->append(M("GENERAL_UNCHANGED")); - removeIfThere (abox, autolevels, false); - autolevels = Gtk::manage (new Gtk::CheckButton (M("TP_EXPOSURE_AUTOLEVELS"))); - autolevels->set_tooltip_markup (M("TP_EXPOSURE_AUTOLEVELS_TIP")); - autoconn = autolevels->signal_toggled().connect( sigc::mem_fun(*this, &ToneCurve::autolevels_toggled) ); - abox->pack_start (*autolevels); + removeIfThere(abox, autolevels, false); + autolevels = Gtk::manage(new Gtk::CheckButton(M("TP_EXPOSURE_AUTOLEVELS"))); + autolevels->set_tooltip_markup(M("TP_EXPOSURE_AUTOLEVELS_TIP")); + autoconn = autolevels->signal_toggled().connect(sigc::mem_fun(*this, &ToneCurve::autolevels_toggled)); + abox->pack_start(*autolevels); - ToolPanel::setBatchMode (batchMode); - expcomp->showEditedCB (); - black->showEditedCB (); - hlcompr->showEditedCB (); - hlcomprthresh->showEditedCB (); - shcompr->showEditedCB (); - brightness->showEditedCB (); - contrast->showEditedCB (); - saturation->showEditedCB (); + ToolPanel::setBatchMode(batchMode); + expcomp->showEditedCB(); + black->showEditedCB(); + hlcompr->showEditedCB(); + hlbl->showEditedCB(); + hlcomprthresh->showEditedCB(); + shcompr->showEditedCB(); + brightness->showEditedCB(); + contrast->showEditedCB(); + saturation->showEditedCB(); - toneCurveMode->append (M("GENERAL_UNCHANGED")); - toneCurveMode2->append (M("GENERAL_UNCHANGED")); + toneCurveMode->append(M("GENERAL_UNCHANGED")); + toneCurveMode2->append(M("GENERAL_UNCHANGED")); - curveEditorG->setBatchMode (batchMode); - curveEditorG2->setBatchMode (batchMode); + curveEditorG->setBatchMode(batchMode); + curveEditorG2->setBatchMode(batchMode); } -void ToneCurve::setAdjusterBehavior (bool expadd, bool hlcompadd, bool hlcompthreshadd, bool bradd, bool blackadd, bool shcompadd, bool contradd, bool satadd) +void ToneCurve::setAdjusterBehavior(bool expadd, bool hlcompadd, bool hlcompthreshadd, bool bradd, bool blackadd, bool shcompadd, bool contradd, bool satadd) { expcomp->setAddMode(expadd); @@ -878,7 +907,7 @@ void ToneCurve::setAdjusterBehavior (bool expadd, bool hlcompadd, bool hlcompthr saturation->setAddMode(satadd); } -void ToneCurve::trimValues (rtengine::procparams::ProcParams* pp) +void ToneCurve::trimValues(rtengine::procparams::ProcParams* pp) { expcomp->trimValue(pp->toneCurve.expcomp); @@ -907,7 +936,6 @@ void ToneCurve::updateCurveBackgroundHistogram( shape->updateBackgroundHistogram(histToneCurve); } - void ToneCurve::setHistmatching(bool enabled) { fromHistMatching = enabled; @@ -919,7 +947,6 @@ void ToneCurve::setHistmatching(bool enabled) } } - void ToneCurve::histmatchingToggled() { if (listener) { @@ -966,8 +993,16 @@ void ToneCurve::autoExpChanged(double expcomp, int bright, int contr, int black, if (nextHLRecons) { hlrbox->show(); + hlrbox->set_sensitive(true); + if (method->get_active_row_number() == 2) { + hlbl->show(); + } else { + hlbl->hide(); + } } else if (!batchMode) { - hlrbox->hide(); + hlrbox->show(); + hlrbox->set_sensitive(false); + hlbl->hide(); } if (!this->black->getAddMode() && !batchMode) { @@ -1007,7 +1042,7 @@ void ToneCurve::autoMatchedToneCurveChanged(rtengine::procparams::ToneCurveMode hlcomprthresh->set_sensitive(static_cast(hlcompr->getValue())); //at hlcompr=0 hlcomprthresh value has no effect } - if (autolevels->get_active() ) { + if (autolevels->get_active()) { expcomp->setValue(0); autoconn.block(true); autolevels->set_active(false); diff --git a/rtgui/tonecurve.h b/rtgui/tonecurve.h index 9439d422e..6dd77951d 100644 --- a/rtgui/tonecurve.h +++ b/rtgui/tonecurve.h @@ -47,6 +47,7 @@ protected: sigc::connection methconn; sigc::connection enaconn; bool lasthrEnabled; + Adjuster* hlbl; Gtk::Box* abox; Gtk::Box* hlrbox; @@ -80,6 +81,7 @@ protected: rtengine::ProcEvent EvHistMatching; rtengine::ProcEvent EvHistMatchingBatch; rtengine::ProcEvent EvClampOOG; + rtengine::ProcEvent EvHLbl; // used temporarily in eventing double nextExpcomp; From 9e159deb01226b2e76bd16ad098f214d848a938d Mon Sep 17 00:00:00 2001 From: Desmis Date: Fri, 19 Feb 2021 13:06:34 +0100 Subject: [PATCH 093/129] Local adjustments - Blur and noise radius > 1.5 increase saturation issue #6117 (#6118) * Fixed bad behavior saturation issue 6117 * Reenable scalegr for grain * Add forgotten brackets --- rtengine/improcfun.h | 2 +- rtengine/iplocallab.cc | 53 +++++++++--------------------------------- rtengine/procparams.cc | 2 +- rtgui/locallabtools.cc | 4 ++-- 4 files changed, 15 insertions(+), 46 deletions(-) diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 4c656fd9f..923a5e8db 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -347,7 +347,7 @@ enum class BlurType { void BlurNoise_Localold(int call, const struct local_params& lp, LabImage* original, LabImage* transformed, const LabImage* const tmp1, int cx, int cy); void InverseBlurNoise_Local(LabImage * originalmask, const struct local_params& lp, const float hueref, const float chromaref, const float lumaref, LabImage* original, LabImage* transformed, const LabImage* const tmp1, int cx, int cy, int sk); void InverseReti_Local(const struct local_params& lp, const float hueref, const float chromaref, const float lumaref, LabImage* original, LabImage* transformed, const LabImage* const tmp1, int cx, int cy, int chro, int sk); - void BlurNoise_Local(LabImage* tmp1, LabImage * originalmask, float **bufchro, const float hueref, const float chromaref, const float lumaref, local_params& lp, LabImage* original, LabImage* transformed, int cx, int cy, int sk); + void BlurNoise_Local(LabImage* tmp1, LabImage * originalmask, const float hueref, const float chromaref, const float lumaref, local_params& lp, LabImage* original, LabImage* transformed, int cx, int cy, int sk); static void strcurv_data(std::string retistr, int *s_datc, int &siz); void blendstruc(int bfw, int bfh, LabImage* bufcolorig, float radius, float stru, array2D & blend2, int sk, bool multiThread); diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index ee8df87e5..03c0af8ed 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -6680,7 +6680,7 @@ void optfft(int N_fftwsize, int &bfh, int &bfw, int &bfhr, int &bfwr, struct loc } } -void ImProcFunctions::BlurNoise_Local(LabImage *tmp1, LabImage * originalmask, float **bufchro, const float hueref, const float chromaref, const float lumaref, local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk) +void ImProcFunctions::BlurNoise_Local(LabImage *tmp1, LabImage * originalmask, const float hueref, const float chromaref, const float lumaref, local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk) { //local BLUR //BENCHFUN @@ -6778,19 +6778,14 @@ void ImProcFunctions::BlurNoise_Local(LabImage *tmp1, LabImage * originalmask, f const float huedelta2 = abdelta2 - chrodelta2; const float dE = std::sqrt(kab * (kch * chrodelta2 + kH * huedelta2) + kL * SQR(refL - maskptr->L[y][x])); const float reducdE = calcreducdE(dE, maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, lp.sensbn); - const float clc = previewbl ? settings->previewselection * 100.f : bufchro[y - ystart][x - xstart]; - const float realstrchdE = reducdE * clc; float difL = (tmp1->L[y - ystart][x - xstart] - original->L[y][x]) * localFactor * reducdE; transformed->L[y][x] = CLIP(original->L[y][x] + difL); - const float fli = (100.f + realstrchdE) / 100.f; - const float difa = tmp1->a[y - ystart][x - xstart] * fli - original->a[y][x] * localFactor; - const float difb = tmp1->b[y - ystart][x - xstart] * fli - original->b[y][x] * localFactor; + const float difa = (tmp1->a[y - ystart][x - xstart] - original->a[y][x]) * localFactor * reducdE; + const float difb = (tmp1->b[y - ystart][x - xstart] - original->b[y][x]) * localFactor * reducdE; - // if (!lp.actsp) { - transformed->a[y][x] = clipC(original->a[y][x] + difa); - transformed->b[y][x] = clipC(original->b[y][x] + difb); - // } + transformed->a[y][x] = clipC(original->a[y][x] + difa); + transformed->b[y][x] = clipC(original->b[y][x] + difb); const float maxdifab = rtengine::max(std::fabs(difa), std::fabs(difb)); @@ -11643,6 +11638,7 @@ void ImProcFunctions::Lab_Local( if (((radius > 1.5 * GAUSS_SKIP && lp.rad > 1.6) || lp.stren > 0.1 || lp.blmet == 1 || lp.guidb > 0 || strengr > 0 || execmaskblur) && lp.blurena) { // radius < GAUSS_SKIP means no gauss, just copy of original image // if (((radius > 1.5 * GAUSS_SKIP && lp.rad > 1.6) || lp.stren > 0.1 || lp.blmet == 1 || lp.guidb > 0 || lp.showmaskblmet == 2 || lp.enablMask || lp.showmaskblmet == 3 || lp.showmaskblmet == 4) && lp.blurena) { // radius < GAUSS_SKIP means no gauss, just copy of original image + //printf("OK BLUR\n"); std::unique_ptr tmp1; std::unique_ptr tmp2; std::unique_ptr tmp3; @@ -11658,7 +11654,7 @@ void ImProcFunctions::Lab_Local( bool fft = params->locallab.spots.at(sp).fftwbl; int isogr = params->locallab.spots.at(sp).isogr; - int scalegr = 100;//params->locallab.spots.at(sp).scalegr; + int scalegr = params->locallab.spots.at(sp).scalegr; @@ -11715,6 +11711,8 @@ void ImProcFunctions::Lab_Local( if (lp.blurmet == 0 && lp.blmet == 0 && radius > (1.5 * GAUSS_SKIP) && lp.rad > 1.6) { + // printf("OK BLUR RAD lp=%f\n", lp.rad); + if (fft || lp.rad > 30.f) { if (lp.chromet == 0) { ImProcFunctions::fftw_convol_blur2(tmp1->L, tmp1->L, bfwr, bfhr, radius, 0, 0); @@ -12215,41 +12213,12 @@ void ImProcFunctions::Lab_Local( } if (tmp1.get()) { - JaggedArray bufchro(lp.blurmet == 1 ? GW : bfw, lp.blurmet == 1 ? GH : bfh); - float minC = std::sqrt(SQR(tmp1->a[0][0]) + SQR(tmp1->b[0][0])) - std::sqrt(SQR(bufgb->a[0][0]) + SQR(bufgb->b[0][0])); - float maxC = minC; -#ifdef _OPENMP - #pragma omp parallel for reduction(max:maxC) reduction(min:minC) schedule(dynamic,16) if (multiThread) -#endif - for (int ir = 0; ir < bfh; ir++) { - for (int jr = 0; jr < bfw; jr++) { - bufchro[ir][jr] = std::sqrt(SQR(tmp1->a[ir][jr]) + SQR(tmp1->b[ir][jr])) - std::sqrt(SQR(bufgb->a[ir][jr]) + SQR(bufgb->b[ir][jr])); - minC = rtengine::min(minC, bufchro[ir][jr]); - maxC = rtengine::max(maxC, bufchro[ir][jr]); - } - } - - float coefC = 0.01f * rtengine::max(std::fabs(minC), std::fabs(maxC)); - - if (coefC > 0.f) { - coefC = 1.f / coefC; -#ifdef _OPENMP - #pragma omp parallel for if (multiThread) -#endif - for (int y = 0; y < bfh; y++) { - for (int x = 0; x < bfw; x++) { - bufchro[y][x] *= coefC; - } - } - } - if (lp.blurmet == 0) { //blur and noise (center) -// BlurNoise_Local(tmp1.get(), originalmaskbl, bufchro, hueref, chromaref, lumaref, lp, original, transformed, cx, cy, sk); if(lp.smasktyp != 1) { - BlurNoise_Local(tmp1.get(), originalmaskbl.get(), bufchro, hueref, chromaref, lumaref, lp, original, transformed, cx, cy, sk); + BlurNoise_Local(tmp1.get(), originalmaskbl.get(), hueref, chromaref, lumaref, lp, original, transformed, cx, cy, sk); } else { - BlurNoise_Local(tmp1.get(), original, bufchro, hueref, chromaref, lumaref, lp, original, transformed, cx, cy, sk); + BlurNoise_Local(tmp1.get(), original, hueref, chromaref, lumaref, lp, original, transformed, cx, cy, sk); } if (params->locallab.spots.at(sp).recurs) { diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 5a1bb0ff8..f4909cb10 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3330,7 +3330,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : decayd(2.), isogr(400), strengr(0), - scalegr(100), + scalegr(80), epsbl(0), blMethod("blur"), chroMethod("lum"), diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 26e6f3cff..15b9d2837 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -6217,7 +6217,7 @@ LocallabBlur::LocallabBlur(): grainFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRAINFRA")))), isogr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_ISOGR"), 20, 6400, 1, 400))), strengr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRENGR"), 0, 100, 1, 0))), - scalegr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SCALEGR"), 0, 100, 1, 100))), + scalegr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SCALEGR"), 0, 100, 1, 80))), medMethod(Gtk::manage(new MyComboBoxText())), itera(Gtk::manage(new Adjuster(M("TP_DIRPYRDENOISE_MEDIAN_PASSES"), 1, 4, 1, 1))), guidbl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GUIDBL"), 0, 1000, 1, 0))), @@ -6551,7 +6551,7 @@ LocallabBlur::LocallabBlur(): ToolParamBlock* const grainBox = Gtk::manage(new ToolParamBlock()); grainBox->pack_start(*isogr); grainBox->pack_start(*strengr); -// grainBox->pack_start(*scalegr); + grainBox->pack_start(*scalegr); grainFrame->add(*grainBox); blnoisebox->pack_start(*grainFrame); blnoisebox->pack_start(*medMethod); From 24df5166f2ce7e2c75861511a2791e4b429c4ff6 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sun, 21 Feb 2021 13:32:16 +0100 Subject: [PATCH 094/129] assume SAMPLEFORMAT_UINT for tiff files when SAMPLEFORMAT_VOID is set --- rtengine/imageio.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index 102d53b8e..971f7c9e9 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -678,14 +678,17 @@ int ImageIO::getTIFFSampleFormat (const Glib::ustring &fname, IIOSampleFormat &s return IMIO_VARIANTNOTSUPPORTED; } - if (!TIFFGetField(in, TIFFTAG_SAMPLEFORMAT, &sampleformat)) + if (!TIFFGetField(in, TIFFTAG_SAMPLEFORMAT, &sampleformat)) { /* * WARNING: This is a dirty hack! * We assume that files which doesn't contain the TIFFTAG_SAMPLEFORMAT tag * (which is the case with uncompressed TIFFs produced by RT!) are RGB files, * but that may be not true. --- Hombre */ - { + sampleformat = SAMPLEFORMAT_UINT; + } else if (sampleformat == SAMPLEFORMAT_VOID) { + // according to https://www.awaresystems.be/imaging/tiff/tifftags/sampleformat.html + // we assume SAMPLEFORMAT_UINT if SAMPLEFORMAT_VOID is set sampleformat = SAMPLEFORMAT_UINT; } From c5a6c9fb3d8867c3125c26f0f314bd5980d08570 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Mon, 22 Feb 2021 12:03:53 +0100 Subject: [PATCH 095/129] make iplocallab.cc cppcheck and also -Wdouble-promotion clean #6119 (#6122) * iplocallab.cc: some cppcheck fixes, also some cleanups and speedups, #6119 * iplocallab.cc: fix remainig cppcheck issues. Now this file is cppcheck clean, #6119 * make iplocallab.cc -Wdouble-promotion clean, #6119 * Fix compilatio issue * Fix compilation issue --- rtengine/iplocallab.cc | 1329 +++++++++++++++++----------------------- 1 file changed, 563 insertions(+), 766 deletions(-) diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 03c0af8ed..4eda9c71a 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -54,6 +54,7 @@ #pragma GCC diagnostic warning "-Wall" #pragma GCC diagnostic warning "-Wextra" +#pragma GCC diagnostic warning "-Wdouble-promotion" namespace { @@ -163,7 +164,7 @@ void calcdif(float lmr, float &lmrc) float b2 = 100.f - a2 * 100.f; if(lmr < 11.6f) { lmrc = a0 * lmr; - } else if (lmr < 60.) { + } else if (lmr < 60.f) { lmrc = a1 * lmr + b1; } else { lmrc = a2 * lmr + b2; @@ -2397,124 +2398,92 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, int call) double Xwout, Zwout; double Xwsc, Zwsc; - LUTu hist16J; - LUTu hist16Q; + LUTu hist16J(32768, LUT_CLIP_BELOW | LUT_CLIP_ABOVE, true); + LUTu hist16Q(32768, LUT_CLIP_BELOW | LUT_CLIP_ABOVE, true); //for J light and contrast - LUTf CAMBrightCurveJ; - CAMBrightCurveJ(32768, LUT_CLIP_ABOVE); - CAMBrightCurveJ.dirty = true; - - LUTf CAMBrightCurveQ; - CAMBrightCurveQ(32768, LUT_CLIP_ABOVE); - CAMBrightCurveQ.dirty = true; - - if (CAMBrightCurveJ.dirty || CAMBrightCurveQ.dirty) { - hist16J(32768); - hist16J.clear(); - hist16Q(32768); - hist16Q.clear(); - - double sum = 0.0; // use double precision for large summations + LUTf CAMBrightCurveJ(32768, LUT_CLIP_ABOVE); + LUTf CAMBrightCurveQ(32768, LUT_CLIP_ABOVE); #ifdef _OPENMP - const int numThreads = min(max(width * height / 65536, 1), omp_get_max_threads()); - #pragma omp parallel num_threads(numThreads) if(numThreads>1) + const int numThreads = min(max(width * height / 65536, 1), omp_get_max_threads()); + #pragma omp parallel num_threads(numThreads) if(numThreads>1) #endif - { - LUTu hist16Jthr; - LUTu hist16Qthr; - hist16Jthr(hist16J.getSize()); - hist16Jthr.clear(); - hist16Qthr(hist16Q.getSize()); - hist16Qthr.clear(); + { + LUTu hist16Jthr(hist16J.getSize(), LUT_CLIP_BELOW | LUT_CLIP_ABOVE, true); + LUTu hist16Qthr(hist16Q.getSize(), LUT_CLIP_BELOW | LUT_CLIP_ABOVE, true); #ifdef _OPENMP - #pragma omp for reduction(+:sum) + #pragma omp for #endif - for (int i = 0; i < height; i++) { - for (int j = 0; j < width; j++) { //rough correspondence between L and J - float currL = lab->L[i][j] / 327.68f; - float koef; //rough correspondence between L and J + for (int i = 0; i < height; i++) { + for (int j = 0; j < width; j++) { //rough correspondence between L and J + float currL = lab->L[i][j] / 327.68f; + float koef; //rough correspondence between L and J - if (currL > 50.f) { - if (currL > 70.f) { - if (currL > 80.f) { - if (currL > 85.f) { - koef = 0.97f; - } else { - koef = 0.93f; - } - } else { - koef = 0.87f; - } - } else { - if (currL > 60.f) { - koef = 0.85f; - } else { - koef = 0.8f; - } - } + if (currL > 50.f) { + if (currL > 70.f) { + if (currL > 80.f) { + if (currL > 85.f) { + koef = 0.97f; } else { - if (currL > 10.f) { - if (currL > 20.f) { - if (currL > 40.f) { - koef = 0.75f; - } else { - koef = 0.7f; - } - } else { - koef = 0.9f; - } - } else { - koef = 1.0; - } + koef = 0.93f; } - - hist16Jthr[(int)((koef * lab->L[i][j]))]++; //evaluate histogram luminance L # J - hist16Qthr[CLIP((int)(32768.f * sqrt((koef * (lab->L[i][j])) / 32768.f)))]++; //for brightness Q : approximation for Q=wh*sqrt(J/100) J not equal L - sum += static_cast(koef) * static_cast(lab->L[i][j]); //evaluate mean J to calculate Yb - //sum not used, but perhaps... + } else { + koef = 0.87f; + } + } else { + if (currL > 60.f) { + koef = 0.85f; + } else { + koef = 0.8f; } } - -#ifdef _OPENMP - #pragma omp critical -#endif - { - hist16J += hist16Jthr; - hist16Q += hist16Qthr; - } + } else { + if (currL > 10.f) { + if (currL > 20.f) { + if (currL > 40.f) { + koef = 0.75f; + } else { + koef = 0.7f; + } + } else { + koef = 0.9f; + } + } else { + koef = 1.0; + } } + + hist16Jthr[(int)((koef * lab->L[i][j]))]++; //evaluate histogram luminance L # J + hist16Qthr[CLIP((int)(32768.f * sqrt((koef * (lab->L[i][j])) / 32768.f)))]++; //for brightness Q : approximation for Q=wh*sqrt(J/100) J not equal L + } + } + #ifdef _OPENMP - static_cast(numThreads); // to silence cppcheck warning + #pragma omp critical +#endif + { + hist16J += hist16Jthr; + hist16Q += hist16Qthr; + } + } +#ifdef _OPENMP + static_cast(numThreads); // to silence cppcheck warning #endif - //evaluate lightness, contrast - } + //evaluate lightness, contrast - float contL = 0.f; - float lightL = 0.f; - float contQ = 0.f; - float lightQ = 0.f; - if (ciec) { - contL = 0.6f *params->locallab.spots.at(sp).contl;//0.6 less effect, no need 1. - lightL = 0.4f *params->locallab.spots.at(sp).lightl;//0.4 less effect, no need 1. - contQ = 0.5f *params->locallab.spots.at(sp).contq;//0.5 less effect, no need 1. - lightQ = 0.4f *params->locallab.spots.at(sp).lightq;//0.4 less effect, no need 1. + const float contL = 0.6 * params->locallab.spots.at(sp).contl; //0.6 less effect, no need 1. + const float lightL = 0.4 * params->locallab.spots.at(sp).lightl; //0.4 less effect, no need 1. + const float contQ = 0.5 * params->locallab.spots.at(sp).contq; //0.5 less effect, no need 1. + const float lightQ = 0.4 * params->locallab.spots.at(sp).lightq; //0.4 less effect, no need 1. - if (CAMBrightCurveJ.dirty) { - Ciecam02::curveJfloat(lightL, contL, hist16J, CAMBrightCurveJ); //lightness J and contrast J - CAMBrightCurveJ /= 327.68f; - CAMBrightCurveJ.dirty = false; - } - - if (CAMBrightCurveQ.dirty) { - Ciecam02::curveJfloat(lightQ, contQ, hist16Q, CAMBrightCurveQ); //brightness Q and contrast Q - CAMBrightCurveQ.dirty = false; - } + Ciecam02::curveJfloat(lightL, contL, hist16J, CAMBrightCurveJ); //lightness J and contrast J + CAMBrightCurveJ /= 327.68f; + Ciecam02::curveJfloat(lightQ, contQ, hist16Q, CAMBrightCurveQ); //brightness Q and contrast Q } int tempo = 5000; if(params->locallab.spots.at(sp).expvibrance && call == 2) { @@ -2670,16 +2639,15 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, int call) #ifdef __SSE2__ // vectorized conversion from Lab to jchqms int k; - vfloat x, y, z; - vfloat J, C, h, Q, M, s; - vfloat c655d35 = F2V(655.35f); for (k = 0; k < width - 3; k += 4) { + vfloat x, y, z; Color::Lab2XYZ(LVFU(lab->L[i][k]), LVFU(lab->a[i][k]), LVFU(lab->b[i][k]), x, y, z); x = x / c655d35; y = y / c655d35; z = z / c655d35; + vfloat J, C, h, Q, M, s; Ciecam02::xyz2jchqms_ciecam02float(J, C, h, Q, M, s, F2V(aw), F2V(fl), F2V(wh), x, y, z, @@ -2770,7 +2738,6 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, int call) protect_red *= coe; //M mode Color::skinredfloat(Jpro, hpro, sres, Mp, dred, protect_red, 0, rstprotection, 100.f, Mpro); Jpro = SQR((10.f * Qpro) / wh); - Cpro = Mpro / coe; Qpro = (Qpro == 0.f ? epsil : Qpro); // avoid division by zero spro = 100.0f * sqrtf(Mpro / Qpro); @@ -2833,6 +2800,7 @@ void ImProcFunctions::ciecamloc_02float(int sp, LabImage* lab, int call) float *zbuffer = sbuffer; for (k = 0; k < bufferLength; k += 4) { + vfloat x, y, z; Ciecam02::jch2xyz_ciecam02float(x, y, z, LVF(Jbuffer[k]), LVF(Cbuffer[k]), LVF(hbuffer[k]), F2V(xw2), F2V(yw2), F2V(zw2), @@ -2950,9 +2918,9 @@ void ImProcFunctions::softprocess(const LabImage* bufcolorig, array2D &bu } } - double aepsil = (epsilmax - epsilmin) / 90.f; - double bepsil = epsilmax - 100.f * aepsil; - double epsil = aepsil * rad + bepsil; + double aepsil = (epsilmax - epsilmin) / 90.0; + double bepsil = epsilmax - 100.0 * aepsil; + double epsil = aepsil * static_cast(rad) + bepsil; float blur = 1.f / sk * (thres + 0.8f * rad); guidedFilter(guidsoft, buflight, buflight, blur, epsil, multiThread, 4); @@ -3722,12 +3690,12 @@ static void mean_fab(int xstart, int ystart, int bfw, int bfh, LabImage* bufexpo for (int x = 0; x < bfw; x++) { bufexporig->a[y][x] = original->a[y + ystart][x + xstart]; bufexporig->b[y][x] = original->b[y + ystart][x + xstart]; - sumab += std::fabs(bufexporig->a[y][x]); - sumab += std::fabs(bufexporig->b[y][x]); + sumab += static_cast(std::fabs(bufexporig->a[y][x])); + sumab += static_cast(std::fabs(bufexporig->b[y][x])); } } - meanfab = sumab / (2.f * nbfab); + meanfab = sumab / (2.0 * nbfab); double som = 0.0; @@ -3736,7 +3704,7 @@ static void mean_fab(int xstart, int ystart, int bfw, int bfh, LabImage* bufexpo #endif for (int y = 0; y < bfh; y++) { for (int x = 0; x < bfw; x++) { - som += SQR(std::fabs(bufexporig->a[y][x]) - meanfab) + SQR(std::fabs(bufexporig->b[y][x]) - meanfab); + som += static_cast(SQR(std::fabs(bufexporig->a[y][x]) - meanfab) + SQR(std::fabs(bufexporig->b[y][x]) - meanfab)); } } @@ -3828,8 +3796,8 @@ void calclocalGradientParams(const struct local_params& lp, struct grad_params& double gradient_stops = stops; double gradient_center_x = LIM01((lp.xc - xstart) / bfw); double gradient_center_y = LIM01((lp.yc - ystart) / bfh); - double gradient_angle = angs / 180.0 * rtengine::RT_PI; - double varfeath = 0.01 * lp.feath; + double gradient_angle = static_cast(angs) / 180.0 * rtengine::RT_PI; + double varfeath = 0.01f * lp.feath; //printf("xstart=%f ysta=%f lpxc=%f lpyc=%f stop=%f bb=%f cc=%f ang=%f ff=%d gg=%d\n", xstart, ystart, lp.xc, lp.yc, gradient_stops, gradient_center_x, gradient_center_y, gradient_angle, w, h); @@ -3890,11 +3858,11 @@ void calclocalGradientParams(const struct local_params& lp, struct grad_params& gp.ta = tan(gradient_angle); gp.xc = w * gradient_center_x; gp.yc = h * gradient_center_y; - gp.ys = std::sqrt((float)h * h + (float)w * w) * (varfeath / cos(gradient_angle)); - gp.ys_inv = 1.0 / gp.ys; - gp.top_edge_0 = gp.yc - gp.ys / 2.0; + gp.ys = std::sqrt(h * h + w * w) * (varfeath / cos(gradient_angle)); + gp.ys_inv = 1.f / gp.ys; + gp.top_edge_0 = gp.yc - gp.ys / 2.f; - if (gp.ys < 1.0 / h) { + if (gp.ys < 1.f / h) { gp.ys_inv = 0; gp.ys = 0; } @@ -4313,8 +4281,8 @@ void ImProcFunctions::mean_dt(const float* data, size_t size, double& mean_p, do #pragma omp parallel for reduction(+:mean,dt) if(multiThread) #endif for (size_t i = 0; i < size; i++) { - mean += data[i]; - dt += SQR(data[i]); + mean += static_cast(data[i]); + dt += static_cast(SQR(data[i])); } mean /= size; @@ -4352,8 +4320,8 @@ void ImProcFunctions::normalize_mean_dt(float * data, const float * ref, size_t const double a = dt_ref / dt_data; const double b = mean_ref - a * mean_data; - const float modma = mod * a; - const float sigmmmodmb = sigm * mod * b; + const float modma = static_cast(mod) * a; + const float sigmmmodmb = static_cast(sigm) * static_cast(mod) * b; const float onesmod = 1.f - mod; /* normalize the array */ @@ -4646,8 +4614,9 @@ void ImProcFunctions::maskcalccol(bool invmask, bool pde, int bfw, int bfh, int if (lochhhmasCurve && lhhmasutili) { for (int i = 0; i < 500; i++) { - if (lochhhmasCurve[i] != 0.5) { + if (lochhhmasCurve[i] != 0.5f) { HHmaskcurve = true; + break; } } } @@ -4734,40 +4703,6 @@ void ImProcFunctions::maskcalccol(bool invmask, bool pde, int bfw, int bfh, int kmaskHL = 32768.f * valHH; } - /* - //keep here in case of...but !! - if (lochhhmasCurve && HHmaskcurve) { - - #ifdef __SSE2__ - huemah = atan2BufferH[jr]; - #else - huemah = xatan2f(bufcolorig->b[ir][jr], bufcolorig->a[ir][jr]); - #endif - - float hh = Color::huelab_to_huehsv2(huemah); - hh += 1.f / 6.f; - - if (hh > 1.f) { - hh -= 1.f; - } - - const float val_HH = float (LIM01(((0.5f - lochhhmasCurve[500.f * hh])))); - kmaskHH = 2.f * val_HH; - const float hhro = kmaskHH; - - if (hhro != 0) { - newhr = huemah + hhro; - - if (newhr > rtengine::RT_PI_F) { - newhr -= 2 * rtengine::RT_PI_F; - } else if (newhr < -rtengine::RT_PI_F) { - newhr += 2 * rtengine::RT_PI_F; - } - } - sincosval = xsincosf(newhr); - - } - */ bufmaskblurcol->L[ir][jr] = clipLoc(kmaskL + kmaskHL + kmasstru + kmasblur); bufmaskblurcol->a[ir][jr] = clipC((kmaskC + chromult * kmaskH)); bufmaskblurcol->b[ir][jr] = clipC((kmaskC + chromult * kmaskH)); @@ -4821,8 +4756,8 @@ void ImProcFunctions::maskcalccol(bool invmask, bool pde, int bfw, int bfh, int if (rad != 0.f) { const float tmpblur = rad < 0.f ? -1.f / rad : 1.f + rad; - const int r1 = rtengine::max(4 / sk * tmpblur + 0.5, 1); - const int r2 = rtengine::max(25 / sk * tmpblur + 0.5, 1); + const int r1 = rtengine::max(4 / sk * tmpblur + 0.5f, 1); + const int r2 = rtengine::max(25 / sk * tmpblur + 0.5f, 1); constexpr float epsilmax = 0.005f; constexpr float epsilmin = 0.00001f; @@ -4896,8 +4831,9 @@ void ImProcFunctions::maskcalccol(bool invmask, bool pde, int bfw, int bfh, int if (loclmasCurvecolwav && lmasutilicolwav) { for (int i = 0; i < 500; i++) { - if (loclmasCurvecolwav[i] != 0.5) { + if (loclmasCurvecolwav[i] != 0.5f) { wavcurvemask = true; + break; } } } @@ -5156,7 +5092,7 @@ void ImProcFunctions::InverseSharp_Local(float **loctemp, const float hueref, co lp.colorde = -1;//to avoid black } - float ampli = 1.f + std::fabs(lp.colorde); + float ampli = 1.0 + std::fabs(lp.colorde); ampli = 2.f + 0.5f * (ampli - 2.f); constexpr float aadark = -1.f; @@ -5289,7 +5225,7 @@ void ImProcFunctions::Sharp_Local(int call, float **loctemp, int senstype, const lp.colorde = -1;//to avoid black } - float ampli = 1.f + std::fabs(lp.colorde); + float ampli = 1.0 + std::fabs(lp.colorde); ampli = 2.f + 0.5f * (ampli - 2.f); float darklim = 5000.f; @@ -5585,9 +5521,8 @@ void ImProcFunctions::transit_shapedetect_retinex(int call, int senstype, LabIma const bool usemaskreti = lp.enaretiMask && senstype == 4 && !lp.enaretiMasktmap; float strcli = 0.03f * lp.str; - if (lp.scalereti == 1) - { - strcli = 0.015 * lp.str; + if (lp.scalereti == 1) { + strcli = 0.015f * lp.str; } #ifdef _OPENMP @@ -6467,10 +6402,10 @@ void ImProcFunctions::calc_ref(int sp, LabImage * original, LabImage * transform for (int y = 0; y < spotSi; y++) { for (int x = 0; x < spotSi; x++) { - aveLblur += blurorig->L[y][x]; - aveAblur += blurorig->a[y][x]; - aveBblur += blurorig->b[y][x]; - aveChroblur += std::sqrt(SQR(blurorig->b[y - cy][x - cx]) + SQR(blurorig->a[y - cy][x - cx])); + aveLblur += static_cast(blurorig->L[y][x]); + aveAblur += static_cast(blurorig->a[y][x]); + aveBblur += static_cast(blurorig->b[y][x]); + aveChroblur += static_cast(std::sqrt(SQR(blurorig->b[y - cy][x - cx]) + SQR(blurorig->a[y - cy][x - cx]))); nsb++; } @@ -6480,10 +6415,10 @@ void ImProcFunctions::calc_ref(int sp, LabImage * original, LabImage * transform //ref for luma, chroma, hue for (int y = rtengine::max(cy, (int)(lp.yc - spotSize)); y < rtengine::min(transformed->H + cy, (int)(lp.yc + spotSize + 1)); y++) { for (int x = rtengine::max(cx, (int)(lp.xc - spotSize)); x < rtengine::min(transformed->W + cx, (int)(lp.xc + spotSize + 1)); x++) { - aveL += original->L[y - cy][x - cx]; - aveA += original->a[y - cy][x - cx]; - aveB += original->b[y - cy][x - cx]; - aveChro += std::sqrt(SQR(original->b[y - cy][x - cx]) + SQR(original->a[y - cy][x - cx])); + aveL += static_cast(original->L[y - cy][x - cx]); + aveA += static_cast(original->a[y - cy][x - cx]); + aveB += static_cast(original->b[y - cy][x - cx]); + aveChro += static_cast(std::sqrt(SQR(original->b[y - cy][x - cx]) + SQR(original->a[y - cy][x - cx]))); nab++; } } @@ -6509,7 +6444,7 @@ void ImProcFunctions::calc_ref(int sp, LabImage * original, LabImage * transform for (int y = 0; y < spotSi ; y ++) for (int x = 0; x < spotSi ; x ++) { - avesobel += sobelL->L[y][x]; + avesobel += static_cast(sobelL->L[y][x]); nbs++; } @@ -6523,21 +6458,21 @@ void ImProcFunctions::calc_ref(int sp, LabImage * original, LabImage * transform aveA = aveA / nab; aveB = aveB / nab; aveChro = aveChro / nab; - aveChro /= 327.68f; - avA = aveA / 327.68f; - avB = aveB / 327.68f; - avL = aveL / 327.68f; + aveChro /= 327.68; + avA = aveA / 327.68; + avB = aveB / 327.68; + avL = aveL / 327.68; hueref = xatan2f(avB, avA); //mean hue if (isdenoise) { aveLblur = aveLblur / nsb; aveChroblur = aveChroblur / nsb; - aveChroblur /= 327.68f; + aveChroblur /= 327.68; aveAblur = aveAblur / nsb; aveBblur = aveBblur / nsb; - float avAblur = aveAblur / 327.68f; - float avBblur = aveBblur / 327.68f; - float avLblur = aveLblur / 327.68f; + float avAblur = aveAblur / 327.68; + float avBblur = aveBblur / 327.68; + float avLblur = aveLblur / 327.68; huerefblur = xatan2f(avBblur, avAblur); chromarefblur = aveChroblur; lumarefblur = avLblur; @@ -6557,9 +6492,7 @@ void ImProcFunctions::calc_ref(int sp, LabImage * original, LabImage * transform delete blurorig; } - if (lumaref > 95.f) {//to avoid crash - lumaref = 95.f; - } + lumaref = rtengine::min(lumaref, 95.f); //to avoid crash } } //doc fftw3 says optimum is with size 2^a * 3^b * 5^c * 7^d * 11^e * 13^f with e+f = 0 or 1 @@ -6673,11 +6606,6 @@ void optfft(int N_fftwsize, int &bfh, int &bfw, int &bfhr, int &bfwr, struct loc } else { bfwr = bfw; } - - if (settings->verbose) { - printf("Nyst=%i Nyen=%i lp.yc=%f lp.lyT=%f lp.ly=%f bfh=%i bfhr=%i origH=%i ftsizeH=%i\n", ystart, yend, lp.yc, lp.lyT, lp.ly, bfh, bfhr, H, ftsizeH); - printf("Nxst=%i Nxen=%i lp.xc=%f lp.lxL=%f lp.lx=%f bfw=%i bfwr=%i origW=%i ftsizeW=%i\n", xstart, xend, lp.xc, lp.lxL, lp.lx, bfw, bfwr, W, ftsizeW); - } } void ImProcFunctions::BlurNoise_Local(LabImage *tmp1, LabImage * originalmask, const float hueref, const float chromaref, const float lumaref, local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk) @@ -6709,7 +6637,7 @@ void ImProcFunctions::BlurNoise_Local(LabImage *tmp1, LabImage * originalmask, c lp.colorde = -1;//to avoid black } - const float ampli = 1.5f + 0.5f * std::fabs(lp.colorde); + const float ampli = 1.5f + 0.5f * std::abs(lp.colorde); constexpr float darklim = 5000.f; constexpr float aadark = -1.f; @@ -6927,7 +6855,7 @@ void ImProcFunctions::transit_shapedetect2(int call, int senstype, const LabImag lp.colorde = -1;//to avoid black } - float ampli = 1.f + std::fabs(lp.colorde); + float ampli = 1.f + std::abs(lp.colorde); ampli = 2.f + 0.5f * (ampli - 2.f); float darklim = 5000.f; @@ -7299,7 +7227,7 @@ void ImProcFunctions::fftw_convol_blur(float * input, float * output, int bfw, i } else if (algo == 1) { n_x = 1.f / bfw; //gauss n_y = 1.f / bfh; - radsig = 1.f / (2.f * rtengine::RT_PI * radius * radius);//gauss + radsig = 1.f / (2.f * rtengine::RT_PI_F * radius * radius);//gauss } n_x = n_x * n_x; @@ -7592,7 +7520,7 @@ void ImProcFunctions::fftw_tile_blur(int GW, int GH, int tilssize, int max_numbl } int topproc = (vblk - 1) * offset; - const int numblox_W = ceil((static_cast(GW)) / offset); + const int lnumblox_W = ceil((static_cast(GW)) / offset); const float DCTnorm = 1.0f / (4 * tilssize * tilssize); //for DCT int imin = rtengine::max(0, - topproc); @@ -7600,7 +7528,7 @@ void ImProcFunctions::fftw_tile_blur(int GW, int GH, int tilssize, int max_numbl int imax = bottom - topproc; for (int i = imin; i < imax; ++i) { - for (int hblk = 0; hblk < numblox_W; ++hblk) { + for (int hblk = 0; hblk < lnumblox_W; ++hblk) { int left = (hblk - 1) * offset; int right = rtengine::min(left + tilssize, GW); int jmin = rtengine::max(0, -left); @@ -7982,10 +7910,7 @@ void ImProcFunctions::wavcont(const struct local_params& lp, float ** tmp, wavel #endif for (int dir = 1; dir < 4; dir++) { for (int level = level_bl; level < maxlvl; ++level) { - const int W_L = wdspot.level_W(level); - const int H_L = wdspot.level_H(level); - const auto wav_L = wdspot.level_coeffs(level)[dir]; - madL[level][dir - 1] = Mad(wav_L, W_L * H_L);//evaluate noise by level + madL[level][dir - 1] = Mad(wdspot.level_coeffs(level)[dir], wdspot.level_W(level) * wdspot.level_H(level)); //evaluate noise by level } } @@ -8177,21 +8102,21 @@ void ImProcFunctions::wavcontrast4(struct local_params& lp, float ** tmp, float } } - int W_L = wdspot->level_W(0); - int H_L = wdspot->level_H(0); + int W_Level = wdspot->level_W(0); + int H_Level = wdspot->level_H(0); float *wav_L0 = wdspot->get_coeff0(); if (radblur > 0.f && blurena) { - float* src[H_L]; - for (int i = 0; i < H_L; ++i) { - src[i] = &wav_L0[i * W_L]; + float* src[H_Level]; + for (int i = 0; i < H_Level; ++i) { + src[i] = &wav_L0[i * W_Level]; } #ifdef _OPENMP #pragma omp parallel if (multiThread) #endif { - gaussianBlur(src, src, W_L, H_L, radblur); + gaussianBlur(src, src, W_Level, H_Level, radblur); } } @@ -8199,7 +8124,7 @@ void ImProcFunctions::wavcontrast4(struct local_params& lp, float ** tmp, float const float Compression = expf(-compress); const float DetailBoost = std::max(compress, 0.f); - CompressDR(wav_L0, W_L, H_L, Compression, DetailBoost); + CompressDR(wav_L0, W_Level, H_Level, Compression, DetailBoost); } if ((lp.residsha < 0.f || lp.residhi < 0.f)) { @@ -8221,7 +8146,7 @@ void ImProcFunctions::wavcontrast4(struct local_params& lp, float ** tmp, float #ifdef _OPENMP #pragma omp parallel for if (multiThread) #endif - for (int i = 0; i < W_L * H_L; i++) { + for (int i = 0; i < W_Level * H_Level; i++) { const float LL100 = wav_L0[i] / 327.68f; if (LL100 < lp.residshathr) { @@ -8240,14 +8165,14 @@ void ImProcFunctions::wavcontrast4(struct local_params& lp, float ** tmp, float } if ((lp.residsha > 0.f || lp.residhi > 0.f)) { - const std::unique_ptr temp(new LabImage(W_L, H_L)); + const std::unique_ptr temp(new LabImage(W_Level, H_Level)); #ifdef _OPENMP #pragma omp parallel for if (multiThread) #endif - for (int i = 0; i < H_L; i++) { - for (int j = 0; j < W_L; j++) { - temp->L[i][j] = wav_L0[i * W_L + j]; + for (int i = 0; i < H_Level; i++) { + for (int j = 0; j < W_Level; j++) { + temp->L[i][j] = wav_L0[i * W_Level + j]; } } @@ -8257,25 +8182,25 @@ void ImProcFunctions::wavcontrast4(struct local_params& lp, float ** tmp, float #pragma omp parallel for if (multiThread) #endif - for (int i = 0; i < H_L; i++) { - for (int j = 0; j < W_L; j++) { - wav_L0[i * W_L + j] = temp->L[i][j]; + for (int i = 0; i < H_Level; i++) { + for (int j = 0; j < W_Level; j++) { + wav_L0[i * W_Level + j] = temp->L[i][j]; } } } - if (contrast != 0.) { + if (contrast != 0.f) { double avedbl = 0.0; // use double precision for large summations #ifdef _OPENMP #pragma omp parallel for reduction(+:avedbl) if (multiThread) #endif - for (int i = 0; i < W_L * H_L; i++) { - avedbl += wav_L0[i]; + for (int i = 0; i < W_Level * H_Level; i++) { + avedbl += static_cast(wav_L0[i]); } - const float avg = LIM01(avedbl / (32768.f * W_L * H_L)); - double contreal = 0.6 * contrast; + const double avg = LIM01(avedbl / (32768.0 * W_Level * H_Level)); + double contreal = 0.6f * contrast; DiagonalCurve resid_contrast({ DCT_NURBS, 0, 0, @@ -8286,8 +8211,8 @@ void ImProcFunctions::wavcontrast4(struct local_params& lp, float ** tmp, float #ifdef _OPENMP #pragma omp parallel for if (multiThread) #endif - for (int i = 0; i < W_L * H_L; i++) { - wav_L0[i] = resid_contrast.getVal(LIM01(wav_L0[i] / 32768.f)) * 32768.f; + for (int i = 0; i < W_Level * H_Level; i++) { + wav_L0[i] = resid_contrast.getVal(LIM01(wav_L0[i] / 32768.f)) * 32768.0; } } @@ -8338,19 +8263,17 @@ void ImProcFunctions::wavcontrast4(struct local_params& lp, float ** tmp, float float eddlow = 15.f; float eddlipinfl = 0.005f * lp.edgw + 0.4f; float eddlipampl = 1.f + lp.basew / 50.f; - int W_L = wdspot->level_W(0);//provisory W_L H_L - int H_L = wdspot->level_H(0); float *koeLi[12]; float maxkoeLi[12] = {0.f}; - float *koeLibuffer = new float[12 * H_L * W_L]; //12 + float *koeLibuffer = new float[12 * H_Level * W_Level]; //12 for (int i = 0; i < 12; i++) { - koeLi[i] = &koeLibuffer[i * W_L * H_L]; + koeLi[i] = &koeLibuffer[i * W_Level * H_Level]; } - array2D tmC(W_L, H_L); + array2D tmC(W_Level, H_Level); float gradw = lp.gradw; float tloww = lp.tloww; @@ -8374,8 +8297,8 @@ void ImProcFunctions::wavcontrast4(struct local_params& lp, float ** tmp, float #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif - for (int i = 1; i < H_L - 1; i++) { - for (int j = 1; j < W_L - 1; j++) { + for (int i = 1; i < H_Level - 1; i++) { + for (int j = 1; j < W_Level - 1; j++) { //treatment of koeLi and maxkoeLi if (lp.lip3) {//Sobel Canny algo improve with parameters // comparison between pixel and neighbors @@ -8384,16 +8307,16 @@ void ImProcFunctions::wavcontrast4(struct local_params& lp, float ** tmp, float const auto somm = neigh ? 40.f : 50.f; for (int dir = 1; dir < 4; dir++) { //neighbors proxi - koeLi[lvl * 3 + dir - 1][i * W_L + j] = (kneigh * koeLi[lvl * 3 + dir - 1][i * W_L + j] + - 2.f * koeLi[lvl * 3 + dir - 1][(i - 1) * W_L + j] + 2.f * koeLi[lvl * 3 + dir - 1][(i + 1) * W_L + j] + 2.f * koeLi[lvl * 3 + dir - 1][i * W_L + j + 1] + 2.f * koeLi[lvl * 3 + dir - 1][i * W_L + j - 1] - + koeLi[lvl * 3 + dir - 1][(i - 1) * W_L + j - 1] + koeLi[lvl * 3 + dir - 1][(i - 1) * W_L + j + 1] + koeLi[lvl * 3 + dir - 1][(i + 1) * W_L + j - 1] + koeLi[lvl * 3 + dir - 1][(i + 1) * W_L + j + 1]) / somm; + koeLi[lvl * 3 + dir - 1][i * W_Level + j] = (kneigh * koeLi[lvl * 3 + dir - 1][i * W_Level + j] + + 2.f * koeLi[lvl * 3 + dir - 1][(i - 1) * W_Level + j] + 2.f * koeLi[lvl * 3 + dir - 1][(i + 1) * W_Level + j] + 2.f * koeLi[lvl * 3 + dir - 1][i * W_Level + j + 1] + 2.f * koeLi[lvl * 3 + dir - 1][i * W_Level + j - 1] + + koeLi[lvl * 3 + dir - 1][(i - 1) * W_Level + j - 1] + koeLi[lvl * 3 + dir - 1][(i - 1) * W_Level + j + 1] + koeLi[lvl * 3 + dir - 1][(i + 1) * W_Level + j - 1] + koeLi[lvl * 3 + dir - 1][(i + 1) * W_Level + j + 1]) / somm; } } float interm = 0.f; for (int dir = 1; dir < 4; dir++) { //here I evaluate combination of vert / diag / horiz...we are with multiplicators of the signal - interm += SQR(koeLi[lvl * 3 + dir - 1][i * W_L + j]); + interm += SQR(koeLi[lvl * 3 + dir - 1][i * W_Level + j]); } interm = std::sqrt(interm) * 0.57736721f; @@ -8401,8 +8324,8 @@ void ImProcFunctions::wavcontrast4(struct local_params& lp, float ** tmp, float constexpr float eps = 0.0001f; // I think this double ratio (alph, beta) is better than arctg - float alph = koeLi[lvl * 3][i * W_L + j] / (koeLi[lvl * 3 + 1][i * W_L + j] + eps); //ratio between horizontal and vertical - float beta = koeLi[lvl * 3 + 2][i * W_L + j] / (koeLi[lvl * 3 + 1][i * W_L + j] + eps); //ratio between diagonal and horizontal + float alph = koeLi[lvl * 3][i * W_Level + j] / (koeLi[lvl * 3 + 1][i * W_Level + j] + eps); //ratio between horizontal and vertical + float beta = koeLi[lvl * 3 + 2][i * W_Level + j] / (koeLi[lvl * 3 + 1][i * W_Level + j] + eps); //ratio between diagonal and horizontal //alph evaluate the direction of the gradient regularity Lipschitz // if = 1 we are on an edge @@ -8445,7 +8368,7 @@ void ImProcFunctions::wavcontrast4(struct local_params& lp, float ** tmp, float } //we can change this part of algo==> not equal but ponderate - koeLi[lvl * 3][i * W_L + j] = koeLi[lvl * 3 + 1][i * W_L + j] = koeLi[lvl * 3 + 2][i * W_L + j] = interm; //new value + koeLi[lvl * 3][i * W_Level + j] = koeLi[lvl * 3 + 1][i * W_Level + j] = koeLi[lvl * 3 + 2][i * W_Level + j] = interm; //new value //here KoeLi contains values where gradient is high and coef high, and eliminate low values... } } @@ -8883,23 +8806,17 @@ void ImProcFunctions::fftw_denoise(int sk, int GW, int GH, int max_numblox_W, in if (chrom == 0) { params_Ldetail = rtengine::min(float(lp.noiseldetail), 99.9f); // max out to avoid div by zero when using noisevar_Ldetail as divisor - noisevar_Ldetail = SQR(static_cast(SQR(100. - params_Ldetail) + 50.*(100. - params_Ldetail)) * TS * 0.5f); + noisevar_Ldetail = SQR(static_cast(SQR(100.f - params_Ldetail) + 50.f * (100.f - params_Ldetail)) * TS * 0.5f); } else if (chrom == 1) { params_Ldetail = rtengine::min(float(lp.noisechrodetail), 99.9f); - // noisevar_Ldetail = 100.f * pow((static_cast(SQR(100. - params_Ldetail) + 50.*(100. - params_Ldetail)) * TS * 0.5f), 2);//to test ??? - noisevar_Ldetail = 100.f * pow((static_cast(SQR(100. - params_Ldetail)) * TS * 0.5f), 2);//to test ??? + noisevar_Ldetail = 100.f * rtengine::SQR((static_cast(SQR(100.f - params_Ldetail)) * TS * 0.5f));//to test ??? } - // float noisevar_Ldetail = SQR(static_cast(SQR(100. - params_Ldetail) + 50.*(100. - params_Ldetail)) * TS * 0.5f); - - - for (int hblk = 0; hblk < numblox_W; ++hblk) { ImProcFunctions::RGBtile_denoise(fLblox, hblk, noisevar_Ldetail); }//end of horizontal block loop - //now perform inverse FT of an entire row of blocks if (numblox_W == max_numblox_W) { fftwf_execute_r2r(plan_backward_blox[0], fLblox, Lblox); //for DCT @@ -9021,7 +8938,6 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl const int wspot = xe - xs; if (((lp.noiself > 0.f || lp.noiself0 > 0.f || lp.noiself2 > 0.f || lp.nlstr > 0 || lp.wavcurvedenoi || lp.noiselc > 0.f || lp.noisecf > 0.f || lp.noisecc > 0.f -// || lp.showmaskblmet == 2 || lp.enablMask || lp.showmaskblmet == 3 || lp.showmaskblmet == 4 || aut == 1 || aut == 2) && lp.denoiena) || execdenoi) { // sk == 1 ?? || execmaskden || aut == 1 || aut == 2) && lp.denoiena && lp.quamet != 3) || execdenoi) { // sk == 1 ?? StopWatch Stop1("locallab Denoise called"); @@ -9030,7 +8946,6 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl MyMutex::MyLock lock(*fftwMutex); } - if (lp.noisecf >= 0.01f || lp.noisecc >= 0.01f || aut == 1 || aut == 2) { noiscfactiv = false; levred = 7; @@ -9043,7 +8958,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if (locwavCurvehue && locwavhueutili) { for (int i = 0; i < 500; i++) { - if (locwavCurvehue[i] != 0.5) { + if (locwavCurvehue[i] != 0.5f) { HHhuecurve = true; break; } @@ -9072,7 +8987,6 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl // calculate min size of numblox_W. int min_numblox_W = ceil((static_cast(GW)) / offset) + 2; - for (int ir = 0; ir < GH; ir++) for (int jr = 0; jr < GW; jr++) { tmp1.L[ir][jr] = original->L[ir][jr]; @@ -9113,20 +9027,20 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if (aut == 0) { if (levred == 7) { edge = 2; - vari[0] = 0.8f * SQR((lp.noiself0 / 125.0) * (1.0 + lp.noiself0 / 25.0)); - vari[1] = 0.8f * SQR((lp.noiself / 125.0) * (1.0 + lp.noiself / 25.0)); - vari[2] = 0.8f * SQR((lp.noiself2 / 125.0) * (1.0 + lp.noiself2 / 25.0)); + vari[0] = 0.8f * SQR((lp.noiself0 / 125.f) * (1.f + lp.noiself0 / 25.f)); + vari[1] = 0.8f * SQR((lp.noiself / 125.f) * (1.f + lp.noiself / 25.f)); + vari[2] = 0.8f * SQR((lp.noiself2 / 125.f) * (1.f + lp.noiself2 / 25.f)); - vari[3] = 0.8f * SQR((lp.noiselc / 125.0) * (1.0 + lp.noiselc / 25.0)); - vari[4] = 0.8f * SQR((lp.noiselc4 / 125.0) * (1.0 + lp.noiselc4 / 25.0)); - vari[5] = 0.8f * SQR((lp.noiselc5 / 125.0) * (1.0 + lp.noiselc5 / 25.0)); - vari[6] = 0.8f * SQR((lp.noiselc6 / 125.0) * (1.0 + lp.noiselc6 / 25.0)); + vari[3] = 0.8f * SQR((lp.noiselc / 125.f) * (1.f + lp.noiselc / 25.f)); + vari[4] = 0.8f * SQR((lp.noiselc4 / 125.f) * (1.f + lp.noiselc4 / 25.f)); + vari[5] = 0.8f * SQR((lp.noiselc5 / 125.f) * (1.f + lp.noiselc5 / 25.f)); + vari[6] = 0.8f * SQR((lp.noiselc6 / 125.f) * (1.f + lp.noiselc6 / 25.f)); } else if (levred == 4) { edge = 3; - vari[0] = 0.8f * SQR((lp.noiself0 / 125.0) * (1.0 + lp.noiself0 / 25.0)); - vari[1] = 0.8f * SQR((lp.noiself / 125.0) * (1.0 + lp.noiself / 25.0)); - vari[2] = 0.8f * SQR((lp.noiselc / 125.0) * (1.0 + lp.noiselc / 25.0)); - vari[3] = 0.8f * SQR((lp.noiselc / 125.0) * (1.0 + lp.noiselc / 25.0)); + vari[0] = 0.8f * SQR((lp.noiself0 / 125.f) * (1.f + lp.noiself0 / 25.f)); + vari[1] = 0.8f * SQR((lp.noiself / 125.f) * (1.f + lp.noiself / 25.f)); + vari[2] = 0.8f * SQR((lp.noiselc / 125.f) * (1.f + lp.noiselc / 25.f)); + vari[3] = 0.8f * SQR((lp.noiselc / 125.f) * (1.f + lp.noiselc / 25.f)); } } else if (aut == 1 || aut == 2) { @@ -9146,31 +9060,19 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl { float kr3 = 0.f; - float kr4 = 0.f; - float kr5 = 0.f; if (aut == 0 || aut == 1) { if ((lp.noiselc < 30.f && aut == 0) || (mxsl < 30.f && aut == 1)) { kr3 = 0.f; - kr4 = 0.f; - kr5 = 0.f; } else if ((lp.noiselc < 50.f && aut == 0) || (mxsl < 50.f && aut == 1)) { kr3 = 0.5f; - kr4 = 0.3f; - kr5 = 0.2f; } else if ((lp.noiselc < 70.f && aut == 0) || (mxsl < 70.f && aut == 1)) { kr3 = 0.7f; - kr4 = 0.5f; - kr5 = 0.3f; } else { kr3 = 1.f; - kr4 = 1.f; - kr5 = 1.f; } } else if (aut == 2) { kr3 = 1.f; - kr4 = 1.f; - kr5 = 1.f; } vari[0] = rtengine::max(0.000001f, vari[0]); @@ -9179,10 +9081,9 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl vari[3] = rtengine::max(0.000001f, kr3 * vari[3]); if (levred == 7) { - kr3 = kr4 = kr5 = 1.f; - vari[4] = rtengine::max(0.000001f, kr4 * vari[4]); - vari[5] = rtengine::max(0.000001f, kr5 * vari[5]); - vari[6] = rtengine::max(0.000001f, kr5 * vari[6]); + vari[4] = rtengine::max(0.000001f, vari[4]); + vari[5] = rtengine::max(0.000001f, vari[5]); + vari[6] = rtengine::max(0.000001f, vari[6]); } float* noisevarlum = new float[GH * GW]; @@ -9260,7 +9161,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl for (int ir = 0; ir < GH; ir++) for (int jr = 0; jr < GW; jr++) { float hueG = xatan2f(tmp1.b[ir][jr], tmp1.a[ir][jr]); - float valparam = float (2.f * (locwavCurvehue[500.f * Color::huelab_to_huehsv2(hueG)] - 0.5f)); //get H=f(H) + float valparam = 2.f * (locwavCurvehue[500.f * static_cast(Color::huelab_to_huehsv2(hueG))] - 0.5f); //get H=f(H) noisevarhue[(ir >> 1)*GW2 + (jr >> 1)] = 1.f + valparam; noisevarlum[(ir >> 1)*GW2 + (jr >> 1)] *= noisevarhue[(ir >> 1)*GW2 + (jr >> 1)]; } @@ -9348,15 +9249,15 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } else if (levred == 4) { edge = 3; - variC[0] = SQR(lp.noisecf / 10.0); - variC[1] = SQR(lp.noisecf / 10.0); - variC[2] = SQR(lp.noisecf / 10.0); - variC[3] = SQR(lp.noisecf / 10.0); + variC[0] = SQR(lp.noisecf / 10.f); + variC[1] = SQR(lp.noisecf / 10.f); + variC[2] = SQR(lp.noisecf / 10.f); + variC[3] = SQR(lp.noisecf / 10.f); - variCb[0] = SQR(lp.noisecf / 10.0); - variCb[1] = SQR(lp.noisecf / 10.0); - variCb[2] = SQR(lp.noisecf / 10.0); - variCb[3] = SQR(lp.noisecf / 10.0); + variCb[0] = SQR(lp.noisecf / 10.f); + variCb[1] = SQR(lp.noisecf / 10.f); + variCb[2] = SQR(lp.noisecf / 10.f); + variCb[3] = SQR(lp.noisecf / 10.f); } } else if (aut == 1 || aut == 2) { @@ -9643,97 +9544,87 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl NLMeans(tmp1.L, lp.nlstr, lp.nldet, lp.nlpat, lp.nlrad, lp.nlgam, GW, GH, float (sk), multiThread); } if(lp.smasktyp != 0) { - if(lp.enablMask && lp.recothrd != 1.f && lp.smasktyp != 0) { - LabImage tmp3(GW, GH); + if(lp.enablMask && lp.recothrd != 1.f) { + LabImage tmp3(GW, GH); - for (int ir = 0; ir < GH; ir++){ - for (int jr = 0; jr < GW; jr++) { - tmp3.L[ir][jr] = original->L[ir][jr]; - tmp3.a[ir][jr] = original->a[ir][jr]; - tmp3.b[ir][jr] = original->b[ir][jr]; - } + for (int ir = 0; ir < GH; ir++){ + for (int jr = 0; jr < GW; jr++) { + tmp3.L[ir][jr] = original->L[ir][jr]; + tmp3.a[ir][jr] = original->a[ir][jr]; + tmp3.b[ir][jr] = original->b[ir][jr]; } - - array2D masklum; - array2D masklumch; - masklum(GW, GH); - masklumch(GW, GH); - for (int ir = 0; ir < GH; ir++) - for (int jr = 0; jr < GW; jr++) { - masklum[ir][jr] = 1.f; - masklumch[ir][jr] = 1.f; - } - - float hig = lp.higthrd; - float higc; - calcdif(hig, higc); - float low = lp.lowthrd; - float lowc; - calcdif(low, lowc); - float mid = 0.01f * lp.midthrd; - float midch = 0.01f * lp.midthrdch; - - if(higc < lowc) { - higc = lowc + 0.01f; - } - float th = (lp.recothrd - 1.f); - float ahigh = th / (higc - 100.f); - float bhigh = 1.f - higc * ahigh; - - float alow = th / lowc; - float blow = 1.f - th; -#ifdef _OPENMP - #pragma omp parallel for if (multiThread) -#endif - for (int ir = 0; ir < GH; ir++) - for (int jr = 0; jr < GW; jr++) { - const float lM = bufmaskblurbl->L[ir][jr]; - const float lmr = lM / 327.68f; - if (lM < 327.68f * lowc) { - masklum[ir][jr] = alow * lmr + blow; - masklumch[ir][jr] = alow * lmr + blow; - } else if (lM < 327.68f * higc) { - masklum[ir][jr] = (1.f - mid); - masklumch[ir][jr] = (1.f - midch); - } else { - masklum[ir][jr] = ahigh * lmr + bhigh; - masklumch[ir][jr] = ahigh * lmr + bhigh; - } - float k = masklum[ir][jr]; - float kch = masklumch[ir][jr]; - if(lp.invmaskd == true) { - masklum[ir][jr] = 1.f - pow(k, lp.decayd); - masklumch[ir][jr] = 1.f - pow(kch, lp.decayd); - } else { - masklum[ir][jr] = pow(k, lp.decayd); - masklumch[ir][jr] = pow(kch, lp.decayd); - } - - } - - for (int i = 0; i < 3; ++i) { - boxblur(static_cast(masklum), static_cast(masklum), 10 / sk, GW, GH, false); - boxblur(static_cast(masklumch), static_cast(masklumch), 10 / sk, GW, GH, false); - } -#ifdef _OPENMP - #pragma omp parallel for if (multiThread) -#endif - for (int i = 0; i < GH; ++i) { - for (int j = 0; j < GW; ++j) { - tmp1.L[i][j] = (tmp3.L[i][j] - tmp1.L[i][j]) * LIM01(masklum[i][j]) + tmp1.L[i][j]; - tmp1.a[i][j] = (tmp3.a[i][j] - tmp1.a[i][j]) * LIM01(masklumch[i][j]) + tmp1.a[i][j]; - tmp1.b[i][j] = (tmp3.b[i][j] - tmp1.b[i][j]) * LIM01(masklumch[i][j]) + tmp1.b[i][j]; - } - } - masklum.free(); - masklumch.free(); } + array2D masklum(GW, GH); + array2D masklumch(GW, GH); + + float hig = lp.higthrd; + float higc; + calcdif(hig, higc); + float low = lp.lowthrd; + float lowc; + calcdif(low, lowc); + float mid = 0.01f * lp.midthrd; + float midch = 0.01f * lp.midthrdch; + + if(higc < lowc) { + higc = lowc + 0.01f; + } + float th = (lp.recothrd - 1.f); + float ahigh = th / (higc - 100.f); + float bhigh = 1.f - higc * ahigh; + + float alow = th / lowc; + float blow = 1.f - th; +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + for (int ir = 0; ir < GH; ir++) { + for (int jr = 0; jr < GW; jr++) { + const float lmr = bufmaskblurbl->L[ir][jr] / 327.68f; + float k; + float kch; + if (lmr < lowc) { + k = alow * lmr + blow; + kch = alow * lmr + blow; + } else if (lmr < higc) { + k = 1.f - mid; + kch = 1.f - midch; + } else { + k = ahigh * lmr + bhigh; + kch = ahigh * lmr + bhigh; + } + if(lp.invmaskd) { + masklum[ir][jr] = 1.f - pow_F(k, lp.decayd); + masklumch[ir][jr] = 1.f - pow_F(kch, lp.decayd); + } else { + masklum[ir][jr] = pow_F(k, lp.decayd); + masklumch[ir][jr] = pow_F(kch, lp.decayd); + } + } + } + + for (int i = 0; i < 3; ++i) { + boxblur(static_cast(masklum), static_cast(masklum), 10 / sk, GW, GH, multiThread); + boxblur(static_cast(masklumch), static_cast(masklumch), 10 / sk, GW, GH, multiThread); + } +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + for (int i = 0; i < GH; ++i) { + for (int j = 0; j < GW; ++j) { + tmp1.L[i][j] = (tmp3.L[i][j] - tmp1.L[i][j]) * LIM01(masklum[i][j]) + tmp1.L[i][j]; + tmp1.a[i][j] = (tmp3.a[i][j] - tmp1.a[i][j]) * LIM01(masklumch[i][j]) + tmp1.a[i][j]; + tmp1.b[i][j] = (tmp3.b[i][j] - tmp1.b[i][j]) * LIM01(masklumch[i][j]) + tmp1.b[i][j]; + } + } + masklum.free(); + masklumch.free(); + } DeNoise_Local(call, lp, originalmaskbl, levred, huerefblur, lumarefblur, chromarefblur, original, transformed, tmp1, cx, cy, sk); } else { DeNoise_Local(call, lp, original, levred, huerefblur, lumarefblur, chromarefblur, original, transformed, tmp1, cx, cy, sk); } - } else if (call == 2) { //simpleprocess const int ystart = rtengine::max(static_cast(lp.yc - lp.lyT) - cy, 0); @@ -9809,20 +9700,20 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if (aut == 0) { if (levred == 7) { edge = 2; - vari[0] = 0.8f * SQR((lp.noiself0 / 125.0) * (1.0 + lp.noiself0 / 25.0)); - vari[1] = 0.8f * SQR((lp.noiself / 125.0) * (1.0 + lp.noiself / 25.0)); - vari[2] = 0.8f * SQR((lp.noiself2 / 125.0) * (1.0 + lp.noiself2 / 25.0)); + vari[0] = 0.8f * SQR((lp.noiself0 / 125.f) * (1.f + lp.noiself0 / 25.f)); + vari[1] = 0.8f * SQR((lp.noiself / 125.f) * (1.f + lp.noiself / 25.f)); + vari[2] = 0.8f * SQR((lp.noiself2 / 125.f) * (1.f + lp.noiself2 / 25.f)); - vari[3] = 0.8f * SQR((lp.noiselc / 125.0) * (1.0 + lp.noiselc / 25.0)); - vari[4] = 0.8f * SQR((lp.noiselc4 / 125.0) * (1.0 + lp.noiselc4 / 25.0)); - vari[5] = 0.8f * SQR((lp.noiselc5 / 125.0) * (1.0 + lp.noiselc5 / 25.0)); - vari[6] = 0.8f * SQR((lp.noiselc6 / 125.0) * (1.0 + lp.noiselc6 / 25.0)); + vari[3] = 0.8f * SQR((lp.noiselc / 125.f) * (1.f + lp.noiselc / 25.f)); + vari[4] = 0.8f * SQR((lp.noiselc4 / 125.f) * (1.f + lp.noiselc4 / 25.f)); + vari[5] = 0.8f * SQR((lp.noiselc5 / 125.f) * (1.f + lp.noiselc5 / 25.f)); + vari[6] = 0.8f * SQR((lp.noiselc6 / 125.f) * (1.f + lp.noiselc6 / 25.f)); } else if (levred == 4) { edge = 3; - vari[0] = 0.8f * SQR((lp.noiself0 / 125.0) * (1.0 + lp.noiself0 / 25.0)); - vari[1] = 0.8f * SQR((lp.noiself / 125.0) * (1.0 + lp.noiself / 25.0)); - vari[2] = 0.8f * SQR((lp.noiselc / 125.0) * (1.0 + lp.noiselc / 25.0)); - vari[3] = 0.8f * SQR((lp.noiselc / 125.0) * (1.0 + lp.noiselc / 25.0)); + vari[0] = 0.8f * SQR((lp.noiself0 / 125.f) * (1.f + lp.noiself0 / 25.f)); + vari[1] = 0.8f * SQR((lp.noiself / 125.f) * (1.f + lp.noiself / 25.f)); + vari[2] = 0.8f * SQR((lp.noiselc / 125.f) * (1.f + lp.noiselc / 25.f)); + vari[3] = 0.8f * SQR((lp.noiselc / 125.f) * (1.f + lp.noiselc / 25.f)); } } else if (aut == 1 || aut == 2) { @@ -9842,32 +9733,19 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl { float kr3 = 0.f; - float kr4 = 0.f; - float kr5 = 0.f; if (aut == 0 || aut == 1) { if ((lp.noiselc < 30.f && aut == 0) || (mxsl < 30.f && aut == 1)) { kr3 = 0.f; - kr4 = 0.f; - kr5 = 0.f; } else if ((lp.noiselc < 50.f && aut == 0) || (mxsl < 50.f && aut == 1)) { kr3 = 0.5f; - kr4 = 0.3f; - kr5 = 0.2f; } else if ((lp.noiselc < 70.f && aut == 0) || (mxsl < 70.f && aut == 1)) { kr3 = 0.7f; - kr4 = 0.5f; - kr5 = 0.3f; } else { kr3 = 1.f; - kr4 = 1.f; - kr5 = 1.f; } } else if (aut == 2) { kr3 = 1.f; - kr4 = 1.f; - kr5 = 1.f; - } vari[0] = rtengine::max(0.000001f, vari[0]); @@ -9876,10 +9754,9 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl vari[3] = rtengine::max(0.000001f, kr3 * vari[3]); if (levred == 7) { - kr3 = kr4 = kr5 = 1.f; - vari[4] = rtengine::max(0.000001f, kr4 * vari[4]); - vari[5] = rtengine::max(0.000001f, kr5 * vari[5]); - vari[6] = rtengine::max(0.000001f, kr5 * vari[6]); + vari[4] = rtengine::max(0.000001f, vari[4]); + vari[5] = rtengine::max(0.000001f, vari[5]); + vari[6] = rtengine::max(0.000001f, vari[6]); } // float* noisevarlum = nullptr; // we need a dummy to pass it to WaveletDenoiseAllL @@ -9958,7 +9835,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl for (int ir = 0; ir < bfh; ir++) for (int jr = 0; jr < bfw; jr++) { float hueG = xatan2f(bufwv.b[ir][jr], bufwv.a[ir][jr]); - float valparam = float (2.f * (locwavCurvehue[500.f * Color::huelab_to_huehsv2(hueG)] - 0.5f)); //get H=f(H) + float valparam = 2.f * (locwavCurvehue[500.f * static_cast(Color::huelab_to_huehsv2(hueG))] - 0.5f); //get H=f(H) noisevarhue[(ir >> 1)* bfw2 + (jr >> 1)] = 1.f + valparam; noisevarlum[(ir >> 1)* bfw2 + (jr >> 1)] *= noisevarhue[(ir >> 1)* bfw2 + (jr >> 1)]; } @@ -10044,15 +9921,15 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl } else if (levred == 4) { edge = 3; - variC[0] = SQR(lp.noisecf / 10.0); - variC[1] = SQR(lp.noisecf / 10.0); - variC[2] = SQR(lp.noisecf / 10.0); - variC[3] = SQR(lp.noisecf / 10.0); + variC[0] = SQR(lp.noisecf / 10.f); + variC[1] = SQR(lp.noisecf / 10.f); + variC[2] = SQR(lp.noisecf / 10.f); + variC[3] = SQR(lp.noisecf / 10.f); - variCb[0] = SQR(lp.noisecf / 10.0); - variCb[1] = SQR(lp.noisecf / 10.0); - variCb[2] = SQR(lp.noisecf / 10.0); - variCb[3] = SQR(lp.noisecf / 10.0); + variCb[0] = SQR(lp.noisecf / 10.f); + variCb[1] = SQR(lp.noisecf / 10.f); + variCb[2] = SQR(lp.noisecf / 10.f); + variCb[3] = SQR(lp.noisecf / 10.f); } @@ -10340,7 +10217,7 @@ void ImProcFunctions::DeNoise(int call, float * slidL, float * slida, float * sl if (lp.smasktyp != 0) { - if(lp.enablMask && lp.recothrd != 1.f && lp.smasktyp != 0) { + if(lp.enablMask && lp.recothrd != 1.f) { LabImage tmp3(bfw, bfh); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) @@ -10921,7 +10798,7 @@ void ImProcFunctions::NLMeans(float **img, int strength, int detail_thresh, int const int H = bfh; float gamma = gam; rtengine::GammaValues g_a; //gamma parameters - double pwr = 1.0 / gam;//default 3.0 - gamma Lab + double pwr = 1.0 / static_cast(gam);//default 3.0 - gamma Lab double ts = 9.03296;//always the same 'slope' in the extrem shadows - slope Lab rtengine::Color::calcGamma(pwr, ts, g_a); // call to calcGamma with selected gamma and slope @@ -11044,7 +10921,7 @@ void ImProcFunctions::NLMeans(float **img, int strength, int detail_thresh, int #endif #ifdef _OPENMP -# pragma omp parallel if (multithread) + #pragma omp parallel if (multithread) #endif { @@ -11055,7 +10932,7 @@ void ImProcFunctions::NLMeans(float **img, int strength, int detail_thresh, int #endif #ifdef _OPENMP -# pragma omp for schedule(dynamic, 2) + #pragma omp for schedule(dynamic, 2) #endif for (int tile = 0; tile < ntiles; ++tile) { const int tile_y = tile / ntiles_x; @@ -11069,13 +10946,13 @@ void ImProcFunctions::NLMeans(float **img, int strength, int detail_thresh, int const int end_x = std::min(start_x + tile_size, WW); const int TW = end_x - start_x; - const auto Y = [=](int y) -> int { return LIM(y+start_y, 0, HH-1); }; - const auto X = [=](int x) -> int { return LIM(x+start_x, 0, WW-1); }; + const auto Yf = [=](int y) -> int { return LIM(y+start_y, 0, HH-1); }; + const auto Xf = [=](int x) -> int { return LIM(x+start_x, 0, WW-1); }; const auto score = [&](int tx, int ty, int zx, int zy) -> float { - return SQR(src[Y(zy)][X(zx)] - src[Y(zy + ty)][X(zx + tx)]); + return SQR(src[Yf(zy)][Xf(zx)] - src[Yf(zy + ty)][Xf(zx + tx)]); }; array2D St(TW, TH);//, ARRAY2D_ALIGNED); @@ -11216,7 +11093,7 @@ void ImProcFunctions::Lab_Local( const LUTf& lmaskloglocalcurve, bool localmasklogutili, const LUTf& lmasklocal_curve, bool localmask_utili, - const LocCCmaskCurve& locccmasCurve, bool lcmasutili, const LocLLmaskCurve& locllmasCurve, bool llmasutili, const LocHHmaskCurve& lochhmasCurve, bool lhmasutili, const LocHHmaskCurve& lochhhmasCurve, bool lhhmasutili, + const LocCCmaskCurve& locccmasCurve, bool lcmasutili, const LocLLmaskCurve& locllmasCurve, bool llmasutili, const LocHHmaskCurve& lochhmasCurve, bool lhmasutili, const LocHHmaskCurve& llochhhmasCurve, bool lhhmasutili, const LocCCmaskCurve& locccmasexpCurve, bool lcmasexputili, const LocLLmaskCurve& locllmasexpCurve, bool llmasexputili, const LocHHmaskCurve& lochhmasexpCurve, bool lhmasexputili, const LocCCmaskCurve& locccmasSHCurve, bool lcmasSHutili, const LocLLmaskCurve& locllmasSHCurve, bool llmasSHutili, const LocHHmaskCurve& lochhmasSHCurve, bool lhmasSHutili, const LocCCmaskCurve& locccmasvibCurve, bool lcmasvibutili, const LocLLmaskCurve& locllmasvibCurve, bool llmasvibutili, const LocHHmaskCurve& lochhmasvibCurve, bool lhmasvibutili, @@ -11258,7 +11135,7 @@ void ImProcFunctions::Lab_Local( calcLocalParams(sp, oW, oH, params->locallab, lp, prevDeltaE, llColorMask, llColorMaskinv, llExpMask, llExpMaskinv, llSHMask, llSHMaskinv, llvibMask, lllcMask, llsharMask, llcbMask, llretiMask, llsoftMask, lltmMask, llblMask, lllogMask, ll_Mask, locwavCurveden, locwavdenutili); avoidcolshi(lp, sp, original, transformed, cy, cx); - const float radius = lp.rad / (sk * 1.4f); //0 to 70 ==> see skip + const float radius = lp.rad / (sk * 1.4); //0 to 70 ==> see skip int levred; bool noiscfactiv; @@ -11332,7 +11209,7 @@ void ImProcFunctions::Lab_Local( for (int ir = 0; ir < bfh; ir++) { for (int jr = 0; jr < bfw; jr++) { const float val = ble[ir][jr] * 32768.f; - sombel += val; + sombel += static_cast(val); deltasobelL[ir][jr] = val; } } @@ -11415,7 +11292,6 @@ void ImProcFunctions::Lab_Local( float lap = 0.f; //params->locallab.spots.at(sp).lapmaskexp; bool pde = false; //params->locallab.spots.at(sp).laplac; LocwavCurve dummy; - bool lmasutilicolwav = false; bool delt = params->locallab.spots.at(sp).deltae; int sco = params->locallab.spots.at(sp).scopemask; int shado = 0; @@ -11428,12 +11304,11 @@ void ImProcFunctions::Lab_Local( float anchorcd = 50.f; int lumask = params->locallab.spots.at(sp).lumask; LocHHmaskCurve lochhhmasCurve; - bool lhhmasutili = false; const int highl = 0; maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, bufexporig.get(), bufmaskoriglog.get(), originalmasklog.get(), original, reserved, inv, lp, 0.f, false, - locccmaslogCurve, lcmaslogutili, locllmaslogCurve, llmaslogutili, lochhmaslogCurve, lhmaslogutili, lochhhmasCurve, lhhmasutili, multiThread, - enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskloglocalcurve, localmasklogutili, dummy, lmasutilicolwav, 1, 1, 5, 5, + locccmaslogCurve, lcmaslogutili, locllmaslogCurve, llmaslogutili, lochhmaslogCurve, lhmaslogutili, lochhhmasCurve, false, multiThread, + enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskloglocalcurve, localmasklogutili, dummy, false, 1, 1, 5, 5, shortcu, delt, hueref, chromaref, lumaref, maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, -1 ); @@ -11461,7 +11336,7 @@ void ImProcFunctions::Lab_Local( } log_encode(tmpImage.get(), lp, multiThread, bfw, bfh); - float repart = 1.f - 0.01f * params->locallab.spots.at(sp).repar; + const float repart = 1.0 - 0.01 * params->locallab.spots.at(sp).repar; #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if(multiThread) @@ -11528,117 +11403,109 @@ void ImProcFunctions::Lab_Local( bool blurz = false; bool delt = params->locallab.spots.at(sp).deltae; - if (((radius > 1.5 * GAUSS_SKIP) || lp.stren > 0.1 || lp.blmet == 1 || lp.guidb > 1 || lp.showmaskblmet == 2 || lp.enablMask || lp.showmaskblmet == 3 || lp.showmaskblmet == 4) && lp.blurena) { + if (((static_cast(radius) > 1.5 * GAUSS_SKIP) || lp.stren > 0.1 || lp.blmet == 1 || lp.guidb > 1 || lp.showmaskblmet == 2 || lp.enablMask || lp.showmaskblmet == 3 || lp.showmaskblmet == 4) && lp.blurena) { blurz = true; } - const int GW = transformed->W; - const int GH = transformed->H; - const std::unique_ptr bufblorig(new LabImage(GW, GH)); + const int TW = transformed->W; + const int TH = transformed->H; + const std::unique_ptr bufblorig(new LabImage(TW, TH)); std::unique_ptr originalmaskbl; std::unique_ptr bufmaskorigbl; std::unique_ptr bufmaskblurbl; - std::unique_ptr bufgb; - std::unique_ptr bufprov(new LabImage(GW, GH)); + std::unique_ptr bufprov(new LabImage(TW, TH)); if (denoiz || blurz || lp.denoiena || lp.blurena) { - bufgb.reset(new LabImage(GW, GH)); - - if (lp.showmaskblmet == 2 || lp.enablMask || lp.showmaskblmet == 3 || lp.showmaskblmet == 4) { - bufmaskorigbl.reset(new LabImage(GW, GH)); - bufmaskblurbl.reset(new LabImage(GW, GH, true)); - originalmaskbl.reset (new LabImage(GW, GH)); - } + if (lp.showmaskblmet == 2 || lp.enablMask || lp.showmaskblmet == 3 || lp.showmaskblmet == 4) { + bufmaskorigbl.reset(new LabImage(TW, TH)); + bufmaskblurbl.reset(new LabImage(TW, TH, true)); + originalmaskbl.reset (new LabImage(TW, TH)); + } #ifdef _OPENMP - #pragma omp parallel for schedule(dynamic,16) if (multiThread) + #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif - for (int y = 0; y < GH; y++) { - for (int x = 0; x < GW; x++) { - bufblorig->L[y][x] = original->L[y][x]; - } + for (int y = 0; y < TH; y++) { + for (int x = 0; x < TW; x++) { + bufblorig->L[y][x] = original->L[y][x]; } + } - int inv = 0; - bool showmaske = false; - bool enaMask = false; - bool deltaE = false; - bool modmask = false; - bool zero = false; - bool modif = false; + int inv = 0; + bool showmaske = false; + bool enaMask = false; + bool deltaE = false; + bool modmask = false; + bool zero = false; + bool modif = false; - if (lp.showmaskblmet == 3) { - showmaske = true; - } + if (lp.showmaskblmet == 3) { + showmaske = true; + } - if (lp.enablMask) { - enaMask = true; - } + if (lp.enablMask) { + enaMask = true; + } - if (lp.showmaskblmet == 4) { - deltaE = true; - } + if (lp.showmaskblmet == 4) { + deltaE = true; + } - if (lp.showmaskblmet == 2) { - modmask = true; - } + if (lp.showmaskblmet == 2) { + modmask = true; + } - if (lp.showmaskblmet == 1) { - modif = true; - } + if (lp.showmaskblmet == 1) { + modif = true; + } - if (lp.showmaskblmet == 0) { - zero = true; - } + if (lp.showmaskblmet == 0) { + zero = true; + } - float chrom = lp.chromabl; - float rad = lp.radmabl; - float gamma = lp.gammabl; - float slope = lp.slomabl; - float blendm = lp.blendmabl; - float lap = params->locallab.spots.at(sp).lapmaskbl; - bool pde = params->locallab.spots.at(sp).laplac; - LocwavCurve dummy; - bool delt = params->locallab.spots.at(sp).deltae; - int lumask = params->locallab.spots.at(sp).lumask; - int sco = params->locallab.spots.at(sp).scopemask; - int shortcu = 0; + float chrom = lp.chromabl; + float rad = lp.radmabl; + float gamma = lp.gammabl; + float slope = lp.slomabl; + float blendm = lp.blendmabl; + float lap = params->locallab.spots.at(sp).lapmaskbl; + bool pde = params->locallab.spots.at(sp).laplac; + LocwavCurve dummy; + int lumask = params->locallab.spots.at(sp).lumask; + int sco = params->locallab.spots.at(sp).scopemask; + int shortcu = 0; - const float mindE = 2.f + MINSCOPE * sco * lp.thr; - const float maxdE = 5.f + MAXSCOPE * sco * (1 + 0.1f * lp.thr); - const float mindElim = 2.f + MINSCOPE * limscope * lp.thr; - const float maxdElim = 5.f + MAXSCOPE * limscope * (1 + 0.1f * lp.thr); - const int shado = params->locallab.spots.at(sp).shadmaskblsha; - const int highl = params->locallab.spots.at(sp).shadmaskbl; - constexpr float amountcd = 0.f; - constexpr float anchorcd = 50.f; - LocHHmaskCurve lochhhmasCurve; - constexpr bool lhhmasutili = false; - const float strumask = 0.02f * params->locallab.spots.at(sp).strumaskbl; - bool astool = params->locallab.spots.at(sp).toolbl; + const float mindE = 2.f + MINSCOPE * sco * lp.thr; + const float maxdE = 5.f + MAXSCOPE * sco * (1 + 0.1f * lp.thr); + const float mindElim = 2.f + MINSCOPE * limscope * lp.thr; + const float maxdElim = 5.f + MAXSCOPE * limscope * (1 + 0.1f * lp.thr); + const int shado = params->locallab.spots.at(sp).shadmaskblsha; + const int highl = params->locallab.spots.at(sp).shadmaskbl; + constexpr float amountcd = 0.f; + constexpr float anchorcd = 50.f; + LocHHmaskCurve lochhhmasCurve; + const float strumask = 0.02 * params->locallab.spots.at(sp).strumaskbl; + const bool astool = params->locallab.spots.at(sp).toolbl; - maskcalccol(false, pde, GW, GH, 0, 0, sk, cx, cy, bufblorig.get(), bufmaskblurbl.get(), originalmaskbl.get(), original, reserved, inv, lp, - strumask, astool, - locccmasblCurve, lcmasblutili, locllmasblCurve, llmasblutili, lochhmasblCurve, lhmasblutili, lochhhmasCurve, lhhmasutili, multiThread, - enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskbllocalcurve, localmaskblutili, loclmasCurveblwav, lmasutiliblwav, 1, 1, 5, 5, - shortcu, delt, hueref, chromaref, lumaref, + maskcalccol(false, pde, TW, TH, 0, 0, sk, cx, cy, bufblorig.get(), bufmaskblurbl.get(), originalmaskbl.get(), original, reserved, inv, lp, + strumask, astool, locccmasblCurve, lcmasblutili, locllmasblCurve, llmasblutili, lochhmasblCurve, lhmasblutili, lochhhmasCurve, false, multiThread, + enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskbllocalcurve, + localmaskblutili, loclmasCurveblwav, lmasutiliblwav, 1, 1, 5, 5, shortcu, params->locallab.spots.at(sp).deltae, hueref, chromaref, lumaref, maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, 0 ); - if (lp.showmaskblmet == 3) { - showmask(lumask, lp, 0, 0, cx, cy, GW, GH, bufblorig.get(), transformed, bufmaskblurbl.get(), inv); - return; - } + if (lp.showmaskblmet == 3) { + showmask(lumask, lp, 0, 0, cx, cy, TW, TH, bufblorig.get(), transformed, bufmaskblurbl.get(), inv); + return; + } } bool execmaskblur = (lp.showmaskblmet == 2 || lp.enablMask || lp.showmaskblmet == 3 || lp.showmaskblmet == 4) && lp.smasktyp != 1; int strengr = params->locallab.spots.at(sp).strengr; - if (((radius > 1.5 * GAUSS_SKIP && lp.rad > 1.6) || lp.stren > 0.1 || lp.blmet == 1 || lp.guidb > 0 || strengr > 0 || execmaskblur) && lp.blurena) { // radius < GAUSS_SKIP means no gauss, just copy of original image - // if (((radius > 1.5 * GAUSS_SKIP && lp.rad > 1.6) || lp.stren > 0.1 || lp.blmet == 1 || lp.guidb > 0 || lp.showmaskblmet == 2 || lp.enablMask || lp.showmaskblmet == 3 || lp.showmaskblmet == 4) && lp.blurena) { // radius < GAUSS_SKIP means no gauss, just copy of original image - //printf("OK BLUR\n"); + if (((static_cast(radius) > 1.5 * GAUSS_SKIP && lp.rad > 1.6) || lp.stren > 0.1 || lp.blmet == 1 || lp.guidb > 0 || strengr > 0 || execmaskblur) && lp.blurena) { // radius < GAUSS_SKIP means no gauss, just copy of original image std::unique_ptr tmp1; std::unique_ptr tmp2; std::unique_ptr tmp3; @@ -11659,11 +11526,11 @@ void ImProcFunctions::Lab_Local( if (bfw >= mSP && bfh >= mSP) { - if (lp.blurmet == 0 && (fft || lp.rad > 30.f)) { + if (lp.blurmet == 0 && (fft || lp.rad > 30.0)) { optfft(N_fftwsize, bfh, bfw, bfhr, bfwr, lp, original->H, original->W, xstart, ystart, xend, yend, cx, cy); } - const std::unique_ptr bufgbi(new LabImage(GW, GH)); + const std::unique_ptr bufgbi(new LabImage(TW, TH)); //here mask is used with plain image for normal and inverse //if it is possible to optimize with maskcalccol(), I don't to preserve visibility @@ -11690,8 +11557,8 @@ void ImProcFunctions::Lab_Local( tmp2.reset(new LabImage(transformed->W, transformed->H)); tmp3.reset(new LabImage(transformed->W, transformed->H)); - for (int y = 0; y < GH ; y++) { - for (int x = 0; x < GW; x++) { + for (int y = 0; y < TH ; y++) { + for (int x = 0; x < TW; x++) { tmp2->L[y][x] = original->L[y][x]; tmp2->a[y][x] = original->a[y][x]; tmp2->b[y][x] = original->b[y][x]; @@ -11710,10 +11577,8 @@ void ImProcFunctions::Lab_Local( } - if (lp.blurmet == 0 && lp.blmet == 0 && radius > (1.5 * GAUSS_SKIP) && lp.rad > 1.6) { - // printf("OK BLUR RAD lp=%f\n", lp.rad); - - if (fft || lp.rad > 30.f) { + if (lp.blurmet == 0 && lp.blmet == 0 && static_cast(radius) > (1.5 * GAUSS_SKIP) && lp.rad > 1.6) { + if (fft || lp.rad > 30.0) { if (lp.chromet == 0) { ImProcFunctions::fftw_convol_blur2(tmp1->L, tmp1->L, bfwr, bfhr, radius, 0, 0); } else if (lp.chromet == 1) { @@ -11725,22 +11590,16 @@ void ImProcFunctions::Lab_Local( ImProcFunctions::fftw_convol_blur2(tmp1->b, tmp1->b, bfwr, bfhr, radius, 0, 0); } } else { - #ifdef _OPENMP #pragma omp parallel if (multiThread) #endif { - if (lp.chromet == 0) - { + if (lp.chromet == 0) { gaussianBlur(tmp1->L, tmp1->L, bfw, bfh, radius); - } - - else if (lp.chromet == 1) - { + } else if (lp.chromet == 1) { gaussianBlur(tmp1->a, tmp1->a, bfw, bfh, radius); gaussianBlur(tmp1->b, tmp1->b, bfw, bfh, radius); - } else if (lp.chromet == 2) - { + } else if (lp.chromet == 2) { gaussianBlur(tmp1->L, tmp1->L, bfw, bfh, radius); gaussianBlur(tmp1->a, tmp1->a, bfw, bfh, radius); gaussianBlur(tmp1->b, tmp1->b, bfw, bfh, radius); @@ -11748,49 +11607,39 @@ void ImProcFunctions::Lab_Local( } } - } else if (lp.blurmet == 1 && lp.blmet == 0 && radius > (1.5 * GAUSS_SKIP) && lp.rad > 1.6) { - if (fft || lp.rad > 30.f) { + } else if (lp.blurmet == 1 && lp.blmet == 0 && static_cast(radius) > (1.5 * GAUSS_SKIP) && lp.rad > 1.6) { + if (fft || lp.rad > 30.0) { if (lp.chromet == 0) { - ImProcFunctions::fftw_convol_blur2(original->L, tmp1->L, GW, GH, radius, 0, 0); - } - - else if (lp.chromet == 1) { - ImProcFunctions::fftw_convol_blur2(original->a, tmp1->a, GW, GH, radius, 0, 0); - ImProcFunctions::fftw_convol_blur2(original->b, tmp1->b, GW, GH, radius, 0, 0); + ImProcFunctions::fftw_convol_blur2(original->L, tmp1->L, TW, TH, radius, 0, 0); + } else if (lp.chromet == 1) { + ImProcFunctions::fftw_convol_blur2(original->a, tmp1->a, TW, TH, radius, 0, 0); + ImProcFunctions::fftw_convol_blur2(original->b, tmp1->b, TW, TH, radius, 0, 0); } else if (lp.chromet == 2) { - ImProcFunctions::fftw_convol_blur2(original->L, tmp1->L, GW, GH, radius, 0, 0); - ImProcFunctions::fftw_convol_blur2(original->a, tmp1->a, GW, GH, radius, 0, 0); - ImProcFunctions::fftw_convol_blur2(original->b, tmp1->b, GW, GH, radius, 0, 0); + ImProcFunctions::fftw_convol_blur2(original->L, tmp1->L, TW, TH, radius, 0, 0); + ImProcFunctions::fftw_convol_blur2(original->a, tmp1->a, TW, TH, radius, 0, 0); + ImProcFunctions::fftw_convol_blur2(original->b, tmp1->b, TW, TH, radius, 0, 0); } - } else { - #ifdef _OPENMP #pragma omp parallel if (multiThread) #endif { - if (lp.chromet == 0) - { - gaussianBlur(original->L, tmp1->L, GW, GH, radius); - } else if (lp.chromet == 1) - - { - gaussianBlur(original->a, tmp1->a, GW, GH, radius); - gaussianBlur(original->b, tmp1->b, GW, GH, radius); - } else if (lp.chromet == 2) - - { - gaussianBlur(original->L, tmp1->L, GW, GH, radius); - gaussianBlur(original->a, tmp1->a, GW, GH, radius); - gaussianBlur(original->b, tmp1->b, GW, GH, radius); + if (lp.chromet == 0) { + gaussianBlur(original->L, tmp1->L, TW, TH, radius); + } else if (lp.chromet == 1) { + gaussianBlur(original->a, tmp1->a, TW, TH, radius); + gaussianBlur(original->b, tmp1->b, TW, TH, radius); + } else if (lp.chromet == 2) { + gaussianBlur(original->L, tmp1->L, TW, TH, radius); + gaussianBlur(original->a, tmp1->a, TW, TH, radius); + gaussianBlur(original->b, tmp1->b, TW, TH, radius); } } } } - //add noise - if (tmp1.get() && lp.stren > 0.1f && lp.blmet == 0) { + if (tmp1.get() && lp.stren > 0.1 && lp.blmet == 0) { float mean = 0.f;//0 best result float variance = lp.stren ; addGaNoise(tmp1.get(), tmp1.get(), mean, variance, sk) ; @@ -11802,8 +11651,8 @@ void ImProcFunctions::Lab_Local( int he = bfh; if (lp.blurmet == 1) { - wi = GW; - he = GH; + wi = TW; + he = TH; } if (tmp1.get()) { @@ -11877,8 +11726,8 @@ void ImProcFunctions::Lab_Local( } else if (lp.blurmet == 1 && lp.blmet == 1) { float** tmL; - int wid = GW; - int hei = GH; + int wid = TW; + int hei = TH; tmL = new float*[hei]; for (int i = 0; i < hei; ++i) { @@ -11886,14 +11735,14 @@ void ImProcFunctions::Lab_Local( } if (lp.chromet == 0) { - Median_Denoise(tmp2->L, tmp1->L, GW, GH, medianTypeL, lp.it, multiThread, tmL); + Median_Denoise(tmp2->L, tmp1->L, TW, TH, medianTypeL, lp.it, multiThread, tmL); } else if (lp.chromet == 1) { - Median_Denoise(tmp2->a, tmp1->a, GW, GH, medianTypeAB, lp.it, multiThread, tmL); - Median_Denoise(tmp2->b, tmp1->b, GW, GH, medianTypeAB, lp.it, multiThread, tmL); + Median_Denoise(tmp2->a, tmp1->a, TW, TH, medianTypeAB, lp.it, multiThread, tmL); + Median_Denoise(tmp2->b, tmp1->b, TW, TH, medianTypeAB, lp.it, multiThread, tmL); } else if (lp.chromet == 2) { - Median_Denoise(tmp2->L, tmp1->L, GW, GH, medianTypeL, lp.it, multiThread, tmL); - Median_Denoise(tmp2->a, tmp1->a, GW, GH, medianTypeAB, lp.it, multiThread, tmL); - Median_Denoise(tmp2->b, tmp1->b, GW, GH, medianTypeAB, lp.it, multiThread, tmL); + Median_Denoise(tmp2->L, tmp1->L, TW, TH, medianTypeL, lp.it, multiThread, tmL); + Median_Denoise(tmp2->a, tmp1->a, TW, TH, medianTypeAB, lp.it, multiThread, tmL); + Median_Denoise(tmp2->b, tmp1->b, TW, TH, medianTypeAB, lp.it, multiThread, tmL); } for (int i = 0; i < hei; ++i) { @@ -11917,7 +11766,6 @@ void ImProcFunctions::Lab_Local( tmp3->L[y - ystart][x - xstart] = original->L[y][x]; tmp3->a[y - ystart][x - xstart] = original->a[y][x]; tmp3->b[y - ystart][x - xstart] = original->b[y][x]; - bufgb->L[y - ystart][x - xstart] = original->L[y][x]; } } @@ -11952,7 +11800,7 @@ void ImProcFunctions::Lab_Local( int r = rtengine::max(int(lp.guidb / sk), 1); - const float epsil = 0.001f * std::pow(2, - lp.epsb); + const float epsil = 0.001f * std::pow(2.f, -lp.epsb); if (lp.chromet == 0) { rtengine::guidedFilterLog(guide, 10.f, LL, r, epsil, multiThread); @@ -12064,8 +11912,8 @@ void ImProcFunctions::Lab_Local( #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif - for (int y = 0; y < GH ; y++) { - for (int x = 0; x < GW; x++) { + for (int y = 0; y < TH ; y++) { + for (int x = 0; x < TW; x++) { tmp1->L[y][x] = original->L[y][x]; tmp1->a[y][x] = original->a[y][x]; tmp1->b[y][x] = original->b[y][x]; @@ -12077,19 +11925,19 @@ void ImProcFunctions::Lab_Local( } Imagefloat *tmpImage = nullptr; - tmpImage = new Imagefloat(GW, GH); + tmpImage = new Imagefloat(TW, TH); lab2rgb(*tmp1, *tmpImage, params->icm.workingProfile); - array2D LL(GW, GH); - array2D rr(GW, GH); - array2D gg(GW, GH); - array2D bb(GW, GH); - array2D guide(GW, GH); + array2D LL(TW, TH); + array2D rr(TW, TH); + array2D gg(TW, TH); + array2D bb(TW, TH); + array2D guide(TW, TH); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif - for (int y = 0; y < GH ; y++) { - for (int x = 0; x < GW; x++) { + for (int y = 0; y < TH ; y++) { + for (int x = 0; x < TW; x++) { LL[y][x] = tmp1->L[y][x]; float ll = LL[y][x] / 32768.f; guide[y][x] = xlin2log(rtengine::max(ll, 0.f), 10.f); @@ -12100,14 +11948,14 @@ void ImProcFunctions::Lab_Local( } } - array2D iR(GW, GH, rr, 0); - array2D iG(GW, GH, gg, 0); - array2D iB(GW, GH, bb, 0); - array2D iL(GW, GH, LL, 0); + array2D iR(TW, TH, rr, 0); + array2D iG(TW, TH, gg, 0); + array2D iB(TW, TH, bb, 0); + array2D iL(TW, TH, LL, 0); int r = rtengine::max(int(lp.guidb / sk), 1); - const float epsil = 0.001f * std::pow(2, - lp.epsb); + const float epsil = 0.001f * std::pow(2.f, - lp.epsb); if (lp.chromet == 0) { rtengine::guidedFilterLog(guide, 10.f, LL, r, epsil, multiThread); @@ -12123,8 +11971,8 @@ void ImProcFunctions::Lab_Local( #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif - for (int y = 0; y < GH ; y++) { - for (int x = 0; x < GW; x++) { + for (int y = 0; y < TH ; y++) { + for (int x = 0; x < TW; x++) { rr[y][x] = intp(lp.strbl, rr[y][x] , iR[y][x]); gg[y][x] = intp(lp.strbl, gg[y][x] , iG[y][x]); bb[y][x] = intp(lp.strbl, bb[y][x] , iB[y][x]); @@ -12141,8 +11989,8 @@ void ImProcFunctions::Lab_Local( #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif - for (int y = 0; y < GH ; y++) { - for (int x = 0; x < GW; x++) { + for (int y = 0; y < TH ; y++) { + for (int x = 0; x < TW; x++) { LL[y][x] = intp(lp.strbl, LL[y][x] , iL[y][x]); tmp1->L[y][x] = LL[y][x]; } @@ -12150,9 +11998,9 @@ void ImProcFunctions::Lab_Local( } if(lp.enablMask && lp.recothr != 1.f && lp.smasktyp != 1) { array2D masklum; - masklum(GW, GH); - for (int ir = 0; ir < GH; ir++) - for (int jr = 0; jr < GW; jr++) { + masklum(TW, TH); + for (int ir = 0; ir < TH; ir++) + for (int jr = 0; jr < TW; jr++) { masklum[ir][jr] = 1.f; } @@ -12176,13 +12024,12 @@ void ImProcFunctions::Lab_Local( #ifdef _OPENMP #pragma omp parallel for if (multiThread) #endif - for (int ir = 0; ir < GH; ir++) - for (int jr = 0; jr < GW; jr++) { + for (int ir = 0; ir < TH; ir++) + for (int jr = 0; jr < TW; jr++) { const float lM = bufmaskblurbl->L[ir][jr]; const float lmr = lM / 327.68f; if (lM < 327.68f * lowc) { masklum[ir][jr] = alow * lmr + blow; - masklum[ir][jr] = alow * lmr + blow; } else if (lM < 327.68f * higc) { } else { @@ -12191,14 +12038,14 @@ void ImProcFunctions::Lab_Local( } for (int i = 0; i < 3; ++i) { - boxblur(static_cast(masklum), static_cast(masklum), 10 / sk, GW, GH, false); + boxblur(static_cast(masklum), static_cast(masklum), 10 / sk, TW, TH, false); } #ifdef _OPENMP #pragma omp parallel for if (multiThread) #endif - for (int i = 0; i < GH; ++i) { - for (int j = 0; j < GW; ++j) { + for (int i = 0; i < TH; ++i) { + for (int j = 0; j < TW; ++j) { tmp1->L[i][j] = (tmp3->L[i][j] - tmp1->L[i][j]) * LIM01(masklum[i][j]) + tmp1->L[i][j]; tmp1->a[i][j] = (tmp3->a[i][j] - tmp1->a[i][j]) * LIM01(masklum[i][j]) + tmp1->a[i][j]; tmp1->b[i][j] = (tmp3->b[i][j] - tmp1->b[i][j]) * LIM01(masklum[i][j]) + tmp1->b[i][j]; @@ -12278,7 +12125,7 @@ void ImProcFunctions::Lab_Local( bufwv->CopyFrom(original, multiThread); } //end dcrop - const double threshold = lp.bilat / 20.0; + const double threshold = lp.bilat / 20.f; if (bfh > 8 && bfw > 8) { ImProcFunctions::impulse_nr(bufwv.get(), threshold); @@ -12383,7 +12230,6 @@ void ImProcFunctions::Lab_Local( float lap = params->locallab.spots.at(sp).lapmaskcb; bool pde = params->locallab.spots.at(sp).laplac; LocwavCurve dummy; - bool delt = params->locallab.spots.at(sp).deltae; int sco = params->locallab.spots.at(sp).scopemask; int lumask = params->locallab.spots.at(sp).lumask; int shado = 0; @@ -12391,18 +12237,16 @@ void ImProcFunctions::Lab_Local( const float maxdE = 5.f + MAXSCOPE * sco * (1 + 0.1f * lp.thr); const float mindElim = 2.f + MINSCOPE * limscope * lp.thr; const float maxdElim = 5.f + MAXSCOPE * limscope * (1 + 0.1f * lp.thr); - bool lmasutilicolwav = false; float amountcd = 0.f; float anchorcd = 50.f; int shortcu = 0; //lp.mergemet; //params->locallab.spots.at(sp).shortc; LocHHmaskCurve lochhhmasCurve; - bool lhhmasutili = false; const int highl = 0; maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, loctemp.get(), bufmaskorigcb.get(), originalmaskcb.get(), original, reserved, inv, lp, 0.f, false, - locccmascbCurve, lcmascbutili, locllmascbCurve, llmascbutili, lochhmascbCurve, lhmascbutili, lochhhmasCurve, lhhmasutili, multiThread, - enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskcblocalcurve, localmaskcbutili, dummy, lmasutilicolwav, 1, 1, 5, 5, - shortcu, delt, hueref, chromaref, lumaref, + locccmascbCurve, lcmascbutili, locllmascbCurve, llmascbutili, lochhmascbCurve, lhmascbutili, lochhhmasCurve, false, multiThread, + enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskcblocalcurve, localmaskcbutili, dummy, false, 1, 1, 5, 5, + shortcu, params->locallab.spots.at(sp).deltae, hueref, chromaref, lumaref, maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.0f, 0.f, -1 ); @@ -12432,11 +12276,11 @@ void ImProcFunctions::Lab_Local( } } - if (lp.clarityml != 0.f && lp.mulloc[5] == 1.0) { //enabled last level to retrieve level 5 and residual image in case user not select level 5 + if (lp.clarityml != 0.f && lp.mulloc[5] == 1.f) { //enabled last level to retrieve level 5 and residual image in case user not select level 5 lp.mulloc[5] = 1.001f; } - if (lp.contresid != 0.f && lp.mulloc[5] == 1.0) { //enabled last level to retrieve level 5 and residual image in case user not select level 5 + if (lp.contresid != 0.f && lp.mulloc[5] == 1.f) { //enabled last level to retrieve level 5 and residual image in case user not select level 5 lp.mulloc[5] = 1.001f; } @@ -12454,13 +12298,11 @@ void ImProcFunctions::Lab_Local( bool invmask = false; maskrecov(loctemp.get(), original, bufmaskorigcb.get(), bfh, bfw, ystart, xstart, hig, low, recoth, decay, invmask, sk, multiThread); } - - } transit_shapedetect(6, loctemp.get(), originalmaskcb.get(), bufchrom, false, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); - bool nochroma = (lp.showmaskcbmet == 2 || lp.showmaskcbmet == 1); + const bool nochroma = (lp.showmaskcbmet == 2 || lp.showmaskcbmet == 1); //chroma CBDL begin here if (lp.chromacb > 0.f && !nochroma) { @@ -12491,7 +12333,6 @@ void ImProcFunctions::Lab_Local( choice = 1; ImProcFunctions::cbdl_local_temp(bufsh, loctemp->L, bfw, bfh, multc, rtengine::max(lp.chromacb, 1.f), lp.threshol, clarich, 0.f, skinprot, false, b_l, t_l, t_r, b_r, choice, sk, multiThread); - float minC = loctemp->L[0][0] - std::sqrt(SQR(loctemp->a[0][0]) + SQR(loctemp->b[0][0])); float maxC = minC; #ifdef _OPENMP @@ -12608,8 +12449,6 @@ void ImProcFunctions::Lab_Local( float lap = params->locallab.spots.at(sp).lapmaskvib; bool pde = params->locallab.spots.at(sp).laplac; LocwavCurve dummy; - bool lmasutilicolwav = false; - bool delt = params->locallab.spots.at(sp).deltae; int sco = params->locallab.spots.at(sp).scopemask; int shortcu = 0;//lp.mergemet; //params->locallab.spots.at(sp).shortc; @@ -12620,16 +12459,15 @@ void ImProcFunctions::Lab_Local( int shado = 0; int lumask = params->locallab.spots.at(sp).lumask; LocHHmaskCurve lochhhmasCurve; - bool lhhmasutili = false; float amountcd = 0.f; float anchorcd = 50.f; const int highl = 0; maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, bufexporig.get(), bufmaskorigvib.get(), originalmaskvib.get(), original, reserved, inv, lp, 0.f, false, - locccmasvibCurve, lcmasvibutili, locllmasvibCurve, llmasvibutili, lochhmasvibCurve, lhmasvibutili, lochhhmasCurve, lhhmasutili, multiThread, - enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskviblocalcurve, localmaskvibutili, dummy, lmasutilicolwav, 1, 1, 5, 5, - shortcu, delt, hueref, chromaref, lumaref, + locccmasvibCurve, lcmasvibutili, locllmasvibCurve, llmasvibutili, lochhmasvibCurve, lhmasvibutili, lochhhmasCurve, false, multiThread, + enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskviblocalcurve, localmaskvibutili, dummy, false, 1, 1, 5, 5, + shortcu, params->locallab.spots.at(sp).deltae, hueref, chromaref, lumaref, maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, -1 ); @@ -12673,8 +12511,7 @@ void ImProcFunctions::Lab_Local( #endif for (int ir = 0; ir < bfh; ir++) for (int jr = 0; jr < bfw; jr++) { - double factor = 1.0; - factor = ImProcFunctions::calcGradientFactor(gph, jr, ir); + float factor = ImProcFunctions::calcGradientFactor(gph, jr, ir); float aa = bufexpfin->a[ir][jr]; float bb = bufexpfin->b[ir][jr]; float chrm = std::sqrt(SQR(aa) + SQR(bb)); @@ -12709,12 +12546,11 @@ void ImProcFunctions::Lab_Local( #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif - for (int ir = 0; ir < bfh; ir++) + for (int ir = 0; ir < bfh; ir++) { for (int jr = 0; jr < bfw; jr++) { - double factor = 1.0; - factor = ImProcFunctions::calcGradientFactor(gp, jr, ir); - bufexpfin->L[ir][jr] *= factor; + bufexpfin->L[ir][jr] *= ImProcFunctions::calcGradientFactor(gp, jr, ir); } + } } if (lp.strvibab != 0.f) { @@ -12725,8 +12561,7 @@ void ImProcFunctions::Lab_Local( #endif for (int ir = 0; ir < bfh; ir++) for (int jr = 0; jr < bfw; jr++) { - double factor = 1.0; - factor = ImProcFunctions::calcGradientFactor(gpab, jr, ir); + const float factor = ImProcFunctions::calcGradientFactor(gpab, jr, ir); bufexpfin->a[ir][jr] *= factor; bufexpfin->b[ir][jr] *= factor; } @@ -12851,8 +12686,6 @@ void ImProcFunctions::Lab_Local( if (!params->locallab.spots.at(sp).enatmMaskaft) { LocwavCurve dummy; - bool lmasutilicolwav = false; - bool delt = params->locallab.spots.at(sp).deltae; int sco = params->locallab.spots.at(sp).scopemask; int shortcu = 0; //lp.mergemet;// params->locallab.spots.at(sp).shortc; @@ -12864,14 +12697,13 @@ void ImProcFunctions::Lab_Local( float amountcd = 0.f; float anchorcd = 50.f; LocHHmaskCurve lochhhmasCurve; - bool lhhmasutili = false; const int highl = 0; maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, bufgbm.get(), bufmaskorigtm.get(), originalmasktm.get(), original, reserved, inv, lp, 0.f, false, - locccmastmCurve, lcmastmutili, locllmastmCurve, llmastmutili, lochhmastmCurve, lhmastmutili, lochhhmasCurve, lhhmasutili, multiThread, - enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmasktmlocalcurve, localmasktmutili, dummy, lmasutilicolwav, 1, 1, 5, 5, - shortcu, delt, hueref, chromaref, lumaref, + locccmastmCurve, lcmastmutili, locllmastmCurve, llmastmutili, lochhmastmCurve, lhmastmutili, lochhhmasCurve, false, multiThread, + enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmasktmlocalcurve, localmasktmutili, dummy, false, 1, 1, 5, 5, + shortcu, params->locallab.spots.at(sp).deltae, hueref, chromaref, lumaref, maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, -1 ); @@ -12892,11 +12724,8 @@ void ImProcFunctions::Lab_Local( if (enatmMasktmap) { //calculate new values for original, originalmasktm, bufmaskorigtm...in function of tmp1 LocwavCurve dummy; - bool lmasutilicolwav = false; - bool delt = params->locallab.spots.at(sp).deltae; int sco = params->locallab.spots.at(sp).scopemask; int shortcu = 0;//lp.mergemet; //params->locallab.spots.at(sp).shortc; - int lumask = params->locallab.spots.at(sp).lumask; const float mindE = 2.f + MINSCOPE * sco * lp.thr; const float maxdE = 5.f + MAXSCOPE * sco * (1 + 0.1f * lp.thr); @@ -12906,20 +12735,18 @@ void ImProcFunctions::Lab_Local( float amountcd = 0.f; float anchorcd = 50.f; LocHHmaskCurve lochhhmasCurve; - bool lhhmasutili = false; const int highl = 0; maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, tmp1.get(), bufmaskorigtm.get(), originalmasktm.get(), original, reserved, inv, lp, 0.f, false, - locccmastmCurve, lcmastmutili, locllmastmCurve, llmastmutili, lochhmastmCurve, lhmastmutili, lochhhmasCurve, lhhmasutili, multiThread, - enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmasktmlocalcurve, localmasktmutili, dummy, lmasutilicolwav, 1, 1, 5, 5, - shortcu, delt, hueref, chromaref, lumaref, + locccmastmCurve, lcmastmutili, locllmastmCurve, llmastmutili, lochhmastmCurve, lhmastmutili, lochhhmasCurve, false, multiThread, + enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmasktmlocalcurve, localmasktmutili, dummy, false, 1, 1, 5, 5, + shortcu, params->locallab.spots.at(sp).deltae, hueref, chromaref, lumaref, maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, -1 ); if (lp.showmasktmmet == 3) {//display mask - showmask(lumask, lp, xstart, ystart, cx, cy, bfw, bfh, tmp1.get(), transformed, bufmaskorigtm.get(), 0); - + showmask(params->locallab.spots.at(sp).lumask, lp, xstart, ystart, cx, cy, bfw, bfh, tmp1.get(), transformed, bufmaskorigtm.get(), 0); return; } @@ -13087,8 +12914,6 @@ void ImProcFunctions::Lab_Local( float lap = params->locallab.spots.at(sp).lapmaskSH; bool pde = params->locallab.spots.at(sp).laplac; LocwavCurve dummy; - bool lmasutilicolwav = false; - bool delt = params->locallab.spots.at(sp).deltae; int sco = params->locallab.spots.at(sp).scopemask; int shortcu = 0;//lp.mergemet; //params->locallab.spots.at(sp).shortc; @@ -13101,14 +12926,13 @@ void ImProcFunctions::Lab_Local( float anchorcd = params->locallab.spots.at(sp).fatanchorSH; int lumask = params->locallab.spots.at(sp).lumask; LocHHmaskCurve lochhhmasCurve; - bool lhhmasutili = false; const int highl = 0; maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, bufexporig.get(), bufmaskorigSH.get(), originalmaskSH.get(), original, reserved, inv, lp, 0.f, false, - locccmasSHCurve, lcmasSHutili, locllmasSHCurve, llmasSHutili, lochhmasSHCurve, lhmasSHutili, lochhhmasCurve, lhhmasutili, multiThread, - enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskSHlocalcurve, localmaskSHutili, dummy, lmasutilicolwav, 1, 1, 5, 5, - shortcu, delt, hueref, chromaref, lumaref, + locccmasSHCurve, lcmasSHutili, locllmasSHCurve, llmasSHutili, lochhmasSHCurve, lhmasSHutili, lochhhmasCurve, false, multiThread, + enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskSHlocalcurve, localmaskSHutili, dummy, false, 1, 1, 5, 5, + shortcu, params->locallab.spots.at(sp).deltae, hueref, chromaref, lumaref, maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, -1 ); @@ -13146,12 +12970,11 @@ void ImProcFunctions::Lab_Local( #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif - for (int ir = 0; ir < bfh; ir++) + for (int ir = 0; ir < bfh; ir++) { for (int jr = 0; jr < bfw; jr++) { - double factor = 1.0; - factor = ImProcFunctions::calcGradientFactor(gp, jr, ir); - bufexpfin->L[ir][jr] *= factor; + bufexpfin->L[ir][jr] *= ImProcFunctions::calcGradientFactor(gp, jr, ir); } + } } if (lp.shmeth == 1) { @@ -13161,11 +12984,11 @@ void ImProcFunctions::Lab_Local( lab2rgb(*bufexpfin, *tmpImage, params->icm.workingProfile); if (tonecurv) { //Tone response curve : does nothing if gamma=2.4 and slope=12.92 ==> gamma sRGB - float gamtone = params->locallab.spots.at(sp).gamSH; - float slotone = params->locallab.spots.at(sp).sloSH; - cmsHTRANSFORM dummy = nullptr; - workingtrc(tmpImage, tmpImage, bfw, bfh, -5, params->icm.workingProfile, 2.4, 12.92310, dummy, true, false, false); - workingtrc(tmpImage, tmpImage, bfw, bfh, 5, params->icm.workingProfile, gamtone, slotone, dummy, false, true, true); + const float gamtone = params->locallab.spots.at(sp).gamSH; + const float slotone = params->locallab.spots.at(sp).sloSH; + cmsHTRANSFORM dummyTransForm = nullptr; + workingtrc(tmpImage, tmpImage, bfw, bfh, -5, params->icm.workingProfile, 2.4, 12.92310, dummyTransForm, true, false, false); + workingtrc(tmpImage, tmpImage, bfw, bfh, 5, params->icm.workingProfile, gamtone, slotone, dummyTransForm, false, true, true); } if (tonequ) { @@ -13183,14 +13006,14 @@ void ImProcFunctions::Lab_Local( } } - if(lp.enaSHMask && lp.recothrs != 1.f) { - float hig = lp.higthrs; - float low = lp.lowthrs; - float recoth = lp.recothrs; - float decay = lp.decays; - bool invmask = false; - maskrecov(bufexpfin.get(), original, bufmaskorigSH.get(), bfh, bfw, ystart, xstart, hig, low, recoth, decay, invmask, sk, multiThread); - } + if(lp.enaSHMask && lp.recothrs != 1.f) { + float hig = lp.higthrs; + float low = lp.lowthrs; + float recoth = lp.recothrs; + float decay = lp.decays; + bool invmask = false; + maskrecov(bufexpfin.get(), original, bufmaskorigSH.get(), bfh, bfw, ystart, xstart, hig, low, recoth, decay, invmask, sk, multiThread); + } transit_shapedetect2(call, 9, bufexporig.get(), bufexpfin.get(), originalmaskSH.get(), hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); @@ -13203,18 +13026,18 @@ void ImProcFunctions::Lab_Local( } else if (lp.invsh && (lp.highlihs > 0.f || lp.shadowhs > 0.f || tonequ || tonecurv || lp.showmaskSHmetinv == 1 || lp.enaSHMaskinv) && call < 3 && lp.hsena) { std::unique_ptr bufmaskblurcol; std::unique_ptr originalmaskSH; - const std::unique_ptr bufcolorig(new LabImage(GW, GH)); + const std::unique_ptr bufcolorig(new LabImage(TW, TH)); if (lp.enaSHMaskinv || lp.showmaskSHmetinv == 1) { - bufmaskblurcol.reset(new LabImage(GW, GH, true)); - originalmaskSH.reset(new LabImage(GW, GH)); + bufmaskblurcol.reset(new LabImage(TW, TH, true)); + originalmaskSH.reset(new LabImage(TW, TH)); } #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif - for (int y = 0; y < GH ; y++) { - for (int x = 0; x < GW; x++) { + for (int y = 0; y < TH ; y++) { + for (int x = 0; x < TW; x++) { bufcolorig->L[y][x] = original->L[y][x]; } } @@ -13247,9 +13070,6 @@ void ImProcFunctions::Lab_Local( float lap = params->locallab.spots.at(sp).lapmaskSH; bool pde = params->locallab.spots.at(sp).laplac; LocwavCurve dummy; - bool lmasutilicolwav = false; - // bool delt = params->locallab.spots.at(sp).deltae; - bool delt = false; int sco = params->locallab.spots.at(sp).scopemask; int shortcu = params->locallab.spots.at(sp).shortc; @@ -13262,20 +13082,19 @@ void ImProcFunctions::Lab_Local( float anchorcd = params->locallab.spots.at(sp).fatanchorSH; int lumask = params->locallab.spots.at(sp).lumask; LocHHmaskCurve lochhhmasCurve; - bool lhhmasutili = false; const int highl = 0; - maskcalccol(false, pde, GW, GH, 0, 0, sk, cx, cy, bufcolorig.get(), bufmaskblurcol.get(), originalmaskSH.get(), original, reserved, inv, lp, + maskcalccol(false, pde, TW, TH, 0, 0, sk, cx, cy, bufcolorig.get(), bufmaskblurcol.get(), originalmaskSH.get(), original, reserved, inv, lp, 0.f, false, - locccmasSHCurve, lcmasSHutili, locllmasSHCurve, llmasSHutili, lochhmasSHCurve, lhmasSHutili, lochhhmasCurve, lhhmasutili, multiThread, - enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskSHlocalcurve, localmaskSHutili, dummy, lmasutilicolwav, 1, 1, 5, 5, - shortcu, delt, hueref, chromaref, lumaref, + locccmasSHCurve, lcmasSHutili, locllmasSHCurve, llmasSHutili, lochhmasSHCurve, lhmasSHutili, lochhhmasCurve, false, multiThread, + enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskSHlocalcurve, localmaskSHutili, dummy, false, 1, 1, 5, 5, + shortcu, false, hueref, chromaref, lumaref, maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, -1 ); if (lp.showmaskSHmetinv == 1) { - showmask(lumask, lp, 0, 0, cx, cy, GW, GH, bufcolorig.get(), transformed, bufmaskblurcol.get(), inv); + showmask(lumask, lp, 0, 0, cx, cy, TW, TH, bufcolorig.get(), transformed, bufmaskblurcol.get(), inv); return; } @@ -13379,7 +13198,7 @@ void ImProcFunctions::Lab_Local( if (lp.locmet == 1) { if (locwavCurve && locwavutili) { for (int i = 0; i < 500; i++) { - if (locwavCurve[i] != 0.5) { + if (locwavCurve[i] != 0.5f) { wavcurve = true; break; } @@ -13387,7 +13206,7 @@ void ImProcFunctions::Lab_Local( } if (loclevwavCurve && loclevwavutili) { for (int i = 0; i < 500; i++) { - if (loclevwavCurve[i] != 0.) { + if (loclevwavCurve[i] != 0.f) { wavcurvelev = true; break; } @@ -13395,7 +13214,7 @@ void ImProcFunctions::Lab_Local( } if (locconwavCurve && locconwavutili) { for (int i = 0; i < 500; i++) { - if (locconwavCurve[i] != 0.5) { + if (locconwavCurve[i] != 0.5f) { wavcurvecon = true; break; } @@ -13403,7 +13222,7 @@ void ImProcFunctions::Lab_Local( } if (loccompwavCurve && loccompwavutili) { for (int i = 0; i < 500; i++) { - if (loccompwavCurve[i] != 0.) { + if (loccompwavCurve[i] != 0.f) { wavcurvecomp = true; break; } @@ -13411,7 +13230,7 @@ void ImProcFunctions::Lab_Local( } if (loccomprewavCurve && loccomprewavutili) { for (int i = 0; i < 500; i++) { - if (loccomprewavCurve[i] != 0.75) { + if (loccomprewavCurve[i] != 0.75f) { wavcurvecompre = true; break; } @@ -13419,7 +13238,7 @@ void ImProcFunctions::Lab_Local( } } - if ((lp.lcamount > 0.f || wavcurve || lp.showmasklcmet == 2 || lp.enalcMask || lp.showmasklcmet == 3 || lp.showmasklcmet == 4 || lp.prevdE || lp.strwav != 0.f || wavcurvelev || wavcurvecon || wavcurvecomp || wavcurvecompre || lp.edgwena || params->locallab.spots.at(sp).residblur > 0.f || params->locallab.spots.at(sp).levelblur > 0.f || params->locallab.spots.at(sp).residcont != 0.f || params->locallab.spots.at(sp).clarilres != 0.f || params->locallab.spots.at(sp).claricres != 0.f) && call <= 3 && lp.lcena) { + if ((lp.lcamount > 0.f || wavcurve || lp.showmasklcmet == 2 || lp.enalcMask || lp.showmasklcmet == 3 || lp.showmasklcmet == 4 || lp.prevdE || lp.strwav != 0.f || wavcurvelev || wavcurvecon || wavcurvecomp || wavcurvecompre || lp.edgwena || params->locallab.spots.at(sp).residblur > 0.0 || params->locallab.spots.at(sp).levelblur > 0.0 || params->locallab.spots.at(sp).residcont != 0.0 || params->locallab.spots.at(sp).clarilres != 0.0 || params->locallab.spots.at(sp).claricres != 0.0) && call <= 3 && lp.lcena) { int ystart = rtengine::max(static_cast(lp.yc - lp.lyT) - cy, 0); int yend = rtengine::min(static_cast(lp.yc + lp.ly) - cy, original->H); @@ -13522,8 +13341,6 @@ void ImProcFunctions::Lab_Local( float lap = 0.f; //params->locallab.spots.at(sp).lapmaskexp; bool pde = false; //params->locallab.spots.at(sp).laplac; LocwavCurve dummy; - bool lmasutilicolwav = false; - bool delt = params->locallab.spots.at(sp).deltae; int sco = params->locallab.spots.at(sp).scopemask; int shado = 0; int shortcu = 0;//lp.mergemet; //params->locallab.spots.at(sp).shortc; @@ -13535,13 +13352,12 @@ void ImProcFunctions::Lab_Local( float anchorcd = 50.f; int lumask = params->locallab.spots.at(sp).lumask; LocHHmaskCurve lochhhmasCurve; - bool lhhmasutili = false; const int highl = 0; maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, bufgb.get(), bufmaskoriglc.get(), originalmasklc.get(), original, reserved, inv, lp, 0.f, false, - locccmaslcCurve, lcmaslcutili, locllmaslcCurve, llmaslcutili, lochhmaslcCurve, lhmaslcutili, lochhhmasCurve, lhhmasutili, multiThread, - enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmasklclocalcurve, localmasklcutili, dummy, lmasutilicolwav, 1, 1, 5, 5, - shortcu, delt, hueref, chromaref, lumaref, + locccmaslcCurve, lcmaslcutili, locllmaslcCurve, llmaslcutili, lochhmaslcCurve, lhmaslcutili, lochhhmasCurve, false, multiThread, + enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmasklclocalcurve, localmasklcutili, dummy, false, 1, 1, 5, 5, + shortcu, params->locallab.spots.at(sp).deltae, hueref, chromaref, lumaref, maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, -1 ); @@ -13594,8 +13410,8 @@ void ImProcFunctions::Lab_Local( } } else if (lp.locmet == 1) { //wavelet && sk ==1 int wavelet_level = 1 + params->locallab.spots.at(sp).csthreshold.getBottomRight();//retrieve with +1 maximum wavelet_level - float mL = params->locallab.spots.at(sp).clarilres / 100.f; - float mC = params->locallab.spots.at(sp).claricres / 100.f; + float mL = params->locallab.spots.at(sp).clarilres / 100.0; + float mC = params->locallab.spots.at(sp).claricres / 100.0; float softr = params->locallab.spots.at(sp).clarisoft; float mL0 = 0.f; float mC0 = 0.f; @@ -13700,7 +13516,7 @@ void ImProcFunctions::Lab_Local( #pragma omp parallel for if (multiThread) #endif for (int i = 0; i < W_La * H_La; i++) { - wav_ab0a[i] *= (1.f + sin(rtengine::RT_PI * (satur / 200.f)));//more progressive than linear + wav_ab0a[i] *= (1.f + xsinf(rtengine::RT_PI_F * (satur / 200.f)));//more progressive than linear wav_ab0a[i] = clipC(wav_ab0a[i]); } } @@ -13754,7 +13570,7 @@ void ImProcFunctions::Lab_Local( #pragma omp parallel for if (multiThread) #endif for (int i = 0; i < W_Lb * H_Lb; i++) { - wav_ab0b[i] *= (1.f + sin(rtengine::RT_PI * (satur / 200.f))); + wav_ab0b[i] *= (1.f + xsinf(rtengine::RT_PI_F * (satur / 200.f))); wav_ab0b[i] = clipC(wav_ab0b[i]); } } @@ -13958,32 +13774,30 @@ void ImProcFunctions::Lab_Local( LabImage *buforigmas = nullptr; LabImage *bufmaskorigreti = nullptr; - if (GW >= mSP && GH >= mSP) + if (TW >= mSP && TH >= mSP) { - { - - array2D buflight(GW, GH); - JaggedArray bufchro(GW, GH); + array2D buflight(TW, TH); + JaggedArray bufchro(TW, TH); int Hd, Wd; - Hd = GH; - Wd = GW; + Hd = TH; + Wd = TW; - bufreti = new LabImage(GW, GH); - bufmask = new LabImage(GW, GH); - bufmaskorigreti = new LabImage(GW, GH); + bufreti = new LabImage(TW, TH); + bufmask = new LabImage(TW, TH); + bufmaskorigreti = new LabImage(TW, TH); if (!lp.enaretiMasktmap && lp.enaretiMask) { - buforig = new LabImage(GW, GH); - buforigmas = new LabImage(GW, GH); + buforig = new LabImage(TW, TH); + buforigmas = new LabImage(TW, TH); // bufmaskorigreti = new LabImage(GW, GH); } #ifdef _OPENMP #pragma omp parallel for if (multiThread) #endif - for (int ir = 0; ir < GH; ir++) //fill with 0 - for (int jr = 0; jr < GW; jr++) { + for (int ir = 0; ir < TH; ir++) //fill with 0 + for (int jr = 0; jr < TW; jr++) { bufreti->L[ir][jr] = 0.f; bufreti->a[ir][jr] = 0.f; bufreti->b[ir][jr] = 0.f; @@ -14039,7 +13853,7 @@ void ImProcFunctions::Lab_Local( #endif for (int y = 0; y < transformed->H ; y++) for (int x = 0; x < transformed->W; x++) { - float dE = std::sqrt(SQR(refa - bufreti->a[y][x] / 327.68f) + SQR(refb - bufreti->b[y][x] / 327.68f) + SQR(lumaref - bufreti->b[y][x] / 327.68f)); + float dE = std::sqrt(SQR(refa - bufreti->a[y][x] / 327.68f) + SQR(refb - bufreti->b[y][x] / 327.68f) + SQR(static_cast(lumaref) - bufreti->b[y][x] / 327.68f)); const float reducdE = calcreducdE(dE, maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sensibefore); reducDE[y][x] = clipDE(reducdE); } @@ -14061,11 +13875,8 @@ void ImProcFunctions::Lab_Local( LabImage *tmpl = new LabImage(Wd, Hd); - // float minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax; bool fftw = lp.ftwreti; - //fftw = false; //for Retinex Mask are incorporated in MSR - bool delt = params->locallab.spots.at(sp).deltae; int sco = params->locallab.spots.at(sp).scopemask; float lumask = params->locallab.spots.at(sp).lumask; @@ -14078,7 +13889,7 @@ void ImProcFunctions::Lab_Local( locccmasretiCurve, lcmasretiutili, locllmasretiCurve, llmasretiutili, lochhmasretiCurve, lhmasretiutili, llretiMask, lmaskretilocalcurve, localmaskretiutili, transformed, lp.enaretiMasktmap, lp.enaretiMask, - delt, hueref, chromaref, lumaref, + params->locallab.spots.at(sp).deltae, hueref, chromaref, lumaref, maxdE2, mindE2, maxdElim2, mindElim2, lp.iterat, limscope, sco, lp.balance, lp.balanceh, lumask); #ifdef _OPENMP #pragma omp parallel for if (multiThread) @@ -14181,17 +13992,17 @@ void ImProcFunctions::Lab_Local( float divchro = maxChro; //first step change saturation without Retinex ==> gain of time and memory - float satreal = lp.str * params->locallab.spots.at(sp).chrrt / 100.f; + float satreal = lp.str * static_cast(params->locallab.spots.at(sp).chrrt) / 100.f; - if (params->locallab.spots.at(sp).chrrt <= 0.2f) { + if (params->locallab.spots.at(sp).chrrt <= 0.2) { satreal /= 10.f; } DiagonalCurve reti_satur({ DCT_NURBS, 0, 0, - 0.2, 0.2 + satreal / 250.0, - 0.6, rtengine::min(1.0, 0.6 + satreal / 250.0), + 0.2, 0.2f + satreal / 250.f, + 0.6, rtengine::min(1.f, 0.6f + satreal / 250.f), 1, 1 }); @@ -14207,7 +14018,7 @@ void ImProcFunctions::Lab_Local( sincosval.y = Chprov == 0.0f ? 1.f : bufreti->a[ir][jr] / Chprov; sincosval.x = Chprov == 0.0f ? 0.f : bufreti->b[ir][jr] / Chprov; - if (params->locallab.spots.at(sp).chrrt <= 100.f) { //first step + if (params->locallab.spots.at(sp).chrrt <= 100.0) { //first step float buf = LIM01(orig[ir][jr] / divchro); buf = reti_satur.getVal(buf); buf *= divchro; @@ -14299,8 +14110,8 @@ void ImProcFunctions::Lab_Local( JaggedArray bufchro(bfw, bfh); int Hd, Wd; - Hd = GH; - Wd = GW; + Hd = TH; + Wd = TW; if (!lp.invret && call == 2) { @@ -14369,7 +14180,7 @@ void ImProcFunctions::Lab_Local( #endif for (int y = ystart; y < yend ; y++) { for (int x = xstart; x < xend; x++) { - const float dE = std::sqrt(SQR(refa - bufreti->a[y - ystart][x - xstart] / 327.68f) + SQR(refb - bufreti->b[y - ystart][x - xstart] / 327.68f) + SQR(lumaref - bufreti->b[y - ystart][x - xstart] / 327.68f)); + const float dE = std::sqrt(SQR(refa - bufreti->a[y - ystart][x - xstart] / 327.68f) + SQR(refb - bufreti->b[y - ystart][x - xstart] / 327.68f) + SQR(static_cast(lumaref) - bufreti->b[y - ystart][x - xstart] / 327.68f)); const float reducdE = calcreducdE(dE, maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sensibefore); reducDE[y - ystart][x - xstart] = clipDE(reducdE); } @@ -14400,7 +14211,6 @@ void ImProcFunctions::Lab_Local( // float minCD, maxCD, mini, maxi, Tmean, Tsigma, Tmin, Tmax; bool fftw = lp.ftwreti; //for Retinex Mask are incorporated in MSR - bool delt = params->locallab.spots.at(sp).deltae; int sco = params->locallab.spots.at(sp).scopemask; float lumask = params->locallab.spots.at(sp).lumask; @@ -14414,7 +14224,7 @@ void ImProcFunctions::Lab_Local( locccmasretiCurve, lcmasretiutili, locllmasretiCurve, llmasretiutili, lochhmasretiCurve, lhmasretiutili, llretiMask, lmaskretilocalcurve, localmaskretiutili, transformed, lp.enaretiMasktmap, lp.enaretiMask, - delt, hueref, chromaref, lumaref, + params->locallab.spots.at(sp).deltae, hueref, chromaref, lumaref, maxdE2, mindE2, maxdElim2, mindElim2, lp.iterat, limscope, sco, lp.balance, lp.balanceh, lumask); #ifdef _OPENMP @@ -14519,17 +14329,17 @@ void ImProcFunctions::Lab_Local( } //first step change saturation without Retinex ==> gain of time and memory - float satreal = lp.str * params->locallab.spots.at(sp).chrrt / 100.f; + float satreal = lp.str * static_cast(params->locallab.spots.at(sp).chrrt) / 100.f; - if (params->locallab.spots.at(sp).chrrt <= 0.2f) { + if (params->locallab.spots.at(sp).chrrt <= 0.2) { satreal /= 10.f; } DiagonalCurve reti_satur({ DCT_NURBS, 0, 0, - 0.2, 0.2 + satreal / 250.0, - 0.6, rtengine::min(1.0, 0.6 + satreal / 250.0), + 0.2, 0.2f + satreal / 250.f, + 0.6, rtengine::min(1.f, 0.6f + satreal / 250.f), 1, 1 }); @@ -14545,8 +14355,8 @@ void ImProcFunctions::Lab_Local( sincosval.y = Chprov == 0.0f ? 1.f : bufreti->a[ir][jr] / Chprov; sincosval.x = Chprov == 0.0f ? 0.f : bufreti->b[ir][jr] / Chprov; - if (params->locallab.spots.at(sp).chrrt <= 40.f) { //first step - orig[ir][jr] = reti_satur.getVal(LIM01(orig[ir][jr] / maxChro)) * maxChro; + if (params->locallab.spots.at(sp).chrrt <= 40.0) { //first step + orig[ir][jr] = static_cast(reti_satur.getVal(LIM01(orig[ir][jr] / maxChro))) * maxChro; } tmpl->a[ir][jr] = orig[ir][jr] * sincosval.y; @@ -14612,7 +14422,7 @@ void ImProcFunctions::Lab_Local( bool enablefat = false; - if (params->locallab.spots.at(sp).fatamount > 1.f) { + if (params->locallab.spots.at(sp).fatamount > 1.0) { enablefat = true;; } @@ -14725,8 +14535,6 @@ void ImProcFunctions::Lab_Local( float lap = params->locallab.spots.at(sp).lapmaskexp; bool pde = params->locallab.spots.at(sp).laplac; LocwavCurve dummy; - bool lmasutilicolwav = false; - bool delt = params->locallab.spots.at(sp).deltae; int sco = params->locallab.spots.at(sp).scopemask; int shado = 0; int shortcu = 0;//lp.mergemet; //params->locallab.spots.at(sp).shortc; @@ -14739,14 +14547,13 @@ void ImProcFunctions::Lab_Local( float anchorcd = 50.f; int lumask = params->locallab.spots.at(sp).lumask; LocHHmaskCurve lochhhmasCurve; - bool lhhmasutili = false; const int highl = 0; maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, bufexporig.get(), bufmaskblurexp.get(), originalmaskexp.get(), original, reserved, inv, lp, 0.f, false, - locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, lochhhmasCurve, lhhmasutili, multiThread, - enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskexplocalcurve, localmaskexputili, dummy, lmasutilicolwav, 1, 1, 5, 5, - shortcu, delt, hueref, chromaref, lumaref, + locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, lochhhmasCurve, false, multiThread, + enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskexplocalcurve, localmaskexputili, dummy, false, 1, 1, 5, 5, + shortcu, params->locallab.spots.at(sp).deltae, hueref, chromaref, lumaref, maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, 0 ); @@ -14981,22 +14788,22 @@ void ImProcFunctions::Lab_Local( } //inverse - else if (lp.invex && (lp.expcomp != 0.0 || lp.laplacexp > 0.1f || lp.blac != 0 || lp.hlcomp > 0.f || lp.shadex > 0 || params->locallab.spots.at(sp).fatamount > 1.f || (exlocalcurve && localexutili) || lp.enaExpMaskinv || lp.showmaskexpmetinv == 1) && lp.exposena) { + else if (lp.invex && (lp.expcomp != 0.f || lp.laplacexp > 0.1f || lp.blac != 0 || lp.hlcomp > 0.f || lp.shadex > 0 || params->locallab.spots.at(sp).fatamount > 1.0 || (exlocalcurve && localexutili) || lp.enaExpMaskinv || lp.showmaskexpmetinv == 1) && lp.exposena) { constexpr float adjustr = 2.f; std::unique_ptr bufmaskblurexp; std::unique_ptr originalmaskexp; - const std::unique_ptr bufexporig(new LabImage(GW, GH)); + const std::unique_ptr bufexporig(new LabImage(TW, TH)); if (lp.enaExpMaskinv || lp.showmaskexpmetinv == 1) { - bufmaskblurexp.reset(new LabImage(GW, GH, true)); - originalmaskexp.reset(new LabImage(GW, GH)); + bufmaskblurexp.reset(new LabImage(TW, TH, true)); + originalmaskexp.reset(new LabImage(TW, TH)); } #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif - for (int y = 0; y < GH ; y++) { - for (int x = 0; x < GW; x++) { + for (int y = 0; y < TH ; y++) { + for (int x = 0; x < TW; x++) { bufexporig->L[y][x] = original->L[y][x]; } } @@ -15016,9 +14823,6 @@ void ImProcFunctions::Lab_Local( const float lap = params->locallab.spots.at(sp).lapmaskexp; const bool pde = params->locallab.spots.at(sp).laplac; LocwavCurve dummy; - const bool lmasutilicolwav = false; - // bool delt = params->locallab.spots.at(sp).deltae; - const bool delt = false; const int sco = params->locallab.spots.at(sp).scopemask; constexpr int shado = 0; constexpr int shortcu = 0;//lp.mergemet; //params->locallab.spots.at(sp).shortc; @@ -15031,19 +14835,18 @@ void ImProcFunctions::Lab_Local( constexpr float amountcd = 0.f; constexpr float anchorcd = 50.f; LocHHmaskCurve lochhhmasCurve; - constexpr bool lhhmasutili = false; const int highl = 0; - maskcalccol(false, pde, GW, GH, 0, 0, sk, cx, cy, bufexporig.get(), bufmaskblurexp.get(), originalmaskexp.get(), original, reserved, inv, lp, + maskcalccol(false, pde, TW, TH, 0, 0, sk, cx, cy, bufexporig.get(), bufmaskblurexp.get(), originalmaskexp.get(), original, reserved, inv, lp, 0.f, false, - locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, lochhhmasCurve, lhhmasutili, multiThread, - enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskexplocalcurve, localmaskexputili, dummy, lmasutilicolwav, 1, 1, 5, 5, - shortcu, delt, hueref, chromaref, lumaref, + locccmasexpCurve, lcmasexputili, locllmasexpCurve, llmasexputili, lochhmasexpCurve, lhmasexputili, lochhhmasCurve, false, multiThread, + enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmaskexplocalcurve, localmaskexputili, dummy, false, 1, 1, 5, 5, + shortcu, false, hueref, chromaref, lumaref, maxdE, mindE, maxdElim, mindElim, lp.iterat, limscope, sco, false, 0.f, 0.f, 0 ); if (lp.showmaskexpmetinv == 1) { - showmask(lumask, lp, 0, 0, cx, cy, GW, GH, bufexporig.get(), transformed, bufmaskblurexp.get(), inv); + showmask(lumask, lp, 0, 0, cx, cy, TW, TH, bufexporig.get(), transformed, bufmaskblurexp.get(), inv); return; } @@ -15053,7 +14856,6 @@ void ImProcFunctions::Lab_Local( } } - if (lp.hlcomp > 0.f) { if (lp.expcomp == 0.f) { lp.expcomp = 0.001f; // to enabled @@ -15070,7 +14872,7 @@ void ImProcFunctions::Lab_Local( } //local color and light - const float factor = LocallabParams::LABGRIDL_CORR_MAX * 3.276f; + const float factor = LocallabParams::LABGRIDL_CORR_MAX * 3.276; const float scaling = LocallabParams::LABGRIDL_CORR_SCALE; const float scaledirect = LocallabParams::LABGRIDL_DIRECT_SCALE; const float a_scale = (lp.highA - lp.lowA) / factor / scaling; @@ -15211,8 +15013,8 @@ void ImProcFunctions::Lab_Local( const int level_hr = params->locallab.spots.at(sp).csthresholdcol.getTopRight(); const int shortcu = lp.mergemet; //params->locallab.spots.at(sp).shortc; const int lumask = params->locallab.spots.at(sp).lumask; - const float strumask = 0.02f * params->locallab.spots.at(sp).strumaskcol; - float conthr = 0.01f * params->locallab.spots.at(sp).conthrcol; + const float strumask = 0.02 * params->locallab.spots.at(sp).strumaskcol; + float conthr = 0.01 * params->locallab.spots.at(sp).conthrcol; const float mercol = params->locallab.spots.at(sp).mercol; const float merlucol = params->locallab.spots.at(sp).merlucol; @@ -15238,7 +15040,7 @@ void ImProcFunctions::Lab_Local( maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, bufcolorig.get(), bufmaskblurcol.get(), originalmaskcol.get(), original, reserved, inv, lp, strumask, astool, - locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili, lochhhmasCurve, lhhmasutili, multiThread, + locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili, llochhhmasCurve, lhhmasutili, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmasklocalcurve, localmaskutili, loclmasCurvecolwav, lmasutilicolwav, level_bl, level_hl, level_br, level_hr, shortcu, delt, hueref, chromaref, lumaref, @@ -15373,7 +15175,7 @@ void ImProcFunctions::Lab_Local( bool HHcurve = false; if (lochhCurve && HHutili) { for (int i = 0; i < 500; i++) { - if (lochhCurve[i] != 0.5) { + if (lochhCurve[i] != 0.5f) { HHcurve = true; break; } @@ -15388,16 +15190,16 @@ void ImProcFunctions::Lab_Local( DiagonalCurve color_satur({ DCT_NURBS, 0, 0, - 0.2, 0.2 + satreal / 250.0, - 0.6, rtengine::min(1.0, 0.6 + satreal / 250.0), + 0.2, 0.2f + satreal / 250.f, + 0.6, rtengine::min(1.f, 0.6f + satreal / 250.f), 1, 1 }); DiagonalCurve color_saturmoins({ DCT_NURBS, 0, 0, - 0.1 - satreal / 150., 0.1, - rtengine::min(1.0, 0.7 - satreal / 300.), 0.7, + 0.1f - satreal / 150.f, 0.1f, + rtengine::min(1.f, 0.7f - satreal / 300.f), 0.7, 1, 1 }); @@ -15418,9 +15220,9 @@ void ImProcFunctions::Lab_Local( // 35000 must be globally good, more than 32768...and less than !! to avoid calculation min max if (lp.chro > 0.f) { - Chprov = color_satur.getVal(LIM01(Chprov / 35000.f)) * 35000.f; + Chprov = static_cast(color_satur.getVal(LIM01(Chprov / 35000.f))) * 35000.f; } else { - Chprov = color_saturmoins.getVal(LIM01(Chprov / 35000.f)) * 35000.f; + Chprov = static_cast(color_saturmoins.getVal(LIM01(Chprov / 35000.f))) * 35000.f; } if (lp.chro == -100.f) { @@ -15460,7 +15262,7 @@ void ImProcFunctions::Lab_Local( if (lochhCurve && HHcurve && lp.qualcurvemet != 0 && !ctoning) { // H=f(H) const float chromat = std::sqrt(SQR(bufcolcalca) + SQR(bufcolcalcb)); const float hhforcurv = xatan2f(bufcolcalcb, bufcolcalca); - const float valparam = 2.f * float ((lochhCurve[500.f * Color::huelab_to_huehsv2(hhforcurv)] - 0.5f)) + static_cast(hhforcurv); + const float valparam = 2.f * (lochhCurve[500.f * static_cast(Color::huelab_to_huehsv2(hhforcurv))] - 0.5f) + hhforcurv; float2 sincosval = xsincosf(valparam); bufcolcalca = chromat * sincosval.y; bufcolcalcb = chromat * sincosval.x; @@ -15477,7 +15279,7 @@ void ImProcFunctions::Lab_Local( if (loclhCurve && LHutili && lp.qualcurvemet != 0) {//L=f(H) curve const float rhue = xatan2f(bufcolcalcb, bufcolcalca); float l_r = bufcolcalcL / 32768.f; //Luminance Lab in 0..1 - const float valparam = loclhCurve[500.f * Color::huelab_to_huehsv2(rhue)] - 0.5f; //get l_r=f(H) + const float valparam = loclhCurve[500.f *static_cast(Color::huelab_to_huehsv2(rhue))] - 0.5f; //get l_r=f(H) if (valparam > 0.f) { l_r = (1.f - valparam) * l_r + valparam * (1.f - SQR(((SQR(1.f - rtengine::min(l_r, 1.0f)))))); @@ -15494,7 +15296,7 @@ void ImProcFunctions::Lab_Local( if (locchCurve && CHutili && lp.qualcurvemet != 0) {//C=f(H) curve const float rhue = xatan2f(bufcolcalcb, bufcolcalca); - const float valparam = locchCurve[500.f * Color::huelab_to_huehsv2(rhue)] - 0.5f; //get valp=f(H) + const float valparam = locchCurve[500.f * static_cast(Color::huelab_to_huehsv2(rhue))] - 0.5f; //get valp=f(H) float chromaChfactor = 1.0f + valparam; bufcolcalca *= chromaChfactor;//apply C=f(H) bufcolcalcb *= chromaChfactor; @@ -15520,10 +15322,6 @@ void ImProcFunctions::Lab_Local( } } - if (HHcurve && ctoning) {//not use ctoning and H(H) simultaneous but priority to ctoning - HHcurve = false; - } - if (!execcolor) {//if we don't use color and light sliders, curves except RGB #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) @@ -16161,18 +15959,18 @@ void ImProcFunctions::Lab_Local( std::unique_ptr bufmaskblurcol; std::unique_ptr originalmaskcol; - const std::unique_ptr bufcolorig(new LabImage(GW, GH)); + const std::unique_ptr bufcolorig(new LabImage(TW, TH)); if (lp.enaColorMaskinv || lp.showmaskcolmetinv == 1) { - bufmaskblurcol.reset(new LabImage(GW, GH, true)); - originalmaskcol.reset(new LabImage(GW, GH)); + bufmaskblurcol.reset(new LabImage(TW, TH, true)); + originalmaskcol.reset(new LabImage(TW, TH)); } #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) if (multiThread) #endif - for (int y = 0; y < GH ; y++) { - for (int x = 0; x < GW; x++) { + for (int y = 0; y < TH ; y++) { + for (int x = 0; x < TW; x++) { bufcolorig->L[y][x] = original->L[y][x]; } } @@ -16200,7 +15998,7 @@ void ImProcFunctions::Lab_Local( int sco = params->locallab.spots.at(sp).scopemask; int shortcu = lp.mergemet; //params->locallab.spots.at(sp).shortc; int lumask = params->locallab.spots.at(sp).lumask; - float strumask = 0.02f * params->locallab.spots.at(sp).strumaskcol; + float strumask = 0.02 * params->locallab.spots.at(sp).strumaskcol; const float mindE = 2.f + MINSCOPE * sco * lp.thr; const float maxdE = 5.f + MAXSCOPE * sco * (1 + 0.1f * lp.thr); @@ -16210,9 +16008,9 @@ void ImProcFunctions::Lab_Local( constexpr float anchorcd = 50.f; const int highl = 0; - maskcalccol(false, pde, GW, GH, 0, 0, sk, cx, cy, bufcolorig.get(), bufmaskblurcol.get(), originalmaskcol.get(), original, reserved, inv, lp, + maskcalccol(false, pde, TW, TH, 0, 0, sk, cx, cy, bufcolorig.get(), bufmaskblurcol.get(), originalmaskcol.get(), original, reserved, inv, lp, strumask, params->locallab.spots.at(sp).toolcol, - locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili, lochhhmasCurve, lhhmasutili, multiThread, + locccmasCurve, lcmasutili, locllmasCurve, llmasutili, lochhmasCurve, lhmasutili, llochhhmasCurve, lhhmasutili, multiThread, enaMask, showmaske, deltaE, modmask, zero, modif, chrom, rad, lap, gamma, slope, blendm, blendm, shado, highl, amountcd, anchorcd, lmasklocalcurve, localmaskutili, loclmasCurvecolwav, lmasutilicolwav, level_bl, level_hl, level_br, level_hr, shortcu, false, hueref, chromaref, lumaref, @@ -16220,7 +16018,7 @@ void ImProcFunctions::Lab_Local( ); if (lp.showmaskcolmetinv == 1) { - showmask(lumask, lp, 0, 0, cx, cy, GW, GH, bufcolorig.get(), transformed, bufmaskblurcol.get(), inv); + showmask(lumask, lp, 0, 0, cx, cy, TW, TH, bufcolorig.get(), transformed, bufmaskblurcol.get(), inv); return; } @@ -16320,7 +16118,7 @@ void ImProcFunctions::Lab_Local( const int level_hr = params->locallab.spots.at(sp).csthresholdmask.getTopRight(); const int shortcu = lp.mergemet; //params->locallab.spots.at(sp).shortc; const int lumask = params->locallab.spots.at(sp).lumask; - const float strumask = 0.02f * params->locallab.spots.at(sp).strumaskmask; + const float strumask = 0.02 * params->locallab.spots.at(sp).strumaskmask; const float softr = params->locallab.spots.at(sp).softradiusmask; const float mindE = 2.f + MINSCOPE * sco * lp.thr; @@ -16362,17 +16160,16 @@ void ImProcFunctions::Lab_Local( } } if (softr != 0.f) {//soft for L a b because we change color... - float rad = softr; - const float tmpblur = rad < 0.f ? -1.f / rad : 1.f + rad; - const int r1 = rtengine::max(4 / sk * tmpblur + 0.5, 1); - const int r2 = rtengine::max(25 / sk * tmpblur + 0.5, 1); + const float tmpblur = softr < 0.f ? -1.f / softr : 1.f + softr; + const int r1 = rtengine::max(4 / sk * tmpblur + 0.5f, 1); + const int r2 = rtengine::max(25 / sk * tmpblur + 0.5f, 1); constexpr float epsilmax = 0.005f; constexpr float epsilmin = 0.00001f; constexpr float aepsil = (epsilmax - epsilmin) / 100.f; constexpr float bepsil = epsilmin; - const float epsil = rad < 0.f ? 0.001f : aepsil * rad + bepsil; + const float epsil = softr < 0.f ? 0.001f : aepsil * softr + bepsil; rtengine::guidedFilter(guid, blechro, blechro, r1, epsil, multiThread); rtengine::guidedFilter(guid, ble, ble, r2, 0.2f * epsil, multiThread); From 310239dfbd659fb0d0612e279d6602d1d7dcbc30 Mon Sep 17 00:00:00 2001 From: Thanatomanic <6567747+Thanatomanic@users.noreply.github.com> Date: Mon, 22 Feb 2021 15:35:13 +0100 Subject: [PATCH 096/129] Add clang-format format file\nThis allows formatting in e.g. VSCode similar to AStyle. --- .clang-format | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000..aa4b31eeb --- /dev/null +++ b/.clang-format @@ -0,0 +1,12 @@ +BasedOnStyle: LLVM +BreakBeforeBraces: Linux +UseTab: Never +IndentWidth: 4 +TabWidth: 4 +ColumnLimit: 0 +AccessModifierOffset: -4 +AllowShortIfStatementsOnASingleLine: Always +AlignAfterOpenBracket: DontAlign +BreakConstructorInitializers: AfterColon +NamespaceIndentation: None +IndentCaseLabels: true \ No newline at end of file From fc23c0fbfa0a5c28bef1125f44d36917d7c50a9d Mon Sep 17 00:00:00 2001 From: Adam Reichold Date: Mon, 22 Feb 2021 18:40:38 +0100 Subject: [PATCH 097/129] Fix GCC warning about comparing signed and unsigned integers. --- rtengine/array2D.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtengine/array2D.h b/rtengine/array2D.h index ba2e6a5d3..10d797999 100644 --- a/rtengine/array2D.h +++ b/rtengine/array2D.h @@ -184,13 +184,13 @@ public: // use with indices T * operator[](int index) { - assert((index >= 0) && (index < rows.size())); + assert((index >= 0) && (std::size_t(index) < rows.size())); return rows[index]; } const T * operator[](int index) const { - assert((index >= 0) && (index < rows.size())); + assert((index >= 0) && (std::size_t(index) < rows.size())); return rows[index]; } From 0694eb1d3df11427e20d33a5a5cffd449184883e Mon Sep 17 00:00:00 2001 From: Thanatomanic <6567747+Thanatomanic@users.noreply.github.com> Date: Tue, 23 Feb 2021 17:38:52 +0100 Subject: [PATCH 098/129] Update .clang-format to prevent unwanted sorting of includes --- .clang-format | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.clang-format b/.clang-format index aa4b31eeb..e559023b1 100644 --- a/.clang-format +++ b/.clang-format @@ -9,4 +9,5 @@ AllowShortIfStatementsOnASingleLine: Always AlignAfterOpenBracket: DontAlign BreakConstructorInitializers: AfterColon NamespaceIndentation: None -IndentCaseLabels: true \ No newline at end of file +IndentCaseLabels: true +SortIncludes: Never From 7a2463a81adc6767a8bb7efc89c688d0b33f1686 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Tue, 23 Feb 2021 23:06:51 +0100 Subject: [PATCH 099/129] make improcfun.cc cppcheck and -Wextra clean (#6128) * make improcfun.cc cppcheck clean * improcfun.cc: add -Wdouble-promotion to stay clean about this warning in future, because we are clean about it atm * improcfun.cc: some cleanups, now this file is -Wextra clean. Let's keep it clean... * improcfun.cc : Fix LGTM alert --- rtengine/improcfun.cc | 126 ++++++++++++++---------------------------- 1 file changed, 40 insertions(+), 86 deletions(-) diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index ccb6e0c65..bf6234350 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -51,6 +51,9 @@ #include "../rtgui/editcallbacks.h" +#pragma GCC diagnostic warning "-Wextra" +#pragma GCC diagnostic warning "-Wdouble-promotion" + namespace { using namespace rtengine; @@ -2233,36 +2236,6 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer // float satLimitOpacity = 1.f-(float(params->colorToning.saturatedOpacity)/100.f); float strProtect = pow_F((float (params->colorToning.strength) / 100.f), 0.4f); - /* - // Debug output - Color LUTf points - if (ctColorCurve) { - printf("\nColor curve:"); - for (size_t i=0; i<501; i++) { - if (i==0 || i==250 || i==500) - printf("\n(%.1f)[", float(i)/500.f); - printf("%.3f ", ctColorCurve.lutHueCurve[float(i)]); - if (i==0 || i==250 || i==500) - printf("]\n"); - } - printf("\n"); - } - */ - - /* - // Debug output - Opacity LUTf points - if (ctOpacityCurve) { - printf("\nOpacity curve:"); - for (size_t i=0; i<501; i++) { - if (i==0 || i==250 || i==500) - printf("\n(%.1f)[", float(i)/500.f); - printf("%.3f ", ctOpacityCurve.lutOpacityCurve[float(i)]); - if (i==0 || i==250 || i==500) - printf("]\n"); - } - printf("\n"); - } - */ - float RedLow = params->colorToning.redlow / 100.0; float GreenLow = params->colorToning.greenlow / 100.0; float BlueLow = params->colorToning.bluelow / 100.0; @@ -2805,7 +2778,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer //colortoning with shift color XYZ or Lch else if (params->colorToning.method == "Lab" && opautili) { - int algm = 0; + int algo = 0; bool twocol = true;//true=500 color false=2 color int metchrom = 0; @@ -2839,19 +2812,19 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer } if (params->colorToning.method == "Lab") { - algm = 1; + algo = 1; } else if (params->colorToning.method == "Lch") { - algm = 2; //in case of + algo = 2; //in case of } - if (algm <= 2) { + if (algo <= 2) { for (int i = istart, ti = 0; i < tH; i++, ti++) { for (int j = jstart, tj = 0; j < tW; j++, tj++) { float r = rtemp[ti * TS + tj]; float g = gtemp[ti * TS + tj]; float b = btemp[ti * TS + tj]; float ro, go, bo; - labtoning(r, g, b, ro, go, bo, algm, metchrom, twoc, satLimit, satLimitOpacity, ctColorCurve, ctOpacityCurve, clToningcurve, cl2Toningcurve, iplow, iphigh, wp, wip); + labtoning(r, g, b, ro, go, bo, algo, metchrom, twoc, satLimit, satLimitOpacity, ctColorCurve, ctOpacityCurve, clToningcurve, cl2Toningcurve, iplow, iphigh, wp, wip); setUnlessOOG(rtemp[ti * TS + tj], gtemp[ti * TS + tj], btemp[ti * TS + tj], ro, go, bo); } } @@ -3466,7 +3439,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer //colortoning with shift color Lab else if (params->colorToning.method == "Lab" && opautili) { - int algm = 0; + int algo = 0; bool twocol = true; int metchrom = 0; @@ -3501,12 +3474,12 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer } if (params->colorToning.method == "Lab") { - algm = 1; + algo = 1; } else if (params->colorToning.method == "Lch") { - algm = 2; //in case of + algo = 2; //in case of } - if (algm <= 2) { + if (algo <= 2) { #ifdef _OPENMP #pragma omp parallel for schedule(dynamic, 5) #endif @@ -3517,7 +3490,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer float g = tmpImage->g(i, j); float b = tmpImage->b(i, j); float ro, bo, go; - labtoning(r, g, b, ro, go, bo, algm, metchrom, twoc, satLimit, satLimitOpacity, ctColorCurve, ctOpacityCurve, clToningcurve, cl2Toningcurve, iplow, iphigh, wp, wip); + labtoning(r, g, b, ro, go, bo, algo, metchrom, twoc, satLimit, satLimitOpacity, ctColorCurve, ctOpacityCurve, clToningcurve, cl2Toningcurve, iplow, iphigh, wp, wip); setUnlessOOG(tmpImage->r(i, j), tmpImage->g(i, j), tmpImage->b(i, j), ro, go, bo); } } @@ -4311,36 +4284,17 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW const bool avoidColorShift = (params->labCurve.avoidcolorshift || (params->colorappearance.gamut && params->colorappearance.enabled)) && !bwToning ; const float protectRed = (float)settings->protectred; const double protectRedH = settings->protectredh; - float protect_red, protect_redh; - protect_red = protectRed;//default=60 chroma: one can put more or less if necessary...in 'option' 40...160 + const float protect_red = rtengine::LIM(protectRed, 20.f, 180.f); //default=60 chroma: one can put more or less if necessary...in 'option' 40...160 - if (protect_red < 20.0f) { - protect_red = 20.0; // avoid too low value - } + // default=0.4 rad : one can put more or less if necessary...in 'option' 0.2 ..1.0 + // avoid divide by 0 and negatives values + // avoid too big values + const float protect_redh = rtengine::LIM(protectRedH, 0.1f, 1.f); - if (protect_red > 180.0f) { - protect_red = 180.0; // avoid too high value - } - - protect_redh = float (protectRedH); //default=0.4 rad : one can put more or less if necessary...in 'option' 0.2 ..1.0 - - if (protect_redh < 0.1f) { - protect_redh = 0.1f; //avoid divide by 0 and negatives values - } - - if (protect_redh > 1.0f) { - protect_redh = 1.0f; //avoid too big values - } - - float protect_redhcur = protectRedH;//default=0.4 rad : one can put more or less if necessary...in 'option' 0.2 ..1 - - if (protect_redhcur < 0.1f) { - protect_redhcur = 0.1f; //avoid divide by 0 and negatives values:minimal protection for transition - } - - if (protect_redhcur > 3.5f) { - protect_redhcur = 3.5f; //avoid too big values - } + // default=0.4 rad : one can put more or less if necessary...in 'option' 0.2 ..1 + // avoid divide by 0 and negatives values:minimal protection for transition + // avoid too big values + const float protect_redhcurg = rtengine::LIM(protectRedH, 0.1f, 3.5f); //increase saturation after denoise : ...approximation float factnoise = 1.f; @@ -4600,21 +4554,21 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW } if (!bwToning) { - float factorskin, factorsat, factorskinext; + float factorskinc, factorsatc, factorskinextc; if (chromapro > 1.f) { float scale = scaleConst;//reduction in normal zone float scaleext = 1.f;//reduction in transition zone Color::scalered(rstprotection, chromapro, 0.0, HH, protect_redh, scale, scaleext); //1.0 float interm = (chromapro - 1.f); - factorskin = 1.f + (interm * scale); - factorskinext = 1.f + (interm * scaleext); + factorskinc = 1.f + (interm * scale); + factorskinextc = 1.f + (interm * scaleext); } else { - factorskin = chromapro ; // +(chromapro)*scale; - factorskinext = chromapro ;// +(chromapro)*scaleext; + factorskinc = chromapro ; // +(chromapro)*scale; + factorskinextc = chromapro ;// +(chromapro)*scaleext; } - factorsat = chromapro * factnoise; + factorsatc = chromapro * factnoise; //simulate very approximative gamut f(L) : with pyramid transition float dred /*=55.f*/;//C red value limit @@ -4634,9 +4588,9 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW // end pyramid // Test if chroma is in the normal range first - Color::transitred(HH, Chprov1, dred, factorskin, protect_red, factorskinext, protect_redh, factorsat, factorsat); - atmp *= factorsat; - btmp *= factorsat; + Color::transitred(HH, Chprov1, dred, factorskinc, protect_red, factorskinextc, protect_redh, factorsatc, factorsatc); + atmp *= factorsatc; + btmp *= factorsatc; if (editPipette && editID == EUID_Lab_CLCurve) { editWhatever->v(i, j) = LIM01 (LL / 100.f); // Lab C=f(L) pipette @@ -4775,7 +4729,7 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW const float xx = 0.25f; //soft : between 0.2 and 0.4 float skdeltaHH; - skdeltaHH = protect_redhcur; //transition hue + skdeltaHH = protect_redhcurg; //transition hue float skbeg = -0.05f; //begin hue skin float skend = 1.60f; //end hue skin @@ -5176,9 +5130,9 @@ void ImProcFunctions::EPDToneMaplocal(int sp, LabImage *lab, LabImage *tmp1, uns float *L = lab->L[0]; float *a = lab->a[0]; float *b = lab->b[0]; - unsigned int i, N = lab->W * lab->H; + std::size_t N = static_cast(lab->W) * static_cast(lab->H); int WW = lab->W ; -// int HH = lab->H ; + EdgePreservingDecomposition epd(lab->W, lab->H); //Due to the taking of logarithms, L must be nonnegative. Further, scale to 0 to 1 using nominal range of L, 0 to 15 bit. @@ -5188,7 +5142,7 @@ void ImProcFunctions::EPDToneMaplocal(int sp, LabImage *lab, LabImage *tmp1, uns #ifdef _OPENMP #pragma omp parallel for reduction(max:maxL) reduction(min:minL) schedule(dynamic,16) #endif - for (i = 0; i < N; i++) { + for (std::size_t i = 0; i < N; i++) { minL = rtengine::min(minL, L[i]); maxL = rtengine::max(maxL, L[i]); } @@ -5200,14 +5154,14 @@ void ImProcFunctions::EPDToneMaplocal(int sp, LabImage *lab, LabImage *tmp1, uns if (maxL == 0.f) { // avoid division by zero maxL = 1.f; } - + + const float mult = gamm / maxL; #ifdef _OPENMP #pragma omp parallel for #endif - for (i = 0; i < N; i++) + for (std::size_t i = 0; i < N; i++) { - L[i] = (L[i] - minL) / maxL; - L[i] *= gamm; + L[i] = (L[i] - minL) * mult; } //Some interpretations. @@ -5913,7 +5867,7 @@ void ImProcFunctions::colorToningLabGrid(LabImage *lab, int xstart, int xend, in float b_base = params->colorToning.labgridBLow / scaling; #ifdef _OPENMP - #pragma omp parallel for if (multiThread) + #pragma omp parallel for if (MultiThread) #endif for (int y = ystart; y < yend; ++y) { From f727477710e1f67fe42ec827d5c4baca9e08921f Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Wed, 24 Feb 2021 22:39:23 +0100 Subject: [PATCH 100/129] Make some more files cppcheck clean (#6133) * Make some more files cppcheck clean * revert change of dcrop.cc from last commit * Replace calculation: y = pow(x, 1/ (2.f * 2.f)) by y = sqrt(sqrt(x)) * Revert "Replace calculation: y = pow(x, 1/ (2.f * 2.f)) by y = sqrt(sqrt(x))" This reverts commit d639c67249f1723fa9f9e55e0442afcb862eba91. --- rtengine/cache.h | 2 +- rtengine/dcrop.cc | 17 ----------------- rtengine/impulse_denoise.cc | 6 +++--- rtengine/iplab2rgb.cc | 3 ++- rtengine/ipsharpen.cc | 4 ++-- rtengine/ipwavelet.cc | 26 ++++++++++---------------- 6 files changed, 18 insertions(+), 40 deletions(-) diff --git a/rtengine/cache.h b/rtengine/cache.h index 6c1dacf43..77a2017f3 100644 --- a/rtengine/cache.h +++ b/rtengine/cache.h @@ -65,7 +65,7 @@ public: virtual void onDestroy() = 0; }; - Cache(unsigned long _size, Hook* _hook = nullptr) : + explicit Cache(unsigned long _size, Hook* _hook = nullptr) : store_size(_size), hook(_hook) { diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 832bff104..422158da6 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -1132,7 +1132,6 @@ void Crop::update(int todo) /* if (params.icm.workingTRC == "Custom") { //exec TRC IN free const Glib::ustring profile = params.icm.workingProfile; - if (profile == "sRGB" || profile == "Adobe RGB" || profile == "ProPhoto" || profile == "WideGamut" || profile == "BruceRGB" || profile == "Beta RGB" || profile == "BestRGB" || profile == "Rec2020" || profile == "ACESp0" || profile == "ACESp1") { const int cw = baseCrop->getWidth(); const int ch = baseCrop->getHeight(); @@ -1159,22 +1158,6 @@ void Crop::update(int todo) } } - /*xref=000;yref=000; - if (colortest && cropw>115 && croph>115) - for(int j=1;j<5;j++){ - xref+=j*30;yref+=j*30; - if (settings->verbose) { - printf("after rgbProc RGB Xr%i Yr%i Skip=%d R=%f G=%f B=%f \n",xref,yref,skip, - baseCrop->r[(int)(xref/skip)][(int)(yref/skip)]/256, - baseCrop->g[(int)(xref/skip)][(int)(yref/skip)]/256, - baseCrop->b[(int)(xref/skip)][(int)(yref/skip)]/256); - printf("after rgbProc Lab Xr%i Yr%i Skip=%d l=%f a=%f b=%f \n",xref,yref,skip, - laboCrop->L[(int)(xref/skip)][(int)(yref/skip)]/327, - laboCrop->a[(int)(xref/skip)][(int)(yref/skip)]/327, - laboCrop->b[(int)(xref/skip)][(int)(yref/skip)]/327); - } - }*/ - // apply luminance operations if (todo & (M_LUMINANCE + M_COLOR)) { // //I made a little change here. Rather than have luminanceCurve (and others) use in/out lab images, we can do more if we copy right here. diff --git a/rtengine/impulse_denoise.cc b/rtengine/impulse_denoise.cc index 20229e714..8e1143c09 100644 --- a/rtengine/impulse_denoise.cc +++ b/rtengine/impulse_denoise.cc @@ -322,7 +322,7 @@ void ImProcFunctions::impulse_nrcam (CieImage* ncie, double thresh, float **buff hfnbrave += fabs(ncie->sh_p[i1][j1] - lpf[i1][j1]); } - impish[i][j] = (hpfabs > ((hfnbrave - hpfabs) * impthrDiv24)); + impish[i][j] = static_cast(hpfabs > ((hfnbrave - hpfabs) * impthrDiv24)); } #ifdef __SSE2__ @@ -353,7 +353,7 @@ void ImProcFunctions::impulse_nrcam (CieImage* ncie, double thresh, float **buff hfnbrave += fabs(ncie->sh_p[i1][j1] - lpf[i1][j1]); } - impish[i][j] = (hpfabs > ((hfnbrave - hpfabs) * impthrDiv24)); + impish[i][j] = static_cast(hpfabs > ((hfnbrave - hpfabs) * impthrDiv24)); } for (; j < width; j++) { @@ -365,7 +365,7 @@ void ImProcFunctions::impulse_nrcam (CieImage* ncie, double thresh, float **buff hfnbrave += fabs(ncie->sh_p[i1][j1] - lpf[i1][j1]); } - impish[i][j] = (hpfabs > ((hfnbrave - hpfabs) * impthrDiv24)); + impish[i][j] = static_cast(hpfabs > ((hfnbrave - hpfabs) * impthrDiv24)); } } } diff --git a/rtengine/iplab2rgb.cc b/rtengine/iplab2rgb.cc index dd89301ae..81a304fd3 100644 --- a/rtengine/iplab2rgb.cc +++ b/rtengine/iplab2rgb.cc @@ -96,7 +96,8 @@ inline void copyAndClamp(const LabImage *src, unsigned char *dst, const double r gbuffer[j] = Color::gamma2curve[G]; bbuffer[j] = Color::gamma2curve[B]; } - for (int j = 0; j < W; ++j) { + + for (j = 0; j < W; ++j) { dst[ix++] = uint16ToUint8Rounded(rbuffer[j]); dst[ix++] = uint16ToUint8Rounded(gbuffer[j]); dst[ix++] = uint16ToUint8Rounded(bbuffer[j]); diff --git a/rtengine/ipsharpen.cc b/rtengine/ipsharpen.cc index afe6f8aa3..96d42e336 100644 --- a/rtengine/ipsharpen.cc +++ b/rtengine/ipsharpen.cc @@ -543,8 +543,8 @@ BENCHFUN // calculate contrast based blend factors to reduce sharpening in regions with low contrast JaggedArray blend(W, H); - float contrast = params->sharpenMicro.contrast / 100.0; - buildBlendMask(luminance, blend, W, H, contrast); + float contrastThreshold = params->sharpenMicro.contrast / 100.0; + buildBlendMask(luminance, blend, W, H, contrastThreshold); #ifdef _OPENMP #pragma omp parallel diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 7563ca75d..4b65dd5bc 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -1182,30 +1182,28 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const float* noisevarhue = new float[GHL * GWL]; int GW2L = (GWL + 1) / 2; - float nvlh[13] = {1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 0.7f, 0.5f}; //high value - float nvll[13] = {0.1f, 0.15f, 0.2f, 0.25f, 0.3f, 0.35f, 0.4f, 0.45f, 0.7f, 0.8f, 1.f, 1.f, 1.f}; //low value + constexpr float nvlh[13] = {1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 0.7f, 0.5f}; //high value + constexpr float nvll[13] = {0.1f, 0.15f, 0.2f, 0.25f, 0.3f, 0.35f, 0.4f, 0.45f, 0.7f, 0.8f, 1.f, 1.f, 1.f}; //low value - float seuillow = 3000.f;//low - float seuilhigh = 18000.f;//high - int i = 10 - cp.ballum; - float ac = (nvlh[i] - nvll[i]) / (seuillow - seuilhigh); - float bc = nvlh[i] - seuillow * ac; + constexpr float seuillow = 3000.f;//low + constexpr float seuilhigh = 18000.f;//high + const int index = 10 - cp.ballum; + const float ac = (nvlh[index] - nvll[index]) / (seuillow - seuilhigh); + const float bc = nvlh[index] - seuillow * ac; #ifdef _OPENMP #pragma omp parallel for - #endif - for (int ir = 0; ir < GHL; ir++) for (int jr = 0; jr < GWL; jr++) { float lN = labco->L[ir][jr]; if (lN < seuillow) { - noisevarlum[(ir >> 1)*GW2L + (jr >> 1)] = nvlh[i]; + noisevarlum[(ir >> 1)*GW2L + (jr >> 1)] = nvlh[index]; } else if (lN < seuilhigh) { noisevarlum[(ir >> 1)*GW2L + (jr >> 1)] = ac * lN + bc; } else { - noisevarlum[(ir >> 1)*GW2L + (jr >> 1)] = nvll[i]; + noisevarlum[(ir >> 1)*GW2L + (jr >> 1)] = nvll[index]; } } @@ -2265,11 +2263,7 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const absciss = asig * std::fabs(tempwav) + bsig; } else { absciss = amean * std::fabs(tempwav); - float k = sig; - if(sig > 1.f) { - k = SQR(sig); - } - float abs = pow(2.f * absciss, (1.f / k)); + float abs = pow(2.f * absciss, (1.f / SQR(sig))); absciss = 0.5f * abs; } float kc = wavguid.getVal(absciss) -1.f; From fe795b419c4a3068fca8b8633c4f0619280eff04 Mon Sep 17 00:00:00 2001 From: luz paz Date: Thu, 25 Feb 2021 09:49:27 -0500 Subject: [PATCH 101/129] Fix various source comment typos Found via `codespell -q 3 -S ./rtdata/languages -L ba,bord,childs,hist,fo,reall,bloc,alph,dof,inout,thre,makro,chang,currentry,preserv,portugues,struc,trough,vektor,` --- rtengine/ashift_dt.c | 4 ++-- rtengine/ashift_lsd.c | 2 +- rtengine/camconst.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rtengine/ashift_dt.c b/rtengine/ashift_dt.c index ce19b6808..6ea96a752 100644 --- a/rtengine/ashift_dt.c +++ b/rtengine/ashift_dt.c @@ -1653,7 +1653,7 @@ static int fact(const int n) // original RANSAC works on linear optimization problems. Our model is nonlinear. We // take advantage of the fact that lines interesting for our model are vantage lines // that meet in one vantage point for each subset of lines (vertical/horizontal). -// Stragegy: we construct a model by (random) sampling within the subset of lines and +// Strategy: we construct a model by (random) sampling within the subset of lines and // calculate the vantage point. Then we check the "distance" of all other lines to the // vantage point. The model that gives highest number of lines combined with the highest // total weight and lowest overall "distance" wins. @@ -1751,7 +1751,7 @@ static void ransac(const dt_iop_ashift_line_t *lines, int *index_set, int *inout const float *L3 = lines[index_set[n]].L; // we take the absolute value of the dot product of V and L as a measure - // of the "distance" between point and line. Note that this is not the real euclidian + // of the "distance" between point and line. Note that this is not the real euclidean // distance but - with the given normalization - just a pragmatically selected number // that goes to zero if V lies on L and increases the more V and L are apart const float d = fabs(vec3scalar(V, L3)); diff --git a/rtengine/ashift_lsd.c b/rtengine/ashift_lsd.c index 3a0ec5aba..29bdf8bed 100644 --- a/rtengine/ashift_lsd.c +++ b/rtengine/ashift_lsd.c @@ -21,7 +21,7 @@ * Changes versus the original code: * do not include "lsd.h" (not needed) * make all interface functions static - * comment out unsused interface functions + * comment out unused interface functions * catch (unlikely) division by zero near line 2035 * rename rad1 and rad2 to radius1 and radius2 in reduce_region_radius() * to avoid naming conflict in windows build diff --git a/rtengine/camconst.json b/rtengine/camconst.json index 850cc287c..b2b8d70d1 100644 --- a/rtengine/camconst.json +++ b/rtengine/camconst.json @@ -1427,7 +1427,7 @@ Camera constants: "make_model": "FUJIFILM X-PRO2", "dcraw_matrix": [ 11434,-4948,-1210,-3746,12042,1903,-666,1479,5235 ], // DNG_v9.4 D65 "raw_crop": [ 0, 5, 6032, 4026 ], // see X-T2 - "ranges": { "white": [ 16105, 16270, 16082 ] } // These values are the lowest pixel values >16000 for all ISOs. LENR has a negligble effect. + "ranges": { "white": [ 16105, 16270, 16082 ] } // These values are the lowest pixel values >16000 for all ISOs. LENR has a negligible effect. // No aperture scaling data provided, but likely negligible }, From 1214450aaa4a97bcb7ae059d02bcdf7a14b61b4d Mon Sep 17 00:00:00 2001 From: Thanatomanic <6567747+Thanatomanic@users.noreply.github.com> Date: Thu, 25 Feb 2021 17:49:05 +0100 Subject: [PATCH 102/129] Small fixes to Gtk::Grid::attach for compilation with gtkmm 3.22 --- rtgui/navigator.cc | 42 +++++++++++++++++++++--------------------- rtgui/preferences.cc | 24 ++++++++++++------------ rtgui/renamedlg.cc | 8 ++++---- rtgui/resize.cc | 12 ++++++------ 4 files changed, 43 insertions(+), 43 deletions(-) diff --git a/rtgui/navigator.cc b/rtgui/navigator.cc index bca024a16..4376162d7 100644 --- a/rtgui/navigator.cc +++ b/rtgui/navigator.cc @@ -192,53 +192,53 @@ Navigator::Navigator() : Gtk::Box* hbox1 = Gtk::manage (new Gtk::Box ()); Gtk::Grid* table1 = Gtk::manage (new Gtk::Grid()); - table1->attach(*lR, 0, 0); - table1->attach(*R, 1, 0); - table1->attach(*lG, 0, 1); - table1->attach(*G, 1, 1); - table1->attach(*lB, 0, 2); - table1->attach(*B, 1, 2); + table1->attach(*lR, 0, 0, 1, 1); + table1->attach(*R, 1, 0, 1, 1); + table1->attach(*lG, 0, 1, 1, 1); + table1->attach(*G, 1, 1, 1, 1); + table1->attach(*lB, 0, 2, 1, 1); + table1->attach(*B, 1, 2, 1, 1); evBox1->add (*table1); evBox1->signal_button_release_event().connect_notify( sigc::mem_fun(*this, &Navigator::cycleUnitsRGB)); hbox1->pack_start (*evBox1, Gtk::PACK_EXPAND_WIDGET, 4); hbox1->pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)), Gtk::PACK_SHRINK, 4); - table0->attach(*hbox1, 0, 0); + table0->attach(*hbox1, 0, 0, 1, 1); // HSV Gtk::EventBox *evBox2 = Gtk::manage (new Gtk::EventBox()); Gtk::Box* hbox2 = Gtk::manage (new Gtk::Box ()); Gtk::Grid* table2 = Gtk::manage (new Gtk::Grid()); - table2->attach(*lH, 0, 0); - table2->attach(*H, 1, 0); - table2->attach(*lS, 0, 1); - table2->attach(*S, 1, 1); - table2->attach(*lV, 0, 2); - table2->attach(*V, 1, 2); + table2->attach(*lH, 0, 0, 1, 1); + table2->attach(*H, 1, 0, 1, 1); + table2->attach(*lS, 0, 1, 1, 1); + table2->attach(*S, 1, 1, 1, 1); + table2->attach(*lV, 0, 2, 1, 1); + table2->attach(*V, 1, 2, 1, 1); evBox2->add (*table2); evBox2->signal_button_release_event().connect_notify( sigc::mem_fun(*this, &Navigator::cycleUnitsHSV)); hbox2->pack_start (*evBox2, Gtk::PACK_EXPAND_WIDGET, 4); hbox2->pack_start (*Gtk::manage (new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)), Gtk::PACK_SHRINK, 4); - table0->attach(*hbox2, 1, 0); + table0->attach(*hbox2, 1, 0, 1, 1); // LAB Gtk::Box* hbox3 = Gtk::manage (new Gtk::Box ()); Gtk::Grid* table3 = Gtk::manage (new Gtk::Grid()); - table3->attach(*lLAB_L, 0, 0); - table3->attach(*LAB_L, 1, 0); - table3->attach(*lLAB_A, 0, 1); - table3->attach(*LAB_A, 1, 1); - table3->attach(*lLAB_B, 0, 2); - table3->attach(*LAB_B, 1, 2); + table3->attach(*lLAB_L, 0, 0, 1, 1); + table3->attach(*LAB_L, 1, 0, 1, 1); + table3->attach(*lLAB_A, 0, 1, 1, 1); + table3->attach(*LAB_A, 1, 1, 1, 1); + table3->attach(*lLAB_B, 0, 2, 1, 1); + table3->attach(*LAB_B, 1, 2, 1, 1); hbox3->pack_start (*table3, Gtk::PACK_EXPAND_WIDGET, 4); hbox3->pack_start (*Gtk::manage (new Gtk::Box()), Gtk::PACK_SHRINK, 2); - table0->attach(*hbox3, 2, 0); + table0->attach(*hbox3, 2, 0, 1, 1); table0->set_column_homogeneous(true); // all cells will have equal width diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 5ab2ecd36..9d9603297 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -530,10 +530,10 @@ Gtk::Widget* Preferences::getImageProcessingPanel () Gtk::Grid* defpt = Gtk::manage(new Gtk::Grid()); defpt->set_row_spacing(2); - defpt->attach(*drlab, 0, 0); - defpt->attach(*rprofiles, 1, 0); - defpt->attach(*drimg, 0, 1); - defpt->attach(*iprofiles, 1, 1); + defpt->attach(*drlab, 0, 0, 1, 1); + defpt->attach(*rprofiles, 1, 0, 1, 1); + defpt->attach(*drimg, 0, 1, 1, 1); + defpt->attach(*iprofiles, 1, 1, 1, 1); vbpp->pack_start(*defpt, Gtk::PACK_SHRINK, 4); useBundledProfiles = Gtk::manage(new Gtk::CheckButton(M("PREFERENCES_USEBUNDLEDPROFILES"))); @@ -555,10 +555,10 @@ Gtk::Widget* Preferences::getImageProcessingPanel () custProfBuilderLabelType->append(M("PREFERENCES_CUSTPROFBUILDKEYFORMAT_TID") + "_" + M("PREFERENCES_CUSTPROFBUILDKEYFORMAT_NAME")); Gtk::Grid* cpbt = Gtk::manage(new Gtk::Grid()); cpbt->set_row_spacing(2); - cpbt->attach(*cplab, 0, 0); - cpbt->attach(*txtCustProfBuilderPath, 1, 0); - cpbt->attach(*cpltypelab, 0, 1); - cpbt->attach(*custProfBuilderLabelType, 1, 1); + cpbt->attach(*cplab, 0, 0, 1, 1); + cpbt->attach(*txtCustProfBuilderPath, 1, 0, 1, 1); + cpbt->attach(*cpltypelab, 0, 1, 1, 1); + cpbt->attach(*custProfBuilderLabelType, 1, 1, 1, 1); cpfrm->add(*cpbt); vbImageProcessing->pack_start (*cpfrm, Gtk::PACK_SHRINK, 4); @@ -574,10 +574,10 @@ Gtk::Widget* Preferences::getImageProcessingPanel () loadParamsPreference->append(M("PREFERENCES_PROFILEPRCACHE")); loadParamsPreference->append(M("PREFERENCES_PROFILEPRFILE")); vbdp->set_row_spacing(2); - vbdp->attach(*splab, 0, 0); - vbdp->attach(*saveParamsPreference, 1, 0); - vbdp->attach(*lplab, 0, 1); - vbdp->attach(*loadParamsPreference, 1, 1); + vbdp->attach(*splab, 0, 0, 1, 1); + vbdp->attach(*saveParamsPreference, 1, 0, 1, 1); + vbdp->attach(*lplab, 0, 1, 1, 1); + vbdp->attach(*loadParamsPreference, 1, 1, 1, 1); fdp->add(*vbdp); vbImageProcessing->pack_start (*fdp, Gtk::PACK_SHRINK, 4); diff --git a/rtgui/renamedlg.cc b/rtgui/renamedlg.cc index f76626798..e35c6268d 100644 --- a/rtgui/renamedlg.cc +++ b/rtgui/renamedlg.cc @@ -36,10 +36,10 @@ RenameDialog::RenameDialog (Gtk::Window* parent) newName->set_hexpand(); newName->set_halign(Gtk::ALIGN_FILL); - names->attach(*onlab, 0, 0); - names->attach(*oldName, 1, 0); - names->attach(*nnlab, 0, 1); - names->attach(*newName, 1, 1); + names->attach(*onlab, 0, 0, 1, 1); + names->attach(*oldName, 1, 0, 1, 1); + names->attach(*nnlab, 0, 1, 1, 1); + names->attach(*newName, 1, 1, 1, 1); get_content_area()->pack_start (*names, Gtk::PACK_SHRINK, 4); diff --git a/rtgui/resize.cc b/rtgui/resize.cc index ff3c622aa..314377049 100644 --- a/rtgui/resize.cc +++ b/rtgui/resize.cc @@ -49,8 +49,8 @@ Resize::Resize () : FoldableToolPanel(this, "resize", M("TP_RESIZE_LABEL"), fals Gtk::Label *label = Gtk::manage (new Gtk::Label (M("TP_RESIZE_APPLIESTO"), Gtk::ALIGN_START)); - combos->attach(*label, 0, 0); - combos->attach(*appliesTo, 1, 0); + combos->attach(*label, 0, 0, 1, 1); + combos->attach(*appliesTo, 1, 0, 1, 1); // See Resize::methodChanged() when adding a new method. method = Gtk::manage (new MyComboBoxText ()); @@ -62,8 +62,8 @@ Resize::Resize () : FoldableToolPanel(this, "resize", M("TP_RESIZE_LABEL"), fals label = Gtk::manage (new Gtk::Label (M("TP_RESIZE_METHOD"), Gtk::ALIGN_START)); - combos->attach(*label, 0, 1); - combos->attach(*method, 1, 1); + combos->attach(*label, 0, 1, 1, 1); + combos->attach(*method, 1, 1, 1, 1); spec = Gtk::manage (new MyComboBoxText ()); spec->append (M("TP_RESIZE_SCALE")); @@ -76,8 +76,8 @@ Resize::Resize () : FoldableToolPanel(this, "resize", M("TP_RESIZE_LABEL"), fals label = Gtk::manage (new Gtk::Label (M("TP_RESIZE_SPECIFY"), Gtk::ALIGN_START)); - combos->attach(*label, 0, 2); - combos->attach(*spec, 1, 2); + combos->attach(*label, 0, 2, 1, 1); + combos->attach(*spec, 1, 2, 1, 1); pack_start (*combos, Gtk::PACK_SHRINK, 4); From 9ba266c21f08139281fd7578d751bed59a2006cb Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Thu, 25 Feb 2021 22:44:50 +0100 Subject: [PATCH 103/129] added some stopwatches --- rtengine/ipwavelet.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 4b65dd5bc..eb715f166 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -2196,13 +2196,15 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const if (thrend > 0.f) { + StopWatch Stop0("final touchup"); //2 decomposition LL after guidefilter and dst before (perhaps dst no need) const std::unique_ptr LdecompLL(new wavelet_decomposition(LL[0], ww, hh, levwavL, 1, skip, rtengine::max(1, wavNestedLevels), DaubLen)); const std::unique_ptr Ldecompdst(new wavelet_decomposition(dst->L[0], ww, hh, levwavL, 1, skip, rtengine::max(1, wavNestedLevels), DaubLen)); if (!LdecompLL->memory_allocation_failed() && !Ldecompdst->memory_allocation_failed()) { - + StopWatch Stop1("Evaluate2"); Evaluate2(*LdecompLL, meang, meanNg, sigmag, sigmaNg, MaxPg, MaxNg, wavNestedLevels); Evaluate2(*Ldecompdst, mean, meanN, sigma, sigmaN, MaxP, MaxN, wavNestedLevels); + Stop1.stop(); float sig = 2.f; float thr = 0.f; if(thrend < 0.02f) thr = 0.5f; @@ -2214,6 +2216,7 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const 0, 1, 0.35, 0.35,thrend, 1.0, 0.35, 0.35, thrend + 0.01f, thr, 0.35, 0.35, 1, thr, 0.35, 0.35 }); + StopWatch Stop2("level loops"); for (int dir = 1; dir < 4; dir++) { for (int level = 0; level < levwavL-1; level++) { int Wlvl_L = LdecompLL->level_W(level); @@ -2281,6 +2284,7 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const } } } + Stop2.stop(); LdecompLL->reconstruct(LL[0], cp.strength); } } From 10e0ab4eaaa784ec86437aae00d88d030d4ecea9 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Thu, 25 Feb 2021 23:10:37 +0100 Subject: [PATCH 104/129] Speedup final touchup local contrast --- rtengine/ipwavelet.cc | 86 +++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 48 deletions(-) diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index eb715f166..3caa9a001 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -2196,19 +2196,19 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const if (thrend > 0.f) { - StopWatch Stop0("final touchup"); - //2 decomposition LL after guidefilter and dst before (perhaps dst no need) + StopWatch Stop0("Final touchup"); + //2 decomposition LL after guidefilter and dst before (perhaps dst no need) const std::unique_ptr LdecompLL(new wavelet_decomposition(LL[0], ww, hh, levwavL, 1, skip, rtengine::max(1, wavNestedLevels), DaubLen)); const std::unique_ptr Ldecompdst(new wavelet_decomposition(dst->L[0], ww, hh, levwavL, 1, skip, rtengine::max(1, wavNestedLevels), DaubLen)); if (!LdecompLL->memory_allocation_failed() && !Ldecompdst->memory_allocation_failed()) { - StopWatch Stop1("Evaluate2"); +StopWatch Stop1("evaluate"); Evaluate2(*LdecompLL, meang, meanNg, sigmag, sigmaNg, MaxPg, MaxNg, wavNestedLevels); Evaluate2(*Ldecompdst, mean, meanN, sigma, sigmaN, MaxP, MaxN, wavNestedLevels); - Stop1.stop(); - float sig = 2.f; +Stop1.stop(); + constexpr float sig = 2.f; float thr = 0.f; - if(thrend < 0.02f) thr = 0.5f; - else if(thrend < 0.1f) thr = 0.2f; + if (thrend < 0.02f) thr = 0.5f; + else if (thrend < 0.1f) thr = 0.2f; else thr = 0.f; FlatCurve wavguid({ @@ -2219,34 +2219,29 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const StopWatch Stop2("level loops"); for (int dir = 1; dir < 4; dir++) { for (int level = 0; level < levwavL-1; level++) { - int Wlvl_L = LdecompLL->level_W(level); - int Hlvl_L = LdecompLL->level_H(level); + const int Wlvl_L = LdecompLL->level_W(level); + const int Hlvl_L = LdecompLL->level_H(level); float* const* WavCoeffs_L = LdecompLL->level_coeffs(level);//first decomp denoised float* const* WavCoeffs_L2 = Ldecompdst->level_coeffs(level);//second decomp before denoise if (settings->verbose) { printf("level=%i mean=%.0f meanden=%.0f sigma=%.0f sigmaden=%.0f Max=%.0f Maxden=%.0f\n", level, mean[level], meang[level], sigma[level], sigmag[level],MaxP[level], MaxPg[level]); } - //find local contrast - float tempmean = 0.f; - float tempsig = 0.f; - float tempmax = 0.f; - tempmean = 0.3f * mean[level] + 0.7f * meang[level] ; - tempsig = 0.3f * sigma[level] + 0.7f * sigmag[level] ; - tempmax = 0.3f * MaxP[level] + 0.7f * MaxPg[level] ; + //find local contrast + const float tempmean = 0.3f * mean[level] + 0.7f * meang[level]; + const float tempsig = 0.3f * sigma[level] + 0.7f * sigmag[level]; + const float tempmax = 0.3f * MaxP[level] + 0.7f * MaxPg[level]; if (MaxP[level] > 0.f && mean[level] != 0.f && sigma[level] != 0.f) { //curve - float insigma = 0.666f; //SD - float logmax = log(tempmax); //log Max - //cp.sigmm change the "wider" of sigma - float rapX = (tempmean + sig * tempsig) / (tempmax); //rapport between sD / max - float inx = log(insigma); - float iny = log(rapX); - float rap = inx / iny; //koef - float asig = 0.166f / (tempsig * sig); - float bsig = 0.5f - asig * tempmean; - float amean = 0.5f / (tempmean); - + constexpr float insigma = 0.666f; //SD + const float logmax = log(tempmax); //log Max + const float rapX = (tempmean + sig * tempsig) / tempmax; //rapport between sD / max + constexpr float inx = log(insigma); + const float iny = log(rapX); + const float rap = inx / iny; //koef + const float asig = 0.166f / (tempsig * sig); + const float bsig = 0.5f - asig * tempmean; + const float amean = 1.f / tempmean; #ifdef _OPENMP #pragma omp parallel for schedule(dynamic, Wlvl_L * 16) num_threads(wavNestedLevels) if (wavNestedLevels>1) @@ -2254,32 +2249,27 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const for (int i = 0; i < Wlvl_L * Hlvl_L; i++) { float absciss; - float tempwav = 0.f; - tempwav = 0.7f * WavCoeffs_L[dir][i] + 0.3f * WavCoeffs_L2[dir][i]; + const float tempwav = std::fabs(0.7f * WavCoeffs_L[dir][i] + 0.3f * WavCoeffs_L2[dir][i]); - if (std::fabs(tempwav) >= (tempmean + sig * tempsig)) { //for max - float valcour = xlogf(std::fabs(tempwav)); - float valc = valcour - logmax; - float vald = valc * rap; + if (tempwav >= tempmean + sig * tempsig) { //for max + const float vald = (xlogf(tempwav) - logmax) * rap; absciss = xexpf(vald); - } else if (std::fabs(tempwav) >= tempmean) { - absciss = asig * std::fabs(tempwav) + bsig; + } else if (tempwav >= tempmean) { + absciss = asig * tempwav + bsig; } else { - absciss = amean * std::fabs(tempwav); - float abs = pow(2.f * absciss, (1.f / SQR(sig))); - absciss = 0.5f * abs; + absciss = amean * tempwav; + if (sig == 2.f) { // for sig = 2.f we can use a faster calculation because the exponent in this case is 0.25 + absciss = 0.5f * std::sqrt(std::sqrt(absciss)); + } else { + absciss = 0.5f * pow_F(absciss, 1.f / SQR(sig)); + } } - float kc = wavguid.getVal(absciss) -1.f; + float kc = wavguid.getVal(absciss) - 1.f; + kc = kc < 0.f ? -SQR(kc) : kc; // approximation to simulate sliders denoise - if(kc < 0) { - kc = -SQR(kc);//approximation to simulate sliders denoise - } - float reduceeffect = kc <= 0.f ? 1.f : 1.2f;//1.2 allows to increase denoise (not used) - - float kinterm = 1.f + reduceeffect * kc; - kinterm = kinterm <= 0.f ? 0.01f : kinterm; - float prov = WavCoeffs_L2[dir][i];//save before denoise - WavCoeffs_L[dir][i] = prov + (WavCoeffs_L[dir][i] - prov) * kinterm;//only apply local contrast on difference between denoise and normal + const float reduceeffect = kc <= 0.f ? 1.f : 1.2f;//1.2 allows to increase denoise (not used) + const float kinterm = rtengine::max(1.f + reduceeffect * kc, 0.f); + WavCoeffs_L[dir][i] = intp(kinterm, WavCoeffs_L[dir][i], WavCoeffs_L2[dir][i]); // interpolate using kinterm } } } From d7327e8b05498b02be5bcef84962ea7d96e1c61f Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Fri, 26 Feb 2021 12:41:23 +0100 Subject: [PATCH 105/129] left original code in comments --- rtengine/ipwavelet.cc | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 3caa9a001..1c53992b6 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -2196,16 +2196,19 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const if (thrend > 0.f) { - StopWatch Stop0("Final touchup"); //2 decomposition LL after guidefilter and dst before (perhaps dst no need) const std::unique_ptr LdecompLL(new wavelet_decomposition(LL[0], ww, hh, levwavL, 1, skip, rtengine::max(1, wavNestedLevels), DaubLen)); const std::unique_ptr Ldecompdst(new wavelet_decomposition(dst->L[0], ww, hh, levwavL, 1, skip, rtengine::max(1, wavNestedLevels), DaubLen)); if (!LdecompLL->memory_allocation_failed() && !Ldecompdst->memory_allocation_failed()) { -StopWatch Stop1("evaluate"); Evaluate2(*LdecompLL, meang, meanNg, sigmag, sigmaNg, MaxPg, MaxNg, wavNestedLevels); Evaluate2(*Ldecompdst, mean, meanN, sigma, sigmaN, MaxP, MaxN, wavNestedLevels); -Stop1.stop(); constexpr float sig = 2.f; + /* original code for variable sig + float k = sig; + if (sig > 1.f) { + k = SQR(sig); + } + */ float thr = 0.f; if (thrend < 0.02f) thr = 0.5f; else if (thrend < 0.1f) thr = 0.2f; @@ -2216,7 +2219,6 @@ Stop1.stop(); 0, 1, 0.35, 0.35,thrend, 1.0, 0.35, 0.35, thrend + 0.01f, thr, 0.35, 0.35, 1, thr, 0.35, 0.35 }); - StopWatch Stop2("level loops"); for (int dir = 1; dir < 4; dir++) { for (int level = 0; level < levwavL-1; level++) { const int Wlvl_L = LdecompLL->level_W(level); @@ -2258,11 +2260,15 @@ Stop1.stop(); absciss = asig * tempwav + bsig; } else { absciss = amean * tempwav; + /* if (sig == 2.f) { // for sig = 2.f we can use a faster calculation because the exponent in this case is 0.25 - absciss = 0.5f * std::sqrt(std::sqrt(absciss)); + */ + absciss = 0.5f * std::sqrt(std::sqrt(absciss)); + /* original code for variable sig } else { - absciss = 0.5f * pow_F(absciss, 1.f / SQR(sig)); + absciss = 0.5f * pow_F(absciss, 1.f / k); } + */ } float kc = wavguid.getVal(absciss) - 1.f; kc = kc < 0.f ? -SQR(kc) : kc; // approximation to simulate sliders denoise @@ -2274,12 +2280,10 @@ Stop1.stop(); } } } - Stop2.stop(); LdecompLL->reconstruct(LL[0], cp.strength); } } - //end local contrast #ifdef _OPENMP #pragma omp parallel for From d3c536b0d8711ba62eeb23cac66fed718f9a3e5c Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Fri, 26 Feb 2021 13:01:02 +0100 Subject: [PATCH 106/129] Fix clang build --- rtengine/ipwavelet.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 1c53992b6..07610d0d9 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -2238,7 +2238,7 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const constexpr float insigma = 0.666f; //SD const float logmax = log(tempmax); //log Max const float rapX = (tempmean + sig * tempsig) / tempmax; //rapport between sD / max - constexpr float inx = log(insigma); + const float inx = log(insigma); const float iny = log(rapX); const float rap = inx / iny; //koef const float asig = 0.166f / (tempsig * sig); From fb72b6c62678118e0b88922c578a54afe7d6d1b1 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Fri, 26 Feb 2021 13:47:08 +0100 Subject: [PATCH 107/129] Keep original code, Optimizer will catch that --- rtengine/ipwavelet.cc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 07610d0d9..fe172c001 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -2203,12 +2203,13 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const Evaluate2(*LdecompLL, meang, meanNg, sigmag, sigmaNg, MaxPg, MaxNg, wavNestedLevels); Evaluate2(*Ldecompdst, mean, meanN, sigma, sigmaN, MaxP, MaxN, wavNestedLevels); constexpr float sig = 2.f; - /* original code for variable sig + + // original code for variable sig float k = sig; if (sig > 1.f) { k = SQR(sig); } - */ + float thr = 0.f; if (thrend < 0.02f) thr = 0.5f; else if (thrend < 0.1f) thr = 0.2f; @@ -2260,15 +2261,11 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const absciss = asig * tempwav + bsig; } else { absciss = amean * tempwav; - /* if (sig == 2.f) { // for sig = 2.f we can use a faster calculation because the exponent in this case is 0.25 - */ - absciss = 0.5f * std::sqrt(std::sqrt(absciss)); - /* original code for variable sig - } else { + absciss = 0.5f * std::sqrt(std::sqrt(absciss)); + } else { // original code for variable sig absciss = 0.5f * pow_F(absciss, 1.f / k); } - */ } float kc = wavguid.getVal(absciss) - 1.f; kc = kc < 0.f ? -SQR(kc) : kc; // approximation to simulate sliders denoise From 4f880b346a28fbcebf4788568f2c3506c6f3b98f Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Fri, 26 Feb 2021 14:19:52 +0100 Subject: [PATCH 108/129] add a cppcheck-suppress --- rtengine/ipwavelet.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index fe172c001..3eeba7a82 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -2206,6 +2206,7 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const // original code for variable sig float k = sig; + // cppcheck-suppress knownConditionTrueFalse if (sig > 1.f) { k = SQR(sig); } From 84d463fbb910b6733c1000ee9657ba13d8114dd4 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Fri, 26 Feb 2021 17:18:45 +0100 Subject: [PATCH 109/129] Segfault in wavelet/denoise, fixes #6140 --- rtengine/ipwavelet.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 4b65dd5bc..aaae1899f 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -1780,6 +1780,7 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const levwava = rtengine::min(maxlevelcrop, levwava); levwava = rtengine::min(maxlev2, levwava); + levwava = rtengine::min(levwav, levwava); if (settings->verbose) { printf("Leval decomp a=%i\n", levwava); } @@ -1833,6 +1834,7 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const levwavb = rtengine::min(maxlevelcrop, levwavb); levwavb = rtengine::min(maxlev2, levwavb); + levwavb = rtengine::min(levwav, levwavb); if (settings->verbose) { printf("Leval decomp b=%i\n", levwavb); From 8d32d59b33f5f72e13ba21501d364c9a86af4689 Mon Sep 17 00:00:00 2001 From: Thanatomanic <6567747+Thanatomanic@users.noreply.github.com> Date: Sat, 27 Feb 2021 07:49:57 +0100 Subject: [PATCH 110/129] Basic color support for Canon EOS 2000D in camconst.json Fixes #5495, but improvement possible --- rtengine/camconst.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rtengine/camconst.json b/rtengine/camconst.json index b2b8d70d1..ca3b4f7d9 100644 --- a/rtengine/camconst.json +++ b/rtengine/camconst.json @@ -1021,6 +1021,14 @@ Camera constants: ] } }, + + { // Quality C, samples provided by falket #5495 + "make_model": [ "Canon EOS 2000D", "Canon EOS Rebel T7", "Canon EOS Kiss X90" ], + // raw_crop is handled by dcraw + // "dcraw_matrix": [ 8532, -701, -1167, -4095, 11879, 2508, -797, 2424, 7010 ], // Adobe DNG v.10.3 + "dcraw_matrix": [ 8300, -2110, -1120, -4917, 12694, 2482, -938, 2141, 5666 ], // Adobe DNG v.10.3 (v2) + "ranges": { "white": 15300 } // typical value, very non-linear behavior near clipping + }, // Canon MILC (mirrorless interchangeable-lens camera) From a6a368e68227edff3fa72ea499556bef85df9160 Mon Sep 17 00:00:00 2001 From: Thanatomanic <6567747+Thanatomanic@users.noreply.github.com> Date: Sat, 27 Feb 2021 08:03:36 +0100 Subject: [PATCH 111/129] Allow resizing of navigator window. Patch by @Lawrence37. Fixes #6052 --- rtgui/editorpanel.cc | 34 ++++++++++++++++------------------ rtgui/editorpanel.h | 2 +- rtgui/history.cc | 2 +- rtgui/navigator.cc | 4 ++-- 4 files changed, 20 insertions(+), 22 deletions(-) diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 909b491f6..7553a7353 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -494,34 +494,32 @@ EditorPanel::EditorPanel (FilePanel* filePanel) // build left side panel leftbox = new Gtk::Paned (Gtk::ORIENTATION_VERTICAL); - // make a subbox to allow resizing of the histogram (if it's on the left) - leftsubbox = new Gtk::Box (Gtk::ORIENTATION_VERTICAL); - leftsubbox->set_size_request (230, 250); + // make a subpaned to allow resizing of the histogram (if it's on the left) + leftsubpaned = new Gtk::Paned(Gtk::ORIENTATION_VERTICAL); + leftsubpaned->set_size_request(230, 250); histogramPanel = nullptr; - profilep = Gtk::manage (new ProfilePanel ()); + profilep = Gtk::manage(new ProfilePanel()); ppframe = Gtk::manage(new Gtk::Frame()); ppframe->set_label_align(0.025, 0.5); ppframe->set_name ("ProfilePanel"); ppframe->add (*profilep); - ppframe->set_label (M ("PROFILEPANEL_LABEL")); - //leftsubbox->pack_start (*ppframe, Gtk::PACK_SHRINK, 4); + ppframe->set_label(M("PROFILEPANEL_LABEL")); + //leftsubpaned->pack_start (*ppframe, Gtk::PACK_SHRINK, 4); - navigator = Gtk::manage (new Navigator ()); - navigator->previewWindow->set_size_request (-1, 150 * RTScalable::getScale()); - leftsubbox->pack_start (*navigator, Gtk::PACK_SHRINK, 2); - - Gtk::Separator* historyseparator = Gtk::manage (new Gtk::Separator (Gtk::ORIENTATION_HORIZONTAL)); - leftsubbox->pack_start (*historyseparator, Gtk::PACK_SHRINK, 2); + navigator = Gtk::manage(new Navigator()); + navigator->previewWindow->set_size_request(-1, 150 * RTScalable::getScale()); + leftsubpaned->pack1(*navigator, false, false); - history = Gtk::manage (new History ()); - leftsubbox->pack_start (*history); + history = Gtk::manage(new History()); + leftsubpaned->pack2(*history, true, false); - leftsubbox->show_all (); + leftsubpaned->set_position(0); + leftsubpaned->show_all(); - leftbox->pack2 (*leftsubbox, true, true); - leftbox->show_all (); + leftbox->pack2(*leftsubpaned, true, true); + leftbox->show_all(); // build the middle of the screen Gtk::Box* editbox = Gtk::manage (new Gtk::Box (Gtk::ORIENTATION_VERTICAL)); @@ -905,7 +903,7 @@ EditorPanel::~EditorPanel () delete tpc; - delete leftsubbox; + delete leftsubpaned; delete leftbox; delete vsubboxright; delete vboxright; diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index e89689f0f..7675face5 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -224,7 +224,7 @@ private: Gtk::Image *iShowHideSidePanels_exit; Gtk::Image *iBeforeLockON, *iBeforeLockOFF; Gtk::Paned *leftbox; - Gtk::Box *leftsubbox; + Gtk::Paned *leftsubpaned; Gtk::Paned *vboxright; Gtk::Box *vsubboxright; diff --git a/rtgui/history.cc b/rtgui/history.cc index e30b3e8ce..dfc74af24 100644 --- a/rtgui/history.cc +++ b/rtgui/history.cc @@ -125,7 +125,7 @@ History::History (bool bookmarkSupport) : historyVPaned (nullptr), blistener (nu if (bookmarkSupport) { historyVPaned = Gtk::manage ( new Gtk::Paned (Gtk::ORIENTATION_VERTICAL) ); - historyVPaned->pack1 (*histFrame, true, true); + historyVPaned->pack1 (*histFrame, true, false); historyVPaned->pack2 (*bmFrame, false, false); pack_start (*historyVPaned); } else { diff --git a/rtgui/navigator.cc b/rtgui/navigator.cc index 4376162d7..42f605fa2 100644 --- a/rtgui/navigator.cc +++ b/rtgui/navigator.cc @@ -75,7 +75,7 @@ Navigator::Navigator() : set_name("Navigator"); Gtk::Box* mbox = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); previewWindow = Gtk::manage (new PreviewWindow ()); - mbox->pack_start (*previewWindow, Gtk::PACK_SHRINK, 2); + mbox->pack_start (*previewWindow, Gtk::PACK_EXPAND_WIDGET, 2); dimension = Gtk::manage (new Gtk::Label ()); mbox->pack_start (*dimension, Gtk::PACK_SHRINK, 2); position = Gtk::manage (new Gtk::Label ()); @@ -242,7 +242,7 @@ Navigator::Navigator() : table0->set_column_homogeneous(true); // all cells will have equal width - mbox->pack_start (*table0, Gtk::PACK_EXPAND_WIDGET, 2); + mbox->pack_start (*table0, Gtk::PACK_SHRINK, 2); add (*mbox); setInvalid (); From b58f643d59124a833f47a21f2420c100d7fd3fc5 Mon Sep 17 00:00:00 2001 From: Desmis Date: Sat, 27 Feb 2021 08:13:44 +0100 Subject: [PATCH 112/129] Local adjustments - Grain - various improvment - see issue #2460 (#6120) * Fixed bad behavior saturation issue 6117 * Reenable scalegr for grain * some changes to grain * Init lagrain * Various improvment GUI - gamma * Change basic - normal grain --- rtdata/languages/default | 6 ++++- rtengine/improcfun.h | 2 +- rtengine/ipgrain.cc | 49 +++++++++++++++++++++++++--------------- rtengine/iplocallab.cc | 4 ++-- rtengine/procevents.h | 1 + rtengine/procparams.cc | 6 ++++- rtengine/procparams.h | 1 + rtengine/refreshmap.cc | 3 ++- rtgui/locallabtools.cc | 29 +++++++++++++++++++++--- rtgui/locallabtools.h | 2 ++ rtgui/paramsedited.cc | 7 ++++++ rtgui/paramsedited.h | 1 + 12 files changed, 84 insertions(+), 27 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 54907f6f0..af4c031d1 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1283,6 +1283,7 @@ HISTORY_MSG_1035;Local - Nlmeans - detail HISTORY_MSG_1036;Local - Nlmeans - patch HISTORY_MSG_1037;Local - Nlmeans - radius HISTORY_MSG_1038;Local - Nlmeans - gamma +HISTORY_MSG_1039;Local - Grain - gamma HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance @@ -2623,6 +2624,7 @@ TP_LOCALLAB_DETAIL;Local contrast TP_LOCALLAB_DETAILFRA;Edge detection TP_LOCALLAB_DETAILSH;Details TP_LOCALLAB_DETAILTHR;Luminance & chroma detail threshold (DCT ƒ) +TP_LOCALLAB_DIVGR;Gamma TP_LOCALLAB_DUPLSPOTNAME;Copy TP_LOCALLAB_EDGFRA;Edge sharpness TP_LOCALLAB_EDGSHOW;Show all tools @@ -2713,6 +2715,8 @@ TP_LOCALLAB_GRADSTRHUE_TOOLTIP;Adjusts hue gradient strength TP_LOCALLAB_GRADSTRLUM;Luminance gradient strength TP_LOCALLAB_GRADSTR_TOOLTIP;Filter strength in stops TP_LOCALLAB_GRAINFRA;Film Grain 1:1 +TP_LOCALLAB_GRAINFRA2;Coarseness + TP_LOCALLAB_GRAIN_TOOLTIP;Adds film-like grain to the image TP_LOCALLAB_GRALWFRA;Graduated filter (local contrast) TP_LOCALLAB_GRIDFRAME_TOOLTIP;You can use this tool as a brush. Use small spot and adapt transition and transition decay\nOnly mode NORMAL and eventually Hue, Saturation, Color, Luminosity are concerned by Merge background (ΔE) @@ -2735,7 +2739,7 @@ TP_LOCALLAB_INVBL_TOOLTIP;Alternative to ‘Inverse’ mode: use two spots\nFirs TP_LOCALLAB_INVERS;Inverse TP_LOCALLAB_INVERS_TOOLTIP;Fewer possibilities if selected (Inverse).\n\nAlternative: use two spots\nFirst Spot:\n full image - delimiter outside preview\n RT-spot shape: rectangle. Transition 100\n\nSecond spot: Excluding spot TP_LOCALLAB_INVMASK;Inverse algorithm -TP_LOCALLAB_ISOGR;Coarseness (ISO) +TP_LOCALLAB_ISOGR;Distribution (ISO) TP_LOCALLAB_LABBLURM;Blur Mask TP_LOCALLAB_LABEL;Local Adjustments TP_LOCALLAB_LABGRID;Color correction grid diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 923a5e8db..0d915cf28 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -280,7 +280,7 @@ enum class BlurType { float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope, float balance, float balanceh, float lumask); //3 functions from Alberto Griggio, adapted J.Desmis 2019 - void filmGrain(Imagefloat *rgb, int isogr, int strengr, int scalegr, int bfw, int bfh); + void filmGrain(Imagefloat *rgb, int isogr, int strengr, int scalegr,float divgr, int bfw, int bfh); void log_encode(Imagefloat *rgb, struct local_params & lp, bool multiThread, int bfw, int bfh); void getAutoLogloc(int sp, ImageSource *imgsrc, float *sourceg, float *blackev, float *whiteev, bool *Autogr, float *sourceab, int fw, int fh, float xsta, float xend, float ysta, float yend, int SCALE); diff --git a/rtengine/ipgrain.cc b/rtengine/ipgrain.cc index b9079606a..d03a3ba33 100644 --- a/rtengine/ipgrain.cc +++ b/rtengine/ipgrain.cc @@ -24,6 +24,7 @@ /* This file is part of darktable, copyright (c) 2010-2012 Henrik Andersson. + adaptation to Rawtherapee 2021 Jacques Desmis jdesmis@gmail.com darktable is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -88,7 +89,7 @@ const int permutation[] class GrainEvaluator { public: - GrainEvaluator(int offset_x, int offset_y, int full_width, int full_height, double scale): + GrainEvaluator(int offset_x, int offset_y, int full_width, int full_height, double scale, float divgr): ox(offset_x), oy(offset_y), fw(full_width), @@ -96,18 +97,18 @@ public: scale(scale) { simplex_noise_init(); - constexpr float mb = 100.f; - evaluate_grain_lut(mb); + constexpr float mb = 100.f;// * divgr; + evaluate_grain_lut(mb, divgr); } - void operator()(int isogr, int strengr, int scalegr, Imagefloat *lab, bool multithread) + void operator()(int isogr, int strengr, int scalegr, float divgr, Imagefloat *lab, bool multithread) { const double strength = (strengr / 100.0); - const double octaves = 3; + const double octaves = 3.; const double wd = std::min(fw, fh); const double zoom = (1.0 + 8 * (double(isogr) / GRAIN_SCALE_FACTOR) / 100.0) / 800.0; const double s = std::max(scale / 3.0, 1.0) / (double(std::max(scalegr, 1)) / 100.0); - + // printf("s=%f \n", s); const int W = lab->getWidth(); const int H = lab->getHeight(); float **lab_L = lab->g.ptrs; @@ -298,29 +299,38 @@ private: return total; } - float paper_resp(float exposure, float mb, float gp) - { - const float delta = GRAIN_LUT_DELTA_MAX * expf((mb / 100.0f) * logf(GRAIN_LUT_DELTA_MIN)); + float paper_resp(float exposure, float mb, float gp, float divgr) + { + float dived = 1.f; + if(divgr > 1.8f) { + dived = 1.f + (divgr - 1.8f); + } + const float delta = dived * GRAIN_LUT_DELTA_MAX * expf((mb / 100.0f) * logf(GRAIN_LUT_DELTA_MIN / dived)); const float density = (1.0f + 2.0f * delta) / (1.0f + expf( (4.0f * gp * (0.5f - exposure)) / (1.0f + 2.0f * delta) )) - delta; return density; } - float paper_resp_inverse(float density, float mb, float gp) + float paper_resp_inverse(float density, float mb, float gp, float divgr) { - const float delta = GRAIN_LUT_DELTA_MAX * expf((mb / 100.0f) * logf(GRAIN_LUT_DELTA_MIN)); + float dived = 1.f; + if(divgr > 1.8f) { + dived = 1.f + (divgr - 1.8f); + } + const float delta = dived * GRAIN_LUT_DELTA_MAX * expf((mb / 100.0f) * logf(GRAIN_LUT_DELTA_MIN / dived)); const float exposure = -logf((1.0f + 2.0f * delta) / (density + delta) - 1.0f) * (1.0f + 2.0f * delta) / (4.0f * gp) + 0.5f; return exposure; } - void evaluate_grain_lut(const float mb) + void evaluate_grain_lut(const float mb, float divgr) { for(int i = 0; i < GRAIN_LUT_SIZE; i++) { for(int j = 0; j < GRAIN_LUT_SIZE; j++) { - const float gu = (float)i / (GRAIN_LUT_SIZE - 1) - 0.5; - const float l = (float)j / (GRAIN_LUT_SIZE - 1); - grain_lut[j * GRAIN_LUT_SIZE + i] = 32768.f * (paper_resp(gu + paper_resp_inverse(l, mb, GRAIN_LUT_PAPER_GAMMA), mb, GRAIN_LUT_PAPER_GAMMA) - l); + float gu = (float)i / (GRAIN_LUT_SIZE - 1) - 0.5; + float l = (float)j / (GRAIN_LUT_SIZE - 1); + float divg = divgr; //1.f + grain_lut[j * GRAIN_LUT_SIZE + i] = 32768.f * (paper_resp(gu + paper_resp_inverse(l, mb, divg * GRAIN_LUT_PAPER_GAMMA, divgr), mb, divg * GRAIN_LUT_PAPER_GAMMA, divgr) - l); } } } @@ -361,11 +371,14 @@ private: } // namespace -void ImProcFunctions::filmGrain(Imagefloat *rgb, int isogr, int strengr, int scalegr, int bfw, int bfh) +void ImProcFunctions::filmGrain(Imagefloat *rgb, int isogr, int strengr, int scalegr, float divgr, int bfw, int bfh) { + if (settings->verbose) { + printf("iso=%i strength=%i scale=%i gamma=%f\n", isogr, strengr, scalegr, divgr); + } - GrainEvaluator ge(0, 0, bfw, bfh, scale); - ge(isogr, strengr, scalegr, rgb, multiThread); + GrainEvaluator ge(0, 0, bfw, bfh, scale, divgr); + ge(isogr, strengr, scalegr, divgr, rgb, multiThread); } } // namespace rtengine diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 4eda9c71a..2e570c15e 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -11522,7 +11522,7 @@ void ImProcFunctions::Lab_Local( bool fft = params->locallab.spots.at(sp).fftwbl; int isogr = params->locallab.spots.at(sp).isogr; int scalegr = params->locallab.spots.at(sp).scalegr; - + float divgr = params->locallab.spots.at(sp).divgr; if (bfw >= mSP && bfh >= mSP) { @@ -11668,7 +11668,7 @@ void ImProcFunctions::Lab_Local( } - filmGrain(tmpImage, isogr, strengr, scalegr, wi, he); + filmGrain(tmpImage, isogr, strengr, scalegr, divgr, wi, he); for (int y = 0; y < he ; y++) { for (int x = 0; x < wi; x++) { diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 62dff74e3..3642b0582 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -1061,6 +1061,7 @@ enum ProcEventCode { Evlocallabnlpat = 1035, Evlocallabnlrad = 1036, Evlocallabnlgam = 1037, + Evlocallabdivgr = 1038, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index f4909cb10..0c66af8e2 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3330,7 +3330,8 @@ LocallabParams::LocallabSpot::LocallabSpot() : decayd(2.), isogr(400), strengr(0), - scalegr(80), + scalegr(100), + divgr(1.), epsbl(0), blMethod("blur"), chroMethod("lum"), @@ -4427,6 +4428,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && isogr == other.isogr && strengr == other.strengr && scalegr == other.scalegr + && divgr == other.divgr && epsbl == other.epsbl && blMethod == other.blMethod && chroMethod == other.chroMethod @@ -6067,6 +6069,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->isogr, "Locallab", "Isogr_" + index_str, spot.isogr, keyFile); saveToKeyfile(!pedited || spot_edited->strengr, "Locallab", "Strengr_" + index_str, spot.strengr, keyFile); saveToKeyfile(!pedited || spot_edited->scalegr, "Locallab", "Scalegr_" + index_str, spot.scalegr, keyFile); + saveToKeyfile(!pedited || spot_edited->divgr, "Locallab", "Divgr_" + index_str, spot.divgr, keyFile); saveToKeyfile(!pedited || spot_edited->epsbl, "Locallab", "Epsbl_" + index_str, spot.epsbl, keyFile); saveToKeyfile(!pedited || spot_edited->blMethod, "Locallab", "BlMethod_" + index_str, spot.blMethod, keyFile); saveToKeyfile(!pedited || spot_edited->chroMethod, "Locallab", "ChroMethod_" + index_str, spot.chroMethod, keyFile); @@ -7923,6 +7926,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Isogr_" + index_str, pedited, spot.isogr, spotEdited.isogr); assignFromKeyfile(keyFile, "Locallab", "Strengr_" + index_str, pedited, spot.strengr, spotEdited.strengr); assignFromKeyfile(keyFile, "Locallab", "Scalegr_" + index_str, pedited, spot.scalegr, spotEdited.scalegr); + assignFromKeyfile(keyFile, "Locallab", "Divgr_" + index_str, pedited, spot.divgr, spotEdited.divgr); assignFromKeyfile(keyFile, "Locallab", "Epsbl_" + index_str, pedited, spot.epsbl, spotEdited.epsbl); assignFromKeyfile(keyFile, "Locallab", "BlMethod_" + index_str, pedited, spot.blMethod, spotEdited.blMethod); assignFromKeyfile(keyFile, "Locallab", "ChroMethod_" + index_str, pedited, spot.chroMethod, spotEdited.chroMethod); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 1a215b3d0..8940b0172 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1235,6 +1235,7 @@ struct LocallabParams { int isogr; int strengr; int scalegr; + double divgr; int epsbl; Glib::ustring blMethod; // blur, med, guid Glib::ustring chroMethod; // lum, chr, all diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 1adb3853d..9f6ceb360 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -1064,7 +1064,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { AUTOEXP, // Evlocallabnldet AUTOEXP, // Evlocallabnlpat AUTOEXP, // Evlocallabnlrad - AUTOEXP // Evlocallabnlgam + AUTOEXP, // Evlocallabnlgam + AUTOEXP // Evlocallabdivgr }; diff --git a/rtgui/locallabtools.cc b/rtgui/locallabtools.cc index 15b9d2837..d7581c938 100644 --- a/rtgui/locallabtools.cc +++ b/rtgui/locallabtools.cc @@ -6215,9 +6215,11 @@ LocallabBlur::LocallabBlur(): radius(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RADIUS"), MINRAD, MAXRAD, 0.1, 1.5, nullptr, nullptr, &blurSlider2radius, &blurRadius2Slider))), strength(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRENGTH"), 0, 100, 1, 0))), grainFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRAINFRA")))), + grainFrame2(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRAINFRA2")))), isogr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_ISOGR"), 20, 6400, 1, 400))), strengr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRENGR"), 0, 100, 1, 0))), - scalegr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SCALEGR"), 0, 100, 1, 80))), + scalegr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SCALEGR"), 0, 100, 1, 100))), + divgr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DIVGR"), 0.2, 3., 0.1, 1.))), medMethod(Gtk::manage(new MyComboBoxText())), itera(Gtk::manage(new Adjuster(M("TP_DIRPYRDENOISE_MEDIAN_PASSES"), 1, 4, 1, 1))), guidbl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GUIDBL"), 0, 1000, 1, 0))), @@ -6337,12 +6339,14 @@ LocallabBlur::LocallabBlur(): strength->setAdjusterListener(this); grainFrame->set_label_align(0.025, 0.5); + grainFrame2->set_label_align(0.025, 0.5); isogr->setAdjusterListener(this); strengr->setAdjusterListener(this); scalegr->setAdjusterListener(this); + divgr->setAdjusterListener(this); medMethod->append(M("TP_LOCALLAB_MEDNONE")); medMethod->append(M("TP_DIRPYRDENOISE_TYPE_3X3")); @@ -6548,8 +6552,14 @@ LocallabBlur::LocallabBlur(): blnoisebox->pack_start(*fftwbl, Gtk::PACK_SHRINK, 0); blnoisebox->pack_start(*radius); blnoisebox->pack_start(*strength); + + ToolParamBlock* const grain2Box = Gtk::manage(new ToolParamBlock()); + grain2Box->pack_start(*isogr); + grain2Box->pack_start(*divgr); + grainFrame2->add(*grain2Box); + ToolParamBlock* const grainBox = Gtk::manage(new ToolParamBlock()); - grainBox->pack_start(*isogr); + grainBox->pack_start(*grainFrame2); grainBox->pack_start(*strengr); grainBox->pack_start(*scalegr); grainFrame->add(*grainBox); @@ -6957,6 +6967,7 @@ void LocallabBlur::read(const rtengine::procparams::ProcParams* pp, const Params isogr->setValue((double)spot.isogr); strengr->setValue((double)spot.strengr); scalegr->setValue((double)spot.scalegr); + divgr->setValue((double)spot.divgr); if (spot.medMethod == "none") { medMethod->set_active(0); @@ -7102,6 +7113,7 @@ void LocallabBlur::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped spot.isogr = isogr->getIntValue(); spot.strengr = strengr->getIntValue(); spot.scalegr = scalegr->getIntValue(); + spot.divgr = divgr->getValue(); if (medMethod->get_active_row_number() == 0) { spot.medMethod = "none"; @@ -7223,6 +7235,7 @@ void LocallabBlur::setDefaults(const rtengine::procparams::ProcParams* defParams isogr->setDefault((double)defSpot.isogr); strengr->setDefault((double)defSpot.strengr); scalegr->setDefault((double)defSpot.scalegr); + divgr->setDefault((double)defSpot.divgr); itera->setDefault((double)defSpot.itera); guidbl->setDefault((double)defSpot.guidbl); strbl->setDefault((double)defSpot.strbl); @@ -7311,6 +7324,13 @@ void LocallabBlur::adjusterChanged(Adjuster* a, double newval) } } + if (a == divgr) { + if (listener) { + listener->panelChanged(Evlocallabdivgr, + divgr->getTextValue() + " (" + escapeHtmlChars(spotName) + ")"); + } + } + if (a == itera) { if (listener) { listener->panelChanged(Evlocallabitera, @@ -7753,7 +7773,7 @@ void LocallabBlur::convertParamToSimple() disableListener(); invmask->set_active(defSpot.invmask); invmaskd->set_active(defSpot.invmaskd); - + scalegr->setValue(defSpot.scalegr); // Set hidden specific GUI widgets in Simple mode to default spot values showmaskblMethod->set_active(0); @@ -7825,6 +7845,7 @@ void LocallabBlur::updateGUIToMode(const modeType new_type) nlpat->hide(); nlrad->hide(); nlgam->hide(); + scalegr->hide(); break; case Normal: @@ -7848,6 +7869,7 @@ void LocallabBlur::updateGUIToMode(const modeType new_type) nlpat->show(); nlrad->hide(); nlgam->show(); + scalegr->show(); if (blMethod->get_active_row_number() == 2) { expdenoise2->show(); @@ -7913,6 +7935,7 @@ void LocallabBlur::updateGUIToMode(const modeType new_type) adjblur->show(); noisechrodetail->show(); usemask->show(); + scalegr->show(); expmaskbl->show(); strumaskbl->show(); diff --git a/rtgui/locallabtools.h b/rtgui/locallabtools.h index a86626e74..1e3a1c6fa 100644 --- a/rtgui/locallabtools.h +++ b/rtgui/locallabtools.h @@ -675,9 +675,11 @@ private: Adjuster* const radius; Adjuster* const strength; Gtk::Frame* const grainFrame; + Gtk::Frame* const grainFrame2; Adjuster* const isogr; Adjuster* const strengr; Adjuster* const scalegr; + Adjuster* const divgr; MyComboBoxText* const medMethod; Adjuster* const itera; Adjuster* const guidbl; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index a75fe8562..2e67b3121 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1308,6 +1308,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).isogr = locallab.spots.at(j).isogr && pSpot.isogr == otherSpot.isogr; locallab.spots.at(j).strengr = locallab.spots.at(j).strengr && pSpot.strengr == otherSpot.strengr; locallab.spots.at(j).scalegr = locallab.spots.at(j).scalegr && pSpot.scalegr == otherSpot.scalegr; + locallab.spots.at(j).divgr = locallab.spots.at(j).divgr && pSpot.divgr == otherSpot.divgr; locallab.spots.at(j).epsbl = locallab.spots.at(j).epsbl && pSpot.epsbl == otherSpot.epsbl; locallab.spots.at(j).blMethod = locallab.spots.at(j).blMethod && pSpot.blMethod == otherSpot.blMethod; locallab.spots.at(j).chroMethod = locallab.spots.at(j).chroMethod && pSpot.chroMethod == otherSpot.chroMethod; @@ -4200,6 +4201,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).scalegr = mods.locallab.spots.at(i).scalegr; } + if (locallab.spots.at(i).divgr) { + toEdit.locallab.spots.at(i).divgr = mods.locallab.spots.at(i).divgr; + } + if (locallab.spots.at(i).epsbl) { toEdit.locallab.spots.at(i).epsbl = mods.locallab.spots.at(i).epsbl; } @@ -6880,6 +6885,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : isogr(v), strengr(v), scalegr(v), + divgr(v), epsbl(v), blMethod(v), chroMethod(v), @@ -7451,6 +7457,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) isogr = v; strengr = v; scalegr = v; + divgr = v; epsbl = v; blMethod = v; chroMethod = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index ec1d9b8f4..e20f52200 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -643,6 +643,7 @@ public: bool isogr; bool strengr; bool scalegr; + bool divgr; bool epsbl; bool blMethod; bool chroMethod; From 966cbfe2768ba69d97d1d4cba0fd64b7f87ba348 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sun, 28 Feb 2021 10:40:59 +0100 Subject: [PATCH 113/129] speedup for a loop in wavelet code , #6143 --- rtengine/ipwavelet.cc | 161 ++++++++++++++++++------------------------ 1 file changed, 70 insertions(+), 91 deletions(-) diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 529c0bbd5..81659c4bc 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -1326,19 +1326,17 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const } } // } - if (execut && exitifzero) { + if (execut && exitifzero) { + StopWatch Stop1("levels loop"); for (int dir = 1; dir < 4; dir++) { for (int level = 0; level < levref; level++) { int Wlvl_L = Ldecomp->level_W(level); int Hlvl_L = Ldecomp->level_H(level); - float* const* WavCoeffs_L = Ldecomp->level_coeffs(level);//first decomp denoised - float* const* WavCoeffs_L2 = Ldecomp2->level_coeffs(level);//second decomp before denoise - int k4 = 3; - int k5 = 3; - if(cp.complex == 1){ - k4= 4; - k5= 5; - } + const float* const WavCoeffs_L = Ldecomp->level_coeffs(level)[dir];//first decomp denoised + const float* const WavCoeffs_L2 = Ldecomp2->level_coeffs(level)[dir];//second decomp before denoise + const int k4 = cp.complex == 1 ? 4 : 3; + const int k5 = cp.complex == 1 ? 5 : 3; + auto WavL0 = Ldecomp->level_coeffs(0)[dir]; auto WavL1 = Ldecomp->level_coeffs(1)[dir]; auto WavL2 = Ldecomp->level_coeffs(2)[dir]; @@ -1360,131 +1358,112 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const float tempmean = 0.f; float tempsig = 0.f; float tempmax = 0.f; + float weightL = 1.f; if(cp.mixmet == 0){ + weightL = 0.f; tempmean = mean[level]; tempsig = sigma[level]; tempmax = MaxP[level]; } else if(cp.mixmet == 1){ + weightL = 0.5f; tempmean = 0.5f * mean[level] + 0.5f * meand[level] ; tempsig = 0.5f * sigma[level] + 0.5f * sigmad[level] ; tempmax = 0.5f * MaxP[level] + 0.5f * MaxPd[level] ; } else if(cp.mixmet == 2){ + weightL = 0.7f; tempmean = 0.3f * mean[level] + 0.7f * meand[level] ; tempsig = 0.3f * sigma[level] + 0.7f * sigmad[level] ; tempmax = 0.3f * MaxP[level] + 0.7f * MaxPd[level] ; } else if(cp.mixmet == 3){ + weightL = 1.f; tempmean = meand[level]; tempsig = sigmad[level]; tempmax = MaxPd[level]; } if (MaxP[level] > 0.f && mean[level] != 0.f && sigma[level] != 0.f) { //curve - float insigma = 0.666f; //SD - float logmax = log(tempmax); //log Max + constexpr float insigma = 0.666f; //SD + const float logmax = log(tempmax); //log Max //cp.sigmm change the "wider" of sigma - float rapX = (tempmean + siglh[level] * tempsig) / (tempmax); //rapport between sD / max - float inx = log(insigma); - float iny = log(rapX); - float rap = inx / iny; //koef - float asig = 0.166f / (tempsig * siglh[level]); - float bsig = 0.5f - asig * tempmean; - float amean = 0.5f / (tempmean); + const float rapX = (tempmean + siglh[level] * tempsig) / tempmax; //rapport between sD / max + const float inx = log(insigma); + const float iny = log(rapX); + const float rap = inx / iny; //koef + const float asig = 0.166f / (tempsig * siglh[level]); + const float bsig = 0.5f - asig * tempmean; + const float amean = 1.f / tempmean; + + //equalizer for levels 0 1 and 3... 1.33 and 0.75 arbitrary values + float kcFactor = 1.f; + if(cp.denmet == 1) { + if(level == 0 || level == 3) { + kcFactor = 1.7f; + } + } else if(cp.denmet == 2) { + if(level == 0 || level == 3) { + kcFactor = 0.3f; + } + } else if(cp.denmet == 3) { + if(level == 0 || level == 1) { + kcFactor = 1.7f; + } + } else if(cp.denmet == 4) { + if(level == 0 || level == 1) { + kcFactor = 0.3f; + } + } + const float k = 1.f / siglh[level] > 1.f ? SQR(siglh[level]) : siglh[level]; + const float maxVal = tempmean + siglh[level] * tempsig; #ifdef _OPENMP - #pragma omp parallel for schedule(dynamic, Wlvl_L * 16) num_threads(wavNestedLevels) if (wavNestedLevels>1) + #pragma omp parallel for schedule(dynamic, Wlvl_L * 16) num_threads(wavNestedLevels) if (wavNestedLevels>1) #endif - for (int i = 0; i < Wlvl_L * Hlvl_L; i++) { float absciss; - float tempwav = 0.f; - if(cp.mixmet == 0){ - tempwav = WavCoeffs_L2[dir][i]; - } else if(cp.mixmet == 1){ - tempwav = 0.5f * WavCoeffs_L[dir][i] + 0.5f * WavCoeffs_L2[dir][i]; - } else if(cp.mixmet == 2){ - tempwav = 0.7f * WavCoeffs_L[dir][i] + 0.3f * WavCoeffs_L2[dir][i]; - } else if(cp.mixmet == 3){ - tempwav = WavCoeffs_L[dir][i]; + const float tempwav = std::fabs(intp(weightL, WavCoeffs_L[i], WavCoeffs_L2[i])); + + if (tempwav >= maxVal) { //for max + absciss = xexpf((xlogf(tempwav) - logmax) * rap); + } else if (tempwav >= tempmean) { + absciss = asig * tempwav + bsig; + } else { + absciss = 0.5f * pow_F(amean * tempwav, k); } - if (std::fabs(tempwav) >= (tempmean + siglh[level] * tempsig)) { //for max - float valcour = xlogf(std::fabs(tempwav)); - float valc = valcour - logmax; - float vald = valc * rap; - absciss = xexpf(vald); - } else if (std::fabs(tempwav) >= tempmean) { - absciss = asig * std::fabs(tempwav) + bsig; - } else { - absciss = amean * std::fabs(tempwav); - float k = siglh[level]; - if(siglh[level] > 1.f) { - k = SQR(siglh[level]); - } - float abs = pow(2.f * absciss, (1.f / k)); - absciss = 0.5f * abs; - } - float kc = 0.f; - if(cp.slimet == 0) { - kc = wavlow.getVal(absciss) -1.f; + float kc; + if (cp.slimet == 0) { + kc = wavlow.getVal(absciss) - 1.f; } else { kc = wavdenoise[absciss * 500.f] - 1.f; } - - float kchigh = 0.f; - kchigh = wavhigh.getVal(absciss) -1.f; - kchigh = -SQR(kchigh); - - float kcmed = 0.f; - kcmed = wavmed.getVal(absciss) -1.f; - kcmed = -SQR(kcmed); - - if(kc < 0) { - kc = -SQR(kc);//approximation to simulate sliders denoise + if (kc < 0) { + kc = -SQR(kc); //approximation to simulate sliders denoise } - //equalizer for levels 0 1 and 3... 1.33 and 0.75 arbitrary values - if(cp.denmet == 1) { - if(level == 0 || level == 3) { - kc *= 1.7f; - } - } else if(cp.denmet == 2) { - if(level == 0 || level == 3) { - kc *= 0.3f; - } - } else if(cp.denmet == 3) { - if(level == 0 || level == 1) { - kc *= 1.7f; - } - } else if(cp.denmet == 4) { - if(level == 0 || level == 1) { - kc *= 0.3f; - } - } - - float reduceeffect = kc <= 0.f ? 1.f : 1.2f;//1.2 allows to increase denoise (not used) + kc *= kcFactor; - float kinterm = 1.f + reduceeffect * kc; - kinterm = kinterm <= 0.f ? 0.01f : kinterm; - - float kintermhigh = 1.f + reduceeffect * kchigh; - kintermhigh = kintermhigh <= 0.f ? 0.01f : kintermhigh; + const float reduceeffect = kc <= 0.f ? 1.f : 1.2f; //1.2 allows to increase denoise (not used) - float kintermed = 1.f + reduceeffect * kcmed; - kintermed = kintermed <= 0.f ? 0.01f : kintermed; - - float kintermlow = kinterm; - if(level < 4) { + if (level < 4) { + float kintermlow = 1.f + reduceeffect * kc; + kintermlow = kintermlow <= 0.f ? 0.01f : kintermlow; WavL0[i] = WavL02[i] + (WavL0[i] - WavL02[i]) * kintermlow; WavL1[i] = WavL12[i] + (WavL1[i] - WavL12[i]) * kintermlow; WavL2[i] = WavL22[i] + (WavL2[i] - WavL22[i]) * kintermlow; WavL3[i] = WavL32[i] + (WavL3[i] - WavL32[i]) * kintermlow; } - if(cp.complex == 1){ - if(cp.limden > 0.f) { + if (cp.complex == 1){ + if (cp.limden > 0.f) { + const float kcmed = -SQR(wavmed.getVal(absciss) - 1.f); + float kintermed = 1.f + reduceeffect * kcmed; + kintermed = kintermed <= 0.f ? 0.01f : kintermed; WavL0[i] = WavL02[i] + (WavL0[i] - WavL02[i]) * kintermed; WavL1[i] = WavL12[i] + (WavL1[i] - WavL12[i]) * kintermed; WavL2[i] = WavL22[i] + (WavL2[i] - WavL22[i]) * kintermed; WavL3[i] = WavL32[i] + (WavL3[i] - WavL32[i]) * kintermed; } + const float kchigh = -SQR(wavhigh.getVal(absciss) - 1.f); + float kintermhigh = 1.f + reduceeffect * kchigh; + kintermhigh = kintermhigh <= 0.f ? 0.01f : kintermhigh; WavL4[i] = WavL42[i] + (WavL4[i] - WavL42[i]) * kintermhigh; WavL5[i] = WavL52[i] + (WavL5[i] - WavL52[i]) * kintermhigh; } From 09441c7e545c86dd8967dd741251db9f67fc1d4f Mon Sep 17 00:00:00 2001 From: Thanatomanic <6567747+Thanatomanic@users.noreply.github.com> Date: Sun, 28 Feb 2021 11:13:21 +0100 Subject: [PATCH 114/129] Correctly apply Local adjustments when loading a pp3 profile --- rtgui/profilepanel.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rtgui/profilepanel.cc b/rtgui/profilepanel.cc index c7e889b3f..a13c6421d 100644 --- a/rtgui/profilepanel.cc +++ b/rtgui/profilepanel.cc @@ -531,6 +531,9 @@ void ProfilePanel::load_clicked (GdkEventButton* event) if (!fillMode->get_active()) { *custom->pedited = pe; + } else { + // Resize custom->pedited to be compliant with pe spot size + custom->pedited->locallab.spots.resize(pe.locallab.spots.size(), LocallabParamsEdited::LocallabSpotEdited(true)); } } From 1f9a8b69a2ae1261127c42f8022b80e14fffbd4c Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sun, 28 Feb 2021 11:14:56 +0100 Subject: [PATCH 115/129] Clarify expression by adding parentheses, #6143 --- rtengine/ipwavelet.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 81659c4bc..a7b08adb1 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -1412,7 +1412,7 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const kcFactor = 0.3f; } } - const float k = 1.f / siglh[level] > 1.f ? SQR(siglh[level]) : siglh[level]; + const float k = 1.f / (siglh[level] > 1.f ? SQR(siglh[level]) : siglh[level]); const float maxVal = tempmean + siglh[level] * tempsig; #ifdef _OPENMP From d8515da4dd23a5f9160004229e21628423d1bdf9 Mon Sep 17 00:00:00 2001 From: Desmis Date: Sun, 28 Feb 2021 13:38:20 +0100 Subject: [PATCH 116/129] LA - Disable default avoid color shift - change needHH to true --- rtengine/iplocallab.cc | 2 +- rtengine/procparams.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 2e570c15e..cc14d968c 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -10497,7 +10497,7 @@ void ImProcFunctions::avoidcolshi(struct local_params& lp, int sp, LabImage * or {static_cast(wiprof[2][0]), static_cast(wiprof[2][1]), static_cast(wiprof[2][2])} }; const bool highlight = params->toneCurve.hrenabled; - const bool needHH = (lp.chro != 0.f); + const bool needHH = true; //always Munsell to avoid bad behavior //(lp.chro != 0.f); #ifdef _OPENMP #pragma omp parallel if (multiThread) #endif diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 0c66af8e2..7d146f0f2 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2778,7 +2778,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : transitgrad(0.0), hishow(false), activ(true), - avoid(true), + avoid(false), blwh(false), recurs(false), laplac(true), From 045bc1cd9a05fdda736e9105f0363840a933234d Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sun, 28 Feb 2021 14:16:20 +0100 Subject: [PATCH 117/129] Cleanup and removed stopwatch, #6143 --- rtengine/ipwavelet.cc | 37 ++++++++----------------------------- 1 file changed, 8 insertions(+), 29 deletions(-) diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index a7b08adb1..ec724133b 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -1327,11 +1327,10 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const } // } if (execut && exitifzero) { - StopWatch Stop1("levels loop"); for (int dir = 1; dir < 4; dir++) { for (int level = 0; level < levref; level++) { - int Wlvl_L = Ldecomp->level_W(level); - int Hlvl_L = Ldecomp->level_H(level); + const int Wlvl_L = Ldecomp->level_W(level); + const int Hlvl_L = Ldecomp->level_H(level); const float* const WavCoeffs_L = Ldecomp->level_coeffs(level)[dir];//first decomp denoised const float* const WavCoeffs_L2 = Ldecomp2->level_coeffs(level)[dir];//second decomp before denoise const int k4 = cp.complex == 1 ? 4 : 3; @@ -1355,32 +1354,12 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const } //find local contrast - float tempmean = 0.f; - float tempsig = 0.f; - float tempmax = 0.f; - float weightL = 1.f; - if(cp.mixmet == 0){ - weightL = 0.f; - tempmean = mean[level]; - tempsig = sigma[level]; - tempmax = MaxP[level]; - } else if(cp.mixmet == 1){ - weightL = 0.5f; - tempmean = 0.5f * mean[level] + 0.5f * meand[level] ; - tempsig = 0.5f * sigma[level] + 0.5f * sigmad[level] ; - tempmax = 0.5f * MaxP[level] + 0.5f * MaxPd[level] ; - } else if(cp.mixmet == 2){ - weightL = 0.7f; - tempmean = 0.3f * mean[level] + 0.7f * meand[level] ; - tempsig = 0.3f * sigma[level] + 0.7f * sigmad[level] ; - tempmax = 0.3f * MaxP[level] + 0.7f * MaxPd[level] ; - } else if(cp.mixmet == 3){ - weightL = 1.f; - tempmean = meand[level]; - tempsig = sigmad[level]; - tempmax = MaxPd[level]; - } - + constexpr float weights[4] = {0.f, 0.5f, 0.7f, 1.f}; + const float weightL = weights[rtengine::LIM(cp.mixmet, 0, 3)]; + const float tempmean = intp(weightL, meand[level], mean[level]); + const float tempsig = intp(weightL, sigmad[level], sigma[level]); + const float tempmax = intp(weightL, MaxPd[level], MaxP[level]); + if (MaxP[level] > 0.f && mean[level] != 0.f && sigma[level] != 0.f) { //curve constexpr float insigma = 0.666f; //SD const float logmax = log(tempmax); //log Max From 02a5040a602da90765321cbe2e1a1637a0727818 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sun, 28 Feb 2021 17:00:37 +0100 Subject: [PATCH 118/129] Undocumented search feature in exif tab can be annoying, fixes #6142 --- rtgui/exifpanel.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtgui/exifpanel.cc b/rtgui/exifpanel.cc index 6fc79d004..eeff0c8c7 100644 --- a/rtgui/exifpanel.cc +++ b/rtgui/exifpanel.cc @@ -42,7 +42,7 @@ ExifPanel::ExifPanel() : exifTree->set_headers_visible (false); exifTree->set_rules_hint (false); exifTree->set_reorderable (false); - exifTree->set_enable_search (true); + exifTree->set_enable_search (false); exifTree->get_selection()->set_mode (Gtk::SELECTION_MULTIPLE); scrolledWindow->set_shadow_type (Gtk::SHADOW_NONE); scrolledWindow->set_policy (Gtk::POLICY_ALWAYS, Gtk::POLICY_ALWAYS); From 68a6e02369e263062b8dd8f24ae469aeaea47a98 Mon Sep 17 00:00:00 2001 From: Stefan Wunsch Date: Mon, 1 Mar 2021 16:40:54 +0100 Subject: [PATCH 119/129] Fix some cmake build system issues (#6147) * [cmake] Switch to find_package for TIFF - Included in cmake 3.5 and later - Provides better configuration messages * Add missing TIFF library to rtgui and rtexif * Removed unnecessary quotes so that cmake sees the list as a list * Add OpenMP to rtengine if OpenMP is enabled --- CMakeLists.txt | 2 +- rtengine/CMakeLists.txt | 8 ++++++++ rtexif/CMakeLists.txt | 8 ++++---- rtgui/CMakeLists.txt | 4 ++++ 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2be1b6744..3b5dbc665 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -487,7 +487,7 @@ pkg_check_modules(LCMS REQUIRED lcms2>=2.6) pkg_check_modules(EXPAT REQUIRED expat>=2.1) pkg_check_modules(FFTW3F REQUIRED fftw3f) pkg_check_modules(IPTCDATA REQUIRED libiptcdata) -pkg_check_modules(TIFF REQUIRED libtiff-4>=4.0.4) +find_package(TIFF 4.0.4 REQUIRED) find_package(JPEG REQUIRED) find_package(PNG REQUIRED) find_package(ZLIB REQUIRED) diff --git a/rtengine/CMakeLists.txt b/rtengine/CMakeLists.txt index cb96daa03..ee575ae47 100644 --- a/rtengine/CMakeLists.txt +++ b/rtengine/CMakeLists.txt @@ -57,6 +57,10 @@ link_directories("${PROJECT_SOURCE_DIR}/rtexif" "${RSVG_LIBRARY_DIRS}" ) +if(OpenMP_FOUND) + include_directories(${OpenMP_CXX_INCLUDE_DIRS}) +endif() + set(CAMCONSTSFILE "camconst.json") set(RTENGINESOURCEFILES @@ -223,4 +227,8 @@ target_link_libraries(rtengine rtexif ${KLT_LIBRARIES} ) +if(OpenMP_FOUND) + target_link_libraries(rtengine ${OpenMP_CXX_LIBRARIES}) +endif() + install(FILES ${CAMCONSTSFILE} DESTINATION "${DATADIR}" PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ) diff --git a/rtexif/CMakeLists.txt b/rtexif/CMakeLists.txt index 836f832e2..e7ba81439 100644 --- a/rtexif/CMakeLists.txt +++ b/rtexif/CMakeLists.txt @@ -14,12 +14,12 @@ add_library(rtexif STATIC add_dependencies(rtexif UpdateInfo) if(WIN32) - include_directories(${EXTRA_INCDIR} ${GLIB2_INCLUDE_DIRS} ${GLIBMM_INCLUDE_DIRS} ${GTK_INCLUDE_DIRS} ${GTKMM_INCLUDE_DIRS}) - link_directories(. "${PROJECT_SOURCE_DIR}/rtexif" ${EXTRA_LIBDIR} ${GLIB2_LIBRARY_DIRS} ${GLIBMM_LIBRARY_DIRS} ${GTK_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS} ${LENSFUN_LIBRARY_DIRS}) + include_directories(${EXTRA_INCDIR} ${GLIB2_INCLUDE_DIRS} ${GLIBMM_INCLUDE_DIRS} ${GTK_INCLUDE_DIRS} ${GTKMM_INCLUDE_DIRS} ${TIFF_INCLUDE_DIRS}) + link_directories(. "${PROJECT_SOURCE_DIR}/rtexif" ${EXTRA_LIBDIR} ${GLIB2_LIBRARY_DIRS} ${GLIBMM_LIBRARY_DIRS} ${GTK_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS} ${LENSFUN_LIBRARY_DIRS} ${TIFF_LIBRARY_DIRS}) else() set_target_properties(rtexif PROPERTIES COMPILE_FLAGS " -fPIC") - include_directories("${EXTRA_INCDIR} ${GLIB2_INCLUDE_DIRS} ${GLIBMM_INCLUDE_DIRS} ${GTK_INCLUDE_DIRS} ${GTKMM_INCLUDE_DIRS}") - link_directories("${EXTRA_LIBDIR} ${GLIB2_LIBRARY_DIRS} ${GLIBMM_LIBRARY_DIRS} ${GTK_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS} ${LENSFUN_LIBRARY_DIRS}") + include_directories(${EXTRA_INCDIR} ${GLIB2_INCLUDE_DIRS} ${GLIBMM_INCLUDE_DIRS} ${GTK_INCLUDE_DIRS} ${GTKMM_INCLUDE_DIRS} ${TIFF_INCLUDE_DIRS}) + link_directories(${EXTRA_LIBDIR} ${GLIB2_LIBRARY_DIRS} ${GLIBMM_LIBRARY_DIRS} ${GTK_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS} ${LENSFUN_LIBRARY_DIRS} ${TIFF_LIBRARY_DIRS}) endif() include_directories(BEFORE "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/rtgui/CMakeLists.txt b/rtgui/CMakeLists.txt index 514204baf..5f8baed47 100644 --- a/rtgui/CMakeLists.txt +++ b/rtgui/CMakeLists.txt @@ -192,6 +192,7 @@ if(WIN32) ${GTK_INCLUDE_DIRS} ${LENSFUN_INCLUDE_DIRS} ${RSVG_INCLUDE_DIRS} + ${TIFF_INCLUDE_DIRS} ) link_directories(. "${PROJECT_SOURCE_DIR}/rtexif" ${EXTRA_LIBDIR} @@ -203,6 +204,7 @@ if(WIN32) ${GTK_LIBRARY_DIRS} ${LENSFUN_LIBRARY_DIRS} ${RSVG_LIBRARY_DIRS} + ${TIFF_LIBRARY_DIRS} ) else() include_directories(${EXTRA_INCDIR} @@ -221,6 +223,7 @@ else() ${LCMS_INCLUDE_DIRS} ${LENSFUN_INCLUDE_DIRS} ${RSVG_INCLUDE_DIRS} + ${TIFF_INCLUDE_DIRS} ) link_directories(${EXTRA_LIBDIR} ${CANBERRA-GTK_LIBRARY_DIRS} @@ -238,6 +241,7 @@ else() ${LCMS_LIBRARY_DIRS} ${LENSFUN_LIBRARY_DIRS} ${RSVG_LIBRARY_DIRS} + ${TIFF_LIBRARY_DIRS} ) endif() From 2366cb4935165a86e86be3c608548a48bd48fa39 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Mon, 1 Mar 2021 18:30:40 +0100 Subject: [PATCH 120/129] raw crop for Leica SL2-S --- rtengine/camconst.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rtengine/camconst.json b/rtengine/camconst.json index ca3b4f7d9..d0947cc69 100644 --- a/rtengine/camconst.json +++ b/rtengine/camconst.json @@ -1492,6 +1492,11 @@ Camera constants: "raw_crop": [ 0, 0, 0, -18 ] // 18 rows at bottom are garbage }, + { // Quality C, only raw crop + "make_model": "Leica SL2-S", + "raw_crop": [ 0, 2, 6024, 4042 ] // 2 rows at top and 4 rows at bottom are black + }, + { // Quality B, Matrix from ART "make_model" : "LEICA V-LUX 5", "dcraw_matrix" : [9803, -4185, -992, -4066, 12578, 1628, -838, 1824, 5288] From d92bbf59e18f0e98809b805c6e1c43c406ad5dcd Mon Sep 17 00:00:00 2001 From: Pandagrapher Date: Mon, 1 Mar 2021 21:04:08 +0100 Subject: [PATCH 121/129] Fixes #6148, allow using decimal key on numpad --- rtgui/guiutils.cc | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/rtgui/guiutils.cc b/rtgui/guiutils.cc index 601fa422c..b1ebf05e6 100644 --- a/rtgui/guiutils.cc +++ b/rtgui/guiutils.cc @@ -1172,6 +1172,7 @@ MySpinButton::MySpinButton () set_numeric(true); set_wrap(false); set_alignment(Gtk::ALIGN_END); + set_update_policy(Gtk::SpinButtonUpdatePolicy::UPDATE_IF_VALID); // Avoid updating text if input is not a numeric } void MySpinButton::updateSize() @@ -1204,19 +1205,16 @@ bool MySpinButton::on_key_press_event (GdkEventKey* event) double vMin, vMax; get_range(vMin, vMax); - if ( (event->string[0] >= 'a' && event->string[0] <= 'z') - || (event->string[0] >= 'A' && event->string[0] <= 'Z') - || event->string[0] == '+' || (event->string[0] == '-' && vMin >= 0) - || event->string[0] == '=' || event->string[0] == '_' - ) { - return false; + if (event->keyval == GDK_KEY_plus || (event->keyval == GDK_KEY_minus && vMin >= 0)) { + return true; // Event is not propagated further } else { - if(event->string[0] == ',') { - event->keyval = GDK_KEY_period; - event->string[0] = '.'; + if (event->keyval == GDK_KEY_comma || event->keyval == GDK_KEY_KP_Decimal) { + set_text(get_text() + "."); + set_position(get_text().length()); // When setting text, cursor position is reseted at text start. Avoiding this with this code + return true; // Event is not propagated further } - return Gtk::Widget::on_key_press_event(event); + return Gtk::SpinButton::on_key_press_event(event); // Event is propagated normally } } From 84751ad26f4644d383c2c7e95ee23469aafd2e33 Mon Sep 17 00:00:00 2001 From: Pandagrapher Date: Mon, 1 Mar 2021 21:38:35 +0100 Subject: [PATCH 122/129] Re-allow using RT shortcut while focused on adjuster --- rtgui/guiutils.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rtgui/guiutils.cc b/rtgui/guiutils.cc index b1ebf05e6..f415d770f 100644 --- a/rtgui/guiutils.cc +++ b/rtgui/guiutils.cc @@ -1205,8 +1205,11 @@ bool MySpinButton::on_key_press_event (GdkEventKey* event) double vMin, vMax; get_range(vMin, vMax); - if (event->keyval == GDK_KEY_plus || (event->keyval == GDK_KEY_minus && vMin >= 0)) { - return true; // Event is not propagated further + if ((event->keyval >= GDK_KEY_a && event->keyval <= GDK_KEY_z) + || (event->keyval >= GDK_KEY_A && event->keyval <= GDK_KEY_Z) + || event->keyval == GDK_KEY_equal || event->keyval == GDK_KEY_underscore + || event->keyval == GDK_KEY_plus || (event->keyval == GDK_KEY_minus && vMin >= 0)) { + return false; // Event is propagated further } else { if (event->keyval == GDK_KEY_comma || event->keyval == GDK_KEY_KP_Decimal) { set_text(get_text() + "."); From 02b86239db9400d7f5b1ab181fc699c59365233a Mon Sep 17 00:00:00 2001 From: Stefan Wunsch Date: Wed, 3 Mar 2021 18:35:19 +0100 Subject: [PATCH 123/129] [cmake] Enable native compilation on Apple M1 (#6152) --- ProcessorTargets.cmake | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ProcessorTargets.cmake b/ProcessorTargets.cmake index aa06b29ee..a752dceeb 100644 --- a/ProcessorTargets.cmake +++ b/ProcessorTargets.cmake @@ -6,7 +6,18 @@ set(PROC_TARGET_1_FLAGS "-mtune=generic" CACHE STRING "Processor-1 flags") # This second choice should be used for your own build only set(PROC_TARGET_2_LABEL native CACHE STRING "Processor-2 label - use it for your own build") -set(PROC_TARGET_2_FLAGS "-march=native" CACHE STRING "Processor-2 flags") + +# Get the architecture on an Apple system (x86 or arm64) +if(APPLE) + execute_process(COMMAND uname -m OUTPUT_VARIABLE APPLE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE) +endif() + +# On Apple's M1 processor and with Apple's clang compiler, the native flag is different +if(CMAKE_CXX_COMPILER_ID STREQUAL AppleClang AND APPLE_ARCHITECTURE STREQUAL arm64) + set(PROC_TARGET_2_FLAGS "-mcpu=native" CACHE STRING "Processor-2 flags") +else() + set(PROC_TARGET_2_FLAGS "-march=native" CACHE STRING "Processor-2 flags") +endif() # The later choices is intended to be used if you want to provide specific builds, but it should match your own processor # You can cross compile but you have to know what you're doing, this mechanism has not been designed for that From 0bf7c4e56c039e0f2b4fc5ec5f39608a2f6efca1 Mon Sep 17 00:00:00 2001 From: Desmis Date: Wed, 3 Mar 2021 18:49:55 +0100 Subject: [PATCH 124/129] Local adjustments - Added Guidedfilter to avoid color shift (#6149) * Added Guidedfilter to avoid color shift * Various improvment to avoid color shift * Small change to mint maxt * local adjustments avoid color shift: reduce memory usage by width * height * 8 byte if Soft Radius > 0 * Remove StopWatch * local adjustments avoid color shift: speedup for last loop * cleanups * one more cleanup * Added checkbox Munsell correction only - uniform perceptual lab * Refine some settings * Clean-up - other small refinement Co-authored-by: Ingo Weyrich --- rtdata/languages/default | 6 ++- rtengine/color.cc | 4 +- rtengine/improcfun.h | 2 +- rtengine/iplocallab.cc | 102 ++++++++++++++++++++++++++++++++++---- rtengine/procevents.h | 2 + rtengine/procparams.cc | 8 +++ rtengine/procparams.h | 2 + rtengine/refreshmap.cc | 4 +- rtgui/controlspotpanel.cc | 61 ++++++++++++++++++++++- rtgui/controlspotpanel.h | 8 +++ rtgui/locallab.cc | 8 +++ rtgui/paramsedited.cc | 14 ++++++ rtgui/paramsedited.h | 2 + 13 files changed, 208 insertions(+), 15 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index af4c031d1..4668b97b3 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1284,6 +1284,8 @@ HISTORY_MSG_1036;Local - Nlmeans - patch HISTORY_MSG_1037;Local - Nlmeans - radius HISTORY_MSG_1038;Local - Nlmeans - gamma HISTORY_MSG_1039;Local - Grain - gamma +HISTORY_MSG_1040;Local - Spot - soft radius +HISTORY_MSG_1041;Local - Spot - Munsell HISTORY_MSG_BLSHAPE;Blur by level HISTORY_MSG_BLURCWAV;Blur chroma HISTORY_MSG_BLURWAV;Blur luminance @@ -2421,7 +2423,7 @@ TP_ICM_WORKING_TRC_TOOLTIP;Only for built-in profiles. TP_IMPULSEDENOISE_LABEL;Impulse Noise Reduction TP_IMPULSEDENOISE_THRESH;Threshold TP_LABCURVE_AVOIDCOLORSHIFT;Avoid color shift -TP_LABCURVE_AVOIDCOLORSHIFT_TOOLTIP;Fit colors into gamut of the working color space and apply Munsell correction. +TP_LABCURVE_AVOIDCOLORSHIFT_TOOLTIP;Fit colors into gamut of the working color space and apply Munsell correction (Uniform Perceptual Lab). TP_LABCURVE_BRIGHTNESS;Lightness TP_LABCURVE_CHROMATICITY;Chromaticity TP_LABCURVE_CHROMA_TOOLTIP;To apply B&W toning, set Chromaticity to -100. @@ -2486,6 +2488,8 @@ TP_LOCALLAB_ARTIF;Shape detection TP_LOCALLAB_ARTIF_TOOLTIP;ΔE scope threshold increases the range of deltaE scope. High values are for very wide gamut images.\nIncreasing deltaE decay can improve shape detection, but can also reduce the scope. TP_LOCALLAB_AUTOGRAY;Auto mean luminance (Yb%) TP_LOCALLAB_AVOID;Avoid color shift +TP_LOCALLAB_AVOIDRAD;Soft radius +TP_LOCALLAB_AVOIDMUN;Munsell correction only TP_LOCALLAB_BALAN;ab-L balance (ΔE) TP_LOCALLAB_BALANEXP;Laplacian balance TP_LOCALLAB_BALANH;C-H balance (ΔE) diff --git a/rtengine/color.cc b/rtengine/color.cc index 11a94d1dc..3fcd44eb8 100644 --- a/rtengine/color.cc +++ b/rtengine/color.cc @@ -2183,7 +2183,6 @@ void Color::gamutLchonly (float HH, float &Lprov1, float &Chprov1, float &R, flo const float ClipLevel = 65535.0f; bool inGamut; float2 sincosval = xsincosf(HH); - do { inGamut = true; @@ -2351,7 +2350,8 @@ void Color::gamutLchonly (float HH, float2 sincosval, float &Lprov1, float &Chpr } } - Chprov1 *= higherCoef; // decrease the chromaticity value + Chprov1 *= higherCoef; // decrease the chromaticity value + if (Chprov1 <= 3.0f) { Lprov1 += lowerCoef; diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 0d915cf28..09b247b6e 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -251,7 +251,7 @@ enum class BlurType { int shortcu, bool delt, const float hueref, const float chromaref, const float lumaref, float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope, bool fftt, float blu_ma, float cont_ma, int indic); - void avoidcolshi(struct local_params& lp, int sp, LabImage * original, LabImage *transformed, int cy, int cx); + void avoidcolshi(struct local_params& lp, int sp, LabImage * original, LabImage *transformed, int cy, int cx, int sk); void deltaEforMask(float **rdE, int bfw, int bfh, LabImage* bufcolorig, const float hueref, const float chromaref, const float lumaref, float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope, float balance, float balanceh); diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index cc14d968c..5f9eb046b 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -10485,17 +10485,25 @@ void clarimerge(struct local_params& lp, float &mL, float &mC, bool &exec, LabIm } } -void ImProcFunctions::avoidcolshi(struct local_params& lp, int sp, LabImage * original, LabImage *transformed, int cy, int cx) +void ImProcFunctions::avoidcolshi(struct local_params& lp, int sp, LabImage * original, LabImage *transformed, int cy, int cx, int sk) { if (params->locallab.spots.at(sp).avoid && lp.islocal) { const float ach = lp.trans / 100.f; TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix(params->icm.workingProfile); - const float wip[3][3] = { - {static_cast(wiprof[0][0]), static_cast(wiprof[0][1]), static_cast(wiprof[0][2])}, - {static_cast(wiprof[1][0]), static_cast(wiprof[1][1]), static_cast(wiprof[1][2])}, - {static_cast(wiprof[2][0]), static_cast(wiprof[2][1]), static_cast(wiprof[2][2])} + const double wip[3][3] = {//improve precision with double + {wiprof[0][0], wiprof[0][1], wiprof[0][2]}, + {wiprof[1][0], wiprof[1][1], wiprof[1][2]}, + {wiprof[2][0], wiprof[2][1], wiprof[2][2]} }; + + const float softr = params->locallab.spots.at(sp).avoidrad;//max softr = 30 + const bool muns = params->locallab.spots.at(sp).avoidmun;//Munsell control with 200 LUT + //improve precision with mint and maxt + const float tr = std::min(2.f, softr); + const float mint = 0.15f - 0.06f * tr;//between 0.15f and 0.03f + const float maxt = 0.98f + 0.008f * tr;//between 0.98f and 0.996f + const bool highlight = params->toneCurve.hrenabled; const bool needHH = true; //always Munsell to avoid bad behavior //(lp.chro != 0.f); #ifdef _OPENMP @@ -10612,7 +10620,10 @@ void ImProcFunctions::avoidcolshi(struct local_params& lp, int sp, LabImage * or Color::pregamutlab(Lprov1, HH, chr); Chprov1 = rtengine::min(Chprov1, chr); - Color::gamutLchonly(sincosval, Lprov1, Chprov1, wip, highlight, 0.15f, 0.92f); + float R, G, B; + if(!muns) { + Color::gamutLchonly(HH, sincosval, Lprov1, Chprov1, R, G, B, wip, highlight, mint, maxt);//replace for best results + } transformed->L[y][x] = Lprov1 * 327.68f; transformed->a[y][x] = 327.68f * Chprov1 * sincosval.y; transformed->b[y][x] = 327.68f * Chprov1 * sincosval.x; @@ -10626,7 +10637,7 @@ void ImProcFunctions::avoidcolshi(struct local_params& lp, int sp, LabImage * or Color::AllMunsellLch(true, Lprov1, Lprov2, HH, Chprov, memChprov, correctionHue, correctlum); if (std::fabs(correctionHue) < 0.015f) { - HH += correctlum; // correct only if correct Munsell chroma very little. + HH += correctlum; // correct only if correct Munsell chroma very small. } sincosval = xsincosf(HH + correctionHue); @@ -10636,6 +10647,78 @@ void ImProcFunctions::avoidcolshi(struct local_params& lp, int sp, LabImage * or } } } + + //Guidedfilter to reduce artifacts in transitions + if (softr != 0.f) {//soft for L a b because we change color... + const float tmpblur = softr < 0.f ? -1.f / softr : 1.f + softr; + const int r1 = rtengine::max(6 / sk * tmpblur + 0.5f, 1); + const int r2 = rtengine::max(10 / sk * tmpblur + 0.5f, 1); + + constexpr float epsilmax = 0.005f; + constexpr float epsilmin = 0.00001f; + + constexpr float aepsil = (epsilmax - epsilmin) / 100.f; + constexpr float bepsil = epsilmin; + const float epsil = softr < 0.f ? 0.001f : aepsil * softr + bepsil; + + const int bw = transformed->W; + const int bh = transformed->H; + array2D ble(bw, bh); + array2D guid(bw, bh); + +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) if (multiThread) +#endif + + for (int y = 0; y < bh ; y++) { + for (int x = 0; x < bw; x++) { + ble[y][x] = transformed->L[y][x] / 32768.f; + guid[y][x] = original->L[y][x] / 32768.f; + } + } + rtengine::guidedFilter(guid, ble, ble, r2, 0.2f * epsil, multiThread); +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) if (multiThread) +#endif + for (int y = 0; y < bh; y++) { + for (int x = 0; x < bw; x++) { + transformed->L[y][x] = 32768.f * ble[y][x]; + } + } + + array2D &blechro = ble; // reuse buffer +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) if (multiThread) +#endif + + for (int y = 0; y < bh ; y++) { + for (int x = 0; x < bw; x++) { + blechro[y][x] = std::sqrt(SQR(transformed->b[y][x]) + SQR(transformed->a[y][x])) / 32768.f; + } + } + rtengine::guidedFilter(guid, blechro, blechro, r1, epsil, multiThread); + +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) if (multiThread) +#endif + for (int y = 0; y < bh; y++) { + for (int x = 0; x < bw; x++) { + const float Chprov1 = std::sqrt(SQR(transformed->a[y][x]) + SQR(transformed->b[y][x])); + float2 sincosval; + + if (Chprov1 == 0.0f) { + sincosval.y = 1.f; + sincosval.x = 0.0f; + } else { + sincosval.y = transformed->a[y][x] / Chprov1; + sincosval.x = transformed->b[y][x] / Chprov1; + } + + transformed->a[y][x] = 32768.f * blechro[y][x] * sincosval.y; + transformed->b[y][x] = 32768.f * blechro[y][x] * sincosval.x; + } + } + } } } @@ -11133,7 +11216,8 @@ void ImProcFunctions::Lab_Local( constexpr int del = 3; // to avoid crash with [loy - begy] and [lox - begx] and bfh bfw // with gtk2 [loy - begy-1] [lox - begx -1 ] and del = 1 struct local_params lp; calcLocalParams(sp, oW, oH, params->locallab, lp, prevDeltaE, llColorMask, llColorMaskinv, llExpMask, llExpMaskinv, llSHMask, llSHMaskinv, llvibMask, lllcMask, llsharMask, llcbMask, llretiMask, llsoftMask, lltmMask, llblMask, lllogMask, ll_Mask, locwavCurveden, locwavdenutili); - avoidcolshi(lp, sp, original, transformed, cy, cx); + + avoidcolshi(lp, sp, original, transformed, cy, cx, sk); const float radius = lp.rad / (sk * 1.4); //0 to 70 ==> see skip int levred; @@ -16207,7 +16291,7 @@ void ImProcFunctions::Lab_Local( //end common mask // Gamut and Munsell control - very important do not deactivated to avoid crash - avoidcolshi(lp, sp, original, transformed, cy, cx); + avoidcolshi(lp, sp, original, transformed, cy, cx, sk); } } diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 3642b0582..d1d0c1126 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -1062,6 +1062,8 @@ enum ProcEventCode { Evlocallabnlrad = 1036, Evlocallabnlgam = 1037, Evlocallabdivgr = 1038, + EvLocallabSpotavoidrad = 1039, + EvLocallabSpotavoidmun = 1040, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 7d146f0f2..91d141696 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2774,11 +2774,13 @@ LocallabParams::LocallabSpot::LocallabSpot() : balanh(1.0), colorde(5.0), colorscope(30.0), + avoidrad(0.7), transitweak(1.0), transitgrad(0.0), hishow(false), activ(true), avoid(false), + avoidmun(false), blwh(false), recurs(false), laplac(true), @@ -4194,11 +4196,13 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && balanh == other.balanh && colorde == other.colorde && colorscope == other.colorscope + && avoidrad == other.avoidrad && transitweak == other.transitweak && transitgrad == other.transitgrad && hishow == other.hishow && activ == other.activ && avoid == other.avoid + && avoidmun == other.avoidmun && blwh == other.blwh && recurs == other.recurs && laplac == other.laplac @@ -5835,11 +5839,13 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || spot_edited->balanh, "Locallab", "Balanh_" + index_str, spot.balanh, keyFile); saveToKeyfile(!pedited || spot_edited->colorde, "Locallab", "Colorde_" + index_str, spot.colorde, keyFile); saveToKeyfile(!pedited || spot_edited->colorscope, "Locallab", "Colorscope_" + index_str, spot.colorscope, keyFile); + saveToKeyfile(!pedited || spot_edited->avoidrad, "Locallab", "Avoidrad_" + index_str, spot.avoidrad, keyFile); saveToKeyfile(!pedited || spot_edited->transitweak, "Locallab", "Transitweak_" + index_str, spot.transitweak, keyFile); saveToKeyfile(!pedited || spot_edited->transitgrad, "Locallab", "Transitgrad_" + index_str, spot.transitgrad, keyFile); saveToKeyfile(!pedited || spot_edited->hishow, "Locallab", "Hishow_" + index_str, spot.hishow, keyFile); saveToKeyfile(!pedited || spot_edited->activ, "Locallab", "Activ_" + index_str, spot.activ, keyFile); saveToKeyfile(!pedited || spot_edited->avoid, "Locallab", "Avoid_" + index_str, spot.avoid, keyFile); + saveToKeyfile(!pedited || spot_edited->avoidmun, "Locallab", "Avoidmun_" + index_str, spot.avoidmun, keyFile); saveToKeyfile(!pedited || spot_edited->blwh, "Locallab", "Blwh_" + index_str, spot.blwh, keyFile); saveToKeyfile(!pedited || spot_edited->recurs, "Locallab", "Recurs_" + index_str, spot.recurs, keyFile); saveToKeyfile(!pedited || spot_edited->laplac, "Locallab", "Laplac_" + index_str, spot.laplac, keyFile); @@ -7651,11 +7657,13 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Balanh_" + index_str, pedited, spot.balanh, spotEdited.balanh); assignFromKeyfile(keyFile, "Locallab", "Colorde_" + index_str, pedited, spot.colorde, spotEdited.colorde); assignFromKeyfile(keyFile, "Locallab", "Colorscope_" + index_str, pedited, spot.colorscope, spotEdited.colorscope); + assignFromKeyfile(keyFile, "Locallab", "Avoidrad_" + index_str, pedited, spot.avoidrad, spotEdited.avoidrad); assignFromKeyfile(keyFile, "Locallab", "Transitweak_" + index_str, pedited, spot.transitweak, spotEdited.transitweak); assignFromKeyfile(keyFile, "Locallab", "Transitgrad_" + index_str, pedited, spot.transitgrad, spotEdited.transitgrad); assignFromKeyfile(keyFile, "Locallab", "Hishow_" + index_str, pedited, spot.hishow, spotEdited.hishow); assignFromKeyfile(keyFile, "Locallab", "Activ_" + index_str, pedited, spot.activ, spotEdited.activ); assignFromKeyfile(keyFile, "Locallab", "Avoid_" + index_str, pedited, spot.avoid, spotEdited.avoid); + assignFromKeyfile(keyFile, "Locallab", "Avoidmun_" + index_str, pedited, spot.avoidmun, spotEdited.avoidmun); assignFromKeyfile(keyFile, "Locallab", "Blwh_" + index_str, pedited, spot.blwh, spotEdited.blwh); assignFromKeyfile(keyFile, "Locallab", "Recurs_" + index_str, pedited, spot.recurs, spotEdited.recurs); assignFromKeyfile(keyFile, "Locallab", "Laplac_" + index_str, pedited, spot.laplac, spotEdited.laplac); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 8940b0172..fd8b6aebb 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1009,11 +1009,13 @@ struct LocallabParams { double balanh; double colorde; double colorscope; + double avoidrad; double transitweak; double transitgrad; bool hishow; bool activ; bool avoid; + bool avoidmun; bool blwh; bool recurs; bool laplac; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 9f6ceb360..8d91bdcd7 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -1065,7 +1065,9 @@ int refreshmap[rtengine::NUMOFEVENTS] = { AUTOEXP, // Evlocallabnlpat AUTOEXP, // Evlocallabnlrad AUTOEXP, // Evlocallabnlgam - AUTOEXP // Evlocallabdivgr + AUTOEXP, // Evlocallabdivgr + AUTOEXP, // EvLocallabSpotavoidrad + AUTOEXP // EvLocallabSpotavoidmun }; diff --git a/rtgui/controlspotpanel.cc b/rtgui/controlspotpanel.cc index 3fa325e0f..5450ba3ed 100644 --- a/rtgui/controlspotpanel.cc +++ b/rtgui/controlspotpanel.cc @@ -76,12 +76,14 @@ ControlSpotPanel::ControlSpotPanel(): balanh_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BALANH"), 0.2, 2.5, 0.1, 1.0, Gtk::manage(new RTImage("rawtherapee-logo-16.png")), Gtk::manage(new RTImage("circle-red-green-small.png"))))), colorde_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_COLORDE"), -15, 15, 2, 5, Gtk::manage(new RTImage("circle-blue-yellow-small.png")), Gtk::manage(new RTImage("circle-gray-green-small.png"))))), colorscope_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_COLORSCOPE"), 0., 100.0, 1., 30.))), + avoidrad_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_AVOIDRAD"), 0., 30.0, 0.1, 0.7))), scopemask_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SCOPEMASK"), 0, 100, 1, 60))), lumask_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LUMASK"), -50, 30, 1, 10, Gtk::manage(new RTImage("circle-yellow-small.png")), Gtk::manage(new RTImage("circle-gray-small.png")) ))), hishow_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_PREVSHOW")))), activ_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ACTIVSPOT")))), avoid_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_AVOID")))), + avoidmun_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_AVOIDMUN")))), blwh_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_BLWH")))), recurs_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_RECURS")))), laplac_(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_LAPLACC")))), @@ -354,6 +356,7 @@ ControlSpotPanel::ControlSpotPanel(): balanh_->setAdjusterListener(this); colorde_->setAdjusterListener(this); colorscope_->setAdjusterListener(this); + avoidrad_->setAdjusterListener(this); preview_->set_active(false); previewConn_ = preview_->signal_clicked().connect( @@ -393,7 +396,17 @@ ControlSpotPanel::ControlSpotPanel(): avoidConn_ = avoid_->signal_toggled().connect( sigc::mem_fun(*this, &ControlSpotPanel::avoidChanged)); - specCaseBox->pack_start(*avoid_); + avoidmunConn_ = avoidmun_->signal_toggled().connect( + sigc::mem_fun(*this, &ControlSpotPanel::avoidmunChanged)); + + Gtk::Frame* const avFrame = Gtk::manage(new Gtk::Frame()); + ToolParamBlock* const avbox = Gtk::manage(new ToolParamBlock()); + avFrame->set_label_align(0.025, 0.5); + avFrame->set_label_widget(*avoid_); + avbox->pack_start(*avoidrad_); + avbox->pack_start(*avoidmun_); + avFrame->add(*avbox); + specCaseBox->pack_start(*avFrame); blwhConn_ = blwh_->signal_toggled().connect( sigc::mem_fun(*this, &ControlSpotPanel::blwhChanged)); @@ -827,9 +840,11 @@ void ControlSpotPanel::load_ControlSpot_param() balanh_->setValue((double)row[spots_.balanh]); colorde_->setValue((double)row[spots_.colorde]); colorscope_->setValue((double)row[spots_.colorscope]); + avoidrad_->setValue((double)row[spots_.avoidrad]); hishow_->set_active(row[spots_.hishow]); activ_->set_active(row[spots_.activ]); avoid_->set_active(row[spots_.avoid]); + avoidmun_->set_active(row[spots_.avoidmun]); blwh_->set_active(row[spots_.blwh]); recurs_->set_active(row[spots_.recurs]); // laplac_->set_active(row[spots_.laplac]); @@ -1481,6 +1496,14 @@ void ControlSpotPanel::adjusterChanged(Adjuster* a, double newval) } } + if (a == avoidrad_) { + row[spots_.avoidrad] = avoidrad_->getValue(); + + if (listener) { + listener->panelChanged(EvLocallabSpotavoidrad, avoidrad_->getTextValue()); + } + } + if (a == scopemask_) { row[spots_.scopemask] = scopemask_->getIntValue(); @@ -1570,6 +1593,31 @@ void ControlSpotPanel::avoidChanged() } } +void ControlSpotPanel::avoidmunChanged() +{ + // printf("avoidmunChanged\n"); + + // Get selected control spot + const auto s = treeview_->get_selection(); + + if (!s->count_selected_rows()) { + return; + } + + const auto iter = s->get_selected(); + Gtk::TreeModel::Row row = *iter; + row[spots_.avoidmun] = avoidmun_->get_active(); + + // Raise event + if (listener) { + if (avoidmun_->get_active()) { + listener->panelChanged(EvLocallabSpotavoidmun, M("GENERAL_ENABLED")); + } else { + listener->panelChanged(EvLocallabSpotavoidmun, M("GENERAL_DISABLED")); + } + } +} + void ControlSpotPanel::activChanged() { // printf("activChanged\n"); @@ -1787,9 +1835,11 @@ void ControlSpotPanel::disableParamlistener(bool cond) balanh_->block(cond); colorde_->block(cond); colorscope_->block(cond); + avoidrad_->block(cond); hishowconn_.block(cond); activConn_.block(cond); avoidConn_.block(cond); + avoidmunConn_.block(cond); blwhConn_.block(cond); recursConn_.block(cond); laplacConn_.block(cond); @@ -1831,9 +1881,11 @@ void ControlSpotPanel::setParamEditable(bool cond) balanh_->set_sensitive(cond); colorde_->set_sensitive(cond); colorscope_->set_sensitive(cond); + avoidrad_->set_sensitive(cond); hishow_->set_sensitive(cond); activ_->set_sensitive(cond); avoid_->set_sensitive(cond); + avoidmun_->set_sensitive(cond); blwh_->set_sensitive(cond); recurs_->set_sensitive(cond); laplac_->set_sensitive(cond); @@ -2509,6 +2561,7 @@ ControlSpotPanel::SpotRow* ControlSpotPanel::getSpot(const int index) r->balanh = row[spots_.balanh]; r->colorde = row[spots_.colorde]; r->colorscope = row[spots_.colorscope]; + r->avoidrad = row[spots_.avoidrad]; r->transitweak = row[spots_.transitweak]; r->transitgrad = row[spots_.transitgrad]; r->scopemask = row[spots_.scopemask]; @@ -2516,6 +2569,7 @@ ControlSpotPanel::SpotRow* ControlSpotPanel::getSpot(const int index) r->hishow = row[spots_.hishow]; r->activ = row[spots_.activ]; r->avoid = row[spots_.avoid]; + r->avoidmun = row[spots_.avoidmun]; r->blwh = row[spots_.blwh]; r->recurs = row[spots_.recurs]; r->laplac = row[spots_.laplac]; @@ -2644,9 +2698,11 @@ void ControlSpotPanel::addControlSpot(SpotRow* newSpot) row[spots_.balanh] = newSpot->balanh; row[spots_.colorde] = newSpot->colorde; row[spots_.colorscope] = newSpot->colorscope; + row[spots_.avoidrad] = newSpot->avoidrad; row[spots_.hishow] = newSpot->hishow; row[spots_.activ] = newSpot->activ; row[spots_.avoid] = newSpot->avoid; + row[spots_.avoidmun] = newSpot->avoidmun; row[spots_.blwh] = newSpot->blwh; row[spots_.recurs] = newSpot->recurs; row[spots_.laplac] = newSpot->laplac; @@ -2717,6 +2773,7 @@ void ControlSpotPanel::setDefaults(const rtengine::procparams::ProcParams * defP balanh_->setDefault(defSpot.balanh); colorde_->setDefault(defSpot.colorde); colorscope_->setDefault(defSpot.colorscope); + avoidrad_->setDefault(defSpot.avoidrad); scopemask_->setDefault((double)defSpot.scopemask); lumask_->setDefault((double)defSpot.lumask); } @@ -2759,9 +2816,11 @@ ControlSpotPanel::ControlSpots::ControlSpots() add(balanh); add(colorde); add(colorscope); + add(avoidrad); add(hishow); add(activ); add(avoid); + add(avoidmun); add(blwh); add(recurs); add(laplac); diff --git a/rtgui/controlspotpanel.h b/rtgui/controlspotpanel.h index 5cbf19e69..2f92b9a77 100644 --- a/rtgui/controlspotpanel.h +++ b/rtgui/controlspotpanel.h @@ -75,9 +75,11 @@ public: double balanh; double colorde; double colorscope; + double avoidrad; bool hishow; bool activ; bool avoid; + bool avoidmun; bool blwh; bool recurs; bool laplac; @@ -249,6 +251,7 @@ private: void hishowChanged(); void activChanged(); void avoidChanged(); + void avoidmunChanged(); void blwhChanged(); void recursChanged(); void laplacChanged(); @@ -307,9 +310,11 @@ private: Gtk::TreeModelColumn balanh; Gtk::TreeModelColumn colorde; Gtk::TreeModelColumn colorscope; + Gtk::TreeModelColumn avoidrad; Gtk::TreeModelColumn hishow; Gtk::TreeModelColumn activ; Gtk::TreeModelColumn avoid; + Gtk::TreeModelColumn avoidmun; Gtk::TreeModelColumn blwh; Gtk::TreeModelColumn recurs; Gtk::TreeModelColumn laplac; @@ -394,6 +399,7 @@ private: Adjuster* const balanh_; Adjuster* const colorde_; Adjuster* const colorscope_; + Adjuster* const avoidrad_; Adjuster* const scopemask_; Adjuster* const lumask_; @@ -403,6 +409,8 @@ private: sigc::connection activConn_; Gtk::CheckButton* const avoid_; sigc::connection avoidConn_; + Gtk::CheckButton* const avoidmun_; + sigc::connection avoidmunConn_; Gtk::CheckButton* const blwh_; sigc::connection blwhConn_; Gtk::CheckButton* const recurs_; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 1b2dbf349..e1eca81c5 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -316,9 +316,11 @@ void Locallab::read(const rtengine::procparams::ProcParams* pp, const ParamsEdit r->balanh = pp->locallab.spots.at(i).balanh; r->colorde = pp->locallab.spots.at(i).colorde; r->colorscope = pp->locallab.spots.at(i).colorscope; + r->avoidrad = pp->locallab.spots.at(i).avoidrad; r->hishow = pp->locallab.spots.at(i).hishow; r->activ = pp->locallab.spots.at(i).activ; r->avoid = pp->locallab.spots.at(i).avoid; + r->avoidmun = pp->locallab.spots.at(i).avoidmun; r->blwh = pp->locallab.spots.at(i).blwh; r->recurs = pp->locallab.spots.at(i).recurs; r->laplac = true; //pp->locallab.spots.at(i).laplac; @@ -494,9 +496,11 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited r->balanh = newSpot->balanh; r->colorde = newSpot->colorde; r->colorscope = newSpot->colorscope; + r->avoidrad = newSpot->avoidrad; r->hishow = newSpot->hishow; r->activ = newSpot->activ; r->avoid = newSpot->avoid; + r->avoidmun = newSpot->avoidmun; r->blwh = newSpot->blwh; r->recurs = newSpot->recurs; r->laplac = newSpot->laplac; @@ -781,8 +785,10 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited r->balanh = newSpot->balanh; r->colorde = newSpot->colorde; r->colorscope = newSpot->colorscope; + r->avoidrad = newSpot->avoidrad; r->activ = newSpot->activ; r->avoid = newSpot->avoid; + r->avoidmun = newSpot->avoidmun; r->blwh = newSpot->blwh; r->recurs = newSpot->recurs; r->laplac = newSpot->laplac; @@ -931,9 +937,11 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pp->locallab.spots.at(pp->locallab.selspot).balanh = r->balanh; pp->locallab.spots.at(pp->locallab.selspot).colorde = r->colorde; pp->locallab.spots.at(pp->locallab.selspot).colorscope = r->colorscope; + pp->locallab.spots.at(pp->locallab.selspot).avoidrad = r->avoidrad; pp->locallab.spots.at(pp->locallab.selspot).hishow = r->hishow; pp->locallab.spots.at(pp->locallab.selspot).activ = r->activ; pp->locallab.spots.at(pp->locallab.selspot).avoid = r->avoid; + pp->locallab.spots.at(pp->locallab.selspot).avoidmun = r->avoidmun; pp->locallab.spots.at(pp->locallab.selspot).blwh = r->blwh; pp->locallab.spots.at(pp->locallab.selspot).recurs = r->recurs; pp->locallab.spots.at(pp->locallab.selspot).laplac = r->laplac; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 2e67b3121..452daa16d 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1078,11 +1078,13 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).balanh = locallab.spots.at(j).balanh && pSpot.balanh == otherSpot.balanh; locallab.spots.at(j).colorde = locallab.spots.at(j).colorde && pSpot.colorde == otherSpot.colorde; locallab.spots.at(j).colorscope = locallab.spots.at(j).colorscope && pSpot.colorscope == otherSpot.colorscope; + locallab.spots.at(j).avoidrad = locallab.spots.at(j).avoidrad && pSpot.avoidrad == otherSpot.avoidrad; locallab.spots.at(j).transitweak = locallab.spots.at(j).transitweak && pSpot.transitweak == otherSpot.transitweak; locallab.spots.at(j).transitgrad = locallab.spots.at(j).transitgrad && pSpot.transitgrad == otherSpot.transitgrad; locallab.spots.at(j).hishow = locallab.spots.at(j).hishow && pSpot.hishow == otherSpot.hishow; locallab.spots.at(j).activ = locallab.spots.at(j).activ && pSpot.activ == otherSpot.activ; locallab.spots.at(j).avoid = locallab.spots.at(j).avoid && pSpot.avoid == otherSpot.avoid; + locallab.spots.at(j).avoidmun = locallab.spots.at(j).avoidmun && pSpot.avoidmun == otherSpot.avoidmun; locallab.spots.at(j).blwh = locallab.spots.at(j).blwh && pSpot.blwh == otherSpot.blwh; locallab.spots.at(j).recurs = locallab.spots.at(j).recurs && pSpot.recurs == otherSpot.recurs; locallab.spots.at(j).laplac = locallab.spots.at(j).laplac && pSpot.laplac == otherSpot.laplac; @@ -3313,6 +3315,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).colorscope = mods.locallab.spots.at(i).colorscope; } + if (locallab.spots.at(i).avoidrad) { + toEdit.locallab.spots.at(i).avoidrad = mods.locallab.spots.at(i).avoidrad; + } + if (locallab.spots.at(i).transitweak) { toEdit.locallab.spots.at(i).transitweak = mods.locallab.spots.at(i).transitweak; } @@ -3333,6 +3339,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).avoid = mods.locallab.spots.at(i).avoid; } + if (locallab.spots.at(i).avoidmun) { + toEdit.locallab.spots.at(i).avoidmun = mods.locallab.spots.at(i).avoidmun; + } + if (locallab.spots.at(i).blwh) { toEdit.locallab.spots.at(i).blwh = mods.locallab.spots.at(i).blwh; } @@ -6659,11 +6669,13 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : balanh(v), colorde(v), colorscope(v), + avoidrad(v), transitweak(v), transitgrad(v), hishow(v), activ(v), avoid(v), + avoidmun(v), blwh(v), recurs(v), laplac(v), @@ -7227,11 +7239,13 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) balanh = v; colorde = v; colorscope = v; + avoidrad = v; transitweak = v; transitgrad = v; hishow = v; activ = v; avoid = v; + avoidmun = v; blwh = v; recurs = v; laplac = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index e20f52200..486d1ee6d 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -417,11 +417,13 @@ public: bool balanh; bool colorde; bool colorscope; + bool avoidrad; bool transitweak; bool transitgrad; bool hishow; bool activ; bool avoid; + bool avoidmun; bool blwh; bool recurs; bool laplac; From c448860b6a9aa33e56340a7b22f299e2a0d0d87b Mon Sep 17 00:00:00 2001 From: Desmis Date: Fri, 5 Mar 2021 08:02:25 +0100 Subject: [PATCH 125/129] LA change size label Shadows/highlights and Tone Equalizer --- rtdata/languages/default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 4668b97b3..3ac4a1fb6 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -3032,7 +3032,7 @@ TP_LOCALLAB_SH1;Shadows Highlights TP_LOCALLAB_SH2;Equalizer TP_LOCALLAB_SHADEX;Shadows TP_LOCALLAB_SHADEXCOMP;Shadow compression & tonal width -TP_LOCALLAB_SHADHIGH;Shadows/Highlights & Tone equalizer +TP_LOCALLAB_SHADHIGH;Shadows/Highlights & Equalizer TP_LOCALLAB_SHADHMASK_TOOLTIP;Lowers the highlights of the mask in the same way as the shadows/highlights algorithm TP_LOCALLAB_SHADMASK_TOOLTIP;Lifts the shadows of the mask in the same way as the shadows/highlights algorithm TP_LOCALLAB_SHADOWHIGHLIGHT_TOOLTIP;Adjust shadows and highlights either with shadows & highlights sliders or with a tone equalizer.\nCan be used instead of, or in conjunction with the Exposure module.\nCan also be used as a graduated filter. From 4583176d1b88ab930f3046ea74632b537d144610 Mon Sep 17 00:00:00 2001 From: Desmis Date: Fri, 5 Mar 2021 08:38:32 +0100 Subject: [PATCH 126/129] LA french - adjust label length --- rtdata/languages/Francais | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rtdata/languages/Francais b/rtdata/languages/Francais index 310dfcfd4..2c19d1377 100644 --- a/rtdata/languages/Francais +++ b/rtdata/languages/Francais @@ -1804,7 +1804,7 @@ TP_LOCALLAB_BUTTON_DEL;Effacer TP_LOCALLAB_BUTTON_DUPL;Dupliquer TP_LOCALLAB_BUTTON_REN;Renommer TP_LOCALLAB_BUTTON_VIS;Montrer/Cacher -TP_LOCALLAB_CBDL;Contraste par niveaux de détail +TP_LOCALLAB_CBDL;Contraste par niveaux détail TP_LOCALLAB_CBDLCLARI_TOOLTIP;Ajuste les tons moyens et les réhausse. TP_LOCALLAB_CBDL_ADJ_TOOLTIP;Agit comme un outil ondelettes.\nLe premier niveau (0) agit sur des détails de 2x2.\nLe dernier niveau (5) agit sur des détails de 64x64. TP_LOCALLAB_CBDL_THRES_TOOLTIP;Empêche d'augmenter le bruit @@ -1940,13 +1940,13 @@ TP_LOCALLAB_EXPLAP_TOOLTIP;Plus vous agissez sur ce curseur de seuil, plus grand TP_LOCALLAB_EXPMERGEFILE_TOOLTIP;Autorise de nombreuses possibilités de fusionner les images (comme les calques dans Photosshop) : difference, multiply, soft light, overlay...avec opacité...\nOriginale Image : fusionne le RT-spot en cours avec Originale.\nSpot Précédent : fusionne le RT-spot en cours avec le précédent - si il n'y a qu'un spot précédent = original.\nArrière plan : fusionne le RT-spot en cours avec la couleur et la luminance de l'arrière plan (moins de possibilités) TP_LOCALLAB_EXPMETHOD_TOOLTIP;Standard : utilise un algorithme similaire à Exposure principal mais en L*a*b* et en prenant en compte le deltaE.\n\nCompression dynamique et atténuateur de contraste : utilise un autre algorithme aussi avec deltaE et avec l'équation de Poisson pour résoudre le Laplacien dans l'espace de Fourier.\nAtténuateur, Compression dynamqiue et Standard peuvent être combinés.\nFFTW La transformée de Fourier est optimisée en taille pour réduire les temps de traitement.\nRéduit les artéfacts et le bruit. TP_LOCALLAB_EXPNOISEMETHOD_TOOLTIP;Applique un median avant la transformée de Laplace pour éviter les artéfacts (bruit).\nVous pouvez aussi utiliser l'outil "Réduction du bruit". -TP_LOCALLAB_EXPOSE;Compression dynamique & Exposition +TP_LOCALLAB_EXPOSE;Plage dynamique & Exposition TP_LOCALLAB_EXPOSURE_TOOLTIP;Modifie l'exposition dans l'espace L*a*b* en utilisant un Laplacien et les algorithmes PDE en prenant en compte dE, minimise les artéfacts. TP_LOCALLAB_EXPRETITOOLS;Outils Retinex avancés TP_LOCALLAB_EXPSHARP_TOOLTIP;RT-Spot minimum 39*39.\nUtiliser de basses valeurs de transition et de hautes valeurs de transition affaiblissement et Etendue pour simuler un petit RT-spot. TP_LOCALLAB_EXPTOOL;Outils exposition TP_LOCALLAB_EXPTRC;Courbe de réponse Tonale - TRC -TP_LOCALLAB_EXP_TOOLNAME;Compression Dynamique & Exposition- 10 +TP_LOCALLAB_EXP_TOOLNAME;Plage Dynamique & Exposition- 10 TP_LOCALLAB_FATAMOUNT;Quantité TP_LOCALLAB_FATANCHOR;Ancre TP_LOCALLAB_FATANCHORA;Décalage @@ -2254,7 +2254,7 @@ TP_LOCALLAB_RESIDHI;Hautes lumières TP_LOCALLAB_RESIDHITHR;Hautes lumières seuil TP_LOCALLAB_RESIDSHA;Ombres TP_LOCALLAB_RESIDSHATHR;Ombres seuil -TP_LOCALLAB_RETI;De-brume - Retinex Fort contraste +TP_LOCALLAB_RETI;De-brume - Retinex TP_LOCALLAB_RETIFRA;Retinex TP_LOCALLAB_RETIM;Original Retinex TP_LOCALLAB_RETITOOLFRA;Retinex Outils @@ -2294,7 +2294,7 @@ TP_LOCALLAB_SH1;Ombres Lumières TP_LOCALLAB_SH2;Egaliseur TP_LOCALLAB_SHADEX;Ombres TP_LOCALLAB_SHADEXCOMP;Compression ombres & profondeur tonale -TP_LOCALLAB_SHADHIGH;Ombres/Lumières - Egaliseur tonal +TP_LOCALLAB_SHADHIGH;Ombres/Lumières - Egaliseur TP_LOCALLAB_SHADOWHIGHLIGHT_TOOLTIP;Peut être utilisé - ou en complement - du module Exposition dans les cas difficiles.\nUtiliser réduction du bruit Denoise peut être nécessaire : éclaicir les ombres.\n\nPeut être utilisé comme un filtre gradué (augmenter Etendue) TP_LOCALLAB_SHAMASKCOL;Ombres TP_LOCALLAB_SHADMASK_TOOLTIP;Relève les ombres du masque de la même manière que l'algorithme "ombres/lumières" From 31641f94818d9436c870250271a2cdaba2a21cb8 Mon Sep 17 00:00:00 2001 From: Desmis Date: Fri, 5 Mar 2021 08:58:11 +0100 Subject: [PATCH 127/129] LA others change length labels english and french --- rtdata/languages/Francais | 4 ++-- rtdata/languages/default | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rtdata/languages/Francais b/rtdata/languages/Francais index 2c19d1377..874682492 100644 --- a/rtdata/languages/Francais +++ b/rtdata/languages/Francais @@ -2039,8 +2039,8 @@ TP_LOCALLAB_LOCCONT;Masque Flou TP_LOCALLAB_LOC_CONTRAST;Contraste Local & Ondelettes TP_LOCALLAB_LOC_CONTRASTPYR;Ψ Pyramide 1: TP_LOCALLAB_LOC_CONTRASTPYR2;Ψ Pyramide 2: -TP_LOCALLAB_LOC_CONTRASTPYR2LAB; Contr. par niveaux- Tone Mapping - Cont.Dir. -TP_LOCALLAB_LOC_CONTRASTPYRLAB; Filtre Gradué - Netteté bords - Flouter +TP_LOCALLAB_LOC_CONTRASTPYR2LAB; Contr. par niveaux- TM - Cont.Dir. +TP_LOCALLAB_LOC_CONTRASTPYRLAB; Filtre Gradué - Netteté bords - Flou TP_LOCALLAB_LOC_RESIDPYR;Image Residuelle TP_LOCALLAB_LOG;Codage log TP_LOCALLAB_LOG1FRA;Ajustements Image diff --git a/rtdata/languages/default b/rtdata/languages/default index 3ac4a1fb6..6c1520b4f 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2776,7 +2776,7 @@ TP_LOCALLAB_LOCCONT;Unsharp Mask TP_LOCALLAB_LOC_CONTRAST;Local Contrast & Wavelets TP_LOCALLAB_LOC_CONTRASTPYR;Ψ Pyramid 1: TP_LOCALLAB_LOC_CONTRASTPYR2;Ψ Pyramid 2: -TP_LOCALLAB_LOC_CONTRASTPYR2LAB; Contrast by level- Tone Mapping - Dir.Contrast +TP_LOCALLAB_LOC_CONTRASTPYR2LAB; Contrast by level - TM - D.Contrast TP_LOCALLAB_LOC_CONTRASTPYRLAB; Graduated Filter - Edge Sharpness - Blur TP_LOCALLAB_LOC_RESIDPYR;Residual image (Main) TP_LOCALLAB_LOG;Log Encoding From df9f33e44eb5d5e415d9a2364e2ef3f46a77e230 Mon Sep 17 00:00:00 2001 From: Desmis Date: Sat, 6 Mar 2021 08:22:50 +0100 Subject: [PATCH 128/129] LA - Others improvments length labels --- rtdata/languages/Francais | 2 +- rtdata/languages/default | 4 ++-- rtgui/locallabtools2.cc | 34 ++++++++++++++++++++++++++++++---- 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/rtdata/languages/Francais b/rtdata/languages/Francais index 874682492..6d9a06afb 100644 --- a/rtdata/languages/Francais +++ b/rtdata/languages/Francais @@ -2294,7 +2294,7 @@ TP_LOCALLAB_SH1;Ombres Lumières TP_LOCALLAB_SH2;Egaliseur TP_LOCALLAB_SHADEX;Ombres TP_LOCALLAB_SHADEXCOMP;Compression ombres & profondeur tonale -TP_LOCALLAB_SHADHIGH;Ombres/Lumières - Egaliseur +TP_LOCALLAB_SHADHIGH;Ombres/Lumières-Egaliseur TP_LOCALLAB_SHADOWHIGHLIGHT_TOOLTIP;Peut être utilisé - ou en complement - du module Exposition dans les cas difficiles.\nUtiliser réduction du bruit Denoise peut être nécessaire : éclaicir les ombres.\n\nPeut être utilisé comme un filtre gradué (augmenter Etendue) TP_LOCALLAB_SHAMASKCOL;Ombres TP_LOCALLAB_SHADMASK_TOOLTIP;Relève les ombres du masque de la même manière que l'algorithme "ombres/lumières" diff --git a/rtdata/languages/default b/rtdata/languages/default index 6c1520b4f..aaeabe7af 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2776,7 +2776,7 @@ TP_LOCALLAB_LOCCONT;Unsharp Mask TP_LOCALLAB_LOC_CONTRAST;Local Contrast & Wavelets TP_LOCALLAB_LOC_CONTRASTPYR;Ψ Pyramid 1: TP_LOCALLAB_LOC_CONTRASTPYR2;Ψ Pyramid 2: -TP_LOCALLAB_LOC_CONTRASTPYR2LAB; Contrast by level - TM - D.Contrast +TP_LOCALLAB_LOC_CONTRASTPYR2LAB; Contrast by level - TM - Directional contrast TP_LOCALLAB_LOC_CONTRASTPYRLAB; Graduated Filter - Edge Sharpness - Blur TP_LOCALLAB_LOC_RESIDPYR;Residual image (Main) TP_LOCALLAB_LOG;Log Encoding @@ -3032,7 +3032,7 @@ TP_LOCALLAB_SH1;Shadows Highlights TP_LOCALLAB_SH2;Equalizer TP_LOCALLAB_SHADEX;Shadows TP_LOCALLAB_SHADEXCOMP;Shadow compression & tonal width -TP_LOCALLAB_SHADHIGH;Shadows/Highlights & Equalizer +TP_LOCALLAB_SHADHIGH;Shadows/Highlights-Equalizer TP_LOCALLAB_SHADHMASK_TOOLTIP;Lowers the highlights of the mask in the same way as the shadows/highlights algorithm TP_LOCALLAB_SHADMASK_TOOLTIP;Lifts the shadows of the mask in the same way as the shadows/highlights algorithm TP_LOCALLAB_SHADOWHIGHLIGHT_TOOLTIP;Adjust shadows and highlights either with shadows & highlights sliders or with a tone equalizer.\nCan be used instead of, or in conjunction with the Exposure module.\nCan also be used as a graduated filter. diff --git a/rtgui/locallabtools2.cc b/rtgui/locallabtools2.cc index 523b0a3af..228b7da0a 100644 --- a/rtgui/locallabtools2.cc +++ b/rtgui/locallabtools2.cc @@ -2472,14 +2472,27 @@ LocallabContrast::LocallabContrast(): origlcConn = origlc->signal_toggled().connect(sigc::mem_fun(*this, &LocallabContrast::origlcChanged)); + Gtk::Box *TittleVBox; + TittleVBox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); + TittleVBox->set_spacing(2); + Gtk::Box* const LCTitleHBox = Gtk::manage(new Gtk::Box()); + Gtk::Box* const LCTitleHBox11 = Gtk::manage(new Gtk::Box()); Gtk::Label* const LCLabel = Gtk::manage(new Gtk::Label()); - LCLabel->set_markup(Glib::ustring("") + escapeHtmlChars(M("TP_LOCALLAB_LOC_CONTRASTPYR")) + Glib::ustring("") + escapeHtmlChars(M("TP_LOCALLAB_LOC_CONTRASTPYRLAB"))); + Gtk::Label* const LCLabel11 = Gtk::manage(new Gtk::Label()); + + LCLabel->set_markup(Glib::ustring("") + escapeHtmlChars(M("TP_LOCALLAB_LOC_CONTRASTPYR")) + Glib::ustring("")); + LCLabel11->set_markup(escapeHtmlChars(M("TP_LOCALLAB_LOC_CONTRASTPYRLAB"))); LCLabel->set_alignment(Gtk::ALIGN_START, Gtk::ALIGN_CENTER); + LCLabel11->set_alignment(Gtk::ALIGN_START, Gtk::ALIGN_CENTER); LCTitleHBox->pack_start(*LCLabel, Gtk::PACK_EXPAND_WIDGET, 0); - expcontrastpyr->setLabel(LCTitleHBox); + LCTitleHBox11->pack_start(*LCLabel11, Gtk::PACK_EXPAND_WIDGET, 0); + TittleVBox->pack_start(*LCTitleHBox, Gtk::PACK_SHRINK); + TittleVBox->pack_start(*LCTitleHBox11, Gtk::PACK_SHRINK); + expcontrastpyr->setLabel(TittleVBox); setExpandAlignProperties(expcontrastpyr, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); + wavgradlConn = wavgradl->signal_toggled().connect(sigc::mem_fun(*this, &LocallabContrast::wavgradlChanged)); sigmalc2->setAdjusterListener(this); @@ -2549,12 +2562,25 @@ LocallabContrast::LocallabContrast(): blurlcConn = blurlc->signal_toggled().connect(sigc::mem_fun(*this, &LocallabContrast::blurlcChanged)); + Gtk::Box *TittleVBox2; + TittleVBox2 = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); + TittleVBox2->set_spacing(2); + Gtk::Box* const LCTitleHBox2 = Gtk::manage(new Gtk::Box()); + Gtk::Box* const LCTitleHBox22 = Gtk::manage(new Gtk::Box()); Gtk::Label* const LCLabel2 = Gtk::manage(new Gtk::Label()); - LCLabel2->set_markup(Glib::ustring("") + escapeHtmlChars(M("TP_LOCALLAB_LOC_CONTRASTPYR2")) + Glib::ustring("") + escapeHtmlChars(M("TP_LOCALLAB_LOC_CONTRASTPYR2LAB"))); + Gtk::Label* const LCLabel22 = Gtk::manage(new Gtk::Label()); + + LCLabel2->set_markup(Glib::ustring("") + escapeHtmlChars(M("TP_LOCALLAB_LOC_CONTRASTPYR2")) + Glib::ustring("")); + LCLabel22->set_markup(escapeHtmlChars(M("TP_LOCALLAB_LOC_CONTRASTPYR2LAB"))); LCLabel2->set_alignment(Gtk::ALIGN_START, Gtk::ALIGN_CENTER); + LCLabel22->set_alignment(Gtk::ALIGN_START, Gtk::ALIGN_CENTER); LCTitleHBox2->pack_start(*LCLabel2, Gtk::PACK_EXPAND_WIDGET, 0); - expcontrastpyr2->setLabel(LCTitleHBox2); + LCTitleHBox22->pack_start(*LCLabel22, Gtk::PACK_EXPAND_WIDGET, 0); + TittleVBox2->pack_start(*LCTitleHBox2, Gtk::PACK_SHRINK); + TittleVBox2->pack_start(*LCTitleHBox22, Gtk::PACK_SHRINK); + expcontrastpyr2->setLabel(TittleVBox2); + setExpandAlignProperties(expcontrastpyr2, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); wavcontConn = wavcont->signal_toggled().connect(sigc::mem_fun(*this, &LocallabContrast::wavcontChanged)); From 47b1804034d3928e874abdc4a85d8e3c5686ac43 Mon Sep 17 00:00:00 2001 From: Stefan Wunsch Date: Sat, 6 Mar 2021 12:37:44 +0100 Subject: [PATCH 129/129] [cmake] Enable mcpu=native for all Arm processors (#6156) --- ProcessorTargets.cmake | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/ProcessorTargets.cmake b/ProcessorTargets.cmake index a752dceeb..b22cfc839 100644 --- a/ProcessorTargets.cmake +++ b/ProcessorTargets.cmake @@ -7,13 +7,8 @@ set(PROC_TARGET_1_FLAGS "-mtune=generic" CACHE STRING "Processor-1 flags") # This second choice should be used for your own build only set(PROC_TARGET_2_LABEL native CACHE STRING "Processor-2 label - use it for your own build") -# Get the architecture on an Apple system (x86 or arm64) -if(APPLE) - execute_process(COMMAND uname -m OUTPUT_VARIABLE APPLE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE) -endif() - -# On Apple's M1 processor and with Apple's clang compiler, the native flag is different -if(CMAKE_CXX_COMPILER_ID STREQUAL AppleClang AND APPLE_ARCHITECTURE STREQUAL arm64) +# The flag is different on x86 and Arm based processors +if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL arm64) set(PROC_TARGET_2_FLAGS "-mcpu=native" CACHE STRING "Processor-2 flags") else() set(PROC_TARGET_2_FLAGS "-march=native" CACHE STRING "Processor-2 flags")