merge with dev
This commit is contained in:
@@ -1833,8 +1833,7 @@ void DCPStore::init(const Glib::ustring& rt_profile_dir, bool loadAll)
|
|||||||
&& lastdot <= sname.size() - 4
|
&& lastdot <= sname.size() - 4
|
||||||
&& !sname.casefold().compare(lastdot, 4, ".dcp")
|
&& !sname.casefold().compare(lastdot, 4, ".dcp")
|
||||||
) {
|
) {
|
||||||
const Glib::ustring cam_short_name = sname.substr(0, lastdot).uppercase();
|
file_std_profiles[sname.substr(0, lastdot).casefold_collate_key()] = fname; // They will be loaded and cached on demand
|
||||||
file_std_profiles[cam_short_name] = fname; // They will be loaded and cached on demand
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Directory
|
// Directory
|
||||||
@@ -1845,11 +1844,10 @@ void DCPStore::init(const Glib::ustring& rt_profile_dir, bool loadAll)
|
|||||||
|
|
||||||
for (const auto& alias : getAliases(rt_profile_dir)) {
|
for (const auto& alias : getAliases(rt_profile_dir)) {
|
||||||
const Glib::ustring alias_name = Glib::ustring(alias.first).uppercase();
|
const Glib::ustring alias_name = Glib::ustring(alias.first).uppercase();
|
||||||
const Glib::ustring real_name = Glib::ustring(alias.second).uppercase();
|
const std::map<std::string, Glib::ustring>::const_iterator real = file_std_profiles.find(Glib::ustring(alias.second).casefold_collate_key());
|
||||||
const std::map<Glib::ustring, Glib::ustring>::const_iterator real = file_std_profiles.find(real_name);
|
|
||||||
|
|
||||||
if (real != file_std_profiles.end()) {
|
if (real != file_std_profiles.end()) {
|
||||||
file_std_profiles[alias_name] = real->second;
|
file_std_profiles[alias_name.casefold_collate_key()] = real->second;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1871,19 +1869,19 @@ bool DCPStore::isValidDCPFileName(const Glib::ustring& filename) const
|
|||||||
|
|
||||||
DCPProfile* DCPStore::getProfile(const Glib::ustring& filename) const
|
DCPProfile* DCPStore::getProfile(const Glib::ustring& filename) const
|
||||||
{
|
{
|
||||||
|
const auto key = filename.casefold_collate_key();
|
||||||
MyMutex::MyLock lock(mutex);
|
MyMutex::MyLock lock(mutex);
|
||||||
|
const std::map<std::string, DCPProfile*>::const_iterator iter = profile_cache.find(key);
|
||||||
|
|
||||||
const std::map<Glib::ustring, DCPProfile*>::iterator r = profile_cache.find(filename);
|
if (iter != profile_cache.end()) {
|
||||||
|
return iter->second;
|
||||||
if (r != profile_cache.end()) {
|
|
||||||
return r->second;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DCPProfile* const res = new DCPProfile(filename);
|
DCPProfile* const res = new DCPProfile(filename);
|
||||||
|
|
||||||
if (res->isValid()) {
|
if (res->isValid()) {
|
||||||
// Add profile
|
// Add profile
|
||||||
profile_cache[filename] = res;
|
profile_cache[key] = res;
|
||||||
if (options.rtSettings.verbose) {
|
if (options.rtSettings.verbose) {
|
||||||
printf("DCP profile '%s' loaded from disk\n", filename.c_str());
|
printf("DCP profile '%s' loaded from disk\n", filename.c_str());
|
||||||
}
|
}
|
||||||
@@ -1896,13 +1894,9 @@ DCPProfile* DCPStore::getProfile(const Glib::ustring& filename) const
|
|||||||
|
|
||||||
DCPProfile* DCPStore::getStdProfile(const Glib::ustring& requested_cam_short_name) const
|
DCPProfile* DCPStore::getStdProfile(const Glib::ustring& requested_cam_short_name) const
|
||||||
{
|
{
|
||||||
const Glib::ustring name = requested_cam_short_name.uppercase();
|
const std::map<std::string, Glib::ustring>::const_iterator iter = file_std_profiles.find(requested_cam_short_name.casefold_collate_key());
|
||||||
|
if (iter != file_std_profiles.end()) {
|
||||||
// Warning: do NOT use map.find(), since it does not seem to work reliably here
|
return getProfile(iter->second);
|
||||||
for (const auto& file_std_profile : file_std_profiles) {
|
|
||||||
if (file_std_profile.first == name) {
|
|
||||||
return getProfile(file_std_profile.second);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// profile not found, looking if we're in loadAll=false mode
|
// profile not found, looking if we're in loadAll=false mode
|
||||||
|
|||||||
@@ -169,10 +169,10 @@ private:
|
|||||||
std::vector<Glib::ustring> profileDir;
|
std::vector<Glib::ustring> profileDir;
|
||||||
|
|
||||||
// these contain standard profiles from RT. keys are all in uppercase, file path is value
|
// these contain standard profiles from RT. keys are all in uppercase, file path is value
|
||||||
std::map<Glib::ustring, Glib::ustring> file_std_profiles;
|
std::map<std::string, Glib::ustring> file_std_profiles;
|
||||||
|
|
||||||
// Maps file name to profile as cache
|
// Maps file name to profile as cache
|
||||||
mutable std::map<Glib::ustring, DCPProfile*> profile_cache;
|
mutable std::map<std::string, DCPProfile*> profile_cache;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,10 +16,14 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
|
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <string>
|
#pragma once
|
||||||
#include <glibmm/ustring.h>
|
|
||||||
#include <map>
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include <glibmm/ustring.h>
|
||||||
|
|
||||||
#include "pixelsmap.h"
|
#include "pixelsmap.h"
|
||||||
#include "rawimage.h"
|
#include "rawimage.h"
|
||||||
|
|
||||||
|
|||||||
@@ -16,10 +16,14 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
|
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <string>
|
#pragma once
|
||||||
#include <glibmm/ustring.h>
|
|
||||||
#include <map>
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include <glibmm/ustring.h>
|
||||||
|
|
||||||
#include "rawimage.h"
|
#include "rawimage.h"
|
||||||
|
|
||||||
namespace rtengine
|
namespace rtengine
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -15,6 +15,7 @@
|
|||||||
* with ICC profiles exceeding 64K bytes in size. See iccprofile.c
|
* with ICC profiles exceeding 64K bytes in size. See iccprofile.c
|
||||||
* for details.
|
* for details.
|
||||||
*/
|
*/
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#include <cstdio> /* needed to define "FILE", "NULL" */
|
#include <cstdio> /* needed to define "FILE", "NULL" */
|
||||||
#include "jpeglib.h"
|
#include "jpeglib.h"
|
||||||
|
|||||||
@@ -195,8 +195,6 @@ public:
|
|||||||
}
|
}
|
||||||
static void inverse33(const double (*coeff)[3], double (*icoeff)[3]);
|
static void inverse33(const double (*coeff)[3], double (*icoeff)[3]);
|
||||||
|
|
||||||
void boxblur2(float** src, float** dst, float** temp, int H, int W, int box);
|
|
||||||
void boxblur_resamp(float **src, float **dst, float** temp, int H, int W, int box, int samp);
|
|
||||||
void MSR(float** luminance, float **originalLuminance, float **exLuminance, LUTf & mapcurve, bool &mapcontlutili, int width, int height, const RetinexParams &deh, const RetinextransmissionCurve & dehatransmissionCurve, const RetinexgaintransmissionCurve & dehagaintransmissionCurve, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax);
|
void MSR(float** luminance, float **originalLuminance, float **exLuminance, LUTf & mapcurve, bool &mapcontlutili, int width, int height, const RetinexParams &deh, const RetinextransmissionCurve & dehatransmissionCurve, const RetinexgaintransmissionCurve & dehagaintransmissionCurve, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax);
|
||||||
void HLRecovery_inpaint (float** red, float** green, float** blue) override;
|
void HLRecovery_inpaint (float** red, float** green, float** blue) override;
|
||||||
static void HLRecovery_Luminance (float* rin, float* gin, float* bin, float* rout, float* gout, float* bout, int width, float maxval);
|
static void HLRecovery_Luminance (float* rin, float* gin, float* bin, float* rout, float* gout, float* bout, int width, float maxval);
|
||||||
|
|||||||
Reference in New Issue
Block a user