diff --git a/rtdata/dcpprofiles/Fujifilm X-T10.dcp b/rtdata/dcpprofiles/Fujifilm X-T10.dcp
deleted file mode 100644
index 9794624a5..000000000
Binary files a/rtdata/dcpprofiles/Fujifilm X-T10.dcp and /dev/null differ
diff --git a/rtdata/dcpprofiles/Panasonic DC-G9.dcp b/rtdata/dcpprofiles/Panasonic DC-G9.dcp
new file mode 100644
index 000000000..64f1203a9
Binary files /dev/null and b/rtdata/dcpprofiles/Panasonic DC-G9.dcp differ
diff --git a/rtdata/dcpprofiles/Panasonic DMC-FZ1000.dcp b/rtdata/dcpprofiles/Panasonic DMC-FZ1000.dcp
new file mode 100644
index 000000000..e99ebf0d9
Binary files /dev/null and b/rtdata/dcpprofiles/Panasonic DMC-FZ1000.dcp differ
diff --git a/rtdata/languages/Deutsch b/rtdata/languages/Deutsch
index ef518868d..dd0655242 100644
--- a/rtdata/languages/Deutsch
+++ b/rtdata/languages/Deutsch
@@ -70,6 +70,7 @@
#69 25.07.2018 Erweiterung (TooWaBoo) RT 5.4
#70 25.07.2018 Korrekturen (TooWaBoo) RT 5.4
#71 28.09.2018 Korrekturen (TooWaBoo) RT 5.5
+#72 05.10.2018 Korrekturen (TooWaBoo) RT 5.5
ABOUT_TAB_BUILD;Version
ABOUT_TAB_CREDITS;Danksagungen
@@ -181,7 +182,7 @@ FILEBROWSER_APPLYPROFILE;Profil anwenden
FILEBROWSER_APPLYPROFILE_PARTIAL;Profil selektiv anwenden
FILEBROWSER_AUTODARKFRAME;Automatisches Dunkelbild
FILEBROWSER_AUTOFLATFIELD;Automatisches Weißbild
-FILEBROWSER_BROWSEPATHBUTTONHINT;Ausgewählter Pfad öffnen
+FILEBROWSER_BROWSEPATHBUTTONHINT;Ausgewählten Pfad öffnen.
FILEBROWSER_BROWSEPATHHINT;Einen Pfad eingeben:\nTaste:\nStrg + o Setzt den Cursor in das Eingabefeld\nEnter Öffnet den Pfad\nEsc Änderungen verwerfen\nUmschalt + Esc Eingabefeld verlassen\n\nSchnellnavigation:\nTaste:\n~ “Home“-Verzeichnis des Benutzers\n! Bilder-Verzeichnis des Benutzers
FILEBROWSER_CACHE;Festplatten-Cache
FILEBROWSER_CACHECLEARFROMFULL;Aus dem Festplatten-Cache entfernen (vollständig)
@@ -236,7 +237,7 @@ FILEBROWSER_POPUPSELECTALL;Alle auswählen
FILEBROWSER_POPUPTRASH;In den Papierkorb verschieben
FILEBROWSER_POPUPUNRANK;Bewertung entfernen
FILEBROWSER_POPUPUNTRASH;Aus dem Papierkorb wiederherstellen
-FILEBROWSER_QUERYBUTTONHINT;Suchfilter zurücksetzen
+FILEBROWSER_QUERYBUTTONHINT;Suchfilter zurücksetzen.
FILEBROWSER_QUERYHINT;Nur Dateien anzeigen, deren Namen die angegebene Zeichenkette beinhalten.\n\nTaste:\nStrg + f Setzt den Cursor in das Suchfeld\nEnter Suche starten\nEsc Suchfeld löschen\nUmschalt + Esc Suchfeldfeld verlassen
FILEBROWSER_QUERYLABEL; Suche:
FILEBROWSER_RANK1_TOOLTIP;Bewertung 1 *\nTaste: Umschalt + 1
@@ -248,31 +249,31 @@ FILEBROWSER_RENAMEDLGLABEL;Datei umbenennen
FILEBROWSER_RESETDEFAULTPROFILE;Profil auf Vorgabe zurücksetzen
FILEBROWSER_SELECTDARKFRAME;Dunkelbild wählen...
FILEBROWSER_SELECTFLATFIELD;Weißbild wählen...
-FILEBROWSER_SHOWCOLORLABEL1HINT;Nur rot markierte Bilder anzeigen\nTaste: Alt + 1
-FILEBROWSER_SHOWCOLORLABEL2HINT;Nur gelb markierte Bilder anzeigen\nTaste: Alt + 2
-FILEBROWSER_SHOWCOLORLABEL3HINT;Nur grün markierte Bilder anzeigen\nTaste: Alt + 3
-FILEBROWSER_SHOWCOLORLABEL4HINT;Nur blau markierte Bilder anzeigen\nTaste: Alt + 4
-FILEBROWSER_SHOWCOLORLABEL5HINT;Nur violett markierte Bilder anzeigen\nTaste: Alt + 5
-FILEBROWSER_SHOWDIRHINT;Alle Filter zurücksetzen\nTaste: d
-FILEBROWSER_SHOWEDITEDHINT;Nur bearbeitete Bilder anzeigen\nTaste: 7
-FILEBROWSER_SHOWEDITEDNOTHINT;Nur unbearbeitete Bilder anzeigen\nTaste: 6
+FILEBROWSER_SHOWCOLORLABEL1HINT;Nur rot markierte Bilder anzeigen.\nTaste: Alt + 1
+FILEBROWSER_SHOWCOLORLABEL2HINT;Nur gelb markierte Bilder anzeigen.\nTaste: Alt + 2
+FILEBROWSER_SHOWCOLORLABEL3HINT;Nur grün markierte Bilder anzeigen.\nTaste: Alt + 3
+FILEBROWSER_SHOWCOLORLABEL4HINT;Nur blau markierte Bilder anzeigen.\nTaste: Alt + 4
+FILEBROWSER_SHOWCOLORLABEL5HINT;Nur violett markierte Bilder anzeigen.\nTaste: Alt + 5
+FILEBROWSER_SHOWDIRHINT;Alle Filter zurücksetzen.\nTaste: d
+FILEBROWSER_SHOWEDITEDHINT;Nur bearbeitete Bilder anzeigen.\nTaste: 7
+FILEBROWSER_SHOWEDITEDNOTHINT;Nur unbearbeitete Bilder anzeigen.\nTaste: 6
FILEBROWSER_SHOWEXIFINFO;Bildinformationen ein-/ausblenden.\n\nIm Multi-Reitermodus:\nTaste: i\nIm Ein-Reitermodus:\nTaste: Alt + i
-FILEBROWSER_SHOWNOTTRASHHINT;Nur nicht gelöschte Bilder anzeigen
+FILEBROWSER_SHOWNOTTRASHHINT;Nur nicht gelöschte Bilder anzeigen.
FILEBROWSER_SHOWORIGINALHINT;Zeige nur das Originalbild.\n\nWenn mehrere Bilder mit dem gleichen Dateinamen und unterschiedlichen Dateitypen existieren, ist das Originalbild das Bild, welches in der Liste "Dateitypen anzeigen" unter Einstellungen > Dateiverwaltung als erstes gefunden wird.
-FILEBROWSER_SHOWRANK1HINT;Nur mit 1 Stern bewertete Bilder anzeigen\nTaste: 1
-FILEBROWSER_SHOWRANK2HINT;Nur mit 2 Sternen bewertete Bilder anzeigen\nTaste: 2
-FILEBROWSER_SHOWRANK3HINT;Nur mit 3 Sternen bewertete Bilder anzeigen\nTaste: 3
-FILEBROWSER_SHOWRANK4HINT;Nur mit 4 Sternen bewertete Bilder anzeigen\nTaste: 4
-FILEBROWSER_SHOWRANK5HINT;Nur mit 5 Sternen bewertete Bilder anzeigen\nTaste: 5
-FILEBROWSER_SHOWRECENTLYSAVEDHINT;Nur gespeicherte Bilder anzeigen\nTaste: Alt + 7
-FILEBROWSER_SHOWRECENTLYSAVEDNOTHINT;Nur nicht gespeicherte Bilder anzeigen\nTaste: Alt + 6
-FILEBROWSER_SHOWTRASHHINT;Inhalt des Papierkorbs anzeigen\nTaste: Strg + t
-FILEBROWSER_SHOWUNCOLORHINT;Nur unmarkierte Bilder anzeigen\nTaste: Alt + 0
-FILEBROWSER_SHOWUNRANKHINT;Nur unbewertete Bilder anzeigen\nTaste: 0
+FILEBROWSER_SHOWRANK1HINT;Nur mit 1 Stern bewertete Bilder anzeigen.\nTaste: 1
+FILEBROWSER_SHOWRANK2HINT;Nur mit 2 Sternen bewertete Bilder anzeigen.\nTaste: 2
+FILEBROWSER_SHOWRANK3HINT;Nur mit 3 Sternen bewertete Bilder anzeigen.\nTaste: 3
+FILEBROWSER_SHOWRANK4HINT;Nur mit 4 Sternen bewertete Bilder anzeigen.\nTaste: 4
+FILEBROWSER_SHOWRANK5HINT;Nur mit 5 Sternen bewertete Bilder anzeigen.\nTaste: 5
+FILEBROWSER_SHOWRECENTLYSAVEDHINT;Nur gespeicherte Bilder anzeigen.\nTaste: Alt + 7
+FILEBROWSER_SHOWRECENTLYSAVEDNOTHINT;Nur nicht gespeicherte Bilder anzeigen.\nTaste: Alt + 6
+FILEBROWSER_SHOWTRASHHINT;Inhalt des Papierkorbs anzeigen.\nTaste: Strg + t
+FILEBROWSER_SHOWUNCOLORHINT;Nur unmarkierte Bilder anzeigen.\nTaste: Alt + 0
+FILEBROWSER_SHOWUNRANKHINT;Nur unbewertete Bilder anzeigen.\nTaste: 0
FILEBROWSER_THUMBSIZE;Miniaturbildgröße
-FILEBROWSER_UNRANK_TOOLTIP;Bewertung entfernen\nTaste: Umschalt + 0
-FILEBROWSER_ZOOMINHINT;Miniaturbilder vergrößern\n\nIm Multi-Reitermodus:\nTaste: +\nIm Ein-Reitermodus:\nTaste: Alt +
-FILEBROWSER_ZOOMOUTHINT;Miniaturbilder verkleinern\n\nIm Multi-Reitermodus:\nTaste: -\nIm Ein-Reitermodus:\nTaste: Alt -
+FILEBROWSER_UNRANK_TOOLTIP;Bewertung entfernen.\nTaste: Umschalt + 0
+FILEBROWSER_ZOOMINHINT;Miniaturbilder vergrößern.\n\nIm Multi-Reitermodus:\nTaste: +\nIm Ein-Reitermodus:\nTaste: Alt +
+FILEBROWSER_ZOOMOUTHINT;Miniaturbilder verkleinern.\n\nIm Multi-Reitermodus:\nTaste: -\nIm Ein-Reitermodus:\nTaste: Alt -
FILECHOOSER_FILTER_ANY;Alle Dateien
FILECHOOSER_FILTER_COLPROF;Farbprofile
FILECHOOSER_FILTER_CURVE;Kurvendateien
@@ -917,14 +918,14 @@ LENSPROFILE_CORRECTION_LCPFILE;LCP-Datei
LENSPROFILE_CORRECTION_MANUAL;Benutzerdefiniert (Lensfun)
LENSPROFILE_LENS_WARNING;Warnung: Der Cropfaktor des Profils entspricht nicht dem des Objektivs.\nDies kann zu einem fehlerhaften Ergebnis führen.
MAIN_BUTTON_FULLSCREEN;Vollbild\nTaste: F11
-MAIN_BUTTON_ICCPROFCREATOR;ICC-Profil erstellen
+MAIN_BUTTON_ICCPROFCREATOR;ICC-Profil erstellen.
MAIN_BUTTON_NAVNEXT_TOOLTIP;Navigiert zum nächsten Miniaturbild in der\nDateiverwaltung oder Filmstreifen bezogen\nauf das ausgewählte Miniaturbild.\nTaste: F4\n\nNavigiert zum nächsten Miniaturbild in der\nDateiverwaltung oder Filmstreifen bezogen\nauf auf das im Editor geöffnete Bild.\nTaste: Umschalt + F4
MAIN_BUTTON_NAVPREV_TOOLTIP;Navigiert zum vorherigen Miniaturbild in der\nDateiverwaltung oder Filmstreifen bezogen\nauf das ausgewählte Miniaturbild.\nTaste: F3\n\nNavigiert zum vorherigen Miniaturbild in der\nDateiverwaltung oder Filmstreifen bezogen\nauf auf das im Editor geöffnete Bild.\nTaste: Umschalt + F3
MAIN_BUTTON_NAVSYNC_TOOLTIP;Selektiert das Miniaturbild des aktuell geöffneten\nBildes in der Dateiverwaltung und des Filmstreifens.\nEs werden alle aktiven Filter gelöscht.\nTaste: x\n\nWie oben, jedoch ohne Löschung aktiver Filter. Das\nMiniaturbild des geöffneten Bildes wird nicht angezeigt,\nwenn es herausgefiltert wurde.\nTaste: y
MAIN_BUTTON_PREFERENCES;Einstellungen
MAIN_BUTTON_PUTTOQUEUE_TOOLTIP;Bild zur Warteschlange hinzufügen.\nTaste: Strg + b
MAIN_BUTTON_SAVE_TOOLTIP;Bild speichern.\nTaste: Strg + s\nProfil (.pp3) speichern.\nTaste: Strg + Umschalt + s
-MAIN_BUTTON_SENDTOEDITOR;Bild im externen Editor öffnen
+MAIN_BUTTON_SENDTOEDITOR;Bild im externen Editor öffnen.
MAIN_BUTTON_SENDTOEDITOR_TOOLTIP;Bild im externen Editor öffnen.\nTaste: Strg + e
MAIN_BUTTON_SHOWHIDESIDEPANELS_TOOLTIP;Alle seitlichen Bedienfelder ein-/ausblenden.\nTaste: m
MAIN_BUTTON_UNFULLSCREEN;Vollbild beenden.\nTaste: F11
@@ -939,8 +940,8 @@ MAIN_FRAME_PLACES_ADD;Hinzufügen
MAIN_FRAME_PLACES_DEL;Entfernen
MAIN_FRAME_RECENT;Verzeichnishistorie
MAIN_MSG_ALREADYEXISTS;Diese Datei existiert bereits.
-MAIN_MSG_CANNOTLOAD;Bild kann nicht geladen werden
-MAIN_MSG_CANNOTSAVE;Fehler beim Speichern
+MAIN_MSG_CANNOTLOAD;Bild kann nicht geladen werden.
+MAIN_MSG_CANNOTSAVE;Fehler beim Speichern.
MAIN_MSG_CANNOTSTARTEDITOR;Der externe Editor kann nicht gestartet werden.
MAIN_MSG_CANNOTSTARTEDITOR_SECONDARY;Setzen Sie bitte den richtigen Pfad in den Einstellungen.
MAIN_MSG_EMPTYFILENAME;Dateiname fehlt!
@@ -1182,7 +1183,7 @@ PREFERENCES_GREYSC18;Yb = 18 CIE L#49
PREFERENCES_GREYSCA;Automatisch
PREFERENCES_HISTOGRAMPOSITIONLEFT;Histogramm linksseitig
PREFERENCES_HISTOGRAMWORKING;Das Arbeitsprofil zur Darstellung des Haupthistogramms verwenden
-PREFERENCES_HISTOGRAM_TOOLTIP;Wenn aktiviert wird das Arbeitsprofil für die Darstellung\ndes Haupthistogramms verwendet, andernfalls das des\ngammakorrigierten Ausgangsprofil.
+PREFERENCES_HISTOGRAM_TOOLTIP;Wenn aktiviert, wird das Arbeitsprofil für die Darstellung\ndes Haupthistogramms verwendet, andernfalls das des\ngammakorrigierten Ausgangsprofils.
PREFERENCES_HLTHRESHOLD;Lichter - Schwelle
PREFERENCES_ICCDIR;ICC-Profile-Verzeichnis
PREFERENCES_IMG_RELOAD_NEEDED;Änderungen werden nur auf neu geöffnete Bilder angewendet
@@ -1214,7 +1215,7 @@ PREFERENCES_MULTITABDUALMON;Multi-Reitermodus (auf zweitem Monitor, wenn verfüg
PREFERENCES_NAVGUIDEBRUSH;Farbe der Navigationshilfe
PREFERENCES_NAVIGATIONFRAME;Navigation
PREFERENCES_OUTDIR;Ausgabeverzeichnis
-PREFERENCES_OUTDIRFOLDER;In dieses Verzeichnis speichern.
+PREFERENCES_OUTDIRFOLDER;In dieses Verzeichnis speichern
PREFERENCES_OUTDIRFOLDERHINT;Alle Dateien im ausgewählten Verzeichnis speichern.
PREFERENCES_OUTDIRTEMPLATE;Dynamisches Verzeichnis verwenden
PREFERENCES_OUTDIRTEMPLATEHINT;Die folgenden Variablen können verwendet werden:\n%f, %d1, %d2, ..., %p1, %p2, ..., %r, %s1, %s2, ...\n\nDiese Variablen beinhalten bestimmte Teile des Verzeichnispfades, in welchem sich das Bild befindet, oder Attribute des Bildes.\n\nWenn zum Beispiel /home/tom/photos/2010-10-31/dsc0042.nef geöffnet wurde, dann haben die Variablen den folgenden Inhalt:\n%d4 = home\n%d3 = tom\n%d2 = photos\n%d1 = 2010-10-31\n%f = dsc0042\n%p1 = /home/tom/photos/2010-10-31\n%p2 = /home/tom/photos\n%p3 = /home/tom\n%p4 = /home\n\nWenn Sie die Ausgabedatei in dasselbe Verzeichnis wie das Originalbild speichern wollen, dann wählen Sie:\n%p1/%f\n\nWenn Sie die Ausgabedatei in ein Unterverzeichnis mit dem Namen "converted" schreiben wollen, dann wählen Sie:\n%p1/converted/%f\n\nWenn Sie die Ausgabedatei im Verzeichnispfad "/home/tom/photos/converted" speichern wollen, dort jedoch in einem mit dem Namen des Ursprungsverzeichnisses betitelten Unterverzeichnis, dann wählen Sie:\n%p2/converted/%d1/%f\n\nDie Variable %r enthält die Bewertung des Bildes.
@@ -1251,10 +1252,10 @@ PREFERENCES_PSPATH;Adobe Photoshop Installationsverzeichnis
PREFERENCES_REMEMBERZOOMPAN;Zoom und Bildposition merken
PREFERENCES_REMEMBERZOOMPAN_TOOLTIP;Öffnen eines neuen Bildes mit den Zoom- und Positionswerten\ndes vorangegangenen Bildes.\n\nFunktioniert nur unter folgenden Bedingungen:\nEin-Reitermodus aktiv\n“Demosaikmethode für 100%-Ansicht“ muss auf “Wie im Bild-\nverarbeitungsprofil vorgegeben“ eingestellt sein.
PREFERENCES_SAVE_TP_OPEN_NOW;Werkzeugstatus jetzt speichern
-PREFERENCES_SELECTFONT;Schriftart
-PREFERENCES_SELECTFONT_COLPICKER;Schriftart für die Farbwähler
+PREFERENCES_SELECTFONT;Schriftart:
+PREFERENCES_SELECTFONT_COLPICKER;Schriftart Farbwähler
PREFERENCES_SELECTLANG;Sprache
-PREFERENCES_SELECTTHEME;Oberflächendesign (erfordert Neustart)
+PREFERENCES_SELECTTHEME;Oberflächendesign
PREFERENCES_SERIALIZE_TIFF_READ;TIFF-Bilder
PREFERENCES_SERIALIZE_TIFF_READ_LABEL;Serialisiertes Lesen von TIFF-Bildern verwenden
PREFERENCES_SERIALIZE_TIFF_READ_TOOLTIP;Beim Arbeiten mit Ordnern voll unkomprimierter TIFF-Bilder, kann diese Einstellung das Generieren von Miniaturbildern deutlich beschleunigen.
@@ -1278,7 +1279,7 @@ PREFERENCES_TAB_GENERAL;Allgemein
PREFERENCES_TAB_IMPROC;Bildbearbeitung
PREFERENCES_TAB_PERFORMANCE;Performance
PREFERENCES_TAB_SOUND;Klänge
-PREFERENCES_THEME;Oberflächendesign
+PREFERENCES_THEME;Oberflächendesign (erfordert Neustart)
PREFERENCES_THUMBNAIL_INSPECTOR_JPEG;Eingebundenes JPEG
PREFERENCES_THUMBNAIL_INSPECTOR_MODE;Bildanzeige
PREFERENCES_THUMBNAIL_INSPECTOR_RAW;Neutrales RAW-Bild
@@ -1541,7 +1542,7 @@ TP_COLORTONING_METHOD;Methode
TP_COLORTONING_METHOD_TOOLTIP;L*a*b*-Überlagerung, RGB-Regler und RGB-Kurven\nverwenden eine interpolierte Farbüberlagerung.\n\nFarbausgleich (Schatten/Mitten/Lichter) und Sättigung\n(2-Farben) verwenden direkte Farben.
TP_COLORTONING_MIDTONES;Mitten
TP_COLORTONING_NEUTRAL;Regler zurücksetzen
-TP_COLORTONING_NEUTRAL_TIP;Alle Werte auf Standard zurücksetzen\n(Schatten, Mitten, Lichter)
+TP_COLORTONING_NEUTRAL_TIP;Alle Werte auf Standard zurücksetzen.\n(Schatten, Mitten, Lichter)
TP_COLORTONING_OPACITY;Deckkraft
TP_COLORTONING_RGBCURVES;RGB-Kurven
TP_COLORTONING_RGBSLIDERS;RGB-Regler
@@ -1573,7 +1574,7 @@ TP_CROP_GUIDETYPE;Hilfslinien:
TP_CROP_H;Höhe
TP_CROP_LABEL;Ausschnitt
TP_CROP_PPI;PPI=
-TP_CROP_SELECTCROP;Ausschnitt wählen.
+TP_CROP_SELECTCROP;Ausschnitt wählen
TP_CROP_W;Breite
TP_CROP_X;x
TP_CROP_Y;y
@@ -2073,7 +2074,7 @@ TP_RGBCURVES_LUMAMODE_TOOLTIP;Der Helligkeitsmodus ändert die Helligkeit
TP_RGBCURVES_RED;R
TP_ROTATE_DEGREE;Winkel
TP_ROTATE_LABEL;Drehen
-TP_ROTATE_SELECTLINE;Leitlinie wählen.
+TP_ROTATE_SELECTLINE;Leitlinie wählen
TP_SAVEDIALOG_OK_TIP;Taste: Strg + Enter
TP_SHADOWSHLIGHTS_HIGHLIGHTS;Lichter
TP_SHADOWSHLIGHTS_HLTONALW;Tonwertbreite Lichter
@@ -2350,10 +2351,9 @@ TP_WBALANCE_WATER1;Unterwasser 1
TP_WBALANCE_WATER2;Unterwasser 2
TP_WBALANCE_WATER_HEADER;Unterwasser
ZOOMPANEL_100;(100%)
-ZOOMPANEL_NEWCROPWINDOW;Neues Detailfenster öffnen
+ZOOMPANEL_NEWCROPWINDOW;Neues Detailfenster öffnen.
ZOOMPANEL_ZOOM100;Zoom 100%\nTaste: z
-ZOOMPANEL_ZOOMFITCROPSCREEN;Ausschnitt an Bildschirm anpassen\nTaste: f
-ZOOMPANEL_ZOOMFITSCREEN;An Bildschirm anpassen\nTaste: Alt + f
+ZOOMPANEL_ZOOMFITCROPSCREEN;Ausschnitt an Bildschirm anpassen.\nTaste: f
+ZOOMPANEL_ZOOMFITSCREEN;An Bildschirm anpassen.\nTaste: Alt + f
ZOOMPANEL_ZOOMIN;Hineinzoomen\nTaste: +
ZOOMPANEL_ZOOMOUT;Herauszoomen\nTaste: -
-
diff --git a/rtdata/languages/default b/rtdata/languages/default
index 4ac12a093..cc978ce92 100644
--- a/rtdata/languages/default
+++ b/rtdata/languages/default
@@ -728,7 +728,8 @@ HISTORY_MSG_492;RGB Curves
HISTORY_MSG_493;L*a*b* Adjustments
HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors
HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction
-HISTORY_MSG_DUALDEMOSAIC_CONTRAST;AMaZE+VNG4 - Contrast threshold
+HISTORY_MSG_DUALDEMOSAIC_CONTRAST;Dual demosaic - Contrast threshold
+HISTORY_MSG_DUALDEMOSAIC_AUTO_CONTRAST;Dual demosaic - Auto threshold
HISTORY_MSG_HISTMATCHING;Auto-matched tone curve
HISTORY_MSG_ICM_OUTPUT_PRIMARIES;Output - Primaries
HISTORY_MSG_ICM_OUTPUT_TEMP;Output - ICC-v4 illuminant D
@@ -751,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
@@ -1815,6 +1817,8 @@ TP_RAW_DMETHOD;Method
TP_RAW_DMETHOD_PROGRESSBAR;%1 demosaicing...
TP_RAW_DMETHOD_PROGRESSBAR_REFINE;Demosaicing refinement...
TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixel Shift is for Pentax/Sony Pixel Shift files. It falls back to AMaZE for non-Pixel Shift files.
+TP_RAW_DUALDEMOSAICAUTOCONTRAST;Auto threshold
+TP_RAW_DUALDEMOSAICAUTOCONTRAST_TOOLTIP;If the check-box is checked (recommended), RawTherapee calculates an optimum value based on flat regions in the image.\nIf there is no flat region in the image or the image is too noisy, the value will be set to 0.\nTo set the value manually, uncheck the check-box first (reasonable values depend on the image).
TP_RAW_DUALDEMOSAICCONTRAST;Contrast threshold
TP_RAW_EAHD;EAHD
TP_RAW_FALSECOLOR;False color suppression steps
diff --git a/rtdata/themes/RawTherapee-GTK3-20_.css b/rtdata/themes/RawTherapee-GTK3-20_.css
index 1224e3ce9..84ea1c3a3 100644
--- a/rtdata/themes/RawTherapee-GTK3-20_.css
+++ b/rtdata/themes/RawTherapee-GTK3-20_.css
@@ -36,6 +36,18 @@ scrollbar:not(.overlay-indicator):hover {
min-width: 1px;
}
+/* Toolbar stuck workaround */
+.scrollableToolbar > scrollbar:not(.dummy),
+.scrollableToolbar > scrollbar:not(.dummy) > contents:not(.dummy),
+.scrollableToolbar > scrollbar:not(.dummy) > contents:not(.dummy) > trough:not(.dummy),
+.scrollableToolbar > scrollbar:not(.dummy) > contents:not(.dummy) > trough:not(.dummy) > slider:not(.dummy) {
+ padding: 0;
+ margin: 0;
+ min-height: 0;
+ min-width: 0;
+ border: none;
+}
+
.view:selected:not(check):not(radio) {
color: #262626;
background-color: #AAAAAA
diff --git a/rtdata/themes/TooWaBlue-GTK3-20_.css b/rtdata/themes/TooWaBlue-GTK3-20_.css
index 3f2165592..aa753727d 100644
--- a/rtdata/themes/TooWaBlue-GTK3-20_.css
+++ b/rtdata/themes/TooWaBlue-GTK3-20_.css
@@ -2,7 +2,7 @@
This file is part of RawTherapee.
Copyright (c) 2016-2018 TooWaBoo
- Version 2.80
+ Version 2.82
RawTherapee is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -80,7 +80,6 @@
min-height: 0;
padding: 0;
margin: 0;
- opacity: 1;
border: none;
box-shadow: none;
}
@@ -145,6 +144,10 @@ arrow {
min-width: 1.333333333333333333em;
min-height: 1.333333333333333333em;
}
+/* combobox cellview to high for font size 8@96dpi*/
+cellview {
+ margin: -1px 0;
+}
text {
background-color: @bg-dark-grey;
@@ -290,7 +293,7 @@ textview:selected, treeview:selected {
}
#Snapshots > border {
- min-height: calc(6.5em + 36px);
+ min-height: calc(6em + 36px);
}
#Snapshots > label {
margin-bottom: -4px;
@@ -315,6 +318,7 @@ textview:selected, treeview:selected {
border: 0.083333333333333333em solid @bg-dark-grey;
border-radius: 0;
box-shadow: none;
+ min-height: 2em;
}
#Snapshots button:hover,
@@ -326,8 +330,9 @@ background-color: @bg-list-hover;
background-color: shade(@bg-list-hover, 1.15);
}
+fontchooser scrolledwindow,
#PlacesPaned scrolledwindow,
-#HistoryPanel > border,
+#HistoryPanel scrolledwindow,
#Snapshots scrolledwindow {
background-color: @bg-dark-grey;
border: 0.083333333333333333em solid @bg-dark-grey;
@@ -686,7 +691,18 @@ scrollbar.hovering slider:hover {
scrollbar:not(.overlay-indicator):hover {
min-width: 1px;
}
-/**/
+
+/* Toolbar stuck workaround */
+.scrollableToolbar > scrollbar:not(.dummy),
+.scrollableToolbar > scrollbar:not(.dummy) > contents:not(.dummy),
+.scrollableToolbar > scrollbar:not(.dummy) > contents:not(.dummy) > trough:not(.dummy),
+.scrollableToolbar > scrollbar:not(.dummy) > contents:not(.dummy) > trough:not(.dummy) > slider:not(.dummy) {
+ padding: 0;
+ margin: 0;
+ min-height: 0;
+ min-width: 0;
+ border: none;
+}
/*** end ***************************************************************************************/
@@ -1477,6 +1493,10 @@ button.text-button label {
margin: 0 0.5em;/* x */
}
+button image + label {
+ margin-left: 0.25em;
+}
+
#PrefNotebook > stack > :nth-child(5) combobox {
/* margin: 0.166666666666666666em 0; */
margin: 2px 0;
@@ -1583,12 +1603,9 @@ button.MiddleH {
margin-left: -2px;
}
-#PlacesPaned button.Left,
-#PlacesPaned button.Right {
- margin-top: 3px;
-}
#PlacesPaned combobox {
- margin-bottom: -3px;
+ margin-bottom: -8px;
+ padding-bottom: 0.416666666666666666em;
}
/**/
@@ -1699,8 +1716,16 @@ buttonbox:not(.dialog-action-area) button{
button.color {
min-height: 1.166666666666666666em;
+ min-width: 2.75em;
padding: 0.25em;
}
+button.color colorswatch,
+colorchooser colorswatch {
+ border: 1px solid @bg-button-border;
+}
+colorchooser colorswatch#add-color-button:first-child {
+ border-radius: 5.5px 0 0 5.5px;
+}
/* Save, Cancel, OK ... buttons */
.dialog-action-area button {
@@ -2132,21 +2157,10 @@ headerbar .title:backdrop {
color: alpha(@winTitle,.60);
}
/*** end ***************************************************************************************/
-/* Toolbar stuck workaround */
-
-/* .scrollableToolbar scrollbar:not(.overlay-indicator) slider:not(.dummy) {
- padding: 0;
- margin: 0;
- min-height: 0;
- min-width: 0;
- border: none;
-} */
-
/* .view:not(check):not(radio), image:not(check):not(radio), spinbutton button, cellview {
- -gtk-icon-transform: scale(1.5);
-}
-* {-gtk-dpi: 144;} */
-
+ -gtk-icon-transform: scale(calc(( 96 / 96 ) * ( 8 / 9 )));
+} */
+/* * {-gtk-dpi: 144;} */
diff --git a/rtdata/themes/TooWaGrey - Average Surround-GTK3-20_.css b/rtdata/themes/TooWaGrey - Average Surround-GTK3-20_.css
index 98ec912b1..29ebd6c96 100644
--- a/rtdata/themes/TooWaGrey - Average Surround-GTK3-20_.css
+++ b/rtdata/themes/TooWaGrey - Average Surround-GTK3-20_.css
@@ -33,7 +33,7 @@
@define-color bg-image rgb(120,120,120); /*** Image area & File Browser background * Default: rgb(70,70,70) ***/
-@define-color accent-color2 rgb(49,132,220); /*** Scale, Progressbar, Scrollbar, Tabs * Default: rgb(35,99,166) ***/
+@define-color accent-color2 rgb(175,175,175); /*** Scale, Progressbar, Scrollbar, Tabs * Default: rgb(35,99,166) ***/
@define-color accent-color4 rgb(155,155,155); /*** Slider knob * Default: rgb(115,115,115) ***/
@define-color accent-color3 rgb(85,85,85); /*** Selected thumbnail background color * Default: rgb(35,99,166) ***/
@@ -43,10 +43,10 @@
@define-color bg-light-grey rgb(135,135,135);
@define-color bg-grey rgb(120,120,120);
-@define-color bg-dark-grey rgb(85,85,85);
+@define-color bg-dark-grey rgb(90,90,90);
-@define-color bg-button-hover rgba(0,0,0,.15);
-@define-color bg-button-active rgba(0,0,0,.5);
+@define-color bg-button-hover rgba(40,40,40,.16);
+@define-color bg-button-active rgba(40,40,40,.4);
@define-color winHeaderbar rgb(75,75,75);
@define-color winTitle rgb(210,210,210);
@@ -55,7 +55,7 @@
@define-color border-tooltip rgb(50,50,50);
@define-color text-tooltip rgb(50,50,50);
/***********************************************/
-@define-color text-color rgb(230,230,230);
+@define-color text-color rgb(220,220,220);
@define-color text-tbEntry rgb(245,245,245);
@define-color border-color rgba(255,255,255,.35);
@define-color bg-list-hover rgb(95,95,95);
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/FTblockDN.cc b/rtengine/FTblockDN.cc
index 8f90be744..58e27e118 100644
--- a/rtengine/FTblockDN.cc
+++ b/rtengine/FTblockDN.cc
@@ -805,8 +805,15 @@ BENCHFUN
}
#endif
- float *LbloxArray[denoiseNestedLevels * numthreads] = {};
- float *fLbloxArray[denoiseNestedLevels * numthreads] = {};
+ const std::size_t blox_array_size = denoiseNestedLevels * numthreads;
+
+ float *LbloxArray[blox_array_size];
+ float *fLbloxArray[blox_array_size];
+
+ for (std::size_t i = 0; i < blox_array_size; ++i) {
+ LbloxArray[i] = nullptr;
+ fLbloxArray[i] = nullptr;
+ }
if (numtiles > 1 && denoiseLuminance) {
for (int i = 0; i < denoiseNestedLevels * numthreads; ++i) {
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..eb4174577 100644
--- a/rtengine/camconst.json
+++ b/rtengine/camconst.json
@@ -1225,6 +1225,11 @@ Camera constants:
}
},
+ { // Quality C
+ "make_model": "DJI FC6310",
+ "ranges": { "white": 64886 }
+ },
+
{ // Quality B
"make_model": "FUJIFILM GFX 50S",
"dcraw_matrix": [ 11756,-4754,-874,-3056,11045,2305,-381,1457,6006 ], // DNGv9.9 D65
@@ -1338,13 +1343,13 @@ Camera constants:
"make_model": "LG mobile LG-H815",
"dcraw_matrix": [ 5859,547,-1250,-6484,15547,547,-2422,5625,3906 ], // DNG D65
//"dcraw_matrix": [ 11563,-2891,-3203,-5313,15625,625,-781,2813,5625 ], // DNG A
- "ranges": { "white_max": 1000 }
+ "ranges": { "white": 1000 }
},
{ // Quality C
"make_model": "LG mobile LG-H850",
//"dcraw_matrix": [ 10000,-2188,-2813,-5156,15469,625,-703,2734,5078 ], // DNG A
"dcraw_matrix": [ 5313,1016,-1172,-6250,15391,547,-2344,5547,3359 ], // DNG D65
- "ranges": { "white_max": 1000 }
+ "ranges": { "white": 1000 }
},
{ // Quality A
@@ -1578,6 +1583,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/dcraw.cc b/rtengine/dcraw.cc
index 73f9c948f..035dab2b2 100644
--- a/rtengine/dcraw.cc
+++ b/rtengine/dcraw.cc
@@ -6462,17 +6462,20 @@ guess_cfa_pc:
unsigned oldOrder = order;
order = 0x4d4d; // always big endian per definition in https://www.adobe.com/content/dam/acom/en/products/photoshop/pdfs/dng_spec_1.4.0.0.pdf chapter 7
unsigned ntags = get4(); // read the number of opcodes
- while (ntags--) {
- unsigned opcode = get4();
- fseek (ifp, 8, SEEK_CUR); // skip 8 bytes as they don't interest us currently
- if (opcode == 4) { // FixBadPixelsConstant
- fseek (ifp, 4, SEEK_CUR); // skip 4 bytes as we know that the opcode 4 takes 4 byte
- if(get4() == 0) { // if raw 0 values should be treated as bad pixels, set zero_is_bad to true (1). That's the only value currently supported by rt
- zero_is_bad = 1;
+
+ if (ntags < ifp->size / 12) { // rough check for wrong value (happens for example with DNG files from DJI FC6310)
+ while (ntags-- && !ifp->eof) {
+ unsigned opcode = get4();
+ fseek (ifp, 8, SEEK_CUR); // skip 8 bytes as they don't interest us currently
+ if (opcode == 4) { // FixBadPixelsConstant
+ fseek (ifp, 4, SEEK_CUR); // skip 4 bytes as we know that the opcode 4 takes 4 byte
+ if(get4() == 0) { // if raw 0 values should be treated as bad pixels, set zero_is_bad to true (1). That's the only value currently supported by rt
+ zero_is_bad = 1;
+ }
+ } else {
+ fseek (ifp, get4(), SEEK_CUR);
+ }
}
- } else {
- fseek (ifp, get4(), SEEK_CUR);
- }
}
order = oldOrder;
break;
@@ -10062,6 +10065,10 @@ dng_skip:
adobe_coeff (make, model);
if((!strncmp(make, "XIAOYI", 6) || !strncmp(make, "YI", 2)) && !strncmp(model, "M1",2))
adobe_coeff (make, model);
+ if(!strncmp(make, "DJI", 3) && !strncmp(model, "FC6310", 6)) // DNG files from this camera have wrong (too high) white level
+ adobe_coeff (make, model);
+ if (!strncmp(make, "LG", 2) && (!strncmp(model, "LG-H850",7) || !strncmp(model, "LG-H815",7)))
+ adobe_coeff (make, model);
if (raw_color) adobe_coeff (make, model);
if (load_raw == &CLASS kodak_radc_load_raw)
if (raw_color) adobe_coeff ("Apple","Quicktake");
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/demosaic_algos.cc b/rtengine/demosaic_algos.cc
index c0d0c2a2b..10ef0dd0e 100644
--- a/rtengine/demosaic_algos.cc
+++ b/rtengine/demosaic_algos.cc
@@ -37,7 +37,7 @@
#include "sleef.c"
#include "opthelper.h"
#include "median.h"
-#define BENCHMARK
+//#define BENCHMARK
#include "StopWatch.h"
#ifdef _OPENMP
#include
diff --git a/rtengine/dual_demosaic_RT.cc b/rtengine/dual_demosaic_RT.cc
index 6e92fd1e2..4ffac9296 100644
--- a/rtengine/dual_demosaic_RT.cc
+++ b/rtengine/dual_demosaic_RT.cc
@@ -36,11 +36,11 @@ using namespace std;
namespace rtengine
{
-void RawImageSource::dual_demosaic_RT(bool isBayer, const RAWParams &raw, int winw, int winh, const array2D &rawData, array2D &red, array2D &green, array2D &blue, double &contrast, bool autoContrast, int autoX, int autoY)
+void RawImageSource::dual_demosaic_RT(bool isBayer, const RAWParams &raw, int winw, int winh, const array2D &rawData, array2D &red, array2D &green, array2D &blue, double &contrast, bool autoContrast)
{
BENCHFUN
- if (contrast == 0.0 && !autoContrast) {
+ if (contrast == 0.f && !autoContrast) {
// contrast == 0.0 means only first demosaicer will be used
if(isBayer) {
if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::AMAZEVNG4) ) {
@@ -91,24 +91,6 @@ void RawImageSource::dual_demosaic_RT(bool isBayer, const RAWParams &raw, int wi
{ 0.019334, 0.119193, 0.950227 }
};
- if (autoContrast && autoX >= 0 && autoY >= 0) {
- constexpr int rectSize = 40;
- const int autoWidth = min(rectSize, winw - autoX);
- const int autoHeight = min(rectSize, winh - autoY);
- if (std::min(autoWidth, autoHeight) > 20) {
- array2D autoL(autoWidth, autoHeight);
- for(int i = 0; i < autoHeight; ++i) {
- Color::RGB2L(red[i + autoY] + autoX, green[i + autoY] + autoX, blue[i + autoY] + autoX, autoL[i], xyz_rgb, autoWidth);
- }
- // calculate contrast based blend factors to use vng4 in regions with low contrast
- JaggedArray blend(autoWidth - 2, autoHeight - 2);
- int c = calcContrastThreshold(autoL, blend, autoWidth, autoHeight);
- if(c < 100) {
- contrast = c; // alternative : contrast = c - 1
- }
- }
- }
-
#pragma omp parallel
{
#pragma omp for
@@ -118,7 +100,10 @@ void RawImageSource::dual_demosaic_RT(bool isBayer, const RAWParams &raw, int wi
}
// calculate contrast based blend factors to use vng4 in regions with low contrast
JaggedArray blend(winw, winh);
- buildBlendMask(L, blend, winw, winh, contrast / 100.f);
+ float contrastf = contrast / 100.f;
+
+ buildBlendMask(L, blend, winw, winh, contrastf, 1.f, autoContrast);
+ contrast = contrastf * 100.f;
// the following is split into 3 loops intentionally to avoid cache conflicts on CPUs with only 4-way cache
#pragma omp parallel for
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/imageformat.h b/rtengine/imageformat.h
index cd86d536d..22708daef 100644
--- a/rtengine/imageformat.h
+++ b/rtengine/imageformat.h
@@ -29,7 +29,6 @@ typedef enum IIO_Sample_Format {
//IIOSF_SIGNED_INT , // Not yet supported
IIOSF_UNSIGNED_CHAR = 1 << 0,
IIOSF_UNSIGNED_SHORT = 1 << 1,
- //IIOSF_HALF , // OpenEXR & NVidia's Half Float, not yet supported
IIOSF_LOGLUV24 = 1 << 2,
IIOSF_LOGLUV32 = 1 << 3,
IIOSF_FLOAT16 = 1 << 4,
diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc
index 08922e436..802365d74 100644
--- a/rtengine/imageio.cc
+++ b/rtengine/imageio.cc
@@ -704,7 +704,7 @@ int ImageIO::getTIFFSampleFormat (Glib::ustring fname, IIOSampleFormat &sFormat,
sFormat = IIOSF_UNSIGNED_SHORT;
return IMIO_SUCCESS;
}
- } else if (samplesperpixel == 3 && sampleformat == SAMPLEFORMAT_IEEEFP) {
+ } else if ((samplesperpixel == 3 || samplesperpixel == 4) && sampleformat == SAMPLEFORMAT_IEEEFP) {
if (bitspersample==16) {
sFormat = IIOSF_FLOAT16;
return IMIO_SUCCESS;
@@ -718,7 +718,7 @@ int ImageIO::getTIFFSampleFormat (Glib::ustring fname, IIOSampleFormat &sFormat,
return IMIO_SUCCESS;
}
}
- } else if (samplesperpixel == 3 && photometric == PHOTOMETRIC_LOGLUV) {
+ } else if ((samplesperpixel == 3 || samplesperpixel == 4) && photometric == PHOTOMETRIC_LOGLUV) {
if (compression == COMPRESSION_SGILOG24) {
sFormat = IIOSF_LOGLUV24;
return IMIO_SUCCESS;
diff --git a/rtengine/imagesource.h b/rtengine/imagesource.h
index e01f22b16..a7c867e08 100644
--- a/rtengine/imagesource.h
+++ b/rtengine/imagesource.h
@@ -83,6 +83,7 @@ public:
virtual void setBorder (unsigned int border) {}
virtual void setCurrentFrame (unsigned int frameNum) = 0;
virtual int getFrameCount () = 0;
+ virtual int getFlatFieldAutoClipValue () = 0;
// use right after demosaicing image, add coarse transformation and put the result in the provided Imagefloat*
diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc
index 4bd1f2f48..5cc93d3c7 100644
--- a/rtengine/improccoordinator.cc
+++ b/rtengine/improccoordinator.cc
@@ -93,7 +93,7 @@ ImProcCoordinator::ImProcCoordinator()
fw(0), fh(0), tr(0),
fullw(1), fullh(1),
pW(-1), pH(-1),
- plistener(nullptr), imageListener(nullptr), aeListener(nullptr), acListener(nullptr), abwListener(nullptr), awbListener(nullptr), frameCountListener(nullptr), imageTypeListener(nullptr), actListener(nullptr), adnListener(nullptr), awavListener(nullptr), dehaListener(nullptr), hListener(nullptr),
+ plistener(nullptr), imageListener(nullptr), aeListener(nullptr), acListener(nullptr), abwListener(nullptr), awbListener(nullptr), flatFieldAutoClipListener(nullptr), bayerAutoContrastListener(nullptr), xtransAutoContrastListener(nullptr), frameCountListener(nullptr), imageTypeListener(nullptr), actListener(nullptr), adnListener(nullptr), awavListener(nullptr), dehaListener(nullptr), hListener(nullptr),
resultValid(false), lastOutputProfile("BADFOOD"), lastOutputIntent(RI__COUNT), lastOutputBPC(false), thread(nullptr), changeSinceLast(0), updaterRunning(false), destroying(false), utili(false), autili(false),
butili(false), ccutili(false), cclutili(false), clcutili(false), opautili(false), wavcontlutili(false), colourToningSatLimit(0.f), colourToningSatLimitOpacity(0.f), highQualityComputed(false)
{}
@@ -160,7 +160,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
}
}
- if (((todo & ALL) == ALL) || panningRelatedChange || (highDetailNeeded && options.prevdemo != PD_Sidecar)) {
+ if (((todo & ALL) == ALL) || (todo & M_MONITOR) || panningRelatedChange || (highDetailNeeded && options.prevdemo != PD_Sidecar)) {
bwAutoR = bwAutoG = bwAutoB = -9000.f;
if (todo == CROP && ipf.needsPCVignetting()) {
@@ -199,6 +199,9 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
imgsrc->setCurrentFrame(params.raw.bayersensor.imageNum);
imgsrc->preprocess(rp, params.lensProf, params.coarse);
+ if (flatFieldAutoClipListener && rp.ff_AutoClipControl) {
+ flatFieldAutoClipListener->flatFieldAutoClipValueChanged(imgsrc->getFlatFieldAutoClipValue());
+ }
imgsrc->getRAWHistogram(histRedRaw, histGreenRaw, histBlueRaw);
highDetailPreprocessComputed = highDetailNeeded;
@@ -239,10 +242,17 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
imgsrc->setBorder(std::max(params.raw.bayersensor.border, 2));
}
}
- bool autoContrast = false;
- double contrastThreshold = 0.f;
+ bool autoContrast = imgsrc->getSensorType() == ST_BAYER ? params.raw.bayersensor.dualDemosaicAutoContrast : params.raw.xtranssensor.dualDemosaicAutoContrast;
+ double contrastThreshold = imgsrc->getSensorType() == ST_BAYER ? params.raw.bayersensor.dualDemosaicContrast : params.raw.xtranssensor.dualDemosaicContrast;
imgsrc->demosaic(rp, autoContrast, contrastThreshold); //enabled demosaic
+ if (imgsrc->getSensorType() == ST_BAYER && bayerAutoContrastListener && autoContrast) {
+ bayerAutoContrastListener->autoContrastChanged(autoContrast ? contrastThreshold : -1.0);
+ }
+ if (imgsrc->getSensorType() == ST_FUJI_XTRANS && xtransAutoContrastListener && autoContrast) {
+ xtransAutoContrastListener->autoContrastChanged(autoContrast ? contrastThreshold : -1.0);
+ }
+
// if a demosaic happened we should also call getimage later, so we need to set the M_INIT flag
todo |= M_INIT;
@@ -896,11 +906,11 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
// process crop, if needed
for (size_t i = 0; i < crops.size(); i++)
- if (crops[i]->hasListener() && (panningRelatedChange || crops[i]->get_skip() == 1)) {
+ if (crops[i]->hasListener() && (panningRelatedChange || (highDetailNeeded && options.prevdemo != PD_Sidecar) || (todo & (M_MONITOR | M_RGBCURVE | M_LUMACURVE)) || crops[i]->get_skip() == 1)) {
crops[i]->update(todo); // may call ourselves
}
- if (panningRelatedChange) {
+ if (panningRelatedChange || (todo & M_MONITOR)) {
progress("Conversion to RGB...", 100 * readyphase / numofphases);
if ((todo != CROP && todo != MINUPDATE) || (todo & M_MONITOR)) {
@@ -1441,6 +1451,7 @@ void ImProcCoordinator::process()
|| params.softlight != nextParams.softlight
|| params.raw != nextParams.raw
|| params.retinex != nextParams.retinex
+ || params.wavelet != nextParams.wavelet
|| params.dirpyrequalizer != nextParams.dirpyrequalizer;
params = nextParams;
diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h
index dba12cdd7..356ef6636 100644
--- a/rtengine/improccoordinator.h
+++ b/rtengine/improccoordinator.h
@@ -158,6 +158,9 @@ protected:
AutoCamListener* acListener;
AutoBWListener* abwListener;
AutoWBListener* awbListener;
+ FlatFieldAutoClipListener *flatFieldAutoClipListener;
+ AutoContrastListener *bayerAutoContrastListener;
+ AutoContrastListener *xtransAutoContrastListener;
FrameCountListener *frameCountListener;
ImageTypeListener *imageTypeListener;
@@ -344,6 +347,20 @@ public:
frameCountListener = fcl;
}
+ void setFlatFieldAutoClipListener (FlatFieldAutoClipListener* ffacl)
+ {
+ flatFieldAutoClipListener = ffacl;
+ }
+ void setBayerAutoContrastListener (AutoContrastListener* acl)
+ {
+ bayerAutoContrastListener = acl;
+ }
+
+ void setXtransAutoContrastListener (AutoContrastListener* acl)
+ {
+ xtransAutoContrastListener = acl;
+ }
+
void setImageTypeListener (ImageTypeListener* itl)
{
imageTypeListener = itl;
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/ipsharpen.cc b/rtengine/ipsharpen.cc
index eaf0db732..321dd635f 100644
--- a/rtengine/ipsharpen.cc
+++ b/rtengine/ipsharpen.cc
@@ -176,7 +176,8 @@ BENCHFUN
// calculate contrast based blend factors to reduce sharpening in regions with low contrast
JaggedArray blend(W, H);
- buildBlendMask(luminance, blend, W, H, sharpenParam.contrast / 100.f, sharpenParam.deconvamount / 100.0);
+ float contrast = sharpenParam.contrast / 100.f;
+ buildBlendMask(luminance, blend, W, H, contrast, sharpenParam.deconvamount / 100.f);
const float damping = sharpenParam.deconvdamping / 5.0;
const bool needdamp = sharpenParam.deconvdamping > 0;
@@ -222,7 +223,8 @@ void ImProcFunctions::sharpening (LabImage* lab, const SharpeningParams &sharpen
if(showMask) {
// calculate contrast based blend factors to reduce sharpening in regions with low contrast
JaggedArray blend(W, H);
- buildBlendMask(lab->L, blend, W, H, sharpenParam.contrast / 100.f, sharpenParam.method == "rld" ? sharpenParam.deconvamount / 100.0 : 1.f);
+ float contrast = sharpenParam.contrast / 100.f;
+ buildBlendMask(lab->L, blend, W, H, contrast, sharpenParam.method == "rld" ? sharpenParam.deconvamount / 100.f : 1.f);
#ifdef _OPENMP
#pragma omp parallel for
#endif
@@ -256,7 +258,8 @@ BENCHFUN
// calculate contrast based blend factors to reduce sharpening in regions with low contrast
JaggedArray blend(W, H);
- buildBlendMask(lab->L, blend, W, H, sharpenParam.contrast / 100.f);
+ float contrast = sharpenParam.contrast / 100.f;
+ buildBlendMask(lab->L, blend, W, H, contrast);
#ifdef _OPENMP
#pragma omp parallel
@@ -610,7 +613,8 @@ BENCHFUN
// calculate contrast based blend factors to reduce sharpening in regions with low contrast
JaggedArray blend(W, H);
- buildBlendMask(luminance, blend, W, H, params->sharpenMicro.contrast / 100.f);
+ float contrast = params->sharpenMicro.contrast / 100.f;
+ buildBlendMask(luminance, blend, W, H, contrast);
#ifdef _OPENMP
#pragma omp parallel
@@ -819,7 +823,8 @@ void ImProcFunctions::sharpeningcam (CieImage* ncie, float** b2, bool showMask)
if(showMask) {
// calculate contrast based blend factors to reduce sharpening in regions with low contrast
JaggedArray blend(W, H);
- buildBlendMask(ncie->sh_p, blend, W, H, params->sharpening.contrast / 100.f);
+ float contrast = params->sharpening.contrast / 100.f;
+ buildBlendMask(ncie->sh_p, blend, W, H, contrast);
#ifdef _OPENMP
#pragma omp parallel for
#endif
@@ -852,7 +857,8 @@ void ImProcFunctions::sharpeningcam (CieImage* ncie, float** b2, bool showMask)
// calculate contrast based blend factors to reduce sharpening in regions with low contrast
JaggedArray blend(W, H);
- buildBlendMask(ncie->sh_p, blend, W, H, params->sharpening.contrast / 100.f);
+ float contrast = params->sharpening.contrast / 100.f;
+ buildBlendMask(ncie->sh_p, blend, W, H, contrast);
#ifdef _OPENMP
#pragma omp parallel
diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc
index d8d6aee33..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
@@ -2388,6 +2390,7 @@ RAWParams::BayerSensor::BayerSensor() :
greenthresh(0),
dcb_iterations(2),
lmmse_iterations(2),
+ dualDemosaicAutoContrast(true),
dualDemosaicContrast(20),
pixelShiftMotionCorrectionMethod(PSMotionCorrectionMethod::AUTO),
pixelShiftEperIso(0.0),
@@ -2425,6 +2428,7 @@ bool RAWParams::BayerSensor::operator ==(const BayerSensor& other) const
&& greenthresh == other.greenthresh
&& dcb_iterations == other.dcb_iterations
&& lmmse_iterations == other.lmmse_iterations
+ && dualDemosaicAutoContrast == other.dualDemosaicAutoContrast
&& dualDemosaicContrast == other.dualDemosaicContrast
&& pixelShiftMotionCorrectionMethod == other.pixelShiftMotionCorrectionMethod
&& pixelShiftEperIso == other.pixelShiftEperIso
@@ -2512,6 +2516,7 @@ Glib::ustring RAWParams::BayerSensor::getPSDemosaicMethodString(PSDemosaicMethod
RAWParams::XTransSensor::XTransSensor() :
method(getMethodString(Method::THREE_PASS)),
+ dualDemosaicAutoContrast(true),
dualDemosaicContrast(20),
ccSteps(0),
blackred(0.0),
@@ -2524,6 +2529,7 @@ bool RAWParams::XTransSensor::operator ==(const XTransSensor& other) const
{
return
method == other.method
+ && dualDemosaicAutoContrast == other.dualDemosaicAutoContrast
&& dualDemosaicContrast == other.dualDemosaicContrast
&& ccSteps == other.ccSteps
&& blackred == other.blackred
@@ -3090,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);
@@ -3409,6 +3416,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
saveToKeyfile(!pedited || pedited->raw.bayersensor.dcbIterations, "RAW Bayer", "DCBIterations", raw.bayersensor.dcb_iterations, keyFile);
saveToKeyfile(!pedited || pedited->raw.bayersensor.dcbEnhance, "RAW Bayer", "DCBEnhance", raw.bayersensor.dcb_enhance, keyFile);
saveToKeyfile(!pedited || pedited->raw.bayersensor.lmmseIterations, "RAW Bayer", "LMMSEIterations", raw.bayersensor.lmmse_iterations, keyFile);
+ saveToKeyfile(!pedited || pedited->raw.bayersensor.dualDemosaicAutoContrast, "RAW Bayer", "DualDemosaicAutoContrast", raw.bayersensor.dualDemosaicAutoContrast, keyFile);
saveToKeyfile(!pedited || pedited->raw.bayersensor.dualDemosaicContrast, "RAW Bayer", "DualDemosaicContrast", raw.bayersensor.dualDemosaicContrast, keyFile);
saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftMotionCorrectionMethod, "RAW Bayer", "PixelShiftMotionCorrectionMethod", toUnderlying(raw.bayersensor.pixelShiftMotionCorrectionMethod), keyFile);
saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftEperIso, "RAW Bayer", "PixelShiftEperIso", raw.bayersensor.pixelShiftEperIso, keyFile);
@@ -3426,6 +3434,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftDemosaicMethod, "RAW Bayer", "pixelShiftDemosaicMethod", raw.bayersensor.pixelShiftDemosaicMethod, keyFile);
saveToKeyfile(!pedited || pedited->raw.bayersensor.pdafLinesFilter, "RAW Bayer", "PDAFLinesFilter", raw.bayersensor.pdafLinesFilter, keyFile);
saveToKeyfile(!pedited || pedited->raw.xtranssensor.method, "RAW X-Trans", "Method", raw.xtranssensor.method, keyFile);
+ saveToKeyfile(!pedited || pedited->raw.xtranssensor.dualDemosaicAutoContrast, "RAW X-Trans", "DualDemosaicAutoContrast", raw.xtranssensor.dualDemosaicAutoContrast, keyFile);
saveToKeyfile(!pedited || pedited->raw.xtranssensor.dualDemosaicContrast, "RAW X-Trans", "DualDemosaicContrast", raw.xtranssensor.dualDemosaicContrast, keyFile);
saveToKeyfile(!pedited || pedited->raw.xtranssensor.ccSteps, "RAW X-Trans", "CcSteps", raw.xtranssensor.ccSteps, keyFile);
saveToKeyfile(!pedited || pedited->raw.xtranssensor.exBlackRed, "RAW X-Trans", "PreBlackRed", raw.xtranssensor.blackred, keyFile);
@@ -4022,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");
@@ -4836,6 +4850,13 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "RAW Bayer", "DCBIterations", pedited, raw.bayersensor.dcb_iterations, pedited->raw.bayersensor.dcbIterations);
assignFromKeyfile(keyFile, "RAW Bayer", "DCBEnhance", pedited, raw.bayersensor.dcb_enhance, pedited->raw.bayersensor.dcbEnhance);
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 < 345) {
+ raw.bayersensor.dualDemosaicAutoContrast = false;
+ if (pedited) {
+ pedited->raw.bayersensor.dualDemosaicAutoContrast = true;
+ }
+ }
assignFromKeyfile(keyFile, "RAW Bayer", "DualDemosaicContrast", pedited, raw.bayersensor.dualDemosaicContrast, pedited->raw.bayersensor.dualDemosaicContrast);
if (keyFile.has_key("RAW Bayer", "PixelShiftMotionCorrectionMethod")) {
@@ -4883,6 +4904,13 @@ 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 < 345) {
+ raw.xtranssensor.dualDemosaicAutoContrast = false;
+ if (pedited) {
+ pedited->raw.xtranssensor.dualDemosaicAutoContrast = true;
+ }
+ }
assignFromKeyfile(keyFile, "RAW X-Trans", "DualDemosaicContrast", pedited, raw.xtranssensor.dualDemosaicContrast, pedited->raw.xtranssensor.dualDemosaicContrast);
assignFromKeyfile(keyFile, "RAW X-Trans", "CcSteps", pedited, raw.xtranssensor.ccSteps, pedited->raw.xtranssensor.ccSteps);
assignFromKeyfile(keyFile, "RAW X-Trans", "PreBlackRed", pedited, raw.xtranssensor.blackred, pedited->raw.xtranssensor.exBlackRed);
diff --git a/rtengine/procparams.h b/rtengine/procparams.h
index 0b8b5ba56..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();
@@ -1285,6 +1286,7 @@ struct RAWParams {
int greenthresh;
int dcb_iterations;
int lmmse_iterations;
+ bool dualDemosaicAutoContrast;
double dualDemosaicContrast;
PSMotionCorrectionMethod pixelShiftMotionCorrectionMethod;
double pixelShiftEperIso;
@@ -1332,6 +1334,7 @@ struct RAWParams {
};
Glib::ustring method;
+ bool dualDemosaicAutoContrast;
double dualDemosaicContrast;
int ccSteps;
double blackred;
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/rawimagesource.cc b/rtengine/rawimagesource.cc
index 1f84cad54..502da8073 100644
--- a/rtengine/rawimagesource.cc
+++ b/rtengine/rawimagesource.cc
@@ -2074,7 +2074,7 @@ void RawImageSource::demosaic(const RAWParams &raw, bool autoContrast, double &c
double threshold = raw.bayersensor.dualDemosaicContrast;
dual_demosaic_RT (true, raw, W, H, rawData, red, green, blue, threshold, false);
} else {
- dual_demosaic_RT (true, raw, W, H, rawData, red, green, blue, contrastThreshold, true, 0, 0);
+ dual_demosaic_RT (true, raw, W, H, rawData, red, green, blue, contrastThreshold, true);
}
} else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::PIXELSHIFT) ) {
pixelshift(0, 0, W, H, raw, currFrame, ri->get_maker(), ri->get_model(), raw.expos);
@@ -2107,7 +2107,7 @@ void RawImageSource::demosaic(const RAWParams &raw, bool autoContrast, double &c
double threshold = raw.xtranssensor.dualDemosaicContrast;
dual_demosaic_RT (false, raw, W, H, rawData, red, green, blue, threshold, false);
} else {
- dual_demosaic_RT (false, raw, W, H, rawData, red, green, blue, contrastThreshold, true, 0, 0);
+ dual_demosaic_RT (false, raw, W, H, rawData, red, green, blue, contrastThreshold, true);
}
} else if(raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::MONO) ) {
nodemosaic(true);
@@ -2872,8 +2872,6 @@ void RawImageSource::processFlatField(const RAWParams &raw, RawImage *riFlatFile
float limitFactor = 1.f;
if(raw.ff_AutoClipControl) {
-// int clipControlGui = 0;
-
for (int m = 0; m < 2; m++)
for (int n = 0; n < 2; n++) {
float maxval = 0.f;
@@ -2917,7 +2915,7 @@ void RawImageSource::processFlatField(const RAWParams &raw, RawImage *riFlatFile
}
}
-// clipControlGui = (1.f - limitFactor) * 100.f; // this value can be used to set the clip control slider in gui
+ flatFieldAutoClipValue = (1.f - limitFactor) * 100.f; // this value can be used to set the clip control slider in gui
} else {
limitFactor = max((float)(100 - raw.ff_clipControl) / 100.f, 0.01f);
}
@@ -3003,7 +3001,6 @@ void RawImageSource::processFlatField(const RAWParams &raw, RawImage *riFlatFile
if(raw.ff_AutoClipControl) {
// determine maximum calculated value to avoid clipping
-// int clipControlGui = 0;
float maxval = 0.f;
// xtrans files have only one black level actually, so we can simplify the code a bit
#ifdef _OPENMP
@@ -3038,7 +3035,7 @@ void RawImageSource::processFlatField(const RAWParams &raw, RawImage *riFlatFile
// there's only one white level for xtrans
if(maxval + black[0] > ri->get_white(0)) {
limitFactor = ri->get_white(0) / (maxval + black[0]);
-// clipControlGui = (1.f - limitFactor) * 100.f; // this value can be used to set the clip control slider in gui
+ flatFieldAutoClipValue = (1.f - limitFactor) * 100.f; // this value can be used to set the clip control slider in gui
}
} else {
limitFactor = max((float)(100 - raw.ff_clipControl) / 100.f, 0.01f);
diff --git a/rtengine/rawimagesource.h b/rtengine/rawimagesource.h
index ad7807a44..f78a4121b 100644
--- a/rtengine/rawimagesource.h
+++ b/rtengine/rawimagesource.h
@@ -74,7 +74,7 @@ protected:
RawImage* riFrames[4] = {nullptr};
unsigned int currFrame = 0;
unsigned int numFrames = 0;
-
+ int flatFieldAutoClipValue = 0;
array2D rawData; // holds preprocessed pixel values, rowData[i][j] corresponds to the ith row and jth column
array2D *rawDataFrames[4] = {nullptr};
array2D *rawDataBuffer[3] = {nullptr};
@@ -212,6 +212,7 @@ public:
ri = riFrames[currFrame];
}
int getFrameCount() {return numFrames;}
+ int getFlatFieldAutoClipValue() {return flatFieldAutoClipValue;}
class GreenEqulibrateThreshold {
public:
@@ -274,7 +275,7 @@ protected:
void igv_interpolate(int winw, int winh);
void lmmse_interpolate_omp(int winw, int winh, array2D &rawData, array2D &red, array2D &green, array2D &blue, int iterations);
void amaze_demosaic_RT(int winx, int winy, int winw, int winh, const array2D &rawData, array2D &red, array2D &green, array2D &blue);//Emil's code for AMaZE
- void dual_demosaic_RT(bool isBayer, const RAWParams &raw, int winw, int winh, const array2D &rawData, array2D &red, array2D &green, array2D &blue, double &contrast, bool autoContrast = false, int autoX = -1, int autoY = -1);
+ void dual_demosaic_RT(bool isBayer, const RAWParams &raw, int winw, int winh, const array2D &rawData, array2D &red, array2D &green, array2D &blue, double &contrast, bool autoContrast = false);
void fast_demosaic();//Emil's code for fast demosaicing
void dcb_demosaic(int iterations, bool dcb_enhance);
void ahd_demosaic();
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/rt_algo.cc b/rtengine/rt_algo.cc
index c56a72a2c..ae385508a 100644
--- a/rtengine/rt_algo.cc
+++ b/rtengine/rt_algo.cc
@@ -23,6 +23,7 @@
#include
#include
#include
+#include
#ifdef _OPENMP
#include
#endif
@@ -32,6 +33,7 @@
#include "rt_algo.h"
#include "rt_math.h"
#include "sleef.c"
+#include "jaggedarray.h"
namespace {
float calcBlendFactor(float val, float threshold) {
@@ -190,75 +192,166 @@ void findMinMaxPercentile(const float* data, size_t size, float minPrct, float&
maxOut += minVal;
}
-void buildBlendMask(float** luminance, float **blend, int W, int H, float contrastThreshold, float amount) {
+void buildBlendMask(float** luminance, float **blend, int W, int H, float &contrastThreshold, float amount, bool autoContrast) {
- constexpr float scale = 0.0625f / 327.68f;
-
- if(contrastThreshold == 0.f) {
+ if(contrastThreshold == 0.f && !autoContrast) {
for(int j = 0; j < H; ++j) {
for(int i = 0; i < W; ++i) {
blend[j][i] = amount;
}
}
} else {
-#ifdef _OPENMP
- #pragma omp parallel
-#endif
- {
-#ifdef __SSE2__
- const vfloat contrastThresholdv = F2V(contrastThreshold);
- const vfloat scalev = F2V(scale);
- const vfloat amountv = F2V(amount);
-#endif
-#ifdef _OPENMP
- #pragma omp for schedule(dynamic,16)
-#endif
+ constexpr float scale = 0.0625f / 327.68f;
+ if (autoContrast) {
+ for (int pass = 0; pass < 2; ++pass) {
+ const int tilesize = 80 / (pass + 1);
+ const int numTilesW = W / tilesize;
+ const int numTilesH = H / tilesize;
+ std::vector>> variances(numTilesH, std::vector>(numTilesW));
- for(int j = 2; j < H - 2; ++j) {
- int i = 2;
+ #pragma omp parallel for
+ for (int i = 0; i < numTilesH; ++i) {
+ int tileY = i * tilesize;
+ for (int j = 0; j < numTilesW; ++j) {
+ int tileX = j * tilesize;
#ifdef __SSE2__
- for(; i < W - 5; i += 4) {
- vfloat contrastv = vsqrtf(SQRV(LVFU(luminance[j][i+1]) - LVFU(luminance[j][i-1])) + SQRV(LVFU(luminance[j+1][i]) - LVFU(luminance[j-1][i])) +
- SQRV(LVFU(luminance[j][i+2]) - LVFU(luminance[j][i-2])) + SQRV(LVFU(luminance[j+2][i]) - LVFU(luminance[j-2][i]))) * scalev;
-
- STVFU(blend[j][i], amountv * calcBlendFactor(contrastv, contrastThresholdv));
+ vfloat avgv = ZEROV;
+ for (int y = tileY; y < tileY + tilesize; ++y) {
+ for (int x = tileX; x < tileX + tilesize; x += 4) {
+ avgv += LVFU(luminance[y][x]);
+ }
+ }
+ float avg = vhadd(avgv);
+#else
+ float avg = 0.;
+ for (int y = tileY; y < tileY + tilesize; ++y) {
+ for (int x = tileX; x < tileX + tilesize; ++x) {
+ avg += luminance[y][x];
+ }
+ }
+#endif
+ avg /= SQR(tilesize);
+#ifdef __SSE2__
+ vfloat varv = ZEROV;
+ avgv = F2V(avg);
+ for (int y = tileY; y < tileY + tilesize; ++y) {
+ for (int x = tileX; x < tileX + tilesize; x +=4) {
+ varv += SQRV(LVFU(luminance[y][x]) - avgv);
+ }
+ }
+ float var = vhadd(varv);
+#else
+ float var = 0.0;
+ for (int y = tileY; y < tileY + tilesize; ++y) {
+ for (int x = tileX; x < tileX + tilesize; ++x) {
+ var += SQR(luminance[y][x] - avg);
+ }
+ }
+ #endif
+ var /= (SQR(tilesize) * avg);
+ variances[i][j].first = var;
+ variances[i][j].second = avg;
+ }
}
-#endif
- for(; i < W - 2; ++i) {
- float contrast = sqrtf(rtengine::SQR(luminance[j][i+1] - luminance[j][i-1]) + rtengine::SQR(luminance[j+1][i] - luminance[j-1][i]) +
- rtengine::SQR(luminance[j][i+2] - luminance[j][i-2]) + rtengine::SQR(luminance[j+2][i] - luminance[j-2][i])) * scale;
+ float minvar = RT_INFINITY_F;
+ int minI = 0, minJ = 0;
+ for (int i = 0; i < numTilesH; ++i) {
+ for (int j = 0; j < numTilesW; ++j) {
+ if (variances[i][j].first < minvar && variances[i][j].second > 2000.f && variances[i][j].second < 20000.f) {
+ minvar = variances[i][j].first;
+ minI = i;
+ minJ = j;
+ }
+ }
+ }
- blend[j][i] = amount * calcBlendFactor(contrast, contrastThreshold);
+ const int minY = tilesize * minI;
+ const int minX = tilesize * minJ;
+
+// std::cout << pass << ": minvar : " << minvar << std::endl;
+ if (minvar <= 1.f || pass == 1) {
+ // a variance <= 1 means we already found a flat region and can skip second pass
+ // in second pass we allow a variance of 2
+ JaggedArray Lum(tilesize, tilesize);
+ JaggedArray Blend(tilesize, tilesize);
+ for (int i = 0; i < tilesize; ++i) {
+ for (int j = 0; j < tilesize; ++j) {
+ Lum[i][j] = luminance[i + minY][j + minX];
+ }
+ }
+ contrastThreshold = (pass == 0 || minvar <= 2.f) ? calcContrastThreshold(Lum, Blend, tilesize, tilesize) / 100.f : 0.f;
+ break;
}
}
+ }
+ if(contrastThreshold == 0.f) {
+ for(int j = 0; j < H; ++j) {
+ for(int i = 0; i < W; ++i) {
+ blend[j][i] = amount;
+ }
+ }
+ } else {
#ifdef _OPENMP
- #pragma omp single
+ #pragma omp parallel
#endif
{
- // upper border
- for(int j = 0; j < 2; ++j) {
- for(int i = 2; i < W - 2; ++i) {
- blend[j][i] = blend[2][i];
- }
- }
- // lower border
- for(int j = H - 2; j < H; ++j) {
- for(int i = 2; i < W - 2; ++i) {
- blend[j][i] = blend[H-3][i];
- }
- }
- for(int j = 0; j < H; ++j) {
- // left border
- blend[j][0] = blend[j][1] = blend[j][2];
- // right border
- blend[j][W - 2] = blend[j][W - 1] = blend[j][W - 3];
- }
- }
+#ifdef __SSE2__
+ const vfloat contrastThresholdv = F2V(contrastThreshold);
+ const vfloat scalev = F2V(scale);
+ const vfloat amountv = F2V(amount);
+#endif
+#ifdef _OPENMP
+ #pragma omp for schedule(dynamic,16)
+#endif
- // blur blend mask to smooth transitions
- gaussianBlur(blend, blend, W, H, 2.0);
+ for(int j = 2; j < H - 2; ++j) {
+ int i = 2;
+#ifdef __SSE2__
+ for(; i < W - 5; i += 4) {
+ vfloat contrastv = vsqrtf(SQRV(LVFU(luminance[j][i+1]) - LVFU(luminance[j][i-1])) + SQRV(LVFU(luminance[j+1][i]) - LVFU(luminance[j-1][i])) +
+ SQRV(LVFU(luminance[j][i+2]) - LVFU(luminance[j][i-2])) + SQRV(LVFU(luminance[j+2][i]) - LVFU(luminance[j-2][i]))) * scalev;
+
+ STVFU(blend[j][i], amountv * calcBlendFactor(contrastv, contrastThresholdv));
+ }
+#endif
+ for(; i < W - 2; ++i) {
+
+ float contrast = sqrtf(rtengine::SQR(luminance[j][i+1] - luminance[j][i-1]) + rtengine::SQR(luminance[j+1][i] - luminance[j-1][i]) +
+ rtengine::SQR(luminance[j][i+2] - luminance[j][i-2]) + rtengine::SQR(luminance[j+2][i] - luminance[j-2][i])) * scale;
+
+ blend[j][i] = amount * calcBlendFactor(contrast, contrastThreshold);
+ }
+ }
+
+#ifdef _OPENMP
+ #pragma omp single
+#endif
+ {
+ // upper border
+ for(int j = 0; j < 2; ++j) {
+ for(int i = 2; i < W - 2; ++i) {
+ blend[j][i] = blend[2][i];
+ }
+ }
+ // lower border
+ for(int j = H - 2; j < H; ++j) {
+ for(int i = 2; i < W - 2; ++i) {
+ blend[j][i] = blend[H-3][i];
+ }
+ }
+ for(int j = 0; j < H; ++j) {
+ // left border
+ blend[j][0] = blend[j][1] = blend[j][2];
+ // right border
+ blend[j][W - 2] = blend[j][W - 1] = blend[j][W - 3];
+ }
+ }
+
+ // blur blend mask to smooth transitions
+ gaussianBlur(blend, blend, W, H, 2.0);
+ }
}
}
}
@@ -289,7 +382,7 @@ int calcContrastThreshold(float** luminance, float **blend, int W, int H) {
}
}
- const float limit = (W - 2) * (H - 2) / 100.f;
+ const float limit = (W - 4) * (H - 4) / 100.f;
int c;
for (c = 1; c < 100; ++c) {
@@ -318,6 +411,7 @@ int calcContrastThreshold(float** luminance, float **blend, int W, int H) {
break;
}
}
+
return c;
}
}
diff --git a/rtengine/rt_algo.h b/rtengine/rt_algo.h
index e20713b8f..0207e6f57 100644
--- a/rtengine/rt_algo.h
+++ b/rtengine/rt_algo.h
@@ -24,6 +24,6 @@
namespace rtengine
{
void findMinMaxPercentile(const float* data, size_t size, float minPrct, float& minOut, float maxPrct, float& maxOut, bool multiThread = true);
-void buildBlendMask(float** luminance, float **blend, int W, int H, float contrastThreshold, float amount = 1.f);
+void buildBlendMask(float** luminance, float **blend, int W, int H, float &contrastThreshold, float amount = 1.f, bool autoContrast = false);
int calcContrastThreshold(float** luminance, float **blend, int W, int H);
}
diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h
index d26d82396..bc8c12fec 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,84 +313,93 @@ 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 FlatFieldAutoClipListener
+{
+public:
+ virtual ~FlatFieldAutoClipListener() = default;
+ virtual void flatFieldAutoClipValueChanged(int n) = 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
+{
+public :
+ virtual ~AutoContrastListener() = default;
+ virtual void autoContrastChanged (double autoContrast) = 0;
};
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. */
@@ -469,7 +495,10 @@ public:
virtual void setHistogramListener (HistogramListener *l) = 0;
virtual void setPreviewImageListener (PreviewImageListener* l) = 0;
virtual void setAutoCamListener (AutoCamListener* l) = 0;
+ virtual void setFlatFieldAutoClipListener (FlatFieldAutoClipListener* l) = 0;
virtual void setFrameCountListener (FrameCountListener* l) = 0;
+ virtual void setBayerAutoContrastListener (AutoContrastListener* l) = 0;
+ virtual void setXtransAutoContrastListener (AutoContrastListener* l) = 0;
virtual void setAutoBWListener (AutoBWListener* l) = 0;
virtual void setAutoWBListener (AutoWBListener* l) = 0;
virtual void setAutoColorTonListener (AutoColorTonListener* l) = 0;
@@ -554,8 +583,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/simpleprocess.cc b/rtengine/simpleprocess.cc
index fbee20f44..06e2b13bf 100644
--- a/rtengine/simpleprocess.cc
+++ b/rtengine/simpleprocess.cc
@@ -209,8 +209,10 @@ private:
if (pl) {
pl->setProgress (0.20);
}
- double contrastThresholdDummy;
- imgsrc->demosaic (params.raw, false, contrastThresholdDummy);
+ bool autoContrast = imgsrc->getSensorType() == ST_BAYER ? params.raw.bayersensor.dualDemosaicAutoContrast : params.raw.xtranssensor.dualDemosaicAutoContrast;
+ double contrastThreshold = imgsrc->getSensorType() == ST_BAYER ? params.raw.bayersensor.dualDemosaicContrast : params.raw.xtranssensor.dualDemosaicContrast;
+
+ imgsrc->demosaic (params.raw, autoContrast, contrastThreshold);
if (pl) {
diff --git a/rtengine/stdimagesource.h b/rtengine/stdimagesource.h
index 62cca7d4f..1dbb65001 100644
--- a/rtengine/stdimagesource.h
+++ b/rtengine/stdimagesource.h
@@ -100,6 +100,7 @@ public:
}
void setCurrentFrame(unsigned int frameNum) {}
int getFrameCount() {return 1;}
+ int getFlatFieldAutoClipValue() {return 0;}
void getRawValues(int x, int y, int rotate, int &R, int &G, int &B) { R = G = B = 0;}
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/rtexif/rtexif.cc b/rtexif/rtexif.cc
index 0715ccfd6..c35ba7e0b 100644
--- a/rtexif/rtexif.cc
+++ b/rtexif/rtexif.cc
@@ -3043,7 +3043,7 @@ void ExifManager::parse (bool isRaw, bool skipIgnored)
if (!sftTagList.empty()) {
for (auto sft : sftTagList) {
int sftVal = sft->toInt();
- if (sftVal == (isRaw ? 0 : 2)) {
+ if (sftVal == 0 || (!isRaw && sftVal == 2)) {
frames.push_back(sft->getParent());
frameRootDetected = true;
diff --git a/rtgui/adjuster.cc b/rtgui/adjuster.cc
index 3f12b0cfb..46aa3952b 100644
--- a/rtgui/adjuster.cc
+++ b/rtgui/adjuster.cc
@@ -239,10 +239,12 @@ void Adjuster::autoToggled ()
// Disable the slider and spin button
spin->set_sensitive(false);
slider->set_sensitive(false);
+ reset->set_sensitive(false);
} else {
// Enable the slider and spin button
spin->set_sensitive(true);
slider->set_sensitive(true);
+ reset->set_sensitive(true);
}
}
@@ -471,10 +473,12 @@ void Adjuster::setAutoValue (bool a)
// Disable the slider and spin button
spin->set_sensitive(false);
slider->set_sensitive(false);
+ reset->set_sensitive(false);
} else {
// Enable the slider and spin button
spin->set_sensitive(true);
slider->set_sensitive(true);
+ reset->set_sensitive(true);
}
}
}
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 1a9e08b94..83a0f37ae 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 ();
@@ -323,7 +322,7 @@ void BatchQueuePanel::addBatchQueueJobs ( std::vector &entries
bool BatchQueuePanel::canStartNext ()
{
-
+// GThreadLock lock;
if (qStartStop->get_active()) {
return true;
} else {
@@ -363,15 +362,12 @@ void BatchQueuePanel::pathFolderButtonPressed ()
// since these settings are shared with editorpanel :
void BatchQueuePanel::pathFolderChanged ()
{
-
options.savePathFolder = outdirFolder->get_filename();
}
-void BatchQueuePanel::formatChanged (Glib::ustring f)
+void BatchQueuePanel::formatChanged(const Glib::ustring& format)
{
-
- options.saveFormatBatch = saveFormatPanel->getFormat ();
-
+ options.saveFormatBatch = saveFormatPanel->getFormat();
}
bool BatchQueuePanel::handleShortcutKey (GdkEventKey* event)
diff --git a/rtgui/batchqueuepanel.h b/rtgui/batchqueuepanel.h
index 497bc166e..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 ();
@@ -72,7 +72,7 @@ public:
void saveOptions ();
void pathFolderChanged ();
void pathFolderButtonPressed ();
- void formatChanged (Glib::ustring f);
+ void formatChanged(const Glib::ustring& format) override;
void updateTab (int qsize, int forceOrientation = 0); // forceOrientation=0: base on options / 1: horizontal / 2: vertical
bool handleShortcutKey (GdkEventKey* event);
diff --git a/rtgui/batchtoolpanelcoord.cc b/rtgui/batchtoolpanelcoord.cc
index b31f41e4f..0b17d9bd3 100644
--- a/rtgui/batchtoolpanelcoord.cc
+++ b/rtgui/batchtoolpanelcoord.cc
@@ -383,9 +383,8 @@ void BatchToolPanelCoordinator::initSession ()
}
}
-void BatchToolPanelCoordinator::panelChanged (rtengine::ProcEvent event, const Glib::ustring& descr)
+void BatchToolPanelCoordinator::panelChanged(const rtengine::ProcEvent& event, const Glib::ustring& descr)
{
-
if (selected.empty()) {
return;
}
@@ -611,9 +610,14 @@ void BatchToolPanelCoordinator::endBatchPParamsChange()
* Using a Profile panel in the batch tool panel editor is actually
* not supported by BatchToolPanelCoordinator::profileChange!
*/
-void BatchToolPanelCoordinator::profileChange (const rtengine::procparams::PartialProfile* nparams, rtengine::ProcEvent event, const Glib::ustring& descr, const ParamsEdited* paramsEdited)
+void BatchToolPanelCoordinator::profileChange(
+ const PartialProfile* nparams,
+ const rtengine::ProcEvent& event,
+ const Glib::ustring& descr,
+ const ParamsEdited* paramsEdited,
+ bool fromLastSave
+)
{
-
if (event == rtengine::EvProfileChanged) {
// a profile has been selected in a hypothetical Profile panel
// -> ACTUALLY NOT SUPPORTED
diff --git a/rtgui/batchtoolpanelcoord.h b/rtgui/batchtoolpanelcoord.h
index 4efcea6fa..204750047 100644
--- a/rtgui/batchtoolpanelcoord.h
+++ b/rtgui/batchtoolpanelcoord.h
@@ -51,30 +51,36 @@ public:
explicit BatchToolPanelCoordinator (FilePanel* parent);
// FileSelectionChangeListener interface
- void selectionChanged (const std::vector& selected);
+ void selectionChanged (const std::vector& selected) override;
// toolpanellistener interface
- void panelChanged (rtengine::ProcEvent event, const Glib::ustring& descr);
+ void panelChanged(const rtengine::ProcEvent& event, const Glib::ustring& descr) override;
// profilechangelistener interface
- void profileChange (const rtengine::procparams::PartialProfile* nparams, rtengine::ProcEvent event, const Glib::ustring& descr, const ParamsEdited* paramsEdited = nullptr);
+ void profileChange(
+ const rtengine::procparams::PartialProfile* nparams,
+ const rtengine::ProcEvent& event,
+ const Glib::ustring& descr,
+ const ParamsEdited* paramsEdited = nullptr,
+ bool fromLastSave = false
+ ) override;
// wbprovider interface
- void getAutoWB (double& temp, double& green, double equal, double tempBias);
+ void getAutoWB (double& temp, double& green, double equal, double tempBias) override;
void getCamWB (double& temp, double& green);
// thumbnaillistener interface
- void procParamsChanged (Thumbnail* thm, int whoChangedIt);
+ void procParamsChanged (Thumbnail* thm, int whoChangedIt) override;
// batchpparamschangelistener interface
- void beginBatchPParamsChange(int numberOfEntries);
- void endBatchPParamsChange();
+ void beginBatchPParamsChange(int numberOfEntries) override;
+ void endBatchPParamsChange() override;
// imageareatoollistener interface
- void spotWBselected (int x, int y, Thumbnail* thm = nullptr);
- void cropSelectionReady ();
- void rotateSelectionReady (double rotate_deg, Thumbnail* thm = nullptr);
- CropGUIListener* startCropEditing (Thumbnail* thm = nullptr);
+ void spotWBselected (int x, int y, Thumbnail* thm = nullptr) override;
+ void cropSelectionReady () override;
+ void rotateSelectionReady (double rotate_deg, Thumbnail* thm = nullptr) override;
+ CropGUIListener* startCropEditing (Thumbnail* thm = nullptr) override;
void optionsChanged ();
};
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 d68f5c2d3..2a65a158e 100644
--- a/rtgui/bayerprocess.cc
+++ b/rtgui/bayerprocess.cc
@@ -30,6 +30,7 @@ BayerProcess::BayerProcess () : FoldableToolPanel(this, "bayerprocess", M("TP_RA
auto m = ProcEventMapper::getInstance();
EvDemosaicBorder = m->newEvent(DEMOSAIC, "HISTORY_MSG_RAW_BORDER");
EvDemosaicContrast = m->newEvent(DEMOSAIC, "HISTORY_MSG_DUALDEMOSAIC_CONTRAST");
+ EvDemosaicAutoContrast = m->newEvent(DEMOSAIC, "HISTORY_MSG_DUALDEMOSAIC_AUTO_CONTRAST");
EvDemosaicPixelshiftDemosaicMethod = m->newEvent(DEMOSAIC, "HISTORY_MSG_PIXELSHIFT_DEMOSAIC");
Gtk::HBox* hb1 = Gtk::manage (new Gtk::HBox ());
@@ -46,12 +47,12 @@ BayerProcess::BayerProcess () : FoldableToolPanel(this, "bayerprocess", M("TP_RA
hb1->pack_end (*method, Gtk::PACK_EXPAND_WIDGET, 4);
pack_start( *hb1, Gtk::PACK_SHRINK, 4);
+ dualDemosaicOptions = Gtk::manage(new Gtk::VBox());
- dualDemosaicOptions = Gtk::manage (new Gtk::VBox ());
-
- dualDemosaicContrast = Gtk::manage(new Adjuster (M("TP_RAW_DUALDEMOSAICCONTRAST"), 0, 100, 1, 20));
- dualDemosaicContrast->setAdjusterListener (this);
-
+ dualDemosaicContrast = Gtk::manage(new Adjuster(M("TP_RAW_DUALDEMOSAICCONTRAST"), 0, 100, 1, 20));
+ dualDemosaicContrast->setAdjusterListener(this);
+ dualDemosaicContrast->addAutoButton(M("TP_RAW_DUALDEMOSAICAUTOCONTRAST_TOOLTIP"));
+ dualDemosaicContrast->setAutoValue(true);
if (dualDemosaicContrast->delay < options.adjusterMaxDelay) {
dualDemosaicContrast->delay = options.adjusterMaxDelay;
}
@@ -250,6 +251,10 @@ BayerProcess::BayerProcess () : FoldableToolPanel(this, "bayerprocess", M("TP_RA
}
+BayerProcess::~BayerProcess ()
+{
+ idle_register.destroy();
+}
void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited)
{
@@ -300,7 +305,9 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params
pixelShiftNonGreenCross->setValue (pp->raw.bayersensor.pixelShiftNonGreenCross);
ccSteps->setValue (pp->raw.bayersensor.ccSteps);
lmmseIterations->setValue (pp->raw.bayersensor.lmmse_iterations);
+ dualDemosaicContrast->setAutoValue(pp->raw.bayersensor.dualDemosaicAutoContrast);
dualDemosaicContrast->setValue (pp->raw.bayersensor.dualDemosaicContrast);
+
pixelShiftMotionMethod->set_active ((int)pp->raw.bayersensor.pixelShiftMotionCorrectionMethod);
pixelShiftEperIso->setValue (pp->raw.bayersensor.pixelShiftEperIso);
pixelShiftSigma->setValue (pp->raw.bayersensor.pixelShiftSigma);
@@ -325,6 +332,7 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params
pixelShiftNonGreenCross->setEdited (pedited->raw.bayersensor.pixelShiftNonGreenCross);
lmmseIterations->setEditedState ( pedited->raw.bayersensor.lmmseIterations ? Edited : UnEdited);
dualDemosaicContrast->setEditedState ( pedited->raw.bayersensor.dualDemosaicContrast ? Edited : UnEdited);
+ dualDemosaicContrast->setAutoInconsistent (multiImage && !pedited->raw.bayersensor.dualDemosaicAutoContrast);
pixelShiftEperIso->setEditedState ( pedited->raw.bayersensor.pixelShiftEperIso ? Edited : UnEdited);
pixelShiftSigma->setEditedState ( pedited->raw.bayersensor.pixelShiftSigma ? Edited : UnEdited);
@@ -345,6 +353,7 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params
}
}
+ lastAutoContrast = pp->raw.bayersensor.dualDemosaicAutoContrast;
if (!batchMode) {
dcbOptions->set_visible(pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::DCB) || pp->raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::DCBVNG4));
@@ -385,6 +394,7 @@ void BayerProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pe
pp->raw.bayersensor.dcb_enhance = dcbEnhance->getLastActive ();
pp->raw.bayersensor.border = border->getIntValue();
pp->raw.bayersensor.lmmse_iterations = lmmseIterations->getIntValue();
+ pp->raw.bayersensor.dualDemosaicAutoContrast = dualDemosaicContrast->getAutoValue();
pp->raw.bayersensor.dualDemosaicContrast = dualDemosaicContrast->getValue();
pp->raw.bayersensor.pixelShiftMotionCorrectionMethod = (RAWParams::BayerSensor::PSMotionCorrectionMethod)pixelShiftMotionMethod->get_active_row_number();
pp->raw.bayersensor.pixelShiftEperIso = pixelShiftEperIso->getValue();
@@ -425,6 +435,7 @@ void BayerProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pe
pedited->raw.bayersensor.dcbEnhance = !dcbEnhance->get_inconsistent();
//pedited->raw.bayersensor.allEnhance = !allEnhance->get_inconsistent();
pedited->raw.bayersensor.lmmseIterations = lmmseIterations->getEditedState ();
+ pedited->raw.bayersensor.dualDemosaicAutoContrast = !dualDemosaicContrast->getAutoInconsistent ();
pedited->raw.bayersensor.dualDemosaicContrast = dualDemosaicContrast->getEditedState ();
pedited->raw.bayersensor.pixelShiftMotionCorrectionMethod = pixelShiftMotionMethod->get_active_text() != M("GENERAL_UNCHANGED");
pedited->raw.bayersensor.pixelShiftDemosaicMethod = pixelShiftDemosaicMethod->get_active_text() != M("GENERAL_UNCHANGED");
@@ -656,6 +667,33 @@ void BayerProcess::checkBoxToggled (CheckBox* c, CheckValue newval)
}
}
+void BayerProcess::adjusterAutoToggled(Adjuster* a, bool newval)
+{
+ if (multiImage) {
+ if (dualDemosaicContrast->getAutoInconsistent()) {
+ dualDemosaicContrast->setAutoInconsistent (false);
+ dualDemosaicContrast->setAutoValue (false);
+ } else if (lastAutoContrast) {
+ dualDemosaicContrast->setAutoInconsistent (true);
+ }
+
+ lastAutoContrast = dualDemosaicContrast->getAutoValue();
+ }
+
+ if (listener) {
+
+ if (a == dualDemosaicContrast) {
+ if (dualDemosaicContrast->getAutoInconsistent()) {
+ listener->panelChanged (EvDemosaicAutoContrast, M ("GENERAL_UNCHANGED"));
+ } else if (dualDemosaicContrast->getAutoValue()) {
+ listener->panelChanged (EvDemosaicAutoContrast, M ("GENERAL_ENABLED"));
+ } else {
+ listener->panelChanged (EvDemosaicAutoContrast, M ("GENERAL_DISABLED"));
+ }
+ }
+ }
+}
+
void BayerProcess::pixelShiftMotionMethodChanged ()
{
if (!batchMode) {
@@ -711,23 +749,23 @@ void BayerProcess::FrameCountChanged(int n, int frameNum)
};
idle_register.add(func, new Data { this, n, frameNum });
-
- // GThreadLock lock;
- // imageNumber->block (true);
-
- // imageNumber->remove_all();
- // imageNumber->append("1");
- // for(int i = 2; i <= std::min(n, 4); ++i) {
- // std::ostringstream entry;
- // entry << i;
- // imageNumber->append(entry.str());
- // }
- // imageNumber->set_active(std::min(frameNum, n - 1));
- // if(n == 1) {
- // imageNumberBox->hide();
- // } else {
- // imageNumberBox->show();
- // }
- // imageNumber->block (false);
}
+void BayerProcess::autoContrastChanged (double autoContrast)
+{
+ struct Data {
+ BayerProcess *me;
+ double autoContrast;
+ };
+ const auto func = [](gpointer data) -> gboolean {
+ Data *d = static_cast(data);
+ BayerProcess *me = d->me;
+ me->disableListener();
+ me->dualDemosaicContrast->setValue(d->autoContrast);
+ me->enableListener();
+ delete d;
+ return FALSE;
+ };
+
+ idle_register.add(func, new Data { this, autoContrast });
+}
diff --git a/rtgui/bayerprocess.h b/rtgui/bayerprocess.h
index cfd063ca9..b0974e7a4 100644
--- a/rtgui/bayerprocess.h
+++ b/rtgui/bayerprocess.h
@@ -25,7 +25,7 @@
#include "guiutils.h"
#include "toolpanel.h"
-class BayerProcess : public ToolParamBlock, public AdjusterListener, public CheckBoxListener, public FoldableToolPanel, public rtengine::FrameCountListener
+class BayerProcess : public ToolParamBlock, public AdjusterListener, public CheckBoxListener, public FoldableToolPanel, public rtengine::FrameCountListener, public rtengine::AutoContrastListener
{
protected:
@@ -60,15 +60,17 @@ protected:
Gtk::VBox *dualDemosaicOptions;
Adjuster* dualDemosaicContrast;
int oldMethod;
-
+ bool lastAutoContrast;
IdleRegister idle_register;
rtengine::ProcEvent EvDemosaicBorder;
+ rtengine::ProcEvent EvDemosaicAutoContrast;
rtengine::ProcEvent EvDemosaicContrast;
rtengine::ProcEvent EvDemosaicPixelshiftDemosaicMethod;
public:
BayerProcess ();
+ ~BayerProcess ();
void read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr);
void write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr);
@@ -80,9 +82,11 @@ 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();
+ void autoContrastChanged (double autoContrast);
void FrameCountChanged(int n, int frameNum);
};
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.cc b/rtgui/cropwindow.cc
index 790f5c294..bb4b049a3 100644
--- a/rtgui/cropwindow.cc
+++ b/rtgui/cropwindow.cc
@@ -267,15 +267,22 @@ void CropWindow::flawnOver (bool isFlawnOver)
this->isFlawnOver = isFlawnOver;
}
-void CropWindow::scroll (int state, GdkScrollDirection direction, int x, int y)
+void CropWindow::scroll (int state, GdkScrollDirection direction, int x, int y, double deltaX, double deltaY)
{
+ double delta = 0.0;
+ if (abs(deltaX) > abs(deltaY)) {
+ delta = deltaX;
+ } else {
+ delta = deltaY;
+ }
+ bool isUp = direction == GDK_SCROLL_UP || (direction == GDK_SCROLL_SMOOTH && delta < 0.0);
if ((state & GDK_CONTROL_MASK) && onArea(ColorPicker, x, y)) {
// resizing a color picker
- if (direction == GDK_SCROLL_UP) {
+ if (isUp) {
hoveredPicker->incSize();
updateHoveredPicker();
iarea->redraw ();
- }else if (direction == GDK_SCROLL_DOWN) {
+ } else {
hoveredPicker->decSize();
updateHoveredPicker();
iarea->redraw ();
@@ -287,9 +294,9 @@ void CropWindow::scroll (int state, GdkScrollDirection direction, int x, int y)
screenCoordToImage(newCenterX, newCenterY, newCenterX, newCenterY);
- if (direction == GDK_SCROLL_UP && !isMaxZoom()) {
+ if (isUp && !isMaxZoom()) {
zoomIn (true, newCenterX, newCenterY);
- } else if (direction == GDK_SCROLL_DOWN && !isMinZoom()) {
+ } else if (!isUp && !isMinZoom()) {
zoomOut (true, newCenterX, newCenterY);
}
}
diff --git a/rtgui/cropwindow.h b/rtgui/cropwindow.h
index 9f0dfb7f4..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;
@@ -187,7 +187,7 @@ public:
bool isInside (int x, int y);
- void scroll (int state, GdkScrollDirection direction, int x, int y);
+ void scroll (int state, GdkScrollDirection direction, int x, int y, double deltaX=0.0, double deltaY=0.0);
void buttonPress (int button, int num, int state, int x, int y);
void buttonRelease (int button, int num, int state, int x, int y);
void pointerMoved (int bstate, int x, int y);
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 4056d6805..d8312ffd2 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 7ec494e7c..40a1eb975 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..057ce731c 100644
--- a/rtgui/flatfield.cc
+++ b/rtgui/flatfield.cc
@@ -104,6 +104,11 @@ FlatField::FlatField () : FoldableToolPanel(this, "flatfield", M("TP_FLATFIELD_L
}
}
+FlatField::~FlatField ()
+{
+ idle_register.destroy();
+}
+
void FlatField::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited)
{
disableListener ();
@@ -232,11 +237,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 +252,6 @@ void FlatField::adjusterChanged (Adjuster* a, double newval)
void FlatField::adjusterAutoToggled (Adjuster* a, bool newval)
{
-
if (multiImage) {
if (flatFieldClipControl->getAutoInconsistent()) {
flatFieldClipControl->setAutoInconsistent(false);
@@ -405,3 +408,22 @@ void FlatField::setShortcutPath(const Glib::ustring& path)
} catch (Glib::Error&) {}
}
+
+void FlatField::flatFieldAutoClipValueChanged(int n)
+{
+ struct Data {
+ FlatField *me;
+ int n;
+ };
+ const auto func = [](gpointer data) -> gboolean {
+ Data *d = static_cast(data);
+ FlatField *me = d->me;
+ me->disableListener();
+ me->flatFieldClipControl->setValue (d->n);
+ me->enableListener();
+ delete d;
+ return FALSE;
+ };
+
+ idle_register.add(func, new Data { this, n });
+}
\ No newline at end of file
diff --git a/rtgui/flatfield.h b/rtgui/flatfield.h
index 4c0a33a54..599589b68 100644
--- a/rtgui/flatfield.h
+++ b/rtgui/flatfield.h
@@ -35,7 +35,7 @@ public:
// add other info here
};
-class FlatField : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel
+class FlatField : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel, public rtengine::FlatFieldAutoClipListener
{
protected:
@@ -58,9 +58,11 @@ protected:
bool b_filter_asCurrent;
bool israw;
+ IdleRegister idle_register;
public:
FlatField ();
+ ~FlatField ();
void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr);
void write (rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr);
@@ -80,6 +82,7 @@ public:
{
ffp = p;
};
+ void flatFieldAutoClipValueChanged(int n = 0);
};
#endif
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/guiutils.cc b/rtgui/guiutils.cc
index c1c0d9764..f9792a28a 100644
--- a/rtgui/guiutils.cc
+++ b/rtgui/guiutils.cc
@@ -947,6 +947,9 @@ bool MyScrolledWindow::on_scroll_event (GdkEventScroll* event)
double step = adjust->get_step_increment();
double value2 = 0.;
+// printf("MyScrolledwindow::on_scroll_event / delta_x=%.5f, delta_y=%.5f, direction=%d, type=%d, send_event=%d\n",
+// event->delta_x, event->delta_y, (int)event->direction, (int)event->type, event->send_event);
+
if (event->direction == GDK_SCROLL_DOWN) {
value2 = value + step;
@@ -964,6 +967,13 @@ bool MyScrolledWindow::on_scroll_event (GdkEventScroll* event)
value2 = lower;
}
+ if (value2 != value) {
+ scroll->set_value(value2);
+ }
+ } else if (event->direction == GDK_SCROLL_SMOOTH) {
+ if (abs(event->delta_y) > 0.1) {
+ value2 = rtengine::LIM(value + (event->delta_y > 0 ? step : -step), lower, upper);
+ }
if (value2 != value) {
scroll->set_value(value2);
}
@@ -1012,6 +1022,9 @@ bool MyScrolledToolbar::on_scroll_event (GdkEventScroll* event)
double step = adjust->get_step_increment() * 2;
double value2 = 0.;
+// printf("MyScrolledToolbar::on_scroll_event / delta_x=%.5f, delta_y=%.5f, direction=%d, type=%d, send_event=%d\n",
+// event->delta_x, event->delta_y, (int)event->direction, (int)event->type, event->send_event);
+
if (event->direction == GDK_SCROLL_DOWN) {
value2 = rtengine::min(value + step, upper);
if (value2 != value) {
@@ -1059,11 +1072,14 @@ MyComboBoxText::MyComboBoxText (bool has_entry) : Gtk::ComboBoxText(has_entry)
minimumWidth = naturalWidth = 70;
Gtk::CellRendererText* cellRenderer = dynamic_cast(get_first_cell());
cellRenderer->property_ellipsize() = Pango::ELLIPSIZE_MIDDLE;
+ add_events(Gdk::SCROLL_MASK|Gdk::SMOOTH_SCROLL_MASK);
}
bool MyComboBoxText::on_scroll_event (GdkEventScroll* event)
{
+// printf("MyComboboxText::on_scroll_event / delta_x=%.5f, delta_y=%.5f, direction=%d, type=%d, send_event=%d\n",
+// event->delta_x, event->delta_y, (int)event->direction, (int)event->type, event->send_event);
// If Shift is pressed, the widget is modified
if (event->state & GDK_SHIFT_MASK) {
Gtk::ComboBoxText::on_scroll_event(event);
@@ -1221,6 +1237,8 @@ bool MySpinButton::on_scroll_event (GdkEventScroll* event)
bool MyHScale::on_scroll_event (GdkEventScroll* event)
{
+// printf("MyHScale::on_scroll_event / delta_x=%.5f, delta_y=%.5f, direction=%d, type=%d, send_event=%d\n",
+// event->delta_x, event->delta_y, (int)event->direction, (int)event->type, event->send_event);
// If Shift is pressed, the widget is modified
if (event->state & GDK_SHIFT_MASK) {
Gtk::HScale::on_scroll_event(event);
@@ -1345,7 +1363,7 @@ void MyFileChooserButton::set_filter(const Glib::RefPtr &filter
{
cur_filter_ = filter;
}
-
+
std::vector> MyFileChooserButton::list_filters()
{
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/imagearea.cc b/rtgui/imagearea.cc
index b2b938139..0bdb7f11c 100644
--- a/rtgui/imagearea.cc
+++ b/rtgui/imagearea.cc
@@ -77,7 +77,7 @@ void ImageArea::on_realize()
// This workaround should be removed when bug is fixed in GTK2 or when migrating to GTK3
add_events(Gdk::EXPOSURE_MASK | Gdk::POINTER_MOTION_MASK | Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::SCROLL_MASK);
#else
- add_events(Gdk::EXPOSURE_MASK | Gdk::POINTER_MOTION_MASK | Gdk::POINTER_MOTION_HINT_MASK | Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::SCROLL_MASK);
+ add_events(Gdk::EXPOSURE_MASK | Gdk::POINTER_MOTION_MASK | Gdk::POINTER_MOTION_HINT_MASK | Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::SCROLL_MASK | Gdk::SMOOTH_SCROLL_MASK);
#endif
Cairo::FontOptions cfo;
@@ -302,9 +302,12 @@ bool ImageArea::on_button_press_event (GdkEventButton* event)
bool ImageArea::on_scroll_event (GdkEventScroll* event)
{
+// printf("ImageArea::on_scroll_event / delta_x=%.5f, delta_y=%.5f, direction=%d, type=%d, send_event=%d\n",
+// event->delta_x, event->delta_y, (int)event->direction, (int)event->type, event->send_event);
+
CropWindow* cw = getCropWindow (event->x, event->y);
if (cw) {
- cw->scroll (event->state, event->direction, event->x, event->y);
+ cw->scroll (event->state, event->direction, event->x, event->y, event->delta_x, event->delta_y);
}
return true;
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 078fe0035..4ab34f265 100644
--- a/rtgui/lwbutton.h
+++ b/rtgui/lwbutton.h
@@ -23,13 +23,13 @@
#include "rtsurface.h"
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/main-cli.cc b/rtgui/main-cli.cc
index 345dd2971..48ad1d64f 100644
--- a/rtgui/main-cli.cc
+++ b/rtgui/main-cli.cc
@@ -280,7 +280,7 @@ int processLineParams ( int argc, char **argv )
currParam = currParam.substr (1, currParam.length() - 2);
#endif
- if ( currParam.at (0) == '-' ) {
+ if ( currParam.at (0) == '-' && currParam.size() > 1) {
switch ( currParam.at (1) ) {
case '-':
// GTK --argument, we're skipping it
diff --git a/rtgui/main.cc b/rtgui/main.cc
index 15f5c8a4a..aa169e147 100644
--- a/rtgui/main.cc
+++ b/rtgui/main.cc
@@ -131,7 +131,7 @@ int processLineParams ( int argc, char **argv )
currParam = currParam.substr (1, currParam.length() - 2);
#endif
- if ( currParam.at (0) == '-' ) {
+ if ( currParam.at (0) == '-' && currParam.size() > 1 ) {
switch ( currParam.at (1) ) {
case '-':
// GTK --argument, we're skipping it
diff --git a/rtgui/options.cc b/rtgui/options.cc
index 85517b2b1..c690a42e3 100644
--- a/rtgui/options.cc
+++ b/rtgui/options.cc
@@ -1330,17 +1330,10 @@ void Options::readFromFile(Glib::ustring fname)
FileBrowserToolbarSingleRow = keyFile.get_boolean("GUI", "FileBrowserToolbarSingleRow");
}
-#if defined(__linux__) && ((GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION > 18) || GTK_MAJOR_VERSION > 3)
- // Cannot scroll toolbox with mousewheel when HideTPVScrollbar=true #3413
- hideTPVScrollbar = false;
-#else
-
if (keyFile.has_key("GUI", "HideTPVScrollbar")) {
hideTPVScrollbar = keyFile.get_boolean("GUI", "HideTPVScrollbar");
}
-#endif
-
if (keyFile.has_key("GUI", "HistogramWorking")) {
rtSettings.HistogramWorking = keyFile.get_boolean("GUI", "HistogramWorking");
}
diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc
index 2ccb62f65..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;
@@ -405,6 +406,7 @@ void ParamsEdited::set(bool v)
raw.bayersensor.dcbEnhance = v;
//raw.bayersensor.allEnhance = v;
raw.bayersensor.lmmseIterations = v;
+ raw.bayersensor.dualDemosaicAutoContrast = v;
raw.bayersensor.dualDemosaicContrast = v;
raw.bayersensor.pixelShiftMotionCorrectionMethod = v;
raw.bayersensor.pixelShiftEperIso = v;
@@ -425,6 +427,7 @@ void ParamsEdited::set(bool v)
raw.bayersensor.linenoiseDirection = v;
raw.bayersensor.pdafLinesFilter = v;
raw.xtranssensor.method = v;
+ raw.xtranssensor.dualDemosaicAutoContrast = v;
raw.xtranssensor.dualDemosaicContrast = v;
raw.xtranssensor.ccSteps = v;
raw.xtranssensor.exBlackRed = v;
@@ -851,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;
@@ -962,6 +966,7 @@ void ParamsEdited::initFrom(const std::vector&
raw.bayersensor.dcbEnhance = raw.bayersensor.dcbEnhance && p.raw.bayersensor.dcb_enhance == other.raw.bayersensor.dcb_enhance;
//raw.bayersensor.allEnhance = raw.bayersensor.allEnhance && p.raw.bayersensor.all_enhance == other.raw.bayersensor.all_enhance;
raw.bayersensor.lmmseIterations = raw.bayersensor.lmmseIterations && p.raw.bayersensor.lmmse_iterations == other.raw.bayersensor.lmmse_iterations;
+ raw.bayersensor.dualDemosaicAutoContrast = raw.bayersensor.dualDemosaicAutoContrast && p.raw.bayersensor.dualDemosaicAutoContrast == other.raw.bayersensor.dualDemosaicAutoContrast;
raw.bayersensor.dualDemosaicContrast = raw.bayersensor.dualDemosaicContrast && p.raw.bayersensor.dualDemosaicContrast == other.raw.bayersensor.dualDemosaicContrast;
raw.bayersensor.pixelShiftMotionCorrectionMethod = raw.bayersensor.pixelShiftMotionCorrectionMethod && p.raw.bayersensor.pixelShiftMotionCorrectionMethod == other.raw.bayersensor.pixelShiftMotionCorrectionMethod;
raw.bayersensor.pixelShiftEperIso = raw.bayersensor.pixelShiftEperIso && p.raw.bayersensor.pixelShiftEperIso == other.raw.bayersensor.pixelShiftEperIso;
@@ -982,6 +987,7 @@ void ParamsEdited::initFrom(const std::vector&
raw.bayersensor.linenoiseDirection = raw.bayersensor.linenoiseDirection && p.raw.bayersensor.linenoiseDirection == other.raw.bayersensor.linenoiseDirection;
raw.bayersensor.pdafLinesFilter = raw.bayersensor.pdafLinesFilter && p.raw.bayersensor.pdafLinesFilter == other.raw.bayersensor.pdafLinesFilter;
raw.xtranssensor.method = raw.xtranssensor.method && p.raw.xtranssensor.method == other.raw.xtranssensor.method;
+ raw.xtranssensor.dualDemosaicAutoContrast = raw.xtranssensor.dualDemosaicAutoContrast && p.raw.xtranssensor.dualDemosaicAutoContrast == other.raw.xtranssensor.dualDemosaicAutoContrast;
raw.xtranssensor.dualDemosaicContrast = raw.xtranssensor.dualDemosaicContrast && p.raw.xtranssensor.dualDemosaicContrast == other.raw.xtranssensor.dualDemosaicContrast;
raw.xtranssensor.ccSteps = raw.xtranssensor.ccSteps && p.raw.xtranssensor.ccSteps == other.raw.xtranssensor.ccSteps;
raw.xtranssensor.exBlackRed = raw.xtranssensor.exBlackRed && p.raw.xtranssensor.blackred == other.raw.xtranssensor.blackred;
@@ -2116,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;
}
@@ -2526,6 +2536,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.raw.bayersensor.lmmse_iterations = mods.raw.bayersensor.lmmse_iterations;
}
+ if (raw.bayersensor.dualDemosaicAutoContrast) {
+ toEdit.raw.bayersensor.dualDemosaicAutoContrast = mods.raw.bayersensor.dualDemosaicAutoContrast;
+ }
+
if (raw.bayersensor.dualDemosaicContrast) {
toEdit.raw.bayersensor.dualDemosaicContrast = mods.raw.bayersensor.dualDemosaicContrast;
}
@@ -2606,6 +2620,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.raw.xtranssensor.method = mods.raw.xtranssensor.method;
}
+ if (raw.xtranssensor.dualDemosaicAutoContrast) {
+ toEdit.raw.xtranssensor.dualDemosaicAutoContrast = mods.raw.xtranssensor.dualDemosaicAutoContrast;
+ }
+
if (raw.xtranssensor.dualDemosaicContrast) {
toEdit.raw.xtranssensor.dualDemosaicContrast = mods.raw.xtranssensor.dualDemosaicContrast;
}
@@ -3126,7 +3144,7 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
bool RAWParamsEdited::BayerSensor::isUnchanged() const
{
- return method && border && imageNum && dcbIterations && dcbEnhance && lmmseIterations && dualDemosaicContrast /*&& allEnhance*/ && greenEq
+ return method && border && imageNum && dcbIterations && dcbEnhance && lmmseIterations && dualDemosaicAutoContrast && dualDemosaicContrast /*&& allEnhance*/ && greenEq
&& pixelShiftMotionCorrectionMethod && pixelShiftEperIso && pixelShiftSigma && pixelShiftShowMotion && pixelShiftShowMotionMaskOnly
&& pixelShiftHoleFill && pixelShiftMedian && pixelShiftNonGreenCross && pixelShiftDemosaicMethod && pixelShiftGreen && pixelShiftBlur && pixelShiftSmooth && pixelShiftEqualBright && pixelShiftEqualBrightChannel
&& linenoise && linenoiseDirection && pdafLinesFilter && exBlack0 && exBlack1 && exBlack2 && exBlack3 && exTwoGreen;
@@ -3134,7 +3152,7 @@ bool RAWParamsEdited::BayerSensor::isUnchanged() const
bool RAWParamsEdited::XTransSensor::isUnchanged() const
{
- return method && exBlackRed && exBlackGreen && exBlackBlue;
+ return method && exBlackRed && exBlackGreen && exBlackBlue && dualDemosaicAutoContrast && dualDemosaicContrast;
}
bool RAWParamsEdited::isUnchanged() const
diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h
index 0a795696c..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
@@ -744,6 +744,7 @@ public:
bool dcbIterations;
bool dcbEnhance;
bool lmmseIterations;
+ bool dualDemosaicAutoContrast;
bool dualDemosaicContrast;
bool pixelShiftMotionCorrectionMethod;
bool pixelShiftEperIso;
@@ -774,6 +775,7 @@ public:
public:
bool method;
+ bool dualDemosaicAutoContrast;
bool dualDemosaicContrast;
bool ccSteps;
bool exBlackRed;
diff --git a/rtgui/partialpastedlg.cc b/rtgui/partialpastedlg.cc
index 6b192dba9..91e542e85 100644
--- a/rtgui/partialpastedlg.cc
+++ b/rtgui/partialpastedlg.cc
@@ -828,8 +828,10 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param
if (!raw_method->get_active ()) {
filterPE.raw.bayersensor.method = falsePE.raw.bayersensor.method;
+ filterPE.raw.bayersensor.dualDemosaicAutoContrast = falsePE.raw.bayersensor.dualDemosaicAutoContrast;
filterPE.raw.bayersensor.dualDemosaicContrast = falsePE.raw.bayersensor.dualDemosaicContrast;
filterPE.raw.xtranssensor.method = falsePE.raw.xtranssensor.method;
+ filterPE.raw.xtranssensor.dualDemosaicAutoContrast = falsePE.raw.xtranssensor.dualDemosaicAutoContrast;
filterPE.raw.xtranssensor.dualDemosaicContrast = falsePE.raw.xtranssensor.dualDemosaicContrast;
}
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 050c4c653..91a9633c0 100644
--- a/rtgui/ppversion.h
+++ b/rtgui/ppversion.h
@@ -1,11 +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 343
+#define PPVERSION 345
#define PPVERSION_AEXP 301 //value of PPVERSION when auto exposure algorithm was modified
/*
Log of version changes
+ 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 a7b45c902..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"));
@@ -929,11 +927,6 @@ Gtk::Widget* Preferences::getGeneralPanel ()
setExpandAlignProperties (hb4label, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE);
ckbHideTPVScrollbar = Gtk::manage ( new Gtk::CheckButton (M ("PREFERENCES_TP_VSCROLLBAR")) );
setExpandAlignProperties (ckbHideTPVScrollbar, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE);
-#if defined(__linux__) && ((GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION > 18) || GTK_MAJOR_VERSION > 3)
- // Cannot scroll toolbox with mousewheel when HideTPVScrollbar=true #3413
- ckbHideTPVScrollbar->set_active(false);
- ckbHideTPVScrollbar->set_sensitive(false);
-#endif
workflowGrid->attach_next_to (*hb4label, *ckbFileBrowserToolbarSingleRow, Gtk::POS_BOTTOM, 1, 1);
workflowGrid->attach_next_to (*ckbHideTPVScrollbar, *hb4label, Gtk::POS_RIGHT, 1, 1);
ckbAutoSaveTpOpen = Gtk::manage (new Gtk::CheckButton (M ("PREFERENCES_AUTOSAVE_TP_OPEN")));
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 5c7cce997..cd4977bb1 100644
--- a/rtgui/previewwindow.cc
+++ b/rtgui/previewwindow.cc
@@ -34,7 +34,7 @@ void PreviewWindow::on_realize ()
{
Gtk::DrawingArea::on_realize ();
- add_events(Gdk::POINTER_MOTION_MASK | Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::SCROLL_MASK);
+ add_events(Gdk::POINTER_MOTION_MASK | Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK);
}
void PreviewWindow::getObservedFrameArea (int& x, int& y, int& w, int& h)
@@ -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 c6064434f..9499c2902 100644
--- a/rtgui/rtwindow.cc
+++ b/rtgui/rtwindow.cc
@@ -645,9 +645,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 ();
}
@@ -809,19 +808,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();
@@ -830,6 +829,11 @@ void RTWindow::setProgressState (bool inProcessing)
}
}
+void RTWindow::error(const Glib::ustring& descr)
+{
+ prProgBar.set_text(descr);
+}
+
void RTWindow::toggle_fullscreen ()
{
if (is_fullscreen) {
@@ -853,11 +857,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/saveasdlg.cc b/rtgui/saveasdlg.cc
index 7067e8ed1..f2a7206b9 100644
--- a/rtgui/saveasdlg.cc
+++ b/rtgui/saveasdlg.cc
@@ -16,15 +16,36 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see .
*/
+#include
+
#include "saveasdlg.h"
-#include "multilangmgr.h"
+
#include "guiutils.h"
+#include "multilangmgr.h"
#include "rtimage.h"
#include "../rtengine/utils.h"
extern Options options;
+namespace
+{
+
+Glib::ustring getCurrentFilename(const Gtk::FileChooserWidget* fchooser)
+{
+ Glib::ustring res = fchooser->get_filename();
+
+ // NB: There seem to be a bug in Gtkmm2.22 / FileChooserWidget : if you suppress the filename entry and
+ // click on a folder in the list, the filename field is empty but get_filename will return the folder's path :/
+ if (Glib::file_test(res, Glib::FILE_TEST_IS_DIR)) {
+ res = fchooser->get_current_name();
+ }
+
+ return res;
+}
+
+}
+
SaveAsDialog::SaveAsDialog (const Glib::ustring &initialDir, Gtk::Window* parent)
: Gtk::Dialog (M("GENERAL_SAVE"), *parent)
{
@@ -219,13 +240,7 @@ SaveFormat SaveAsDialog::getFormat ()
void SaveAsDialog::okPressed ()
{
- fname = fchooser->get_filename();
-
- // NB: There seem to be a bug in Gtkmm2.22 / FileChooserWidget : if you suppress the filename entry and
- // click on a folder in the list, the filename field is empty but get_filename will return the folder's path :/
- if (Glib::file_test(fname, Glib::FILE_TEST_IS_DIR)) {
- fname = fchooser->get_current_name();
- }
+ fname = getCurrentFilename(fchooser);
// Checking if the filename field is empty. The user have to click Cancel if he don't want to specify a filename
if (fname.empty()) {
@@ -246,9 +261,18 @@ void SaveAsDialog::okPressed ()
// Extension is either empty or unfamiliar
fname += '.' + formatOpts->getFormat().format;
} else if (
- !rtengine::hasJpegExtension(fname)
- && !rtengine::hasTiffExtension(fname)
- && !rtengine::hasPngExtension(fname)
+ (
+ formatOpts->getFormat().format == "jpg"
+ && !rtengine::hasJpegExtension(fname)
+ )
+ || (
+ formatOpts->getFormat().format == "tif"
+ && !rtengine::hasTiffExtension(fname)
+ )
+ || (
+ formatOpts->getFormat().format == "png"
+ && !rtengine::hasPngExtension(fname)
+ )
) {
// Create dialog to warn user that the filename may have two extensions on the end
Gtk::MessageDialog msgd(
@@ -283,15 +307,42 @@ void SaveAsDialog::cancelPressed ()
response (Gtk::RESPONSE_CANCEL);
}
-void SaveAsDialog::formatChanged (Glib::ustring f)
+void SaveAsDialog::formatChanged(const Glib::ustring& format)
{
+ const auto sanitize_suffix =
+ [this, format](const std::function& has_suffix)
+ {
+ const Glib::ustring name = getCurrentFilename(fchooser);
- if (f == "jpg") {
+ if (!has_suffix(name)) {
+ fchooser->set_current_name(removeExtension(Glib::path_get_basename(name)) + '.' + format);
+ }
+ };
+
+ if (format == "jpg") {
fchooser->set_filter (filter_jpg);
- } else if (f == "png") {
+ sanitize_suffix(
+ [](const Glib::ustring& filename)
+ {
+ return rtengine::hasJpegExtension(filename);
+ }
+ );
+ } else if (format == "png") {
fchooser->set_filter (filter_png);
- } else if (f == "tif") {
+ sanitize_suffix(
+ [](const Glib::ustring& filename)
+ {
+ return rtengine::hasPngExtension(filename);
+ }
+ );
+ } else if (format == "tif") {
fchooser->set_filter (filter_tif);
+ sanitize_suffix(
+ [](const Glib::ustring& filename)
+ {
+ return rtengine::hasTiffExtension(filename);
+ }
+ );
}
}
diff --git a/rtgui/saveasdlg.h b/rtgui/saveasdlg.h
index 073be23f4..e02be340f 100644
--- a/rtgui/saveasdlg.h
+++ b/rtgui/saveasdlg.h
@@ -62,7 +62,7 @@ public:
void okPressed ();
void cancelPressed ();
- void formatChanged (Glib::ustring f);
+ void formatChanged(const Glib::ustring& format) override;
bool keyPressed (GdkEventKey* event);
};
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 47011be18..e6560d73d 100644
--- a/rtgui/saveformatpanel.h
+++ b/rtgui/saveformatpanel.h
@@ -26,10 +26,9 @@
class FormatChangeListener
{
-
public:
- virtual ~FormatChangeListener () {}
- virtual void formatChanged (Glib::ustring f) {}
+ virtual ~FormatChangeListener() = default;
+ virtual void formatChanged(const Glib::ustring& format) = 0;
};
class SaveFormatPanel : public Gtk::Grid, public AdjusterListener
@@ -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/thumbbrowserbase.cc b/rtgui/thumbbrowserbase.cc
index 43454d8f5..150b8492f 100644
--- a/rtgui/thumbbrowserbase.cc
+++ b/rtgui/thumbbrowserbase.cc
@@ -68,26 +68,59 @@ void ThumbBrowserBase::scrollChanged ()
}
}
-void ThumbBrowserBase::scroll (int direction)
+void ThumbBrowserBase::scroll (int direction, double deltaX, double deltaY)
{
+ double delta = 0.0;
+ if (abs(deltaX) > abs(deltaY)) {
+ delta = deltaX;
+ } else {
+ delta = deltaY;
+ }
+ double coef = direction == GDK_SCROLL_DOWN || (direction == GDK_SCROLL_SMOOTH && delta > 0.0) ? +1.0 : -1.0;
+
// GUI already acquired when here
- if (direction == GDK_SCROLL_UP || direction == GDK_SCROLL_DOWN) {
+ if (direction == GDK_SCROLL_UP || direction == GDK_SCROLL_DOWN || direction == GDK_SCROLL_SMOOTH) {
if (arrangement == TB_Vertical) {
- vscroll.set_value (vscroll.get_value() + (direction == GDK_SCROLL_DOWN ? +1 : -1) * vscroll.get_adjustment()->get_step_increment());
+ double currValue = vscroll.get_value();
+ double newValue = rtengine::LIM(currValue + coef * vscroll.get_adjustment()->get_step_increment(),
+ vscroll.get_adjustment()->get_lower (),
+ vscroll.get_adjustment()->get_upper());
+ if (newValue != currValue) {
+ vscroll.set_value (newValue);
+ }
} else {
- hscroll.set_value (hscroll.get_value() + (direction == GDK_SCROLL_DOWN ? +1 : -1) * hscroll.get_adjustment()->get_step_increment());
+ double currValue = hscroll.get_value();
+ double newValue = rtengine::LIM(currValue + coef * hscroll.get_adjustment()->get_step_increment(),
+ hscroll.get_adjustment()->get_lower(),
+ hscroll.get_adjustment()->get_upper());
+ if (newValue != currValue) {
+ hscroll.set_value (newValue);
+ }
}
}
}
void ThumbBrowserBase::scrollPage (int direction)
{
+ // GUI already acquired when here
// GUI already acquired when here
if (direction == GDK_SCROLL_UP || direction == GDK_SCROLL_DOWN) {
if (arrangement == TB_Vertical) {
- vscroll.set_value (vscroll.get_value() + (direction == GDK_SCROLL_DOWN ? +1 : -1) * vscroll.get_adjustment()->get_page_increment());
+ double currValue = vscroll.get_value();
+ double newValue = rtengine::LIM(currValue + (direction == GDK_SCROLL_DOWN ? +1 : -1) * vscroll.get_adjustment()->get_page_increment(),
+ vscroll.get_adjustment()->get_lower(),
+ vscroll.get_adjustment()->get_upper());
+ if (newValue != currValue) {
+ vscroll.set_value (newValue);
+ }
} else {
- hscroll.set_value (hscroll.get_value() + (direction == GDK_SCROLL_DOWN ? +1 : -1) * hscroll.get_adjustment()->get_page_increment());
+ double currValue = hscroll.get_value();
+ double newValue = rtengine::LIM(currValue + (direction == GDK_SCROLL_DOWN ? +1 : -1) * hscroll.get_adjustment()->get_page_increment(),
+ hscroll.get_adjustment()->get_lower(),
+ hscroll.get_adjustment()->get_upper());
+ if (newValue != currValue) {
+ hscroll.set_value (newValue);
+ }
}
}
}
@@ -690,7 +723,7 @@ void ThumbBrowserBase::Internal::on_realize()
bgs = style->get_background_color(Gtk::STATE_FLAG_SELECTED);
set_can_focus(true);
- add_events(Gdk::EXPOSURE_MASK | Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::POINTER_MOTION_MASK | Gdk::SCROLL_MASK | Gdk::KEY_PRESS_MASK);
+ add_events(Gdk::EXPOSURE_MASK | Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::POINTER_MOTION_MASK | Gdk::SCROLL_MASK | Gdk::SMOOTH_SCROLL_MASK | Gdk::KEY_PRESS_MASK);
set_has_tooltip (true);
signal_query_tooltip().connect( sigc::mem_fun(*this, &ThumbBrowserBase::Internal::on_query_tooltip) );
}
@@ -927,8 +960,7 @@ bool ThumbBrowserBase::Internal::on_motion_notify_event (GdkEventMotion* event)
bool ThumbBrowserBase::Internal::on_scroll_event (GdkEventScroll* event)
{
// Gtk signals automatically acquire the GUI (i.e. this method is enclosed by gdk_thread_enter and gdk_thread_leave)
-
- parent->scroll (event->direction);
+ parent->scroll (event->direction, event->delta_x, event->delta_y);
return true;
}
diff --git a/rtgui/thumbbrowserbase.h b/rtgui/thumbbrowserbase.h
index dd63f5bf4..e00d014e7 100644
--- a/rtgui/thumbbrowserbase.h
+++ b/rtgui/thumbbrowserbase.h
@@ -139,7 +139,7 @@ public:
enum Arrangement {TB_Horizontal, TB_Vertical};
void configScrollBars ();
void scrollChanged ();
- void scroll (int direction);
+ void scroll (int direction, double deltaX=0.0, double deltaY=0.0);
void scrollPage (int direction);
private:
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 deecb7682..43aaeecd2 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 ()
@@ -517,6 +521,9 @@ void ToolPanelCoordinator::initImage (rtengine::StagedImageProcessor* ipc_, bool
ipc->setAutoCamListener (colorappearance);
ipc->setAutoBWListener (blackwhite);
ipc->setFrameCountListener (bayerprocess);
+ ipc->setFlatFieldAutoClipListener (flatfield);
+ ipc->setBayerAutoContrastListener (bayerprocess);
+ ipc->setXtransAutoContrastListener (xtransprocess);
ipc->setAutoWBListener (whitebalance);
ipc->setAutoColorTonListener (colortoning);
ipc->setAutoChromaListener (dirpyrdenoise);
@@ -615,33 +622,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;
}
@@ -661,7 +643,6 @@ void ToolPanelCoordinator::spotWBselected (int x, int y, Thumbnail* thm)
void ToolPanelCoordinator::sharpMaskSelected(bool sharpMask)
{
-
if (!ipc) {
return;
}
@@ -670,7 +651,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 ()
{
@@ -781,28 +797,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 1c46ee54e..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,12 +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);
@@ -277,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 cf46f370b..2a24aff45 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 b774075c0..41573de50 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 27b5810c4..47556e54f 100644
--- a/rtgui/xtransprocess.cc
+++ b/rtgui/xtransprocess.cc
@@ -28,6 +28,7 @@ XTransProcess::XTransProcess () : FoldableToolPanel(this, "xtransprocess", M("TP
{
auto m = ProcEventMapper::getInstance();
EvDemosaicContrast = m->newEvent(DEMOSAIC, "HISTORY_MSG_DUALDEMOSAIC_CONTRAST");
+ EvDemosaicAutoContrast = m->newEvent(DEMOSAIC, "HISTORY_MSG_DUALDEMOSAIC_AUTO_CONTRAST");
Gtk::HBox* hb1 = Gtk::manage (new Gtk::HBox ());
hb1->pack_start (*Gtk::manage (new Gtk::Label ( M("TP_RAW_DMETHOD") + ": ")), Gtk::PACK_SHRINK, 4);
@@ -71,6 +72,8 @@ XTransProcess::XTransProcess () : FoldableToolPanel(this, "xtransprocess", M("TP
dualDemosaicContrast = Gtk::manage(new Adjuster (M("TP_RAW_DUALDEMOSAICCONTRAST"), 0, 100, 1, 20));
dualDemosaicContrast->setAdjusterListener (this);
+ dualDemosaicContrast->addAutoButton(M("TP_RAW_DUALDEMOSAICAUTOCONTRAST_TOOLTIP"));
+ dualDemosaicContrast->setAutoValue(true);
if (dualDemosaicContrast->delay < options.adjusterMaxDelay) {
dualDemosaicContrast->delay = options.adjusterMaxDelay;
@@ -94,6 +97,9 @@ XTransProcess::XTransProcess () : FoldableToolPanel(this, "xtransprocess", M("TP
methodconn = method->signal_changed().connect( sigc::mem_fun(*this, &XTransProcess::methodChanged) );
}
+XTransProcess::~XTransProcess () {
+ idle_register.destroy();
+}
void XTransProcess::read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited)
{
@@ -108,6 +114,7 @@ void XTransProcess::read(const rtengine::procparams::ProcParams* pp, const Param
}
if(pedited ) {
+ dualDemosaicContrast->setAutoInconsistent (multiImage && !pedited->raw.xtranssensor.dualDemosaicAutoContrast);
dualDemosaicContrast->setEditedState ( pedited->raw.xtranssensor.dualDemosaicContrast ? Edited : UnEdited);
ccSteps->setEditedState (pedited->raw.xtranssensor.ccSteps ? Edited : UnEdited);
@@ -115,8 +122,12 @@ void XTransProcess::read(const rtengine::procparams::ProcParams* pp, const Param
method->set_active_text(M("GENERAL_UNCHANGED"));
}
}
+ dualDemosaicContrast->setAutoValue(pp->raw.xtranssensor.dualDemosaicAutoContrast);
dualDemosaicContrast->setValue (pp->raw.xtranssensor.dualDemosaicContrast);
ccSteps->setValue (pp->raw.xtranssensor.ccSteps);
+
+ lastAutoContrast = pp->raw.bayersensor.dualDemosaicAutoContrast;
+
if (!batchMode) {
dualDemosaicOptions->set_visible(pp->raw.xtranssensor.method == procparams::RAWParams::XTransSensor::getMethodString(procparams::RAWParams::XTransSensor::Method::FOUR_PASS)
|| pp->raw.xtranssensor.method == procparams::RAWParams::XTransSensor::getMethodString(procparams::RAWParams::XTransSensor::Method::TWO_PASS));
@@ -129,6 +140,7 @@ void XTransProcess::read(const rtengine::procparams::ProcParams* pp, const Param
void XTransProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedited)
{
+ pp->raw.xtranssensor.dualDemosaicAutoContrast = dualDemosaicContrast->getAutoValue();
pp->raw.xtranssensor.dualDemosaicContrast = dualDemosaicContrast->getValue();
pp->raw.xtranssensor.ccSteps = ccSteps->getIntValue();
@@ -140,6 +152,7 @@ void XTransProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* p
if (pedited) {
pedited->raw.xtranssensor.method = method->get_active_text() != M("GENERAL_UNCHANGED");
+ pedited->raw.xtranssensor.dualDemosaicAutoContrast = !dualDemosaicContrast->getAutoInconsistent ();
pedited->raw.xtranssensor.dualDemosaicContrast = dualDemosaicContrast->getEditedState ();
pedited->raw.xtranssensor.ccSteps = ccSteps->getEditedState ();
}
@@ -174,7 +187,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) {
@@ -185,6 +198,33 @@ void XTransProcess::adjusterChanged (Adjuster* a, double newval)
}
}
+void XTransProcess::adjusterAutoToggled(Adjuster* a, bool newval)
+{
+ if (multiImage) {
+ if (dualDemosaicContrast->getAutoInconsistent()) {
+ dualDemosaicContrast->setAutoInconsistent (false);
+ dualDemosaicContrast->setAutoValue (false);
+ } else if (lastAutoContrast) {
+ dualDemosaicContrast->setAutoInconsistent (true);
+ }
+
+ lastAutoContrast = dualDemosaicContrast->getAutoValue();
+ }
+
+ if (listener) {
+
+ if (a == dualDemosaicContrast) {
+ if (dualDemosaicContrast->getAutoInconsistent()) {
+ listener->panelChanged (EvDemosaicAutoContrast, M ("GENERAL_UNCHANGED"));
+ } else if (dualDemosaicContrast->getAutoValue()) {
+ listener->panelChanged (EvDemosaicAutoContrast, M ("GENERAL_ENABLED"));
+ } else {
+ listener->panelChanged (EvDemosaicAutoContrast, M ("GENERAL_DISABLED"));
+ }
+ }
+ }
+}
+
void XTransProcess::methodChanged ()
{
const int curSelection = method->get_active_row_number();
@@ -207,3 +247,26 @@ void XTransProcess::methodChanged ()
: EvDemosaicMethod, method->get_active_text());
}
}
+
+void XTransProcess::checkBoxToggled (CheckBox* c, CheckValue newval)
+{
+}
+
+void XTransProcess::autoContrastChanged (double autoContrast)
+{
+ struct Data {
+ XTransProcess *me;
+ double autoContrast;
+ };
+ const auto func = [](gpointer data) -> gboolean {
+ Data *d = static_cast(data);
+ XTransProcess *me = d->me;
+ me->disableListener();
+ me->dualDemosaicContrast->setValue(d->autoContrast);
+ me->enableListener();
+ delete d;
+ return FALSE;
+ };
+
+ idle_register.add(func, new Data { this, autoContrast });
+}
diff --git a/rtgui/xtransprocess.h b/rtgui/xtransprocess.h
index edc0965b8..7a706b1ac 100644
--- a/rtgui/xtransprocess.h
+++ b/rtgui/xtransprocess.h
@@ -21,11 +21,12 @@
#include
#include "adjuster.h"
+#include "checkbox.h"
#include "guiutils.h"
#include "toolpanel.h"
-class XTransProcess : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel
+class XTransProcess : public ToolParamBlock, public AdjusterListener, public CheckBoxListener, public FoldableToolPanel, public rtengine::AutoContrastListener
{
protected:
@@ -34,14 +35,18 @@ protected:
Adjuster* ccSteps;
Gtk::VBox *dualDemosaicOptions;
Adjuster* dualDemosaicContrast;
+ bool lastAutoContrast;
int oldSelection;
sigc::connection methodconn;
+ IdleRegister idle_register;
+ rtengine::ProcEvent EvDemosaicAutoContrast;
rtengine::ProcEvent EvDemosaicContrast;
public:
XTransProcess ();
+ ~XTransProcess ();
void read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr);
void write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr);
@@ -50,7 +55,10 @@ public:
void setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr);
void methodChanged();
+ 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);
};