merge with dev

This commit is contained in:
Desmis 2018-02-16 08:22:30 +01:00
commit 9660858976
12 changed files with 100 additions and 26 deletions

View File

@ -92,6 +92,17 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PROC_FLAGS}")
# Stop compilation on typos such as std:swap (missing colon will be detected as unused label):
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=unused-label")
# Special treatment for x87 and x86-32 SSE (see GitHub issue #4324)
include(FindX87Math)
if(HAVE_X87_MATH)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffloat-store")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffloat-store")
endif()
if(HAVE_X86_SSE_MATH)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 -mfpmath=sse")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2 -mfpmath=sse")
endif()
if(WIN32)
# Add additional paths. Look in the MinGW path first, then in the Gtkmm path.
# If you wish to build some dependent libraries, you have to install them in MinGW to use them:

View File

@ -0,0 +1,60 @@
# This file is part of RawTherapee.
#
# Copyright (C) 2018 Flössie <floessie.mail@gmail.com>
#
# RawTherapee is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# RawTherapee is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
include(CheckCXXSourceCompiles)
set(CMAKE_REQUIRED_QUIET_COPY "${CMAKE_REQUIRED_QUIET}")
set(CMAKE_REQUIRED_QUIET ON)
set(TEST_SOURCE
"
#if !defined(__i386) && !defined(_M_IX86)
#error
#endif
#if defined(__SSE2__)
#error
#endif
int main()
{
}
")
CHECK_CXX_SOURCE_COMPILES("${TEST_SOURCE}" HAVE_X87_MATH)
set(TEST_SOURCE
"
#if !defined(__i386) && !defined(_M_IX86)
#error
#endif
#if !defined(__SSE2__)
#error
#endif
int main()
{
}
")
CHECK_CXX_SOURCE_COMPILES("${TEST_SOURCE}" HAVE_X86_SSE_MATH)
unset(TEST_SOURCE)
set(CMAKE_REQUIRED_QUIET "${CMAKE_REQUIRED_QUIET_COPY}")
unset(CMAKE_REQUIRED_QUIET_COPY)

View File

@ -1270,7 +1270,7 @@ void ColorTemp::temp2mul (double temp, double green, double equal, double& rmul,
}
if (settings->verbose) {
double correl_temp;
double correl_temp = 0.0;
XYZtoCorColorTemp(Xwb, Ywb, Zwb, correl_temp);
printf("Correlated temperature (lamp)=%i\n", (int) correl_temp); //use only for lamp...otherwise It give an information!!
}

View File

@ -1880,7 +1880,7 @@ void RawImageSource::lmmse_interpolate_omp(int winw, int winh, array2D<float> &r
gamtab->makeIdentity();
}
array2D<float> (*rgb[3]);
array2D<float>* rgb[3];
rgb[0] = &red;
rgb[1] = &green;
rgb[2] = &blue;
@ -2619,7 +2619,7 @@ void RawImageSource::ahd_demosaic()
static const int dir[4] = { -1, 1, -TS, TS };
float ldiff[2][4], abdiff[2][4], leps, abeps;
float xyz[3], xyz_cam[3][4];
float (*cbrt);
float* cbrt;
float (*rgb)[TS][TS][3];
float (*lab)[TS][TS][3];
float (*lix)[3];
@ -3982,10 +3982,10 @@ void RawImageSource::rcd_demosaic()
//float V_Stat, H_Stat, P_Stat, Q_Stat;
float VH_Central_Value, VH_Neighbour_Value, PQ_Central_Value, PQ_Neighbour_Value;
*/
float ( *VH_Dir ), ( *PQ_Dir );
float *VH_Dir, *PQ_Dir;
//Low pass filter
float ( *lpf );
float *lpf;
/**

View File

@ -758,7 +758,7 @@ template<class T> void gaussVerticalSsemult (T** RESTRICT src, T** RESTRICT dst,
}
}
template<class T> void gaussVerticalSsediv (T** RESTRICT src, T** RESTRICT dst, T** divBuffer, const int W, const int H, const float sigma)
template<class T> void gaussVerticalSsediv (T** src, T** dst, T** divBuffer, const int W, const int H, const float sigma)
{
double b1, b2, b3, B, M[3][3];
calculateYvVFactors<double>(sigma, b1, b2, b3, B, M);

View File

@ -2457,7 +2457,7 @@ void ImProcFunctions::finalContAllL (float ** WavCoeffs_L, float * WavCoeffs_L0,
}
}
int choicelevel = atoi (params->wavelet.Lmethod.data()) - 1;
int choicelevel = params->wavelet.Lmethod - 1;
choicelevel = choicelevel == -1 ? 4 : choicelevel;
int choiceClevel = 0;
@ -3270,7 +3270,7 @@ void ImProcFunctions::ContAllL (float *koeLi[12], float *maxkoeLi, bool lipschit
}
// to see each level of wavelet ...level from 0 to 8
int choicelevel = atoi (params->wavelet.Lmethod.data()) - 1;
int choicelevel = params->wavelet.Lmethod - 1;
choicelevel = choicelevel == -1 ? 4 : choicelevel;
}
@ -3528,7 +3528,7 @@ void ImProcFunctions::ContAllAB (LabImage * labco, int maxlvl, float ** varhue,
}
// to see each level of wavelet ...level from 0 to 8
int choicelevel = atoi (params->wavelet.Lmethod.data()) - 1;
int choicelevel = params->wavelet.Lmethod - 1;
choicelevel = choicelevel == -1 ? 4 : choicelevel;
int choiceClevel = 0;

View File

@ -30,13 +30,8 @@
#ifdef __GNUC__
#define RESTRICT __restrict__
#if __SIZEOF_POINTER__ == 4 && __GNUC__ >= 7 // there seems to be a bug with __builtin_expect on 32bit systems when using gcc >= 7
#define LIKELY(x) (x)
#define UNLIKELY(x) (x)
#else
#define LIKELY(x) __builtin_expect (!!(x), 1)
#define UNLIKELY(x) __builtin_expect (!!(x), 0)
#endif
#define LIKELY(x) __builtin_expect (!!(x), 1)
#define UNLIKELY(x) __builtin_expect (!!(x), 0)
#define ALIGNED64 __attribute__ ((aligned (64)))
#define ALIGNED16 __attribute__ ((aligned (16)))
#else

View File

@ -2088,7 +2088,7 @@ enabled(false),
expfinal(false),
exptoning(false),
expnoise(false),
Lmethod("4_"),
Lmethod(4),
CLmethod("all"),
Backmethod("grey"),
Tilesmethod("full"),
@ -4875,7 +4875,15 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "Wavelet", "Lipst", pedited, wavelet.lipst, pedited->wavelet.lipst);
assignFromKeyfile(keyFile, "Wavelet", "AvoidColorShift", pedited, wavelet.avoid, pedited->wavelet.avoid);
assignFromKeyfile(keyFile, "Wavelet", "TMr", pedited, wavelet.tmr, pedited->wavelet.tmr);
assignFromKeyfile(keyFile, "Wavelet", "LevMethod", pedited, wavelet.Lmethod, pedited->wavelet.Lmethod);
if (ppVersion < 331) { // wavelet.Lmethod was a string before version 331
Glib::ustring temp;
assignFromKeyfile(keyFile, "Wavelet", "LevMethod", pedited, temp, pedited->wavelet.Lmethod);
if (!temp.empty()) {
wavelet.Lmethod = std::stoi(temp);
}
} else {
assignFromKeyfile(keyFile, "Wavelet", "LevMethod", pedited, wavelet.Lmethod, pedited->wavelet.Lmethod);
}
assignFromKeyfile(keyFile, "Wavelet", "ChoiceLevMethod", pedited, wavelet.CLmethod, pedited->wavelet.CLmethod);
assignFromKeyfile(keyFile, "Wavelet", "BackMethod", pedited, wavelet.Backmethod, pedited->wavelet.Backmethod);
assignFromKeyfile(keyFile, "Wavelet", "TilesMethod", pedited, wavelet.Tilesmethod, pedited->wavelet.Tilesmethod);
@ -5256,7 +5264,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "ColorToning", "LabGridALow", pedited, colorToning.labgridALow, pedited->colorToning.labgridALow);
assignFromKeyfile(keyFile, "ColorToning", "LabGridBLow", pedited, colorToning.labgridBLow, pedited->colorToning.labgridBLow);
assignFromKeyfile(keyFile, "ColorToning", "LabGridAHigh", pedited, colorToning.labgridAHigh, pedited->colorToning.labgridAHigh);
assignFromKeyfile(keyFile, "ColorToning", "LabGridBHigh", pedited, colorToning.labgridBHigh, pedited->colorToning.labgridBHigh);
assignFromKeyfile(keyFile, "ColorToning", "LabGridBHigh", pedited, colorToning.labgridBHigh, pedited->colorToning.labgridBHigh);
}
if (keyFile.has_group("RAW")) {

View File

@ -1237,7 +1237,7 @@ struct WaveletParams {
bool exptoning;
bool expnoise;
Glib::ustring Lmethod;
int Lmethod;
Glib::ustring CLmethod;
Glib::ustring Backmethod;
Glib::ustring Tilesmethod;

View File

@ -1348,7 +1348,7 @@ int RawImageSource::findHotDeadPixels( PixelsMap &bpMap, float thresh, bool find
float varthresh = (20.0 * (thresh / 100.0) + 1.0) / 24.f;
// allocate temporary buffer
float (*cfablur);
float* cfablur;
cfablur = (float (*)) malloc(H * W * sizeof * cfablur);
// counter for dead or hot pixels

View File

@ -1,11 +1,13 @@
#pragma once
// This number has to be incremented whenever the PP3 file format is modified or the behaviour of a tool changes
#define PPVERSION 330
#define PPVERSION 331
#define PPVERSION_AEXP 301 //value of PPVERSION when auto exposure algorithm was modified
/*
Log of version changes
331 2018-14-02
changed wavelet.Lmethod to int
330 2018-20-01
Added 'Auto-matched Tone Curve' button, performing histogram matching
329 2017-12-09

View File

@ -1096,7 +1096,7 @@ void Wavelet::read (const ProcParams* pp, const ParamsEdited* pedited)
Dirmethod->set_active (3);
}
int selectedLevel = atoi(pp->wavelet.Lmethod.data()) - 1;
int selectedLevel = pp->wavelet.Lmethod - 1;
Lmethod->set_active (selectedLevel == -1 ? 4 : selectedLevel);
ccshape->setCurve (pp->wavelet.ccwcurve);
@ -1735,9 +1735,7 @@ void Wavelet::write (ProcParams* pp, ParamsEdited* pedited)
pp->wavelet.Dirmethod = "all";
}
char lMethod[3]; // one additional char to avoid buffer overrun if someone increases number of levels > 9
sprintf(lMethod, "%d", Lmethod->get_active_row_number() + 1);
pp->wavelet.Lmethod = lMethod;
pp->wavelet.Lmethod = Lmethod->get_active_row_number() + 1;
}
void Wavelet::curveChanged (CurveEditor* ce)