Some more cherry-picking for 5.10 (#6937)

* Local adjustments - Show additional settings - link with complexity  (#6899)

* Change hishow -additional seeting - with complexity

* Modify windows.yml and appimage.yml

* Fixed bug in duplicate spot

* Remove pre-dev builds

* Update camconst.json white levels for 1DxII

* Fix warnings: conversion to double/float, unused variables, register keyword

* Fix crash when opening image in editor

Do not access uninitialized raw image data. The raw data is requested
when the demosaic mode is set to None and the cursor is moved over the
image in the editor. It can occur before the raw data is loaded.

* Fix sRGB working profile crash

The sRGB working profile cannot be found under some conditions because
the profile name is stored as a Glib::ustring and the same strings may
not be equal when using different locales. Use std::string whenever
comparing profile names.

---------

Co-authored-by: Desmis <jdesmis@gmail.com>
Co-authored-by: CarVac <airplaniac2002@gmail.com>
Co-authored-by: Alexander Gruzintsev <0v3rt1r3d@gmail.com>
This commit is contained in:
Lawrence37 2024-02-04 15:43:33 -08:00 committed by GitHub
parent 42817bffa4
commit e438e0e604
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 50 additions and 23 deletions

View File

@ -538,6 +538,10 @@ pkg_check_modules(LCMS REQUIRED lcms2>=2.6)
pkg_check_modules(EXPAT REQUIRED expat>=2.1)
pkg_check_modules(FFTW3F REQUIRED fftw3f)
# By default little-cms2 uses 'register' keyword which is deprecated and removed in c++17
# This definition forces not to use it
add_definitions("-DCMS_NO_REGISTER_KEYWORD")
#Set the appropriate FFTW flags on macOS
if(APPLE AND OPTION_OMP)
set(EXTRA_LIB "-L${LOCAL_PREFIX}/lib -lfftw3f_omp -lfftw3f -lm")

View File

@ -389,13 +389,18 @@ Camera constants:
"ranges": {
// black levels are read from raw masked pixels
// white levels are same for all colors all ISOs, but safety margin vary on ISO
// actually not, 160 & 320 & 640 seem to have different white levels per color
"white": [
{ "iso": 50, "levels": 16350 }, // typical for all ISOs: 16383, stdev 2.25
{ "iso": 100, "levels": 16350 }, // stdev 2.25
{ "iso": [ 125, 160, 200, 250 ], "levels": 16340 }, // stdev 2.5
{ "iso": [ 320, 400, 500 ], "levels": 16330 }, // stdev 2.95
{ "iso": [ 640, 800, 1000 ], "levels": 16320 }, // stdev x, 4.0 , x
{ "iso": [ 1250, 1600, 2000 ], "levels": 16300 }, // stdev x, 6.0 , x
{ "iso": [ 125, 200, 250 ], "levels": 16340 }, // stdev 2.5
{ "iso": 160, "levels": [ 16340, 14450, 15600 ] }, // based on CarVac's testing
{ "iso": [ 400, 500 ], "levels": 16330 }, // stdev 2.95
{ "iso": 320, "levels": [ 16330, 16000, 16330 ] }, // based on CarVac's testing
{ "iso": [ 800, 1000 ], "levels": 16320 }, // stdev x, 4.0 , x
{ "iso": 640, "levels": [ 16320, 15800, 16320 ] }, // based on CarVac's testing
{ "iso": [ 1600, 2000 ], "levels": 16300 }, // stdev x, 6.0 , x
{ "iso": 1250, "levels": [ 16300, 16050, 16300 ] }, // based on CarVac's testing
{ "iso": [ 2500, 3200, 4000 ], "levels": 16250 }, // STDEV x, 9.8 , x
{ "iso": [ 5000, 6400, 8000 ], "levels": 16150 }, // stdev x, 17, x
{ "iso": [ 10000, 12800, 16000 ], "levels": 16100 }, // stdev x, 34 , x

View File

@ -317,7 +317,6 @@ private:
typedef std::map<std::string, std::vector<badPix> > bpList_t;
dfList_t dfList;
bpList_t bpList;
bool initialized;
Glib::ustring currentPath;
dfInfo* addFileInfo(const Glib::ustring &filename, bool pool = true);
dfInfo* find(const std::string &mak, const std::string &mod, int isospeed, double shut, time_t t);

View File

@ -18,6 +18,7 @@
*/
#include <cstring>
#include <map>
#include <string>
#include <glibmm/ustring.h>
#include <glibmm/fileutils.h>
@ -51,9 +52,9 @@ namespace
// Not recursive
void loadProfiles(
const Glib::ustring& dirName,
std::map<Glib::ustring, cmsHPROFILE>* profiles,
std::map<Glib::ustring, rtengine::ProfileContent>* profileContents,
std::map<Glib::ustring, Glib::ustring>* profileNames,
std::map<std::string, cmsHPROFILE>* profiles,
std::map<std::string, rtengine::ProfileContent>* profileContents,
std::map<std::string, Glib::ustring>* profileNames,
bool nameUpper
)
{
@ -114,8 +115,8 @@ void loadProfiles(
bool loadProfile(
const Glib::ustring& profile,
const Glib::ustring& dirName,
std::map<Glib::ustring, cmsHPROFILE>* profiles,
std::map<Glib::ustring, rtengine::ProfileContent>* profileContents
std::map<std::string, cmsHPROFILE>* profiles,
std::map<std::string, rtengine::ProfileContent>* profileContents
)
{
if (dirName.empty() || profiles == nullptr) {
@ -996,10 +997,10 @@ parse_error:
return false;
}
using ProfileMap = std::map<Glib::ustring, cmsHPROFILE>;
using MatrixMap = std::map<Glib::ustring, TMatrix>;
using ContentMap = std::map<Glib::ustring, ProfileContent>;
using NameMap = std::map<Glib::ustring, Glib::ustring>;
using ProfileMap = std::map<std::string, cmsHPROFILE>;
using MatrixMap = std::map<std::string, TMatrix>;
using ContentMap = std::map<std::string, ProfileContent>;
using NameMap = std::map<std::string, Glib::ustring>;
ProfileMap wProfiles;
// ProfileMap wProfilesGamma;

View File

@ -2990,7 +2990,7 @@ LocallabParams::LocallabSpot::LocallabSpot() :
avoidrad(0.),
transitweak(1.0),
transitgrad(0.0),
hishow(false),
hishow(options.complexity != 2),
activ(true),
blwh(false),
recurs(false),

View File

@ -16,6 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#include <cassert>
#include <cmath>
#include <cstdlib>
#include <iostream>
@ -743,6 +744,8 @@ void RawImageSource::getWBMults(const ColorTemp &ctemp, const RAWParams &raw, st
void RawImageSource::getImage(const ColorTemp &ctemp, int tran, Imagefloat* image, const PreviewProps &pp, const ToneCurveParams &hrp, const RAWParams &raw)
{
assert(rawData.getHeight() == H && rawData.getWidth() == W);
MyMutex::MyLock lock(getImageMutex);
tran = defTransform(ri, tran);
@ -1744,6 +1747,8 @@ void RawImageSource::preprocess(const RAWParams &raw, const LensProfParams &lens
void RawImageSource::demosaic(const RAWParams &raw, bool autoContrast, double &contrastThreshold, bool cache)
{
assert(rawData.getHeight() == H && rawData.getWidth() == W);
MyTime t1, t2;
t1.set();
@ -3837,6 +3842,8 @@ void RawImageSource::hlRecovery(const std::string &method, float* red, float* gr
void RawImageSource::getAutoExpHistogram(LUTu & histogram, int& histcompr)
{
assert(rawData.getHeight() == H && rawData.getWidth() == W);
// BENCHFUN
histcompr = 3;
@ -5307,8 +5314,8 @@ void RawImageSource::ItcWB(bool extra, double &tempref, double &greenref, double
Glib::ustring profuse;
profuse = "JDCmax";
int limx = 0.05f;
int limy = 0.04f;
float limx = 0.05f;
float limy = 0.04f;
if (wbpar.itcwb_prim == "srgb") {
profuse = "sRGB";
@ -7480,6 +7487,8 @@ void RawImageSource::getrgbloc(int begx, int begy, int yEn, int xEn, int cx, int
void RawImageSource::getAutoWBMultipliersitc(bool extra, double & tempref, double & greenref, double & tempitc, double & greenitc, float &temp0, float &delta, int &bia, int &dread, int &kcam, int &nocam, float &studgood, float &minchrom, int &kmin, float &minhist, float &maxhist, int begx, int begy, int yEn, int xEn, int cx, int cy, int bf_h, int bf_w, double & rm, double & gm, double & bm, const WBParams & wbpar, const ColorManagementParams & cmp, const RAWParams & raw, const ToneCurveParams &hrp)
{
assert(rawData.getHeight() == H && rawData.getWidth() == W);
// BENCHFUN
constexpr double clipHigh = 64000.0;
@ -7704,6 +7713,8 @@ void RawImageSource::getAutoWBMultipliersitc(bool extra, double & tempref, doubl
void RawImageSource::getAutoWBMultipliers(double &rm, double &gm, double &bm)
{
assert(rawData.getHeight() == H && rawData.getWidth() == W);
// BENCHFUN
constexpr double clipHigh = 64000.0;
@ -7920,6 +7931,7 @@ void RawImageSource::getAutoWBMultipliers(double &rm, double &gm, double &bm)
ColorTemp RawImageSource::getSpotWB(std::vector<Coord2D> &red, std::vector<Coord2D> &green, std::vector<Coord2D> &blue, int tran, double equal, StandardObserver observer)
{
assert(rawData.getHeight() == H && rawData.getWidth() == W);
int x;
int y;
@ -8259,7 +8271,7 @@ void RawImageSource::init()
void RawImageSource::getRawValues(int x, int y, int rotate, int &R, int &G, int &B)
{
if (d1x) { // Nikon D1x has special sensor. We just skip it
if (rawData.getWidth() != W || rawData.getHeight() != H || d1x) { // Nikon D1x has special sensor. We just skip it
R = G = B = 0;
return;
}
@ -8307,6 +8319,8 @@ bool RawImageSource::isGainMapSupported() const
void RawImageSource::applyDngGainMap(const float black[4], const std::vector<GainMap> &gainMaps)
{
assert(rawData.getHeight() == H && rawData.getWidth() == W);
// now we can apply each gain map to raw_data
array2D<float> mvals[2][2];

View File

@ -393,7 +393,9 @@ Gtk::TreePath DirBrowser::expandToDir (const Glib::ustring& absDirPath)
char* dcpy = strdup (absDirPath.c_str());
char* dir = strtok (dcpy, "/\\");
#ifdef _WIN32
int count = 0;
#endif
expandSuccess = true;
#ifndef _WIN32
@ -436,8 +438,9 @@ Gtk::TreePath DirBrowser::expandToDir (const Glib::ustring& absDirPath)
++ix;
++i;
}
#ifdef _WIN32
count++;
#endif
dir = strtok(nullptr, "/\\");
}

View File

@ -24,7 +24,7 @@
#include "guiutils.h"
class EditorPanel;
class ExternalEditor;
struct ExternalEditor;
class RTWindow;
class EditWindow :

View File

@ -445,7 +445,7 @@ void FlatField::setGainMap(bool enabled) {
flatFieldFromMetaData->set_sensitive(enabled);
if (!enabled) {
idle_register.add(
[this, enabled]() -> bool
[this]() -> bool
{
disableListener();
flatFieldFromMetaData->setValue(false);

View File

@ -845,6 +845,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
r.colorde = newSpot->colorde;
r.colorscope = newSpot->colorscope;
r.avoidrad = newSpot->avoidrad;
r.hishow = newSpot->hishow;
r.activ = newSpot->activ;
r.blwh = newSpot->blwh;
r.recurs = newSpot->recurs;

View File

@ -30,7 +30,7 @@ namespace rtengine
namespace procparams
{
class ColorManagementParams;
struct ColorManagementParams;
}

View File

@ -28,7 +28,7 @@ namespace rtengine
namespace procparams
{
class ColorManagementParams;
struct ColorManagementParams;
}