diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4724c4001..6f5c168f8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,6 +13,14 @@ endif ()
string (TOUPPER ${CMAKE_BUILD_TYPE} UPPER_CMAKE_BUILD_TYPE)
+# Set required C and C++ standards and check GCC version
+SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
+SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
+
+if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9")
+ message(WARNING "RawTherapee should be built using GCC version 4.9 or higher!")
+endif()
+
# We might want to build using the old C++ ABI, even when using a new GCC version
if (USE_OLD_CXX_ABI)
add_definitions (-D_GLIBCXX_USE_CXX11_ABI=0)
@@ -89,6 +97,7 @@ option(USE_EXPERIMENTAL_LANG_VERSIONS "Build RT with -std=c++0x" OFF)
option (BUILD_SHARED "Build rawtherapee with shared libraries" OFF)
option (WITH_BZIP "Build with Bzip2 support" ON)
option (WITH_MYFILE_MMAP "Build using memory mapped file" ON)
+option (WITH_LTO "Build with link-time optimizations" OFF)
option (OPTION_OMP "Build with OpenMP support" ON)
option (PROTECT_VECTORS "Protect critical vectors by custom R/W Mutex, recommanded even if your std::vector is thread safe" ON)
option (STRICT_MUTEX "True (recommended): MyMutex will behave like POSIX Mutex; False: MyMutex will behave like POSIX RecMutex; Note: forced to ON for Debug builds" ON)
@@ -266,6 +275,12 @@ if (WITH_MYFILE_MMAP)
add_definitions (-DMYFILE_MMAP)
endif (WITH_MYFILE_MMAP)
+if (WITH_LTO)
+ SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flto")
+ SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto")
+ SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
+endif (WITH_LTO)
+
if (OPTION_OMP)
find_package(OpenMP)
if (OPENMP_FOUND)
@@ -273,11 +288,6 @@ if (OPTION_OMP)
endif (OPENMP_FOUND)
endif (OPTION_OMP)
-if(USE_EXPERIMENTAL_LANG_VERSIONS OR NOT (SIGC_VERSION VERSION_LESS 2.5.1))
- SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu1x")
- SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
-endif ()
-
# find out whether we are building out of source
get_filename_component(ABS_SOURCE_DIR "${PROJECT_SOURCE_DIR}" ABSOLUTE)
get_filename_component(ABS_BINARY_DIR "${CMAKE_BINARY_DIR}" ABSOLUTE)
diff --git a/rtdata/images/Dark/actions/intent-absolute.png b/rtdata/images/Dark/actions/intent-absolute.png
new file mode 100644
index 000000000..6d274a2c0
Binary files /dev/null and b/rtdata/images/Dark/actions/intent-absolute.png differ
diff --git a/rtdata/languages/default b/rtdata/languages/default
index 51ce3fadb..96279184b 100644
--- a/rtdata/languages/default
+++ b/rtdata/languages/default
@@ -657,17 +657,18 @@ HISTORY_MSG_423;Retinex - Gamma slope
HISTORY_MSG_424;Retinex - HL threshold
HISTORY_MSG_425;Retinex - Log base
HISTORY_MSG_426;Retinex - Hue equalizer
-HISTORY_MSG_427;Retinex - Iterations
-HISTORY_MSG_428;Retinex - T. Gradient
-HISTORY_MSG_429;Retinex - S. Gradient
-HISTORY_MSG_430;Retinex - Mask highlights
-HISTORY_MSG_431;Retinex - Mask TW highlights
-HISTORY_MSG_432;Retinex - Mask shadows
-HISTORY_MSG_433;Retinex - Mask TW shadows
-HISTORY_MSG_434;Retinex - Mask radius
-HISTORY_MSG_435;Retinex - Mask method
-HISTORY_MSG_436;Retinex - Mask curve
-HISTORY_MSG_437;Retinex - Preview
+HISTORY_MSG_427;Output rendering intent
+HISTORY_MSG_428;Retinex - Iterations
+HISTORY_MSG_429;Retinex - T. Gradient
+HISTORY_MSG_430;Retinex - S. Gradient
+HISTORY_MSG_431;Retinex - Mask highlights
+HISTORY_MSG_432;Retinex - Mask TW highlights
+HISTORY_MSG_433;Retinex - Mask shadows
+HISTORY_MSG_434;Retinex - Mask TW shadows
+HISTORY_MSG_435;Retinex - Mask radius
+HISTORY_MSG_436;Retinex - Mask method
+HISTORY_MSG_437;Retinex - Mask curve
+HISTORY_MSG_438;Retinex - Preview
HISTORY_NEWSNAPSHOT;Add
HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: Alt-s
HISTORY_SNAPSHOT;Snapshot
@@ -785,6 +786,8 @@ MAIN_TOOLTIP_SHOWHIDERP1;Show/Hide the right panel.\nShortcut: Alt-l
MAIN_TOOLTIP_SHOWHIDETP1;Show/Hide the top panel.\nShortcut: Shift-l
MAIN_TOOLTIP_THRESHOLD;Threshold
MAIN_TOOLTIP_TOGGLE;Toggle the Before/After view.\nShortcut: Shift-b
+MONITOR_SOFTPROOF;Soft-proof
+MONITOR_PROFILE_SYSTEM;System default
NAVIGATOR_B;B:
NAVIGATOR_G;G:
NAVIGATOR_H;H:
@@ -898,7 +901,7 @@ PREFERENCES_CLIPPINGIND;Clipping Indication
PREFERENCES_CLUTSCACHE;HaldCLUT Cache
PREFERENCES_CLUTSCACHE_LABEL;Maximum number of cached CLUTs
PREFERENCES_CLUTSDIR;HaldCLUT directory
-PREFERENCES_CMETRICINTENT;Colorimetric intent
+PREFERENCES_MONINTENT;Default monitor intent
PREFERENCES_CURVEBBOXPOS;Position of curve copypasta buttons
PREFERENCES_CURVEBBOXPOS_ABOVE;Above
PREFERENCES_CURVEBBOXPOS_BELOW;Below
@@ -993,7 +996,7 @@ PREFERENCES_MENUGROUPRANK;Group "Rank"
PREFERENCES_MENUOPTIONS;Context Menu Options
PREFERENCES_METADATA;Metadata
PREFERENCES_MIN;Mini (100x115)
-PREFERENCES_MONITORICC;Monitor color profile
+PREFERENCES_MONPROFILE;Default monitor profile
PREFERENCES_MULTITAB;Multiple Editor Tabs Mode
PREFERENCES_MULTITABDUALMON;Multiple Editor Tabs In Own Window Mode
PREFERENCES_NAVGUIDEBRUSH;Navigator guide color
@@ -1024,6 +1027,7 @@ PREFERENCES_PROFILEPRCACHE;Profile in cache
PREFERENCES_PROFILEPRFILE;Profile next to the input file
PREFERENCES_PROFILESAVECACHE;Save processing profile to the cache
PREFERENCES_PROFILESAVEINPUT;Save processing profile next to the input file
+PREFERENCES_PROFILE_NONE;None
PREFERENCES_PROPERTY;Property
PREFERENCES_PSPATH;Adobe Photoshop installation directory
PREFERENCES_REMEMBERZOOMPAN;Remember zoom % and pan offset
@@ -1525,6 +1529,7 @@ TP_ICM_INPUTPROFILE;Input Profile
TP_ICM_LABEL;Color Management
TP_ICM_NOICM;No ICM: sRGB Output
TP_ICM_OUTPUTPROFILE;Output Profile
+TP_ICM_PROFILEINTENT;Rendering Intent
TP_ICM_SAVEREFERENCE;Save Reference Image for Profiling
TP_ICM_SAVEREFERENCE_APPLYWB;Apply white balance
TP_ICM_SAVEREFERENCE_APPLYWB_TOOLTIP;Generally, apply the white balance when saving images to create ICC profiles, and do not apply the white balance to create DCP profiles.
diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc
index 9c41e17f9..b1260e307 100644
--- a/rtengine/dcraw.cc
+++ b/rtengine/dcraw.cc
@@ -1925,7 +1925,7 @@ void CLASS hasselblad_correct()
blur than this, but this does not need any buffer and makes nice-looking
radial gradients */
ushort *corners_weight = (ushort *)malloc(bw*bh*9*sizeof(*corners_weight));
- const char corners_mix[9][4][2] = { { {0,0}, {0,1}, {1,0}, {1,1} },
+ const int corners_mix[9][4][2] = { { {0,0}, {0,1}, {1,0}, {1,1} },
{ {0,1}, {1,1}, {-1,-1}, {-1,-1} },
{ {0,1}, {0,2}, {1,1}, {1,2} },
{ {1,0}, {1,1}, {-1,-1}, {-1,-1} },
diff --git a/rtengine/dcraw.patch b/rtengine/dcraw.patch
index 5b0a2b2ec..4451e8909 100644
--- a/rtengine/dcraw.patch
+++ b/rtengine/dcraw.patch
@@ -1,5 +1,5 @@
---- dcraw.c 2015-11-24 19:17:16 +0000
-+++ dcraw.cc 2015-11-27 12:35:05 +0000
+--- dcraw.c 2016-01-02 12:05:48 +0000
++++ dcraw.cc 2016-01-02 13:21:21 +0000
@@ -1,3 +1,15 @@
+/*RT*/#include
+/*RT*/#include
@@ -470,7 +470,7 @@
+ blur than this, but this does not need any buffer and makes nice-looking
+ radial gradients */
+ ushort *corners_weight = (ushort *)malloc(bw*bh*9*sizeof(*corners_weight));
-+ const char corners_mix[9][4][2] = { { {0,0}, {0,1}, {1,0}, {1,1} },
++ const int corners_mix[9][4][2] = { { {0,0}, {0,1}, {1,0}, {1,1} },
+ { {0,1}, {1,1}, {-1,-1}, {-1,-1} },
+ { {0,1}, {0,2}, {1,1}, {1,2} },
+ { {1,0}, {1,1}, {-1,-1}, {-1,-1} },
diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc
index 1745d8210..d12027c6d 100644
--- a/rtengine/improccoordinator.cc
+++ b/rtengine/improccoordinator.cc
@@ -31,7 +31,7 @@ extern const Settings* settings;
ImProcCoordinator::ImProcCoordinator ()
: orig_prev(NULL), oprevi(NULL), oprevl(NULL), nprevl(NULL), previmg(NULL), workimg(NULL),
- ncie(NULL), imgsrc(NULL), shmap(NULL), lastAwbEqual(0.), ipf(¶ms, true), monitorIntent(RI_RELATIVE), scale(10),
+ ncie(NULL), imgsrc(NULL), shmap(NULL), lastAwbEqual(0.), ipf(¶ms, true), monitorIntent(RI_RELATIVE), scale(10),
highDetailPreprocessComputed(false), highDetailRawComputed(false), allocated(false),
bwAutoR(-9000.f), bwAutoG(-9000.f), bwAutoB(-9000.f), CAMMean(0.),
@@ -787,6 +787,11 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
ipf.updateColorProfiles(params.icm, monitorProfile, monitorIntent);
}
+ // Update the monitor color transform if necessary
+ if (todo & M_MONITOR) {
+ ipf.updateColorProfiles(params.icm, monitorProfile, monitorIntent);
+ }
+
// process crop, if needed
for (size_t i = 0; i < crops.size(); i++)
if (crops[i]->hasListener () && cropCall != crops[i] ) {
@@ -800,7 +805,6 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
progress ("Conversion to RGB...", 100 * readyphase / numofphases);
-// if (todo != CROP && todo != MINUPDATE) {
if ((todo != CROP && todo != MINUPDATE) || (todo & M_MONITOR)) {
MyMutex::MyLock prevImgLock(previmg->getMutex());
diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc
index c3c5af03f..b1f47c3a9 100644
--- a/rtengine/improcfun.cc
+++ b/rtengine/improcfun.cc
@@ -144,7 +144,6 @@ void ImProcFunctions::firstAnalysisThread (Imagefloat* original, Glib::ustring w
void ImProcFunctions::updateColorProfiles (const ColorManagementParams& icm, const Glib::ustring& monitorProfile, RenderingIntent monitorIntent)
{
// set up monitor transform
-
if (monitorTransform != NULL) {
cmsDeleteTransform (monitorTransform);
}
diff --git a/rtengine/procevents.h b/rtengine/procevents.h
index 3c7e1ceb5..be95686be 100644
--- a/rtengine/procevents.h
+++ b/rtengine/procevents.h
@@ -454,19 +454,19 @@ enum ProcEvent {
EvLbaselog = 424,
// EvLgrbl = 425,
EvRetinexlhcurve = 425,
- EvLiter = 426,
- EvLgrad = 427,
- EvLgrads = 428,
- EvLhighlights = 429,
- EvLh_tonalwidth = 430,
- EvLshadows = 431,
- EvLs_tonalwidth = 432,
- EvLradius = 433,
- EvmapMethod = 434,
- EvRetinexmapcurve = 435,
- EvviewMethod = 436,
- EvOIntent = 437,
- EvMonitorTransform = 438,
+ EvOIntent = 426,
+ EvMonitorTransform = 427,
+ EvLiter = 428,
+ EvLgrad = 429,
+ EvLgrads = 430,
+ EvLhighlights = 431,
+ EvLh_tonalwidth = 432,
+ EvLshadows = 433,
+ EvLs_tonalwidth = 434,
+ EvLradius = 435,
+ EvmapMethod = 436,
+ EvRetinexmapcurve = 437,
+ EvviewMethod = 438,
NUMOFEVENTS
};
}
diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc
index 291dc0550..607aa1226 100644
--- a/rtengine/refreshmap.cc
+++ b/rtengine/refreshmap.cc
@@ -454,6 +454,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = {
DEMOSAIC, // EvLbaselog
// DEMOSAIC, // EvLgrbl
DEMOSAIC, // EvRetinexlhcurve
+ ALLNORAW, // EvOIntent
+ MONITORTRANSFORM, // EvMonitorTransform
RETINEX, // EvLiter
RETINEX, // EvLgrad
RETINEX, // EvLgrads
@@ -464,8 +466,6 @@ int refreshmap[rtengine::NUMOFEVENTS] = {
RETINEX, //EvLradius
RETINEX, //EvmapMethod
DEMOSAIC, //EvRetinexmapcurve
- DEMOSAIC, //EvviewMethod
- ALLNORAW, // EvOIntent
- MONITORTRANSFORM // EvMonitorTransform
+ DEMOSAIC //EvviewMethod
};
diff --git a/rtengine/settings.h b/rtengine/settings.h
index e3e220af9..3e9c9d38a 100644
--- a/rtengine/settings.h
+++ b/rtengine/settings.h
@@ -38,7 +38,7 @@ public:
int leveldnliss; // level of auto multi zone
int leveldnautsimpl; // STD or EXPERT
- Glib::ustring monitorProfile; ///< ICC profile of the monitor (full path recommended)
+ Glib::ustring monitorProfile; ///< ICC profile name used for the monitor
RenderingIntent monitorIntent; ///< Colorimetric intent used with the above profile
bool autoMonitorProfile; ///< Try to auto-determine the correct monitor color profile
bool autocielab;
diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc
index 14d827bab..9ae940980 100644
--- a/rtengine/simpleprocess.cc
+++ b/rtengine/simpleprocess.cc
@@ -1159,7 +1159,6 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p
// if(params.blackwhite.enabled) params.toneCurve.hrenabled=false;
readyImg = ipf.lab2rgb16b (labView, cx, cy, cw, ch, params.icm.output, params.icm.outputIntent, params.icm.working, params.icm.gamma, params.icm.freegamma, params.icm.gampos, params.icm.slpos, ga0, ga1, ga2, ga3, ga4, ga5, ga6, params.blackwhite.enabled );
customGamma = true;
- customGamma = true;
//or selected Free gamma
useLCMS = false;
@@ -1167,6 +1166,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p
Glib::ustring chpro, outProfile;
bool present_space[9] = {false, false, false, false, false, false, false, false, false};
std::vector opnames = iccStore->getProfiles ();
+
//test if files are in system
for (int j = 0; j < 9; j++) {
// one can modify "option" [Color Management] to adapt the profile's name if they are different for windows, MacOS, Linux ??
diff --git a/rtgui/options.cc b/rtgui/options.cc
index e6c697983..e97a27ecb 100644
--- a/rtgui/options.cc
+++ b/rtgui/options.cc
@@ -1713,6 +1713,10 @@ int Options::readFromFile (Glib::ustring fname)
fastexport_icm_output = keyFile.get_string ("Fast Export", "fastexport_icm_output" );
}
+ if (keyFile.has_key ("Fast Export", "fastexport_icm_output_intent" )) {
+ fastexport_icm_outputIntent = static_cast(keyFile.get_integer ("Fast Export", "fastexport_icm_output_intent" ));
+ }
+
if (keyFile.has_key ("Fast Export", "fastexport_icm_gamma" )) {
fastexport_icm_gamma = keyFile.get_string ("Fast Export", "fastexport_icm_gamma" );
}
diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc
index f5adf43e0..0033978c3 100644
--- a/rtgui/preferences.cc
+++ b/rtgui/preferences.cc
@@ -687,7 +687,6 @@ Gtk::Widget* Preferences::getColorManagementPanel ()
Gtk::VBox* mvbcm = Gtk::manage (new Gtk::VBox ());
mvbcm->set_border_width (4);
-
iccDir = Gtk::manage (new Gtk::FileChooserButton (M("PREFERENCES_ICCDIR"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER));
Gtk::Label* pdlabel = Gtk::manage (new Gtk::Label (M("PREFERENCES_ICCDIR") + ":", Gtk::ALIGN_LEFT));
@@ -1466,7 +1465,6 @@ void Preferences::storePreferences ()
#endif
moptions.rtSettings.iccDirectory = iccDir->get_filename ();
- //moptions.rtSettings.colorimetricIntent = intent->get_active_row_number ();
moptions.rtSettings.viewingdevice = view->get_active_row_number ();
moptions.rtSettings.viewingdevicegrey = grey->get_active_row_number ();
moptions.rtSettings.viewinggreySc = greySc->get_active_row_number ();
@@ -1576,6 +1574,7 @@ void Preferences::fillPreferences ()
panFactor->set_value (moptions.panAccelFactor);
rememberZoomPanCheckbutton->set_active (moptions.rememberZoomAndPan);
ctiffserialize->set_active(moptions.serializeTiffRead);
+
#if !defined(__APPLE__) // monitor profile not supported on apple
setActiveTextOrIndex (*monProfile, moptions.rtSettings.monitorProfile, 0);
switch (moptions.rtSettings.monitorIntent) {
@@ -1590,7 +1589,6 @@ void Preferences::fillPreferences ()
monIntent->set_active (2);
break;
}
-
#if defined(WIN32)
cbAutoMonProfile->set_active(moptions.rtSettings.autoMonitorProfile);
#endif
@@ -1959,6 +1957,7 @@ void Preferences::iccDirChanged ()
monProfile->append_text (M("PREFERENCES_PROFILE_NONE"));
monProfile->set_active (0);
+
const std::vector profiles = rtengine::ICCStore::getInstance ()->getProfilesFromDir (iccDir->get_filename ());
for (std::vector::const_iterator profile = profiles.begin (); profile != profiles.end (); ++profile)
monProfile->append_text (*profile);