Bugfix and Enhancement for Clut, Issue 2584, Kudos to Fl?ssie
This commit is contained in:
@@ -113,8 +113,9 @@ void FilmSimulation::read( const rtengine::procparams::ProcParams* pp, const Par
|
||||
m_clutComboBox->setSelectedClut("NULL");
|
||||
}
|
||||
if ( !m_enabled->get_inconsistent() && !pp->filmSimulation.enabled )
|
||||
{
|
||||
clutStore.clearCache();
|
||||
{
|
||||
if (options.clutCacheSize == 1)
|
||||
clutStore.clearCache();
|
||||
}
|
||||
|
||||
updateDisable( false );
|
||||
|
||||
@@ -25,7 +25,12 @@
|
||||
#include "addsetids.h"
|
||||
#include "guiutils.h"
|
||||
#include "../rtengine/safegtk.h"
|
||||
#include "version.h"
|
||||
#include "version.h"
|
||||
|
||||
#ifdef _OPENMP
|
||||
#include <omp.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
@@ -353,9 +358,13 @@ void Options::setDefaults () {
|
||||
histogramBar = true;
|
||||
histogramFullMode = false;
|
||||
|
||||
rgbDenoiseThreadLimit = 0;
|
||||
|
||||
filledProfile = false;
|
||||
rgbDenoiseThreadLimit = 0;
|
||||
#if defined( _OPENMP ) && defined( __x86_64__ )
|
||||
clutCacheSize = omp_get_num_procs();
|
||||
#else
|
||||
clutCacheSize = 1;
|
||||
#endif
|
||||
filledProfile = false;
|
||||
|
||||
showProfileSelector = true;
|
||||
FileBrowserToolbarSingleRow = false;
|
||||
@@ -726,7 +735,7 @@ if (keyFile.has_group ("Clipping Indication")) {
|
||||
}
|
||||
|
||||
if (keyFile.has_group ("Performance")) {
|
||||
if (keyFile.has_key ("Performance", "RgbDenoiseThreadLimit")) rgbDenoiseThreadLimit = keyFile.get_integer ("Performance", "RgbDenoiseThreadLimit");
|
||||
if (keyFile.has_key ("Performance", "RgbDenoiseThreadLimit")) rgbDenoiseThreadLimit = keyFile.get_integer ("Performance", "RgbDenoiseThreadLimit");
|
||||
if( keyFile.has_key ("Performance", "NRauto")) rtSettings.nrauto = keyFile.get_double("Performance", "NRauto");
|
||||
if( keyFile.has_key ("Performance", "NRautomax")) rtSettings.nrautomax = keyFile.get_double("Performance", "NRautomax");
|
||||
if( keyFile.has_key ("Performance", "NRhigh")) rtSettings.nrhigh = keyFile.get_double("Performance", "NRhigh");
|
||||
@@ -736,8 +745,7 @@ if (keyFile.has_group ("Performance")) {
|
||||
if (keyFile.has_key ("Performance", "LevNRAUT")) rtSettings.leveldnaut = keyFile.get_integer("Performance", "LevNRAUT");
|
||||
if (keyFile.has_key ("Performance", "LevNRLISS")) rtSettings.leveldnliss = keyFile.get_integer("Performance", "LevNRLISS");
|
||||
if (keyFile.has_key ("Performance", "SIMPLNRAUT")) rtSettings.leveldnautsimpl = keyFile.get_integer("Performance", "SIMPLNRAUT");
|
||||
|
||||
|
||||
if (keyFile.has_key ("Performance", "ClutCacheSize")) clutCacheSize = keyFile.get_integer ("Performance", "ClutCacheSize");
|
||||
}
|
||||
|
||||
if (keyFile.has_group ("GUI")) {
|
||||
@@ -1009,7 +1017,7 @@ int Options::saveToFile (Glib::ustring fname) {
|
||||
keyFile.set_integer ("Clipping Indication", "ShadowThreshold", shadowThreshold);
|
||||
keyFile.set_boolean ("Clipping Indication", "BlinkClipped", blinkClipped);
|
||||
|
||||
keyFile.set_integer ("Performance", "RgbDenoiseThreadLimit", rgbDenoiseThreadLimit);
|
||||
keyFile.set_integer ("Performance", "RgbDenoiseThreadLimit", rgbDenoiseThreadLimit);
|
||||
keyFile.set_double ("Performance", "NRauto", rtSettings.nrauto);
|
||||
keyFile.set_double ("Performance", "NRautomax", rtSettings.nrautomax);
|
||||
keyFile.set_double ("Performance", "NRhigh", rtSettings.nrhigh);
|
||||
@@ -1019,6 +1027,7 @@ int Options::saveToFile (Glib::ustring fname) {
|
||||
keyFile.set_integer ("Performance", "LevNRAUT", rtSettings.leveldnaut);
|
||||
keyFile.set_integer ("Performance", "LevNRLISS", rtSettings.leveldnliss);
|
||||
keyFile.set_integer ("Performance", "SIMPLNRAUT", rtSettings.leveldnautsimpl);
|
||||
keyFile.set_integer ("Performance", "ClutCacheSize", clutCacheSize);
|
||||
|
||||
keyFile.set_string ("Output", "Format", saveFormat.format);
|
||||
keyFile.set_integer ("Output", "JpegQuality", saveFormat.jpegQuality);
|
||||
|
||||
@@ -219,7 +219,7 @@ class Options {
|
||||
|
||||
// Performance options
|
||||
int rgbDenoiseThreadLimit; // maximum number of threads for the denoising tool ; 0 = use the maximum available
|
||||
|
||||
int clutCacheSize;
|
||||
bool filledProfile; // Used as reminder for the ProfilePanel "mode"
|
||||
|
||||
bool menuGroupRank;
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
#include <sstream>
|
||||
#include "../rtengine/safegtk.h"
|
||||
#include "rtimage.h"
|
||||
#ifdef _OPENMP
|
||||
#include <omp.h>
|
||||
#endif
|
||||
|
||||
extern Options options;
|
||||
extern Glib::ustring argv0;
|
||||
@@ -593,7 +596,33 @@ Gtk::Widget* Preferences::getPerformancePanel () {
|
||||
|
||||
mainContainer->pack_start(*threadLimitHB, Gtk::PACK_SHRINK, 4);
|
||||
fdenoise->add (*mainContainer);
|
||||
mvbsd->pack_start (*fdenoise, Gtk::PACK_SHRINK, 4);
|
||||
mvbsd->pack_start (*fdenoise, Gtk::PACK_SHRINK, 4);
|
||||
|
||||
|
||||
Gtk::Frame* fclut = Gtk::manage( new Gtk::Frame (M("PREFERENCES_CLUTSCACHE")) );
|
||||
|
||||
Gtk::HBox* clutCacheSizeHB = Gtk::manage( new Gtk::HBox () );
|
||||
clutCacheSizeHB->set_border_width(4);
|
||||
clutCacheSizeHB->set_spacing(4);
|
||||
// clutCacheSizeHB->set_tooltip_text(M("PREFERENCES_CLUTCACHESIZE_TOOLTIP"));
|
||||
Gtk::Label* CLUTLl = Gtk::manage( new Gtk::Label (M("PREFERENCES_CLUTSCACHE_LABEL") + ":", Gtk::ALIGN_LEFT));
|
||||
clutCacheSizeSB = Gtk::manage( new Gtk::SpinButton () );
|
||||
clutCacheSizeSB->set_digits (0);
|
||||
clutCacheSizeSB->set_increments (1, 5);
|
||||
clutCacheSizeSB->set_max_length(2); // Will this be sufficient? :)
|
||||
|
||||
#ifdef _OPENMP
|
||||
clutCacheSizeSB->set_range (1, 2*omp_get_num_procs());
|
||||
#else
|
||||
clutCacheSizeSB->set_range (1, 8);
|
||||
#endif
|
||||
|
||||
clutCacheSizeHB->pack_start (*CLUTLl, Gtk::PACK_SHRINK, 0);
|
||||
clutCacheSizeHB->pack_end (*clutCacheSizeSB, Gtk::PACK_SHRINK, 0);
|
||||
fclut->add (*clutCacheSizeHB);
|
||||
|
||||
|
||||
mvbsd->pack_start (*fclut, Gtk::PACK_SHRINK, 4);
|
||||
|
||||
// return mainContainer;
|
||||
return mvbsd;
|
||||
@@ -1376,7 +1405,8 @@ void Preferences::storePreferences () {
|
||||
moptions.overwriteOutputFile = chOverwriteOutputFile->get_active ();
|
||||
moptions.UseIconNoText = ckbUseIconNoText->get_active();
|
||||
|
||||
moptions.rgbDenoiseThreadLimit = rgbDenoiseTreadLimitSB->get_value_as_int();
|
||||
moptions.rgbDenoiseThreadLimit = rgbDenoiseTreadLimitSB->get_value_as_int();
|
||||
moptions.clutCacheSize = clutCacheSizeSB->get_value_as_int();
|
||||
|
||||
// Sounds only on Windows and Linux
|
||||
#if defined(WIN32) || defined(__linux__)
|
||||
@@ -1522,7 +1552,7 @@ void Preferences::fillPreferences () {
|
||||
ckbUseIconNoText->set_active(moptions.UseIconNoText);
|
||||
|
||||
rgbDenoiseTreadLimitSB->set_value(moptions.rgbDenoiseThreadLimit);
|
||||
|
||||
clutCacheSizeSB->set_value(moptions.clutCacheSize);
|
||||
//darkFrameDir->set_filename( moptions.rtSettings.darkFramesPath );
|
||||
//updateDFinfos();
|
||||
darkFrameDir->set_current_folder( moptions.rtSettings.darkFramesPath );
|
||||
@@ -1534,7 +1564,7 @@ void Preferences::fillPreferences () {
|
||||
flatFieldChanged ();
|
||||
|
||||
clutsDir->set_current_folder( moptions.clutsDir );
|
||||
|
||||
|
||||
addc.block (true);
|
||||
setc.block (true);
|
||||
if (moptions.baBehav.size() == ADDSET_PARAM_NUM) {
|
||||
|
||||
@@ -124,6 +124,7 @@ class Preferences : public Gtk::Dialog, public ProfileStoreListener {
|
||||
Gtk::CheckButton* sameThumbSize;
|
||||
|
||||
Gtk::SpinButton* rgbDenoiseTreadLimitSB;
|
||||
Gtk::SpinButton* clutCacheSizeSB;
|
||||
|
||||
Gtk::CheckButton* ckbmenuGroupRank;
|
||||
Gtk::CheckButton* ckbmenuGroupLabel;
|
||||
|
||||
Reference in New Issue
Block a user