Merge pull request #4459 from Beep6581/enhanced-inspector-mode

feature: added option to use a (fast) neutral RAW rendering in 'inspector mode'
This commit is contained in:
Alberto Griggio
2018-03-27 12:17:22 +02:00
committed by GitHub
11 changed files with 170 additions and 13 deletions

View File

@@ -210,6 +210,23 @@ void Inspector::switchImage (const Glib::ustring &fullPath)
return;
}
if (delayconn.connected()) {
delayconn.disconnect();
}
next_image_path = fullPath;
if (!options.inspectorDelay) {
doSwitchImage();
} else {
delayconn = Glib::signal_timeout().connect(sigc::mem_fun(*this, &Inspector::doSwitchImage), options.inspectorDelay);
}
}
bool Inspector::doSwitchImage()
{
Glib::ustring fullPath = next_image_path;
// we first check the size of the list, it may have been changed in Preference
if (images.size() > size_t(options.maxInspectorBuffers)) {
// deleting the last entries
@@ -225,7 +242,6 @@ void Inspector::switchImage (const Glib::ustring &fullPath)
if (fullPath.empty()) {
currImage = nullptr;
queue_draw();
return;
} else {
bool found = false;
@@ -264,6 +280,8 @@ void Inspector::switchImage (const Glib::ustring &fullPath)
}
}
}
return true;
}
void Inspector::deleteBuffers ()

View File

@@ -48,9 +48,14 @@ private:
double zoom;
bool active;
sigc::connection delayconn;
Glib::ustring next_image_path;
bool on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr);
void deleteBuffers();
bool doSwitchImage();
public:
Inspector();
~Inspector();

View File

