diff --git a/rtdata/languages/default b/rtdata/languages/default index 72a76a75a..0d87f7677 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -752,6 +752,7 @@ HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift HISTORY_MSG_RAW_BORDER;Raw border HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling +HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light HISTORY_MSG_SOFTLIGHT_STRENGTH;Soft light - Strength diff --git a/rtengine/CMakeLists.txt b/rtengine/CMakeLists.txt index 3cbfed183..759316e33 100644 --- a/rtengine/CMakeLists.txt +++ b/rtengine/CMakeLists.txt @@ -127,6 +127,7 @@ set(RTENGINESOURCEFILES xtrans_demosaic.cc vng4_demosaic_RT.cc ipsoftlight.cc + guidedfilter.cc ) if(LENSFUN_HAS_LOAD_DIRECTORY) diff --git a/rtengine/LUT.h b/rtengine/LUT.h index 15ae988e3..d2f758689 100644 --- a/rtengine/LUT.h +++ b/rtengine/LUT.h @@ -89,8 +89,7 @@ using LUTd = LUT; using LUTuc = LUT; template -class LUT : - public rtengine::NonCopyable +class LUT { protected: // list of variables ordered to improve cache speed @@ -198,6 +197,8 @@ public: } } + explicit LUT(const LUT&) = delete; + void setClip(int flags) { clip = flags; @@ -225,7 +226,7 @@ public: return size > 0 ? upperBound : 0; } - LUT & operator=(LUT &rhs) + LUT & operator=(const LUT& rhs) { if (this != &rhs) { if (rhs.size > this->size) { @@ -257,7 +258,7 @@ public: // handy to sum up per thread histograms. #pragma omp simd speeds up the loop by about factor 3 for LUTu (uint32_t). template::value>::type> - LUT & operator+=(LUT &rhs) + LUT & operator+=(const LUT& rhs) { if (rhs.size == this->size) { #ifdef _OPENMP diff --git a/rtengine/array2D.h b/rtengine/array2D.h index 25d644c85..48a789bf8 100644 --- a/rtengine/array2D.h +++ b/rtengine/array2D.h @@ -267,11 +267,11 @@ public: ar_realloc(w, h); memcpy(data, copy, w * h * sizeof(T)); } - int width() + int width() const { return x; } - int height() + int height() const { return y; } diff --git a/rtengine/boxblur.h b/rtengine/boxblur.h index 805575b77..71452ceae 100644 --- a/rtengine/boxblur.h +++ b/rtengine/boxblur.h @@ -35,6 +35,8 @@ namespace rtengine 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; diff --git a/rtengine/camconst.json b/rtengine/camconst.json index fdaaeef92..37c42350d 100644 --- a/rtengine/camconst.json +++ b/rtengine/camconst.json @@ -1578,6 +1578,13 @@ Camera constants: "ranges": { "white": 3980 } // 12-bit files. }, + { // Quality C, only colour matrix and PDAF lines info + "make_model" : "Nikon Z 7", + "dcraw_matrix" : [10405,-3755,-1270,-5461,13787,1793,-1040,2015,6785], // Adobe DNG Converter 11.0 ColorMatrix2 + "pdaf_pattern" : [0, 12], + "pdaf_offset" : 29 + }, + { // Quality B, 16Mp and 64Mp raw frames "make_model": "OLYMPUS E-M5MarkII", "dcraw_matrix": [ 9422,-3258,-711,-2655,10898,2015,-512,1354,5512 ], // DNG_v8.8 D65 diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 002747070..3b1ebfdab 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -139,10 +139,10 @@ void Crop::update(int todo) // give possibility to the listener to modify crop window (as the full image dimensions are already known at this point) int wx, wy, ww, wh, ws; - bool overrideWindow = false; + const bool overrideWindow = cropImageListener; - if (cropImageListener) { - overrideWindow = cropImageListener->getWindow(wx, wy, ww, wh, ws); + if (overrideWindow) { + cropImageListener->getWindow(wx, wy, ww, wh, ws); } // re-allocate sub-images and arrays if their dimensions changed diff --git a/rtengine/ex1simple.cc b/rtengine/ex1simple.cc index 921ee6e44..ddaa89177 100644 --- a/rtengine/ex1simple.cc +++ b/rtengine/ex1simple.cc @@ -21,11 +21,11 @@ //#include #include -class PListener : public rtengine::ProgressListener +class PListener : + public rtengine::ProgressListener { - public: - void setProgressStr (Glib::ustring str) + void setProgressStr(const Glib::ustring& str) { std::cout << str << std::endl; } @@ -33,11 +33,16 @@ public: { std::cout << p << std::endl; } + void setProgressState(bool inProcessing) + { + } + void error(const Glib::ustring& descr) + { + } }; int main (int argc, char* argv[]) { - if (argc < 4) { std::cout << "Usage: rtcmd " << std::endl; exit(1); diff --git a/rtengine/guidedfilter.cc b/rtengine/guidedfilter.cc new file mode 100644 index 000000000..f6b702a73 --- /dev/null +++ b/rtengine/guidedfilter.cc @@ -0,0 +1,195 @@ +/* -*- C++ -*- + * + * This file is part of RawTherapee. + * + * Copyright (c) 2018 Alberto Griggio + * + * 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 . + */ + +/** + * This is a Fast Guided Filter implementation, derived directly from the + * pseudo-code of the paper: + * + * Fast Guided Filter + * by Kaiming He, Jian Sun + * + * available at https://arxiv.org/abs/1505.00996 + */ + +#include "guidedfilter.h" +#include "boxblur.h" +#include "rescale.h" +#include "imagefloat.h" + +namespace rtengine { + +#if 0 +# define DEBUG_DUMP(arr) \ + do { \ + Imagefloat im(arr.width(), arr.height()); \ + const char *out = "/tmp/" #arr ".tif"; \ + for (int y = 0; y < im.getHeight(); ++y) { \ + for (int x = 0; x < im.getWidth(); ++x) { \ + im.r(y, x) = im.g(y, x) = im.b(y, x) = arr[y][x] * 65535.f; \ + } \ + } \ + im.saveTIFF(out, 16); \ + } while (false) +#else +# define DEBUG_DUMP(arr) +#endif + + +void guidedFilter(const array2D &guide, const array2D &src, array2D &dst, int r, float epsilon, bool multithread, int subsampling) +{ + const int W = src.width(); + const int H = src.height(); + + enum Op { MUL, DIVEPSILON, ADD, SUB, ADDMUL, SUBMUL }; + + const auto apply = + [=](Op op, array2D &res, const array2D &a, const array2D &b, const array2D &c=array2D()) -> void + { + const int w = res.width(); + const int h = res.height(); + +#ifdef _OPENMP + #pragma omp parallel for if (multithread) +#endif + for (int y = 0; y < h; ++y) { + for (int x = 0; x < w; ++x) { + float r; + float aa = a[y][x]; + float bb = b[y][x]; + switch (op) { + case MUL: + r = aa * bb; + break; + case DIVEPSILON: + r = aa / (bb + epsilon); + break; + case ADD: + r = aa + bb; + break; + case SUB: + r = aa - bb; + break; + case ADDMUL: + r = aa * bb + c[y][x]; + break; + case SUBMUL: + r = c[y][x] - (aa * bb); + break; + default: + assert(false); + r = 0; + break; + } + res[y][x] = r; + } + } + }; + + // use the terminology of the paper (Algorithm 2) + const array2D &I = guide; + const array2D &p = src; + array2D &q = dst; + + const auto f_mean = + [](array2D &d, array2D &s, int rad) -> void + { + rad = LIM(rad, 0, (min(s.width(), s.height()) - 1) / 2 - 1); + boxblur(s, d, rad, rad, s.width(), s.height()); + }; + + const auto f_subsample = + [=](array2D &d, const array2D &s) -> void + { + rescaleBilinear(s, d, multithread); + }; + + const auto f_upsample = f_subsample; + + const int w = W / subsampling; + const int h = H / subsampling; + + array2D I1(w, h); + array2D p1(w, h); + + f_subsample(I1, I); + f_subsample(p1, p); + + DEBUG_DUMP(I); + DEBUG_DUMP(p); + DEBUG_DUMP(I1); + DEBUG_DUMP(p1); + + float r1 = float(r) / subsampling; + + array2D meanI(w, h); + f_mean(meanI, I1, r1); + DEBUG_DUMP(meanI); + + array2D meanp(w, h); + f_mean(meanp, p1, r1); + DEBUG_DUMP(meanp); + + array2D &corrIp = p1; + apply(MUL, corrIp, I1, p1); + f_mean(corrIp, corrIp, r1); + DEBUG_DUMP(corrIp); + + array2D &corrI = I1; + apply(MUL, corrI, I1, I1); + f_mean(corrI, corrI, r1); + DEBUG_DUMP(corrI); + + array2D &varI = corrI; + apply(SUBMUL, varI, meanI, meanI, corrI); + DEBUG_DUMP(varI); + + array2D &covIp = corrIp; + apply(SUBMUL, covIp, meanI, meanp, corrIp); + DEBUG_DUMP(covIp); + + array2D &a = varI; + apply(DIVEPSILON, a, covIp, varI); + DEBUG_DUMP(a); + + array2D &b = covIp; + apply(SUBMUL, b, a, meanI, meanp); + DEBUG_DUMP(b); + + array2D &meana = a; + f_mean(meana, a, r1); + DEBUG_DUMP(meana); + + array2D &meanb = b; + f_mean(meanb, b, r1); + DEBUG_DUMP(meanb); + + array2D meanA(W, H); + f_upsample(meanA, meana); + DEBUG_DUMP(meanA); + + array2D &meanB = q; + f_upsample(meanB, meanb); + DEBUG_DUMP(meanB); + + apply(ADDMUL, q, meanA, I, meanB); + DEBUG_DUMP(q); +} + +} // namespace rtengine diff --git a/rtgui/mountselectionlistener.h b/rtengine/guidedfilter.h similarity index 69% rename from rtgui/mountselectionlistener.h rename to rtengine/guidedfilter.h index 73728dfd9..3f987f80e 100644 --- a/rtgui/mountselectionlistener.h +++ b/rtengine/guidedfilter.h @@ -1,7 +1,8 @@ -/* +/* -*- C++ -*- + * * This file is part of RawTherapee. * - * Copyright (c) 2004-2010 Gabor Horvath + * Copyright (c) 2018 Alberto Griggio * * RawTherapee is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,16 +17,13 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _MOUNTSELECTIONLISTENER_ -#define _MOUNTSELECTIONLISTENER_ -#include +#pragma once -class MountSelectionListener -{ +#include "array2D.h" -public: - virtual void mountSelectionChanged (Glib::ustring mountRoot) {} -}; +namespace rtengine { -#endif +void guidedFilter(const array2D &guide, const array2D &src, array2D &dst, int r, float epsilon, bool multithread, int subsampling=4); + +} // namespace rtengine diff --git a/rtengine/ipshadowshighlights.cc b/rtengine/ipshadowshighlights.cc index 4d5cc465a..ff56c84ac 100644 --- a/rtengine/ipshadowshighlights.cc +++ b/rtengine/ipshadowshighlights.cc @@ -22,6 +22,7 @@ #include "gauss.h" #include "sleef.c" #include "opthelper.h" +#include "guidedfilter.h" namespace rtengine { @@ -33,11 +34,32 @@ void ImProcFunctions::shadowsHighlights(LabImage *lab) const int width = lab->W; const int height = lab->H; + const bool lab_mode = params->sh.lab; array2D mask(width, height); - const float sigma = params->sh.radius * 5.f / scale; - LUTf f(32768); + array2D L(width, height); + const float radius = float(params->sh.radius) * 10 / scale; + LUTf f(lab_mode ? 32768 : 65536); + TMatrix ws = ICCStore::getInstance()->workingSpaceMatrix(params->icm.workingProfile); + TMatrix iws = ICCStore::getInstance()->workingSpaceInverseMatrix(params->icm.workingProfile); + + const auto rgb2lab = + [&](float R, float G, float B, float &l, float &a, float &b) -> void + { + float x, y, z; + Color::rgbxyz(R, G, B, x, y, z, ws); + Color::XYZ2Lab(x, y, z, l, a, b); + }; + + const auto lab2rgb = + [&](float l, float a, float b, float &R, float &G, float &B) -> void + { + float x, y, z; + Color::Lab2XYZ(l, a, b, x, y, z); + Color::xyz2rgb(x, y, z, R, G, B, iws); + }; + const auto apply = [&](int amount, int tonalwidth, bool hl) -> void { @@ -45,27 +67,24 @@ void ImProcFunctions::shadowsHighlights(LabImage *lab) const float scale = hl ? (thresh > 0.f ? 0.9f / thresh : 1.f) : thresh * 0.9f; #ifdef _OPENMP - #pragma omp parallel if (multiThread) + #pragma omp parallel for if (multiThread) #endif - { - -#ifdef _OPENMP - #pragma omp for -#endif - for (int y = 0; y < height; ++y) { - for (int x = 0; x < width; ++x) { - float l = lab->L[y][x]; - if (hl) { - mask[y][x] = (l > thresh) ? 1.f : pow4(l * scale); - } else { - mask[y][x] = l <= thresh ? 1.f : pow4(scale / l); - } + for (int y = 0; y < height; ++y) { + for (int x = 0; x < width; ++x) { + float l = lab->L[y][x]; + float l1 = l / 32768.f; + if (hl) { + mask[y][x] = (l > thresh) ? 1.f : pow4(l * scale); + L[y][x] = 1.f - l1; + } else { + mask[y][x] = l <= thresh ? 1.f : pow4(scale / l); + L[y][x] = l1; } } - - gaussianBlur(mask, mask, width, height, sigma); } + guidedFilter(L, mask, mask, radius, 0.075, multiThread, 4); + const float base = std::pow(4.f, float(amount)/100.f); const float gamma = hl ? base : 1.f / base; @@ -80,35 +99,55 @@ void ImProcFunctions::shadowsHighlights(LabImage *lab) }); if(!hl) { + if (lab_mode) { #ifdef _OPENMP - #pragma omp parallel for if (multiThread) + #pragma omp parallel for if (multiThread) #endif - for (int l = 0; l < 32768; ++l) { - auto base = pow_F(l / 32768.f, gamma); - // get a bit more contrast in the shadows - base = sh_contrast.getVal(base); - f[l] = base * 32768.f; + for (int l = 0; l < 32768; ++l) { + auto base = pow_F(l / 32768.f, gamma); + // get a bit more contrast in the shadows + base = sh_contrast.getVal(base); + f[l] = base * 32768.f; + } + } else { +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + for (int c = 0; c < 65536; ++c) { + float l, a, b; + float R = c, G = c, B = c; + rgb2lab(R, G, B, l, a, b); + auto base = pow_F(l / 32768.f, gamma); + // get a bit more contrast in the shadows + base = sh_contrast.getVal(base); + l = base * 32768.f; + lab2rgb(l, a, b, R, G, B); + f[c] = G; + } } } else { -#ifdef __SSE2__ - vfloat c32768v = F2V(32768.f); - vfloat lv = _mm_setr_ps(0,1,2,3); - vfloat fourv = F2V(4.f); - vfloat gammav = F2V(gamma); - for (int l = 0; l < 32768; l += 4) { - vfloat basev = pow_F(lv / c32768v, gammav); - STVFU(f[l], basev * c32768v); - lv += fourv; - } -#else + if (lab_mode) { #ifdef _OPENMP - #pragma omp parallel for if (multiThread) + #pragma omp parallel for if (multiThread) #endif - for (int l = 0; l < 32768; ++l) { - auto base = pow_F(l / 32768.f, gamma); - f[l] = base * 32768.f; + for (int l = 0; l < 32768; ++l) { + auto base = pow_F(l / 32768.f, gamma); + f[l] = base * 32768.f; + } + } else { +#ifdef _OPENMP + #pragma omp parallel for if (multiThread) +#endif + for (int c = 0; c < 65536; ++c) { + float l, a, b; + float R = c, G = c, B = c; + rgb2lab(R, G, B, l, a, b); + auto base = pow_F(l / 32768.f, gamma); + l = base * 32768.f; + lab2rgb(l, a, b, R, G, B); + f[c] = G; + } } -#endif } #ifdef _OPENMP @@ -117,17 +156,26 @@ void ImProcFunctions::shadowsHighlights(LabImage *lab) for (int y = 0; y < height; ++y) { for (int x = 0; x < width; ++x) { float l = lab->L[y][x]; - float blend = mask[y][x]; + float blend = LIM01(mask[y][x]); float orig = 1.f - blend; if (l >= 0.f && l < 32768.f) { - lab->L[y][x] = f[l] * blend + l * orig; - if (!hl && l > 1.f) { - // when pushing shadows, scale also the chromaticity - float s = max(lab->L[y][x] / l * 0.5f, 1.f) * blend; - float a = lab->a[y][x]; - float b = lab->b[y][x]; - lab->a[y][x] = a * s + a * orig; - lab->b[y][x] = b * s + b * orig; + if (lab_mode) { + lab->L[y][x] = f[l] * blend + l * orig; + if (!hl && l > 1.f) { + // when pushing shadows, scale also the chromaticity + float s = max(lab->L[y][x] / l * 0.5f, 1.f) * blend; + float a = lab->a[y][x]; + float b = lab->b[y][x]; + lab->a[y][x] = a * s + a * orig; + lab->b[y][x] = b * s + b * orig; + } + } else { + float rgb[3]; + lab2rgb(l, lab->a[y][x], lab->b[y][x], rgb[0], rgb[1], rgb[2]); + for (int i = 0; i < 3; ++i) { + rgb[i] = f[rgb[i]] * blend + rgb[i] * orig; + } + rgb2lab(rgb[0], rgb[1], rgb[2], lab->L[y][x], lab->a[y][x], lab->b[y][x]); } } } @@ -135,11 +183,11 @@ void ImProcFunctions::shadowsHighlights(LabImage *lab) }; if (params->sh.highlights > 0) { - apply(params->sh.highlights, params->sh.htonalwidth, true); + apply(params->sh.highlights * 0.7, params->sh.htonalwidth, true); } if (params->sh.shadows > 0) { - apply(params->sh.shadows, params->sh.stonalwidth, false); + apply(params->sh.shadows * 0.6, params->sh.stonalwidth, false); } } diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index f8df8ee63..526a36765 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -1501,7 +1501,8 @@ SHParams::SHParams() : htonalwidth(70), shadows(0), stonalwidth(30), - radius(40) + radius(40), + lab(false) { } @@ -1513,7 +1514,8 @@ bool SHParams::operator ==(const SHParams& other) const && htonalwidth == other.htonalwidth && shadows == other.shadows && stonalwidth == other.stonalwidth - && radius == other.radius; + && radius == other.radius + && lab == other.lab; } bool SHParams::operator !=(const SHParams& other) const @@ -3094,6 +3096,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->sh.shadows, "Shadows & Highlights", "Shadows", sh.shadows, keyFile); saveToKeyfile(!pedited || pedited->sh.stonalwidth, "Shadows & Highlights", "ShadowTonalWidth", sh.stonalwidth, keyFile); saveToKeyfile(!pedited || pedited->sh.radius, "Shadows & Highlights", "Radius", sh.radius, keyFile); + saveToKeyfile(!pedited || pedited->sh.lab, "Shadows & Highlights", "Lab", sh.lab, keyFile); // Crop saveToKeyfile(!pedited || pedited->crop.enabled, "Crop", "Enabled", crop.enabled, keyFile); @@ -4028,6 +4031,11 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Shadows & Highlights", "Shadows", pedited, sh.shadows, pedited->sh.shadows); assignFromKeyfile(keyFile, "Shadows & Highlights", "ShadowTonalWidth", pedited, sh.stonalwidth, pedited->sh.stonalwidth); assignFromKeyfile(keyFile, "Shadows & Highlights", "Radius", pedited, sh.radius, pedited->sh.radius); + if (ppVersion >= 344) { + assignFromKeyfile(keyFile, "Shadows & Highlights", "Lab", pedited, sh.lab, pedited->sh.lab); + } else { + sh.lab = true; + } if (keyFile.has_key("Shadows & Highlights", "LocalContrast") && ppVersion < 329) { int lc = keyFile.get_integer("Shadows & Highlights", "LocalContrast"); @@ -4843,7 +4851,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "RAW Bayer", "DCBEnhance", pedited, raw.bayersensor.dcb_enhance, pedited->raw.bayersensor.dcbEnhance); assignFromKeyfile(keyFile, "RAW Bayer", "LMMSEIterations", pedited, raw.bayersensor.lmmse_iterations, pedited->raw.bayersensor.lmmseIterations); assignFromKeyfile(keyFile, "RAW Bayer", "DualDemosaicAutoContrast", pedited, raw.bayersensor.dualDemosaicAutoContrast, pedited->raw.bayersensor.dualDemosaicAutoContrast); - if (ppVersion < 344) { + if (ppVersion < 345) { raw.bayersensor.dualDemosaicAutoContrast = false; if (pedited) { pedited->raw.bayersensor.dualDemosaicAutoContrast = true; @@ -4897,7 +4905,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) if (keyFile.has_group("RAW X-Trans")) { assignFromKeyfile(keyFile, "RAW X-Trans", "Method", pedited, raw.xtranssensor.method, pedited->raw.xtranssensor.method); assignFromKeyfile(keyFile, "RAW X-Trans", "DualDemosaicAutoContrast", pedited, raw.xtranssensor.dualDemosaicAutoContrast, pedited->raw.xtranssensor.dualDemosaicAutoContrast); - if (ppVersion < 344) { + if (ppVersion < 345) { raw.xtranssensor.dualDemosaicAutoContrast = false; if (pedited) { pedited->raw.xtranssensor.dualDemosaicAutoContrast = true; diff --git a/rtengine/procparams.h b/rtengine/procparams.h index d8fa89a64..22868a844 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -749,6 +749,7 @@ struct SHParams { int shadows; int stonalwidth; int radius; + bool lab; SHParams(); diff --git a/rtengine/profilestore.h b/rtengine/profilestore.h index 4949517da..d79e5691f 100644 --- a/rtengine/profilestore.h +++ b/rtengine/profilestore.h @@ -39,14 +39,14 @@ class ProfileStoreListener { public: - virtual ~ProfileStoreListener() {} + virtual ~ProfileStoreListener() = default; /** @brief Called whenever the current value has to be stored before update. */ - virtual void storeCurrentValue() {} + virtual void storeCurrentValue() = 0; /** @brief Called whenever the file list has been updated and the content of the listener has to be updated. */ virtual void updateProfileList() = 0; /** @brief Called whenever the profile list has changed and the old value have to be restored (if possible). */ - virtual void restoreValue() {} + virtual void restoreValue() = 0; }; /// @brief ProfileStoreEntry type (folder or file) diff --git a/rtengine/rescale.h b/rtengine/rescale.h new file mode 100644 index 000000000..ba9a01c99 --- /dev/null +++ b/rtengine/rescale.h @@ -0,0 +1,99 @@ +/* -*- C++ -*- + * + * This file is part of RawTherapee. + * + * Copyright (c) 2018 Alberto Griggio + * + * 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 . + */ + +#pragma once + +#include "array2D.h" + +namespace rtengine { + +inline float getBilinearValue(const array2D &src, float x, float y) +{ + const int W = src.width(); + const int H = src.height(); + + // 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); + + float bl = src[yi][xi]; + float br = src[yi][xi1]; + float tl = src[yi1][xi]; + 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; +} + + +inline void rescaleBilinear(const array2D &src, array2D &dst, bool multithread) +{ + const int Ws = src.width(); + const int Hs = src.height(); + const int Wd = dst.width(); + const int Hd = dst.height(); + + float col_scale = float (Ws) / float (Wd); + float row_scale = float (Hs) / float (Hd); + +#ifdef _OPENMP + #pragma omp parallel for if (multithread) +#endif + + for (int y = 0; y < Hd; ++y) { + float ymrs = y * row_scale; + + for (int x = 0; x < Wd; ++x) { + dst[y][x] = getBilinearValue(src, x * col_scale, ymrs); + } + } +} + + +inline void rescaleNearest(const array2D &src, array2D &dst, bool multithread) +{ + const int width = src.width(); + const int height = src.height(); + const int nw = dst.width(); + const int nh = dst.height(); + +#ifdef _OPENMP + #pragma omp parallel for if (multithread) +#endif + + for (int y = 0; y < nh; ++y) { + int sy = y * height / nh; + + for (int x = 0; x < nw; ++x) { + int sx = x * width / nw; + dst[y][x] = src[sy][sx]; + } + } +} + + +} // namespace rtengine diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h index fcb00457a..ecf273337 100644 --- a/rtengine/rtengine.h +++ b/rtengine/rtengine.h @@ -154,21 +154,20 @@ public: /** This listener interface is used to indicate the progress of time consuming operations */ class ProgressListener { - public: - virtual ~ProgressListener() {} + virtual ~ProgressListener() = default; /** This member function is called when the percentage of the progress has been changed. * @param p is a number between 0 and 1 */ - virtual void setProgress (double p) {} + virtual void setProgress(double p) = 0; /** This member function is called when a textual information corresponding to the progress has been changed. * @param str is the textual information corresponding to the progress */ - virtual void setProgressStr (Glib::ustring str) {} + virtual void setProgressStr(const Glib::ustring& str) = 0; /** This member function is called when the state of the processing has been changed. * @param inProcessing =true if the processing has been started, =false if it has been stopped */ - virtual void setProgressState (bool inProcessing) {} + virtual void setProgressState(bool inProcessing) = 0; /** This member function is called when an error occurs during the operation. * @param descr is the error message */ - virtual void error (Glib::ustring descr) {} + virtual void error(const Glib::ustring& descr) = 0; }; class ImageSource; @@ -219,20 +218,20 @@ public: class PreviewImageListener { public: - virtual ~PreviewImageListener() {} + virtual ~PreviewImageListener() = default; /** With this member function the staged processor notifies the listener that it allocated a new * image to store the end result of the processing. It can be used in a shared manner. * @param img is a pointer to the image * @param scale describes the current scaling applied compared to the 100% size (preview scale) * @param cp holds the coordinates of the current crop rectangle */ - virtual void setImage (IImage8* img, double scale, procparams::CropParams cp) {} + virtual void setImage(IImage8* img, double scale, const procparams::CropParams& cp) = 0; /** With this member function the staged processor notifies the listener that the image passed as parameter * will be deleted, and no longer used to store the preview image. * @param img the pointer to the image to be destroyed. The listener has to free the image! */ - virtual void delImage (IImage8* img) {} + virtual void delImage(IImage8* img) = 0; /** With this member function the staged processor notifies the listener that the preview image has been updated. * @param cp holds the coordinates of the current crop rectangle */ - virtual void imageReady (procparams::CropParams cp) {} + virtual void imageReady(const procparams::CropParams& cp) = 0; }; /** When the detailed crop image is ready for display during staged processing (thus the changes have been updated), @@ -242,52 +241,70 @@ public: class DetailedCropListener { public: - virtual ~DetailedCropListener() {} + virtual ~DetailedCropListener() = default; /** With this member function the staged processor notifies the listener that the detailed crop image has been updated. * @param img is a pointer to the detailed crop image */ - virtual void setDetailedCrop (IImage8* img, IImage8* imgtrue, procparams::ColorManagementParams cmp, - procparams::CropParams cp, int cx, int cy, int cw, int ch, int skip) {} - virtual bool getWindow (int& cx, int& cy, int& cw, int& ch, int& skip) - { - return false; - } - // virtual void setPosition (int x, int y, bool update=true) {} - + virtual void setDetailedCrop( + IImage8* img, + IImage8* imgtrue, + const procparams::ColorManagementParams& cmp, + const procparams::CropParams& cp, + int cx, + int cy, + int cw, + int ch, + int skip + ) = 0; + virtual void getWindow(int& cx, int& cy, int& cw, int& ch, int& skip) = 0; }; /** This listener is used when the full size of the final image has been changed (e.g. rotated by 90 deg.) */ class SizeListener { public: - virtual ~SizeListener() {} + virtual ~SizeListener() = default; /** This member function is called when the size of the final image has been changed * @param w is the width of the final image (without cropping) * @param h is the height of the final image (without cropping) * @param ow is the width of the final image (without resizing and cropping) * @param oh is the height of the final image (without resizing and cropping) */ - virtual void sizeChanged (int w, int h, int ow, int oh) {} + virtual void sizeChanged(int w, int h, int ow, int oh) = 0; }; /** This listener is used when the histogram of the final image has changed. */ class HistogramListener { public: - virtual ~HistogramListener() {} + virtual ~HistogramListener() = default; /** This member function is called when the histogram of the final image has changed. * @param histRed is the array of size 256 containing the histogram of the red channel * @param histGreen is the array of size 256 containing the histogram of the green channel * @param histBlue is the array of size 256 containing the histogram of the blue channel * @param histLuma is the array of size 256 containing the histogram of the luminance channel * other for curves backgrounds, histRAW is RAW without colors */ - virtual void histogramChanged (LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve,/* LUTu & histCLurve,LUTu & histLLCurve, */LUTu & histLCAM, LUTu & histCCAM, - LUTu & histRedRaw, LUTu & histGreenRaw, LUTu & histBlueRaw, LUTu & histChroma, LUTu & histLRETI) {} + virtual void histogramChanged( + const LUTu& histRed, + const LUTu& histGreen, + const LUTu& histBlue, + const LUTu& histLuma, + const LUTu& histToneCurve, + const LUTu& histLCurve, + const LUTu& histCCurve, + const LUTu& histLCAM, + const LUTu& histCCAM, + const LUTu& histRedRaw, + const LUTu& histGreenRaw, + const LUTu& histBlueRaw, + const LUTu& histChroma, + const LUTu& histLRETI + ) = 0; }; /** This listener is used when the auto exposure has been recomputed (e.g. when the clipping ratio changed). */ class AutoExpListener { public: - virtual ~AutoExpListener() {} + virtual ~AutoExpListener() = default; /** This member function is called when the auto exposure has been recomputed. * @param brightness is the new brightness value (in logarithmic scale) * @param bright is the new ... @@ -296,73 +313,69 @@ public: * @param hlcompr is the new highlight recovery amount * @param hlcomprthresh is the new threshold for hlcompr * @param hlrecons set to true if HighLight Reconstruction is enabled */ - virtual void autoExpChanged (double brightness, int bright, int contrast, int black, int hlcompr, int hlcomprthresh, bool hlrecons) {} + virtual void autoExpChanged(double brightness, int bright, int contrast, int black, int hlcompr, int hlcomprthresh, bool hlrecons) = 0; - virtual void autoMatchedToneCurveChanged(procparams::ToneCurveParams::TcMode curveMode, const std::vector &curve) {} + virtual void autoMatchedToneCurveChanged(procparams::ToneCurveParams::TcMode curveMode, const std::vector& curve) = 0; }; class AutoCamListener { public : - virtual ~AutoCamListener() {} - virtual void autoCamChanged (double ccam, double ccamout) {} - virtual void adapCamChanged (double cadap) {} - virtual void ybCamChanged (int yb) {} - + virtual ~AutoCamListener() = default; + virtual void autoCamChanged(double ccam, double ccamout) = 0; + virtual void adapCamChanged(double cadap) = 0; + virtual void ybCamChanged(int yb) = 0; }; class AutoChromaListener { public : - virtual ~AutoChromaListener() {} - virtual void chromaChanged (double autchroma, double autred, double autblue) {} - virtual void noiseChanged (double nresid, double highresid) {} - virtual void noiseTilePrev (int tileX, int tileY, int prevX, int prevY, int sizeT, int sizeP) {} - + virtual ~AutoChromaListener() = default; + virtual void chromaChanged(double autchroma, double autred, double autblue) = 0; + virtual void noiseChanged(double nresid, double highresid) = 0; + virtual void noiseTilePrev(int tileX, int tileY, int prevX, int prevY, int sizeT, int sizeP) = 0; }; class RetinexListener { -public : - virtual ~RetinexListener() {} - virtual void minmaxChanged (double cdma, double cdmin, double mini, double maxi, double Tmean, double Tsigma, double Tmin, double Tmax) {} - +public: + virtual ~RetinexListener() = default; + virtual void minmaxChanged(double cdma, double cdmin, double mini, double maxi, double Tmean, double Tsigma, double Tmin, double Tmax) = 0; }; class AutoColorTonListener { -public : - virtual ~AutoColorTonListener() {} - virtual void autoColorTonChanged (int bwct, int satthres, int satprot) {} +public: + virtual ~AutoColorTonListener() = default; + virtual void autoColorTonChanged(int bwct, int satthres, int satprot) = 0; }; class AutoBWListener { -public : - virtual ~AutoBWListener() {} - virtual void BWChanged (double redbw, double greenbw, double bluebw) {} - +public: + virtual ~AutoBWListener() = default; + virtual void BWChanged(double redbw, double greenbw, double bluebw) = 0; }; class AutoWBListener { -public : +public: virtual ~AutoWBListener() = default; - virtual void WBChanged (double temp, double green) = 0; + virtual void WBChanged(double temp, double green) = 0; }; class FrameCountListener { -public : +public: virtual ~FrameCountListener() = default; - virtual void FrameCountChanged (int n, int frameNum) = 0; + virtual void FrameCountChanged(int n, int frameNum) = 0; }; class ImageTypeListener { -public : +public: virtual ~ImageTypeListener() = default; - virtual void imageTypeChanged (bool isRaw, bool isBayer, bool isXtrans, bool is_Mono = false) = 0; + virtual void imageTypeChanged(bool isRaw, bool isBayer, bool isXtrans, bool is_Mono = false) = 0; }; class AutoContrastListener @@ -374,13 +387,12 @@ public : class WaveletListener { -public : - virtual ~WaveletListener() {} - virtual void wavChanged (double nlevel) {} +public: + virtual ~WaveletListener() = default; + virtual void wavChanged(double nlevel) = 0; }; - /** This class represents a detailed part of the image (looking through a kind of window). * It can be created and destroyed with the appropriate members of StagedImageProcessor. * Several crops can be assigned to the same image. */ @@ -563,8 +575,7 @@ public: * there is no jobs left. * @param img is the result of the last ProcessingJob * @return the next ProcessingJob to process */ - virtual ProcessingJob* imageReady (IImagefloat* img) = 0; - virtual void error (Glib::ustring message) = 0; + virtual ProcessingJob* imageReady(IImagefloat* img) = 0; }; /** This function performs all the image processing steps corresponding to the given ProcessingJob. It runs in the background, thus it returns immediately, * When it finishes, it calls the BatchProcessingListener with the resulting image and asks for the next job. It the listener gives a new job, it goes on diff --git a/rtengine/rtetest.cc b/rtengine/rtetest.cc index 5d2dbfddc..bd81dbb0d 100644 --- a/rtengine/rtetest.cc +++ b/rtengine/rtetest.cc @@ -21,23 +21,28 @@ //#include #include -class PListener : public rtengine::ProgressListener +class PListener : + public rtengine::ProgressListener { - public: - void setProgressStr (Glib::ustring str) + void setProgressStr(const Glib::ustring& str) { std::cout << str << std::endl; } - void setProgress (double p) + void setProgress(double p) { std::cout << p << std::endl; } + void setProgressState(bool inProcessing) + { + } + void error(const Glib::ustring& descr) + { + } }; int main (int argc, char* argv[]) { - if (argc < 4) { std::cout << "Usage: rtcmd " << std::endl; exit(1); diff --git a/rtengine/tmo_fattal02.cc b/rtengine/tmo_fattal02.cc index 359b33575..dc7826501 100644 --- a/rtengine/tmo_fattal02.cc +++ b/rtengine/tmo_fattal02.cc @@ -73,6 +73,7 @@ #include "sleef.c" #include "opthelper.h" #include "rt_algo.h" +#include "rescale.h" namespace rtengine { @@ -938,66 +939,14 @@ void solve_pde_fft (Array2Df *F, Array2Df *U, Array2Df *buf, bool multithread)/* * RT code from here on *****************************************************************************/ -inline float get_bilinear_value (const Array2Df &src, float x, float y) +inline void rescale_bilinear (const Array2Df &src, Array2Df &dst, bool multithread) { - // 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, src.getCols() - 1); - int yi1 = std::min (yi + 1, src.getRows() - 1); - - float bl = src (xi, yi); - float br = src (xi1, yi); - float tl = src (xi, yi1); - float tr = src (xi1, yi1); - - // 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; + rescaleBilinear(src, dst, multithread); } - -void rescale_bilinear (const Array2Df &src, Array2Df &dst, bool multithread) +inline void rescale_nearest (const Array2Df &src, Array2Df &dst, bool multithread) { - float col_scale = float (src.getCols()) / float (dst.getCols()); - float row_scale = float (src.getRows()) / float (dst.getRows()); - -#ifdef _OPENMP - #pragma omp parallel for if (multithread) -#endif - - for (int y = 0; y < dst.getRows(); ++y) { - float ymrs = y * row_scale; - - for (int x = 0; x < dst.getCols(); ++x) { - dst (x, y) = get_bilinear_value (src, x * col_scale, ymrs); - } - } -} - -void rescale_nearest (const Array2Df &src, Array2Df &dst, bool multithread) -{ - const int width = src.getCols(); - const int height = src.getRows(); - const int nw = dst.getCols(); - const int nh = dst.getRows(); - -#ifdef _OPENMP - #pragma omp parallel for if (multithread) -#endif - - for (int y = 0; y < nh; ++y) { - int sy = y * height / nh; - - for (int x = 0; x < nw; ++x) { - int sx = x * width / nw; - dst (x, y) = src (sx, sy); - } - } + rescaleNearest(src, dst, multithread); } diff --git a/rtgui/adjuster.h b/rtgui/adjuster.h index 5b4d6f46d..bd7f426ef 100644 --- a/rtgui/adjuster.h +++ b/rtgui/adjuster.h @@ -24,13 +24,13 @@ #include "guiutils.h" class Adjuster; + class AdjusterListener { - public: - virtual ~AdjusterListener() {}; - virtual void adjusterChanged (Adjuster* a, double newval) {} - virtual void adjusterAutoToggled (Adjuster* a, bool newval) {} + virtual ~AdjusterListener() = default; + virtual void adjusterChanged (Adjuster* a, double newval) = 0; + virtual void adjusterAutoToggled (Adjuster* a, bool newval) = 0; }; typedef double(*double2double_fun)(double val); diff --git a/rtgui/batchqueue.cc b/rtgui/batchqueue.cc index d3e3ef9f0..1d52c96e6 100644 --- a/rtgui/batchqueue.cc +++ b/rtgui/batchqueue.cc @@ -39,6 +39,27 @@ using namespace std; using namespace rtengine; +namespace +{ + +struct NLParams { + BatchQueueListener* listener; + int qsize; + bool queueEmptied; + bool queueError; + Glib::ustring queueErrorMessage; +}; + +int bqnotifylistenerUI (void* data) +{ + NLParams* params = static_cast(data); + params->listener->queueSizeChanged (params->qsize, params->queueEmptied, params->queueError, params->queueErrorMessage); + delete params; + return 0; +} + +} + BatchQueue::BatchQueue (FileCatalog* aFileCatalog) : processing(nullptr), fileCatalog(aFileCatalog), sequence(0), listener(nullptr) { @@ -580,9 +601,54 @@ void BatchQueue::startProcessing () } } -rtengine::ProcessingJob* BatchQueue::imageReady (rtengine::IImagefloat* img) +void BatchQueue::setProgress(double p) { + if (processing) { + processing->progress = p; + } + // No need to acquire the GUI, setProgressUI will do it + const auto func = [](gpointer data) -> gboolean { + static_cast(data)->redraw(); + return FALSE; + }; + + idle_register.add(func, this); +} + +void BatchQueue::setProgressStr(const Glib::ustring& str) +{ +} + +void BatchQueue::setProgressState(bool inProcessing) +{ +} + +void BatchQueue::error(const Glib::ustring& descr) +{ + if (processing && processing->processing) { + // restore failed thumb + BatchQueueButtonSet* bqbs = new BatchQueueButtonSet (processing); + bqbs->setButtonListener (this); + processing->addButtonSet (bqbs); + processing->processing = false; + processing->job = rtengine::ProcessingJob::create(processing->filename, processing->thumbnail->getType() == FT_Raw, processing->params); + processing = nullptr; + redraw (); + } + + if (listener) { + NLParams* params = new NLParams; + params->listener = listener; + params->queueEmptied = false; + params->queueError = true; + params->queueErrorMessage = descr; + idle_register.add(bqnotifylistenerUI, params); + } +} + +rtengine::ProcessingJob* BatchQueue::imageReady(rtengine::IImagefloat* img) +{ // save image img Glib::ustring fname; SaveFormat saveFormat; @@ -892,22 +958,6 @@ Glib::ustring BatchQueue::autoCompleteFileName (const Glib::ustring& fileName, c return ""; } -void BatchQueue::setProgress (double p) -{ - - if (processing) { - processing->progress = p; - } - - // No need to acquire the GUI, setProgressUI will do it - const auto func = [](gpointer data) -> gboolean { - static_cast(data)->redraw(); - return FALSE; - }; - - idle_register.add(func, this); -} - void BatchQueue::buttonPressed (LWButton* button, int actionCode, void* actionData) { @@ -923,22 +973,6 @@ void BatchQueue::buttonPressed (LWButton* button, int actionCode, void* actionDa } } -struct NLParams { - BatchQueueListener* listener; - int qsize; - bool queueEmptied; - bool queueError; - Glib::ustring queueErrorMessage; -}; - -int bqnotifylistenerUI (void* data) -{ - NLParams* params = static_cast(data); - params->listener->queueSizeChanged (params->qsize, params->queueEmptied, params->queueError, params->queueErrorMessage); - delete params; - return 0; -} - void BatchQueue::notifyListener (bool queueEmptied) { @@ -960,27 +994,3 @@ void BatchQueue::redrawNeeded (LWButton* button) GThreadLock lock; queue_draw (); } - -void BatchQueue::error (Glib::ustring msg) -{ - - if (processing && processing->processing) { - // restore failed thumb - BatchQueueButtonSet* bqbs = new BatchQueueButtonSet (processing); - bqbs->setButtonListener (this); - processing->addButtonSet (bqbs); - processing->processing = false; - processing->job = rtengine::ProcessingJob::create(processing->filename, processing->thumbnail->getType() == FT_Raw, processing->params); - processing = nullptr; - redraw (); - } - - if (listener) { - NLParams* params = new NLParams; - params->listener = listener; - params->queueEmptied = false; - params->queueError = true; - params->queueErrorMessage = msg; - idle_register.add(bqnotifylistenerUI, params); - } -} diff --git a/rtgui/batchqueue.h b/rtgui/batchqueue.h index 0d91542b6..41c30da3f 100644 --- a/rtgui/batchqueue.h +++ b/rtgui/batchqueue.h @@ -30,9 +30,9 @@ class BatchQueueListener { public: - virtual ~BatchQueueListener () {} - virtual void queueSizeChanged (int qsize, bool queueEmptied, bool queueError, Glib::ustring queueErrorMessage) = 0; - virtual bool canStartNext () = 0; + virtual ~BatchQueueListener() = default; + virtual void queueSizeChanged(int qsize, bool queueEmptied, bool queueError, const Glib::ustring& queueErrorMessage) = 0; + virtual bool canStartNext() = 0; }; class FileCatalog; @@ -62,9 +62,12 @@ public: return (!fd.empty()); } - rtengine::ProcessingJob* imageReady (rtengine::IImagefloat* img); - void error (Glib::ustring msg); - void setProgress (double p); + void setProgress(double p); + void setProgressStr(const Glib::ustring& str); + void setProgressState(bool inProcessing); + void error(const Glib::ustring& descr); + rtengine::ProcessingJob* imageReady(rtengine::IImagefloat* img); + void rightClicked (ThumbBrowserEntryBase* entry); void doubleClicked (ThumbBrowserEntryBase* entry); bool keyPressed (GdkEventKey* event); diff --git a/rtgui/batchqueuepanel.cc b/rtgui/batchqueuepanel.cc index b73fb2f6f..b698ee9d6 100644 --- a/rtgui/batchqueuepanel.cc +++ b/rtgui/batchqueuepanel.cc @@ -245,9 +245,9 @@ void BatchQueuePanel::updateTab (int qsize, int forceOrientation) } } -void BatchQueuePanel::queueSizeChanged (int qsize, bool queueEmptied, bool queueError, Glib::ustring queueErrorMessage) +void BatchQueuePanel::queueSizeChanged(int qsize, bool queueEmptied, bool queueError, const Glib::ustring& queueErrorMessage) { - updateTab ( qsize); + updateTab (qsize); if (qsize == 0 || (qsize == 1 && !fdir->get_sensitive())) { qStartStop->set_sensitive(false); @@ -311,10 +311,9 @@ void BatchQueuePanel::stopBatchProc () updateTab (batchQueue->getEntries().size()); } -void BatchQueuePanel::addBatchQueueJobs ( std::vector &entries, bool head) +void BatchQueuePanel::addBatchQueueJobs(const std::vector& entries, bool head) { - - batchQueue->addEntries (entries, head); + batchQueue->addEntries(entries, head); if (!qStartStop->get_active() && qAutoStart->get_active()) { startBatchProc (); diff --git a/rtgui/batchqueuepanel.h b/rtgui/batchqueuepanel.h index d765e23dc..3f1da85ce 100644 --- a/rtgui/batchqueuepanel.h +++ b/rtgui/batchqueuepanel.h @@ -59,11 +59,11 @@ public: void init (RTWindow* parent); - void addBatchQueueJobs (std::vector &entries , bool head = false); + void addBatchQueueJobs(const std::vector& entries , bool head = false); // batchqueuelistener interface - void queueSizeChanged (int qsize, bool queueEmptied, bool queueError, Glib::ustring queueErrorMessage); - bool canStartNext (); + void queueSizeChanged(int qsize, bool queueEmptied, bool queueError, const Glib::ustring& queueErrorMessage); + bool canStartNext(); void startBatchProc (); void stopBatchProc (); diff --git a/rtgui/bayerpreprocess.cc b/rtgui/bayerpreprocess.cc index c43bdb4d8..7c9545b89 100644 --- a/rtgui/bayerpreprocess.cc +++ b/rtgui/bayerpreprocess.cc @@ -134,6 +134,10 @@ void BayerPreProcess::adjusterChanged (Adjuster* a, double newval) } } +void BayerPreProcess::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void BayerPreProcess::setBatchMode(bool batchMode) { ToolPanel::setBatchMode (batchMode); diff --git a/rtgui/bayerpreprocess.h b/rtgui/bayerpreprocess.h index c27e76e00..18bf35026 100644 --- a/rtgui/bayerpreprocess.h +++ b/rtgui/bayerpreprocess.h @@ -46,7 +46,9 @@ public: void setBatchMode (bool batchMode); void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr); - void adjusterChanged (Adjuster* a, double newval); + void adjusterChanged(Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); + void hotDeadPixelChanged(); void setAdjusterBehavior (bool linedenoiseadd, bool greenequiladd); void trimValues (rtengine::procparams::ProcParams* pp); diff --git a/rtgui/bayerprocess.cc b/rtgui/bayerprocess.cc index ed9f86ab6..9b5ffece2 100644 --- a/rtgui/bayerprocess.cc +++ b/rtgui/bayerprocess.cc @@ -553,6 +553,10 @@ void BayerProcess::adjusterChanged (Adjuster* a, double newval) } } +void BayerProcess::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void BayerProcess::methodChanged () { const int currentSelection = method->get_active_row_number(); diff --git a/rtgui/bayerprocess.h b/rtgui/bayerprocess.h index fe7163ffc..cde3270bb 100644 --- a/rtgui/bayerprocess.h +++ b/rtgui/bayerprocess.h @@ -83,6 +83,7 @@ public: void methodChanged(); void imageNumberChanged(); void adjusterChanged(Adjuster* a, double newval); + void adjusterAutoToggled (Adjuster* a, bool newval); void checkBoxToggled(CheckBox* c, CheckValue newval); void pixelShiftMotionMethodChanged(); void pixelShiftDemosaicMethodChanged(); diff --git a/rtgui/bayerrawexposure.cc b/rtgui/bayerrawexposure.cc index 7a8f32389..f284d7975 100644 --- a/rtgui/bayerrawexposure.cc +++ b/rtgui/bayerrawexposure.cc @@ -121,7 +121,7 @@ void BayerRAWExposure::write( rtengine::procparams::ProcParams* pp, ParamsEdited } -void BayerRAWExposure::adjusterChanged (Adjuster* a, double newval) +void BayerRAWExposure::adjusterChanged(Adjuster* a, double newval) { if (listener) { Glib::ustring value = a->getTextValue(); @@ -148,6 +148,10 @@ void BayerRAWExposure::adjusterChanged (Adjuster* a, double newval) } } +void BayerRAWExposure::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void BayerRAWExposure::checkBoxToggled (CheckBox* c, CheckValue newval) { if (c == PextwoGreen) { diff --git a/rtgui/bayerrawexposure.h b/rtgui/bayerrawexposure.h index 5d51babbb..a368eea3f 100644 --- a/rtgui/bayerrawexposure.h +++ b/rtgui/bayerrawexposure.h @@ -43,6 +43,7 @@ public: void setBatchMode (bool batchMode); void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled (Adjuster* a, bool newval); void checkBoxToggled (CheckBox* c, CheckValue newval); void setAdjusterBehavior (bool pexblackadd); void trimValues (rtengine::procparams::ProcParams* pp); diff --git a/rtgui/blackwhite.cc b/rtgui/blackwhite.cc index 469094fb8..47ab24f5e 100644 --- a/rtgui/blackwhite.cc +++ b/rtgui/blackwhite.cc @@ -1094,9 +1094,8 @@ void BlackWhite::autoch_toggled () } -void BlackWhite::adjusterChanged (Adjuster* a, double newval) +void BlackWhite::adjusterChanged(Adjuster* a, double newval) { - // Checking "listener" to avoid "autoch" getting toggled off because it has to change the sliders when toggling on if (listener && (a == mixerRed || a == mixerGreen || a == mixerBlue || a == mixerOrange || a == mixerYellow || a == mixerMagenta || a == mixerPurple || a == mixerCyan) ) { if (multiImage && autoch->get_inconsistent()) { @@ -1147,6 +1146,10 @@ void BlackWhite::adjusterChanged (Adjuster* a, double newval) } } +void BlackWhite::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void BlackWhite::updateRGBLabel () { if (!batchMode) { diff --git a/rtgui/blackwhite.h b/rtgui/blackwhite.h index 07ad6a160..43e4b5384 100644 --- a/rtgui/blackwhite.h +++ b/rtgui/blackwhite.h @@ -53,6 +53,7 @@ public: void updateRGBLabel (); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled (Adjuster* a, bool newval); void setAdjusterBehavior (bool bwadd, bool bwgadd); void trimValues (rtengine::procparams::ProcParams* pp); void enabledcc_toggled (); diff --git a/rtgui/bqentryupdater.h b/rtgui/bqentryupdater.h index 75040b109..e25f5aed4 100644 --- a/rtgui/bqentryupdater.h +++ b/rtgui/bqentryupdater.h @@ -28,8 +28,8 @@ class BQEntryUpdateListener { public: - virtual ~BQEntryUpdateListener () {} - virtual void updateImage (guint8* img, int w, int h, int origw, int origh, guint8* newOPreview) {} + virtual ~BQEntryUpdateListener() = default; + virtual void updateImage(guint8* img, int w, int h, int origw, int origh, guint8* newOPreview) = 0; }; class BatchQueueEntryUpdater diff --git a/rtgui/cacorrection.cc b/rtgui/cacorrection.cc index 485a5e1cf..4405e4ad1 100644 --- a/rtgui/cacorrection.cc +++ b/rtgui/cacorrection.cc @@ -97,6 +97,10 @@ void CACorrection::adjusterChanged (Adjuster* a, double newval) } } +void CACorrection::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void CACorrection::setAdjusterBehavior (bool badd) { diff --git a/rtgui/cacorrection.h b/rtgui/cacorrection.h index fd34bc942..2de510968 100644 --- a/rtgui/cacorrection.h +++ b/rtgui/cacorrection.h @@ -40,6 +40,7 @@ public: void setBatchMode (bool batchMode); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); void setAdjusterBehavior (bool badd); void trimValues (rtengine::procparams::ProcParams* pp); }; diff --git a/rtgui/checkbox.h b/rtgui/checkbox.h index 5b3088704..b5ab4945f 100644 --- a/rtgui/checkbox.h +++ b/rtgui/checkbox.h @@ -33,10 +33,9 @@ enum class CheckValue { class CheckBoxListener { - public: - virtual ~CheckBoxListener() {}; - virtual void checkBoxToggled (CheckBox* c, CheckValue newval) {} + virtual ~CheckBoxListener() = default; + virtual void checkBoxToggled(CheckBox* c, CheckValue newval) = 0; }; diff --git a/rtgui/chmixer.cc b/rtgui/chmixer.cc index 1a122ef6f..e15ed89f5 100644 --- a/rtgui/chmixer.cc +++ b/rtgui/chmixer.cc @@ -167,7 +167,7 @@ void ChMixer::setDefaults (const ProcParams* defParams, const ParamsEdited* pedi } } -void ChMixer::adjusterChanged (Adjuster* a, double newval) +void ChMixer::adjusterChanged(Adjuster* a, double newval) { if (listener && getEnabled()) { @@ -179,6 +179,9 @@ void ChMixer::adjusterChanged (Adjuster* a, double newval) } } +void ChMixer::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} void ChMixer::enabledChanged() { diff --git a/rtgui/chmixer.h b/rtgui/chmixer.h index 410ac0d16..0ec28da3d 100644 --- a/rtgui/chmixer.h +++ b/rtgui/chmixer.h @@ -42,6 +42,7 @@ public: void setBatchMode (bool batchMode); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); void setAdjusterBehavior (bool rgbadd); void trimValues (rtengine::procparams::ProcParams* pp); void enabledChanged(); diff --git a/rtgui/colorappearance.cc b/rtgui/colorappearance.cc index 2e83d63d9..094c6fc5d 100644 --- a/rtgui/colorappearance.cc +++ b/rtgui/colorappearance.cc @@ -1544,9 +1544,8 @@ void ColorAppearance::colorForValue (double valX, double valY, enum ColorCaller: caller->ccBlue = double (B); } -void ColorAppearance::adjusterChanged (Adjuster* a, double newval) +void ColorAppearance::adjusterChanged(Adjuster* a, double newval) { - if (listener && (multiImage || getEnabled()) ) { if (a == degree) { listener->panelChanged (EvCATDegree, a->getTextValue()); @@ -1594,9 +1593,8 @@ void ColorAppearance::adjusterChanged (Adjuster* a, double newval) } } -void ColorAppearance::adjusterAutoToggled (Adjuster* a, bool newval) +void ColorAppearance::adjusterAutoToggled(Adjuster* a, bool newval) { - if (multiImage) { if (degree->getAutoInconsistent()) { degree->setAutoInconsistent (false); @@ -1844,11 +1842,21 @@ void ColorAppearance::setBatchMode (bool batchMode) curveEditorG3->setBatchMode (batchMode); } -void ColorAppearance::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve,/* LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histLRETI) +void ColorAppearance::updateCurveBackgroundHistogram( + const LUTu& histToneCurve, + const LUTu& histLCurve, + const LUTu& histCCurve, + const LUTu& histLCAM, + const LUTu& histCCAM, + const LUTu& histRed, + const LUTu& histGreen, + const LUTu& histBlue, + const LUTu& histLuma, + const LUTu& histLRETI +) { - - shape->updateBackgroundHistogram (histLCAM); - shape3->updateBackgroundHistogram (histCCAM); + shape->updateBackgroundHistogram(histLCAM); + shape3->updateBackgroundHistogram(histCCAM); } diff --git a/rtgui/colorappearance.h b/rtgui/colorappearance.h index 3829475ae..5dd8a2e82 100644 --- a/rtgui/colorappearance.h +++ b/rtgui/colorappearance.h @@ -80,7 +80,18 @@ public: void setAdjusterBehavior (bool degreeadd, bool adapscenadd, bool adaplumadd, bool badpixsladd, bool jlightadd, bool chromaadd, bool contrastadd, bool rstprotectionadd, bool qbrightadd, bool qcontrastadd, bool schromaadd, bool mchromaadd, bool colorhadd); void trimValues (rtengine::procparams::ProcParams* pp); - void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve,/* LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histLRETI); + void updateCurveBackgroundHistogram( + const LUTu& histToneCurve, + const LUTu& histLCurve, + const LUTu& histCCurve, + const LUTu& histLCAM, + const LUTu& histCCAM, + const LUTu& histRed, + const LUTu& histGreen, + const LUTu& histBlue, + const LUTu& histLuma, + const LUTu& histLRETI + ); virtual void colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller *caller); void updateToolState (std::vector &tpOpen); void writeOptions (std::vector &tpOpen); diff --git a/rtgui/colortoning.cc b/rtgui/colortoning.cc index 7b3fb97df..8b357c3f9 100644 --- a/rtgui/colortoning.cc +++ b/rtgui/colortoning.cc @@ -318,7 +318,7 @@ ColorToning::ColorToning () : FoldableToolPanel(this, "colortoning", M("TP_COLOR //------------------------------------------------------------------------ // LAB grid - auto m = ProcEventMapper::getInstance(); + auto m = ProcEventMapper::getInstance(); EvColorToningLabGridValue = m->newEvent(RGBCURVE, "HISTORY_MSG_COLORTONING_LABGRID_VALUE"); labgridBox = Gtk::manage(new Gtk::HBox()); labgrid = Gtk::manage(new LabGrid(EvColorToningLabGridValue)); @@ -688,13 +688,6 @@ void ColorToning::setAdjusterBehavior (bool splitAdd, bool satThresholdAdd, bool } -void ColorToning::adjusterChanged (ThresholdAdjuster* a, double newBottom, double newTop) -{ - if (listener && getEnabled()) - listener->panelChanged (a == hlColSat ? EvColorToningHighights : EvColorToningShadows, - Glib::ustring::compose(Glib::ustring(M("TP_COLORTONING_HUE") + ": %1" + "\n" + M("TP_COLORTONING_STRENGTH") + ": %2"), int(newTop), int(newBottom))); -} - void ColorToning::autoColorTonChanged(int bwct, int satthres, int satprot) { nextbw = bwct; @@ -731,40 +724,32 @@ bool ColorToning::CTComp_ () return false; } -void ColorToning::adjusterChanged (Adjuster* a, double newval) +void ColorToning::adjusterChanged (ThresholdAdjuster* a, double newBottom, double newTop) { - - if (!listener || !getEnabled()) { - return; + if (listener && getEnabled()) { + listener->panelChanged( + a == hlColSat + ? EvColorToningHighights + : EvColorToningShadows, + Glib::ustring::compose(Glib::ustring(M("TP_COLORTONING_HUE") + ": %1" + "\n" + M("TP_COLORTONING_STRENGTH") + ": %2"), int(newTop), int(newBottom)) + ); } +} - if (a == redlow) { - listener->panelChanged (EvColorToningredlow, redlow->getTextValue()); - } else if (a == greenlow) { - listener->panelChanged (EvColorToninggreenlow, greenlow->getTextValue()); - } else if (a == bluelow) { - listener->panelChanged (EvColorToningbluelow, bluelow->getTextValue()); - } else if (a == redmed) { - listener->panelChanged (EvColorToningredmed, redmed->getTextValue()); - } else if (a == greenmed) { - listener->panelChanged (EvColorToninggreenmed, greenmed->getTextValue()); - } else if (a == bluemed) { - listener->panelChanged (EvColorToningbluemed, bluemed->getTextValue()); - } else if (a == redhigh) { - listener->panelChanged (EvColorToningredhigh, redhigh->getTextValue()); - } else if (a == greenhigh) { - listener->panelChanged (EvColorToninggreenhigh, greenhigh->getTextValue()); - } else if (a == bluehigh) { - listener->panelChanged (EvColorToningbluehigh, bluehigh->getTextValue()); - } else if (a == balance) { - listener->panelChanged (EvColorToningbalance, balance->getTextValue()); - } else if (a == satProtectionThreshold) { - listener->panelChanged (EvColorToningSatThreshold, a->getTextValue()); - } else if (a == saturatedOpacity) { - listener->panelChanged (EvColorToningSatProtection, a->getTextValue()); - } else if (a == strength) { - listener->panelChanged (EvColorToningStrength, a->getTextValue()); - } +void ColorToning::adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight) +{ +} + +void ColorToning::adjusterChanged(ThresholdAdjuster* a, int newBottom, int newTop) +{ +} + +void ColorToning::adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight) +{ +} + +void ColorToning::adjusterChanged2(ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR) +{ } //Two Color changed @@ -829,7 +814,7 @@ void ColorToning::methodChanged () if (!batchMode) { labgridBox->hide(); - + if (method->get_active_row_number() == 0) { // Lab colorSep->show(); colorCurveEditorG->show(); @@ -1141,6 +1126,45 @@ void ColorToning::trimValues (rtengine::procparams::ProcParams* pp) bluehigh->trimValue(pp->colorToning.bluehigh); } +void ColorToning::adjusterChanged(Adjuster* a, double newval) +{ + if (!listener || !getEnabled()) { + return; + } + + if (a == redlow) { + listener->panelChanged (EvColorToningredlow, redlow->getTextValue()); + } else if (a == greenlow) { + listener->panelChanged (EvColorToninggreenlow, greenlow->getTextValue()); + } else if (a == bluelow) { + listener->panelChanged (EvColorToningbluelow, bluelow->getTextValue()); + } else if (a == redmed) { + listener->panelChanged (EvColorToningredmed, redmed->getTextValue()); + } else if (a == greenmed) { + listener->panelChanged (EvColorToninggreenmed, greenmed->getTextValue()); + } else if (a == bluemed) { + listener->panelChanged (EvColorToningbluemed, bluemed->getTextValue()); + } else if (a == redhigh) { + listener->panelChanged (EvColorToningredhigh, redhigh->getTextValue()); + } else if (a == greenhigh) { + listener->panelChanged (EvColorToninggreenhigh, greenhigh->getTextValue()); + } else if (a == bluehigh) { + listener->panelChanged (EvColorToningbluehigh, bluehigh->getTextValue()); + } else if (a == balance) { + listener->panelChanged (EvColorToningbalance, balance->getTextValue()); + } else if (a == satProtectionThreshold) { + listener->panelChanged (EvColorToningSatThreshold, a->getTextValue()); + } else if (a == saturatedOpacity) { + listener->panelChanged (EvColorToningSatProtection, a->getTextValue()); + } else if (a == strength) { + listener->panelChanged (EvColorToningStrength, a->getTextValue()); + } +} + +void ColorToning::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void ColorToning::setBatchMode (bool batchMode) { ToolPanel::setBatchMode (batchMode); diff --git a/rtgui/colortoning.h b/rtgui/colortoning.h index 73ac1dff2..cb021e242 100644 --- a/rtgui/colortoning.h +++ b/rtgui/colortoning.h @@ -32,13 +32,19 @@ public: void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr); void trimValues (rtengine::procparams::ProcParams* pp); void adjusterChanged (Adjuster* a, double newval); - void adjusterChanged (ThresholdAdjuster* a, double newBottom, double newTop); + void adjusterAutoToggled (Adjuster* a, bool newval); void setAdjusterBehavior (bool splitAdd, bool satThresholdAdd, bool satOpacityAdd, bool strprotectAdd, bool balanceAdd); void neutral_pressed (); //void neutralCurves_pressed (); void autoColorTonChanged (int bwct, int satthres, int satprot); bool CTComp_ (); + void adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop); + void adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight); + void adjusterChanged(ThresholdAdjuster* a, int newBottom, int newTop); + void adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight); + void adjusterChanged2(ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR); + void enabledChanged (); void curveChanged (CurveEditor* ce); void autosatChanged (); @@ -51,7 +57,7 @@ public: void colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller); void setListener(ToolPanelListener *tpl); - + private: bool resetPressed(GdkEventButton* event); diff --git a/rtgui/crop.cc b/rtgui/crop.cc index 7205fc3ad..d5b246107 100644 --- a/rtgui/crop.cc +++ b/rtgui/crop.cc @@ -728,7 +728,7 @@ void Crop::setDimensions (int mw, int mh) refreshSize (); } -void Crop::sizeChanged (int x, int y, int ow, int oh) +void Crop::sizeChanged(int x, int y, int ow, int oh) { struct Params { Crop* crop; @@ -1261,9 +1261,8 @@ void Crop::cropManipReady () idle_register.add(notifyListenerUI, this); } -double Crop::getRatio () +double Crop::getRatio () const { - double r = -1.0; if (!fixr->get_active()) { diff --git a/rtgui/crop.h b/rtgui/crop.h index e786d8364..d3b5c7b6b 100644 --- a/rtgui/crop.h +++ b/rtgui/crop.h @@ -76,7 +76,7 @@ public: void cropResized (int &x, int &y, int& x2, int& y2); void cropManipReady (); bool inImageArea (int x, int y); - double getRatio (); + double getRatio () const; void setCropPanelListener (CropPanelListener* cl) { diff --git a/rtgui/cropguilistener.h b/rtgui/cropguilistener.h index 239e9d002..7a791ef93 100644 --- a/rtgui/cropguilistener.h +++ b/rtgui/cropguilistener.h @@ -23,21 +23,21 @@ class CropGUIListener { public: - virtual ~CropGUIListener() {} - virtual void cropMoved (int &x, int &y, int &w, int &h) = 0; - virtual void cropWidth1Resized (int &x, int &y, int &w, int &h, float custom_ratio=0.f) = 0; - virtual void cropWidth2Resized (int &x, int &y, int &w, int &h, float custom_ratio=0.f) = 0; - virtual void cropHeight1Resized (int &x, int &y, int &w, int &h, float custom_ratio=0.f) = 0; - virtual void cropHeight2Resized (int &x, int &y, int &w, int &h, float custom_ratio=0.f) = 0; - virtual void cropTopLeftResized (int &x, int &y, int &w, int &h, float custom_ratio=0.f) = 0; - virtual void cropTopRightResized (int &x, int &y, int &w, int &h, float custom_ratio=0.f) = 0; - virtual void cropBottomLeftResized (int &x, int &y, int &w, int &h, float custom_ratio=0.f) = 0; - virtual void cropBottomRightResized (int &x, int &y, int &w, int &h, float custom_ratio=0.f) = 0; - virtual void cropInit (int &x, int &y, int &w, int &h) = 0; - virtual void cropResized (int &x, int &y, int& x2, int& y2) = 0; - virtual void cropManipReady () = 0; - virtual bool inImageArea (int x, int y) = 0; - virtual double getRatio () = 0; + virtual ~CropGUIListener() = default; + virtual void cropMoved(int &x, int &y, int &w, int &h) = 0; + virtual void cropWidth1Resized(int &x, int &y, int &w, int &h, float custom_ratio = 0.f) = 0; + virtual void cropWidth2Resized(int &x, int &y, int &w, int &h, float custom_ratio = 0.f) = 0; + virtual void cropHeight1Resized(int &x, int &y, int &w, int &h, float custom_ratio = 0.f) = 0; + virtual void cropHeight2Resized(int &x, int &y, int &w, int &h, float custom_ratio = 0.f) = 0; + virtual void cropTopLeftResized(int &x, int &y, int &w, int &h, float custom_ratio = 0.f) = 0; + virtual void cropTopRightResized(int &x, int &y, int &w, int &h, float custom_ratio = 0.f) = 0; + virtual void cropBottomLeftResized(int &x, int &y, int &w, int &h, float custom_ratio = 0.f) = 0; + virtual void cropBottomRightResized(int &x, int &y, int &w, int &h, float custom_ratio = 0.f) = 0; + virtual void cropInit(int &x, int &y, int &w, int &h) = 0; + virtual void cropResized(int &x, int &y, int& x2, int& y2) = 0; + virtual void cropManipReady() = 0; + virtual bool inImageArea(int x, int y) = 0; + virtual double getRatio() const = 0; }; #endif diff --git a/rtgui/crophandler.cc b/rtgui/crophandler.cc index ecef3fa3b..c00cccf6c 100644 --- a/rtgui/crophandler.cc +++ b/rtgui/crophandler.cc @@ -106,15 +106,9 @@ void CropHandler::newImage (StagedImageProcessor* ipc_, bool isDetailWindow) initial = true; } -void CropHandler::sizeChanged (int x, int y, int ow, int oh) // the ipc notifies it to keep track size changes like rotation +void CropHandler::sizeChanged(int x, int y, int ow, int oh) // the ipc notifies it to keep track size changes like rotation { - compDim (); - -// this should be put into an idle source!!! - /* if (listener) - listener->cropWindowChanged (); - */ } bool CropHandler::isFullDisplay () @@ -300,10 +294,18 @@ void CropHandler::getPosition (int& x, int& y) } -void CropHandler::setDetailedCrop (IImage8* im, IImage8* imtrue, rtengine::procparams::ColorManagementParams cmp, - rtengine::procparams::CropParams cp, int ax, int ay, int aw, int ah, int askip) +void CropHandler::setDetailedCrop( + IImage8* im, + IImage8* imtrue, + const rtengine::procparams::ColorManagementParams& cmp, + const rtengine::procparams::CropParams& cp, + int ax, + int ay, + int aw, + int ah, + int askip +) { - if (!enabled) { return; } @@ -406,9 +408,8 @@ void CropHandler::setDetailedCrop (IImage8* im, IImage8* imtrue, rtengine::procp cimg.unlock (); } -bool CropHandler::getWindow (int& cwx, int& cwy, int& cww, int& cwh, int& cskip) +void CropHandler::getWindow(int& cwx, int& cwy, int& cww, int& cwh, int& cskip) { - cwx = cropX; cwy = cropY; cww = cropW; @@ -424,8 +425,6 @@ bool CropHandler::getWindow (int& cwx, int& cwy, int& cww, int& cwh, int& cskip) } cskip = zoom >= 1000 ? 1 : zoom/10; - - return true; } void CropHandler::update () diff --git a/rtgui/crophandler.h b/rtgui/crophandler.h index 305d15e2c..14dd5062d 100644 --- a/rtgui/crophandler.h +++ b/rtgui/crophandler.h @@ -86,9 +86,19 @@ public: } // DetailedCropListener interface - void setDetailedCrop (rtengine::IImage8* im, rtengine::IImage8* imworking, rtengine::procparams::ColorManagementParams cmp, - rtengine::procparams::CropParams cp, int cx, int cy, int cw, int ch, int skip); - bool getWindow (int& cwx, int& cwy, int& cww, int& cwh, int& cskip); + void setDetailedCrop( + rtengine::IImage8* im, + rtengine::IImage8* imworking, + const rtengine::procparams::ColorManagementParams& cmp, + const rtengine::procparams::CropParams& cp, + int cx, + int cy, + int cw, + int ch, + int skip + ); + void getWindow(int& cwx, int& cwy, int& cww, int& cwh, int& cskip); + // SizeListener interface void sizeChanged (int w, int h, int ow, int oh); diff --git a/rtgui/cropwindow.h b/rtgui/cropwindow.h index 66f9b9097..71729e66e 100644 --- a/rtgui/cropwindow.h +++ b/rtgui/cropwindow.h @@ -32,15 +32,15 @@ #include "edit.h" class CropWindow; + class CropWindowListener { - public: - virtual ~CropWindowListener() {} - virtual void cropPositionChanged (CropWindow*) {} - virtual void cropWindowSizeChanged (CropWindow*) {} - virtual void cropZoomChanged (CropWindow*) {} - virtual void initialImageArrived () {} + virtual ~CropWindowListener() = default; + virtual void cropPositionChanged(CropWindow*) = 0; + virtual void cropWindowSizeChanged(CropWindow*) = 0; + virtual void cropZoomChanged(CropWindow*) = 0; + virtual void initialImageArrived() = 0; }; class ImageArea; diff --git a/rtgui/curveeditor.cc b/rtgui/curveeditor.cc index a65f8b451..995dafa4e 100644 --- a/rtgui/curveeditor.cc +++ b/rtgui/curveeditor.cc @@ -254,7 +254,7 @@ void CurveEditor::setUnChanged (bool uc) /* * Update the backgrounds histograms */ -void CurveEditor::updateBackgroundHistogram (LUTu & hist) +void CurveEditor::updateBackgroundHistogram(const LUTu& hist) { // Copy the histogram in the curve editor cache if (hist) { @@ -265,7 +265,7 @@ void CurveEditor::updateBackgroundHistogram (LUTu & hist) } // Then call the curve editor group to eventually update the histogram - subGroup->updateBackgroundHistogram (this); + subGroup->updateBackgroundHistogram(this); } // Open up the curve if it has modifications and it's not already opened diff --git a/rtgui/curveeditor.h b/rtgui/curveeditor.h index 3f279ff05..afd4a1211 100644 --- a/rtgui/curveeditor.h +++ b/rtgui/curveeditor.h @@ -93,7 +93,7 @@ public: void curveTypeToggled(); bool isUnChanged (); void setUnChanged (bool uc); - void updateBackgroundHistogram (LUTu & hist); + void updateBackgroundHistogram(const LUTu& hist); void setLeftBarColorProvider(ColorProvider* cp, int callerId); void setBottomBarColorProvider(ColorProvider* cp, int callerId); diff --git a/rtgui/defringe.cc b/rtgui/defringe.cc index 5f70925e7..6a3d11d76 100644 --- a/rtgui/defringe.cc +++ b/rtgui/defringe.cc @@ -149,9 +149,8 @@ void Defringe::curveChanged () } } -void Defringe::adjusterChanged (Adjuster* a, double newval) +void Defringe::adjusterChanged(Adjuster* a, double newval) { - if (listener && getEnabled()) { if (a == radius) { @@ -162,6 +161,10 @@ void Defringe::adjusterChanged (Adjuster* a, double newval) } } +void Defringe::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void Defringe::enabledChanged () { diff --git a/rtgui/defringe.h b/rtgui/defringe.h index ef0bfd2aa..81b870675 100644 --- a/rtgui/defringe.h +++ b/rtgui/defringe.h @@ -50,6 +50,7 @@ public: void curveChanged (); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); void enabledChanged (); virtual void colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller); diff --git a/rtgui/diagonalcurveeditorsubgroup.cc b/rtgui/diagonalcurveeditorsubgroup.cc index 6455f6cb9..a022c8650 100644 --- a/rtgui/diagonalcurveeditorsubgroup.cc +++ b/rtgui/diagonalcurveeditorsubgroup.cc @@ -1154,14 +1154,17 @@ void DiagonalCurveEditorSubGroup::shcChanged () /* * Listener */ -void DiagonalCurveEditorSubGroup::adjusterChanged (Adjuster* a, double newval) +void DiagonalCurveEditorSubGroup::adjusterChanged(Adjuster* a, double newval) { - paramCurve->setPoints (getCurveFromGUI(DCT_Parametric)); storeDisplayedCurve(); parent->curveChanged (); } +void DiagonalCurveEditorSubGroup::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + /* * Listener called when the mouse is over a parametric curve's slider */ diff --git a/rtgui/diagonalcurveeditorsubgroup.h b/rtgui/diagonalcurveeditorsubgroup.h index 1e3c3bf13..c9dafeadd 100644 --- a/rtgui/diagonalcurveeditorsubgroup.h +++ b/rtgui/diagonalcurveeditorsubgroup.h @@ -105,6 +105,7 @@ protected: const std::vector getCurveFromGUI (int type); void shcChanged (); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); bool adjusterEntered (GdkEventCrossing* ev, int ac); bool adjusterLeft (GdkEventCrossing* ev, int ac); void setSubGroupRangeLabels(Glib::ustring r1, Glib::ustring r2, Glib::ustring r3, Glib::ustring r4); diff --git a/rtgui/dirpyrdenoise.cc b/rtgui/dirpyrdenoise.cc index f79770a62..c2fb31902 100644 --- a/rtgui/dirpyrdenoise.cc +++ b/rtgui/dirpyrdenoise.cc @@ -1009,11 +1009,9 @@ void DirPyrDenoise::setDefaults (const ProcParams* defParams, const ParamsEdited } } -void DirPyrDenoise::adjusterChanged (Adjuster* a, double newval) +void DirPyrDenoise::adjusterChanged(Adjuster* a, double newval) { - - Glib::ustring costr; - costr = Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(2), a->getValue()); + const Glib::ustring costr = Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(2), a->getValue()); if (listener && getEnabled()) { if (a == Ldetail) { @@ -1034,6 +1032,10 @@ void DirPyrDenoise::adjusterChanged (Adjuster* a, double newval) } } +void DirPyrDenoise::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void DirPyrDenoise::enabledChanged () { diff --git a/rtgui/dirpyrdenoise.h b/rtgui/dirpyrdenoise.h index cc9a2b5bd..26a55ba20 100644 --- a/rtgui/dirpyrdenoise.h +++ b/rtgui/dirpyrdenoise.h @@ -49,6 +49,7 @@ public: void autoOpenCurve (); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); void enabledChanged (); void medianChanged (); void chromaChanged (double autchroma, double autred, double autblue); diff --git a/rtgui/dirpyrequalizer.cc b/rtgui/dirpyrequalizer.cc index 8ceeed96a..b63243465 100644 --- a/rtgui/dirpyrequalizer.cc +++ b/rtgui/dirpyrequalizer.cc @@ -297,13 +297,28 @@ void DirPyrEqualizer::setDefaults (const ProcParams* defParams, const ParamsEdit } } -void DirPyrEqualizer::adjusterChanged (ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight) +void DirPyrEqualizer::adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop) +{ +} + +void DirPyrEqualizer::adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight) +{ +} + +void DirPyrEqualizer::adjusterChanged(ThresholdAdjuster* a, int newBottom, int newTop) +{ +} + +void DirPyrEqualizer::adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight) { if (listener && (multiImage || getEnabled()) ) { listener->panelChanged (EvDirPyrEqualizerHueskin, hueskin->getHistoryString()); } } +void DirPyrEqualizer::adjusterChanged2(ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR) +{ +} void DirPyrEqualizer::setBatchMode (bool batchMode) { @@ -330,9 +345,8 @@ void DirPyrEqualizer::cbdlMethodChanged() -void DirPyrEqualizer::adjusterChanged (Adjuster* a, double newval) +void DirPyrEqualizer::adjusterChanged(Adjuster* a, double newval) { - if (listener && getEnabled()) { if (a == threshold) { listener->panelChanged (EvDirPyrEqualizerThreshold, @@ -359,6 +373,10 @@ void DirPyrEqualizer::adjusterChanged (Adjuster* a, double newval) } } +void DirPyrEqualizer::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void DirPyrEqualizer::enabledChanged () { diff --git a/rtgui/dirpyrequalizer.h b/rtgui/dirpyrequalizer.h index 9a3517166..3b5549e55 100644 --- a/rtgui/dirpyrequalizer.h +++ b/rtgui/dirpyrequalizer.h @@ -63,15 +63,20 @@ public: void setBatchMode (bool batchMode); void setAdjusterBehavior (bool multiplieradd, bool thresholdadd, bool skinadd); void trimValues (rtengine::procparams::ProcParams* pp); - void adjusterChanged (ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight); -// void algoChanged (); void cbdlMethodChanged(); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); void enabledChanged(); void gamutlabToggled (); void lumaneutralPressed (); void lumacontrastPlusPressed (); void lumacontrastMinusPressed (); + + void adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop); + void adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight); + void adjusterChanged(ThresholdAdjuster* a, int newBottom, int newTop); + void adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight); + void adjusterChanged2(ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR); }; #endif diff --git a/rtgui/distortion.cc b/rtgui/distortion.cc index b6ad7cc03..d1d097269 100644 --- a/rtgui/distortion.cc +++ b/rtgui/distortion.cc @@ -84,14 +84,17 @@ void Distortion::setDefaults (const ProcParams* defParams, const ParamsEdited* p } } -void Distortion::adjusterChanged (Adjuster* a, double newval) +void Distortion::adjusterChanged(Adjuster* a, double newval) { - if (listener) { listener->panelChanged (EvDISTAmount, Glib::ustring::format (std::setw(4), std::fixed, std::setprecision(3), a->getValue())); } } +void Distortion::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void Distortion::setBatchMode (bool batchMode) { diff --git a/rtgui/distortion.h b/rtgui/distortion.h index c2856323d..b1134e426 100644 --- a/rtgui/distortion.h +++ b/rtgui/distortion.h @@ -43,6 +43,7 @@ public: void setBatchMode (bool batchMode); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled (Adjuster* a, bool newval); void setAdjusterBehavior (bool vadd); void trimValues (rtengine::procparams::ProcParams* pp); void idPressed (); diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 392d12a2c..1f46d60e7 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -1159,7 +1159,12 @@ Glib::ustring EditorPanel::getFileName () } // TODO!!! -void EditorPanel::procParamsChanged (rtengine::procparams::ProcParams* params, rtengine::ProcEvent ev, Glib::ustring descr, ParamsEdited* paramsEdited) +void EditorPanel::procParamsChanged( + const rtengine::procparams::ProcParams* params, + const rtengine::ProcEvent& ev, + const Glib::ustring& descr, + const ParamsEdited* paramsEdited +) { // if (ev!=EvPhotoLoaded) @@ -1178,7 +1183,28 @@ void EditorPanel::procParamsChanged (rtengine::procparams::ProcParams* params, r info_toggled(); } -void EditorPanel::setProgressState (bool inProcessing) +void EditorPanel::clearParamChanges() +{ +} + +void EditorPanel::setProgress(double p) +{ + spparams *s = new spparams; + s->val = p; + s->pProgress = progressLabel; + idle_register.add(setprogressStrUI, s); +} + +void EditorPanel::setProgressStr(const Glib::ustring& str) +{ + spparams *s = new spparams; + s->str = str; + s->val = -1; + s->pProgress = progressLabel; + idle_register.add(setprogressStrUI, s); +} + +void EditorPanel::setProgressState(bool inProcessing) { struct spsparams { bool inProcessing; @@ -1217,21 +1243,63 @@ void EditorPanel::setProgressState (bool inProcessing) idle_register.add (func, p); } -void EditorPanel::setProgress (double p) +void EditorPanel::error(const Glib::ustring& descr) { - spparams *s = new spparams; - s->val = p; - s->pProgress = progressLabel; - idle_register.add (setprogressStrUI, s); } -void EditorPanel::setProgressStr (Glib::ustring str) +void EditorPanel::error(const Glib::ustring& title, const Glib::ustring& descr) { - spparams *s = new spparams; - s->str = str; - s->val = -1; - s->pProgress = progressLabel; - idle_register.add (setprogressStrUI, s); + struct errparams { + Glib::ustring descr; + Glib::ustring title; + EditorPanelIdleHelper* epih; + }; + + epih->pending++; + errparams* const p = new errparams; + p->descr = descr; + p->title = title; + p->epih = epih; + + const auto func = [] (gpointer data) -> gboolean { + errparams* const p = static_cast (data); + + if (p->epih->destroyed) + { + if (p->epih->pending == 1) { + delete p->epih; + } else { + p->epih->pending--; + } + + delete p; + + return 0; + } + + p->epih->epanel->displayError (p->title, p->descr); + p->epih->pending--; + delete p; + + return FALSE; + }; + + idle_register.add (func, p); +} + +void EditorPanel::displayError(const Glib::ustring& title, const Glib::ustring& descr) +{ + GtkWidget* msgd = gtk_message_dialog_new_with_markup (nullptr, + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + "%s", + descr.data()); + gtk_window_set_title ((GtkWindow*)msgd, title.data()); + g_signal_connect_swapped (msgd, "response", + G_CALLBACK (gtk_widget_destroy), + msgd); + gtk_widget_show_all (msgd); } // This is only called from the ThreadUI, so within the gtk thread @@ -1286,61 +1354,6 @@ void EditorPanel::refreshProcessingState (bool inProcessingP) setprogressStrUI (s); } -void EditorPanel::displayError (Glib::ustring title, Glib::ustring descr) -{ - GtkWidget* msgd = gtk_message_dialog_new_with_markup (nullptr, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - "%s", - descr.data()); - gtk_window_set_title ((GtkWindow*)msgd, title.data()); - g_signal_connect_swapped (msgd, "response", - G_CALLBACK (gtk_widget_destroy), - msgd); - gtk_widget_show_all (msgd); -} - -void EditorPanel::error (Glib::ustring title, Glib::ustring descr) -{ - struct errparams { - Glib::ustring descr; - Glib::ustring title; - EditorPanelIdleHelper* epih; - }; - - epih->pending++; - errparams* const p = new errparams; - p->descr = descr; - p->title = title; - p->epih = epih; - - const auto func = [] (gpointer data) -> gboolean { - errparams* const p = static_cast (data); - - if (p->epih->destroyed) - { - if (p->epih->pending == 1) { - delete p->epih; - } else { - p->epih->pending--; - } - - delete p; - - return 0; - } - - p->epih->epanel->displayError (p->title, p->descr); - p->epih->pending--; - delete p; - - return FALSE; - }; - - idle_register.add (func, p); -} - void EditorPanel::info_toggled () { @@ -2249,15 +2262,28 @@ void EditorPanel::tbBeforeLock_toggled () tbBeforeLock->get_active() ? tbBeforeLock->set_image (*iBeforeLockON) : tbBeforeLock->set_image (*iBeforeLockOFF); } -void EditorPanel::histogramChanged (LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, /*LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, - LUTu & histRedRaw, LUTu & histGreenRaw, LUTu & histBlueRaw, LUTu & histChroma, LUTu & histLRETI) +void EditorPanel::histogramChanged( + const LUTu& histRed, + const LUTu& histGreen, + const LUTu& histBlue, + const LUTu& histLuma, + const LUTu& histToneCurve, + const LUTu& histLCurve, + const LUTu& histCCurve, + const LUTu& histLCAM, + const LUTu& histCCAM, + const LUTu& histRedRaw, + const LUTu& histGreenRaw, + const LUTu& histBlueRaw, + const LUTu& histChroma, + const LUTu& histLRETI +) { - if (histogramPanel) { - histogramPanel->histogramChanged (histRed, histGreen, histBlue, histLuma, histChroma, histRedRaw, histGreenRaw, histBlueRaw); + histogramPanel->histogramChanged(histRed, histGreen, histBlue, histLuma, histChroma, histRedRaw, histGreenRaw, histBlueRaw); } - tpc->updateCurveBackgroundHistogram (histToneCurve, histLCurve, histCCurve,/*histCLurve, histLLCurve,*/ histLCAM, histCCAM, histRed, histGreen, histBlue, histLuma, histLRETI); + tpc->updateCurveBackgroundHistogram(histToneCurve, histLCurve, histCCurve, histLCAM, histCCAM, histRed, histGreen, histBlue, histLuma, histLRETI); } bool EditorPanel::CheckSidePanelsVisibility() diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index 3ac0d92b6..29ca70554 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -45,13 +45,14 @@ struct EditorPanelIdleHelper { }; class RTWindow; + class EditorPanel final : - public Gtk::VBox, - public PParamsChangeListener, - public rtengine::ProgressListener, - public ThumbnailListener, - public HistoryBeforeLineListener, - public rtengine::HistogramListener + public Gtk::VBox, + public PParamsChangeListener, + public rtengine::ProgressListener, + public ThumbnailListener, + public HistoryBeforeLineListener, + public rtengine::HistogramListener { public: explicit EditorPanel (FilePanel* filePanel = nullptr); @@ -81,16 +82,24 @@ public: { return realized; } - // progresslistener interface - void setProgress (double p); - void setProgressStr (Glib::ustring str); - void setProgressState (bool inProcessing); - void error (Glib::ustring title, Glib::ustring descr); - void displayError (Glib::ustring title, Glib::ustring descr); // this is called by error in the gtk thread + // ProgressListener interface + void setProgress(double p); + void setProgressStr(const Glib::ustring& str); + void setProgressState(bool inProcessing); + void error(const Glib::ustring& descr); + + void error(const Glib::ustring& title, const Glib::ustring& descr); + void displayError(const Glib::ustring& title, const Glib::ustring& descr); // this is called by error in the gtk thread void refreshProcessingState (bool inProcessing); // this is called by setProcessingState in the gtk thread // PParamsChangeListener interface - void procParamsChanged (rtengine::procparams::ProcParams* params, rtengine::ProcEvent ev, Glib::ustring descr, ParamsEdited* paramsEdited = nullptr); + void procParamsChanged( + const rtengine::procparams::ProcParams* params, + const rtengine::ProcEvent& ev, + const Glib::ustring& descr, + const ParamsEdited* paramsEdited = nullptr + ); + void clearParamChanges(); // thumbnaillistener interface void procParamsChanged (Thumbnail* thm, int whoChangedIt); @@ -99,8 +108,22 @@ public: void historyBeforeLineChanged (const rtengine::procparams::ProcParams& params); // HistogramListener - void histogramChanged (LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve,/* LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, - LUTu & histRedRaw, LUTu & histGreenRaw, LUTu & histBlueRaw, LUTu & histChroma, LUTu & histLRETI); + void histogramChanged( + const LUTu& histRed, + const LUTu& histGreen, + const LUTu& histBlue, + const LUTu& histLuma, + const LUTu& histToneCurve, + const LUTu& histLCurve, + const LUTu& histCCurve, + const LUTu& histLCAM, + const LUTu& histCCAM, + const LUTu& histRedRaw, + const LUTu& histGreenRaw, + const LUTu& histBlueRaw, + const LUTu& histChroma, + const LUTu& histLRETI + ); // event handlers void info_toggled (); diff --git a/rtgui/epd.cc b/rtgui/epd.cc index 602585dfb..681248994 100644 --- a/rtgui/epd.cc +++ b/rtgui/epd.cc @@ -143,7 +143,7 @@ void EdgePreservingDecompositionUI::setDefaults(const ProcParams *defParams, con void EdgePreservingDecompositionUI::adjusterChanged(Adjuster* a, double newval) { - if(listener && getEnabled()) { + if (listener && getEnabled()) { if(a == strength) { listener->panelChanged(EvEPDStrength, Glib::ustring::format(std::setw(2), std::fixed, std::setprecision(2), a->getValue())); } else if(a == gamma) { @@ -158,6 +158,10 @@ void EdgePreservingDecompositionUI::adjusterChanged(Adjuster* a, double newval) } } +void EdgePreservingDecompositionUI::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void EdgePreservingDecompositionUI::enabledChanged () { if (listener) { diff --git a/rtgui/epd.h b/rtgui/epd.h index 2e18cc0c9..c40133c3a 100644 --- a/rtgui/epd.h +++ b/rtgui/epd.h @@ -42,6 +42,7 @@ public: void setBatchMode (bool batchMode); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); void enabledChanged (); void setAdjusterBehavior (bool stAdd, bool gAdd, bool esAdd, bool scAdd, bool rAdd); }; diff --git a/rtgui/exportpanel.h b/rtgui/exportpanel.h index 369682169..dc9aa34a5 100644 --- a/rtgui/exportpanel.h +++ b/rtgui/exportpanel.h @@ -26,9 +26,10 @@ class ExportPanelListener { - public: - virtual void exportRequested () {} + virtual ~ExportPanelListener() = default; + + virtual void exportRequested() = 0; }; class ExportPanel : public Gtk::VBox diff --git a/rtgui/fattaltonemap.cc b/rtgui/fattaltonemap.cc index 545a313a9..4bba72f2a 100644 --- a/rtgui/fattaltonemap.cc +++ b/rtgui/fattaltonemap.cc @@ -113,6 +113,10 @@ void FattalToneMapping::adjusterChanged(Adjuster* a, double newval) } } +void FattalToneMapping::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void FattalToneMapping::enabledChanged () { if (listener) { diff --git a/rtgui/fattaltonemap.h b/rtgui/fattaltonemap.h index 90f92a965..fb6f1acd6 100644 --- a/rtgui/fattaltonemap.h +++ b/rtgui/fattaltonemap.h @@ -42,6 +42,7 @@ public: void setBatchMode (bool batchMode); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); void enabledChanged (); void setAdjusterBehavior(bool amountAdd, bool thresholdAdd, bool anchorAdd); }; diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index edd37f7dd..f83e39146 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -981,7 +981,7 @@ void FileBrowser::menuItemActivated (Gtk::MenuItem* m) // Empty run to update the thumb rtengine::procparams::ProcParams params = mselected[i]->thumbnail->getProcParams (); - mselected[i]->thumbnail->setProcParams (params, nullptr, FILEBROWSER); + mselected[i]->thumbnail->setProcParams (params, nullptr, FILEBROWSER, true, true); } if (!mselected.empty() && bppcl) { @@ -1991,7 +1991,11 @@ void FileBrowser::setExportPanel (ExportPanel* expanel) exportPanel->setExportPanelListener (this); } -void FileBrowser::updateProfileList () +void FileBrowser::storeCurrentValue() +{ +} + +void FileBrowser::updateProfileList() { // submenu applmenu int p = 0; @@ -2085,6 +2089,10 @@ void FileBrowser::updateProfileList () subMenuList.clear(); } +void FileBrowser::restoreValue() +{ +} + void FileBrowser::openRequested( std::vector mselected) { std::vector entries; diff --git a/rtgui/filebrowser.h b/rtgui/filebrowser.h index 1d8bc4b2b..5debe9a6c 100644 --- a/rtgui/filebrowser.h +++ b/rtgui/filebrowser.h @@ -34,23 +34,20 @@ class ProfileStoreLabel; class FileBrowser; class FileBrowserEntry; + class FileBrowserListener { - public: - virtual ~FileBrowserListener () {} - virtual void filterApplied () {} - virtual void openRequested (std::vector tbe) {} - virtual void developRequested (std::vector tbe, bool fastmode) {} - virtual void renameRequested (std::vector tbe) {} - virtual void deleteRequested (std::vector tbe, bool inclBatchProcessed) {} - virtual void copyMoveRequested (std::vector tbe, bool moveRequested) {} - virtual void selectionChanged (std::vector tbe) {} - virtual void clearFromCacheRequested(std::vector tbe, bool leavenotrace) {} - virtual bool isInTabMode () - { - return false; - } + virtual ~FileBrowserListener() = default; + virtual void filterApplied() = 0; + virtual void openRequested(const std::vector& tbe) = 0; + virtual void developRequested(const std::vector& tbe, bool fastmode) = 0; + virtual void renameRequested(const std::vector& tbe) = 0; + virtual void deleteRequested(const std::vector& tbe, bool inclBatchProcessed) = 0; + virtual void copyMoveRequested(const std::vector& tbe, bool moveRequested) = 0; + virtual void selectionChanged(const std::vector& tbe) = 0; + virtual void clearFromCacheRequested(const std::vector& tbe, bool leavenotrace) = 0; + virtual bool isInTabMode() const = 0; }; /* @@ -203,7 +200,9 @@ public: // exportpanel interface void exportRequested(); - void updateProfileList (); + void storeCurrentValue(); + void updateProfileList(); + void restoreValue(); type_trash_changed trash_changed(); }; diff --git a/rtgui/filebrowserentry.cc b/rtgui/filebrowserentry.cc index 71e6aef24..c91f95912 100644 --- a/rtgui/filebrowserentry.cc +++ b/rtgui/filebrowserentry.cc @@ -209,7 +209,7 @@ void FileBrowserEntry::procParamsChanged (Thumbnail* thm, int whoChangedIt) } } -void FileBrowserEntry::updateImage (rtengine::IImage8* img, double scale, rtengine::procparams::CropParams cropParams) +void FileBrowserEntry::updateImage(rtengine::IImage8* img, double scale, const rtengine::procparams::CropParams& cropParams) { if (!feih) { return; @@ -260,7 +260,7 @@ void FileBrowserEntry::updateImage (rtengine::IImage8* img, double scale, rtengi idle_register.add(func, param, priority); } -void FileBrowserEntry::_updateImage (rtengine::IImage8* img, double s, rtengine::procparams::CropParams cropParams) +void FileBrowserEntry::_updateImage(rtengine::IImage8* img, double s, const rtengine::procparams::CropParams& cropParams) { MYWRITERLOCK(l, lockRW); diff --git a/rtgui/filebrowserentry.h b/rtgui/filebrowserentry.h index ada726dfc..5d5bd7e8e 100644 --- a/rtgui/filebrowserentry.h +++ b/rtgui/filebrowserentry.h @@ -99,8 +99,8 @@ public: // thumbnaillistener interface void procParamsChanged (Thumbnail* thm, int whoChangedIt); // thumbimageupdatelistener interface - void updateImage (rtengine::IImage8* img, double scale, rtengine::procparams::CropParams cropParams); - void _updateImage (rtengine::IImage8* img, double scale, rtengine::procparams::CropParams cropParams); // inside gtk thread + void updateImage(rtengine::IImage8* img, double scale, const rtengine::procparams::CropParams& cropParams); + void _updateImage(rtengine::IImage8* img, double scale, const rtengine::procparams::CropParams& cropParams); // inside gtk thread virtual bool motionNotify (int x, int y); virtual bool pressNotify (int button, int type, int bstate, int x, int y); diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index 2271c05c7..55e293718 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -749,18 +749,6 @@ void FileCatalog::_refreshProgressBar () } } -void FileCatalog::filterApplied() -{ - const auto func = [](gpointer data) -> gboolean { - static_cast(data)->_refreshProgressBar(); - - return FALSE; - }; - - idle_register.add(func, this); -} - - void FileCatalog::previewReady (int dir_id, FileBrowserEntry* fdn) { @@ -962,9 +950,19 @@ int openRequestedUI (void* p) return 0; } -void FileCatalog::openRequested (std::vector tmb) +void FileCatalog::filterApplied() { + const auto func = [](gpointer data) -> gboolean { + static_cast(data)->_refreshProgressBar(); + return FALSE; + }; + + idle_register.add(func, this); +} + +void FileCatalog::openRequested(const std::vector& tmb) +{ FCOIParams* params = new FCOIParams; params->catalog = this; params->tmb = tmb; @@ -976,9 +974,8 @@ void FileCatalog::openRequested (std::vector tmb) idle_register.add(openRequestedUI, params); } -void FileCatalog::deleteRequested (std::vector tbe, bool inclBatchProcessed) +void FileCatalog::deleteRequested(const std::vector& tbe, bool inclBatchProcessed) { - if (tbe.empty()) { return; } @@ -1017,15 +1014,12 @@ void FileCatalog::deleteRequested (std::vector tbe, bool inc } } - -void FileCatalog::copyMoveRequested (std::vector tbe, bool moveRequested) +void FileCatalog::copyMoveRequested(const std::vector& tbe, bool moveRequested) { - if (tbe.empty()) { return; } - Glib::ustring fc_title; if (moveRequested) { @@ -1129,9 +1123,9 @@ void FileCatalog::copyMoveRequested (std::vector tbe, bool m _refreshProgressBar(); } // Gtk::RESPONSE_OK } -void FileCatalog::developRequested (std::vector tbe, bool fastmode) -{ +void FileCatalog::developRequested(const std::vector& tbe, bool fastmode) +{ if (listener) { std::vector entries; @@ -1262,23 +1256,8 @@ void FileCatalog::developRequested (std::vector tbe, bool fas } } -void FileCatalog::exportRequested () +void FileCatalog::renameRequested(const std::vector& tbe) { - -} - -void FileCatalog::setExportPanel (ExportPanel* expanel) -{ - - exportPanel = expanel; - exportPanel->set_sensitive (false); - exportPanel->setExportPanelListener (this); - fileBrowser->setExportPanel(expanel); -} - -void FileCatalog::renameRequested (std::vector tbe) -{ - RenameDialog* renameDlg = new RenameDialog ((Gtk::Window*)get_toplevel()); for (size_t i = 0; i < tbe.size(); i++) { @@ -1333,9 +1312,15 @@ void FileCatalog::renameRequested (std::vector tbe) delete renameDlg; } -void FileCatalog::clearFromCacheRequested (std::vector tbe, bool leavenotrace) +void FileCatalog::selectionChanged(const std::vector& tbe) { + if (fslistener) { + fslistener->selectionChanged (tbe); + } +} +void FileCatalog::clearFromCacheRequested(const std::vector& tbe, bool leavenotrace) +{ if (tbe.empty()) { return; } @@ -1347,6 +1332,11 @@ void FileCatalog::clearFromCacheRequested (std::vector tbe, } } +bool FileCatalog::isInTabMode() const +{ + return inTabMode; +} + void FileCatalog::categoryButtonToggled (Gtk::ToggleButton* b, bool isMouseClick) { @@ -1966,12 +1956,8 @@ void FileCatalog::refreshEditedState (const std::set& efiles) fileBrowser->refreshEditedState (efiles); } -void FileCatalog::selectionChanged (std::vector tbe) +void FileCatalog::exportRequested() { - - if (fslistener) { - fslistener->selectionChanged (tbe); - } } // Called within GTK UI thread @@ -1991,6 +1977,15 @@ void FileCatalog::setFilterPanel (FilterPanel* fpanel) filterPanel->set_sensitive (false); filterPanel->setFilterPanelListener (this); } + +void FileCatalog::setExportPanel(ExportPanel* expanel) +{ + exportPanel = expanel; + exportPanel->set_sensitive (false); + exportPanel->setExportPanelListener (this); + fileBrowser->setExportPanel(expanel); +} + void FileCatalog::trashChanged () { if (trashIsEmpty()) { diff --git a/rtgui/filecatalog.h b/rtgui/filecatalog.h index af16fc8ae..0af52fd28 100644 --- a/rtgui/filecatalog.h +++ b/rtgui/filecatalog.h @@ -212,13 +212,16 @@ public: void refreshThumbImages (); void refreshHeight (); - void openRequested (std::vector tbe); - void deleteRequested (std::vector tbe, bool inclBatchProcessed); - void copyMoveRequested (std::vector tbe, bool moveRequested); - void developRequested (std::vector tbe, bool fastmode); - void renameRequested (std::vector tbe); - void clearFromCacheRequested(std::vector tbe, bool leavenotrace); - void selectionChanged (std::vector tbe); + void filterApplied(); + void openRequested(const std::vector& tbe); + void deleteRequested(const std::vector& tbe, bool inclBatchProcessed); + void copyMoveRequested(const std::vector& tbe, bool moveRequested); + void developRequested(const std::vector& tbe, bool fastmode); + void renameRequested(const std::vector& tbe); + void selectionChanged(const std::vector& tbe); + void clearFromCacheRequested(const std::vector& tbe, bool leavenotrace); + bool isInTabMode() const; + void emptyTrash (); bool trashIsEmpty (); @@ -277,11 +280,6 @@ public: bool handleShortcutKey (GdkEventKey* event); - bool isInTabMode() - { - return inTabMode; - } - bool CheckSidePanelsVisibility(); void toggleSidePanels(); void toggleLeftPanel(); @@ -289,7 +287,6 @@ public: void showToolBar(); void hideToolBar(); - void filterApplied(); #ifndef _WIN32 void on_dir_changed (const Glib::RefPtr& file, const Glib::RefPtr& other_file, Gio::FileMonitorEvent event_type, bool internal); diff --git a/rtgui/filepanel.cc b/rtgui/filepanel.cc index 3cb5afa4c..f75983ac0 100644 --- a/rtgui/filepanel.cc +++ b/rtgui/filepanel.cc @@ -228,7 +228,6 @@ void FilePanel::on_NB_switch_page(Gtk::Widget* page, guint page_num) bool FilePanel::fileSelected (Thumbnail* thm) { - if (!parent) { return false; } @@ -258,6 +257,16 @@ bool FilePanel::fileSelected (Thumbnail* thm) sigc::bind(sigc::mem_fun(*this, &FilePanel::imageLoaded), thm, ld) ); return true; } + +bool FilePanel::addBatchQueueJobs(const std::vector& entries) +{ + if (parent) { + parent->addBatchQueueJobs (entries); + } + + return true; +} + bool FilePanel::imageLoaded( Thumbnail* thm, ProgressConnector *pc ) { @@ -365,16 +374,6 @@ void FilePanel::open (const Glib::ustring& d) } } -bool FilePanel::addBatchQueueJobs ( std::vector &entries ) -{ - - if (parent) { - parent->addBatchQueueJobs (entries); - } - - return true; -} - void FilePanel::optionsChanged () { diff --git a/rtgui/filepanel.h b/rtgui/filepanel.h index 3ecf7a33b..8be0229bc 100644 --- a/rtgui/filepanel.h +++ b/rtgui/filepanel.h @@ -36,8 +36,7 @@ class RTWindow; class FilePanel final : public Gtk::HPaned, - public FileSelectionListener, - public PParamsChangeListener + public FileSelectionListener { public: FilePanel (); @@ -72,8 +71,8 @@ public: void saveOptions (); // interface fileselectionlistener - bool fileSelected (Thumbnail* thm); - bool addBatchQueueJobs ( std::vector &entries ); + bool fileSelected(Thumbnail* thm); + bool addBatchQueueJobs(const std::vector& entries); void optionsChanged (); bool imageLoaded( Thumbnail* thm, ProgressConnector * ); diff --git a/rtgui/fileselectionchangelistener.h b/rtgui/fileselectionchangelistener.h index 1ad905d17..5f1b20fcc 100644 --- a/rtgui/fileselectionchangelistener.h +++ b/rtgui/fileselectionchangelistener.h @@ -19,13 +19,13 @@ #ifndef _FILESELECTIONCHANGELISTENER_ #define _FILESELECTIONCHANGELISTENER_ -#include "thumbnail.h" +class Thumbnail; class FileSelectionChangeListener { - public: - virtual void selectionChanged (const std::vector& selected) {} + virtual ~FileSelectionChangeListener() = default; + virtual void selectionChanged(const std::vector& selected) = 0; }; #endif diff --git a/rtgui/fileselectionlistener.h b/rtgui/fileselectionlistener.h index dc6434dab..0cac24d46 100644 --- a/rtgui/fileselectionlistener.h +++ b/rtgui/fileselectionlistener.h @@ -19,15 +19,15 @@ #ifndef _FILESELECTIONLISTENER_ #define _FILESELECTIONLISTENER_ -#include "thumbnail.h" -#include "batchqueueentry.h" +class Thumbnail; +class BatchQueueEntry; class FileSelectionListener { - public: - virtual bool fileSelected (Thumbnail* thm) = 0; - virtual bool addBatchQueueJobs ( std::vector &entries ) = 0; + virtual ~FileSelectionListener() = default; + virtual bool fileSelected(Thumbnail* thm) = 0; + virtual bool addBatchQueueJobs(const std::vector& entries) = 0; }; #endif diff --git a/rtgui/filmsimulation.cc b/rtgui/filmsimulation.cc index 73e35b2f8..f929048b8 100644 --- a/rtgui/filmsimulation.cc +++ b/rtgui/filmsimulation.cc @@ -106,14 +106,18 @@ void FilmSimulation::enabledChanged () } } -void FilmSimulation::adjusterChanged( Adjuster* a, double newval ) +void FilmSimulation::adjusterChanged(Adjuster* a, double newval) { - if (listener && (multiImage || getEnabled()) ) { - Glib::ustring value = a->getTextValue(); - listener->panelChanged ( EvFilmSimulationStrength, value ); + if (listener && (multiImage || getEnabled())) { + const Glib::ustring value = a->getTextValue(); + listener->panelChanged(EvFilmSimulationStrength, value); } } +void FilmSimulation::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void FilmSimulation::setBatchMode( bool batchMode ) { ToolPanel::setBatchMode( batchMode ); diff --git a/rtgui/filmsimulation.h b/rtgui/filmsimulation.h index 8f627c352..72ef019c5 100644 --- a/rtgui/filmsimulation.h +++ b/rtgui/filmsimulation.h @@ -53,12 +53,13 @@ class FilmSimulation : public ToolParamBlock, public AdjusterListener, public Fo public: FilmSimulation(); - void adjusterChanged( Adjuster* a, double newval ); - void setBatchMode( bool batchMode ); - void read( const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr ); - void write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr ); - void setAdjusterBehavior( bool strength ); - void trimValues( rtengine::procparams::ProcParams* pp ); + void adjusterChanged(Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); + void setBatchMode(bool batchMode); + void read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr); + void write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr); + void setAdjusterBehavior(bool strength); + void trimValues(rtengine::procparams::ProcParams* pp); private: void onClutSelected(); diff --git a/rtgui/filterpanel.cc b/rtgui/filterpanel.cc index 4ba332d3d..c140acfb0 100644 --- a/rtgui/filterpanel.cc +++ b/rtgui/filterpanel.cc @@ -35,7 +35,9 @@ FilterPanel::FilterPanel () : listener (nullptr) Gtk::HBox* fnhb = Gtk::manage(new Gtk::HBox ()); fnvb->pack_start (*enaFNumber, Gtk::PACK_SHRINK, 0); fnumberFrom = Gtk::manage(new Gtk::Entry ()); + fnumberFrom->set_width_chars(1); fnumberTo = Gtk::manage(new Gtk::Entry ()); + fnumberTo->set_width_chars(1); fnhb->pack_start (*fnumberFrom, true, true, 2); fnhb->pack_start (*Gtk::manage(new Gtk::Label(" - ")), false, false, 4); fnhb->pack_start (*fnumberTo, true, true, 2); @@ -47,7 +49,9 @@ FilterPanel::FilterPanel () : listener (nullptr) Gtk::HBox* shb = Gtk::manage(new Gtk::HBox ()); svb->pack_start (*enaShutter, Gtk::PACK_SHRINK, 0); shutterFrom = Gtk::manage(new Gtk::Entry ()); + shutterFrom->set_width_chars(1); shutterTo = Gtk::manage(new Gtk::Entry ()); + shutterTo->set_width_chars(1); shb->pack_start (*shutterFrom, true, true, 2); shb->pack_start (*Gtk::manage(new Gtk::Label(" - ")), false, false, 4); shb->pack_start (*shutterTo, true, true, 2); @@ -59,7 +63,9 @@ FilterPanel::FilterPanel () : listener (nullptr) Gtk::HBox* ihb = Gtk::manage(new Gtk::HBox ()); ivb->pack_start (*enaISO, Gtk::PACK_SHRINK, 0); isoFrom = Gtk::manage(new Gtk::Entry ()); + isoFrom->set_width_chars(1); isoTo = Gtk::manage(new Gtk::Entry ()); + isoTo->set_width_chars(1); ihb->pack_start (*isoFrom, true, true, 2); ihb->pack_start (*Gtk::manage(new Gtk::Label(" - ")), false, false, 4); ihb->pack_start (*isoTo, true, true, 2); @@ -71,7 +77,9 @@ FilterPanel::FilterPanel () : listener (nullptr) Gtk::HBox* fhb = Gtk::manage(new Gtk::HBox ()); fvb->pack_start (*enaFocalLen, Gtk::PACK_SHRINK, 0); focalFrom = Gtk::manage(new Gtk::Entry ()); + focalFrom->set_width_chars(1); focalTo = Gtk::manage(new Gtk::Entry ()); + focalTo->set_width_chars(1); fhb->pack_start (*focalFrom, true, true, 2); fhb->pack_start (*Gtk::manage(new Gtk::Label(" - ")), false, false, 4); fhb->pack_start (*focalTo, true, true, 2); diff --git a/rtgui/filterpanel.h b/rtgui/filterpanel.h index f37695754..7f32a88d9 100644 --- a/rtgui/filterpanel.h +++ b/rtgui/filterpanel.h @@ -24,9 +24,9 @@ class FilterPanelListener { - public: - virtual void exifFilterChanged () {} + virtual ~FilterPanelListener() = default; + virtual void exifFilterChanged () = 0; }; class FilterPanel : public Gtk::VBox diff --git a/rtgui/flatfield.cc b/rtgui/flatfield.cc index 1b77ae316..83ab15127 100644 --- a/rtgui/flatfield.cc +++ b/rtgui/flatfield.cc @@ -232,11 +232,10 @@ void FlatField::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedit } -void FlatField::adjusterChanged (Adjuster* a, double newval) +void FlatField::adjusterChanged(Adjuster* a, double newval) { if (listener) { - - Glib::ustring value = a->getTextValue(); + const Glib::ustring value = a->getTextValue(); if (a == flatFieldBlurRadius) { listener->panelChanged (EvFlatFieldBlurRadius, value); @@ -248,7 +247,6 @@ void FlatField::adjusterChanged (Adjuster* a, double newval) void FlatField::adjusterAutoToggled (Adjuster* a, bool newval) { - if (multiImage) { if (flatFieldClipControl->getAutoInconsistent()) { flatFieldClipControl->setAutoInconsistent(false); diff --git a/rtgui/gradient.cc b/rtgui/gradient.cc index 40c9f01ab..5091d3637 100644 --- a/rtgui/gradient.cc +++ b/rtgui/gradient.cc @@ -247,10 +247,9 @@ void Gradient::setDefaults (const ProcParams* defParams, const ParamsEdited* ped } } -void Gradient::adjusterChanged (Adjuster* a, double newval) +void Gradient::adjusterChanged(Adjuster* a, double newval) { - - updateGeometry (int(centerX->getValue()), int(centerY->getValue()), feather->getValue(), degree->getValue()); + updateGeometry(int(centerX->getValue()), int(centerY->getValue()), feather->getValue(), degree->getValue()); if (listener && getEnabled()) { @@ -266,6 +265,10 @@ void Gradient::adjusterChanged (Adjuster* a, double newval) } } +void Gradient::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void Gradient::enabledChanged () { diff --git a/rtgui/gradient.h b/rtgui/gradient.h index 2201ea7c4..c34364cb5 100644 --- a/rtgui/gradient.h +++ b/rtgui/gradient.h @@ -43,6 +43,7 @@ public: void setBatchMode (bool batchMode); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); void enabledChanged (); void setAdjusterBehavior (bool degreeadd, bool featheradd, bool strengthadd, bool centeradd); void trimValues (rtengine::procparams::ProcParams* pp); diff --git a/rtgui/histogrampanel.cc b/rtgui/histogrampanel.cc index 6ff48a9fd..7c136cbfe 100644 --- a/rtgui/histogrampanel.cc +++ b/rtgui/histogrampanel.cc @@ -345,7 +345,7 @@ void HistogramPanel::reorder (Gtk::PositionType align) } // DrawModeListener interface: -void HistogramPanel::toggle_button_mode () +void HistogramPanel::toggleButtonMode () { if (options.histogramDrawMode == 0) showMode->set_image(*mode0Image); @@ -734,7 +734,16 @@ void HistogramArea::updateOptions (bool r, bool g, bool b, bool l, bool c, bool updateBackBuffer (); } -void HistogramArea::update (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histChroma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw) +void HistogramArea::update( + const LUTu& histRed, + const LUTu& histGreen, + const LUTu& histBlue, + const LUTu& histLuma, + const LUTu& histChroma, + const LUTu& histRedRaw, + const LUTu& histGreenRaw, + const LUTu& histBlueRaw +) { if (histRed) { rhist = histRed; @@ -1042,7 +1051,7 @@ bool HistogramArea::on_button_press_event (GdkEventButton* event) options.histogramDrawMode = (options.histogramDrawMode + 1) % 3; if (myDrawModeListener) { - myDrawModeListener->toggle_button_mode (); + myDrawModeListener->toggleButtonMode (); } updateBackBuffer (); diff --git a/rtgui/histogrampanel.h b/rtgui/histogrampanel.h index 7c2e11162..9a8f58938 100644 --- a/rtgui/histogrampanel.h +++ b/rtgui/histogrampanel.h @@ -110,8 +110,8 @@ private: class DrawModeListener { public: - virtual ~DrawModeListener() {} - virtual void toggle_button_mode () {} + virtual ~DrawModeListener() = default; + virtual void toggleButtonMode() = 0; }; class HistogramArea : public Gtk::DrawingArea, public BackBuffer, private HistogramScaling @@ -144,7 +144,16 @@ public: ~HistogramArea(); void updateBackBuffer (); - void update (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histChroma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw); + void update( + const LUTu& histRed, + const LUTu& histGreen, + const LUTu& histBlue, + const LUTu& histLuma, + const LUTu& histChroma, + const LUTu& histRedRaw, + const LUTu& histGreenRaw, + const LUTu& histBlueRaw + ); void updateOptions (bool r, bool g, bool b, bool l, bool c, bool raw, int mode); void on_realize(); bool on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr); @@ -209,9 +218,17 @@ public: HistogramPanel (); ~HistogramPanel (); - void histogramChanged (LUTu &histRed, LUTu &histGreen, LUTu &histBlue, LUTu &histLuma, LUTu &histChroma, LUTu &histRedRaw, LUTu &histGreenRaw, LUTu &histBlueRaw) + void histogramChanged( + const LUTu& histRed, + const LUTu& histGreen, + const LUTu& histBlue, + const LUTu& histLuma, + const LUTu& histChroma, + const LUTu& histRedRaw, + const LUTu& histGreenRaw, + const LUTu& histBlueRaw) { - histogramArea->update (histRed, histGreen, histBlue, histLuma, histChroma, histRedRaw, histGreenRaw, histBlueRaw); + histogramArea->update(histRed, histGreen, histBlue, histLuma, histChroma, histRedRaw, histGreenRaw, histBlueRaw); } // pointermotionlistener interface void pointerMoved (bool validPos, const Glib::ustring &profile, const Glib::ustring &profileW, int x, int y, int r, int g, int b, bool isRaw = false); @@ -232,7 +249,7 @@ public: void resized (Gtk::Allocation& req); // drawModeListener interface - void toggle_button_mode (); + void toggleButtonMode (); }; #endif diff --git a/rtgui/history.cc b/rtgui/history.cc index 458a30c0b..35f99db5b 100644 --- a/rtgui/history.cc +++ b/rtgui/history.cc @@ -154,12 +154,6 @@ void History::initHistory () bookmarkModel->clear (); } -void History::clearParamChanges () -{ - - initHistory (); -} - void History::historySelectionChanged () { @@ -216,9 +210,13 @@ void History::bookmarkSelectionChanged () } } -void History::procParamsChanged (ProcParams* params, ProcEvent ev, Glib::ustring descr, ParamsEdited* paramsEdited) +void History::procParamsChanged( + const ProcParams* params, + const ProcEvent& ev, + const Glib::ustring& descr, + const ParamsEdited* paramsEdited +) { - // to prevent recursion, we filter out the events triggered by the history and events that should not be registered if (ev == EvHistoryBrowsed || ev == EvMonitorTransform) { return; @@ -300,6 +298,11 @@ void History::procParamsChanged (ProcParams* params, ProcEvent ev, Glib::ustring selchangebm.block (false); } +void History::clearParamChanges () +{ + initHistory (); +} + void History::addBookmarkWithText (Glib::ustring text) { diff --git a/rtgui/history.h b/rtgui/history.h index 8fbe256e4..4b9499502 100644 --- a/rtgui/history.h +++ b/rtgui/history.h @@ -27,9 +27,9 @@ class HistoryBeforeLineListener { - public: - virtual void historyBeforeLineChanged (const rtengine::procparams::ProcParams& params) {} + virtual ~HistoryBeforeLineListener() = default; + virtual void historyBeforeLineChanged(const rtengine::procparams::ProcParams& params) = 0; }; class History : public Gtk::VBox, public PParamsChangeListener @@ -106,7 +106,12 @@ public: } // pparamschangelistener interface - void procParamsChanged (rtengine::procparams::ProcParams* params, rtengine::ProcEvent ev, Glib::ustring descr, ParamsEdited* paramsEdited = nullptr); + void procParamsChanged( + const rtengine::procparams::ProcParams* params, + const rtengine::ProcEvent& ev, + const Glib::ustring& descr, + const ParamsEdited* paramsEdited = nullptr + ); void clearParamChanges (); void historySelectionChanged (); diff --git a/rtgui/hsvequalizer.h b/rtgui/hsvequalizer.h index fc3d22984..2d80bb626 100644 --- a/rtgui/hsvequalizer.h +++ b/rtgui/hsvequalizer.h @@ -29,7 +29,7 @@ #include "colorprovider.h" -class HSVEqualizer : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel, public CurveListener, public ColorProvider +class HSVEqualizer : public ToolParamBlock, public FoldableToolPanel, public CurveListener, public ColorProvider { protected: diff --git a/rtgui/iccprofilecreator.cc b/rtgui/iccprofilecreator.cc index 8ae8d4ab9..8d6e09553 100644 --- a/rtgui/iccprofilecreator.cc +++ b/rtgui/iccprofilecreator.cc @@ -363,7 +363,7 @@ void ICCProfileCreator::updateICCVersion() } } -void ICCProfileCreator::adjusterChanged (Adjuster* a, double newval) +void ICCProfileCreator::adjusterChanged(Adjuster* a, double newval) { if (a == aPrimariesRedX || a == aPrimariesRedY || a == aPrimariesGreenX || a == aPrimariesGreenY || @@ -382,6 +382,10 @@ void ICCProfileCreator::adjusterChanged (Adjuster* a, double newval) } } +void ICCProfileCreator::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void ICCProfileCreator::primariesChanged() { if (primaries->get_active_row_number() > 0) { diff --git a/rtgui/iccprofilecreator.h b/rtgui/iccprofilecreator.h index c3f2e48a1..4ec73ff5c 100644 --- a/rtgui/iccprofilecreator.h +++ b/rtgui/iccprofilecreator.h @@ -91,7 +91,8 @@ private: void primariesChanged(); void illuminantChanged(); void trcPresetsChanged(); - void adjusterChanged (Adjuster* a, double newval); + void adjusterChanged(Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); static std::vector getGamma(); Glib::ustring getPrimariesPresetName(const Glib::ustring &preset); void getPrimaries(const Glib::ustring &preset, float *p, ColorTemp &temp); diff --git a/rtgui/icmpanel.cc b/rtgui/icmpanel.cc index 01b15d4b8..bb7fdd89b 100644 --- a/rtgui/icmpanel.cc +++ b/rtgui/icmpanel.cc @@ -698,6 +698,10 @@ void ICMPanel::adjusterChanged(Adjuster* a, double newval) } } +void ICMPanel::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void ICMPanel::wpChanged() { if (listener) { diff --git a/rtgui/icmpanel.h b/rtgui/icmpanel.h index e04a4397e..bd4aa493e 100644 --- a/rtgui/icmpanel.h +++ b/rtgui/icmpanel.h @@ -30,10 +30,9 @@ class ICMPanelListener { - public: - virtual ~ICMPanelListener() {} - virtual void saveInputICCReference(Glib::ustring fname, bool apply_wb) {} + virtual ~ICMPanelListener() = default; + virtual void saveInputICCReference(const Glib::ustring& fname, bool apply_wb) = 0; }; class ICMPanel : @@ -127,6 +126,7 @@ public: void setBatchMode(bool batchMode); void setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr); void adjusterChanged(Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); void wpChanged(); void wtrcinChanged(); diff --git a/rtgui/imageareatoollistener.h b/rtgui/imageareatoollistener.h index d11ec2e6f..705888676 100644 --- a/rtgui/imageareatoollistener.h +++ b/rtgui/imageareatoollistener.h @@ -27,23 +27,14 @@ class ImageAreaToolListener { public: - virtual ~ImageAreaToolListener() {} - virtual void spotWBselected (int x, int y, Thumbnail* thm = nullptr) {} - virtual void sharpMaskSelected (bool sharpMask) {} - virtual int getSpotWBRectSize () - { - return 8; - } - virtual void cropSelectionReady () {} - virtual void rotateSelectionReady (double rotate_deg, Thumbnail* thm = nullptr) {} - virtual ToolBar* getToolBar () - { - return nullptr; - } - virtual CropGUIListener* startCropEditing (Thumbnail* thm = nullptr) - { - return nullptr; - } + virtual ~ImageAreaToolListener() = default; + virtual void spotWBselected(int x, int y, Thumbnail* thm = nullptr) = 0; + virtual void sharpMaskSelected(bool sharpMask) = 0; + virtual int getSpotWBRectSize() const = 0; + virtual void cropSelectionReady() = 0; + virtual void rotateSelectionReady(double rotate_deg, Thumbnail* thm = nullptr) = 0; + virtual ToolBar* getToolBar() const = 0; + virtual CropGUIListener* startCropEditing(Thumbnail* thm = nullptr) = 0; }; #endif diff --git a/rtgui/impulsedenoise.cc b/rtgui/impulsedenoise.cc index 5aba32d77..3e5a9a980 100644 --- a/rtgui/impulsedenoise.cc +++ b/rtgui/impulsedenoise.cc @@ -77,15 +77,17 @@ void ImpulseDenoise::setDefaults (const ProcParams* defParams, const ParamsEdite } } -void ImpulseDenoise::adjusterChanged (Adjuster* a, double newval) +void ImpulseDenoise::adjusterChanged(Adjuster* a, double newval) { - if (listener && getEnabled()) { - listener->panelChanged (EvIDNThresh, Glib::ustring::format (std::setw(2), std::fixed, std::setprecision(1), a->getValue())); } } +void ImpulseDenoise::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void ImpulseDenoise::enabledChanged () { if (listener) { diff --git a/rtgui/impulsedenoise.h b/rtgui/impulsedenoise.h index cd8de582b..14b51eb7a 100644 --- a/rtgui/impulsedenoise.h +++ b/rtgui/impulsedenoise.h @@ -40,6 +40,7 @@ public: void setBatchMode (bool batchMode); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); void enabledChanged (); void setAdjusterBehavior (bool threshadd); diff --git a/rtgui/labcurve.cc b/rtgui/labcurve.cc index 2669079ab..2e851c321 100644 --- a/rtgui/labcurve.cc +++ b/rtgui/labcurve.cc @@ -521,9 +521,8 @@ void LCurve::curveChanged (CurveEditor* ce) } } -void LCurve::adjusterChanged (Adjuster* a, double newval) +void LCurve::adjusterChanged(Adjuster* a, double newval) { - Glib::ustring costr; if (a == brightness) { @@ -565,6 +564,10 @@ void LCurve::adjusterChanged (Adjuster* a, double newval) } } +void LCurve::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void LCurve::colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller *caller) { @@ -642,14 +645,21 @@ void LCurve::setBatchMode (bool batchMode) } -void LCurve::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve,/* LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histLRETI) +void LCurve::updateCurveBackgroundHistogram( + const LUTu& histToneCurve, + const LUTu& histLCurve, + const LUTu& histCCurve, + const LUTu& histLCAM, + const LUTu& histCCAM, + const LUTu& histRed, + const LUTu& histGreen, + const LUTu& histBlue, + const LUTu& histLuma, + const LUTu& histLRETI +) { - lshape->updateBackgroundHistogram (histLCurve); ccshape->updateBackgroundHistogram (histCCurve); -// clshape->updateBackgroundHistogram (histCLurve); -// lcshape->updateBackgroundHistogram (histLLCurve); - } void LCurve::setAdjusterBehavior (bool bradd, bool contradd, bool satadd) diff --git a/rtgui/labcurve.h b/rtgui/labcurve.h index e0b912559..d15f7d144 100644 --- a/rtgui/labcurve.h +++ b/rtgui/labcurve.h @@ -75,10 +75,22 @@ public: void curveChanged (CurveEditor* ce); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); void avoidcolorshift_toggled (); void lcredsk_toggled(); - void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve,/* LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histLRETI); + void updateCurveBackgroundHistogram( + const LUTu& histToneCurve, + const LUTu& histLCurve, + const LUTu& histCCurve, + const LUTu& histLCAM, + const LUTu& histCCAM, + const LUTu& histRed, + const LUTu& histGreen, + const LUTu& histBlue, + const LUTu& histLuma, + const LUTu& histLRETI + ); virtual void colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller); diff --git a/rtgui/lensgeomlistener.h b/rtgui/lensgeomlistener.h index 3f9866e95..c6ba966b1 100644 --- a/rtgui/lensgeomlistener.h +++ b/rtgui/lensgeomlistener.h @@ -21,8 +21,8 @@ class LensGeomListener { - public: + virtual ~LensGeomListener() = default; virtual void straightenRequested () = 0; virtual void autoCropRequested () = 0; virtual double autoDistorRequested () = 0; diff --git a/rtgui/localcontrast.cc b/rtgui/localcontrast.cc index 727479c34..2be811a99 100644 --- a/rtgui/localcontrast.cc +++ b/rtgui/localcontrast.cc @@ -115,7 +115,6 @@ void LocalContrast::setDefaults(const ProcParams *defParams, const ParamsEdited } } - void LocalContrast::adjusterChanged(Adjuster* a, double newval) { if (listener && getEnabled()) { @@ -131,6 +130,9 @@ void LocalContrast::adjusterChanged(Adjuster* a, double newval) } } +void LocalContrast::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} void LocalContrast::enabledChanged () { diff --git a/rtgui/localcontrast.h b/rtgui/localcontrast.h index 4f6f872af..89341c976 100644 --- a/rtgui/localcontrast.h +++ b/rtgui/localcontrast.h @@ -47,6 +47,7 @@ public: void setBatchMode(bool batchMode); void adjusterChanged(Adjuster *a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); void enabledChanged(); void setAdjusterBehavior(bool radiusAdd, bool amountAdd, bool darknessAdd, bool lightnessAdd); }; diff --git a/rtgui/lockablecolorpicker.h b/rtgui/lockablecolorpicker.h index 308f5d6d5..211f8de4d 100644 --- a/rtgui/lockablecolorpicker.h +++ b/rtgui/lockablecolorpicker.h @@ -27,12 +27,13 @@ class CropWindow; -class LockablePickerToolListener { +class LockablePickerToolListener +{ public: - virtual ~LockablePickerToolListener () {} + virtual ~LockablePickerToolListener () = default; /// Callback on Color Picker's visibility switch - virtual void switchPickerVisibility (bool isVisible) {} + virtual void switchPickerVisibility(bool isVisible) = 0; }; class LockableColorPicker : BackBuffer diff --git a/rtgui/lwbutton.h b/rtgui/lwbutton.h index 2053911be..cccf59b11 100644 --- a/rtgui/lwbutton.h +++ b/rtgui/lwbutton.h @@ -22,13 +22,13 @@ #include class LWButton; + class LWButtonListener { - public: - virtual ~LWButtonListener () {} - virtual void buttonPressed (LWButton* button, int actionCode, void* actionData) {} - virtual void redrawNeeded (LWButton* button) {} + virtual ~LWButtonListener() = default; + virtual void buttonPressed(LWButton* button, int actionCode, void* actionData) = 0; + virtual void redrawNeeded(LWButton* button) = 0; }; class LWButton diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 04b8363f3..570d6ab2b 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -292,6 +292,7 @@ void ParamsEdited::set(bool v) sh.shadows = v; sh.stonalwidth = v; sh.radius = v; + sh.lab = v; crop.enabled = v; crop.x = v; crop.y = v; @@ -853,6 +854,7 @@ void ParamsEdited::initFrom(const std::vector& sh.shadows = sh.shadows && p.sh.shadows == other.sh.shadows; sh.stonalwidth = sh.stonalwidth && p.sh.stonalwidth == other.sh.stonalwidth; sh.radius = sh.radius && p.sh.radius == other.sh.radius; + sh.lab = sh.lab && p.sh.lab == other.sh.lab; crop.enabled = crop.enabled && p.crop.enabled == other.crop.enabled; crop.x = crop.x && p.crop.x == other.crop.x; crop.y = crop.y && p.crop.y == other.crop.y; @@ -2120,6 +2122,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.sh.radius = mods.sh.radius; } + if (sh.lab) { + toEdit.sh.lab = mods.sh.lab; + } + if (crop.enabled) { toEdit.crop.enabled = mods.crop.enabled; } diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index faa3a6c8e..aa9c01bd9 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -402,12 +402,12 @@ class SHParamsEdited public: bool enabled; - bool hq; bool highlights; bool htonalwidth; bool shadows; bool stonalwidth; bool radius; + bool lab; }; class CropParamsEdited diff --git a/rtgui/pcvignette.cc b/rtgui/pcvignette.cc index 735b766c7..3d668fed9 100644 --- a/rtgui/pcvignette.cc +++ b/rtgui/pcvignette.cc @@ -78,9 +78,8 @@ void PCVignette::setDefaults (const ProcParams* defParams, const ParamsEdited* p } } -void PCVignette::adjusterChanged (Adjuster* a, double newval) +void PCVignette::adjusterChanged(Adjuster* a, double newval) { - if (listener && getEnabled()) { if (a == strength) { listener->panelChanged (EvPCVignetteStrength, strength->getTextValue()); @@ -92,6 +91,10 @@ void PCVignette::adjusterChanged (Adjuster* a, double newval) } } +void PCVignette::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void PCVignette::enabledChanged () { diff --git a/rtgui/pcvignette.h b/rtgui/pcvignette.h index eab1cf67d..91e876947 100644 --- a/rtgui/pcvignette.h +++ b/rtgui/pcvignette.h @@ -26,6 +26,7 @@ public: void setBatchMode (bool batchMode); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); void enabledChanged (); void setAdjusterBehavior (bool strengthadd, bool featheradd, bool roundnessadd); void trimValues (rtengine::procparams::ProcParams* pp); diff --git a/rtgui/perspective.cc b/rtgui/perspective.cc index 4bfcc1d7b..db5e0c50b 100644 --- a/rtgui/perspective.cc +++ b/rtgui/perspective.cc @@ -88,14 +88,17 @@ void PerspCorrection::setDefaults (const ProcParams* defParams, const ParamsEdit } } -void PerspCorrection::adjusterChanged (Adjuster* a, double newval) +void PerspCorrection::adjusterChanged(Adjuster* a, double newval) { - if (listener) { listener->panelChanged (EvPerspCorr, Glib::ustring::compose ("%1=%3\n%2=%4", M("TP_PERSPECTIVE_HORIZONTAL"), M("TP_PERSPECTIVE_VERTICAL"), horiz->getValue(), vert->getValue())); } } +void PerspCorrection::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void PerspCorrection::setAdjusterBehavior (bool badd) { diff --git a/rtgui/perspective.h b/rtgui/perspective.h index 434df2b3f..a97d5d347 100644 --- a/rtgui/perspective.h +++ b/rtgui/perspective.h @@ -40,6 +40,7 @@ public: void setBatchMode (bool batchMode); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); void setAdjusterBehavior (bool badd); void trimValues (rtengine::procparams::ProcParams* pp); }; diff --git a/rtgui/pparamschangelistener.h b/rtgui/pparamschangelistener.h index ff55eea00..c8338745e 100644 --- a/rtgui/pparamschangelistener.h +++ b/rtgui/pparamschangelistener.h @@ -25,20 +25,23 @@ class PParamsChangeListener { - public: - virtual ~PParamsChangeListener() {} - virtual void procParamsChanged (rtengine::procparams::ProcParams* params, rtengine::ProcEvent ev, Glib::ustring descr, ParamsEdited* paramsEdited = nullptr) {} - virtual void clearParamChanges () {} + virtual ~PParamsChangeListener() = default; + virtual void procParamsChanged( + const rtengine::procparams::ProcParams* params, + const rtengine::ProcEvent& ev, + const Glib::ustring& descr, + const ParamsEdited* paramsEdited = nullptr + ) = 0; + virtual void clearParamChanges() = 0; }; class BatchPParamsChangeListener { - public: - virtual ~BatchPParamsChangeListener() {} - virtual void beginBatchPParamsChange(int numberOfEntries) {} - virtual void endBatchPParamsChange() {} + virtual ~BatchPParamsChangeListener() = default; + virtual void beginBatchPParamsChange(int numberOfEntries) = 0; + virtual void endBatchPParamsChange() = 0; }; #endif diff --git a/rtgui/ppversion.h b/rtgui/ppversion.h index 417171197..91a9633c0 100644 --- a/rtgui/ppversion.h +++ b/rtgui/ppversion.h @@ -1,13 +1,15 @@ #pragma once // This number has to be incremented whenever the PP3 file format is modified or the behaviour of a tool changes -#define PPVERSION 344 +#define PPVERSION 345 #define PPVERSION_AEXP 301 //value of PPVERSION when auto exposure algorithm was modified /* Log of version changes - 344 2018-10-21 + 345 2018-10-21 dual demosaic auto contrast threshold + 344 2018-10-04 + added Lab/RGB color space selection for shadows/highlights 343 2018-09-06 raw auto ca correction avoid colour shift 342 2018-09-05 diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 45420d2d8..1f59a91cd 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -282,8 +282,6 @@ Gtk::Widget* Preferences::getBatchProcPanel () appendBehavList (mi, M ("TP_VIBRANCE_PASTELS"), ADDSET_VIBRANCE_PASTELS, false); appendBehavList (mi, M ("TP_VIBRANCE_SATURATED"), ADDSET_VIBRANCE_SATURATED, false); - mi = behModel->append (); - mi->set_value (behavColumns.label, M ("TP_GAMMA_OUTPUT")); mi = behModel->append (); mi->set_value (behavColumns.label, M ("TP_CHMIXER_LABEL")); diff --git a/rtgui/preprocess.cc b/rtgui/preprocess.cc index 02e0ff220..9ad0953af 100644 --- a/rtgui/preprocess.cc +++ b/rtgui/preprocess.cc @@ -87,7 +87,7 @@ void PreProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedi } } -void PreProcess::adjusterChanged (Adjuster* a, double newval) +void PreProcess::adjusterChanged(Adjuster* a, double newval) { if (listener) { if (a == hdThreshold) { @@ -96,6 +96,10 @@ void PreProcess::adjusterChanged (Adjuster* a, double newval) } } +void PreProcess::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void PreProcess::hotPixelChanged () { if (batchMode) { diff --git a/rtgui/preprocess.h b/rtgui/preprocess.h index 856a9a25e..64ed110fb 100644 --- a/rtgui/preprocess.h +++ b/rtgui/preprocess.h @@ -47,7 +47,8 @@ public: void hotPixelChanged(); void deadPixelChanged(); - void adjusterChanged (Adjuster* a, double newval); + void adjusterChanged(Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); //void adjusterChanged (Adjuster* a, double newval); diff --git a/rtgui/previewhandler.cc b/rtgui/previewhandler.cc index 45e46d2d8..a251986bf 100644 --- a/rtgui/previewhandler.cc +++ b/rtgui/previewhandler.cc @@ -57,7 +57,7 @@ PreviewHandler::~PreviewHandler () //----------------previewimagelistener functions-------------------- -void PreviewHandler::setImage (rtengine::IImage8* i, double scale, rtengine::procparams::CropParams cp) +void PreviewHandler::setImage(rtengine::IImage8* i, double scale, const rtengine::procparams::CropParams& cp) { pih->pending++; @@ -104,7 +104,7 @@ void PreviewHandler::setImage (rtengine::IImage8* i, double scale, rtengine::pro } -void PreviewHandler::delImage (IImage8* i) +void PreviewHandler::delImage(IImage8* i) { pih->pending++; @@ -149,7 +149,7 @@ void PreviewHandler::delImage (IImage8* i) idle_register.add(func, iap); } -void PreviewHandler::imageReady (CropParams cp) +void PreviewHandler::imageReady(const rtengine::procparams::CropParams& cp) { pih->pending++; iaimgpar* iap = new iaimgpar; diff --git a/rtgui/previewhandler.h b/rtgui/previewhandler.h index 1258083ec..7fae4121e 100644 --- a/rtgui/previewhandler.h +++ b/rtgui/previewhandler.h @@ -30,13 +30,13 @@ class PreviewListener { - public: - virtual ~PreviewListener () {} - virtual void previewImageChanged () {} + virtual ~PreviewListener() = default; + virtual void previewImageChanged() = 0; }; class PreviewHandler; + struct PreviewHandlerIdleHelper { PreviewHandler* phandler; bool destroyed; @@ -72,9 +72,9 @@ public: } // previewimagelistener - void setImage (rtengine::IImage8* img, double scale, rtengine::procparams::CropParams cp); - void delImage (rtengine::IImage8* img); - void imageReady (rtengine::procparams::CropParams cp); + void setImage(rtengine::IImage8* img, double scale, const rtengine::procparams::CropParams& cp); + void delImage(rtengine::IImage8* img); + void imageReady(const rtengine::procparams::CropParams& cp); // this function is called when a new preview image arrives from rtengine void previewImageChanged (); diff --git a/rtgui/previewloader.h b/rtgui/previewloader.h index d5207cd44..77091bcd3 100644 --- a/rtgui/previewloader.h +++ b/rtgui/previewloader.h @@ -29,9 +29,7 @@ class PreviewLoaderListener { public: - virtual ~PreviewLoaderListener() - { - } + virtual ~PreviewLoaderListener() = default; /** * @brief a preview is ready @@ -39,16 +37,12 @@ public: * @param dir_id directory ID this is for * @param fd entry */ - virtual void previewReady(int dir_id, FileBrowserEntry* fd) - { - } + virtual void previewReady(int dir_id, FileBrowserEntry* fd) = 0; /** * @brief all previews have finished loading */ - virtual void previewsFinished(int dir_id_) - { - } + virtual void previewsFinished(int dir_id_) = 0; }; class PreviewLoader : diff --git a/rtgui/previewwindow.cc b/rtgui/previewwindow.cc index f9dba53ac..cd4977bb1 100644 --- a/rtgui/previewwindow.cc +++ b/rtgui/previewwindow.cc @@ -194,24 +194,25 @@ void PreviewWindow::setImageArea (ImageArea* ia) } } -void PreviewWindow::cropPositionChanged (CropWindow* w) +void PreviewWindow::cropPositionChanged(CropWindow* w) { - queue_draw (); } -void PreviewWindow::cropWindowSizeChanged (CropWindow* w) +void PreviewWindow::cropWindowSizeChanged(CropWindow* w) { - queue_draw (); } -void PreviewWindow::cropZoomChanged (CropWindow* w) +void PreviewWindow::cropZoomChanged(CropWindow* w) { - queue_draw (); } +void PreviewWindow::initialImageArrived() +{ +} + bool PreviewWindow::on_motion_notify_event (GdkEventMotion* event) { diff --git a/rtgui/previewwindow.h b/rtgui/previewwindow.h index f50411170..ba9d8f633 100644 --- a/rtgui/previewwindow.h +++ b/rtgui/previewwindow.h @@ -66,9 +66,10 @@ public: void previewImageChanged (); // CropWindowListener interface - void cropPositionChanged (CropWindow* w); - void cropWindowSizeChanged (CropWindow* w); - void cropZoomChanged (CropWindow* w); + void cropPositionChanged(CropWindow* w); + void cropWindowSizeChanged(CropWindow* w); + void cropZoomChanged(CropWindow* w); + void initialImageArrived(); }; #endif diff --git a/rtgui/profilechangelistener.h b/rtgui/profilechangelistener.h index 79705b114..8e8dc99b5 100644 --- a/rtgui/profilechangelistener.h +++ b/rtgui/profilechangelistener.h @@ -19,27 +19,23 @@ #ifndef _PROFILECHANGELISTENER_ #define _PROFILECHANGELISTENER_ +#include + #include "../rtengine/rtengine.h" -#include class ProfileChangeListener { - public: - virtual ~ProfileChangeListener() {} - virtual void profileChange (const rtengine::procparams::PartialProfile* nparams, rtengine::ProcEvent event, const Glib::ustring& descr, const ParamsEdited* paramsEdited = nullptr, bool fromLastSaved = false) {} - virtual void setDefaults (rtengine::procparams::ProcParams* defparams) {} + virtual ~ProfileChangeListener() = default; + virtual void profileChange( + const rtengine::procparams::PartialProfile* nparams, + const rtengine::ProcEvent& event, + const Glib::ustring& descr, + const ParamsEdited* paramsEdited = nullptr, + bool fromLastSaved = false + ) = 0; + virtual void setDefaults(const rtengine::procparams::ProcParams* defparams) = 0; }; -class BatchProfileChangeListener -{ - -public: - virtual ~BatchProfileChangeListener() {} - virtual void beginBatchProfileChange(int numberOfEntries) {} - virtual void endBatchProfileChange() {} -}; - - #endif diff --git a/rtgui/profilepanel.cc b/rtgui/profilepanel.cc index b1ab05eda..64f10ca0e 100644 --- a/rtgui/profilepanel.cc +++ b/rtgui/profilepanel.cc @@ -709,9 +709,13 @@ void ProfilePanel::selection_changed () dontupdate = false; } -void ProfilePanel::procParamsChanged (rtengine::procparams::ProcParams* p, rtengine::ProcEvent ev, Glib::ustring descr, ParamsEdited* paramsEdited) +void ProfilePanel::procParamsChanged( + const rtengine::procparams::ProcParams* p, + const rtengine::ProcEvent& ev, + const Glib::ustring& descr, + const ParamsEdited* paramsEdited +) { - // to prevent recursion, filter out the events caused by the profilepanel if (ev == EvProfileChanged || ev == EvPhotoLoaded) { return; @@ -734,6 +738,10 @@ void ProfilePanel::procParamsChanged (rtengine::procparams::ProcParams* p, rteng *custom->pparams = *p; } +void ProfilePanel::clearParamChanges() +{ +} + /** @brief Initialize the Profile panel with a default profile, overridden by the last saved profile if provided * * The file tree has already been created on object's construction. We add here the Custom, LastSaved and/or Internal item. diff --git a/rtgui/profilepanel.h b/rtgui/profilepanel.h index dc07e2006..509800aaa 100644 --- a/rtgui/profilepanel.h +++ b/rtgui/profilepanel.h @@ -89,7 +89,13 @@ public: void setInitialFileName (const Glib::ustring& filename); // PParamsChangeListener interface - void procParamsChanged (rtengine::procparams::ProcParams* params, rtengine::ProcEvent ev, Glib::ustring descr, ParamsEdited* paramsEdited = nullptr); + void procParamsChanged( + const rtengine::procparams::ProcParams* params, + const rtengine::ProcEvent& ev, + const Glib::ustring& descr, + const ParamsEdited* paramsEdited = nullptr + ); + void clearParamChanges(); // gui callbacks void save_clicked (GdkEventButton* event); diff --git a/rtgui/progressconnector.h b/rtgui/progressconnector.h index 3ce20f8f8..12a2bf82f 100644 --- a/rtgui/progressconnector.h +++ b/rtgui/progressconnector.h @@ -26,22 +26,22 @@ #undef THREAD_PRIORITY_NORMAL -class PLDBridge : public rtengine::ProgressListener +class PLDBridge : + public rtengine::ProgressListener { - - rtengine::ProgressListener* pl; - public: - explicit PLDBridge ( rtengine::ProgressListener* pb) - : pl(pb) {} + explicit PLDBridge(rtengine::ProgressListener* pb) : + pl(pb) + { + } // ProgressListener interface - void setProgress (double p) + void setProgress(double p) { GThreadLock lock; pl->setProgress(p); } - void setProgressStr (Glib::ustring str) + void setProgressStr(const Glib::ustring& str) { GThreadLock lock; Glib::ustring progrstr; @@ -49,17 +49,20 @@ public: pl->setProgressStr(progrstr); } - void setProgressState (bool inProcessing) + void setProgressState(bool inProcessing) { GThreadLock lock; pl->setProgressState(inProcessing); } - void error (Glib::ustring descr) + void error(const Glib::ustring& descr) { GThreadLock lock; pl->error(descr); } + +private: + rtengine::ProgressListener* const pl; }; template diff --git a/rtgui/prsharpening.cc b/rtgui/prsharpening.cc index 8179efcd8..fd2c85227 100644 --- a/rtgui/prsharpening.cc +++ b/rtgui/prsharpening.cc @@ -314,7 +314,6 @@ void PrSharpening::setDefaults (const ProcParams* defParams, const ParamsEdited* void PrSharpening::adjusterChanged (Adjuster* a, double newval) { - if (listener && (multiImage || getEnabled()) ) { Glib::ustring costr; @@ -351,9 +350,12 @@ void PrSharpening::adjusterChanged (Adjuster* a, double newval) } } +void PrSharpening::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void PrSharpening::enabledChanged () { - if (listener) { if (get_inconsistent()) { listener->panelChanged (EvPrShrEnabled, M("GENERAL_UNCHANGED")); @@ -455,7 +457,19 @@ void PrSharpening::method_changed () } -void PrSharpening::adjusterChanged (ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR) +void PrSharpening::adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop) +{ +} + +void PrSharpening::adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight) +{ +} + +void PrSharpening::adjusterChanged(ThresholdAdjuster* a, int newBottom, int newTop) +{ +} + +void PrSharpening::adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight) { if (listener && (multiImage || getEnabled()) ) { if(a == threshold) { @@ -464,6 +478,10 @@ void PrSharpening::adjusterChanged (ThresholdAdjuster* a, int newBottomL, int ne } } +void PrSharpening::adjusterChanged2(ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR) +{ +} + void PrSharpening::setBatchMode (bool batchMode) { diff --git a/rtgui/prsharpening.h b/rtgui/prsharpening.h index bac0b9240..8b2c02e25 100644 --- a/rtgui/prsharpening.h +++ b/rtgui/prsharpening.h @@ -65,11 +65,17 @@ public: void setBatchMode (bool batchMode); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); void enabledChanged (); void edgesonly_toggled (); void halocontrol_toggled (); void method_changed (); - void adjusterChanged (ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR); + + void adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop); + void adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight); + void adjusterChanged(ThresholdAdjuster* a, int newBottom, int newTop); + void adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight); + void adjusterChanged2(ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR); void setAdjusterBehavior (bool contrastadd, bool radiusadd, bool amountadd, bool dampingadd, bool iteradd, bool edgetoladd, bool haloctrladd); void trimValues (rtengine::procparams::ProcParams* pp); diff --git a/rtgui/quickzoomlistener.h b/rtgui/quickzoomlistener.h deleted file mode 100644 index 5857bc259..000000000 --- a/rtgui/quickzoomlistener.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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 . - */ -#ifndef _QZLISTENER_ -#define _QZLISTENER_ - -class QuickZoomListener -{ - -public: - - virtual void increaseZoom () {} - virtual void decreaseZoom () {} - virtual void quickZoom () {} - virtual void increaseCropZoom () {} - virtual void decreaseCropZoom () {} - virtual void quickCropZoom () {} -}; - -#endif diff --git a/rtgui/rawcacorrection.cc b/rtgui/rawcacorrection.cc index 44186bc70..b208f5509 100644 --- a/rtgui/rawcacorrection.cc +++ b/rtgui/rawcacorrection.cc @@ -123,7 +123,7 @@ void RAWCACorr::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedit } -void RAWCACorr::adjusterChanged (Adjuster* a, double newval) +void RAWCACorr::adjusterChanged(Adjuster* a, double newval) { if (listener) { @@ -139,6 +139,10 @@ void RAWCACorr::adjusterChanged (Adjuster* a, double newval) } } +void RAWCACorr::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void RAWCACorr::checkBoxToggled (CheckBox* c, CheckValue newval) { if (c == caAutocorrect) { diff --git a/rtgui/rawcacorrection.h b/rtgui/rawcacorrection.h index dea9ef738..3bb511885 100644 --- a/rtgui/rawcacorrection.h +++ b/rtgui/rawcacorrection.h @@ -50,6 +50,7 @@ public: void trimValues (rtengine::procparams::ProcParams* pp); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled (Adjuster* a, bool newval); void checkBoxToggled (CheckBox* c, CheckValue newval); }; diff --git a/rtgui/rawexposure.cc b/rtgui/rawexposure.cc index a705ed4ca..af0766e31 100644 --- a/rtgui/rawexposure.cc +++ b/rtgui/rawexposure.cc @@ -76,7 +76,7 @@ void RAWExposure::write( rtengine::procparams::ProcParams* pp, ParamsEdited* ped } -void RAWExposure::adjusterChanged (Adjuster* a, double newval) +void RAWExposure::adjusterChanged(Adjuster* a, double newval) { if (listener) { Glib::ustring value = a->getTextValue(); @@ -89,6 +89,10 @@ void RAWExposure::adjusterChanged (Adjuster* a, double newval) } } +void RAWExposure::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void RAWExposure::setBatchMode(bool batchMode) { ToolPanel::setBatchMode (batchMode); diff --git a/rtgui/rawexposure.h b/rtgui/rawexposure.h index d6e3e863f..6153ae98b 100644 --- a/rtgui/rawexposure.h +++ b/rtgui/rawexposure.h @@ -42,6 +42,7 @@ public: void setBatchMode (bool batchMode); void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled (Adjuster* a, bool newval); void setAdjusterBehavior (bool pexposadd, bool pexpreseradd); void trimValues (rtengine::procparams::ProcParams* pp); }; diff --git a/rtgui/recentselectionlistener.h b/rtgui/recentselectionlistener.h deleted file mode 100644 index a06048336..000000000 --- a/rtgui/recentselectionlistener.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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 . - */ -#ifndef _RECENTSELECTIONLISTENER_ -#define _RECENTSELECTIONLISTENER_ - -#include - -class RecentSelectionListener -{ - -public: - virtual void recentSelected (Glib::ustring recentdir) {} -}; - -#endif diff --git a/rtgui/resize.cc b/rtgui/resize.cc index d99068096..0de1f7db0 100644 --- a/rtgui/resize.cc +++ b/rtgui/resize.cc @@ -257,9 +257,8 @@ void Resize::setDefaults (const ProcParams* defParams, const ParamsEdited* pedit } } -void Resize::adjusterChanged (Adjuster* a, double newval) +void Resize::adjusterChanged(Adjuster* a, double newval) { - if (!batchMode) { wconn.block (true); hconn.block (true); @@ -274,6 +273,10 @@ void Resize::adjusterChanged (Adjuster* a, double newval) } } +void Resize::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + int Resize::getComputedWidth() { @@ -351,9 +354,8 @@ void Resize::update (bool isCropped, int cw, int ch, int ow, int oh) setDimensions(); } -void Resize::sizeChanged (int mw, int mh, int ow, int oh) +void Resize::sizeChanged(int mw, int mh, int ow, int oh) { - // updating max values now maxw = ow; maxh = oh; diff --git a/rtgui/resize.h b/rtgui/resize.h index 0534e292a..e403e5d6f 100644 --- a/rtgui/resize.h +++ b/rtgui/resize.h @@ -46,6 +46,7 @@ public: void setBatchMode (bool batchMode); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); void entryWChanged (); void entryHChanged (); void appliesToChanged (); diff --git a/rtgui/retinex.cc b/rtgui/retinex.cc index 5fdb8998a..08883708e 100644 --- a/rtgui/retinex.cc +++ b/rtgui/retinex.cc @@ -1311,9 +1311,8 @@ void Retinex::setAdjusterBehavior (bool strAdd, bool neighAdd, bool limdAdd, boo } -void Retinex::adjusterChanged (Adjuster* a, double newval) +void Retinex::adjusterChanged(Adjuster* a, double newval) { - if (a == iter && !batchMode) { if (iter->getIntValue() > 1) { scal->set_sensitive (true); @@ -1368,11 +1367,11 @@ void Retinex::adjusterChanged (Adjuster* a, double newval) listener->panelChanged (EvLradius, radius->getTextValue()); } - - } - +void Retinex::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} void Retinex::autoOpenCurve () { @@ -1439,11 +1438,22 @@ void Retinex::trimValues (rtengine::procparams::ProcParams* pp) } -void Retinex::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve,/* LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histLRETI) -{ - cdshape->updateBackgroundHistogram (histLRETI); - cdshapeH->updateBackgroundHistogram (histLRETI); +void Retinex::updateCurveBackgroundHistogram( + const LUTu& histToneCurve, + const LUTu& histLCurve, + const LUTu& histCCurve, + const LUTu& histLCAM, + const LUTu& histCCAM, + const LUTu& histRed, + const LUTu& histGreen, + const LUTu& histBlue, + const LUTu& histLuma, + const LUTu& histLRETI +) +{ + cdshape->updateBackgroundHistogram(histLRETI); + cdshapeH->updateBackgroundHistogram(histLRETI); } void Retinex::colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller *caller) diff --git a/rtgui/retinex.h b/rtgui/retinex.h index 134be502e..e0d0d7695 100644 --- a/rtgui/retinex.h +++ b/rtgui/retinex.h @@ -104,6 +104,7 @@ public: void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr); void trimValues (rtengine::procparams::ProcParams* pp); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled (Adjuster* a, bool newval); void autoOpenCurve (); void medianmapChanged (); void minmaxChanged (double cdma, double cdmin, double mini, double maxi, double Tmean, double Tsigma, double Tmin, double Tmax); @@ -123,7 +124,18 @@ public: void writeOptions (std::vector &tpOpen); void updateToolState (std::vector &tpOpen); void setAdjusterBehavior (bool strAdd, bool neighAdd, bool limdAdd, bool offsAdd, bool vartAdd, bool gamAdd, bool slopeAdd); - void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve,/* LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histLRETI); + void updateCurveBackgroundHistogram( + const LUTu& histToneCurve, + const LUTu& histLCurve, + const LUTu& histCCurve, + const LUTu& histLCAM, + const LUTu& histCCAM, + const LUTu& histRed, + const LUTu& histGreen, + const LUTu& histBlue, + const LUTu& histLuma, + const LUTu& histLRETI + ); virtual void colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller); diff --git a/rtgui/rgbcurves.cc b/rtgui/rgbcurves.cc index d32633bf4..1ffb8cc46 100644 --- a/rtgui/rgbcurves.cc +++ b/rtgui/rgbcurves.cc @@ -198,12 +198,19 @@ void RGBCurves::setBatchMode (bool batchMode) } -void RGBCurves::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, /*LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histLRETI) +void RGBCurves::updateCurveBackgroundHistogram( + const LUTu& histToneCurve, + const LUTu& histLCurve, + const LUTu& histCCurve, + const LUTu& histLCAM, + const LUTu& histCCAM, + const LUTu& histRed, + const LUTu& histGreen, + const LUTu& histBlue, + const LUTu& histLuma, + const LUTu& histLRETI +) { - - // Rshape->updateBackgroundHistogram (histRed); - // Gshape->updateBackgroundHistogram (histGreen); - // Bshape->updateBackgroundHistogram (histBlue); } diff --git a/rtgui/rgbcurves.h b/rtgui/rgbcurves.h index dfcba71f9..2bb24a10f 100644 --- a/rtgui/rgbcurves.h +++ b/rtgui/rgbcurves.h @@ -26,7 +26,7 @@ #include "curveeditorgroup.h" #include "colorprovider.h" -class RGBCurves : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel, public CurveListener, public ColorProvider +class RGBCurves : public ToolParamBlock, public FoldableToolPanel, public CurveListener, public ColorProvider { protected: @@ -51,7 +51,18 @@ public: void autoOpenCurve (); void curveChanged (CurveEditor* ce); - void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, /*LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histLRETI); + void updateCurveBackgroundHistogram( + const LUTu& histToneCurve, + const LUTu& histLCurve, + const LUTu& histCCurve, + const LUTu& histLCAM, + const LUTu& histCCAM, + const LUTu& histRed, + const LUTu& histGreen, + const LUTu& histBlue, + const LUTu& histLuma, + const LUTu& histLRETI + ); void lumamodeChanged (); void enabledChanged(); }; diff --git a/rtgui/rotate.cc b/rtgui/rotate.cc index 481b65139..9f70010df 100644 --- a/rtgui/rotate.cc +++ b/rtgui/rotate.cc @@ -85,14 +85,17 @@ void Rotate::setDefaults (const ProcParams* defParams, const ParamsEdited* pedit } } -void Rotate::adjusterChanged (Adjuster* a, double newval) +void Rotate::adjusterChanged(Adjuster* a, double newval) { - if (listener) { - listener->panelChanged (EvROTDegree, Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(2), degree->getValue())); + listener->panelChanged(EvROTDegree, Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(2), degree->getValue())); } } +void Rotate::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void Rotate::straighten (double deg) { diff --git a/rtgui/rotate.h b/rtgui/rotate.h index bad46ef84..5361cd80e 100644 --- a/rtgui/rotate.h +++ b/rtgui/rotate.h @@ -44,6 +44,7 @@ public: void straighten (double deg); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled (Adjuster* a, bool newval); void setAdjusterBehavior (bool rotadd); void trimValues (rtengine::procparams::ProcParams* pp); void selectStraightPressed (); diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index a52fd1ba5..8ecd31cc1 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -630,9 +630,8 @@ void RTWindow::addBatchQueueJob (BatchQueueEntry* bqe, bool head) fpanel->queue_draw (); } -void RTWindow::addBatchQueueJobs (std::vector &entries) +void RTWindow::addBatchQueueJobs(const std::vector& entries) { - bpanel->addBatchQueueJobs (entries, false); fpanel->queue_draw (); } @@ -794,19 +793,19 @@ void RTWindow::showPreferences () } } -void RTWindow::setProgress (double p) +void RTWindow::setProgress(double p) { - prProgBar.set_fraction (p); + prProgBar.set_fraction(p); } -void RTWindow::setProgressStr (Glib::ustring str) +void RTWindow::setProgressStr(const Glib::ustring& str) { if (!options.mainNBVertical) { - prProgBar.set_text ( str ); + prProgBar.set_text(str); } } -void RTWindow::setProgressState (bool inProcessing) +void RTWindow::setProgressState(bool inProcessing) { if (inProcessing) { prProgBar.show(); @@ -815,6 +814,11 @@ void RTWindow::setProgressState (bool inProcessing) } } +void RTWindow::error(const Glib::ustring& descr) +{ + prProgBar.set_text(descr); +} + void RTWindow::toggle_fullscreen () { if (is_fullscreen) { @@ -838,11 +842,6 @@ void RTWindow::toggle_fullscreen () } } -void RTWindow::error (Glib::ustring descr) -{ - prProgBar.set_text ( descr ); -} - void RTWindow::SetEditorCurrent() { mainNB->set_current_page (mainNB->page_num (*epanel)); diff --git a/rtgui/rtwindow.h b/rtgui/rtwindow.h index d5c13d515..61b961b64 100644 --- a/rtgui/rtwindow.h +++ b/rtgui/rtwindow.h @@ -78,7 +78,7 @@ public: bool selectEditorPanel (const std::string &name); void addBatchQueueJob (BatchQueueEntry* bqe, bool head = false); - void addBatchQueueJobs (std::vector &entries); + void addBatchQueueJobs (const std::vector& entries); bool keyPressed (GdkEventKey* event); bool on_configure_event (GdkEventConfigure* event); @@ -90,10 +90,12 @@ public: void showPreferences (); void on_realize (); void toggle_fullscreen (); - void setProgress (double p); - void setProgressStr (Glib::ustring str); - void setProgressState (bool inProcessing); - void error (Glib::ustring descr); + + void setProgress(double p); + void setProgressStr(const Glib::ustring& str); + void setProgressState(bool inProcessing); + void error(const Glib::ustring& descr); + rtengine::ProgressListener* getProgressListener () { return pldBridge; diff --git a/rtgui/saveformatpanel.cc b/rtgui/saveformatpanel.cc index b147c5d70..de2240fc6 100644 --- a/rtgui/saveformatpanel.cc +++ b/rtgui/saveformatpanel.cc @@ -206,7 +206,7 @@ void SaveFormatPanel::formatChanged () } } -void SaveFormatPanel::adjusterChanged (Adjuster* a, double newval) +void SaveFormatPanel::adjusterChanged(Adjuster* a, double newval) { const unsigned int act = format->get_active_row_number(); @@ -218,3 +218,7 @@ void SaveFormatPanel::adjusterChanged (Adjuster* a, double newval) listener->formatChanged(sf_templates[act].second.format); } } + +void SaveFormatPanel::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} diff --git a/rtgui/saveformatpanel.h b/rtgui/saveformatpanel.h index 7c4dbf33f..e6560d73d 100644 --- a/rtgui/saveformatpanel.h +++ b/rtgui/saveformatpanel.h @@ -26,7 +26,6 @@ class FormatChangeListener { - public: virtual ~FormatChangeListener() = default; virtual void formatChanged(const Glib::ustring& format) = 0; @@ -61,6 +60,7 @@ public: void formatChanged (); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); }; #endif diff --git a/rtgui/shadowshighlights.cc b/rtgui/shadowshighlights.cc index f1d8dbaf2..f4ed90138 100644 --- a/rtgui/shadowshighlights.cc +++ b/rtgui/shadowshighlights.cc @@ -17,12 +17,26 @@ * along with RawTherapee. If not, see . */ #include "shadowshighlights.h" +#include "eventmapper.h" using namespace rtengine; using namespace rtengine::procparams; ShadowsHighlights::ShadowsHighlights () : FoldableToolPanel(this, "shadowshighlights", M("TP_SHADOWSHLIGHTS_LABEL"), false, true) { + auto m = ProcEventMapper::getInstance(); + EvSHColorspace = m->newEvent(RGBCURVE, "HISTORY_MSG_SH_COLORSPACE"); + + Gtk::HBox* hb = Gtk::manage (new Gtk::HBox ()); + 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")); + colorspace->append(M("TP_DIRPYRDENOISE_MAIN_COLORSPACE_LAB")); + hb->pack_start(*colorspace); + pack_start(*hb); + + pack_start (*Gtk::manage (new Gtk::HSeparator())); + 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); @@ -46,6 +60,8 @@ ShadowsHighlights::ShadowsHighlights () : FoldableToolPanel(this, "shadowshighli shadows->setAdjusterListener (this); s_tonalwidth->setAdjusterListener (this); + colorspace->signal_changed().connect(sigc::mem_fun(*this, &ShadowsHighlights::colorspaceChanged)); + show_all_children (); } @@ -61,6 +77,7 @@ void ShadowsHighlights::read (const ProcParams* pp, const ParamsEdited* pedited) shadows->setEditedState (pedited->sh.shadows ? Edited : UnEdited); s_tonalwidth->setEditedState (pedited->sh.stonalwidth ? Edited : UnEdited); set_inconsistent (multiImage && !pedited->sh.enabled); + } setEnabled (pp->sh.enabled); @@ -71,6 +88,14 @@ void ShadowsHighlights::read (const ProcParams* pp, const ParamsEdited* pedited) shadows->setValue (pp->sh.shadows); s_tonalwidth->setValue (pp->sh.stonalwidth); + if (pedited && !pedited->sh.lab) { + colorspace->set_active(2); + } else if (pp->sh.lab) { + colorspace->set_active(1); + } else { + colorspace->set_active(0); + } + enableListener (); } @@ -84,6 +109,12 @@ void ShadowsHighlights::write (ProcParams* pp, ParamsEdited* pedited) pp->sh.stonalwidth = (int)s_tonalwidth->getValue (); pp->sh.enabled = getEnabled(); + if (colorspace->get_active_row_number() == 0) { + pp->sh.lab = false; + } else if (colorspace->get_active_row_number() == 1) { + pp->sh.lab = true; + } + if (pedited) { pedited->sh.radius = radius->getEditedState (); pedited->sh.highlights = highlights->getEditedState (); @@ -91,6 +122,7 @@ void ShadowsHighlights::write (ProcParams* pp, ParamsEdited* pedited) pedited->sh.shadows = shadows->getEditedState (); pedited->sh.stonalwidth = s_tonalwidth->getEditedState (); pedited->sh.enabled = !get_inconsistent(); + pedited->sh.lab = colorspace->get_active_row_number() != 2; } } @@ -120,10 +152,8 @@ void ShadowsHighlights::setDefaults (const ProcParams* defParams, const ParamsEd void ShadowsHighlights::adjusterChanged (Adjuster* a, double newval) { - if (listener && getEnabled()) { - - Glib::ustring costr = Glib::ustring::format ((int)a->getValue()); + const Glib::ustring costr = Glib::ustring::format ((int)a->getValue()); if (a == highlights) { listener->panelChanged (EvSHHighlights, costr); @@ -139,6 +169,10 @@ void ShadowsHighlights::adjusterChanged (Adjuster* a, double newval) } } +void ShadowsHighlights::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void ShadowsHighlights::enabledChanged () { @@ -153,6 +187,13 @@ void ShadowsHighlights::enabledChanged () } } +void ShadowsHighlights::colorspaceChanged() +{ + if (listener && (multiImage || getEnabled()) ) { + listener->panelChanged(EvSHColorspace, colorspace->get_active_text()); + } +} + void ShadowsHighlights::setBatchMode (bool batchMode) { @@ -162,6 +203,7 @@ void ShadowsHighlights::setBatchMode (bool batchMode) h_tonalwidth->showEditedCB (); shadows->showEditedCB (); s_tonalwidth->showEditedCB (); + colorspace->append(M("GENERAL_UNCHANGED")); } void ShadowsHighlights::setAdjusterBehavior (bool hadd, bool sadd) diff --git a/rtgui/shadowshighlights.h b/rtgui/shadowshighlights.h index 96642bfc0..4b6daa9dc 100644 --- a/rtgui/shadowshighlights.h +++ b/rtgui/shadowshighlights.h @@ -32,6 +32,9 @@ protected: Adjuster* shadows; Adjuster* s_tonalwidth; Adjuster* radius; + MyComboBoxText *colorspace; + + rtengine::ProcEvent EvSHColorspace; public: @@ -43,10 +46,13 @@ public: void setBatchMode (bool batchMode); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); void enabledChanged (); void setAdjusterBehavior (bool hadd, bool sadd); void trimValues (rtengine::procparams::ProcParams* pp); + + void colorspaceChanged(); }; #endif diff --git a/rtgui/sharpenedge.cc b/rtgui/sharpenedge.cc index 8849ffa72..03675a3bf 100644 --- a/rtgui/sharpenedge.cc +++ b/rtgui/sharpenedge.cc @@ -129,7 +129,7 @@ void SharpenEdge::chanthree_toggled () } } -void SharpenEdge::adjusterChanged (Adjuster* a, double newval) +void SharpenEdge::adjusterChanged(Adjuster* a, double newval) { if (listener && getEnabled()) { Glib::ustring value = a->getTextValue(); @@ -142,6 +142,10 @@ void SharpenEdge::adjusterChanged (Adjuster* a, double newval) } } +void SharpenEdge::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void SharpenEdge::setBatchMode(bool batchMode) { passes->showEditedCB (); diff --git a/rtgui/sharpenedge.h b/rtgui/sharpenedge.h index f27d4ecee..82f796cb5 100644 --- a/rtgui/sharpenedge.h +++ b/rtgui/sharpenedge.h @@ -51,6 +51,7 @@ public: void trimValues (rtengine::procparams::ProcParams* pp); void setAdjusterBehavior (bool amountadd, bool passadd); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled (Adjuster* a, bool newval); void enabledChanged (); void chanthree_toggled (); diff --git a/rtgui/sharpening.cc b/rtgui/sharpening.cc index f3bad9f3a..3614594ea 100644 --- a/rtgui/sharpening.cc +++ b/rtgui/sharpening.cc @@ -304,9 +304,8 @@ void Sharpening::setDefaults (const ProcParams* defParams, const ParamsEdited* p } } -void Sharpening::adjusterChanged (Adjuster* a, double newval) +void Sharpening::adjusterChanged(Adjuster* a, double newval) { - if (listener && (multiImage || getEnabled()) ) { Glib::ustring costr; @@ -343,15 +342,35 @@ void Sharpening::adjusterChanged (Adjuster* a, double newval) } } -void Sharpening::adjusterChanged (ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight) +void Sharpening::adjusterAutoToggled(Adjuster* a, bool newval) { - if (listener && (multiImage || getEnabled()) ) { - if(a == threshold) { - listener->panelChanged (EvShrThresh, threshold->getHistoryString()); +} + +void Sharpening::adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop) +{ +} + +void Sharpening::adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight) +{ +} + +void Sharpening::adjusterChanged(ThresholdAdjuster* a, int newBottom, int newTop) +{ +} + +void Sharpening::adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight) +{ + if (listener && (multiImage || getEnabled())) { + if (a == threshold) { + listener->panelChanged(EvShrThresh, threshold->getHistoryString()); } } } +void Sharpening::adjusterChanged2(ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR) +{ +} + void Sharpening::enabledChanged () { diff --git a/rtgui/sharpening.h b/rtgui/sharpening.h index 9bcbbbc20..ed22357fa 100644 --- a/rtgui/sharpening.h +++ b/rtgui/sharpening.h @@ -65,13 +65,19 @@ public: void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr); void setBatchMode (bool batchMode); - void adjusterChanged (Adjuster* a, double newval); - void adjusterChanged (ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight); + void adjusterChanged(Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); void enabledChanged (); void edgesonly_toggled (); void halocontrol_toggled (); void method_changed (); + void adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop); + void adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight); + void adjusterChanged(ThresholdAdjuster* a, int newBottom, int newTop); + void adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight); + void adjusterChanged2(ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR); + void setAdjusterBehavior (bool contrastadd, bool radiusadd, bool amountadd, bool dampingadd, bool iteradd, bool edgetoladd, bool haloctrladd); void trimValues (rtengine::procparams::ProcParams* pp); }; diff --git a/rtgui/sharpenmicro.cc b/rtgui/sharpenmicro.cc index 9beb5a340..7e981db96 100644 --- a/rtgui/sharpenmicro.cc +++ b/rtgui/sharpenmicro.cc @@ -137,10 +137,10 @@ void SharpenMicro::matrix_toggled () } } -void SharpenMicro::adjusterChanged (Adjuster* a, double newval) +void SharpenMicro::adjusterChanged(Adjuster* a, double newval) { if (listener && getEnabled()) { - Glib::ustring value = a->getTextValue(); + const Glib::ustring value = a->getTextValue(); if (a == amount) { listener->panelChanged (EvSharpenMicroAmount, value); @@ -152,6 +152,10 @@ void SharpenMicro::adjusterChanged (Adjuster* a, double newval) } } +void SharpenMicro::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void SharpenMicro::setBatchMode(bool batchMode) { amount->showEditedCB (); diff --git a/rtgui/sharpenmicro.h b/rtgui/sharpenmicro.h index e1fc0d7e0..19c962841 100644 --- a/rtgui/sharpenmicro.h +++ b/rtgui/sharpenmicro.h @@ -54,6 +54,7 @@ public: void trimValues (rtengine::procparams::ProcParams* pp); void setAdjusterBehavior (bool amountadd, bool contrastadd, bool uniformityadd); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled (Adjuster* a, bool newval); void enabledChanged (); void matrix_toggled (); diff --git a/rtgui/shcselector.h b/rtgui/shcselector.h index 92d4c21ba..5e02342d5 100644 --- a/rtgui/shcselector.h +++ b/rtgui/shcselector.h @@ -25,8 +25,8 @@ class SHCListener { public: - virtual ~SHCListener() {} - virtual void shcChanged () {} + virtual ~SHCListener() = default; + virtual void shcChanged() = 0; }; class SHCSelector : public Gtk::DrawingArea, BackBuffer diff --git a/rtgui/softlight.cc b/rtgui/softlight.cc index cac534ce3..0ee4c64b9 100644 --- a/rtgui/softlight.cc +++ b/rtgui/softlight.cc @@ -86,6 +86,11 @@ void SoftLight::adjusterChanged(Adjuster* a, double newval) } +void SoftLight::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + + void SoftLight::enabledChanged () { if (listener) { diff --git a/rtgui/softlight.h b/rtgui/softlight.h index dc51ac730..ad537894e 100644 --- a/rtgui/softlight.h +++ b/rtgui/softlight.h @@ -41,6 +41,7 @@ public: void setBatchMode(bool batchMode); void adjusterChanged(Adjuster *a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); void enabledChanged(); void setAdjusterBehavior(bool strengthAdd); }; diff --git a/rtgui/thresholdadjuster.h b/rtgui/thresholdadjuster.h index 200fe2175..fea4e9094 100644 --- a/rtgui/thresholdadjuster.h +++ b/rtgui/thresholdadjuster.h @@ -33,16 +33,16 @@ class ThresholdAdjusterListener { public: - virtual ~ThresholdAdjusterListener() {} + virtual ~ThresholdAdjusterListener() = default; // to be used by listener that has created a ThresholdAdjuster with with single threshold and precision > 0 - virtual void adjusterChanged (ThresholdAdjuster* a, double newBottom, double newTop) {} + virtual void adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop) = 0; // to be used by listener that has created a ThresholdAdjuster with with double threshold and precision > 0 - virtual void adjusterChanged (ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight) {} + virtual void adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight) = 0; // to be used by listener that has created a ThresholdAdjuster with with single threshold and precision == 0 - virtual void adjusterChanged (ThresholdAdjuster* a, int newBottom, int newTop) {} + virtual void adjusterChanged(ThresholdAdjuster* a, int newBottom, int newTop) = 0; // to be used by listener that has created a ThresholdAdjuster with with double threshold and precision == 0 - virtual void adjusterChanged (ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight) {} - virtual void adjusterChanged2 (ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR) {} + virtual void adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight) = 0; + virtual void adjusterChanged2(ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR) = 0; }; diff --git a/rtgui/thumbimageupdater.h b/rtgui/thumbimageupdater.h index 3b34c9456..820ddca8f 100644 --- a/rtgui/thumbimageupdater.h +++ b/rtgui/thumbimageupdater.h @@ -30,9 +30,7 @@ class ThumbImageUpdateListener { public: - virtual ~ThumbImageUpdateListener() - { - } + virtual ~ThumbImageUpdateListener() = default; /** * @brief Called when thumbnail image is update @@ -43,9 +41,7 @@ public: * * @note no locks are held when called back */ - virtual void updateImage(rtengine::IImage8* img, double scale, rtengine::procparams::CropParams cropParams) - { - } + virtual void updateImage(rtengine::IImage8* img, double scale, const rtengine::procparams::CropParams& cropParams) = 0; }; class ThumbImageUpdater : diff --git a/rtgui/thumbnail.cc b/rtgui/thumbnail.cc index 0f0433878..c2d23eab2 100644 --- a/rtgui/thumbnail.cc +++ b/rtgui/thumbnail.cc @@ -417,10 +417,11 @@ bool Thumbnail::hasProcParams () const return pparamsValid; } -void Thumbnail::setProcParams (const ProcParams& pp, ParamsEdited* pe, int whoChangedIt, bool updateCacheNow) +void Thumbnail::setProcParams (const ProcParams& pp, ParamsEdited* pe, int whoChangedIt, bool updateCacheNow, bool resetToDefault) { const bool needsReprocessing = - pparams.toneCurve != pp.toneCurve + resetToDefault + || pparams.toneCurve != pp.toneCurve || pparams.labCurve != pp.labCurve || pparams.localContrast != pp.localContrast || pparams.rgbCurves != pp.rgbCurves diff --git a/rtgui/thumbnail.h b/rtgui/thumbnail.h index 93d85cc01..ae627c22f 100644 --- a/rtgui/thumbnail.h +++ b/rtgui/thumbnail.h @@ -87,7 +87,7 @@ public: // Use this to create params on demand for update ; if flaggingMode=true, the procparams is created for a file being flagged (inTrash, rank, colorLabel) rtengine::procparams::ProcParams* createProcParamsForUpdate (bool returnParams, bool force, bool flaggingMode = false); - void setProcParams (const rtengine::procparams::ProcParams& pp, ParamsEdited* pe = nullptr, int whoChangedIt = -1, bool updateCacheNow = true); + void setProcParams (const rtengine::procparams::ProcParams& pp, ParamsEdited* pe = nullptr, int whoChangedIt = -1, bool updateCacheNow = true, bool resetToDefault = false); void clearProcParams (int whoClearedIt = -1); void loadProcParams (); diff --git a/rtgui/thumbnaillistener.h b/rtgui/thumbnaillistener.h index 3c4200838..99a9a9286 100644 --- a/rtgui/thumbnaillistener.h +++ b/rtgui/thumbnaillistener.h @@ -19,16 +19,13 @@ #ifndef _THUMBNAILLISTENER_ #define _THUMBNAILLISTENER_ -#include "thumbnail.h" - class Thumbnail; + class ThumbnailListener { - public: - - virtual void procParamsChanged (Thumbnail* thm, int whoChangedIt) {} - + virtual ~ThumbnailListener() = default; + virtual void procParamsChanged(Thumbnail* thm, int whoChangedIt) = 0; }; #endif diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc index 19326be26..06abe1fd2 100644 --- a/rtgui/tonecurve.cc +++ b/rtgui/tonecurve.cc @@ -587,9 +587,8 @@ float ToneCurve::blendPipetteValues(CurveEditor *ce, float chan1, float chan2, f return CurveListener::blendPipetteValues(ce, chan1, chan2, chan3); } -void ToneCurve::adjusterChanged (Adjuster* a, double newval) +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); @@ -641,6 +640,10 @@ void ToneCurve::adjusterChanged (Adjuster* a, double newval) } } +void ToneCurve::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void ToneCurve::neutral_pressed () { // This method deselects auto levels and HL reconstruction auto @@ -808,25 +811,6 @@ void ToneCurve::waitForAutoExp () histmatching->set_sensitive(false); } -void ToneCurve::autoExpChanged (double expcomp, int bright, int contr, int black, int hlcompr, int hlcomprthresh, bool hlrecons) -{ - nextBlack = black; - nextExpcomp = expcomp; - nextBrightness = bright; - nextContrast = contr; - nextHlcompr = hlcompr; - nextHlcomprthresh = hlcomprthresh; - nextHLRecons = hlrecons; - - const auto func = [](gpointer data) -> gboolean { - static_cast(data)->autoExpComputed_(); - - return FALSE; - }; - - idle_register.add(func, this); -} - void ToneCurve::enableAll () { @@ -937,10 +921,20 @@ void ToneCurve::trimValues (rtengine::procparams::ProcParams* pp) saturation->trimValue(pp->toneCurve.saturation); } -void ToneCurve::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, /*LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histLRETI) +void ToneCurve::updateCurveBackgroundHistogram( + const LUTu& histToneCurve, + const LUTu& histLCurve, + const LUTu& histCCurve, + const LUTu& histLCAM, + const LUTu& histCCAM, + const LUTu& histRed, + const LUTu& histGreen, + const LUTu& histBlue, + const LUTu& histLuma, + const LUTu& histLRETI +) { - - shape->updateBackgroundHistogram (histToneCurve); + shape->updateBackgroundHistogram(histToneCurve); } @@ -973,22 +967,6 @@ void ToneCurve::histmatchingToggled() } } - -void ToneCurve::autoMatchedToneCurveChanged(rtengine::procparams::ToneCurveParams::TcMode curveMode, const std::vector &curve) -{ - nextToneCurveMode = curveMode; - nextToneCurve = curve; - - const auto func = [](gpointer data) -> gboolean { - static_cast(data)->histmatchingComputed(); - - return FALSE; - }; - - idle_register.add(func, this); -} - - bool ToneCurve::histmatchingComputed() { GThreadLock lock; @@ -1024,3 +1002,36 @@ bool ToneCurve::histmatchingComputed() return false; } + +void ToneCurve::autoExpChanged(double expcomp, int bright, int contr, int black, int hlcompr, int hlcomprthresh, bool hlrecons) +{ + nextBlack = black; + nextExpcomp = expcomp; + nextBrightness = bright; + nextContrast = contr; + nextHlcompr = hlcompr; + nextHlcomprthresh = hlcomprthresh; + nextHLRecons = hlrecons; + + const auto func = [](gpointer data) -> gboolean { + static_cast(data)->autoExpComputed_(); + + return FALSE; + }; + + idle_register.add(func, this); +} + +void ToneCurve::autoMatchedToneCurveChanged(rtengine::procparams::ToneCurveParams::TcMode curveMode, const std::vector& curve) +{ + nextToneCurveMode = curveMode; + nextToneCurve = curve; + + const auto func = [](gpointer data) -> gboolean { + static_cast(data)->histmatchingComputed(); + + return FALSE; + }; + + idle_register.add(func, this); +} diff --git a/rtgui/tonecurve.h b/rtgui/tonecurve.h index ce431986a..53ec2fa9f 100644 --- a/rtgui/tonecurve.h +++ b/rtgui/tonecurve.h @@ -102,12 +102,12 @@ public: virtual float blendPipetteValues (CurveEditor *ce, float chan1, float chan2, float chan3); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); void neutral_pressed (); void autolevels_toggled (); void clip_changed (); bool clip_changed_ (); void waitForAutoExp (); - void autoExpChanged (double expcomp, int bright, int contr, int black, int hlcompr, int hlcomprthresh, bool hlrecons); bool autoExpComputed_ (); void enableAll (); void curveChanged (CurveEditor* ce); @@ -117,12 +117,25 @@ public: bool curveMode2Changed_ (); void expandCurve (bool isExpanded); bool isCurveExpanded (); - void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve,/* LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histLRETI); + void updateCurveBackgroundHistogram( + const LUTu& histToneCurve, + const LUTu& histLCurve, + const LUTu& histCCurve, + const LUTu& histLCAM, + const LUTu& histCCAM, + const LUTu& histRed, + const LUTu& histGreen, + const LUTu& histBlue, + const LUTu& histLuma, + const LUTu& histLRETI + ); void histmatchingToggled(); - void autoMatchedToneCurveChanged(rtengine::procparams::ToneCurveParams::TcMode curveMode, const std::vector &curve); bool histmatchingComputed(); + void autoExpChanged(double expcomp, int bright, int contr, int black, int hlcompr, int hlcomprthresh, bool hlrecons); + void autoMatchedToneCurveChanged(rtengine::procparams::ToneCurveParams::TcMode curveMode, const std::vector& curve); + void setRaw (bool raw); void hrenabledChanged (); diff --git a/rtgui/toolbar.h b/rtgui/toolbar.h index 42e764952..2d859eac7 100644 --- a/rtgui/toolbar.h +++ b/rtgui/toolbar.h @@ -28,12 +28,12 @@ class ToolBarListener { public: - virtual ~ToolBarListener() {} + virtual ~ToolBarListener() = default; /// Callback when a tool is selected - virtual void toolSelected (ToolMode tool) {} + virtual void toolSelected(ToolMode tool) = 0; /// Callback when the Edit mode is stopped - virtual void editModeSwitchedOff () {} + virtual void editModeSwitchedOff() = 0; }; class ToolBar : public Gtk::HBox diff --git a/rtgui/toolpanel.h b/rtgui/toolpanel.h index fd7d27fbe..9f2d031c0 100644 --- a/rtgui/toolpanel.h +++ b/rtgui/toolpanel.h @@ -33,11 +33,9 @@ class FoldableToolPanel; class ToolPanelListener { - public: - - virtual ~ToolPanelListener() {} - virtual void panelChanged (rtengine::ProcEvent event, const Glib::ustring& descr) {} + virtual ~ToolPanelListener() = default; + virtual void panelChanged(const rtengine::ProcEvent& event, const Glib::ustring& descr) = 0; }; /// @brief This class control the space around the group of tools inside a tab, as well as the space separating each tool. */ diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index 6e8e80cf2..6cc32a477 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -336,9 +336,8 @@ void ToolPanelCoordinator::imageTypeChanged (bool isRaw, bool isBayer, bool isXt } -void ToolPanelCoordinator::panelChanged (rtengine::ProcEvent event, const Glib::ustring& descr) +void ToolPanelCoordinator::panelChanged(const rtengine::ProcEvent& event, const Glib::ustring& descr) { - if (!ipc) { return; } @@ -404,9 +403,14 @@ void ToolPanelCoordinator::panelChanged (rtengine::ProcEvent event, const Glib:: } } -void ToolPanelCoordinator::profileChange (const PartialProfile *nparams, rtengine::ProcEvent event, const Glib::ustring& descr, const ParamsEdited* paramsEdited, bool fromLastSave) +void ToolPanelCoordinator::profileChange( + const PartialProfile* nparams, + const rtengine::ProcEvent& event, + const Glib::ustring& descr, + const ParamsEdited* paramsEdited, + bool fromLastSave +) { - int fw, fh, tr; if (!ipc) { @@ -486,13 +490,13 @@ void ToolPanelCoordinator::profileChange (const PartialProfile *nparams, rtengi } } -void ToolPanelCoordinator::setDefaults (ProcParams* defparams) +void ToolPanelCoordinator::setDefaults(const ProcParams* defparams) { - - if (defparams) + if (defparams) { for (auto toolPanel : toolPanels) { - toolPanel->setDefaults (defparams); + toolPanel->setDefaults(defparams); } + } } CropGUIListener* ToolPanelCoordinator::getCropGUIListener () @@ -617,33 +621,8 @@ void ToolPanelCoordinator::writeToolExpandedStatus (std::vector &tpOpen) } -void ToolPanelCoordinator::cropSelectionReady () +void ToolPanelCoordinator::spotWBselected(int x, int y, Thumbnail* thm) { - - toolBar->setTool (TMHand); - - if (!ipc) { - return; - } -} - -void ToolPanelCoordinator::rotateSelectionReady (double rotate_deg, Thumbnail* thm) -{ - - toolBar->setTool (TMHand); - - if (!ipc) { - return; - } - - if (rotate_deg != 0.0) { - rotate->straighten (rotate_deg); - } -} - -void ToolPanelCoordinator::spotWBselected (int x, int y, Thumbnail* thm) -{ - if (!ipc) { return; } @@ -663,7 +642,6 @@ void ToolPanelCoordinator::spotWBselected (int x, int y, Thumbnail* thm) void ToolPanelCoordinator::sharpMaskSelected(bool sharpMask) { - if (!ipc) { return; } @@ -672,7 +650,42 @@ void ToolPanelCoordinator::sharpMaskSelected(bool sharpMask) ipc->endUpdateParams (rtengine::EvShrEnabled); } +int ToolPanelCoordinator::getSpotWBRectSize() const +{ + return whitebalance->getSize(); +} +void ToolPanelCoordinator::cropSelectionReady() +{ + toolBar->setTool (TMHand); + + if (!ipc) { + return; + } +} + +void ToolPanelCoordinator::rotateSelectionReady(double rotate_deg, Thumbnail* thm) +{ + toolBar->setTool (TMHand); + + if (!ipc) { + return; + } + + if (rotate_deg != 0.0) { + rotate->straighten (rotate_deg); + } +} + +ToolBar* ToolPanelCoordinator::getToolBar() const +{ + return toolBar; +} + +CropGUIListener* ToolPanelCoordinator::startCropEditing(Thumbnail* thm) +{ + return crop; +} void ToolPanelCoordinator::autoCropRequested () { @@ -783,28 +796,31 @@ void ToolPanelCoordinator::cropSelectRequested () toolBar->setTool (TMCropSelect); } -void ToolPanelCoordinator::saveInputICCReference (Glib::ustring fname, bool apply_wb) +void ToolPanelCoordinator::saveInputICCReference(const Glib::ustring& fname, bool apply_wb) { - if (ipc) { ipc->saveInputICCReference (fname, apply_wb); } } -int ToolPanelCoordinator::getSpotWBRectSize () +void ToolPanelCoordinator::updateCurveBackgroundHistogram( + const LUTu& histToneCurve, + const LUTu& histLCurve, + const LUTu& histCCurve, + const LUTu& histLCAM, + const LUTu& histCCAM, + const LUTu& histRed, + const LUTu& histGreen, + const LUTu& histBlue, + const LUTu& histLuma, + const LUTu& histLRETI +) { - - return whitebalance->getSize (); -} - -void ToolPanelCoordinator::updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, /*LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histLRETI) -{ - colorappearance->updateCurveBackgroundHistogram (histToneCurve, histLCurve, histCCurve, /*histCLurve, histLLCurve,*/ histLCAM, histCCAM, histRed, histGreen, histBlue, histLuma, histLRETI); - toneCurve->updateCurveBackgroundHistogram (histToneCurve, histLCurve, histCCurve,/* histCLurve, histLLCurve,*/ histLCAM, histCCAM, histRed, histGreen, histBlue, histLuma, histLRETI); - lcurve->updateCurveBackgroundHistogram (histToneCurve, histLCurve, histCCurve, /*histCLurve, histLLCurve,*/ histLCAM, histCCAM, histRed, histGreen, histBlue, histLuma, histLRETI); - rgbcurves->updateCurveBackgroundHistogram (histToneCurve, histLCurve, histCCurve,/* histCLurve, histLLCurve, */histLCAM, histCCAM, histRed, histGreen, histBlue, histLuma, histLRETI); - retinex->updateCurveBackgroundHistogram (histToneCurve, histLCurve, histCCurve,/* histCLurve, histLLCurve, */histLCAM, histCCAM, histRed, histGreen, histBlue, histLuma, histLRETI); - + colorappearance->updateCurveBackgroundHistogram(histToneCurve, histLCurve, histCCurve, histLCAM, histCCAM, histRed, histGreen, histBlue, histLuma, histLRETI); + toneCurve->updateCurveBackgroundHistogram(histToneCurve, histLCurve, histCCurve,histLCAM, histCCAM, histRed, histGreen, histBlue, histLuma, histLRETI); + lcurve->updateCurveBackgroundHistogram(histToneCurve, histLCurve, histCCurve, histLCAM, histCCAM, histRed, histGreen, histBlue, histLuma, histLRETI); + rgbcurves->updateCurveBackgroundHistogram(histToneCurve, histLCurve, histCCurve, histLCAM, histCCAM, histRed, histGreen, histBlue, histLuma, histLRETI); + retinex->updateCurveBackgroundHistogram(histToneCurve, histLCurve, histCCurve, histLCAM, histCCAM, histRed, histGreen, histBlue, histLuma, histLRETI); } void ToolPanelCoordinator::foldAllButOne (Gtk::Box* parent, FoldableToolPanel* openedSection) diff --git a/rtgui/toolpanelcoord.h b/rtgui/toolpanelcoord.h index 866efafa5..b5a23f690 100644 --- a/rtgui/toolpanelcoord.h +++ b/rtgui/toolpanelcoord.h @@ -84,7 +84,8 @@ class ImageEditorCoordinator; -class ToolPanelCoordinator : public ToolPanelListener, +class ToolPanelCoordinator : + public ToolPanelListener, public ToolBarListener, public ProfileChangeListener, public WBProvider, @@ -97,9 +98,7 @@ class ToolPanelCoordinator : public ToolPanelListener, public ImageAreaToolListener, public rtengine::ImageTypeListener { - protected: - WhiteBalance* whitebalance; Vignetting* vignetting; Gradient* gradient; @@ -192,11 +191,9 @@ protected: void updateVScrollbars (bool hide); private: - EditDataProvider *editDataProvider; public: - CoarsePanel* coarse; Gtk::Notebook* toolPanelNotebook; @@ -207,7 +204,18 @@ public: { return hasChanged; } - void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve, /*LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histLRETI); + void updateCurveBackgroundHistogram( + const LUTu& histToneCurve, + const LUTu& histLCurve, + const LUTu& histCCurve, + const LUTu& histLCAM, + const LUTu& histCCAM, + const LUTu& histRed, + const LUTu& histGreen, + const LUTu& histBlue, + const LUTu& histLuma, + const LUTu& histLRETI + ); void foldAllButOne (Gtk::Box* parent, FoldableToolPanel* openedSection); // multiple listeners can be added that are notified on changes (typical: profile panel and the history) @@ -217,14 +225,20 @@ public: } // toolpanellistener interface - void panelChanged (rtengine::ProcEvent event, const Glib::ustring& descr); + void panelChanged(const rtengine::ProcEvent& event, const Glib::ustring& descr); void imageTypeChanged (bool isRaw, bool isBayer, bool isXtrans, bool isMono = false); // void autoContrastChanged (double autoContrast); // profilechangelistener interface - void profileChange (const rtengine::procparams::PartialProfile* nparams, rtengine::ProcEvent event, const Glib::ustring& descr, const ParamsEdited* paramsEdited = nullptr, bool fromLastSave = false); - void setDefaults (rtengine::procparams::ProcParams* defparams); + void profileChange( + const rtengine::procparams::PartialProfile* nparams, + const rtengine::ProcEvent& event, + const Glib::ustring& descr, + const ParamsEdited* paramsEdited = nullptr, + bool fromLastSave = false + ); + void setDefaults(const rtengine::procparams::ProcParams* defparams); // DirSelectionListener interface void dirSelected (const Glib::ustring& dirname, const Glib::ustring& openfile); @@ -279,22 +293,16 @@ public: void cropSelectRequested (); // icmpanellistener interface - void saveInputICCReference (Glib::ustring fname, bool apply_wb); + void saveInputICCReference(const Glib::ustring& fname, bool apply_wb); // imageareatoollistener interface - void spotWBselected (int x, int y, Thumbnail* thm = nullptr); - void sharpMaskSelected (bool sharpMask); - void cropSelectionReady (); - void rotateSelectionReady (double rotate_deg, Thumbnail* thm = nullptr); - ToolBar* getToolBar () - { - return toolBar; - } - int getSpotWBRectSize (); - CropGUIListener* startCropEditing (Thumbnail* thm = nullptr) - { - return crop; - } + void spotWBselected(int x, int y, Thumbnail* thm = nullptr); + void sharpMaskSelected(bool sharpMask); + int getSpotWBRectSize() const; + void cropSelectionReady(); + void rotateSelectionReady(double rotate_deg, Thumbnail* thm = nullptr); + ToolBar* getToolBar() const; + CropGUIListener* startCropEditing(Thumbnail* thm = nullptr); void updateTPVScrollbar (bool hide); bool handleShortcutKey (GdkEventKey* event); diff --git a/rtgui/vibrance.cc b/rtgui/vibrance.cc index 51cb31a02..0069576e0 100644 --- a/rtgui/vibrance.cc +++ b/rtgui/vibrance.cc @@ -273,7 +273,7 @@ void Vibrance::pastsattog_toggled () } } -void Vibrance::adjusterChanged (Adjuster* a, double newval) +void Vibrance::adjusterChanged(Adjuster* a, double newval) { if (a == pastels && pastSatTog->get_active()) { saturated->setValue (newval); @@ -290,13 +290,32 @@ void Vibrance::adjusterChanged (Adjuster* a, double newval) } } -void Vibrance::adjusterChanged (ThresholdAdjuster* a, int newBottom, int newTop) +void Vibrance::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + +void Vibrance::adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop) +{ +} + +void Vibrance::adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight) +{ +} + +void Vibrance::adjusterChanged(ThresholdAdjuster* a, int newBottom, int newTop) { if (listener && getEnabled()) { listener->panelChanged (EvVibrancePastSatThreshold, psThreshold->getHistoryString()); } } +void Vibrance::adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight) +{ +} + +void Vibrance::adjusterChanged2(ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR) +{ +} void Vibrance::setBatchMode(bool batchMode) { diff --git a/rtgui/vibrance.h b/rtgui/vibrance.h index ceb010434..62faf0c85 100644 --- a/rtgui/vibrance.h +++ b/rtgui/vibrance.h @@ -61,10 +61,16 @@ public: void trimValues (rtengine::procparams::ProcParams* pp); void setAdjusterBehavior (bool pastelsadd, bool saturatedadd); void adjusterChanged (Adjuster* a, double newval); - void adjusterChanged (ThresholdAdjuster* a, int newBottom, int newTop); + void adjusterAutoToggled (Adjuster* a, bool newval); void curveChanged (); void autoOpenCurve (); + void adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop); + void adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight); + void adjusterChanged(ThresholdAdjuster* a, int newBottom, int newTop); + void adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight); + void adjusterChanged2(ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR); + void enabledChanged (); void protectskins_toggled (); void avoidcolorshift_toggled (); diff --git a/rtgui/vignetting.cc b/rtgui/vignetting.cc index dd8d0a2b1..34559ef21 100644 --- a/rtgui/vignetting.cc +++ b/rtgui/vignetting.cc @@ -112,9 +112,8 @@ void Vignetting::setDefaults (const ProcParams* defParams, const ParamsEdited* p } } -void Vignetting::adjusterChanged (Adjuster* a, double newval) +void Vignetting::adjusterChanged(Adjuster* a, double newval) { - if (listener) { if (a == amount) { listener->panelChanged (EvVignettingAmount, amount->getTextValue()); @@ -128,6 +127,10 @@ void Vignetting::adjusterChanged (Adjuster* a, double newval) } } +void Vignetting::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void Vignetting::setAdjusterBehavior (bool amountadd, bool radiusadd, bool strengthadd, bool centeradd) { diff --git a/rtgui/vignetting.h b/rtgui/vignetting.h index 029f16808..975bf7344 100644 --- a/rtgui/vignetting.h +++ b/rtgui/vignetting.h @@ -42,7 +42,8 @@ public: void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr); void setBatchMode (bool batchMode); - void adjusterChanged (Adjuster* a, double newval); + void adjusterChanged(Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); void setAdjusterBehavior (bool amountadd, bool radiusadd, bool strengthadd, bool centeradd); void trimValues (rtengine::procparams::ProcParams* pp); }; diff --git a/rtgui/wavelet.cc b/rtgui/wavelet.cc index 7acce1e90..81fc282ab 100644 --- a/rtgui/wavelet.cc +++ b/rtgui/wavelet.cc @@ -1921,7 +1921,8 @@ void Wavelet::setDefaults (const ProcParams* defParams, const ParamsEdited* pedi } } } -void Wavelet::adjusterChanged (ThresholdAdjuster* a, double newBottom, double newTop) + +void Wavelet::adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop) { if (listener && (multiImage || getEnabled()) ) { if(a == level0noise) { @@ -1941,8 +1942,19 @@ void Wavelet::adjusterChanged (ThresholdAdjuster* a, double newBottom, double ne } } +void Wavelet::adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight) +{ +} -void Wavelet::adjusterChanged2 (ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR) +void Wavelet::adjusterChanged(ThresholdAdjuster* a, int newBottom, int newTop) +{ +} + +void Wavelet::adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight) +{ +} + +void Wavelet::adjusterChanged2(ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR) { if (listener && (multiImage || getEnabled()) ) { if(a == hueskin) { @@ -2389,7 +2401,7 @@ void Wavelet::adjusterUpdateUI (Adjuster* a) */ } -void Wavelet::adjusterChanged (Adjuster* a, double newval) +void Wavelet::adjusterChanged(Adjuster* a, double newval) { if (listener && (multiImage || getEnabled()) ) { if (a == edgthresh) { @@ -2517,6 +2529,10 @@ void Wavelet::adjusterChanged (Adjuster* a, double newval) } } +void Wavelet::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void Wavelet::enabledUpdateUI () { if (!batchMode) { diff --git a/rtgui/wavelet.h b/rtgui/wavelet.h index b73045228..5cbb5bfe3 100644 --- a/rtgui/wavelet.h +++ b/rtgui/wavelet.h @@ -43,9 +43,8 @@ public: ~Wavelet (); bool wavComputed_ (); - void adjusterChanged (ThresholdAdjuster* a, double newBottom, double newTop); - void adjusterChanged (Adjuster* a, double newval); - void adjusterChanged2 (ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR); + void adjusterChanged(Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); void autoOpenCurve (); void curveChanged (CurveEditor* ce); void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr); @@ -57,6 +56,12 @@ public: void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr); void writeOptions (std::vector &tpOpen); + void adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop); + void adjusterChanged(ThresholdAdjuster* a, double newBottomLeft, double newTopLeft, double newBottomRight, double newTopRight); + void adjusterChanged(ThresholdAdjuster* a, int newBottom, int newTop); + void adjusterChanged(ThresholdAdjuster* a, int newBottomLeft, int newTopLeft, int newBottomRight, int newTopRight); + void adjusterChanged2(ThresholdAdjuster* a, int newBottomL, int newTopL, int newBottomR, int newTopR); + private: void foldAllButMe (GdkEventButton* event, MyExpander *expander); diff --git a/rtgui/whitebalance.cc b/rtgui/whitebalance.cc index 681ac16c2..1257a9c58 100644 --- a/rtgui/whitebalance.cc +++ b/rtgui/whitebalance.cc @@ -370,7 +370,7 @@ void WhiteBalance::enabledChanged() } -void WhiteBalance::adjusterChanged (Adjuster* a, double newval) +void WhiteBalance::adjusterChanged(Adjuster* a, double newval) { int tVal = (int)temp->getValue(); double gVal = green->getValue(); @@ -433,6 +433,10 @@ void WhiteBalance::adjusterChanged (Adjuster* a, double newval) } } +void WhiteBalance::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void WhiteBalance::optChanged () { Gtk::TreeModel::Row row = getActiveMethod(); diff --git a/rtgui/whitebalance.h b/rtgui/whitebalance.h index 8603d1c59..08ec05047 100644 --- a/rtgui/whitebalance.h +++ b/rtgui/whitebalance.h @@ -28,10 +28,9 @@ class SpotWBListener { - public: - virtual ~SpotWBListener () {} - virtual void spotWBRequested (int size) {} + virtual ~SpotWBListener() = default; + virtual void spotWBRequested(int size) = 0; }; class WhiteBalance : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel, public rtengine::AutoWBListener @@ -107,7 +106,8 @@ public: void optChanged (); void spotPressed (); void spotSizeChanged (); - void adjusterChanged (Adjuster* a, double newval); + void adjusterChanged(Adjuster* a, double newval); + void adjusterAutoToggled(Adjuster* a, bool newval); int getSize (); void setWBProvider (WBProvider* p) { diff --git a/rtgui/windirmonitor.h b/rtgui/windirmonitor.h index b9be67a5a..8e18b7914 100644 --- a/rtgui/windirmonitor.h +++ b/rtgui/windirmonitor.h @@ -27,7 +27,7 @@ class WinDirChangeListener public: virtual ~WinDirChangeListener() = default; - virtual void winDirChanged () {} + virtual void winDirChanged() = 0; }; class WinDirMonitor : public Glib::Object diff --git a/rtgui/xtransprocess.cc b/rtgui/xtransprocess.cc index df771d8ca..670ddccf3 100644 --- a/rtgui/xtransprocess.cc +++ b/rtgui/xtransprocess.cc @@ -189,7 +189,7 @@ void XTransProcess::setDefaults(const rtengine::procparams::ProcParams* defParam } } -void XTransProcess::adjusterChanged (Adjuster* a, double newval) +void XTransProcess::adjusterChanged(Adjuster* a, double newval) { if (listener) { if (a == ccSteps) { @@ -209,6 +209,10 @@ void XTransProcess::checkBoxToggled (CheckBox* c, CheckValue newval) } } +void XTransProcess::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void XTransProcess::methodChanged () { const int curSelection = method->get_active_row_number(); diff --git a/rtgui/xtransprocess.h b/rtgui/xtransprocess.h index af3f25596..a90a97326 100644 --- a/rtgui/xtransprocess.h +++ b/rtgui/xtransprocess.h @@ -58,6 +58,7 @@ public: void autoContrastChanged (double autoContrast); void adjusterChanged(Adjuster* a, double newval); void checkBoxToggled(CheckBox* c, CheckValue newval); + void adjusterAutoToggled(Adjuster* a, bool newval); }; #endif diff --git a/rtgui/xtransrawexposure.cc b/rtgui/xtransrawexposure.cc index 480112537..19fcb0c46 100644 --- a/rtgui/xtransrawexposure.cc +++ b/rtgui/xtransrawexposure.cc @@ -90,7 +90,7 @@ void XTransRAWExposure::write( rtengine::procparams::ProcParams* pp, ParamsEdite } -void XTransRAWExposure::adjusterChanged (Adjuster* a, double newval) +void XTransRAWExposure::adjusterChanged(Adjuster* a, double newval) { if (listener) { Glib::ustring value = a->getTextValue(); @@ -105,6 +105,10 @@ void XTransRAWExposure::adjusterChanged (Adjuster* a, double newval) } } +void XTransRAWExposure::adjusterAutoToggled(Adjuster* a, bool newval) +{ +} + void XTransRAWExposure::setBatchMode(bool batchMode) { ToolPanel::setBatchMode (batchMode); diff --git a/rtgui/xtransrawexposure.h b/rtgui/xtransrawexposure.h index 4ed046a07..fc95d5743 100644 --- a/rtgui/xtransrawexposure.h +++ b/rtgui/xtransrawexposure.h @@ -43,6 +43,7 @@ public: void setBatchMode (bool batchMode); void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr); void adjusterChanged (Adjuster* a, double newval); + void adjusterAutoToggled (Adjuster* a, bool newval); void setAdjusterBehavior (bool pexblackadd); void trimValues (rtengine::procparams::ProcParams* pp); };