From 2f32afa841631b5774316c004828bcacdd6b422e Mon Sep 17 00:00:00 2001 From: heckflosse Date: Sun, 8 Oct 2017 15:36:31 +0200 Subject: [PATCH 01/13] Raw CA correction created an artifact, fixes #4116 --- rtengine/CA_correct_RT.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index ec598b6ca..59fd804f1 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -824,7 +824,7 @@ void RawImageSource::CA_correct_RT(const bool autoCA, const double cared, const } if (rrmax < rr1) { - for (int rr = 0; rr < border; rr++) + for (int rr = 0; rr < std::min(border, rr1 - rrmax); rr++) for (int cc = ccmin; cc < ccmax; cc++) { int c = FC(rr, cc); rgb[c][((rrmax + rr)*ts + cc) >> ((c & 1) ^ 1)] = (rawData[(height - rr - 2)][left + cc]) / 65535.f; @@ -845,7 +845,7 @@ void RawImageSource::CA_correct_RT(const bool autoCA, const double cared, const if (ccmax < cc1) { for (int rr = rrmin; rr < rrmax; rr++) - for (int cc = 0; cc < border; cc++) { + for (int cc = 0; cc < std::min(border, cc1 - ccmax); cc++) { int c = FC(rr, cc); rgb[c][(rr * ts + ccmax + cc) >> ((c & 1) ^ 1)] = (rawData[(top + rr)][(width - cc - 2)]) / 65535.f; if ((c & 1) == 0) { @@ -867,8 +867,8 @@ void RawImageSource::CA_correct_RT(const bool autoCA, const double cared, const } if (rrmax < rr1 && ccmax < cc1) { - for (int rr = 0; rr < border; rr++) - for (int cc = 0; cc < border; cc++) { + for (int rr = 0; rr < std::min(border, rr1 - rrmax); rr++) + for (int cc = 0; cc < std::min(border, cc1 - ccmax); cc++) { int c = FC(rr, cc); rgb[c][((rrmax + rr)*ts + ccmax + cc) >> ((c & 1) ^ 1)] = (rawData[(height - rr - 2)][(width - cc - 2)]) / 65535.f; if ((c & 1) == 0) { @@ -879,7 +879,7 @@ void RawImageSource::CA_correct_RT(const bool autoCA, const double cared, const if (rrmin > 0 && ccmax < cc1) { for (int rr = 0; rr < border; rr++) - for (int cc = 0; cc < border; cc++) { + for (int cc = 0; cc < std::min(border, cc1 - ccmax); cc++) { int c = FC(rr, cc); rgb[c][(rr * ts + ccmax + cc) >> ((c & 1) ^ 1)] = (rawData[(border2 - rr)][(width - cc - 2)]) / 65535.f; if ((c & 1) == 0) { @@ -889,7 +889,7 @@ void RawImageSource::CA_correct_RT(const bool autoCA, const double cared, const } if (rrmax < rr1 && ccmin > 0) { - for (int rr = 0; rr < border; rr++) + for (int rr = 0; rr < std::min(border, rr1 - rrmax); rr++) for (int cc = 0; cc < border; cc++) { int c = FC(rr, cc); rgb[c][((rrmax + rr)*ts + cc) >> ((c & 1) ^ 1)] = (rawData[(height - rr - 2)][(border2 - cc)]) / 65535.f; From d84a3fd40ae5bf8af0bb4801e862f6e177fe8e5b Mon Sep 17 00:00:00 2001 From: heckflosse Date: Sun, 8 Oct 2017 17:27:39 +0200 Subject: [PATCH 02/13] Improve start time of rawtherapee when Dark-frames and Flat-fileds directories are set at default (windows), fixes #4103 --- rtengine/dfmanager.cc | 51 +++++++++++++++++++----------------------- rtengine/ffmanager.cc | 52 +++++++++++++++++++------------------------ 2 files changed, 46 insertions(+), 57 deletions(-) diff --git a/rtengine/dfmanager.cc b/rtengine/dfmanager.cc index bc35b3c71..b9841c86b 100644 --- a/rtengine/dfmanager.cc +++ b/rtengine/dfmanager.cc @@ -334,41 +334,36 @@ void DFManager::init( Glib::ustring pathname ) dfInfo* DFManager::addFileInfo (const Glib::ustring& filename, bool pool) { - auto file = Gio::File::create_for_path (filename); + auto ext = getFileExtension(filename); + + if (ext.empty() || !options.is_extention_enabled(ext)) { + return nullptr; + } + + auto file = Gio::File::create_for_path(filename); if (!file) { return nullptr; } - if (!file->query_exists ()) { + if (!file->query_exists()) { return nullptr; } try { - auto info = file->query_info (); + auto info = file->query_info("standard::name,standard::type,standard::is-hidden"); - if (!info && info->get_file_type () == Gio::FILE_TYPE_DIRECTORY) { + if (!info && info->get_file_type() == Gio::FILE_TYPE_DIRECTORY) { return nullptr; } - if (!options.fbShowHidden && info->is_hidden ()) { + if (!options.fbShowHidden && info->is_hidden()) { return nullptr; } - Glib::ustring ext; - - auto lastdot = info->get_name ().find_last_of ('.'); - if (lastdot != Glib::ustring::npos) { - ext = info->get_name ().substr (lastdot + 1); - } - - if (!options.is_extention_enabled (ext)) { - return nullptr; - } - - RawImage ri (filename); - int res = ri.loadRaw (false); // Read informations about shot + RawImage ri(filename); + int res = ri.loadRaw(false); // Read informations about shot if (res != 0) { return nullptr; @@ -378,7 +373,7 @@ dfInfo* DFManager::addFileInfo (const Glib::ustring& filename, bool pool) if(!pool) { dfInfo n(filename, "", "", 0, 0, 0); - iter = dfList.insert(std::pair< std::string, dfInfo>( "", n ) ); + iter = dfList.emplace("", n); return &(iter->second); } @@ -388,22 +383,22 @@ dfInfo* DFManager::addFileInfo (const Glib::ustring& filename, bool pool) rml.ciffLength = ri.get_ciffLen(); ImageData idata(filename, &rml); /* Files are added in the map, divided by same maker/model,ISO and shutter*/ - std::string key( dfInfo::key(((Glib::ustring)idata.getMake()).uppercase(), ((Glib::ustring)idata.getModel()).uppercase(), idata.getISOSpeed(), idata.getShutterSpeed()) ); - iter = dfList.find( key ); + std::string key(dfInfo::key(((Glib::ustring)idata.getMake()).uppercase(), ((Glib::ustring)idata.getModel()).uppercase(), idata.getISOSpeed(), idata.getShutterSpeed())); + iter = dfList.find(key); - if( iter == dfList.end() ) { - dfInfo n(filename, ((Glib::ustring)idata.getMake()).uppercase(), ((Glib::ustring)idata.getModel()).uppercase(), idata.getISOSpeed(), idata.getShutterSpeed(), idata.getDateTimeAsTS() ); - iter = dfList.insert(std::pair< std::string, dfInfo>( key, n ) ); + if(iter == dfList.end()) { + dfInfo n(filename, ((Glib::ustring)idata.getMake()).uppercase(), ((Glib::ustring)idata.getModel()).uppercase(), idata.getISOSpeed(), idata.getShutterSpeed(), idata.getDateTimeAsTS()); + iter = dfList.emplace(key, n); } else { - while( iter != dfList.end() && iter->second.key() == key && ABS(iter->second.timestamp - idata.getDateTimeAsTS()) > 60 * 60 * 6 ) { // 6 hour difference + while(iter != dfList.end() && iter->second.key() == key && ABS(iter->second.timestamp - idata.getDateTimeAsTS()) > 60 * 60 * 6) { // 6 hour difference ++iter; } - if( iter != dfList.end() ) { - iter->second.pathNames.push_back( filename ); + if(iter != dfList.end()) { + iter->second.pathNames.push_back(filename); } else { dfInfo n(filename, ((Glib::ustring)idata.getMake()).uppercase(), ((Glib::ustring)idata.getModel()).uppercase(), idata.getISOSpeed(), idata.getShutterSpeed(), idata.getDateTimeAsTS()); - iter = dfList.insert(std::pair< std::string, dfInfo>( key, n ) ); + iter = dfList.emplace(key, n); } } diff --git a/rtengine/ffmanager.cc b/rtengine/ffmanager.cc index 87ae98905..d0edffb17 100644 --- a/rtengine/ffmanager.cc +++ b/rtengine/ffmanager.cc @@ -21,6 +21,7 @@ #include "rawimage.h" #include "imagedata.h" #include "median.h" +#include "utils.h" namespace rtengine { @@ -288,43 +289,36 @@ void FFManager::init( Glib::ustring pathname ) ffInfo* FFManager::addFileInfo (const Glib::ustring& filename, bool pool) { - auto file = Gio::File::create_for_path (filename); + auto ext = getFileExtension(filename); + + if (ext.empty() || !options.is_extention_enabled(ext)) { + return nullptr; + } + + auto file = Gio::File::create_for_path(filename); if (!file ) { return nullptr; } - if (!file->query_exists ()) { + if (!file->query_exists()) { return nullptr; } try { - auto info = file->query_info (); + auto info = file->query_info("standard::name,standard::type,standard::is-hidden"); - if (!info || info->get_file_type () == Gio::FILE_TYPE_DIRECTORY) { + if (!info || info->get_file_type() == Gio::FILE_TYPE_DIRECTORY) { return nullptr; } - if (!options.fbShowHidden && info->is_hidden ()) { + if (!options.fbShowHidden && info->is_hidden()) { return nullptr; } - Glib::ustring ext; - - auto lastdot = info->get_name ().find_last_of ('.'); - - if (lastdot != Glib::ustring::npos) { - ext = info->get_name ().substr (lastdot + 1); - } - - if (!options.is_extention_enabled (ext)) { - return nullptr; - } - - - RawImage ri (filename); - int res = ri.loadRaw (false); // Read informations about shot + RawImage ri(filename); + int res = ri.loadRaw(false); // Read informations about shot if (res != 0) { return nullptr; @@ -334,7 +328,7 @@ ffInfo* FFManager::addFileInfo (const Glib::ustring& filename, bool pool) if(!pool) { ffInfo n(filename, "", "", "", 0, 0, 0); - iter = ffList.insert(std::pair< std::string, ffInfo>( "", n ) ); + iter = ffList.emplace("", n); return &(iter->second); } @@ -344,22 +338,22 @@ ffInfo* FFManager::addFileInfo (const Glib::ustring& filename, bool pool) rml.ciffLength = ri.get_ciffLen(); ImageData idata(filename, &rml); /* Files are added in the map, divided by same maker/model,lens and aperture*/ - std::string key( ffInfo::key(idata.getMake(), idata.getModel(), idata.getLens(), idata.getFocalLen(), idata.getFNumber()) ); - iter = ffList.find( key ); + std::string key(ffInfo::key(idata.getMake(), idata.getModel(), idata.getLens(), idata.getFocalLen(), idata.getFNumber())); + iter = ffList.find(key); - if( iter == ffList.end() ) { + if(iter == ffList.end()) { ffInfo n(filename, idata.getMake(), idata.getModel(), idata.getLens(), idata.getFocalLen(), idata.getFNumber(), idata.getDateTimeAsTS()); - iter = ffList.insert(std::pair< std::string, ffInfo>( key, n ) ); + iter = ffList.emplace(key, n); } else { - while( iter != ffList.end() && iter->second.key() == key && ABS(iter->second.timestamp - ri.get_timestamp()) > 60 * 60 * 6 ) { // 6 hour difference + while(iter != ffList.end() && iter->second.key() == key && ABS(iter->second.timestamp - ri.get_timestamp()) > 60 * 60 * 6) { // 6 hour difference ++iter; } - if( iter != ffList.end() ) { - iter->second.pathNames.push_back( filename ); + if(iter != ffList.end()) { + iter->second.pathNames.push_back(filename); } else { ffInfo n(filename, idata.getMake(), idata.getModel(), idata.getLens(), idata.getFocalLen(), idata.getFNumber(), idata.getDateTimeAsTS()); - iter = ffList.insert(std::pair< std::string, ffInfo>( key, n ) ); + iter = ffList.emplace(key, n); } } From 1fdc2d7b49327c9e08ca037d04a51a7c22e159cd Mon Sep 17 00:00:00 2001 From: Alberto Griggio Date: Mon, 9 Oct 2017 09:46:00 +0200 Subject: [PATCH 03/13] dcraw: do not use CameraCalibration matrices when loading DNG files This is to make sure that DNG-converted and original raw files are processed in the same way Fixes #4129 --- rtengine/dcraw.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index f8918896b..f59f5b2fe 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -6244,6 +6244,16 @@ guess_cfa_pc: free (buf); } + /* RT -- do not use CameraCalibration matrices for DNGs - see #4129 */ + for (j=0; j < 4; j++) { + ab[j] = 1; + for (i=0; i < 4; i++) { + cc[0][j][i] = i == j; + cc[1][j][i] = i == j; + } + } + /* RT end */ + for (i=0; i < colors; i++) FORCC cc[cm_D65][i][c] *= ab[i]; if (use_cm) { From f38b271d74c9f78c8dd538e153bad57243dca98b Mon Sep 17 00:00:00 2001 From: heckflosse Date: Tue, 10 Oct 2017 15:44:27 +0200 Subject: [PATCH 04/13] fix heap-buffer-overflow in wavelet, Detected by AddressSanitizer. #4127 --- rtengine/ipwavelet.cc | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index a5c9b6d7a..dd2a32e10 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -669,12 +669,12 @@ SSEFUNCTION void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int #pragma omp parallel num_threads(numthreads) #endif { - float *mean = new float [9]; - float *meanN = new float [9]; - float *sigma = new float [9]; - float *sigmaN = new float [9]; - float *MaxP = new float [9]; - float *MaxN = new float [9]; + float mean[10]; + float meanN[10]; + float sigma[10]; + float sigmaN[10]; + float MaxP[10]; + float MaxN[10]; float** varhue = new float*[tileheight]; @@ -1247,12 +1247,6 @@ SSEFUNCTION void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int delete [] varchro; - delete [] mean; - delete [] meanN; - delete [] sigma; - delete [] sigmaN; - delete [] MaxP; - delete [] MaxN; } #ifdef _RT_NESTED_OPENMP omp_set_nested(oldNested); From dcd2922167d6649549ac6c0e5cf81171d4dbe834 Mon Sep 17 00:00:00 2001 From: Hombre57 Date: Tue, 10 Oct 2017 23:03:57 +0200 Subject: [PATCH 05/13] Let users select RGB Input ICC profiles for output profiles as requested there https://discuss.pixls.us/t/rawtherapee-restriction-on-user-chosen-output-profile/5301 (no issue) --- rtengine/iccstore.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rtengine/iccstore.cc b/rtengine/iccstore.cc index 49ff4790e..dc4fe6ffb 100644 --- a/rtengine/iccstore.cc +++ b/rtengine/iccstore.cc @@ -501,7 +501,9 @@ public: ) ||( type==ICCStore::ProfileType::OUTPUT - && (cmsGetDeviceClass(profile.second) == cmsSigDisplayClass || cmsGetDeviceClass(profile.second) == cmsSigOutputClass) + && (cmsGetDeviceClass(profile.second) == cmsSigDisplayClass + || cmsGetDeviceClass(profile.second) == cmsSigInputClass + || cmsGetDeviceClass(profile.second) == cmsSigOutputClass) && cmsGetColorSpace(profile.second) == cmsSigRgbData ) ) { From f38680b0f8f8dc0f6aa3e6a68af4ab9220d4144a Mon Sep 17 00:00:00 2001 From: Hombre57 Date: Tue, 10 Oct 2017 23:42:59 +0200 Subject: [PATCH 06/13] Updating misleading tooltips of Soft-proofing buttons (no issue) --- rtdata/languages/Francais | 4 ++-- rtdata/languages/default | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rtdata/languages/Francais b/rtdata/languages/Francais index e7fdc8592..6c581d55b 100644 --- a/rtdata/languages/Francais +++ b/rtdata/languages/Francais @@ -1173,8 +1173,8 @@ SAVEDLG_SUBSAMP_TOOLTIP;Meilleurs compression:\nJ:a:b 4:2:0\nh/v 2/2\nChroma div SAVEDLG_TIFFUNCOMPRESSED;TIFF non compressé SAVEDLG_WARNFILENAME;Le fichier sera nommé SHCSELECTOR_TOOLTIP;Cliquez le bouton droit de la souris\npour réinitialiser la position de ces 3 curseurs -SOFTPROOF_GAMUTCHECK_TOOLTIP;Si activé, indique en gris les pixels dont la couleurs est en dehors du gamut du profil de sortie -SOFTPROOF_TOOLTIP;Épreuvage écran\nSi activé, simule le rendu généré par le profile de sortie de l'outil ICM. Particulièrement utile pour simuler le rendu en sortie d'imprimante. +SOFTPROOF_GAMUTCHECK_TOOLTIP;Si activé, indique en gris les pixels dont la couleurs est en dehors du gamut du profil Imprimante +SOFTPROOF_TOOLTIP;Épreuvage écran\nSi activé, vous permet de simuler le rendu obtenu par votre imprimante en utilisant le profil Imprimante réglé dans Préférences > Gestion des couleurs. THRESHOLDSELECTOR_B;Bas THRESHOLDSELECTOR_BL;Bas-gauche THRESHOLDSELECTOR_BR;Bas-droite diff --git a/rtdata/languages/default b/rtdata/languages/default index 8310c284e..4095fadfb 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1200,8 +1200,8 @@ SAVEDLG_SUBSAMP_TOOLTIP;Best compression:\nJ:a:b 4:2:0\nh/v 2/2\nChroma halved h SAVEDLG_TIFFUNCOMPRESSED;Uncompressed TIFF SAVEDLG_WARNFILENAME;File will be named SHCSELECTOR_TOOLTIP;Click right mouse button to reset the position of those 3 sliders. -SOFTPROOF_GAMUTCHECK_TOOLTIP;If active, indicates in grey the pixels which have out of gamut colors from the output profile. -SOFTPROOF_TOOLTIP;Soft-proofing\nIf active, let you simulate de rendering generated by the output profile of the ICM tool. Most useful for simulating printing outputs. +SOFTPROOF_GAMUTCHECK_TOOLTIP;If active, indicates in grey the pixels which have out of gamut colors from the Printer profile. +SOFTPROOF_TOOLTIP;Soft-proofing\nIf active, let you simulate the printer's output by using the Printer profile set in Preferences > Color Management. THRESHOLDSELECTOR_B;Bottom THRESHOLDSELECTOR_BL;Bottom-left THRESHOLDSELECTOR_BR;Bottom-right From 2b3dfb3f3cf1529a20ecc9df7cbc130fd94bdad4 Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Thu, 12 Oct 2017 22:29:42 +0200 Subject: [PATCH 07/13] Added comment to executable_loader.in --- tools/osx/executable_loader.in | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/osx/executable_loader.in b/tools/osx/executable_loader.in index b6025fe59..dcc0cabc4 100644 --- a/tools/osx/executable_loader.in +++ b/tools/osx/executable_loader.in @@ -48,6 +48,7 @@ esac #fi #ln -sf "${app}" /tmp +# Prevent crash when directory name contains special characters AppleLocale=`defaults read -g AppleLocale` export LANG=${AppleLocale%@*}.UTF-8 From fd0d50fe0d4005d2a6afa8afa786c71c9b25445d Mon Sep 17 00:00:00 2001 From: heckflosse Date: Fri, 13 Oct 2017 20:53:15 +0200 Subject: [PATCH 08/13] Use std::string instead of Glib::ustring for the map-key in rtimage.cc, #4140 --- rtgui/rtimage.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtgui/rtimage.cc b/rtgui/rtimage.cc index 16e8e3286..b24158b00 100644 --- a/rtgui/rtimage.cc +++ b/rtgui/rtimage.cc @@ -28,7 +28,7 @@ namespace { -std::map> pixbufCache; +std::map> pixbufCache; } From b6bf4aba05246c1d81d930d734843ec63c671da0 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Fri, 13 Oct 2017 20:54:03 +0200 Subject: [PATCH 09/13] Don't create Metadata panel for batch editor, #4140 --- rtgui/batchtoolpanelcoord.cc | 19 +-------- rtgui/toolpanelcoord.cc | 82 +++++++++++------------------------- rtgui/toolpanelcoord.h | 2 +- 3 files changed, 26 insertions(+), 77 deletions(-) diff --git a/rtgui/batchtoolpanelcoord.cc b/rtgui/batchtoolpanelcoord.cc index be092fbfb..e7672e4c7 100644 --- a/rtgui/batchtoolpanelcoord.cc +++ b/rtgui/batchtoolpanelcoord.cc @@ -25,31 +25,14 @@ using namespace rtengine::procparams; -BatchToolPanelCoordinator::BatchToolPanelCoordinator (FilePanel* parent) : ToolPanelCoordinator(), somethingChanged(false), parent(parent) +BatchToolPanelCoordinator::BatchToolPanelCoordinator (FilePanel* parent) : ToolPanelCoordinator(true), somethingChanged(false), parent(parent) { blockedUpdate = false; - // remove exif panel and iptc panel - std::vector::iterator epi = std::find (toolPanels.begin(), toolPanels.end(), exifpanel); - - if (epi != toolPanels.end()) { - toolPanels.erase (epi); - } - - std::vector::iterator ipi = std::find (toolPanels.begin(), toolPanels.end(), iptcpanel); - - if (ipi != toolPanels.end()) { - toolPanels.erase (ipi); - } - if (toolBar) { toolBar->setBatchMode (); } - toolPanelNotebook->remove_page (*metadataPanel); - metadataPanel = nullptr; - toiM = nullptr; - for (size_t i = 0; i < toolPanels.size(); i++) { toolPanels[i]->setBatchMode (true); } diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index ad0bd09bc..2032fa6e2 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -28,7 +28,7 @@ using namespace rtengine::procparams; -ToolPanelCoordinator::ToolPanelCoordinator () : ipc (nullptr), hasChanged (false), editDataProvider (nullptr) +ToolPanelCoordinator::ToolPanelCoordinator (bool batch) : ipc (nullptr), hasChanged (false), editDataProvider (nullptr) { exposurePanel = Gtk::manage (new ToolVBox ()); @@ -70,8 +70,10 @@ ToolPanelCoordinator::ToolPanelCoordinator () : ipc (nullptr), hasChanged (false prsharpening = Gtk::manage (new PrSharpening()); crop = Gtk::manage (new Crop ()); icm = Gtk::manage (new ICMPanel ()); - exifpanel = Gtk::manage (new ExifPanel ()); - iptcpanel = Gtk::manage (new IPTCPanel ()); + if(!batch) { + exifpanel = Gtk::manage (new ExifPanel ()); + iptcpanel = Gtk::manage (new IPTCPanel ()); + } wavelet = Gtk::manage (new Wavelet ()); dirpyrequalizer = Gtk::manage (new DirPyrEqualizer ()); hsvequalizer = Gtk::manage (new HSVEqualizer ()); @@ -99,111 +101,68 @@ ToolPanelCoordinator::ToolPanelCoordinator () : ipc (nullptr), hasChanged (false // Medium -> High ISO addPanel (colorPanel, whitebalance); - toolPanels.push_back (whitebalance); addPanel (exposurePanel, toneCurve); - toolPanels.push_back (toneCurve); addPanel (colorPanel, vibrance); - toolPanels.push_back (vibrance); addPanel (colorPanel, chmixer); - toolPanels.push_back (chmixer); // << TODO: Add "Enabled" addPanel (colorPanel, blackwhite); - toolPanels.push_back (blackwhite); addPanel (exposurePanel, shadowshighlights); - toolPanels.push_back (shadowshighlights); addPanel (detailsPanel, sharpening); - toolPanels.push_back (sharpening); addPanel (detailsPanel, sharpenEdge); - toolPanels.push_back (sharpenEdge); addPanel (detailsPanel, sharpenMicro); - toolPanels.push_back (sharpenMicro); addPanel (colorPanel, hsvequalizer); - toolPanels.push_back (hsvequalizer); // << TODO: Add "Enabled" addPanel (colorPanel, filmSimulation); - toolPanels.push_back (filmSimulation); addPanel (colorPanel, rgbcurves); - toolPanels.push_back (rgbcurves); // << TODO: Add "Enabled" addPanel (colorPanel, colortoning); - toolPanels.push_back (colortoning); addPanel (exposurePanel, epd); - toolPanels.push_back (epd); addPanel (exposurePanel, retinex); - toolPanels.push_back (retinex); addPanel (exposurePanel, pcvignette); - toolPanels.push_back (pcvignette); addPanel (exposurePanel, gradient); - toolPanels.push_back (gradient); addPanel (exposurePanel, lcurve); - toolPanels.push_back (lcurve); // << TODO: Add "Enabled" ??? addPanel (exposurePanel, colorappearance); - toolPanels.push_back (colorappearance); addPanel (detailsPanel, impulsedenoise); - toolPanels.push_back (impulsedenoise); addPanel (detailsPanel, dirpyrdenoise); - toolPanels.push_back (dirpyrdenoise); addPanel (detailsPanel, defringe); - toolPanels.push_back (defringe); addPanel (detailsPanel, dirpyrequalizer); - toolPanels.push_back (dirpyrequalizer); addPanel (waveletPanel, wavelet); - toolPanels.push_back (wavelet); addPanel (transformPanel, crop); - toolPanels.push_back (crop); addPanel (transformPanel, resize); - toolPanels.push_back (resize); addPanel (resize->getPackBox(), prsharpening, 2); - toolPanels.push_back (prsharpening); addPanel (transformPanel, lensgeom); - toolPanels.push_back (lensgeom); addPanel (lensgeom->getPackBox(), rotate, 2); - toolPanels.push_back (rotate); addPanel (lensgeom->getPackBox(), perspective, 2); - toolPanels.push_back (perspective); addPanel (lensgeom->getPackBox(), lensProf, 2); - toolPanels.push_back (lensProf); addPanel (lensgeom->getPackBox(), distortion, 2); - toolPanels.push_back (distortion); addPanel (lensgeom->getPackBox(), cacorrection, 2); - toolPanels.push_back (cacorrection); addPanel (lensgeom->getPackBox(), vignetting, 2); - toolPanels.push_back (vignetting); addPanel (colorPanel, icm); - toolPanels.push_back (icm); addPanel (rawPanel, sensorbayer); - toolPanels.push_back (sensorbayer); addPanel (sensorbayer->getPackBox(), bayerprocess, 2); - toolPanels.push_back (bayerprocess); addPanel (sensorbayer->getPackBox(), bayerrawexposure, 2); - toolPanels.push_back (bayerrawexposure); addPanel (sensorbayer->getPackBox(), bayerpreprocess, 2); - toolPanels.push_back (bayerpreprocess); addPanel (sensorbayer->getPackBox(), rawcacorrection, 2); - toolPanels.push_back (rawcacorrection); addPanel (rawPanel, sensorxtrans); - toolPanels.push_back (sensorxtrans); addPanel (sensorxtrans->getPackBox(), xtransprocess, 2); - toolPanels.push_back (xtransprocess); addPanel (sensorxtrans->getPackBox(), xtransrawexposure, 2); - toolPanels.push_back (xtransrawexposure); addPanel (rawPanel, rawexposure); - toolPanels.push_back (rawexposure); addPanel (rawPanel, preprocess); - toolPanels.push_back (preprocess); addPanel (rawPanel, darkframe); - toolPanels.push_back (darkframe); addPanel (rawPanel, flatfield); - toolPanels.push_back (flatfield); toolPanels.push_back (coarse); - toolPanels.push_back (exifpanel); - toolPanels.push_back (iptcpanel); - metadataPanel = Gtk::manage (new Gtk::Notebook ()); - metadataPanel->set_name ("MetaPanelNotebook"); + if(!batch) { + toolPanels.push_back (exifpanel); + toolPanels.push_back (iptcpanel); + metadataPanel = Gtk::manage (new Gtk::Notebook ()); + metadataPanel->set_name ("MetaPanelNotebook"); + metadataPanel->append_page (*exifpanel, M ("MAIN_TAB_EXIF")); + metadataPanel->append_page (*iptcpanel, M ("MAIN_TAB_IPTC")); + } else { + metadataPanel = nullptr; + } toolPanelNotebook = new Gtk::Notebook (); toolPanelNotebook->set_name ("ToolPanelNotebook"); - metadataPanel->append_page (*exifpanel, M ("MAIN_TAB_EXIF")); - metadataPanel->append_page (*iptcpanel, M ("MAIN_TAB_IPTC")); exposurePanelSW = Gtk::manage (new MyScrolledWindow ()); detailsPanelSW = Gtk::manage (new MyScrolledWindow ()); @@ -256,7 +215,11 @@ ToolPanelCoordinator::ToolPanelCoordinator () : ipc (nullptr), hasChanged (false toiW = Gtk::manage (new TextOrIcon ("wavelet.png", M ("MAIN_TAB_WAVELET"), M ("MAIN_TAB_WAVELET_TOOLTIP"), type)); toiT = Gtk::manage (new TextOrIcon ("transform.png", M ("MAIN_TAB_TRANSFORM"), M ("MAIN_TAB_TRANSFORM_TOOLTIP"), type)); toiR = Gtk::manage (new TextOrIcon ("raw.png", M ("MAIN_TAB_RAW"), M ("MAIN_TAB_RAW_TOOLTIP"), type)); - toiM = Gtk::manage (new TextOrIcon ("meta.png", M ("MAIN_TAB_METADATA"), M ("MAIN_TAB_METADATA_TOOLTIP"), type)); + if(!batch) { + toiM = Gtk::manage (new TextOrIcon ("meta.png", M ("MAIN_TAB_METADATA"), M ("MAIN_TAB_METADATA_TOOLTIP"), type)); + } else { + toiM = nullptr; + } toolPanelNotebook->append_page (*exposurePanelSW, *toiE); toolPanelNotebook->append_page (*detailsPanelSW, *toiD); @@ -264,7 +227,9 @@ ToolPanelCoordinator::ToolPanelCoordinator () : ipc (nullptr), hasChanged (false toolPanelNotebook->append_page (*waveletPanelSW, *toiW); toolPanelNotebook->append_page (*transformPanelSW, *toiT); toolPanelNotebook->append_page (*rawPanelSW, *toiR); - toolPanelNotebook->append_page (*metadataPanel, *toiM); + if(!batch) { + toolPanelNotebook->append_page (*metadataPanel, *toiM); + } toolPanelNotebook->set_current_page (0); @@ -297,6 +262,7 @@ void ToolPanelCoordinator::addPanel (Gtk::Box* where, FoldableToolPanel* panel, expList.push_back (panel->getExpander()); where->pack_start (*panel->getExpander(), false, false); + toolPanels.push_back (panel); } ToolPanelCoordinator::~ToolPanelCoordinator () diff --git a/rtgui/toolpanelcoord.h b/rtgui/toolpanelcoord.h index 5a71ef692..155679687 100644 --- a/rtgui/toolpanelcoord.h +++ b/rtgui/toolpanelcoord.h @@ -198,7 +198,7 @@ public: CoarsePanel* coarse; Gtk::Notebook* toolPanelNotebook; - ToolPanelCoordinator (); + ToolPanelCoordinator (bool batch = false); virtual ~ToolPanelCoordinator (); bool getChangedState () From 93f6bf89b94ef8bad093458bc3f701821522e9d4 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Fri, 13 Oct 2017 20:59:49 +0200 Subject: [PATCH 10/13] Multithreaded init phase, #4140 --- rtengine/init.cc | 61 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 51 insertions(+), 10 deletions(-) diff --git a/rtengine/init.cc b/rtengine/init.cc index 41f599b01..6c1f4b98a 100644 --- a/rtengine/init.cc +++ b/rtengine/init.cc @@ -42,24 +42,65 @@ MyMutex* lcmsMutex = nullptr; int init (const Settings* s, Glib::ustring baseDir, Glib::ustring userSettingsDir, bool loadAll) { settings = s; - ProfileStore::getInstance()->init (loadAll); - ICCStore::getInstance()->init (s->iccDirectory, Glib::build_filename (baseDir, "iccprofiles"), loadAll); - DCPStore::getInstance()->init (Glib::build_filename (baseDir, "dcpprofiles"), loadAll); + ProcParams::init(); + PerceptualToneCurve::init(); + RawImageSource::init(); - CameraConstantsStore::getInstance ()->init (baseDir, userSettingsDir); - ProcParams::init (); - Color::init (); - PerceptualToneCurve::init (); - RawImageSource::init (); +#ifdef _OPENMP +#pragma omp parallel sections +#endif +{ +#ifdef _OPENMP +#pragma omp section +#endif +{ if (s->lensfunDbDirectory.empty() || Glib::path_is_absolute(s->lensfunDbDirectory)) { LFDatabase::init(s->lensfunDbDirectory); } else { LFDatabase::init(Glib::build_filename(baseDir, s->lensfunDbDirectory)); } +} +#ifdef _OPENMP +#pragma omp section +#endif +{ + ProfileStore::getInstance()->init(loadAll); +} +#ifdef _OPENMP +#pragma omp section +#endif +{ + ICCStore::getInstance()->init(s->iccDirectory, Glib::build_filename (baseDir, "iccprofiles"), loadAll); +} +#ifdef _OPENMP +#pragma omp section +#endif +{ + DCPStore::getInstance()->init(Glib::build_filename (baseDir, "dcpprofiles"), loadAll); +} +#ifdef _OPENMP +#pragma omp section +#endif +{ + CameraConstantsStore::getInstance()->init(baseDir, userSettingsDir); +} +#ifdef _OPENMP +#pragma omp section +#endif +{ + dfm.init(s->darkFramesPath); +} +#ifdef _OPENMP +#pragma omp section +#endif +{ + ffm.init(s->flatFieldsPath); +} +} + + Color::init (); delete lcmsMutex; lcmsMutex = new MyMutex; - dfm.init( s->darkFramesPath ); - ffm.init( s->flatFieldsPath ); return 0; } From 77b357605981392ce5b68b561c4be744f8e89eb8 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Fri, 13 Oct 2017 21:05:37 +0200 Subject: [PATCH 11/13] dual-threaded fill of lensfun treestores, #4140 --- rtgui/lensprofile.cc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/rtgui/lensprofile.cc b/rtgui/lensprofile.cc index 0c3b227aa..899ef289e 100644 --- a/rtgui/lensprofile.cc +++ b/rtgui/lensprofile.cc @@ -582,13 +582,27 @@ bool LensProfilePanel::checkLensfunCanCorrect(bool automatch) //----------------------------------------------------------------------------- LensProfilePanel::LFDbHelper::LFDbHelper() +{ +#ifdef _OPENMP +#pragma omp parallel sections +#endif +{ +#ifdef _OPENMP +#pragma omp section +#endif { lensfunCameraModel = Gtk::TreeStore::create(lensfunModelCam); - lensfunLensModel = Gtk::TreeStore::create(lensfunModelLens); - fillLensfunCameras(); +} +#ifdef _OPENMP +#pragma omp section +#endif +{ + lensfunLensModel = Gtk::TreeStore::create(lensfunModelLens); fillLensfunLenses(); } +} +} void LensProfilePanel::LFDbHelper::fillLensfunCameras() { From 5a0e4de6078efec8171b8154f95e1574c813126d Mon Sep 17 00:00:00 2001 From: heckflosse Date: Fri, 13 Oct 2017 21:23:21 +0200 Subject: [PATCH 12/13] When no lcp is selected, rt does not show (none), fixes #4143 --- rtgui/lensprofile.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtgui/lensprofile.cc b/rtgui/lensprofile.cc index 899ef289e..8da352834 100644 --- a/rtgui/lensprofile.cc +++ b/rtgui/lensprofile.cc @@ -177,7 +177,7 @@ void LensProfilePanel::read(const rtengine::procparams::ProcParams* pp, const Pa if (pp->lensProf.lcpFile.empty()) { Glib::ustring lastFolder = fcbLCPFile->get_current_folder(); fcbLCPFile->set_current_folder(lastFolder); - fcbLCPFile->set_filename(lastFolder + "/."); + fcbLCPFile->unselect_all(); bindCurrentFolder(*fcbLCPFile, options.lastLensProfileDir); updateDisabled(false); } else if (LCPStore::getInstance()->isValidLCPFileName(pp->lensProf.lcpFile)) { From e6f57b1978cc59337121e737ddf51acb697fd641 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Fri, 13 Oct 2017 21:34:55 +0200 Subject: [PATCH 13/13] Use std::string instead of Glib::ustring for key of map in camconst, #4140 --- rtengine/camconst.cc | 4 ++-- rtengine/camconst.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rtengine/camconst.cc b/rtengine/camconst.cc index 6b4a36c4b..469d18571 100644 --- a/rtengine/camconst.cc +++ b/rtengine/camconst.cc @@ -184,7 +184,7 @@ CameraConst::parseEntry(void *cJSON_, const char *make_model) js = (cJSON *)cJSON_; CameraConst *cc = new CameraConst; - cc->make_model = Glib::ustring(make_model); + cc->make_model = make_model; ji = cJSON_GetObjectItem(js, "dcraw_matrix"); @@ -739,7 +739,7 @@ CameraConstantsStore::get(const char make[], const char model[]) key += " "; key += model; key = key.uppercase(); - std::map::iterator it; + std::map::iterator it; it = mCameraConstants.find(key); if (it == mCameraConstants.end()) { diff --git a/rtengine/camconst.h b/rtengine/camconst.h index 31b65f3e8..47c8d8bee 100644 --- a/rtengine/camconst.h +++ b/rtengine/camconst.h @@ -17,7 +17,7 @@ struct camera_const_levels { class CameraConst { private: - Glib::ustring make_model; + std::string make_model; short dcraw_matrix[12]; int raw_crop[4]; int raw_mask[8][4]; @@ -48,7 +48,7 @@ public: class CameraConstantsStore { private: - std::map mCameraConstants; + std::map mCameraConstants; CameraConstantsStore(); bool parse_camera_constants_file(Glib::ustring filename);