@@ -426,6 +426,7 @@ void Options::setDefaults ()
#endif
filledProfile = false;
maxInspectorBuffers = 2; // a rather conservative value for low specced systems...
inspectorDelay = 0;
serializeTiffRead = true;
FileBrowserToolbarSingleRow = false;
@@ -592,6 +593,8 @@ void Options::setDefaults ()
rtSettings.lensfunDbDirectory = ""; // set also in main.cc and main-cli.cc
cropGuides = CROP_GUIDE_FULL;
cropAutoFit = false;
rtSettings.thumbnail_inspector_mode = rtengine::Settings::ThumbnailInspectorMode::JPEG;
}
Options* Options::copyFrom (Options* other)
@@ -1054,6 +1057,10 @@ void Options::readFromFile (Glib::ustring fname)
maxInspectorBuffers = keyFile.get_integer ("Performance", "MaxInspectorBuffers");
}
if (keyFile.has_key ("Performance", "InspectorDelay")) {
inspectorDelay = keyFile.get_integer("Performance", "InspectorDelay");
}
if (keyFile.has_key ("Performance", "PreviewDemosaicFromSidecar")) {
prevdemo = (prevdemo_t)keyFile.get_integer ("Performance", "PreviewDemosaicFromSidecar");
}
@@ -1065,6 +1072,10 @@ void Options::readFromFile (Glib::ustring fname)
if (keyFile.has_key ("Performance", "SerializeTiffRead")) {
serializeTiffRead = keyFile.get_boolean ("Performance", "SerializeTiffRead");
}
if (keyFile.has_key("Performance", "ThumbnailInspectorMode")) {
rtSettings.thumbnail_inspector_mode = static_cast<rtengine::Settings::ThumbnailInspectorMode>(keyFile.get_integer("Performance", "ThumbnailInspectorMode"));
}
}
if (keyFile.has_group ("GUI")) {
@@ -1841,9 +1852,11 @@ void Options::saveToFile (Glib::ustring fname)
keyFile.set_integer ("Performance", "SIMPLNRAUT", rtSettings.leveldnautsimpl);
keyFile.set_integer ("Performance", "ClutCacheSize", clutCacheSize);
keyFile.set_integer ("Performance", "MaxInspectorBuffers", maxInspectorBuffers);
keyFile.set_integer ("Performance", "InspectorDelay", inspectorDelay);
keyFile.set_integer ("Performance", "PreviewDemosaicFromSidecar", prevdemo);
keyFile.set_boolean ("Performance", "Daubechies", rtSettings.daubech);
keyFile.set_boolean ("Performance", "SerializeTiffRead", serializeTiffRead);
keyFile.set_integer("Performance", "ThumbnailInspectorMode", int(rtSettings.thumbnail_inspector_mode));
keyFile.set_string ("Output", "Format", saveFormat.format);
keyFile.set_integer ("Output", "JpegQuality", saveFormat.jpegQuality);

View File

@@ -275,6 +275,7 @@ public:
Glib::ustring clutsDir;
int rgbDenoiseThreadLimit; // maximum number of threads for the denoising tool ; 0 = use the maximum available
int maxInspectorBuffers; // maximum number of buffers (i.e. images) for the Inspector feature
int inspectorDelay;
int clutCacheSize;
bool filledProfile; // Used as reminder for the ProfilePanel "mode"
prevdemo_t prevdemo; // Demosaicing method used for the <100% preview

View File

@@ -657,7 +657,19 @@ Gtk::Widget* Preferences::getPerformancePanel ()
maxInspectorBuffersSB->set_range (1, 12); // ... we have to set a limit, 12 seem to be enough even for systems with tons of RAM
maxIBuffersHB->pack_start (*maxIBufferLbl, Gtk::PACK_SHRINK, 0);
maxIBuffersHB->pack_end (*maxInspectorBuffersSB, Gtk::PACK_SHRINK, 0);
finspect->add (*maxIBuffersHB);
Gtk::VBox *inspectorvb = Gtk::manage(new Gtk::VBox());
inspectorvb->add(*maxIBuffersHB);
Gtk::HBox *insphb = Gtk::manage(new Gtk::HBox());
thumbnailInspectorMode = Gtk::manage(new Gtk::ComboBoxText());
thumbnailInspectorMode->append(M("PREFERENCES_THUMBNAIL_INSPECTOR_JPEG"));
thumbnailInspectorMode->append(M("PREFERENCES_THUMBNAIL_INSPECTOR_RAW"));
thumbnailInspectorMode->append(M("PREFERENCES_THUMBNAIL_INSPECTOR_RAW_IF_NO_JPEG_FULLSIZE"));
insphb->pack_start(*Gtk::manage(new Gtk::Label(M("PREFERENCES_THUMBNAIL_INSPECTOR_MODE") + ": ")), Gtk::PACK_SHRINK, 4);
insphb->pack_start(*thumbnailInspectorMode);
inspectorvb->pack_start(*insphb);
finspect->add (*inspectorvb);
mainContainer->pack_start (*finspect, Gtk::PACK_SHRINK, 4);
Gtk::Frame* fdenoise = Gtk::manage ( new Gtk::Frame (M ("PREFERENCES_NOISE")) );
@@ -1853,6 +1865,7 @@ void Preferences::storePreferences ()
moptions.rgbDenoiseThreadLimit = rgbDenoiseTreadLimitSB->get_value_as_int();
moptions.clutCacheSize = clutCacheSizeSB->get_value_as_int();
moptions.maxInspectorBuffers = maxInspectorBuffersSB->get_value_as_int();
moptions.rtSettings.thumbnail_inspector_mode = static_cast<rtengine::Settings::ThumbnailInspectorMode>(thumbnailInspectorMode->get_active_row_number());
// Sounds only on Windows and Linux
#if defined(WIN32) || defined(__linux__)
@@ -2072,6 +2085,7 @@ void Preferences::fillPreferences ()
rgbDenoiseTreadLimitSB->set_value (moptions.rgbDenoiseThreadLimit);
clutCacheSizeSB->set_value (moptions.clutCacheSize);
maxInspectorBuffersSB->set_value (moptions.maxInspectorBuffers);
thumbnailInspectorMode->set_active(int(moptions.rtSettings.thumbnail_inspector_mode));
darkFrameDir->set_current_folder ( moptions.rtSettings.darkFramesPath );
darkFrameChanged ();

View File

@@ -166,6 +166,7 @@ class Preferences : public Gtk::Dialog, public ProfileStoreListener
Gtk::SpinButton* rgbDenoiseTreadLimitSB;
Gtk::SpinButton* clutCacheSizeSB;
Gtk::SpinButton* maxInspectorBuffersSB;
Gtk::ComboBoxText *thumbnailInspectorMode;
Gtk::CheckButton* ckbmenuGroupRank;
Gtk::CheckButton* ckbmenuGroupLabel;