Issue 1680: "FtblockDN.cc RGB_denoise": this patch add a Performance tab to limit the number of core used for RGB denoising tool

This commit is contained in:
natureh 510
2013-02-26 01:05:44 +01:00
parent d59fab9f17
commit d6e42edcc6
8 changed files with 56 additions and 2 deletions

View File

@@ -303,7 +303,9 @@ void Options::setDefaults () {
histogramPosition = 2;
histogramBar = true;
histogramFullMode = false;
rgbDenoiseThreadLimit = 0;
showProfileSelector = true;
FileBrowserToolbarSingleRow = false;
hideTPVScrollbar = false;
@@ -603,6 +605,10 @@ if (keyFile.has_group ("Clipping Indication")) {
if (keyFile.has_key ("Clipping Indication", "BlinkClipped")) blinkClipped = keyFile.get_boolean ("Clipping Indication", "BlinkClipped");
}
if (keyFile.has_group ("Performance")) {
if (keyFile.has_key ("Performance", "RgbDenoiseThreadLimit")) rgbDenoiseThreadLimit = keyFile.get_integer ("Performance", "RgbDenoiseThreadLimit");
}
if (keyFile.has_group ("GUI")) {
if (keyFile.has_key ("GUI", "Font")) font = keyFile.get_string ("GUI", "Font");
if (keyFile.has_key ("GUI", "WindowWidth")) windowWidth = keyFile.get_integer ("GUI", "WindowWidth");
@@ -820,6 +826,8 @@ 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_string ("Output", "Format", saveFormat.format);
keyFile.set_integer ("Output", "JpegQuality", saveFormat.jpegQuality);
keyFile.set_integer ("Output", "JpegSubSamp", saveFormat.jpegSubSamp);

View File

@@ -194,6 +194,9 @@ class Options {
bool UseIconNoText;
int whiteBalanceSpotSize;
// Performance options
int rgbDenoiseThreadLimit; // maximum number of threads for the denoising tool ; 0 = use the maximum available
bool menuGroupRank;
bool menuGroupLabel;
bool menuGroupFileOperations;

View File

@@ -82,6 +82,7 @@ Preferences::Preferences (RTWindow *rtwindow):parent(rtwindow) {
nb->append_page (*getFileBrowserPanel(), M("PREFERENCES_TAB_BROWSER"));
nb->append_page (*getColorManagementPanel(),M("PREFERENCES_TAB_COLORMGR"));
nb->append_page (*getBatchProcPanel(), M("PREFERENCES_BATCH_PROCESSING"));
nb->append_page (*getPerformancePanel(), M("PREFERENCES_TAB_PERFORMANCE"));
// Sounds only on Windows and Linux
#if defined(WIN32) || defined(__linux__)
nb->append_page (*getSoundPanel(), M("PREFERENCES_TAB_SOUND"));
@@ -395,6 +396,32 @@ Gtk::Widget* Preferences::getProcParamsPanel () {
return mvbpp;
}
Gtk::Widget* Preferences::getPerformancePanel () {
Gtk::VBox* mainContainer = Gtk::manage( new Gtk::VBox () );
mainContainer->set_spacing(4);
Gtk::HBox* threadLimitHB = Gtk::manage( new Gtk::HBox () );
threadLimitHB->set_border_width(4);
threadLimitHB->set_spacing(4);
threadLimitHB->set_tooltip_text(M("PREFERENCES_RGBDTL_TOOLTIP"));
Gtk::Label* RGBDTLl = Gtk::manage( new Gtk::Label (M("PREFERENCES_RGBDTL_LABEL") + ":", Gtk::ALIGN_LEFT));
rgbDenoiseTreadLimitSB = Gtk::manage( new Gtk::SpinButton () );
rgbDenoiseTreadLimitSB->set_digits (0);
rgbDenoiseTreadLimitSB->set_increments (1, 5);
rgbDenoiseTreadLimitSB->set_max_length(2); // Will this be sufficient? :)
int maxThreadNumber = 10;
#ifdef _OPENMP
maxThreadNumber = omp_get_max_threads();
#endif
rgbDenoiseTreadLimitSB->set_range (0, maxThreadNumber);
threadLimitHB->pack_start (*RGBDTLl, Gtk::PACK_SHRINK, 0);
threadLimitHB->pack_end (*rgbDenoiseTreadLimitSB, Gtk::PACK_SHRINK, 0);
mainContainer->pack_start(*threadLimitHB, Gtk::PACK_SHRINK, 4);
return mainContainer;
}
Gtk::Widget* Preferences::getColorManagementPanel () {
Gtk::VBox* mvbcm = Gtk::manage (new Gtk::VBox ());
@@ -1134,6 +1161,8 @@ void Preferences::storePreferences () {
moptions.overwriteOutputFile = chOverwriteOutputFile->get_active ();
moptions.UseIconNoText = ckbUseIconNoText->get_active();
moptions.rgbDenoiseThreadLimit = rgbDenoiseTreadLimitSB->get_value_as_int();
// Sounds only on Windows and Linux
#if defined(WIN32) || defined(__linux__)
moptions.sndEnable = ckbSndEnable->get_active ();
@@ -1250,6 +1279,8 @@ void Preferences::fillPreferences () {
ckbHideTPVScrollbar->set_active(moptions.hideTPVScrollbar);
ckbUseIconNoText->set_active(moptions.UseIconNoText);
rgbDenoiseTreadLimitSB->set_value(moptions.rgbDenoiseThreadLimit);
//darkFrameDir->set_filename( moptions.rtSettings.darkFramesPath );
//updateDFinfos();
darkFrameDir->set_current_folder( moptions.rtSettings.darkFramesPath );

View File

@@ -111,6 +111,8 @@ class Preferences : public Gtk::Dialog {
Gtk::Button* delExt;
Gtk::CheckButton* overlayedFileNames;
Gtk::SpinButton* rgbDenoiseTreadLimitSB;
Gtk::CheckButton* ckbmenuGroupRank;
Gtk::CheckButton* ckbmenuGroupLabel;
Gtk::CheckButton* ckbmenuGroupFileOperations;
@@ -172,6 +174,7 @@ class Preferences : public Gtk::Dialog {
Gtk::Widget* getFileBrowserPanel ();
Gtk::Widget* getGeneralPanel ();
Gtk::Widget* getBatchProcPanel ();
Gtk::Widget* getPerformancePanel ();
Gtk::Widget* getSoundPanel ();
public: