diff --git a/rtdata/languages/default b/rtdata/languages/default index cdf9ef6a1..26300601e 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -869,6 +869,7 @@ MAIN_MSG_OPERATIONCANCELLED;Operation cancelled MAIN_MSG_PATHDOESNTEXIST;The path\n\n%1\n\ndoes not exist. Please set a correct path in Preferences. MAIN_MSG_QOVERWRITE;Do you want to overwrite it? MAIN_MSG_SETPATHFIRST;You first have to set a target path in Preferences in order to use this function! +MAIN_MSG_TOOMANYOPENEDITORS;Too many open editors.\nPlease close an editor to continue. MAIN_MSG_WRITEFAILED;Failed to write\n"%1"\n\nMake sure that the folder exists and that you have write permission to it. MAIN_TAB_COLOR;Color MAIN_TAB_COLOR_TOOLTIP;Shortcut: Alt-c diff --git a/rtengine/ipretinex.cc b/rtengine/ipretinex.cc index 5ceaa0472..fcc370a54 100644 --- a/rtengine/ipretinex.cc +++ b/rtengine/ipretinex.cc @@ -144,8 +144,6 @@ void RawImageSource::MSR(float** luminance, float** originalLuminance, float **e constexpr float eps = 2.f; bool useHsl = deh.retinexcolorspace == "HSLLOG"; bool useHslLin = deh.retinexcolorspace == "HSLLIN"; - float gain2 = (float) deh.gain / 100.f; //def =1 not use - gain2 = useHslLin ? gain2 * 0.5f : gain2; float offse = (float) deh.offs; //def = 0 not use int iter = deh.iter; int gradient = deh.scal; @@ -160,23 +158,15 @@ void RawImageSource::MSR(float** luminance, float** originalLuminance, float **e limD *= useHslLin ? 10.f : 1.f; float ilimD = 1.f / limD; float hig = ((float) deh.highl) / 100.f; - float elogt; - float hl = deh.baselog; scal = deh.skal; - if (hl >= 2.71828f) { - elogt = 2.71828f + SQR (SQR (hl - 2.71828f)); - } else { - elogt = hl; - } - int H_L = height; int W_L = width; float *tran[H_L] ALIGNED16; float *tranBuffer = nullptr; - elogt = 2.71828f;//disabled baselog + constexpr float elogt = 2.71828f; bool lhutili = false; FlatCurve* shcurve = new FlatCurve (deh.lhcurve); //curve L=f(H) @@ -661,7 +651,6 @@ void RawImageSource::MSR(float** luminance, float** originalLuminance, float **e delta = 1.0f; } - // float cdfactor = gain2 * 32768.f / delta; float cdfactor = 32768.f / delta; maxCD = -9999999.f; minCD = 9999999.f; diff --git a/rtengine/procevents.h b/rtengine/procevents.h index f815d14db..4b2ec94b8 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -451,7 +451,7 @@ enum ProcEvent { EvLgam = 421, EvLslope = 422, EvLhighl = 423, - EvLbaselog = 424, +// EvLbaselog = 424, -- can be reused -- EvRetinexlhcurve = 425, EvOIntent = 426, EvMonitorTransform = 427, diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index f3bc3bf97..85d35d800 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -175,7 +175,6 @@ void RetinexParams::setDefaults() gam = 1.30; slope = 3.; neigh = 80; - gain = 50; offs = 0; vart = 200; limd = 8; @@ -186,7 +185,6 @@ void RetinexParams::setDefaults() stonalwidth = 80; radius = 40; - baselog = 2.71828; skal = 3; retinexMethod = "high"; mapMethod = "none"; @@ -1186,7 +1184,6 @@ void RAWParams::setDefaults() ff_clipControl = 0; cared = 0; cablue = 0; - caautostrength = 2; ca_autocorrect = false; hotPixelFilter = false; deadPixelFilter = false; @@ -1800,10 +1797,6 @@ int ProcParams::save (const Glib::ustring &fname, const Glib::ustring &fname2, b keyFile.set_integer ("Retinex", "Neigh", retinex.neigh); } - if (!pedited || pedited->retinex.gain) { - keyFile.set_integer ("Retinex", "Gain", retinex.gain); - } - if (!pedited || pedited->retinex.offs) { keyFile.set_integer ("Retinex", "Offs", retinex.offs); } @@ -1820,10 +1813,6 @@ int ProcParams::save (const Glib::ustring &fname, const Glib::ustring &fname2, b keyFile.set_integer ("Retinex", "highl", retinex.highl); } - if (!pedited || pedited->retinex.baselog) { - keyFile.set_double ("Retinex", "baselog", retinex.baselog); - } - if (!pedited || pedited->retinex.skal) { keyFile.set_integer ("Retinex", "skal", retinex.skal); } @@ -3867,10 +3856,6 @@ int ProcParams::save (const Glib::ustring &fname, const Glib::ustring &fname2, b keyFile.set_boolean ("RAW", "CA", raw.ca_autocorrect ); } - if (!pedited || pedited->raw.caAutoStrength) { - keyFile.set_double ("RAW", "CAAutoStrength", raw.caautostrength ); - } - if (!pedited || pedited->raw.caRed) { keyFile.set_double ("RAW", "CARed", raw.cared ); } @@ -5339,14 +5324,6 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("Retinex", "Gain")) { - retinex.gain = keyFile.get_integer ("Retinex", "Gain"); - - if (pedited) { - pedited->retinex.gain = true; - } - } - if (keyFile.has_key ("Retinex", "Offs")) { retinex.offs = keyFile.get_integer ("Retinex", "Offs"); @@ -5379,14 +5356,6 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("Retinex", "baselog")) { - retinex.baselog = keyFile.get_double ("Retinex", "baselog"); - - if (pedited) { - pedited->retinex.baselog = true; - } - } - if (keyFile.has_key ("Retinex", "skal")) { retinex.skal = keyFile.get_integer ("Retinex", "skal"); @@ -8521,14 +8490,6 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited) } } - if (keyFile.has_key ("RAW", "CAAutoStrength")) { - raw.caautostrength = keyFile.get_double ("RAW", "CAAutoStrength" ); - - if (pedited) { - pedited->raw.caAutoStrength = true; - } - } - if (keyFile.has_key ("RAW", "CARed")) { raw.cared = keyFile.get_double ("RAW", "CARed" ); @@ -9255,7 +9216,6 @@ bool ProcParams::operator== (const ProcParams& other) && retinex.gam == other.retinex.gam && retinex.slope == other.retinex.slope && retinex.neigh == other.retinex.neigh - && retinex.gain == other.retinex.gain && retinex.limd == other.retinex.limd && retinex.highl == other.retinex.highl && retinex.highlights == other.retinex.highlights @@ -9263,8 +9223,6 @@ bool ProcParams::operator== (const ProcParams& other) && retinex.shadows == other.retinex.shadows && retinex.stonalwidth == other.retinex.stonalwidth && retinex.radius == other.retinex.radius - - && retinex.baselog == other.retinex.baselog && retinex.skal == other.retinex.skal && retinex.offs == other.retinex.offs && retinex.retinexMethod == other.retinex.retinexMethod @@ -9612,7 +9570,6 @@ bool ProcParams::operator== (const ProcParams& other) && raw.expos == other.raw.expos && raw.preser == other.raw.preser && raw.ca_autocorrect == other.raw.ca_autocorrect - && raw.caautostrength == other.raw.caautostrength && raw.cared == other.raw.cared && raw.cablue == other.raw.cablue && raw.hotPixelFilter == other.raw.hotPixelFilter diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 12696f5f0..eb5a18728 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -317,7 +317,6 @@ public: double gam; double slope; int neigh; - int gain; int offs; int highlights; int htonalwidth; @@ -333,7 +332,6 @@ public: int vart; int limd; int highl; - double baselog; int skal; bool medianmap; RetinexParams (); @@ -1387,7 +1385,6 @@ public: int ff_clipControl; bool ca_autocorrect; - double caautostrength; double cared; double cablue; diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 4f2976271..9b1343f65 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -2005,13 +2005,12 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le plistener->setProgressStr ("CA Auto Correction..."); plistener->setProgress (0.0); } - - if (numFrames == 4) { - for (int i = 0; i < 4; ++i) { - CA_correct_RT (raw.ca_autocorrect, raw.cared, raw.cablue, 10.0 - raw.caautostrength, *rawDataFrames[i]); + if(numFrames == 4) { + for(int i=0; i<4; ++i) { + CA_correct_RT(raw.ca_autocorrect, raw.cared, raw.cablue, 8.0, *rawDataFrames[i]); } } else { - CA_correct_RT (raw.ca_autocorrect, raw.cared, raw.cablue, 10.0 - raw.caautostrength, rawData); + CA_correct_RT(raw.ca_autocorrect, raw.cared, raw.cablue, 8.0, rawData); } } diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index b047a9b8e..9f97a2b9f 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -451,7 +451,7 @@ int refreshmap[rtengine::NUMOFEVENTS] = { DEMOSAIC, // EvLgam DEMOSAIC, // EvLslope RETINEX, // EvLhighl - DEMOSAIC, // EvLbaselog + 0, // --unused-- DEMOSAIC, // EvRetinexlhcurve OUTPUTPROFILE, // EvOIntent MONITORTRANSFORM, // EvMonitorTransform: no history message diff --git a/rtgui/CMakeLists.txt b/rtgui/CMakeLists.txt index 219d26464..fe2e0c844 100644 --- a/rtgui/CMakeLists.txt +++ b/rtgui/CMakeLists.txt @@ -225,7 +225,8 @@ add_dependencies(rth UpdateInfo) add_dependencies(rth-cli UpdateInfo) # Set executables targets properties, i.e. output filename and compile flags -if(WIN32) +# for "Debug" builds, open a console in all cases for Windows version +if((WIN32) AND NOT(UPPER_CMAKE_BUILD_TYPE STREQUAL "DEBUG")) set_target_properties(rth PROPERTIES LINK_FLAGS "-mwindows") endif() set_target_properties(rth PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS}" OUTPUT_NAME rawtherapee) diff --git a/rtgui/batchtoolpanelcoord.cc b/rtgui/batchtoolpanelcoord.cc index 17f88458f..d247199cf 100644 --- a/rtgui/batchtoolpanelcoord.cc +++ b/rtgui/batchtoolpanelcoord.cc @@ -171,8 +171,8 @@ void BatchToolPanelCoordinator::initSession () chmixer->setAdjusterBehavior (false); blackwhite->setAdjusterBehavior (false, false); colortoning->setAdjusterBehavior (false, false, false, false, false); - filmSimulation->setAdjusterBehavior (false); - retinex->setAdjusterBehavior (false, false, false, false, false, false, false, false); + filmSimulation->setAdjusterBehavior(false); + retinex->setAdjusterBehavior (false, false, false, false, false, false, false); shadowshighlights->setAdjusterBehavior (false, false, false); dirpyrequalizer->setAdjusterBehavior (false, false, false); @@ -209,8 +209,8 @@ void BatchToolPanelCoordinator::initSession () icm->setAdjusterBehavior (options.baBehav[ADDSET_FREE_OUPUT_GAMMA], options.baBehav[ADDSET_FREE_OUTPUT_SLOPE]); // colortoning->setAdjusterBehavior (options.baBehav[ADDSET_COLORTONING_SPLIT], options.baBehav[ADDSET_COLORTONING_SATTHRESHOLD], options.baBehav[ADDSET_COLORTONING_SATOPACITY], options.baBehav[ADDSET_COLORTONING_STRPROTECT], options.baBehav[ADDSET_COLORTONING_BALANCE]); colortoning->setAdjusterBehavior (options.baBehav[ADDSET_COLORTONING_SPLIT], options.baBehav[ADDSET_COLORTONING_SATTHRESHOLD], options.baBehav[ADDSET_COLORTONING_SATOPACITY], options.baBehav[ADDSET_COLORTONING_STRENGTH], options.baBehav[ADDSET_COLORTONING_BALANCE]); - filmSimulation->setAdjusterBehavior (options.baBehav[ADDSET_FILMSIMULATION_STRENGTH]); - retinex->setAdjusterBehavior (options.baBehav[ADDSET_RETI_STR], options.baBehav[ADDSET_RETI_NEIGH], options.baBehav[ADDSET_RETI_LIMD], options.baBehav[ADDSET_RETI_GAIN], options.baBehav[ADDSET_RETI_OFFS], options.baBehav[ADDSET_RETI_VART], options.baBehav[ADDSET_RETI_GAM], options.baBehav[ADDSET_RETI_SLO]); + filmSimulation->setAdjusterBehavior(options.baBehav[ADDSET_FILMSIMULATION_STRENGTH]); + retinex->setAdjusterBehavior (options.baBehav[ADDSET_RETI_STR], options.baBehav[ADDSET_RETI_NEIGH], options.baBehav[ADDSET_RETI_LIMD], options.baBehav[ADDSET_RETI_OFFS], options.baBehav[ADDSET_RETI_VART], options.baBehav[ADDSET_RETI_GAM], options.baBehav[ADDSET_RETI_SLO]); chmixer->setAdjusterBehavior (options.baBehav[ADDSET_CHMIXER] ); blackwhite->setAdjusterBehavior (options.baBehav[ADDSET_BLACKWHITE_HUES], options.baBehav[ADDSET_BLACKWHITE_GAMMA]); @@ -661,10 +661,6 @@ void BatchToolPanelCoordinator::initSession () pparams.retinex.limd = 0; } - if (options.baBehav[ADDSET_RETI_GAIN]) { - pparams.retinex.gain = 0; - } - if (options.baBehav[ADDSET_RETI_OFFS]) { pparams.retinex.offs = 0; } diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 648004aee..d139cc8e8 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -453,7 +453,7 @@ public: }; EditorPanel::EditorPanel (FilePanel* filePanel) - : catalogPane(nullptr), realized(false), tbBeforeLock(nullptr), iHistoryShow(nullptr), iHistoryHide(nullptr), iTopPanel_1_Show(nullptr), iTopPanel_1_Hide(nullptr), iRightPanel_1_Show(nullptr), iRightPanel_1_Hide(nullptr), iBeforeLockON(nullptr), iBeforeLockOFF(nullptr), previewHandler(nullptr), beforePreviewHandler(nullptr), beforeIarea(nullptr), beforeBox(nullptr), afterBox(nullptr), beforeLabel(nullptr), afterLabel(nullptr), beforeHeaderBox(nullptr), afterHeaderBox(nullptr), parent(nullptr), openThm(nullptr), isrc(nullptr), ipc(nullptr), beforeIpc(nullptr), err(0), isProcessing(false) + : catalogPane(nullptr), realized(false), tbBeforeLock(nullptr), iHistoryShow(nullptr), iHistoryHide(nullptr), iTopPanel_1_Show(nullptr), iTopPanel_1_Hide(nullptr), iRightPanel_1_Show(nullptr), iRightPanel_1_Hide(nullptr), iBeforeLockON(nullptr), iBeforeLockOFF(nullptr), previewHandler(nullptr), beforePreviewHandler(nullptr), beforeIarea(nullptr), beforeBox(nullptr), afterBox(nullptr), beforeLabel(nullptr), afterLabel(nullptr), beforeHeaderBox(nullptr), afterHeaderBox(nullptr), parent(nullptr), parentWindow(nullptr), openThm(nullptr), isrc(nullptr), ipc(nullptr), beforeIpc(nullptr), err(0), isProcessing(false) { epih = new EditorPanelIdleHelper; @@ -899,7 +899,7 @@ void EditorPanel::rightPaneButtonReleased (GdkEventButton *event) { if (event->button == 1) { int winW, winH; - parent->get_size (winW, winH); + parentWindow->get_size (winW, winH); // Button 1 released : it's a resize options.toolPanelWidth = winW - hpanedr->get_position(); } @@ -929,7 +929,7 @@ void EditorPanel::showTopPanel (bool show) void EditorPanel::setAspect () { int winW, winH; - parent->get_size (winW, winH); + parentWindow->get_size (winW, winH); hpanedl->set_position (options.historyPanelWidth); hpanedr->set_position (winW - options.toolPanelWidth); diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index 050909d7d..d3d0eeaf7 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -67,6 +67,12 @@ public: { parent = p; } + + void setParentWindow (Gtk::Window* p) + { + parentWindow = p; + } + void writeOptions(); void showTopPanel (bool show); @@ -196,6 +202,7 @@ private: HistogramPanel* histogramPanel; ToolPanelCoordinator* tpc; RTWindow* parent; + Gtk::Window* parentWindow; //SaveAsDialog* saveAsDialog; FilePanel* fPanel; diff --git a/rtgui/editwindow.cc b/rtgui/editwindow.cc index 1d08ac783..7782de87c 100644 --- a/rtgui/editwindow.cc +++ b/rtgui/editwindow.cc @@ -73,7 +73,7 @@ EditWindow::EditWindow (RTWindow* p) : parent(p) , isFullscreen(false) set_resizable(true); property_destroy_with_parent().set_value(false); - signal_window_state_event().connect( sigc::mem_fun(*this, &EditWindow::on_window_state_event) ); + //signal_window_state_event().connect( sigc::mem_fun(*this, &EditWindow::on_window_state_event) ); mainNB = Gtk::manage (new Gtk::Notebook ()); mainNB->set_scrollable (true); @@ -95,18 +95,16 @@ void EditWindow::on_realize () editWindowCursorManager.init (get_window()); } +/* HOMBRE: Disabling this since it's maximized when opened anyway. + * Someday, the EditorWindow migh save it own position and state, so it'll have to be uncommented bool EditWindow::on_window_state_event(GdkEventWindowState* event) { - if (!event->new_window_state) { - // Window mode - options.windowMaximized = false; - } else if (event->new_window_state & (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN)) { - // Fullscreen mode - options.windowMaximized = true; + if (event->changed_mask & GDK_WINDOW_STATE_MAXIMIZED) { + options.windowMaximized = event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED; } - return true; -} + return Gtk::Widget::on_window_state_event(event); +}*/ void EditWindow::on_mainNB_switch_page(Gtk::Widget* widget, guint page_num) { @@ -124,6 +122,7 @@ void EditWindow::on_mainNB_switch_page(Gtk::Widget* widget, guint page_num) void EditWindow::addEditorPanel (EditorPanel* ep, const std::string &name) { ep->setParent (parent); + ep->setParentWindow(this); // construct closeable tab for the image Gtk::HBox* hb = Gtk::manage (new Gtk::HBox ()); diff --git a/rtgui/editwindow.h b/rtgui/editwindow.h index e5b0e8afb..320b47b40 100644 --- a/rtgui/editwindow.h +++ b/rtgui/editwindow.h @@ -50,7 +50,7 @@ public: bool keyPressed (GdkEventKey* event); bool on_delete_event(GdkEventAny* event); - bool on_window_state_event(GdkEventWindowState* event); + //bool on_window_state_event(GdkEventWindowState* event); void on_mainNB_switch_page(Gtk::Widget* page, guint page_num); void set_title_decorated(Glib::ustring fname); diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index d3fc71d62..10d4809ed 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -604,21 +604,18 @@ void FileBrowser::addEntry_ (FileBrowserEntry* entry) std::lower_bound( fd.begin(), fd.end(), - (ThumbBrowserEntryBase*)entry, - [](ThumbBrowserEntryBase* a, ThumbBrowserEntryBase* b) + entry, + [](const ThumbBrowserEntryBase* a, const ThumbBrowserEntryBase* b) { - return *b < *a; + return *a < *b; } ), - (ThumbBrowserEntryBase*)entry + entry ); initEntry (entry); } redraw (); - - // newly added item might have been already trashed in a previous session - trash_changed().emit(); } FileBrowserEntry* FileBrowser::delEntry (const Glib::ustring& fname) diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index fba3f432a..eafe32fcd 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -825,6 +825,9 @@ void FileCatalog::previewsFinishedUI () refImageForOpen_fname = ""; actionNextPrevious = NAV_NONE; } + + // newly added item might have been already trashed in a previous session + trashChanged(); } void FileCatalog::previewsFinished (int dir_id) diff --git a/rtgui/filecatalog.h b/rtgui/filecatalog.h index 5116f3bb3..29e4a370a 100644 --- a/rtgui/filecatalog.h +++ b/rtgui/filecatalog.h @@ -36,20 +36,6 @@ #include "multilangmgr.h" #include "threadutils.h" - -class DirEntry -{ - -public: - Glib::ustring fullName; - - explicit DirEntry (const Glib::ustring& n) : fullName (n) {} - - bool operator< (DirEntry& other) - { - return fullName.casefold() < other.fullName.casefold(); - } -}; class FilePanel; /* * Class: diff --git a/rtgui/filepanel.cc b/rtgui/filepanel.cc index 7d0f9013b..b3e3668c5 100644 --- a/rtgui/filepanel.cc +++ b/rtgui/filepanel.cc @@ -279,9 +279,23 @@ bool FilePanel::imageLoaded( Thumbnail* thm, ProgressConnector 0 && winGdiHandles <= 8500) // 0 means we don't have the rights to access the function, 8500 because the limit is 10000 and we need about 1500 free handles +#endif + { GThreadLock lock; // Acquiring the GUI... not sure that it's necessary, but it shouldn't harm epanel = Gtk::manage (new EditorPanel ()); parent->addEditorPanel (epanel, pl->thm->getFileName()); + } +#ifdef WIN32 + else { + Glib::ustring msg_ = Glib::ustring("") + M("MAIN_MSG_CANNOTLOAD") + " \"" + thm->getFileName() + "\" .\n" + M("MAIN_MSG_TOOMANYOPENEDITORS") + ""; + Gtk::MessageDialog msgd (msg_, true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); + msgd.run (); + goto MAXGDIHANDLESREACHED; + } +#endif } epanel->open(pl->thm, pl->pc->returnValue() ); @@ -301,7 +315,9 @@ bool FilePanel::imageLoaded( Thumbnail* thm, ProgressConnectorpc; { diff --git a/rtgui/main-cli.cc b/rtgui/main-cli.cc index f6df47119..d262d5feb 100644 --- a/rtgui/main-cli.cc +++ b/rtgui/main-cli.cc @@ -476,14 +476,14 @@ int processLineParams( int argc, char **argv ) try { - auto enumerator = dir->enumerate_children (); + auto enumerator = dir->enumerate_children("standard::name,standard::type"); - while (auto file = enumerator->next_file ()) { + while (auto file = enumerator->next_file()) { - const auto fileName = Glib::build_filename (argument, file->get_name ()); - bool isDir = Glib::file_test (fileName, Glib::FILE_TEST_IS_DIR); - bool notAll = allExtensions && !options.is_parse_extention (fileName); - bool notRetained = !allExtensions && !options.has_retained_extention (fileName); + const auto fileName = Glib::build_filename(argument, file->get_name()); + bool isDir = file->get_file_type() == Gio::FILE_TYPE_DIRECTORY; + bool notAll = allExtensions && !options.is_parse_extention(fileName); + bool notRetained = !allExtensions && !options.has_retained_extention(fileName); if (isDir || notAll || notRetained) { if (isDir) { diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 8d1d6d18a..d39a5fdf8 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -67,12 +67,10 @@ void ParamsEdited::set (bool v) retinex.gam = v; retinex.slope = v; retinex.neigh = v; - retinex.gain = v; retinex.offs = v; retinex.vart = v; retinex.limd = v; retinex.highl = v; - retinex.baselog = v; retinex.skal = v; retinex.medianmap = v; retinex.transmissionCurve = v; @@ -484,7 +482,6 @@ void ParamsEdited::set (bool v) raw.xtranssensor.exBlackGreen = v; raw.xtranssensor.exBlackBlue = v; raw.caCorrection = v; - raw.caAutoStrength = v; raw.caBlue = v; raw.caRed = v; raw.hotPixelFilter = v; @@ -670,12 +667,10 @@ void ParamsEdited::initFrom (const std::vector retinex.gam = retinex.gam && p.retinex.gam == other.retinex.gam; retinex.slope = retinex.slope && p.retinex.slope == other.retinex.slope; retinex.neigh = retinex.neigh && p.retinex.neigh == other.retinex.neigh; - retinex.gain = retinex.gain && p.retinex.gain == other.retinex.gain; retinex.offs = retinex.offs && p.retinex.offs == other.retinex.offs; retinex.vart = retinex.vart && p.retinex.vart == other.retinex.vart; retinex.limd = retinex.limd && p.retinex.limd == other.retinex.limd; retinex.highl = retinex.highl && p.retinex.highl == other.retinex.highl; - retinex.baselog = retinex.baselog && p.retinex.baselog == other.retinex.baselog; retinex.skal = retinex.skal && p.retinex.skal == other.retinex.skal; retinex.medianmap = retinex.medianmap && p.retinex.medianmap == other.retinex.medianmap; retinex.highlights = retinex.highlights && p.retinex.highlights == other.retinex.highlights; @@ -1085,7 +1080,6 @@ void ParamsEdited::initFrom (const std::vector raw.xtranssensor.exBlackGreen = raw.xtranssensor.exBlackGreen && p.raw.xtranssensor.blackgreen == other.raw.xtranssensor.blackgreen; raw.xtranssensor.exBlackBlue = raw.xtranssensor.exBlackBlue && p.raw.xtranssensor.blackblue == other.raw.xtranssensor.blackblue; raw.caCorrection = raw.caCorrection && p.raw.ca_autocorrect == other.raw.ca_autocorrect; - raw.caAutoStrength = raw.caAutoStrength && p.raw.caautostrength == other.raw.caautostrength; raw.caRed = raw.caRed && p.raw.cared == other.raw.cared; raw.caBlue = raw.caBlue && p.raw.cablue == other.raw.cablue; raw.hotPixelFilter = raw.hotPixelFilter && p.raw.hotPixelFilter == other.raw.hotPixelFilter; @@ -1382,18 +1376,10 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten toEdit.retinex.highl = mods.retinex.highl; } - if (retinex.baselog) { - toEdit.retinex.baselog = mods.retinex.baselog; - } - if (retinex.skal) { toEdit.retinex.skal = mods.retinex.skal; } - if (retinex.gain) { - toEdit.retinex.gain = dontforceSet && options.baBehav[ADDSET_RETI_GAIN] ? toEdit.retinex.gain + mods.retinex.gain : mods.retinex.gain; - } - if (retinex.offs) { toEdit.retinex.offs = dontforceSet && options.baBehav[ADDSET_RETI_OFFS] ? toEdit.retinex.offs + mods.retinex.offs : mods.retinex.offs; } @@ -2928,10 +2914,6 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten toEdit.raw.ca_autocorrect = mods.raw.ca_autocorrect; } - if (raw.caAutoStrength) { - toEdit.raw.caautostrength = dontforceSet && options.baBehav[ADDSET_RAWCACORR] ? toEdit.raw.caautostrength + mods.raw.caautostrength : mods.raw.caautostrength; - } - if (raw.caRed) { toEdit.raw.cared = dontforceSet && options.baBehav[ADDSET_RAWCACORR] ? toEdit.raw.cared + mods.raw.cared : mods.raw.cared; } @@ -3419,7 +3401,7 @@ bool RAWParamsEdited::XTransSensor::isUnchanged() const bool RAWParamsEdited::isUnchanged() const { - return bayersensor.isUnchanged() && xtranssensor.isUnchanged() && caCorrection && caAutoStrength && caRed && caBlue && hotPixelFilter && deadPixelFilter && hotDeadPixelThresh && darkFrame + return bayersensor.isUnchanged() && xtranssensor.isUnchanged() && caCorrection && caRed && caBlue && hotPixelFilter && deadPixelFilter && hotDeadPixelThresh && darkFrame && dfAuto && ff_file && ff_AutoSelect && ff_BlurRadius && ff_BlurType && exPos && exPreser && ff_AutoClipControl && ff_clipControl; } diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index cbc36a431..8100131e2 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -67,7 +67,6 @@ public: bool gam; bool slope; bool neigh; - bool gain; bool offs; bool retinexMethod; bool mapMethod; @@ -823,7 +822,6 @@ public: XTransSensor xtranssensor; bool caCorrection; - bool caAutoStrength; bool caRed; bool caBlue; bool hotPixelFilter; diff --git a/rtgui/partialpastedlg.cc b/rtgui/partialpastedlg.cc index 07bff8bf1..47552cc98 100644 --- a/rtgui/partialpastedlg.cc +++ b/rtgui/partialpastedlg.cc @@ -699,9 +699,6 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param // the general section is always ignored, whichever operation we use the PartialPaste for filterPE.general = falsePE.general; - // raw.caAutoStrength is ignored at the moment. - filterPE.raw.caAutoStrength = false; - // Now we filter out the filter depending on the checked items if (!wb->get_active ()) { @@ -904,6 +901,7 @@ void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, Param filterPE.raw.bayersensor.pixelShiftBlur = falsePE.raw.bayersensor.pixelShiftBlur; filterPE.raw.bayersensor.pixelShiftEperIso = falsePE.raw.bayersensor.pixelShiftEperIso; filterPE.raw.bayersensor.pixelShiftEqualBright = falsePE.raw.bayersensor.pixelShiftEqualBright; + filterPE.raw.bayersensor.pixelShiftEqualBrightChannel = falsePE.raw.bayersensor.pixelShiftEqualBrightChannel; filterPE.raw.bayersensor.pixelShiftExp0 = falsePE.raw.bayersensor.pixelShiftExp0; filterPE.raw.bayersensor.pixelShiftGreen = falsePE.raw.bayersensor.pixelShiftGreen; filterPE.raw.bayersensor.pixelShiftHoleFill = falsePE.raw.bayersensor.pixelShiftHoleFill; diff --git a/rtgui/partialpastedlg.h b/rtgui/partialpastedlg.h index 930e05ad5..93630f900 100644 --- a/rtgui/partialpastedlg.h +++ b/rtgui/partialpastedlg.h @@ -131,7 +131,7 @@ public: sigc::connection coarserotConn, finerotConn, cropConn, resizeConn, prsharpeningConn, perspectiveConn, commonTransConn; sigc::connection exifchConn, iptcConn, icmConn; sigc::connection df_fileConn, df_AutoSelectConn, ff_fileConn, ff_AutoSelectConn, ff_BlurRadiusConn, ff_BlurTypeConn, ff_ClipControlConn; - sigc::connection raw_caredblueConn, raw_caautostrengthConn, raw_ca_autocorrectConn, raw_hotpix_filtConn, raw_deadpix_filtConn, raw_linenoiseConn, raw_greenthreshConn, raw_ccStepsConn, raw_methodConn, raw_imagenumConn, raw_dcb_iterationsConn, raw_lmmse_iterationsConn, raw_pixelshiftConn, raw_dcb_enhanceConn, raw_exposConn, raw_preserConn, raw_blackConn; + sigc::connection raw_caredblueConn, raw_ca_autocorrectConn, raw_hotpix_filtConn, raw_deadpix_filtConn, raw_linenoiseConn, raw_greenthreshConn, raw_ccStepsConn, raw_methodConn, raw_imagenumConn, raw_dcb_iterationsConn, raw_lmmse_iterationsConn, raw_pixelshiftConn, raw_dcb_enhanceConn, raw_exposConn, raw_preserConn, raw_blackConn; public: PartialPasteDlg (const Glib::ustring &title, Gtk::Window* parent); diff --git a/rtgui/rawcacorrection.cc b/rtgui/rawcacorrection.cc index 683dcc97f..ca3b1a970 100644 --- a/rtgui/rawcacorrection.cc +++ b/rtgui/rawcacorrection.cc @@ -33,13 +33,6 @@ RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROM caAutocorrect = Gtk::manage (new CheckBox(M("TP_RAWCACORR_AUTO"), multiImage)); caAutocorrect->setCheckBoxListener (this); - caStrength = Gtk::manage(new Adjuster (M("TP_RAWCACORR_CASTR"), 2.0, 8.0, 0.5, 6.0)); - caStrength->setAdjusterListener (this); - if (caStrength->delay < options.adjusterMaxDelay) { - caStrength->delay = options.adjusterMaxDelay; - } - -// caStrength->show(); caRed = Gtk::manage(new Adjuster (M("TP_RAWCACORR_CARED"), -4.0, 4.0, 0.1, 0, icaredL, icaredR)); caRed->setAdjusterListener (this); @@ -58,7 +51,6 @@ RAWCACorr::RAWCACorr () : FoldableToolPanel(this, "rawcacorrection", M("TP_CHROM caBlue->show(); pack_start( *caAutocorrect, Gtk::PACK_SHRINK, 4); -// pack_start( *caStrength, Gtk::PACK_SHRINK, 4); pack_start( *caRed, Gtk::PACK_SHRINK, 4); pack_start( *caBlue, Gtk::PACK_SHRINK, 4); @@ -70,18 +62,15 @@ void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi if(pedited ) { caAutocorrect->setEdited(pedited->raw.caCorrection); - caStrength->setEditedState( pedited->raw.caAutoStrength ? Edited : UnEdited ); caRed->setEditedState( pedited->raw.caRed ? Edited : UnEdited ); caBlue->setEditedState( pedited->raw.caBlue ? Edited : UnEdited ); } - caStrength->set_sensitive(pp->raw.ca_autocorrect); // disable Red and Blue sliders when caAutocorrect is enabled caRed->set_sensitive(!pp->raw.ca_autocorrect); caBlue->set_sensitive(!pp->raw.ca_autocorrect); caAutocorrect->setValue(pp->raw.ca_autocorrect); - caStrength->setValue (pp->raw.caautostrength); caRed->setValue (pp->raw.cared); caBlue->setValue (pp->raw.cablue); @@ -91,13 +80,11 @@ void RAWCACorr::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi void RAWCACorr::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pedited) { pp->raw.ca_autocorrect = caAutocorrect->getLastActive(); - pp->raw.caautostrength = caStrength->getValue(); pp->raw.cared = caRed->getValue(); pp->raw.cablue = caBlue->getValue(); if (pedited) { pedited->raw.caCorrection = !caAutocorrect->get_inconsistent(); - pedited->raw.caAutoStrength = caStrength->getEditedState (); pedited->raw.caRed = caRed->getEditedState (); pedited->raw.caBlue = caBlue->getEditedState (); } @@ -114,8 +101,6 @@ void RAWCACorr::adjusterChanged (Adjuster* a, double newval) listener->panelChanged (EvPreProcessCARed, value ); } else if (a == caBlue) { listener->panelChanged (EvPreProcessCABlue, value ); -// } else if (a == caStrength) { -// listener->panelChanged (EvPreProcessCAStrength, value ); } } } @@ -124,7 +109,6 @@ void RAWCACorr::checkBoxToggled (CheckBox* c, CheckValue newval) { if (c == caAutocorrect) { if (!batchMode) { - caStrength->set_sensitive(caAutocorrect->getLastActive ()); // disable Red and Blue sliders when caAutocorrect is enabled caRed->set_sensitive(!caAutocorrect->getLastActive ()); caBlue->set_sensitive(!caAutocorrect->getLastActive ()); @@ -138,23 +122,19 @@ void RAWCACorr::checkBoxToggled (CheckBox* c, CheckValue newval) void RAWCACorr::setBatchMode(bool batchMode) { ToolPanel::setBatchMode (batchMode); - caStrength->showEditedCB (); caRed->showEditedCB (); caBlue->showEditedCB (); } void RAWCACorr::setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited) { - caStrength->setDefault( defParams->raw.caautostrength); caRed->setDefault( defParams->raw.cared); caBlue->setDefault( defParams->raw.cablue); if (pedited) { - caStrength->setDefaultEditedState( pedited->raw.caAutoStrength ? Edited : UnEdited); caRed->setDefaultEditedState( pedited->raw.caRed ? Edited : UnEdited); caBlue->setDefaultEditedState( pedited->raw.caBlue ? Edited : UnEdited); } else { - caStrength->setDefaultEditedState( Irrelevant ); caRed->setDefaultEditedState( Irrelevant ); caBlue->setDefaultEditedState( Irrelevant ); } @@ -163,7 +143,6 @@ void RAWCACorr::setDefaults(const rtengine::procparams::ProcParams* defParams, c void RAWCACorr::setAdjusterBehavior (bool caadd) { - caStrength->setAddMode(caadd); caRed->setAddMode(caadd); caBlue->setAddMode(caadd); } @@ -171,7 +150,6 @@ void RAWCACorr::setAdjusterBehavior (bool caadd) void RAWCACorr::trimValues (rtengine::procparams::ProcParams* pp) { - caStrength->trimValue(pp->raw.caautostrength); caRed->trimValue(pp->raw.cared); caBlue->trimValue(pp->raw.cablue); } diff --git a/rtgui/rawcacorrection.h b/rtgui/rawcacorrection.h index a1873b2ad..69292b1aa 100644 --- a/rtgui/rawcacorrection.h +++ b/rtgui/rawcacorrection.h @@ -29,7 +29,6 @@ class RAWCACorr : public ToolParamBlock, public AdjusterListener, public CheckBo protected: CheckBox* caAutocorrect; - Adjuster* caStrength; Adjuster* caRed; Adjuster* caBlue; diff --git a/rtgui/retinex.cc b/rtgui/retinex.cc index 75f099488..6da77f8e3 100644 --- a/rtgui/retinex.cc +++ b/rtgui/retinex.cc @@ -450,42 +450,20 @@ Retinex::Retinex () : FoldableToolPanel (this, "retinex", M ("TP_RETINEX_LABEL") gainGrid->attach ( *gaintransmissionCurve, 0, 0, 1, 1); gaintransmissionCurve->show(); - gain = Gtk::manage (new Adjuster (M ("TP_RETINEX_GAIN"), 20, 200, 1, 50)); // Unused !? - setExpandAlignProperties (gain, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); - gain->set_tooltip_markup (M ("TP_RETINEX_GAIN_TOOLTIP")); - offs = Gtk::manage (new Adjuster (M ("TP_RETINEX_OFFSET"), -1000, 5000, 1, 0)); setExpandAlignProperties (offs, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); gainGrid->attach (*offs, 0, 1, 1, 1); offs->show (); - //------------- - gainFrame->add (*gainGrid); settingsGrid->attach (*gainFrame, 0, 6, 1, 1); - - - baselog = Gtk::manage (new Adjuster (M ("TP_RETINEX_BASELOG"), 1., 10., 1., 3.)); // Unused !? - setExpandAlignProperties (baselog, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); - baselog->set_tooltip_markup (M ("TP_RETINEX_BASELOG_TOOLTIP")); -// settingsGrid->attach(*baselog, 0, 7, 1, 1); -// baselog->show (); - - //-------------------------- - expsettings->add (*settingsGrid, false); expsettings->setLevel (2); pack_start (*expsettings); - - - // End of SETTINGS Expander ======================================================= - - - // Reset button neutral = Gtk::manage (new Gtk::Button (M ("TP_RETINEX_NEUTRAL"))); @@ -553,12 +531,6 @@ Retinex::Retinex () : FoldableToolPanel (this, "retinex", M ("TP_RETINEX_LABEL") neigh->delay = 200; } - gain->setAdjusterListener (this); - - if (gain->delay < 200) { - gain->delay = 200; - } - offs->setAdjusterListener (this); if (offs->delay < 200) { @@ -583,13 +555,6 @@ Retinex::Retinex () : FoldableToolPanel (this, "retinex", M ("TP_RETINEX_LABEL") highl->delay = 200; } - baselog->setAdjusterListener (this); - - if (baselog->delay < 200) { - baselog->delay = 200; - } - - radius->setAdjusterListener (this); if (radius->delay < 200) { @@ -649,7 +614,6 @@ Retinex::~Retinex() void Retinex::neutral_pressed () { neigh->resetValue (false); - gain->resetValue (false); offs->resetValue (false); str->resetValue (false); scal->resetValue (false); @@ -659,7 +623,6 @@ void Retinex::neutral_pressed () vart->resetValue (false); limd->resetValue (false); highl->resetValue (false); - baselog->resetValue (false); gam->resetValue (false); slope->resetValue (false); highlights->resetValue (false); @@ -795,12 +758,10 @@ void Retinex::read (const ProcParams* pp, const ParamsEdited* pedited) neigh->setEditedState (pedited->retinex.neigh ? Edited : UnEdited); gam->setEditedState (pedited->retinex.gam ? Edited : UnEdited); slope->setEditedState (pedited->retinex.slope ? Edited : UnEdited); - gain->setEditedState (pedited->retinex.gain ? Edited : UnEdited); offs->setEditedState (pedited->retinex.offs ? Edited : UnEdited); vart->setEditedState (pedited->retinex.vart ? Edited : UnEdited); limd->setEditedState (pedited->retinex.limd ? Edited : UnEdited); highl->setEditedState (pedited->retinex.highl ? Edited : UnEdited); - baselog->setEditedState (pedited->retinex.baselog ? Edited : UnEdited); skal->setEditedState (pedited->retinex.skal ? Edited : UnEdited); set_inconsistent (multiImage && !pedited->retinex.enabled); medianmap->set_inconsistent (!pedited->retinex.medianmap); @@ -841,7 +802,6 @@ void Retinex::read (const ProcParams* pp, const ParamsEdited* pedited) } neigh->setValue (pp->retinex.neigh); - gain->setValue (pp->retinex.gain); offs->setValue (pp->retinex.offs); str->setValue (pp->retinex.str); scal->setValue (pp->retinex.scal); @@ -853,7 +813,6 @@ void Retinex::read (const ProcParams* pp, const ParamsEdited* pedited) gam->setValue (pp->retinex.gam); slope->setValue (pp->retinex.slope); highl->setValue (pp->retinex.highl); - baselog->setValue (pp->retinex.baselog); radius->setValue (pp->retinex.radius); highlights->setValue (pp->retinex.highlights); @@ -977,12 +936,10 @@ void Retinex::write (ProcParams* pp, ParamsEdited* pedited) pp->retinex.gam = gam->getValue (); pp->retinex.slope = slope->getValue (); pp->retinex.neigh = neigh->getValue (); - pp->retinex.gain = (int)gain->getValue (); pp->retinex.offs = (int)offs->getValue (); pp->retinex.vart = (int)vart->getValue (); pp->retinex.limd = (int)limd->getValue (); pp->retinex.highl = (int)highl->getValue (); - pp->retinex.baselog = baselog->getValue (); pp->retinex.skal = (int)skal->getValue (); pp->retinex.cdcurve = cdshape->getCurve (); pp->retinex.lhcurve = lhshape->getCurve (); @@ -1015,12 +972,10 @@ void Retinex::write (ProcParams* pp, ParamsEdited* pedited) pedited->retinex.gam = gam->getEditedState (); pedited->retinex.slope = slope->getEditedState (); pedited->retinex.neigh = neigh->getEditedState (); - pedited->retinex.gain = gain->getEditedState (); pedited->retinex.offs = offs->getEditedState (); pedited->retinex.vart = vart->getEditedState (); pedited->retinex.limd = limd->getEditedState (); pedited->retinex.highl = highl->getEditedState (); - pedited->retinex.baselog = baselog->getEditedState (); pedited->retinex.skal = skal->getEditedState (); pedited->retinex.cdcurve = !cdshape->isUnChanged (); pedited->retinex.cdHcurve = !cdshapeH->isUnChanged (); @@ -1153,7 +1108,6 @@ void Retinex::viewMethodChanged() if (!batchMode) { if (viewMethod->get_active_row_number() == 1 || viewMethod->get_active_row_number() == 2) { //vart->hide(); - gain->hide(); offs->hide(); limd->hide(); transmissionCurveEditorG->hide(); @@ -1169,7 +1123,6 @@ void Retinex::viewMethodChanged() curveEditorGH->hide(); } else if (viewMethod->get_active_row_number() == 3 || viewMethod->get_active_row_number() == 4) { - gain->hide(); offs->hide(); transmissionCurveEditorG->show(); //vart->hide(); @@ -1177,7 +1130,6 @@ void Retinex::viewMethodChanged() } else { vart->show(); neigh->show(); - gain->show(); offs->show(); limd->show(); transmissionCurveEditorG->show(); @@ -1210,15 +1162,12 @@ void Retinex::ColorSpaceUpdateUI () if (retinexcolorspace->get_active_row_number() == 0) { curveEditorGD->show(); curveEditorGDH->hide(); - baselog->show(); } else if (retinexcolorspace->get_active_row_number() == 1) { curveEditorGD->hide(); curveEditorGDH->show(); - baselog->show(); } else if (retinexcolorspace->get_active_row_number() == 2) { curveEditorGD->hide(); curveEditorGDH->show(); - baselog->hide(); } } } @@ -1286,7 +1235,6 @@ void Retinex::setDefaults (const ProcParams* defParams, const ParamsEdited* pedi { neigh->setDefault (defParams->retinex.neigh); - gain->setDefault (defParams->retinex.gain); offs->setDefault (defParams->retinex.offs); str->setDefault (defParams->retinex.str); scal->setDefault (defParams->retinex.scal); @@ -1296,7 +1244,6 @@ void Retinex::setDefaults (const ProcParams* defParams, const ParamsEdited* pedi vart->setDefault (defParams->retinex.vart); limd->setDefault (defParams->retinex.limd); highl->setDefault (defParams->retinex.highl); - baselog->setDefault (defParams->retinex.baselog); skal->setDefault (defParams->retinex.skal); gam->setDefault (defParams->retinex.gam); slope->setDefault (defParams->retinex.slope); @@ -1309,7 +1256,6 @@ void Retinex::setDefaults (const ProcParams* defParams, const ParamsEdited* pedi if (pedited) { neigh->setDefaultEditedState (pedited->retinex.neigh ? Edited : UnEdited); - gain->setDefaultEditedState (pedited->retinex.gain ? Edited : UnEdited); offs->setDefaultEditedState (pedited->retinex.offs ? Edited : UnEdited); str->setDefaultEditedState (pedited->retinex.str ? Edited : UnEdited); scal->setDefaultEditedState (pedited->retinex.scal ? Edited : UnEdited); @@ -1319,7 +1265,6 @@ void Retinex::setDefaults (const ProcParams* defParams, const ParamsEdited* pedi vart->setDefaultEditedState (pedited->retinex.vart ? Edited : UnEdited); limd->setDefaultEditedState (pedited->retinex.limd ? Edited : UnEdited); highl->setDefaultEditedState (pedited->retinex.highl ? Edited : UnEdited); - baselog->setDefaultEditedState (pedited->retinex.baselog ? Edited : UnEdited); skal->setDefaultEditedState (pedited->retinex.skal ? Edited : UnEdited); gam->setDefaultEditedState (pedited->retinex.gam ? Edited : UnEdited); slope->setDefaultEditedState (pedited->retinex.slope ? Edited : UnEdited); @@ -1332,12 +1277,10 @@ void Retinex::setDefaults (const ProcParams* defParams, const ParamsEdited* pedi } else { neigh->setDefaultEditedState (Irrelevant); - gain->setDefaultEditedState (Irrelevant); offs->setDefaultEditedState (Irrelevant); vart->setDefaultEditedState (Irrelevant); limd->setDefaultEditedState (Irrelevant); highl->setDefaultEditedState (Irrelevant); - baselog->setDefaultEditedState (Irrelevant); skal->setDefaultEditedState (Irrelevant); str->setDefaultEditedState (Irrelevant); scal->setDefaultEditedState (Irrelevant); @@ -1356,12 +1299,11 @@ void Retinex::setDefaults (const ProcParams* defParams, const ParamsEdited* pedi } } -void Retinex::setAdjusterBehavior (bool strAdd, bool neighAdd, bool limdAdd, bool gainAdd, bool offsAdd, bool vartAdd, bool gamAdd, bool slopeAdd) +void Retinex::setAdjusterBehavior (bool strAdd, bool neighAdd, bool limdAdd, bool offsAdd, bool vartAdd, bool gamAdd, bool slopeAdd) { str->setAddMode (strAdd); neigh->setAddMode (neighAdd); limd->setAddMode (limdAdd); - gain->setAddMode (gainAdd); offs->setAddMode (offsAdd); vart->setAddMode (vartAdd); gam->setAddMode (gamAdd); @@ -1400,8 +1342,6 @@ void Retinex::adjusterChanged (Adjuster* a, double newval) listener->panelChanged (EvLgrad, grad->getTextValue()); } else if (a == grads) { listener->panelChanged (EvLgrads, grads->getTextValue()); - } else if (a == gain) { - listener->panelChanged (EvLgain, gain->getTextValue()); } else if (a == offs) { listener->panelChanged (EvLoffs, offs->getTextValue()); } else if (a == vart) { @@ -1410,8 +1350,6 @@ void Retinex::adjusterChanged (Adjuster* a, double newval) listener->panelChanged (EvLlimd, limd->getTextValue()); } else if (a == highl) { listener->panelChanged (EvLhighl, highl->getTextValue()); - } else if (a == baselog) { - listener->panelChanged (EvLbaselog, baselog->getTextValue()); } else if (a == skal) { listener->panelChanged (EvLskal, skal->getTextValue()); } else if (a == gam) { @@ -1490,12 +1428,10 @@ void Retinex::trimValues (rtengine::procparams::ProcParams* pp) grad->trimValue (pp->retinex.grad); grads->trimValue (pp->retinex.grads); neigh->trimValue (pp->retinex.neigh); - gain->trimValue (pp->retinex.gain); offs->trimValue (pp->retinex.offs); vart->trimValue (pp->retinex.vart); limd->trimValue (pp->retinex.limd); highl->trimValue (pp->retinex.highl); - baselog->trimValue (pp->retinex.baselog); gam->trimValue (pp->retinex.gam); slope->trimValue (pp->retinex.slope); highlights->trimValue (pp->retinex.highlights); @@ -1560,7 +1496,6 @@ void Retinex::setBatchMode (bool batchMode) { ToolPanel::setBatchMode (batchMode); neigh->showEditedCB (); - gain->showEditedCB (); offs->showEditedCB (); str->showEditedCB (); scal->showEditedCB (); @@ -1572,8 +1507,6 @@ void Retinex::setBatchMode (bool batchMode) vart->showEditedCB (); limd->showEditedCB (); highl->showEditedCB (); - baselog->showEditedCB (); - radius->showEditedCB (); highlights->showEditedCB (); h_tonalwidth->showEditedCB (); diff --git a/rtgui/retinex.h b/rtgui/retinex.h index a3618e1e4..134be502e 100644 --- a/rtgui/retinex.h +++ b/rtgui/retinex.h @@ -31,12 +31,10 @@ protected: Adjuster* grads; Adjuster* iter; Adjuster* neigh; - Adjuster* gain; Adjuster* offs; Adjuster* vart; Adjuster* limd; Adjuster* highl; - Adjuster* baselog; Adjuster* skal; Adjuster* gam; Adjuster* slope; @@ -124,7 +122,7 @@ public: void ColorSpaceUpdateUI(); void writeOptions (std::vector &tpOpen); void updateToolState (std::vector &tpOpen); - void setAdjusterBehavior (bool strAdd, bool neighAdd, bool limdAdd, bool gainAdd, bool offsAdd, bool vartAdd, bool gamAdd, bool slopeAdd); + 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); virtual void colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller); diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index 5edfb3b25..a94fafa36 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -131,7 +131,6 @@ RTWindow::RTWindow () if (options.windowMaximized) { maximize(); - //get_style_context()->add_class("maximized"); } else { unmaximize(); move(options.windowX, options.windowY); @@ -146,6 +145,7 @@ RTWindow::RTWindow () if(simpleEditor) { epanel = Gtk::manage( new EditorPanel (nullptr) ); epanel->setParent (this); + epanel->setParentWindow(this); add (*epanel); show_all (); @@ -387,6 +387,7 @@ void RTWindow::addEditorPanel (EditorPanel* ep, const std::string &name) wndEdit->addEditorPanel(ep, name); } else { ep->setParent (this); + ep->setParentWindow(this); // construct closeable tab for the image Gtk::Grid* titleGrid = Gtk::manage (new Gtk::Grid ()); @@ -868,6 +869,7 @@ void RTWindow::createSetmEditor() // Editor panel, single-tab mode only epanel = Gtk::manage ( new EditorPanel (fpanel) ); epanel->setParent (this); + epanel->setParentWindow(this); // decorate tab Gtk::Grid* const editorLabelGrid = Gtk::manage (new Gtk::Grid ()); diff --git a/rtgui/thumbbrowserbase.cc b/rtgui/thumbbrowserbase.cc index 531ed8c25..abb8ec68d 100644 --- a/rtgui/thumbbrowserbase.cc +++ b/rtgui/thumbbrowserbase.cc @@ -14,13 +14,16 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#include -#include "../rtengine/rt_math.h" +#include + +#include -#include "thumbbrowserbase.h" #include "multilangmgr.h" #include "options.h" +#include "thumbbrowserbase.h" + #include "../rtengine/mytime.h" +#include "../rtengine/rt_math.h" using namespace std; @@ -515,7 +518,7 @@ void ThumbBrowserBase::configScrollBars () } } -void ThumbBrowserBase::arrangeFiles () +void ThumbBrowserBase::arrangeFiles() { MYREADERLOCK(l, entryRW); @@ -523,74 +526,60 @@ void ThumbBrowserBase::arrangeFiles () // We could lock it one more time, there's no harm excepted (negligible) speed penalty //GThreadLock lock; - int N = fd.size (); - - // apply filter - for (int i = 0; i < N; i++) { - fd[i]->filtered = !checkFilter (fd[i]); - } - int rowHeight = 0; - // compute size of the items - for (int i = 0; i < N; i++) + for (unsigned int i = 0; i < fd.size(); i++) { + // apply filter + fd[i]->filtered = !checkFilter (fd[i]); + + // compute size of the items if (!fd[i]->filtered && fd[i]->getMinimalHeight() > rowHeight) { rowHeight = fd[i]->getMinimalHeight (); } + } if (arrangement == TB_Horizontal) { numOfCols = 1; - int numOfRows = 1; -// if (rowHeight>0) { -// numOfRows = (internal.get_height()+rowHeight/2)/rowHeight; -// if (numOfRows<1) -// numOfRows = 1; -// } - int ct = 0; int currx = 0; - while (ct < N) { - // find widest item in the column - int maxw = 0; - - for (int i = 0; ct + i < N && i < numOfRows; i++) - if (fd[ct + i]->getMinimalWidth() > maxw) { - maxw = fd[ct + i]->getMinimalWidth (); - } - + for (unsigned int ct = 0; ct < fd.size(); ++ct) { // arrange items in the column int curry = 0; - for (int i = 0; ct < N && i < numOfRows; i++, ct++) { - while (ct < N && fd[ct]->filtered) { - fd[ct++]->drawable = false; - } - - if (ct < N) { - fd[ct]->setPosition (currx, curry, maxw, rowHeight); - fd[ct]->drawable = true; - curry += rowHeight; - } + for (; ct < fd.size() && fd[ct]->filtered; ++ct) { + fd[ct]->drawable = false; } - currx += maxw; + if (ct < fd.size()) { + const int maxw = fd[ct]->getMinimalWidth(); + + fd[ct]->setPosition(currx, curry, maxw, rowHeight); + fd[ct]->drawable = true; + currx += maxw; + curry += rowHeight; + } } MYREADERLOCK_RELEASE(l); // This will require a Writer access - resizeThumbnailArea (currx, numOfRows * rowHeight); + resizeThumbnailArea(currx, rowHeight); } else { - int availWidth = internal.get_width(); + const int availWidth = internal.get_width(); + // initial number of columns numOfCols = 0; int colsWidth = 0; - for (int i = 0; i < N; i++) + for (unsigned int i = 0; i < fd.size(); ++i) { if (!fd[i]->filtered && colsWidth + fd[i]->getMinimalWidth() <= availWidth) { - colsWidth += fd[numOfCols]->getMinimalWidth (); - numOfCols++; + colsWidth += fd[numOfCols]->getMinimalWidth(); + ++numOfCols; + if(colsWidth > availWidth) { + break; + } } + } if (numOfCols < 1) { numOfCols = 1; @@ -598,30 +587,22 @@ void ThumbBrowserBase::arrangeFiles () std::vector colWidths; - for (; numOfCols > 0; numOfCols--) { + for (; numOfCols > 0; --numOfCols) { // compute column widths - colWidths.resize (numOfCols); + colWidths.assign(numOfCols, 0); - for (int i = 0; i < numOfCols; i++) { - colWidths[i] = 0; - } - - for (int i = 0, j = 0; i < N; i++) { + for (unsigned int i = 0, j = 0; i < fd.size(); ++i) { if (!fd[i]->filtered && fd[i]->getMinimalWidth() > colWidths[j % numOfCols]) { - colWidths[j % numOfCols] = fd[i]->getMinimalWidth (); + colWidths[j % numOfCols] = fd[i]->getMinimalWidth(); } if (!fd[i]->filtered) { - j++; + ++j; } } // if not wider than the space available, arrange it and we are ready - colsWidth = 0; - - for (int i = 0; i < numOfCols; i++) { - colsWidth += colWidths[i]; - } + colsWidth = std::accumulate(colWidths.begin(), colWidths.end(), 0); if (numOfCols == 1 || colsWidth < availWidth) { break; @@ -629,20 +610,19 @@ void ThumbBrowserBase::arrangeFiles () } // arrange files - int ct = 0; int curry = 0; - while (ct < N) { + for (unsigned int ct = 0; ct < fd.size();) { // arrange items in the row int currx = 0; - for (int i = 0; ct < N && i < numOfCols; i++, ct++) { - while (ct < N && fd[ct]->filtered) { - fd[ct++]->drawable = false; + for (int i = 0; ct < fd.size() && i < numOfCols; ++i, ++ct) { + for (; ct < fd.size() && fd[ct]->filtered; ++ct) { + fd[ct]->drawable = false; } - if (ct < N) { - fd[ct]->setPosition (currx, curry, colWidths[i % numOfCols], rowHeight); + if (ct < fd.size()) { + fd[ct]->setPosition(currx, curry, colWidths[i % numOfCols], rowHeight); fd[ct]->drawable = true; currx += colWidths[i % numOfCols]; } diff --git a/rtgui/thumbbrowserentrybase.cc b/rtgui/thumbbrowserentrybase.cc index cf0ce1bb3..ff7e58d49 100644 --- a/rtgui/thumbbrowserentrybase.cc +++ b/rtgui/thumbbrowserentrybase.cc @@ -17,33 +17,73 @@ * along with RawTherapee. If not, see . */ #include "thumbbrowserentrybase.h" -#include "thumbbrowserbase.h" + #include "options.h" +#include "thumbbrowserbase.h" + #include "../rtengine/mytime.h" -ThumbBrowserEntryBase::ThumbBrowserEntryBase (const Glib::ustring& fname) - : fnlabw(0), fnlabh(0), dtlabw(0), dtlabh(0), exlabw(0), exlabh(0), prew(0), preh(0), - prex(0), prey(0), upperMargin(6), borderWidth(1), textGap(6), sideMargin(8), lowerMargin(8), - preview(nullptr), dispname(Glib::path_get_basename (fname)), buttonSet(nullptr), width(0), height(0), - exp_width(0), exp_height(0), startx(0), starty(0), ofsX(0), ofsY(0), redrawRequests(0), - parent(nullptr), original(nullptr), bbSelected(false), bbFramed(false), bbPreview(nullptr), cursor_type(CSUndefined), - thumbnail(nullptr), filename(fname), shortname(dispname), exifline(""), datetimeline(""), - selected(false), drawable(false), filtered(false), framed(false), processing(false), italicstyle(false), - edited(false), recentlysaved(false), updatepriority(false), withFilename(WFNAME_NONE) {} +ThumbBrowserEntryBase::ThumbBrowserEntryBase (const Glib::ustring& fname) : + fnlabw(0), + fnlabh(0), + dtlabw(0), + dtlabh(0), + exlabw(0), + exlabh(0), + prew(0), + preh(0), + prex(0), + prey(0), + upperMargin(6), + borderWidth(1), + textGap(6), + sideMargin(8), + lowerMargin(8), + preview(nullptr), + dispname(Glib::path_get_basename(fname)), + buttonSet(nullptr), + width(0), + height(0), + exp_width(0), + exp_height(0), + startx(0), + starty(0), + ofsX(0), + ofsY(0), + redrawRequests(0), + parent(nullptr), + original(nullptr), + bbSelected(false), + bbFramed(false), + bbPreview(nullptr), + cursor_type(CSUndefined), + collate_name(dispname.casefold().collate_key()), + thumbnail(nullptr), + filename(fname), + shortname(dispname), + exifline(""), + datetimeline(""), + selected(false), + drawable(false), + filtered(false), + framed(false), + processing(false), + italicstyle(false), + edited(false), + recentlysaved(false), + updatepriority(false), + withFilename(WFNAME_NONE) +{ +} ThumbBrowserEntryBase::~ThumbBrowserEntryBase () { - - if (preview) { - delete [] preview; - } - + delete[] preview; delete buttonSet; } void ThumbBrowserEntryBase::addButtonSet (LWButtonSet* bs) { - buttonSet = bs; } diff --git a/rtgui/thumbbrowserentrybase.h b/rtgui/thumbbrowserentrybase.h index 561d652dd..f4779faa1 100644 --- a/rtgui/thumbbrowserentrybase.h +++ b/rtgui/thumbbrowserentrybase.h @@ -88,6 +88,9 @@ protected: // called during updateBackBuffer for custom overlays virtual void customBackBufferUpdate (Cairo::RefPtr c) {} +private: + const std::string collate_name; + public: Thumbnail* thumbnail; @@ -167,9 +170,9 @@ public: void setPosition (int x, int y, int w, int h); void setOffset (int x, int y); - bool operator< (ThumbBrowserEntryBase& other) + bool operator <(const ThumbBrowserEntryBase& other) const { - return shortname.casefold() > other.shortname.casefold(); + return collate_name < other.collate_name; } ThumbBrowserEntryBase* getOriginal () const;