Merge branch 'dev' into newlocallab
This commit is contained in:
commit
033d9fe02a
@ -89,6 +89,7 @@ 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")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=delete-incomplete")
|
||||
|
||||
# Special treatment for x87 and x86-32 SSE (see GitHub issue #4324)
|
||||
include(FindX87Math)
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "gauss.h"
|
||||
#include "median.h"
|
||||
#include "StopWatch.h"
|
||||
|
||||
namespace {
|
||||
|
||||
bool LinEqSolve(int nDim, double* pfMatr, double* pfVect, double* pfSolution)
|
||||
@ -106,10 +107,6 @@ bool LinEqSolve(int nDim, double* pfMatr, double* pfVect, double* pfSolution)
|
||||
//end of linear equation solver
|
||||
}
|
||||
|
||||
namespace rtengine {
|
||||
extern const Settings* settings;
|
||||
}
|
||||
|
||||
using namespace std;
|
||||
using namespace rtengine;
|
||||
|
||||
@ -198,7 +195,7 @@ float* RawImageSource::CA_correct_RT(
|
||||
|
||||
//block CA shift values and weight assigned to block
|
||||
float* const blockwt = buffer + (height * width);
|
||||
memset(blockwt, 0, vblsz * hblsz * (2 * 2 + 1) * sizeof(float));
|
||||
memset(blockwt, 0, static_cast<unsigned long>(vblsz) * hblsz * (2 * 2 + 1) * sizeof(float));
|
||||
float (*blockshifts)[2][2] = (float (*)[2][2])(blockwt + vblsz * hblsz);
|
||||
|
||||
// Because we can't break parallel processing, we need a switch do handle the errors
|
||||
|
@ -124,7 +124,6 @@ set(RTENGINESOURCEFILES
|
||||
rtthumbnail.cc
|
||||
shmap.cc
|
||||
simpleprocess.cc
|
||||
slicer.cc
|
||||
stdimagesource.cc
|
||||
tmo_fattal02.cc
|
||||
utils.cc
|
||||
|
@ -4,8 +4,7 @@
|
||||
#ifdef _OPENMP
|
||||
#include <omp.h>
|
||||
#endif
|
||||
#include "sleef.c"
|
||||
#include "opthelper.h"
|
||||
#include "sleef.h"
|
||||
|
||||
#define DIAGONALS 5
|
||||
#define DIAGONALSP1 6
|
||||
|
@ -23,25 +23,34 @@
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include <fftw3.h>
|
||||
#include "../rtgui/threadutils.h"
|
||||
#include "rtengine.h"
|
||||
#include "improcfun.h"
|
||||
#include "LUT.h"
|
||||
|
||||
#include "array2D.h"
|
||||
#include "iccmatrices.h"
|
||||
#include "boxblur.h"
|
||||
#include "rt_math.h"
|
||||
#include "mytime.h"
|
||||
#include "sleef.c"
|
||||
#include "opthelper.h"
|
||||
#include "cplx_wavelet_dec.h"
|
||||
#include "median.h"
|
||||
#include "color.h"
|
||||
#include "curves.h"
|
||||
#include "iccmatrices.h"
|
||||
#include "iccstore.h"
|
||||
#include "imagefloat.h"
|
||||
#include "improcfun.h"
|
||||
#include "labimage.h"
|
||||
#include "LUT.h"
|
||||
#include "median.h"
|
||||
#include "mytime.h"
|
||||
#include "opthelper.h"
|
||||
#include "procparams.h"
|
||||
#include "rt_math.h"
|
||||
#include "sleef.h"
|
||||
|
||||
#include "../rtgui/threadutils.h"
|
||||
#include "../rtgui/options.h"
|
||||
|
||||
#ifdef _OPENMP
|
||||
#include <omp.h>
|
||||
#endif
|
||||
|
||||
//#define BENCHMARK
|
||||
#include "StopWatch.h"
|
||||
|
||||
@ -69,11 +78,7 @@ namespace rtengine
|
||||
|
||||
*/
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
|
||||
extern const Settings* settings;
|
||||
extern MyMutex *fftwMutex;
|
||||
|
||||
|
||||
|
@ -56,21 +56,18 @@
|
||||
* LUTuc stands for LUT<unsigned char>
|
||||
*/
|
||||
|
||||
#ifndef LUT_H_
|
||||
#define LUT_H_
|
||||
#pragma once
|
||||
|
||||
#include <cstring>
|
||||
#include <cstdint>
|
||||
#include <cassert>
|
||||
|
||||
#ifndef NDEBUG
|
||||
#include <glibmm.h>
|
||||
#include <fstream>
|
||||
#endif
|
||||
|
||||
#include "opthelper.h"
|
||||
#include "rt_math.h"
|
||||
#include "noncopyable.h"
|
||||
|
||||
// Bit representations of flags
|
||||
enum {
|
||||
@ -485,26 +482,6 @@ public:
|
||||
return (p1 + p2 * diff);
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
// Debug facility ; dump the content of the LUT in a file. No control of the filename is done
|
||||
void dump(Glib::ustring fname)
|
||||
{
|
||||
if (size) {
|
||||
Glib::ustring fname_ = fname + ".xyz"; // TopSolid'Design "plot" file format
|
||||
std::ofstream f (fname_.c_str());
|
||||
f << "$" << std::endl;
|
||||
|
||||
for (unsigned int iter = 0; iter < size; iter++) {
|
||||
f << iter << ", " << data[iter] << ", 0." << std::endl;
|
||||
}
|
||||
|
||||
f << "$" << std::endl;
|
||||
f.close ();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
operator bool (void) const
|
||||
{
|
||||
return size > 0;
|
||||
@ -649,5 +626,3 @@ public:
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif /* LUT_H_ */
|
||||
|
@ -29,8 +29,12 @@
|
||||
|
||||
#include "gauss.h"
|
||||
#include "improcfun.h"
|
||||
#include "sleef.c"
|
||||
#include "../rtgui/myflatcurve.h"
|
||||
#include "cieimage.h"
|
||||
#include "color.h"
|
||||
#include "curves.h"
|
||||
#include "labimage.h"
|
||||
#include "sleef.h"
|
||||
#include "curves.h"
|
||||
#include "rt_math.h"
|
||||
#include "opthelper.h"
|
||||
#include "median.h"
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include "rtengine.h"
|
||||
#include "rawimagesource.h"
|
||||
#include "rt_math.h"
|
||||
#include "procparams.h"
|
||||
#include "../rtgui/multilangmgr.h"
|
||||
#include "median.h"
|
||||
//#define BENCHMARK
|
||||
|
@ -16,8 +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/>.
|
||||
*/
|
||||
#ifndef _ALIGNEDBUFFER_
|
||||
#define _ALIGNEDBUFFER_
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
@ -142,5 +141,3 @@ public:
|
||||
return unitSize ? allocatedSize / unitSize : 0;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -30,10 +30,9 @@
|
||||
#include "rawimagesource.h"
|
||||
#include "rt_math.h"
|
||||
#include "../rtgui/multilangmgr.h"
|
||||
#include "sleef.c"
|
||||
#include "sleef.h"
|
||||
#include "opthelper.h"
|
||||
#include "median.h"
|
||||
#include "procparams.h"
|
||||
#include "StopWatch.h"
|
||||
|
||||
namespace rtengine
|
||||
|
@ -52,8 +52,8 @@
|
||||
*
|
||||
* !! locked arrays cannot be resized and cannot be unlocked again !!
|
||||
*/
|
||||
#ifndef ARRAY2D_H_
|
||||
#define ARRAY2D_H_
|
||||
#pragma once
|
||||
|
||||
#include <csignal> // for raise()
|
||||
#include <cassert>
|
||||
|
||||
@ -249,7 +249,7 @@ public:
|
||||
ar_realloc(w, h, offset);
|
||||
|
||||
if (flags & ARRAY2D_CLEAR_DATA) {
|
||||
memset(data + offset, 0, w * h * sizeof(T));
|
||||
memset(data + offset, 0, static_cast<unsigned long>(w) * h * sizeof(T));
|
||||
}
|
||||
}
|
||||
|
||||
@ -313,4 +313,3 @@ public:
|
||||
return list[index];
|
||||
}
|
||||
};
|
||||
#endif /* array2D_H_ */
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "array2D.h"
|
||||
#include "median.h"
|
||||
#include "pixelsmap.h"
|
||||
#include "rawimage.h"
|
||||
#include "rawimagesource.h"
|
||||
|
||||
namespace rtengine
|
||||
|
@ -16,22 +16,16 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _BILATERAL2_
|
||||
#define _BILATERAL2_
|
||||
#pragma once
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
#include <cstdio>
|
||||
#include <glibmm.h>
|
||||
|
||||
#include "rtengine.h"
|
||||
#include "rt_math.h"
|
||||
#include "mytime.h"
|
||||
#include <cstring>
|
||||
|
||||
#include "array2D.h"
|
||||
#ifdef _OPENMP
|
||||
#include <omp.h>
|
||||
#endif
|
||||
#include "LUT.h"
|
||||
#include "rt_math.h"
|
||||
|
||||
using namespace rtengine;
|
||||
|
||||
@ -573,7 +567,7 @@ template<class T> void bilateral (T** src, T** dst, int W, int H, int sigmar, do
|
||||
// calculate histogram at the beginning of the row
|
||||
rhist.clear();
|
||||
|
||||
for (int x = MAX(0, row_from - r); x <= MIN(H, row_from + r); x++)
|
||||
for (int x = std::max(0, row_from - r); x <= std::min(H, row_from + r); x++)
|
||||
for (int y = 0; y < r + 1; y++) {
|
||||
rhist[((int)src[x][y]) >> TRANSBIT]++;
|
||||
}
|
||||
@ -584,12 +578,12 @@ template<class T> void bilateral (T** src, T** dst, int W, int H, int sigmar, do
|
||||
|
||||
// calculate histogram at the beginning of the row
|
||||
if (i > r)
|
||||
for (int x = 0; x <= MIN(H, r); x++) {
|
||||
for (int x = 0; x <= std::min(H, r); x++) {
|
||||
rhist[((int)src[i - r - 1][x]) >> TRANSBIT]--;
|
||||
}
|
||||
|
||||
if (i < H - r)
|
||||
for (int x = 0; x <= MIN(H, r); x++) {
|
||||
for (int x = 0; x <= std::min(H, r); x++) {
|
||||
rhist[((int)src[i + r][x]) >> TRANSBIT]++;
|
||||
}
|
||||
|
||||
@ -599,12 +593,12 @@ template<class T> void bilateral (T** src, T** dst, int W, int H, int sigmar, do
|
||||
|
||||
// subtract pixels at the left and add pixels at the right
|
||||
if (j > r)
|
||||
for (int x = MAX(0, i - r); x <= MIN(i + r, H - 1); x++) {
|
||||
for (int x = std::max(0, i - r); x <= std::min(i + r, H - 1); x++) {
|
||||
hist[(int)(src[x][j - r - 1]) >> TRANSBIT]--;
|
||||
}
|
||||
|
||||
if (j < W - r)
|
||||
for (int x = MAX(0, i - r); x <= MIN(i + r, H - 1); x++) {
|
||||
for (int x = std::max(0, i - r); x <= std::min(i + r, H - 1); x++) {
|
||||
hist[((int)src[x][j + r]) >> TRANSBIT]++;
|
||||
}
|
||||
|
||||
@ -643,5 +637,3 @@ template<class T> void bilateral (T** src, T** dst, int W, int H, int sigmar, do
|
||||
}
|
||||
#undef BINBIT
|
||||
#undef TRANSBIT
|
||||
|
||||
#endif
|
||||
|
@ -1,4 +1,3 @@
|
||||
#ifndef CALC_DISTORTION__H
|
||||
#define CALC_DISTORTION__H
|
||||
#pragma once
|
||||
|
||||
int calcDistortion (unsigned char* img1, unsigned char* img2, int ncols, int nrows, int nfactor, double &distortion);
|
||||
#endif
|
||||
|
@ -2,6 +2,9 @@
|
||||
* This file is part of RawTherapee.
|
||||
*/
|
||||
#include "camconst.h"
|
||||
#include <glibmm/fileutils.h>
|
||||
#include <glibmm/miscutils.h>
|
||||
#include <glibmm/ustring.h>
|
||||
#include "settings.h"
|
||||
#include "rt_math.h"
|
||||
#include <cstdio>
|
||||
@ -17,8 +20,6 @@
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
extern const Settings* settings;
|
||||
|
||||
CameraConst::CameraConst() : pdafOffset(0)
|
||||
{
|
||||
memset(dcraw_matrix, 0, sizeof(dcraw_matrix));
|
||||
|
@ -1,11 +1,11 @@
|
||||
/*
|
||||
* This file is part of RawTherapee.
|
||||
*/
|
||||
#ifndef __CAMCONST__
|
||||
#define __CAMCONST__
|
||||
#pragma once
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/ustring.h>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
@ -72,5 +72,3 @@ public:
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -20,18 +20,15 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "rtengine.h"
|
||||
#include "rawimage.h"
|
||||
#include "rawimagesource.h"
|
||||
#include "rt_math.h"
|
||||
#include "improcfun.h"
|
||||
#include "procparams.h"
|
||||
#include "color.h"
|
||||
#include "gauss.h"
|
||||
#include "rt_algo.h"
|
||||
//#define BENCHMARK
|
||||
#include "StopWatch.h"
|
||||
#ifdef _OPENMP
|
||||
#include <omp.h>
|
||||
#endif
|
||||
#include "opthelper.h"
|
||||
#include "../rtgui/multilangmgr.h"
|
||||
|
||||
@ -583,10 +580,10 @@ BENCHFUN
|
||||
} else {
|
||||
if (sigmaCornerOffset != 0.0) {
|
||||
const float distance = sqrt(rtengine::SQR(i + tileSize / 2 - H / 2) + rtengine::SQR(j + tileSize / 2 - W / 2));
|
||||
const float sigmaTile = sigma + distanceFactor * distance;
|
||||
const float sigmaTile = static_cast<float>(sigma) + distanceFactor * distance;
|
||||
if (sigmaTile >= 0.4f) {
|
||||
float lkernel7[7][7];
|
||||
compute7x7kernel(sigma + distanceFactor * distance, lkernel7);
|
||||
compute7x7kernel(static_cast<float>(sigma) + distanceFactor * distance, lkernel7);
|
||||
for (int k = 0; k < iterations - 1; ++k) {
|
||||
// apply 7x7 gaussian blur and divide luminance by result of gaussian blur
|
||||
gauss7x7div(tmpIThr, tmpThr, lumThr, fullTileSize, fullTileSize, lkernel7);
|
||||
@ -605,13 +602,13 @@ BENCHFUN
|
||||
// special handling for small tiles at end of row or column
|
||||
for (int k = border, ii = endOfCol ? H - fullTileSize - border : i - border; k < fullTileSize - border; ++k) {
|
||||
for (int l = border, jj = endOfRow ? W - fullTileSize - border : j - border; l < fullTileSize - border; ++l) {
|
||||
luminance[ii + k][jj + l] = rtengine::intp(blend[ii + k][jj + l], max(tmpIThr[k][l], 0.0f), luminance[ii + k][jj + l]);
|
||||
luminance[ii + k][jj + l] = rtengine::intp(blend[ii + k][jj + l], std::max(tmpIThr[k][l], 0.0f), luminance[ii + k][jj + l]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int ii = border; ii < fullTileSize - border; ++ii) {
|
||||
for (int jj = border; jj < fullTileSize - border; ++jj) {
|
||||
luminance[i + ii - border][j + jj - border] = rtengine::intp(blend[i + ii - border][j + jj - border], max(tmpIThr[ii][jj], 0.0f), luminance[i + ii - border][j + jj - border]);
|
||||
luminance[i + ii - border][j + jj - border] = rtengine::intp(blend[i + ii - border][j + jj - border], std::max(tmpIThr[ii][jj], 0.0f), luminance[i + ii - border][j + jj - border]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,6 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "rtengine.h"
|
||||
#include "rawimagesource.h"
|
||||
#include "rt_math.h"
|
||||
|
||||
@ -63,7 +62,7 @@ void RawImageSource::CLASS cfa_linedn(float noise, bool horizontal, bool vertica
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
float noisevar = SQR(3 * noise * 65535); // _noise_ (as a fraction of saturation) is input to the algorithm
|
||||
float noisevarm4 = 4.0f * noisevar;
|
||||
float* RawDataTmp = (float*)malloc( width * height * sizeof(float));
|
||||
float* RawDataTmp = (float*)malloc(static_cast<unsigned long>(width) * height * sizeof(float));
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel
|
||||
#endif
|
||||
|
@ -17,10 +17,10 @@
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "ciecam02.h"
|
||||
#include "rtengine.h"
|
||||
#include "rt_math.h"
|
||||
#include "curves.h"
|
||||
#include <math.h>
|
||||
#include "sleef.c"
|
||||
#include "sleef.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#include "settings.h"
|
||||
@ -34,10 +34,6 @@
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
#ifdef _DEBUG
|
||||
extern const Settings* settings;
|
||||
#endif
|
||||
|
||||
void Ciecam02::curvecolorfloat (float satind, float satval, float &sres, float parsat)
|
||||
{
|
||||
if (satind > 0.f) {
|
||||
|
@ -16,12 +16,19 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _CIECAM02_
|
||||
#define _CIECAM02_
|
||||
#pragma once
|
||||
|
||||
#include <cmath>
|
||||
#include "LUT.h"
|
||||
#include <cstdint>
|
||||
|
||||
#include "opthelper.h"
|
||||
|
||||
template<typename T>
|
||||
class LUT;
|
||||
|
||||
using LUTu = LUT<uint32_t>;
|
||||
using LUTf = LUT<float>;
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
@ -106,4 +113,3 @@ public:
|
||||
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include "cieimage.h"
|
||||
#include <memory.h>
|
||||
|
||||
#include <new>
|
||||
#include <cstring>
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
@ -10,7 +12,6 @@ CieImage::CieImage (int w, int h) : fromImage(false), W(w), H(h)
|
||||
M_p = new float*[H];
|
||||
C_p = new float*[H];
|
||||
sh_p = new float*[H];
|
||||
// ch_p = new float*[H];
|
||||
h_p = new float*[H];
|
||||
|
||||
// Initialize the pointers to zero
|
||||
@ -98,9 +99,6 @@ CieImage::CieImage (int w, int h) : fromImage(false), W(w), H(h)
|
||||
|
||||
++c;
|
||||
|
||||
// for (int i=0; i<H; i++)
|
||||
// ch_p[i] = data[c] + i*W;
|
||||
// ++c;
|
||||
for (int i = 0; i < H; i++) {
|
||||
h_p[i] = data[c] + i * W;
|
||||
}
|
||||
|
@ -16,10 +16,8 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _CIEIMAGE_H_
|
||||
#define _CIEIMAGE_H_
|
||||
#pragma once
|
||||
|
||||
#include "image16.h"
|
||||
#include "noncopyable.h"
|
||||
|
||||
namespace rtengine
|
||||
@ -39,7 +37,6 @@ public:
|
||||
float** M_p;
|
||||
float** C_p;
|
||||
float** sh_p;
|
||||
// float** ch_p;
|
||||
float** h_p;
|
||||
|
||||
CieImage (int w, int h);
|
||||
@ -50,4 +47,3 @@ public:
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
|
@ -1,7 +1,11 @@
|
||||
#include <algorithm>
|
||||
|
||||
#include <glibmm/fileutils.h>
|
||||
#include <glibmm/miscutils.h>
|
||||
|
||||
#include "clutstore.h"
|
||||
|
||||
#include "colortemp.h"
|
||||
#include "iccstore.h"
|
||||
#include "imagefloat.h"
|
||||
#include "opthelper.h"
|
||||
|
@ -3,8 +3,6 @@
|
||||
#include <memory>
|
||||
#include <cstdint>
|
||||
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include "cache.h"
|
||||
#include "alignedbuffer.h"
|
||||
#include "noncopyable.h"
|
||||
|
@ -20,18 +20,19 @@
|
||||
#include "rtengine.h"
|
||||
#include "color.h"
|
||||
#include "iccmatrices.h"
|
||||
#include "mytime.h"
|
||||
#include "sleef.c"
|
||||
#include "sleef.h"
|
||||
#include "opthelper.h"
|
||||
#include "iccstore.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#include "mytime.h"
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
extern const Settings* settings;
|
||||
|
||||
cmsToneCurve* Color::linearGammaTRC;
|
||||
LUTf Color::cachef;
|
||||
LUTf Color::cachefy;
|
||||
|
@ -20,14 +20,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/ustring.h>
|
||||
|
||||
#include "rt_math.h"
|
||||
#include "LUT.h"
|
||||
#include "labimage.h"
|
||||
#include "iccmatrices.h"
|
||||
#include "lcms2.h"
|
||||
#include "sleef.c"
|
||||
#include "sleef.h"
|
||||
|
||||
#define SAT(a,b,c) ((float)max(a,b,c)-(float)min(a,b,c))/(float)max(a,b,c)
|
||||
|
||||
|
@ -16,19 +16,21 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <glibmm/ustring.h>
|
||||
|
||||
#include "colortemp.h"
|
||||
#include "rtengine.h"
|
||||
#include "iccmatrices.h"
|
||||
#include "rt_math.h"
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "sleef.c"
|
||||
#include "sleef.h"
|
||||
#include "settings.h"
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
extern const Settings* settings;
|
||||
|
||||
static const double cie_colour_match_jd[97][3] = {//350nm to 830nm 5 nm J.Desmis 2° Standard Observer.
|
||||
{0.0000000, 0.000000, 0.000000}, {0.0000000, 0.000000, 0.000000}, {0.0001299, 0.0003917, 0.0006061},
|
||||
{0.0002321, 0.000006965, 0.001086}, {0.0004149, 0.00001239, 0.001946}, {0.0007416, 0.00002202, 0.003846},
|
||||
|
@ -16,8 +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/>.
|
||||
*/
|
||||
#ifndef _COLORTEMP_
|
||||
#define _COLORTEMP_
|
||||
#pragma once
|
||||
|
||||
#include <cmath>
|
||||
#include <map>
|
||||
@ -207,4 +206,3 @@ public:
|
||||
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
@ -17,8 +17,7 @@
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __COORD__
|
||||
#define __COORD__
|
||||
#pragma once
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
@ -253,5 +252,3 @@ inline const PolarCoord operator* (const double lhs, const PolarCoord& rhs)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -16,8 +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/>.
|
||||
*/
|
||||
#ifndef __COORD2D__
|
||||
#define __COORD2D__
|
||||
#pragma once
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
@ -35,5 +34,5 @@ public:
|
||||
y = y_;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
|
@ -17,9 +17,7 @@
|
||||
* 2010 Ilya Popov <ilia_popov@rambler.ru>
|
||||
* 2012 Emil Martinec <ejmartin@uchicago.edu>
|
||||
*/
|
||||
|
||||
#ifndef CPLX_WAVELET_DEC_H_INCLUDED
|
||||
#define CPLX_WAVELET_DEC_H_INCLUDED
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <cmath>
|
||||
@ -266,5 +264,3 @@ void wavelet_decomposition::reconstruct(E * dst, const float blend)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -17,7 +17,7 @@
|
||||
* 2012 Emil Martinec <ejmartin@uchicago.edu>
|
||||
* 2014 Jacques Desmis <jdesmis@gmail.com>
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
|
@ -17,10 +17,8 @@
|
||||
* 2010 Ilya Popov <ilia_popov@rambler.ru>
|
||||
* 2012 Emil Martinec <ejmartin@uchicago.edu>
|
||||
* 2014 Ingo Weyrich <heckflosse@i-weyrich.de>
|
||||
*/
|
||||
|
||||
#ifndef CPLX_WAVELET_LEVEL_H_INCLUDED
|
||||
#define CPLX_WAVELET_LEVEL_H_INCLUDED
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include "rt_math.h"
|
||||
@ -759,5 +757,3 @@ template<typename T> template<typename E> void wavelet_level<T>::reconstruct_lev
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -23,9 +23,6 @@
|
||||
#include <cstring>
|
||||
#include <glib.h>
|
||||
#include <glib/gstdio.h>
|
||||
#ifdef _OPENMP
|
||||
#include <omp.h>
|
||||
#endif
|
||||
|
||||
#include "rt_math.h"
|
||||
|
||||
@ -792,16 +789,16 @@ void CurveFactory::complexsgnCurve(bool & autili, bool & butili, bool & ccutili
|
||||
|
||||
}
|
||||
|
||||
void CurveFactory::complexCurve(double ecomp, double black, double hlcompr, double hlcomprthresh,
|
||||
double shcompr, double br, double contr,
|
||||
const std::vector<double>& curvePoints,
|
||||
const std::vector<double>& curvePoints2,
|
||||
LUTu & histogram,
|
||||
LUTf & hlCurve, LUTf & shCurve, LUTf & outCurve,
|
||||
LUTu & outBeforeCCurveHistogram,
|
||||
ToneCurve & customToneCurve1,
|
||||
ToneCurve & customToneCurve2,
|
||||
int skip)
|
||||
void CurveFactory::complexCurve (double ecomp, double black, double hlcompr, double hlcomprthresh,
|
||||
double shcompr, double br, double contr,
|
||||
const std::vector<double>& curvePoints,
|
||||
const std::vector<double>& curvePoints2,
|
||||
const LUTu & histogram,
|
||||
LUTf & hlCurve, LUTf & shCurve, LUTf & outCurve,
|
||||
LUTu & outBeforeCCurveHistogram,
|
||||
ToneCurve & customToneCurve1,
|
||||
ToneCurve & customToneCurve2,
|
||||
int skip)
|
||||
{
|
||||
|
||||
// the curve shapes are defined in sRGB gamma, but the output curves will operate on linear floating point data,
|
||||
|
@ -16,24 +16,21 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __CURVES_H__
|
||||
#define __CURVES_H__
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/ustring.h>
|
||||
|
||||
#include "rt_math.h"
|
||||
#include "../rtgui/mycurve.h"
|
||||
#include "../rtgui/myflatcurve.h"
|
||||
#include "../rtgui/mydiagonalcurve.h"
|
||||
#include "color.h"
|
||||
#include "flatcurvetypes.h"
|
||||
#include "diagonalcurvetypes.h"
|
||||
#include "pipettebuffer.h"
|
||||
|
||||
#include "LUT.h"
|
||||
|
||||
#include "sleef.h"
|
||||
#define CURVES_MIN_POLY_POINTS 1000
|
||||
|
||||
#include "rt_math.h"
|
||||
@ -356,8 +353,7 @@ public:
|
||||
public:
|
||||
static void complexCurve(double ecomp, double black, double hlcompr, double hlcomprthresh, double shcompr, double br, double contr,
|
||||
const std::vector<double>& curvePoints, const std::vector<double>& curvePoints2,
|
||||
LUTu & histogram, LUTf & hlCurve, LUTf & shCurve, LUTf & outCurve, LUTu & outBeforeCCurveHistogram, ToneCurve & outToneCurve, ToneCurve & outToneCurve2,
|
||||
|
||||
const LUTu & histogram, LUTf & hlCurve, LUTf & shCurve, LUTf & outCurve, LUTu & outBeforeCCurveHistogram, ToneCurve & outToneCurve, ToneCurve & outToneCurve2,
|
||||
int skip = 1);
|
||||
|
||||
static void complexCurvelocal(double ecomp, double black, double hlcompr, double hlcomprthresh, double shcompr, double br, double cont, double lumare,
|
||||
@ -678,7 +674,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class LocCCmaskblCurve
|
||||
{
|
||||
private:
|
||||
@ -1700,12 +1695,6 @@ public:
|
||||
float *r, float *g, float *b) const;
|
||||
};
|
||||
|
||||
class SatAndValueBlendingToneCurve : public ToneCurve
|
||||
{
|
||||
public:
|
||||
void Apply(float& r, float& g, float& b) const;
|
||||
};
|
||||
|
||||
class WeightedStdToneCurve : public ToneCurve
|
||||
{
|
||||
private:
|
||||
@ -2085,47 +2074,6 @@ inline void WeightedStdToneCurve::BatchApply(const size_t start, const size_t en
|
||||
#endif
|
||||
}
|
||||
|
||||
// Tone curve modifying the value channel only, preserving hue and saturation
|
||||
// values in 0xffff space
|
||||
inline void SatAndValueBlendingToneCurve::Apply(float& ir, float& ig, float& ib) const
|
||||
{
|
||||
|
||||
assert(lutToneCurve);
|
||||
|
||||
float r = CLIP(ir);
|
||||
float g = CLIP(ig);
|
||||
float b = CLIP(ib);
|
||||
|
||||
const float lum = (r + g + b) / 3.f;
|
||||
const float newLum = lutToneCurve[lum];
|
||||
|
||||
if (newLum == lum) {
|
||||
return;
|
||||
}
|
||||
|
||||
float h, s, v;
|
||||
Color::rgb2hsvtc(r, g, b, h, s, v);
|
||||
|
||||
float dV;
|
||||
|
||||
if (newLum > lum) {
|
||||
// Linearly targeting Value = 1 and Saturation = 0
|
||||
const float coef = (newLum - lum) / (65535.f - lum);
|
||||
dV = (1.f - v) * coef;
|
||||
s *= 1.f - coef;
|
||||
} else {
|
||||
// Linearly targeting Value = 0
|
||||
const float coef = (newLum - lum) / lum ;
|
||||
dV = v * coef;
|
||||
}
|
||||
|
||||
Color::hsv2rgbdcp(h, s, v + dV, r, g, b);
|
||||
|
||||
setUnlessOOG(ir, ig, ib, r, g, b);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#undef CLIPI
|
||||
|
||||
#endif
|
||||
|
@ -21,22 +21,22 @@
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <functional>
|
||||
#include <glib/gstdio.h>
|
||||
#include <glibmm/fileutils.h>
|
||||
#include <glibmm/miscutils.h>
|
||||
|
||||
#include "dcp.h"
|
||||
|
||||
#include "cJSON.h"
|
||||
#include "color.h"
|
||||
#include "iccmatrices.h"
|
||||
#include "iccstore.h"
|
||||
#include "improcfun.h"
|
||||
#include "imagefloat.h"
|
||||
#include "rawimagesource.h"
|
||||
#include "rt_math.h"
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
extern const Settings* settings;
|
||||
|
||||
}
|
||||
#include "utils.h"
|
||||
#include "../rtexif/rtexif.h"
|
||||
#include "../rtgui/options.h"
|
||||
|
||||
using namespace rtengine;
|
||||
using namespace rtexif;
|
||||
@ -432,7 +432,7 @@ std::map<std::string, std::string> getAliases(const Glib::ustring& profile_dir)
|
||||
|
||||
}
|
||||
|
||||
struct DCPProfile::ApplyState::Data {
|
||||
struct DCPProfileApplyState::Data {
|
||||
float pro_photo[3][3];
|
||||
float work[3][3];
|
||||
bool already_pro_photo;
|
||||
@ -441,14 +441,12 @@ struct DCPProfile::ApplyState::Data {
|
||||
float bl_scale;
|
||||
};
|
||||
|
||||
DCPProfile::ApplyState::ApplyState() :
|
||||
DCPProfileApplyState::DCPProfileApplyState() :
|
||||
data(new Data{})
|
||||
{
|
||||
}
|
||||
|
||||
DCPProfile::ApplyState::~ApplyState()
|
||||
{
|
||||
}
|
||||
DCPProfileApplyState::~DCPProfileApplyState() = default;
|
||||
|
||||
DCPProfile::DCPProfile(const Glib::ustring& filename) :
|
||||
has_color_matrix_1(false),
|
||||
@ -1148,7 +1146,7 @@ void DCPProfile::apply(
|
||||
}
|
||||
}
|
||||
|
||||
void DCPProfile::setStep2ApplyState(const Glib::ustring& working_space, bool use_tone_curve, bool apply_look_table, bool apply_baseline_exposure, ApplyState& as_out)
|
||||
void DCPProfile::setStep2ApplyState(const Glib::ustring& working_space, bool use_tone_curve, bool apply_look_table, bool apply_baseline_exposure, DCPProfileApplyState& as_out)
|
||||
{
|
||||
as_out.data->use_tone_curve = use_tone_curve;
|
||||
as_out.data->apply_look_table = apply_look_table;
|
||||
@ -1192,7 +1190,7 @@ void DCPProfile::setStep2ApplyState(const Glib::ustring& working_space, bool use
|
||||
}
|
||||
}
|
||||
|
||||
void DCPProfile::step2ApplyTile(float* rc, float* gc, float* bc, int width, int height, int tile_width, const ApplyState& as_in) const
|
||||
void DCPProfile::step2ApplyTile(float* rc, float* gc, float* bc, int width, int height, int tile_width, const DCPProfileApplyState& as_in) const
|
||||
{
|
||||
|
||||
#define FCLIP(a) ((a)>0.0?((a)<65535.5?(a):65535.5):0.0)
|
||||
@ -1868,7 +1866,7 @@ DCPProfile* DCPStore::getProfile(const Glib::ustring& filename) const
|
||||
if (res->isValid()) {
|
||||
// Add profile
|
||||
profile_cache[key] = res;
|
||||
if (options.rtSettings.verbose) {
|
||||
if (settings->verbose) {
|
||||
printf("DCP profile '%s' loaded from disk\n", filename.c_str());
|
||||
}
|
||||
return res;
|
||||
|
@ -24,35 +24,23 @@
|
||||
#include <array>
|
||||
#include <memory>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/ustring.h>
|
||||
|
||||
#include "../rtgui/threadutils.h"
|
||||
|
||||
#include "imagefloat.h"
|
||||
#include "curves.h"
|
||||
#include "colortemp.h"
|
||||
#include "noncopyable.h"
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
class ColorTemp;
|
||||
class Imagefloat;
|
||||
class DCPProfileApplyState;
|
||||
|
||||
class DCPProfile final
|
||||
{
|
||||
public:
|
||||
class ApplyState final
|
||||
{
|
||||
public:
|
||||
ApplyState();
|
||||
~ApplyState();
|
||||
|
||||
private:
|
||||
struct Data;
|
||||
|
||||
const std::unique_ptr<Data> data;
|
||||
|
||||
friend class DCPProfile;
|
||||
};
|
||||
|
||||
struct Illuminants {
|
||||
short light_source_1;
|
||||
short light_source_2;
|
||||
@ -86,8 +74,8 @@ public:
|
||||
const Matrix& cam_wb_matrix,
|
||||
bool apply_hue_sat_map = true
|
||||
) const;
|
||||
void setStep2ApplyState(const Glib::ustring& working_space, bool use_tone_curve, bool apply_look_table, bool apply_baseline_exposure, ApplyState& as_out);
|
||||
void step2ApplyTile(float* r, float* g, float* b, int width, int height, int tile_width, const ApplyState& as_in) const;
|
||||
void setStep2ApplyState(const Glib::ustring& working_space, bool use_tone_curve, bool apply_look_table, bool apply_baseline_exposure, DCPProfileApplyState& as_out);
|
||||
void step2ApplyTile(float* r, float* g, float* b, int width, int height, int tile_width, const DCPProfileApplyState& as_in) const;
|
||||
|
||||
private:
|
||||
struct HsbModify {
|
||||
@ -148,6 +136,20 @@ private:
|
||||
AdobeToneCurve tone_curve;
|
||||
};
|
||||
|
||||
class DCPProfileApplyState final
|
||||
{
|
||||
public:
|
||||
DCPProfileApplyState();
|
||||
~DCPProfileApplyState();
|
||||
|
||||
private:
|
||||
struct Data;
|
||||
|
||||
const std::unique_ptr<Data> data;
|
||||
|
||||
friend class DCPProfile;
|
||||
};
|
||||
|
||||
class DCPStore final :
|
||||
public NonCopyable
|
||||
{
|
||||
|
@ -26,12 +26,13 @@
|
||||
/*RT*/#include <omp.h>
|
||||
/*RT*/#endif
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include "opthelper.h"
|
||||
//#define BENCHMARK
|
||||
#include "StopWatch.h"
|
||||
|
||||
#include "utils.h"
|
||||
#include <zlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
@ -17,8 +17,7 @@
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef DCRAW_H
|
||||
#define DCRAW_H
|
||||
#pragma once
|
||||
|
||||
#include "myfile.h"
|
||||
#include <csetjmp>
|
||||
@ -529,6 +528,3 @@ void shiftXtransMatrix( const int offsy, const int offsx) {
|
||||
void nikon_14bit_load_raw(); // ported from LibRaw
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif //DCRAW_H
|
||||
|
@ -17,20 +17,18 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "cieimage.h"
|
||||
#include "curves.h"
|
||||
#include "dcp.h"
|
||||
#include "dcrop.h"
|
||||
#include "image8.h"
|
||||
#include "imagefloat.h"
|
||||
#include "labimage.h"
|
||||
#include "mytime.h"
|
||||
#include "procparams.h"
|
||||
#include "refreshmap.h"
|
||||
#include "rt_math.h"
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <unistd.h>
|
||||
|
||||
//#include <chrono>
|
||||
// "ceil" rounding
|
||||
//#define SKIPS(a,b) ((a) / (b) + ((a) % (b) > 0))
|
||||
#include "../rtgui/editcallbacks.h"
|
||||
|
||||
#pragma GCC diagnostic warning "-Wall"
|
||||
@ -50,8 +48,6 @@ constexpr T skips(T a, T b)
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
extern const Settings* settings;
|
||||
|
||||
Crop::Crop(ImProcCoordinator* parent, EditDataProvider *editDataProvider, bool isDetailWindow)
|
||||
: PipetteBuffer(editDataProvider), origCrop(nullptr), laboCrop(nullptr), labnCrop(nullptr), reservCrop(nullptr),
|
||||
cropImg(nullptr), shbuf_real(nullptr), transCrop(nullptr), cieCrop(nullptr), shbuffer(nullptr),
|
||||
@ -834,7 +830,7 @@ void Crop::update(int todo)
|
||||
}
|
||||
}
|
||||
double rrm, ggm, bbm;
|
||||
DCPProfile::ApplyState as;
|
||||
DCPProfileApplyState as;
|
||||
DCPProfile *dcpProf = parent->imgsrc->getDCP(params.icm, as);
|
||||
|
||||
LUTu histToneCurve;
|
||||
@ -1152,7 +1148,7 @@ void Crop::update(int todo)
|
||||
loclmasCurvecolwav.Reset();
|
||||
|
||||
if (skip <= 2) {
|
||||
usleep(settings->cropsleep); //wait to avoid crash when crop 100% and move window
|
||||
Glib::usleep(settings->cropsleep); //wait to avoid crash when crop 100% and move window
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,8 +21,6 @@
|
||||
#include "improccoordinator.h"
|
||||
#include "rtengine.h"
|
||||
#include "improcfun.h"
|
||||
#include "image8.h"
|
||||
#include "image16.h"
|
||||
#include "imagesource.h"
|
||||
#include "procevents.h"
|
||||
#include "pipettebuffer.h"
|
||||
@ -31,6 +29,8 @@
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
class Image8;
|
||||
|
||||
using namespace procparams;
|
||||
|
||||
class ImProcCoordinator;
|
||||
|
@ -22,12 +22,10 @@
|
||||
#include "rawimagesource.h"
|
||||
#include "rawimage.h"
|
||||
#include "mytime.h"
|
||||
#include "image8.h"
|
||||
#include "rt_math.h"
|
||||
#include "color.h"
|
||||
#include "../rtgui/multilangmgr.h"
|
||||
#include "procparams.h"
|
||||
#include "sleef.c"
|
||||
#include "sleef.h"
|
||||
#include "opthelper.h"
|
||||
#include "median.h"
|
||||
//#define BENCHMARK
|
||||
@ -41,8 +39,6 @@ using namespace std;
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
extern const Settings* settings;
|
||||
|
||||
#undef ABS
|
||||
|
||||
#define ABS(a) ((a)<0?-(a):(a))
|
||||
@ -78,7 +74,7 @@ void RawImageSource::ppg_demosaic()
|
||||
plistener->setProgress (0.0);
|
||||
}
|
||||
|
||||
image = (float (*)[4]) calloc (H * W, sizeof * image);
|
||||
image = (float (*)[4]) calloc (static_cast<size_t>(H) * W, sizeof * image);
|
||||
|
||||
for (int ii = 0; ii < H; ii++)
|
||||
for (int jj = 0; jj < W; jj++) {
|
||||
@ -376,9 +372,9 @@ void RawImageSource::jdl_interpolate_omp() // from "Lassus"
|
||||
int row, col, c, d, i, u = width, v = 2 * u, w = 3 * u, x = 4 * u, y = 5 * u, z = 6 * u, indx, (*dif)[2], (*chr)[2];
|
||||
float f[4], g[4];
|
||||
float (*image)[4];
|
||||
image = (float (*)[4]) calloc (width * height, sizeof * image);
|
||||
dif = (int (*)[2]) calloc(width * height, sizeof * dif);
|
||||
chr = (int (*)[2]) calloc(width * height, sizeof * chr);
|
||||
image = (float (*)[4]) calloc (static_cast<size_t>(width) * height, sizeof * image);
|
||||
dif = (int (*)[2]) calloc(static_cast<size_t>(width) * height, sizeof * dif);
|
||||
chr = (int (*)[2]) calloc(static_cast<size_t>(width) * height, sizeof * chr);
|
||||
|
||||
if (plistener) {
|
||||
// this function seems to be unused
|
||||
@ -543,14 +539,14 @@ void RawImageSource::lmmse_interpolate_omp(int winw, int winh, array2D<float> &r
|
||||
|
||||
float *rix[5];
|
||||
float *qix[5];
|
||||
float *buffer = (float *)calloc(rr1 * cc1 * 5 * sizeof(float), 1);
|
||||
float *buffer = (float *)calloc(static_cast<size_t>(rr1) * cc1 * 5 * sizeof(float), 1);
|
||||
|
||||
if(buffer == nullptr) { // allocation of big block of memory failed, try to get 5 smaller ones
|
||||
printf("lmmse_interpolate_omp: allocation of big memory block failed, try to get 5 smaller ones now...\n");
|
||||
bool allocationFailed = false;
|
||||
|
||||
for(int i = 0; i < 5; i++) {
|
||||
qix[i] = (float *)calloc(rr1 * cc1 * sizeof(float), 1);
|
||||
qix[i] = (float *)calloc(static_cast<size_t>(rr1) * cc1 * sizeof(float), 1);
|
||||
|
||||
if(!qix[i]) { // allocation of at least one small block failed
|
||||
allocationFailed = true;
|
||||
@ -1145,7 +1141,7 @@ void RawImageSource::igv_interpolate(int winw, int winh)
|
||||
vdif = (float (*)) calloc( width * height / 2, sizeof * vdif );
|
||||
hdif = (float (*)) calloc( width * height / 2, sizeof * hdif );
|
||||
|
||||
chrarray = (float (*)) calloc( width * height, sizeof( float ) );
|
||||
chrarray = (float (*)) calloc(static_cast<size_t>(width) * height, sizeof( float ) );
|
||||
chr[0] = chrarray;
|
||||
chr[1] = chrarray + (width * height) / 2;
|
||||
|
||||
@ -2040,7 +2036,7 @@ void RawImageSource::refinement_lassus(int PassCount)
|
||||
t1e.set();
|
||||
int u = W, v = 2 * u, w = 3 * u, x = 4 * u, y = 5 * u;
|
||||
float (*image)[3];
|
||||
image = (float(*)[3]) calloc(W * H, sizeof * image);
|
||||
image = (float(*)[3]) calloc(static_cast<size_t>(W) * H, sizeof * image);
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel shared(image)
|
||||
#endif
|
||||
|
@ -16,23 +16,27 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "dfmanager.h"
|
||||
#include "../rtgui/options.h"
|
||||
#include <giomm.h>
|
||||
#include "../rtgui/guiutils.h"
|
||||
#include "rawimage.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
#include <cstdio>
|
||||
#include "imagedata.h"
|
||||
#include <giomm.h>
|
||||
#include <glibmm/ustring.h>
|
||||
|
||||
#include "dfmanager.h"
|
||||
#include "../rtgui/options.h"
|
||||
#include "rawimage.h"
|
||||
#include "imagedata.h"
|
||||
#include "utils.h"
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
extern const Settings* settings;
|
||||
|
||||
// *********************** class dfInfo **************************************
|
||||
dfInfo::~dfInfo()
|
||||
{
|
||||
delete ri;
|
||||
}
|
||||
|
||||
inline dfInfo& dfInfo::operator =(const dfInfo &o)
|
||||
{
|
||||
|
@ -19,17 +19,18 @@
|
||||
#pragma once
|
||||
|
||||
#include <cmath>
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include <glibmm/ustring.h>
|
||||
|
||||
#include "pixelsmap.h"
|
||||
#include "rawimage.h"
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
class RawImage;
|
||||
class dfInfo
|
||||
{
|
||||
public:
|
||||
@ -48,13 +49,7 @@ public:
|
||||
|
||||
dfInfo( const dfInfo &o)
|
||||
: pathname(o.pathname), maker(o.maker), model(o.model), iso(o.iso), shutter(o.shutter), timestamp(o.timestamp), ri(nullptr) {}
|
||||
~dfInfo()
|
||||
{
|
||||
if( ri ) {
|
||||
delete ri;
|
||||
}
|
||||
}
|
||||
|
||||
~dfInfo();
|
||||
|
||||
dfInfo &operator =(const dfInfo &o);
|
||||
bool operator <(const dfInfo &e2) const;
|
||||
|
31
rtengine/diagonalcurvetypes.h
Normal file
31
rtengine/diagonalcurvetypes.h
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* This file is part of RawTherapee.
|
||||
*
|
||||
* Copyright (c) 2004-2019 Gabor Horvath <hgabor@rawtherapee.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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
// For compatibility and simplicity reason, order shouldn't change, and must be identical to the order specified in the curveType widget
|
||||
enum DiagonalCurveType {
|
||||
DCT_Empty = -1, // Also used for identity curves
|
||||
DCT_Linear, // 0
|
||||
DCT_Spline, // 1
|
||||
DCT_Parametric, // 2
|
||||
DCT_NURBS, // 3
|
||||
DCT_CatumullRom, // 4
|
||||
// Insert new curve type above this line
|
||||
DCT_Unchanged // Must remain the last of the enum
|
||||
};
|
@ -18,13 +18,20 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <cstddef>
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include "improcfun.h"
|
||||
#include <cstddef>
|
||||
|
||||
#include "array2D.h"
|
||||
#include "rt_math.h"
|
||||
#include "cieimage.h"
|
||||
#include "color.h"
|
||||
#include "curves.h"
|
||||
#include "improcfun.h"
|
||||
#include "LUT.h"
|
||||
#include "opthelper.h"
|
||||
#include "boxblur.h"
|
||||
#include "rt_math.h"
|
||||
#include "settings.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@ -73,8 +80,8 @@ void dirpyr_channel(const float * const * data_fine, float ** data_coarse, int w
|
||||
float val = 0.f;
|
||||
float norm = 0.f;
|
||||
|
||||
for (int inbr = max(0, i - scalewin); inbr <= min(height - 1, i + scalewin); inbr += scale) {
|
||||
for (int jnbr = max(0, j - scalewin); jnbr <= j + scalewin; jnbr += scale) {
|
||||
for (int inbr = std::max(0, i - scalewin); inbr <= std::min(height - 1, i + scalewin); inbr += scale) {
|
||||
for (int jnbr = std::max(0, j - scalewin); jnbr <= j + scalewin; jnbr += scale) {
|
||||
const float dirwt = domker[(inbr - i) / scale + halfwin][(jnbr - j)/ scale + halfwin] * rangeFn(fabsf(data_fine[inbr][jnbr] - data_fine[i][j]));
|
||||
val += dirwt * data_fine[inbr][jnbr];
|
||||
norm += dirwt;
|
||||
@ -107,7 +114,7 @@ void dirpyr_channel(const float * const * data_fine, float ** data_coarse, int w
|
||||
float val = 0.f;
|
||||
float norm = 0.f;
|
||||
|
||||
for (int inbr = max(0, i - scalewin); inbr <= min(height - 1, i + scalewin); inbr += scale) {
|
||||
for (int inbr = std::max(0, i - scalewin); inbr <= std::min(height - 1, i + scalewin); inbr += scale) {
|
||||
for (int jnbr = j - scalewin; jnbr <= j + scalewin; jnbr += scale) {
|
||||
const float dirwt = domker[(inbr - i) / scale + halfwin][(jnbr - j)/ scale + halfwin] * rangeFn(fabsf(data_fine[inbr][jnbr] - data_fine[i][j]));
|
||||
val += dirwt * data_fine[inbr][jnbr];
|
||||
@ -121,8 +128,8 @@ void dirpyr_channel(const float * const * data_fine, float ** data_coarse, int w
|
||||
float val = 0.f;
|
||||
float norm = 0.f;
|
||||
|
||||
for (int inbr = max(0, i - scalewin); inbr <= min(height - 1, i + scalewin); inbr += scale) {
|
||||
for (int jnbr = j - scalewin; jnbr <= min(width - 1, j + scalewin); jnbr += scale) {
|
||||
for (int inbr = std::max(0, i - scalewin); inbr <= std::min(height - 1, i + scalewin); inbr += scale) {
|
||||
for (int jnbr = j - scalewin; jnbr <= std::min(width - 1, j + scalewin); jnbr += scale) {
|
||||
const float dirwt = domker[(inbr - i) / scale + halfwin][(jnbr - j)/ scale + halfwin] * rangeFn(fabsf(data_fine[inbr][jnbr] - data_fine[i][j]));
|
||||
val += dirwt * data_fine[inbr][jnbr];
|
||||
norm += dirwt;
|
||||
@ -151,8 +158,8 @@ void dirpyr_channel(const float * const * data_fine, float ** data_coarse, int w
|
||||
float val = 0.f;
|
||||
float norm = 0.f;
|
||||
|
||||
for (int inbr = max(0, i - scale); inbr <= min(height - 1, i + scale); inbr += scale) {
|
||||
for (int jnbr = max(0, j - scale); jnbr <= j + scale; jnbr += scale) {
|
||||
for (int inbr = std::max(0, i - scale); inbr <= std::min(height - 1, i + scale); inbr += scale) {
|
||||
for (int jnbr = std::max(0, j - scale); jnbr <= j + scale; jnbr += scale) {
|
||||
const float dirwt = rangeFn(fabsf(data_fine[inbr][jnbr] - data_fine[i][j]));
|
||||
val += dirwt * data_fine[inbr][jnbr];
|
||||
norm += dirwt;
|
||||
@ -184,7 +191,7 @@ void dirpyr_channel(const float * const * data_fine, float ** data_coarse, int w
|
||||
float val = 0.f;
|
||||
float norm = 0.f;
|
||||
|
||||
for (int inbr = max(0, i - scale); inbr <= min(height - 1, i + scale); inbr += scale) {
|
||||
for (int inbr = std::max(0, i - scale); inbr <= std::min(height - 1, i + scale); inbr += scale) {
|
||||
for (int jnbr = j - scale; jnbr <= j + scale; jnbr += scale) {
|
||||
const float dirwt = rangeFn(fabsf(data_fine[inbr][jnbr] - data_fine[i][j]));
|
||||
val += dirwt * data_fine[inbr][jnbr];
|
||||
@ -198,8 +205,8 @@ void dirpyr_channel(const float * const * data_fine, float ** data_coarse, int w
|
||||
float val = 0.f;
|
||||
float norm = 0.f;
|
||||
|
||||
for (int inbr = max(0, i - scale); inbr <= min(height - 1, i + scale); inbr += scale) {
|
||||
for (int jnbr = j - scale; jnbr <= min(width - 1, j + scale); jnbr += scale) {
|
||||
for (int inbr = std::max(0, i - scale); inbr <= std::min(height - 1, i + scale); inbr += scale) {
|
||||
for (int jnbr = j - scale; jnbr <= std::min(width - 1, j + scale); jnbr += scale) {
|
||||
const float dirwt = rangeFn(fabsf(data_fine[inbr][jnbr] - data_fine[i][j]));
|
||||
val += dirwt * data_fine[inbr][jnbr];
|
||||
norm += dirwt;
|
||||
@ -390,8 +397,6 @@ void idirpyr_eq_channelcam(const float * const * data_coarse, const float * cons
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
extern const Settings* settings;
|
||||
|
||||
void ImProcFunctions::dirpyr_equalizer(const float * const * src, float ** dst, int srcwidth, int srcheight, const float * const * l_a, const float * const * l_b, const double * mult, const double dirpyrThreshold, const double skinprot, float b_l, float t_l, float t_r, int scaleprev)
|
||||
{
|
||||
//sequence of scales
|
||||
|
@ -23,36 +23,40 @@
|
||||
//
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "color.h"
|
||||
#include "jaggedarray.h"
|
||||
#include "rtengine.h"
|
||||
#include "rawimagesource.h"
|
||||
#include "rt_math.h"
|
||||
#include "procparams.h"
|
||||
#include "rawimagesource.h"
|
||||
#include "rt_algo.h"
|
||||
#include "rt_math.h"
|
||||
#include "rtengine.h"
|
||||
|
||||
#include "../rtgui/options.h"
|
||||
|
||||
//#define BENCHMARK
|
||||
#include "StopWatch.h"
|
||||
#include "rt_algo.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
void RawImageSource::dual_demosaic_RT(bool isBayer, const RAWParams &raw, int winw, int winh, const array2D<float> &rawData, array2D<float> &red, array2D<float> &green, array2D<float> &blue, double &contrast, bool autoContrast)
|
||||
void RawImageSource::dual_demosaic_RT(bool isBayer, const procparams::RAWParams &raw, int winw, int winh, const array2D<float> &rawData, array2D<float> &red, array2D<float> &green, array2D<float> &blue, double &contrast, bool autoContrast)
|
||||
{
|
||||
BENCHFUN
|
||||
|
||||
if (contrast == 0.f && !autoContrast) {
|
||||
// contrast == 0.0 means only first demosaicer will be used
|
||||
if(isBayer) {
|
||||
if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::AMAZEVNG4) ) {
|
||||
if (raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::AMAZEVNG4) ) {
|
||||
amaze_demosaic_RT(0, 0, winw, winh, rawData, red, green, blue, options.chunkSizeAMAZE, options.measure);
|
||||
} else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::DCBVNG4) ) {
|
||||
} else if (raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::DCBVNG4) ) {
|
||||
dcb_demosaic(raw.bayersensor.dcb_iterations, raw.bayersensor.dcb_enhance);
|
||||
} else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::RCDVNG4) ) {
|
||||
} else if (raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::RCDVNG4) ) {
|
||||
rcd_demosaic(options.chunkSizeRCD, options.measure);
|
||||
}
|
||||
} else {
|
||||
if (raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::FOUR_PASS) ) {
|
||||
if (raw.xtranssensor.method == procparams::RAWParams::XTransSensor::getMethodString(procparams::RAWParams::XTransSensor::Method::FOUR_PASS) ) {
|
||||
xtrans_interpolate (3, true, options.chunkSizeXT, options.measure);
|
||||
} else {
|
||||
xtrans_interpolate (1, false, options.chunkSizeXT, options.measure);
|
||||
@ -70,15 +74,15 @@ void RawImageSource::dual_demosaic_RT(bool isBayer, const RAWParams &raw, int wi
|
||||
if (isBayer) {
|
||||
vng4_demosaic(rawData, redTmp, greenTmp, blueTmp);
|
||||
|
||||
if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::AMAZEVNG4) || raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::PIXELSHIFT)) {
|
||||
if (raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::AMAZEVNG4) || raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::PIXELSHIFT)) {
|
||||
amaze_demosaic_RT(0, 0, winw, winh, rawData, red, green, blue, options.chunkSizeAMAZE, options.measure);
|
||||
} else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::DCBVNG4) ) {
|
||||
} else if (raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::DCBVNG4) ) {
|
||||
dcb_demosaic(raw.bayersensor.dcb_iterations, raw.bayersensor.dcb_enhance);
|
||||
} else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::RCDVNG4) ) {
|
||||
} else if (raw.bayersensor.method == procparams::RAWParams::BayerSensor::getMethodString(procparams::RAWParams::BayerSensor::Method::RCDVNG4) ) {
|
||||
rcd_demosaic(options.chunkSizeRCD, options.measure);
|
||||
}
|
||||
} else {
|
||||
if (raw.xtranssensor.method == RAWParams::XTransSensor::getMethodString(RAWParams::XTransSensor::Method::FOUR_PASS) ) {
|
||||
if (raw.xtranssensor.method == procparams::RAWParams::XTransSensor::getMethodString(procparams::RAWParams::XTransSensor::Method::FOUR_PASS) ) {
|
||||
xtrans_interpolate (3, true, options.chunkSizeXT, options.measure);
|
||||
} else {
|
||||
xtrans_interpolate (1, false, options.chunkSizeXT, options.measure);
|
||||
|
@ -17,10 +17,15 @@
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../rtengine/dynamicprofile.h"
|
||||
#include "dynamicprofile.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <glibmm/regex.h>
|
||||
#include <glibmm/miscutils.h>
|
||||
#include <glibmm/keyfile.h>
|
||||
|
||||
#include "rtengine.h"
|
||||
#include "../rtgui/options.h"
|
||||
|
||||
using namespace rtengine;
|
||||
using namespace rtengine::procparams;
|
||||
@ -176,7 +181,7 @@ bool DynamicProfileRules::loadRules()
|
||||
return false;
|
||||
}
|
||||
|
||||
if (options.rtSettings.verbose) {
|
||||
if (settings->verbose) {
|
||||
printf ("loading dynamic profiles...\n");
|
||||
}
|
||||
|
||||
@ -195,7 +200,7 @@ bool DynamicProfileRules::loadRules()
|
||||
return false;
|
||||
}
|
||||
|
||||
if (options.rtSettings.verbose) {
|
||||
if (settings->verbose) {
|
||||
printf (" loading rule %d\n", serial);
|
||||
}
|
||||
|
||||
@ -225,7 +230,7 @@ bool DynamicProfileRules::loadRules()
|
||||
|
||||
bool DynamicProfileRules::storeRules()
|
||||
{
|
||||
if (options.rtSettings.verbose) {
|
||||
if (settings->verbose) {
|
||||
printf ("saving dynamic profiles...\n");
|
||||
}
|
||||
|
||||
|
@ -16,12 +16,15 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _DYNAMICPROFILE_H_
|
||||
#define _DYNAMICPROFILE_H_
|
||||
#pragma once
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/ustring.h>
|
||||
#include <vector>
|
||||
#include "../rtgui/options.h"
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
class FramesMetaData;
|
||||
}
|
||||
|
||||
class DynamicProfileRule
|
||||
{
|
||||
@ -76,5 +79,3 @@ public:
|
||||
const std::vector<DynamicProfileRule> &getRules();
|
||||
void setRules (const std::vector<DynamicProfileRule> &r);
|
||||
};
|
||||
|
||||
#endif // _DYNAMICPROFILE_H_
|
||||
|
@ -20,14 +20,13 @@
|
||||
#include <cmath>
|
||||
|
||||
#include "color.h"
|
||||
#include "rawimage.h"
|
||||
#include "rawimagesource.h"
|
||||
#include "rawimagesource_i.h"
|
||||
#include "jaggedarray.h"
|
||||
#include "rawimage.h"
|
||||
#include "iccmatrices.h"
|
||||
#include "rt_math.h"
|
||||
#include "../rtgui/multilangmgr.h"
|
||||
#include "procparams.h"
|
||||
//#define BENCHMARK
|
||||
#include "StopWatch.h"
|
||||
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include <cmath>
|
||||
#include "rawimagesource.h"
|
||||
#include "../rtgui/multilangmgr.h"
|
||||
#include "procparams.h"
|
||||
#include "opthelper.h"
|
||||
|
||||
using namespace std;
|
||||
|
@ -16,6 +16,10 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <giomm/file.h>
|
||||
#include <glibmm/miscutils.h>
|
||||
|
||||
#include "ffmanager.h"
|
||||
#include "../rtgui/options.h"
|
||||
#include "rawimage.h"
|
||||
@ -26,8 +30,6 @@
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
extern const Settings* settings;
|
||||
|
||||
// *********************** class ffInfo **************************************
|
||||
|
||||
inline ffInfo& ffInfo::operator =(const ffInfo &o)
|
||||
@ -50,6 +52,11 @@ inline ffInfo& ffInfo::operator =(const ffInfo &o)
|
||||
return *this;
|
||||
}
|
||||
|
||||
ffInfo::~ffInfo()
|
||||
{
|
||||
delete ri;
|
||||
}
|
||||
|
||||
bool ffInfo::operator <(const ffInfo &e2) const
|
||||
{
|
||||
if( this->maker.compare( e2.maker) >= 0 ) {
|
||||
|
@ -19,16 +19,16 @@
|
||||
#pragma once
|
||||
|
||||
#include <cmath>
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include <glibmm/ustring.h>
|
||||
|
||||
#include "rawimage.h"
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
class RawImage;
|
||||
class ffInfo
|
||||
{
|
||||
public:
|
||||
@ -48,13 +48,8 @@ public:
|
||||
|
||||
ffInfo( const ffInfo &o)
|
||||
: pathname(o.pathname), maker(o.maker), model(o.model), lens(o.lens), aperture(o.aperture), focallength(o.focallength), timestamp(o.timestamp), ri(nullptr) {}
|
||||
~ffInfo()
|
||||
{
|
||||
if( ri ) {
|
||||
delete ri;
|
||||
}
|
||||
}
|
||||
|
||||
~ffInfo();
|
||||
|
||||
ffInfo &operator =(const ffInfo &o);
|
||||
bool operator <(const ffInfo &e2) const;
|
||||
|
@ -19,28 +19,19 @@
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
|
||||
#ifdef _OPENMP
|
||||
#include <omp.h>
|
||||
#endif
|
||||
|
||||
#include "rawimage.h"
|
||||
#include "rawimagesource.h"
|
||||
|
||||
#include "coord.h"
|
||||
#include "mytime.h"
|
||||
#include "opthelper.h"
|
||||
#include "procparams.h"
|
||||
#include "rt_algo.h"
|
||||
#include "rtengine.h"
|
||||
|
||||
#include "sleef.h"
|
||||
//#define BENCHMARK
|
||||
#include "StopWatch.h"
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
extern const Settings* settings;
|
||||
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
@ -98,7 +89,7 @@ bool channelsAvg(
|
||||
|
||||
}
|
||||
|
||||
bool rtengine::RawImageSource::getFilmNegativeExponents(Coord2D spotA, Coord2D spotB, int tran, const FilmNegativeParams ¤tParams, std::array<float, 3>& newExps)
|
||||
bool rtengine::RawImageSource::getFilmNegativeExponents(Coord2D spotA, Coord2D spotB, int tran, const procparams::FilmNegativeParams ¤tParams, std::array<float, 3>& newExps)
|
||||
{
|
||||
newExps = {
|
||||
static_cast<float>(currentParams.redRatio * currentParams.greenExp),
|
||||
|
@ -18,23 +18,17 @@
|
||||
*/
|
||||
#include <cmath>
|
||||
|
||||
#include "LUT.h"
|
||||
#include "rtengine.h"
|
||||
#include "rtthumbnail.h"
|
||||
#include "opthelper.h"
|
||||
#include "sleef.h"
|
||||
#include "rt_algo.h"
|
||||
#include "rtengine.h"
|
||||
#include "settings.h"
|
||||
#include "procparams.h"
|
||||
#define BENCHMARK
|
||||
#include "StopWatch.h"
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
extern const Settings* settings;
|
||||
|
||||
}
|
||||
|
||||
void rtengine::Thumbnail::processFilmNegative(
|
||||
const procparams::ProcParams ¶ms,
|
||||
const Imagefloat* baseImg,
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This file is part of RawTherapee.
|
||||
*
|
||||
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
|
||||
* Copyright (c) 2004-2019 Gabor Horvath <hgabor@rawtherapee.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
|
||||
@ -15,23 +15,15 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _ILABEL_
|
||||
#define _ILABEL_
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <gtkmm.h>
|
||||
|
||||
class ILabel : public Gtk::DrawingArea
|
||||
{
|
||||
|
||||
Glib::ustring label;
|
||||
|
||||
public:
|
||||
explicit ILabel (const Glib::ustring &lab);
|
||||
bool on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr) override;
|
||||
void on_realize() override;
|
||||
void on_style_updated () override;
|
||||
// For compatibility and simplicity reason, order shouldn't change, and must be identical to the order specified in the curveType widget
|
||||
enum FlatCurveType {
|
||||
FCT_Empty = -1, // Also used for identity curves
|
||||
FCT_Linear, // 0
|
||||
FCT_MinMaxCPoints, // 1
|
||||
//FCT_Parametric, // 2
|
||||
// Insert new curve type above this line
|
||||
FCT_Unchanged // Must remain the last of the enum
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -23,10 +23,14 @@
|
||||
* also distributed under the GPL V3+
|
||||
*/
|
||||
|
||||
#include "gamutwarning.h"
|
||||
#include <iostream>
|
||||
|
||||
namespace rtengine {
|
||||
#include "gamutwarning.h"
|
||||
#include "iccstore.h"
|
||||
#include "image8.h"
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
GamutWarning::GamutWarning(cmsHPROFILE iprof, cmsHPROFILE gamutprof, RenderingIntent intent, bool gamutbpc):
|
||||
lab2ref(nullptr),
|
||||
@ -126,5 +130,4 @@ inline void GamutWarning::mark(Image8 *image, int y, int x)
|
||||
image->b(y, x) = 255;
|
||||
}
|
||||
|
||||
|
||||
} // namespace rtengine
|
||||
|
@ -25,11 +25,14 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "iccstore.h"
|
||||
#include "noncopyable.h"
|
||||
#include "image8.h"
|
||||
#include <lcms2.h>
|
||||
|
||||
namespace rtengine {
|
||||
#include "noncopyable.h"
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
class Image8;
|
||||
|
||||
enum RenderingIntent : int;
|
||||
|
||||
|
@ -16,13 +16,10 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _GAUSS_H_
|
||||
#define _GAUSS_H_
|
||||
#pragma once
|
||||
|
||||
enum eGaussType {GAUSS_STANDARD, GAUSS_MULT, GAUSS_DIV};
|
||||
static constexpr auto GAUSS_SKIP = 0.25;
|
||||
|
||||
|
||||
void gaussianBlur(float** src, float** dst, const int W, const int H, const double sigma, bool useBoxBlur = false, eGaussType gausstype = GAUSS_STANDARD, float** buffer2 = nullptr);
|
||||
|
||||
#endif
|
@ -28,32 +28,20 @@
|
||||
* available at https://arxiv.org/abs/1505.00996
|
||||
*/
|
||||
|
||||
#include "guidedfilter.h"
|
||||
#include "boxblur.h"
|
||||
#include "sleef.c"
|
||||
#include "rescale.h"
|
||||
#include "guidedfilter.h"
|
||||
#include "imagefloat.h"
|
||||
#include "rescale.h"
|
||||
#include "sleef.h"
|
||||
|
||||
namespace rtengine {
|
||||
#define BENCHMARK
|
||||
#include "StopWatch.h"
|
||||
|
||||
#if 0
|
||||
# define DEBUG_DUMP(arr) \
|
||||
do { \
|
||||
Imagefloat im(arr.width(), arr.height()); \
|
||||
const char *out = "/tmp/" #arr ".tif"; \
|
||||
for (int y = 0; y < im.getHeight(); ++y) { \
|
||||
for (int x = 0; x < im.getWidth(); ++x) { \
|
||||
im.r(y, x) = im.g(y, x) = im.b(y, x) = arr[y][x] * 65535.f; \
|
||||
} \
|
||||
} \
|
||||
im.saveTIFF(out, 16); \
|
||||
} while (false)
|
||||
#else
|
||||
# define DEBUG_DUMP(arr)
|
||||
#endif
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
|
||||
namespace {
|
||||
namespace
|
||||
{
|
||||
|
||||
int calculate_subsampling(int w, int h, int r)
|
||||
{
|
||||
@ -76,7 +64,6 @@ int calculate_subsampling(int w, int h, int r)
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
void guidedFilter(const array2D<float> &guide, const array2D<float> &src, array2D<float> &dst, int r, float epsilon, bool multithread, int subsampling)
|
||||
{
|
||||
|
||||
@ -166,54 +153,39 @@ void guidedFilter(const array2D<float> &guide, const array2D<float> &src, array2
|
||||
f_subsample(I1, I);
|
||||
f_subsample(p1, p);
|
||||
|
||||
DEBUG_DUMP(I);
|
||||
DEBUG_DUMP(p);
|
||||
DEBUG_DUMP(I1);
|
||||
DEBUG_DUMP(p1);
|
||||
|
||||
float r1 = float(r) / subsampling;
|
||||
|
||||
array2D<float> meanI(w, h);
|
||||
f_mean(meanI, I1, r1);
|
||||
DEBUG_DUMP(meanI);
|
||||
|
||||
array2D<float> meanp(w, h);
|
||||
f_mean(meanp, p1, r1);
|
||||
DEBUG_DUMP(meanp);
|
||||
|
||||
array2D<float> &corrIp = p1;
|
||||
apply(MUL, corrIp, I1, p1);
|
||||
f_mean(corrIp, corrIp, r1);
|
||||
DEBUG_DUMP(corrIp);
|
||||
|
||||
array2D<float> &corrI = I1;
|
||||
apply(MUL, corrI, I1, I1);
|
||||
f_mean(corrI, corrI, r1);
|
||||
DEBUG_DUMP(corrI);
|
||||
|
||||
array2D<float> &varI = corrI;
|
||||
apply(SUBMUL, varI, meanI, meanI, corrI);
|
||||
DEBUG_DUMP(varI);
|
||||
|
||||
array2D<float> &covIp = corrIp;
|
||||
apply(SUBMUL, covIp, meanI, meanp, corrIp);
|
||||
DEBUG_DUMP(covIp);
|
||||
|
||||
array2D<float> &a = varI;
|
||||
apply(DIVEPSILON, a, covIp, varI);
|
||||
DEBUG_DUMP(a);
|
||||
|
||||
array2D<float> &b = covIp;
|
||||
apply(SUBMUL, b, a, meanI, meanp);
|
||||
DEBUG_DUMP(b);
|
||||
|
||||
array2D<float> &meana = a;
|
||||
f_mean(meana, a, r1);
|
||||
DEBUG_DUMP(meana);
|
||||
|
||||
array2D<float> &meanb = b;
|
||||
f_mean(meanb, b, r1);
|
||||
DEBUG_DUMP(meanb);
|
||||
|
||||
// speedup by heckflosse67
|
||||
const int Ws = meana.width();
|
||||
|
@ -22,7 +22,8 @@
|
||||
|
||||
#include "array2D.h"
|
||||
|
||||
namespace rtengine {
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
void guidedFilter(const array2D<float> &guide, const array2D<float> &src, array2D<float> &dst, int r, float epsilon, bool multithread, int subsampling=0);
|
||||
|
||||
|
@ -288,8 +288,6 @@ void boxblur_resamp(const float* const* src, float** dst, float** temp, int H, i
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
extern const Settings* settings;
|
||||
|
||||
void RawImageSource::HLRecovery_inpaint(float** red, float** green, float** blue)
|
||||
{
|
||||
double progress = 0.0;
|
||||
|
@ -18,23 +18,22 @@
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "rawimagesource.h"
|
||||
#include "rtthumbnail.h"
|
||||
#include "curves.h"
|
||||
#include "color.h"
|
||||
#include "rt_math.h"
|
||||
#include "iccstore.h"
|
||||
#include "procparams.h"
|
||||
#include "../rtgui/mydiagonalcurve.h"
|
||||
#include "improcfun.h"
|
||||
//#define BENCHMARK
|
||||
#include "StopWatch.h"
|
||||
#include <iostream>
|
||||
|
||||
#include "color.h"
|
||||
#include "curves.h"
|
||||
#include "improcfun.h"
|
||||
#include "procparams.h"
|
||||
#include "rawimagesource.h"
|
||||
#include "rt_math.h"
|
||||
#include "rtthumbnail.h"
|
||||
#include "settings.h"
|
||||
|
||||
namespace rtengine {
|
||||
//#define BENCHMARK
|
||||
#include "StopWatch.h"
|
||||
|
||||
extern const Settings *settings;
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -18,12 +18,11 @@
|
||||
*/
|
||||
#include <cmath>
|
||||
|
||||
#include "rawimage.h"
|
||||
#include "rawimagesource.h"
|
||||
#include "rawimagesource_i.h"
|
||||
#include "jaggedarray.h"
|
||||
#include "rawimage.h"
|
||||
#include "rt_math.h"
|
||||
#include "procparams.h"
|
||||
#include "../rtgui/multilangmgr.h"
|
||||
#include "opthelper.h"
|
||||
//#define BENCHMARK
|
||||
|
@ -16,8 +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/>.
|
||||
*/
|
||||
#ifndef _ICCMATRICES_
|
||||
#define _ICCMATRICES_
|
||||
#pragma once
|
||||
|
||||
// Bradford transform between illuminants
|
||||
constexpr double d65_d50[3][3] = {
|
||||
@ -296,4 +295,3 @@ constexpr double d50_best[3][3] = {
|
||||
{-0.253000840399762, 0.0215532098817316,1.22569552576991}
|
||||
};
|
||||
*/
|
||||
#endif
|
||||
|
@ -18,7 +18,9 @@
|
||||
*/
|
||||
#include <cstring>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/ustring.h>
|
||||
#include <glibmm/fileutils.h>
|
||||
#include <glibmm/miscutils.h>
|
||||
#include <glib/gstdio.h>
|
||||
|
||||
#ifdef WIN32
|
||||
@ -32,6 +34,7 @@
|
||||
#include "iccstore.h"
|
||||
|
||||
#include "iccmatrices.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "../rtgui/options.h"
|
||||
#include "../rtgui/threadutils.h"
|
||||
@ -41,12 +44,6 @@
|
||||
|
||||
#include "cJSON.h"
|
||||
#define inkc_constant 0x696E6B43
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
extern const Settings* settings;
|
||||
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -19,15 +19,14 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/ustring.h>
|
||||
|
||||
#include <lcms2.h>
|
||||
|
||||
#include "color.h"
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "color.h"
|
||||
#include "procparams.h"
|
||||
#include "rtengine.h"
|
||||
|
||||
@ -45,3 +46,7 @@ int rtengine::getCoarseBitMask( const procparams::CoarseTransformParams &coarse)
|
||||
|
||||
return tr;
|
||||
}
|
||||
|
||||
const LUTf& rtengine::getigammatab() {
|
||||
return Color::igammatab_srgb;
|
||||
}
|
||||
|
@ -16,17 +16,19 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _IIMAGE_
|
||||
#define _IIMAGE_
|
||||
#pragma once
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <vector>
|
||||
#include "rt_math.h"
|
||||
|
||||
#include <glibmm/ustring.h>
|
||||
#include <lcms2.h>
|
||||
|
||||
#include "alignedbuffer.h"
|
||||
#include "coord2d.h"
|
||||
#include "imagedimensions.h"
|
||||
#include "LUT.h"
|
||||
#include "coord2d.h"
|
||||
#include "color.h"
|
||||
#include "rt_math.h"
|
||||
|
||||
#include "../rtgui/threadutils.h"
|
||||
|
||||
#define TR_NONE 0
|
||||
@ -57,6 +59,7 @@ extern const char sImage16[];
|
||||
extern const char sImagefloat[];
|
||||
|
||||
int getCoarseBitMask(const procparams::CoarseTransformParams& coarse);
|
||||
const LUTf& getigammatab();
|
||||
|
||||
enum TypeInterpolation { TI_Nearest, TI_Bilinear };
|
||||
|
||||
@ -955,17 +958,35 @@ public:
|
||||
|
||||
histogram(65536 >> histcompr);
|
||||
histogram.clear();
|
||||
const LUTf& igammatab = getigammatab();
|
||||
|
||||
for (int i = 0; i < height; i++)
|
||||
for (int j = 0; j < width; j++) {
|
||||
float r_, g_, b_;
|
||||
convertTo<T, float>(r(i, j), r_);
|
||||
convertTo<T, float>(g(i, j), g_);
|
||||
convertTo<T, float>(b(i, j), b_);
|
||||
histogram[(int)Color::igamma_srgb (r_) >> histcompr]++;
|
||||
histogram[(int)Color::igamma_srgb (g_) >> histcompr]++;
|
||||
histogram[(int)Color::igamma_srgb (b_) >> histcompr]++;
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel
|
||||
#endif
|
||||
{
|
||||
LUTu histThr(histogram.getSize());
|
||||
histThr.clear();
|
||||
#ifdef _OPENMP
|
||||
#pragma omp for schedule(dynamic,16) nowait
|
||||
#endif
|
||||
for (int i = 0; i < height; i++) {
|
||||
for (int j = 0; j < width; j++) {
|
||||
float r_, g_, b_;
|
||||
convertTo<T, float>(r(i, j), r_);
|
||||
convertTo<T, float>(g(i, j), g_);
|
||||
convertTo<T, float>(b(i, j), b_);
|
||||
histThr[static_cast<int>(igammatab[r_]) >> histcompr]++;
|
||||
histThr[static_cast<int>(igammatab[g_]) >> histcompr]++;
|
||||
histThr[static_cast<int>(igammatab[b_]) >> histcompr]++;
|
||||
}
|
||||
}
|
||||
#ifdef _OPENMP
|
||||
#pragma omp critical
|
||||
#endif
|
||||
{
|
||||
histogram += histThr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void computeHistogramAutoWB (double &avg_r, double &avg_g, double &avg_b, int &n, LUTu &histogram, const int compression) const override
|
||||
@ -973,16 +994,16 @@ public:
|
||||
histogram.clear();
|
||||
avg_r = avg_g = avg_b = 0.;
|
||||
n = 0;
|
||||
|
||||
const LUTf& igammatab = getigammatab();
|
||||
for (unsigned int i = 0; i < (unsigned int)(height); i++)
|
||||
for (unsigned int j = 0; j < (unsigned int)(width); j++) {
|
||||
float r_, g_, b_;
|
||||
convertTo<T, float>(r(i, j), r_);
|
||||
convertTo<T, float>(g(i, j), g_);
|
||||
convertTo<T, float>(b(i, j), b_);
|
||||
int rtemp = Color::igamma_srgb (r_);
|
||||
int gtemp = Color::igamma_srgb (g_);
|
||||
int btemp = Color::igamma_srgb (b_);
|
||||
int rtemp = igammatab[r_];
|
||||
int gtemp = igammatab[g_];
|
||||
int btemp = igammatab[b_];
|
||||
|
||||
histogram[rtemp >> compression]++;
|
||||
histogram[gtemp >> compression] += 2;
|
||||
@ -1009,6 +1030,9 @@ public:
|
||||
int n = 0;
|
||||
//int p = 6;
|
||||
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel for reduction(+:avg_r,avg_g,avg_b,n) schedule(dynamic,16)
|
||||
#endif
|
||||
for (unsigned int i = 0; i < (unsigned int)(height); i++)
|
||||
for (unsigned int j = 0; j < (unsigned int)(width); j++) {
|
||||
float r_, g_, b_;
|
||||
@ -1564,17 +1588,35 @@ public:
|
||||
|
||||
histogram(65536 >> histcompr);
|
||||
histogram.clear();
|
||||
const LUTf& igammatab = getigammatab();
|
||||
|
||||
for (int i = 0; i < height; i++)
|
||||
for (int j = 0; j < width; j++) {
|
||||
float r_, g_, b_;
|
||||
convertTo<T, float>(r(i, j), r_);
|
||||
convertTo<T, float>(g(i, j), g_);
|
||||
convertTo<T, float>(b(i, j), b_);
|
||||
histogram[(int)Color::igamma_srgb (r_) >> histcompr]++;
|
||||
histogram[(int)Color::igamma_srgb (g_) >> histcompr]++;
|
||||
histogram[(int)Color::igamma_srgb (b_) >> histcompr]++;
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel
|
||||
#endif
|
||||
{
|
||||
LUTu histThr(histogram.getSize());
|
||||
histThr.clear();
|
||||
#ifdef _OPENMP
|
||||
#pragma omp for schedule(dynamic,16) nowait
|
||||
#endif
|
||||
for (int i = 0; i < height; i++) {
|
||||
for (int j = 0; j < width; j++) {
|
||||
float r_, g_, b_;
|
||||
convertTo<T, float>(r(i, j), r_);
|
||||
convertTo<T, float>(g(i, j), g_);
|
||||
convertTo<T, float>(b(i, j), b_);
|
||||
histThr[static_cast<int>(igammatab[r_]) >> histcompr]++;
|
||||
histThr[static_cast<int>(igammatab[g_]) >> histcompr]++;
|
||||
histThr[static_cast<int>(igammatab[b_]) >> histcompr]++;
|
||||
}
|
||||
}
|
||||
#ifdef _OPENMP
|
||||
#pragma omp critical
|
||||
#endif
|
||||
{
|
||||
histogram += histThr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void computeHistogramAutoWB (double &avg_r, double &avg_g, double &avg_b, int &n, LUTu &histogram, const int compression) const override
|
||||
@ -1582,6 +1624,7 @@ public:
|
||||
histogram.clear();
|
||||
avg_r = avg_g = avg_b = 0.;
|
||||
n = 0;
|
||||
const LUTf& igammatab = getigammatab();
|
||||
|
||||
for (unsigned int i = 0; i < (unsigned int)(height); i++)
|
||||
for (unsigned int j = 0; j < (unsigned int)(width); j++) {
|
||||
@ -1589,9 +1632,9 @@ public:
|
||||
convertTo<T, float>(r(i, j), r_);
|
||||
convertTo<T, float>(g(i, j), g_);
|
||||
convertTo<T, float>(b(i, j), b_);
|
||||
int rtemp = Color::igamma_srgb (r_);
|
||||
int gtemp = Color::igamma_srgb (g_);
|
||||
int btemp = Color::igamma_srgb (b_);
|
||||
int rtemp = igammatab[r_];
|
||||
int gtemp = igammatab[g_];
|
||||
int btemp = igammatab[b_];
|
||||
|
||||
histogram[rtemp >> compression]++;
|
||||
histogram[gtemp >> compression] += 2;
|
||||
@ -1618,6 +1661,9 @@ public:
|
||||
int n = 0;
|
||||
//int p = 6;
|
||||
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel for reduction(+:avg_r,avg_g,avg_b,n) schedule(dynamic,16)
|
||||
#endif
|
||||
for (unsigned int i = 0; i < (unsigned int)(height); i++)
|
||||
for (unsigned int j = 0; j < (unsigned int)(width); j++) {
|
||||
float r_, g_, b_;
|
||||
@ -1808,5 +1854,3 @@ public:
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -16,11 +16,13 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <cstdio>
|
||||
|
||||
#include "colortemp.h"
|
||||
#include "image16.h"
|
||||
#include "imagefloat.h"
|
||||
#include "image8.h"
|
||||
#include <cstdio>
|
||||
#include "rtengine.h"
|
||||
#include "rt_math.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -19,17 +19,15 @@
|
||||
//
|
||||
// A class representing a 16 bit rgb image with separate planes and 16 byte aligned data
|
||||
//
|
||||
#ifndef _IMAGE16_
|
||||
#define _IMAGE16_
|
||||
#pragma once
|
||||
|
||||
#include "imageio.h"
|
||||
#include "rtengine.h"
|
||||
#include "imagefloat.h"
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
class Image8;
|
||||
class Imagefloat;
|
||||
|
||||
class Image16 : public IImage16, public ImageIO
|
||||
{
|
||||
@ -109,4 +107,3 @@ public:
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
|
@ -18,7 +18,10 @@
|
||||
*/
|
||||
#include <cstring>
|
||||
#include <cstdio>
|
||||
|
||||
#include "colortemp.h"
|
||||
#include "image8.h"
|
||||
#include "imagefloat.h"
|
||||
#include "rtengine.h"
|
||||
|
||||
using namespace rtengine;
|
||||
|
@ -19,15 +19,13 @@
|
||||
//
|
||||
// A class representing a 8 bit rgb image without alpha channel
|
||||
//
|
||||
#ifndef _IMAGE8_
|
||||
#define _IMAGE8_
|
||||
#pragma once
|
||||
|
||||
#include "imageio.h"
|
||||
#include "rtengine.h"
|
||||
#include "imagefloat.h"
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
class Imagefloat;
|
||||
|
||||
class Image8 : public IImage8, public ImageIO
|
||||
{
|
||||
@ -104,4 +102,3 @@ public:
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
|
@ -17,15 +17,22 @@
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <functional>
|
||||
|
||||
#include <strings.h>
|
||||
#include <glib/gstdio.h>
|
||||
|
||||
#include <tiff.h>
|
||||
|
||||
#include <glib/gstdio.h>
|
||||
|
||||
#include <glibmm/convert.h>
|
||||
|
||||
#include "imagedata.h"
|
||||
#include "iptcpairs.h"
|
||||
#include "imagesource.h"
|
||||
#include "rt_math.h"
|
||||
#include "iptcpairs.h"
|
||||
#include "procparams.h"
|
||||
#include "rt_math.h"
|
||||
#include "utils.h"
|
||||
#include "../rtexif/rtexif.h"
|
||||
|
||||
#pragma GCC diagnostic warning "-Wextra"
|
||||
#define PRINT_HDR_PS_DETECTION 0
|
||||
|
@ -16,17 +16,24 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __IMAGEDATA_H__
|
||||
#define __IMAGEDATA_H__
|
||||
#pragma once
|
||||
|
||||
#include <cstdio>
|
||||
#include <memory>
|
||||
#include "rawimage.h"
|
||||
#include <string>
|
||||
#include <glibmm.h>
|
||||
#include "../rtexif/rtexif.h"
|
||||
#include <vector>
|
||||
|
||||
#include <glibmm/ustring.h>
|
||||
|
||||
#include <libiptcdata/iptc-data.h>
|
||||
#include "rtengine.h"
|
||||
|
||||
#include "imageio.h"
|
||||
|
||||
namespace rtexif
|
||||
{
|
||||
|
||||
class TagDirectory;
|
||||
}
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
@ -133,4 +140,3 @@ public:
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
|
@ -17,12 +17,14 @@
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <tiffio.h>
|
||||
|
||||
#include "colortemp.h"
|
||||
#include "imagefloat.h"
|
||||
#include "image16.h"
|
||||
#include "image8.h"
|
||||
#include "labimage.h"
|
||||
#include <cstring>
|
||||
#include "rtengine.h"
|
||||
#include "mytime.h"
|
||||
#include "iccstore.h"
|
||||
#include "alignedbuffer.h"
|
||||
#include "rt_math.h"
|
||||
|
@ -19,11 +19,9 @@
|
||||
//
|
||||
// A class representing a 16 bit rgb image with separate planes and 16 byte aligned data
|
||||
//
|
||||
#ifndef _IMAGEFLOAT_
|
||||
#define _IMAGEFLOAT_
|
||||
#pragma once
|
||||
|
||||
#include "imageio.h"
|
||||
#include "rtengine.h"
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
@ -31,6 +29,7 @@ using namespace procparams;
|
||||
|
||||
class Image8;
|
||||
class Image16;
|
||||
class LabImage;
|
||||
|
||||
/*
|
||||
* Image type used by most tools; expected range: [0.0 ; 65535.0]
|
||||
@ -227,4 +226,3 @@ public:
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
|
@ -16,8 +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/>.
|
||||
*/
|
||||
#ifndef _IMAGEFORMAT_
|
||||
#define _IMAGEFORMAT_
|
||||
#pragma once
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
@ -51,5 +50,3 @@ typedef enum SensorType {
|
||||
} eSensorType;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -27,8 +27,10 @@
|
||||
#include <libiptcdata/iptc-jpeg.h>
|
||||
#include "rt_math.h"
|
||||
#include "procparams.h"
|
||||
#include "utils.h"
|
||||
#include "../rtgui/options.h"
|
||||
#include "../rtgui/version.h"
|
||||
#include "../rtexif/rtexif.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#include <winsock2.h>
|
||||
@ -810,7 +812,7 @@ int ImageIO::loadTIFF (const Glib::ustring &fname)
|
||||
* TIFFTAG_SMAXSAMPLEVALUE, but for now, we normalize the image to the
|
||||
* effective minimum and maximum values
|
||||
*/
|
||||
if (options.rtSettings.verbose) {
|
||||
if (settings->verbose) {
|
||||
printf("Information of \"%s\":\n", fname.c_str());
|
||||
uint16 tiffDefaultScale, tiffBaselineExposure, tiffLinearResponseLimit;
|
||||
if (TIFFGetField(in, TIFFTAG_DEFAULTSCALE, &tiffDefaultScale)) {
|
||||
|
@ -16,35 +16,51 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _IMAGEIO_
|
||||
#define _IMAGEIO_
|
||||
|
||||
#define IMIO_SUCCESS 0
|
||||
#define IMIO_CANNOTREADFILE 1
|
||||
#define IMIO_INVALIDHEADER 2
|
||||
#define IMIO_HEADERERROR 3
|
||||
#define IMIO_READERROR 4
|
||||
#define IMIO_VARIANTNOTSUPPORTED 5
|
||||
#define IMIO_FILETYPENOTSUPPORTED 6
|
||||
#define IMIO_CANNOTWRITEFILE 7
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/ustring.h>
|
||||
|
||||
#include <libiptcdata/iptc-data.h>
|
||||
#include "rtengine.h"
|
||||
#include "imageformat.h"
|
||||
#include "../rtexif/rtexif.h"
|
||||
#include "imagedimensions.h"
|
||||
|
||||
#include "iimage.h"
|
||||
#include "colortemp.h"
|
||||
#include "imagedimensions.h"
|
||||
#include "imageformat.h"
|
||||
#include "rtengine.h"
|
||||
|
||||
enum {
|
||||
IMIO_SUCCESS,
|
||||
IMIO_CANNOTREADFILE,
|
||||
IMIO_INVALIDHEADER,
|
||||
IMIO_HEADERERROR,
|
||||
IMIO_READERROR,
|
||||
IMIO_VARIANTNOTSUPPORTED,
|
||||
IMIO_FILETYPENOTSUPPORTED,
|
||||
IMIO_CANNOTWRITEFILE
|
||||
};
|
||||
|
||||
namespace rtexif
|
||||
{
|
||||
|
||||
class TagDirectory;
|
||||
|
||||
}
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
class ColorTemp;
|
||||
class ProgressListener;
|
||||
class Imagefloat;
|
||||
|
||||
namespace procparams
|
||||
{
|
||||
|
||||
class ExifPairs;
|
||||
|
||||
}
|
||||
|
||||
class ImageIO : virtual public ImageDatas
|
||||
{
|
||||
|
||||
@ -111,4 +127,3 @@ public:
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
|
@ -21,21 +21,31 @@
|
||||
#include <array>
|
||||
#include <vector>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/ustring.h>
|
||||
|
||||
#include "colortemp.h"
|
||||
#include "coord2d.h"
|
||||
#include "dcp.h"
|
||||
#include "image16.h"
|
||||
#include "image8.h"
|
||||
#include "imagedata.h"
|
||||
#include "imagefloat.h"
|
||||
#include "LUT.h"
|
||||
#include "rtengine.h"
|
||||
|
||||
template<typename T>
|
||||
class LUT;
|
||||
|
||||
using LUTf = LUT<float>;
|
||||
|
||||
template<typename T, const size_t num>
|
||||
class multi_array2D;
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
class ColorTemp;
|
||||
class DCPProfile;
|
||||
class DCPProfileApplyState;
|
||||
class Imagefloat;
|
||||
class RetinexgaintransmissionCurve;
|
||||
class RetinextransmissionCurve;
|
||||
|
||||
namespace procparams
|
||||
{
|
||||
|
||||
@ -47,7 +57,7 @@ struct RAWParams;
|
||||
struct RetinexParams;
|
||||
struct ToneCurveParams;
|
||||
struct CaptureSharpeningParams;
|
||||
}
|
||||
};
|
||||
|
||||
class ImageMatrices
|
||||
{
|
||||
@ -82,7 +92,7 @@ public:
|
||||
virtual int load (const Glib::ustring &fname) = 0;
|
||||
virtual void preprocess (const procparams::RAWParams &raw, const procparams::LensProfParams &lensProf, const procparams::CoarseTransformParams& coarse, bool prepareDenoise = true) {};
|
||||
virtual void filmNegativeProcess (const procparams::FilmNegativeParams ¶ms) {};
|
||||
virtual bool getFilmNegativeExponents (Coord2D spotA, Coord2D spotB, int tran, const FilmNegativeParams& currentParams, std::array<float, 3>& newExps) { return false; };
|
||||
virtual bool getFilmNegativeExponents (Coord2D spotA, Coord2D spotB, int tran, const procparams::FilmNegativeParams& currentParams, std::array<float, 3>& newExps) { return false; };
|
||||
virtual void demosaic (const procparams::RAWParams &raw, bool autoContrast, double &contrastThreshold, bool cache = false) {};
|
||||
virtual void retinex (const procparams::ColorManagementParams& cmp, const procparams::RetinexParams &deh, const procparams::ToneCurveParams& Tc, LUTf & cdcurve, LUTf & mapcurve, const RetinextransmissionCurve & dehatransmissionCurve, const RetinexgaintransmissionCurve & dehagaintransmissionCurve, multi_array2D<float, 4> &conversionBuffer, bool dehacontlutili, bool mapcontlutili, bool useHsl, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax, LUTu &histLRETI) {};
|
||||
virtual void retinexPrepareCurves (const procparams::RetinexParams &retinexParams, LUTf &cdcurve, LUTf &mapcurve, RetinextransmissionCurve &retinextransmissionCurve, RetinexgaintransmissionCurve &retinexgaintransmissionCurve, bool &retinexcontlutili, bool &mapcontlutili, bool &useHsl, LUTu & lhist16RETI, LUTu & histLRETI) {};
|
||||
@ -101,13 +111,13 @@ public:
|
||||
|
||||
|
||||
// use right after demosaicing image, add coarse transformation and put the result in the provided Imagefloat*
|
||||
virtual void getImage (const ColorTemp &ctemp, int tran, Imagefloat* image, const PreviewProps &pp, const procparams::ToneCurveParams &hlp, const RAWParams &raw) = 0;
|
||||
virtual void getImage (const ColorTemp &ctemp, int tran, Imagefloat* image, const PreviewProps &pp, const procparams::ToneCurveParams &hlp, const procparams::RAWParams &raw) = 0;
|
||||
virtual eSensorType getSensorType () const = 0;
|
||||
virtual bool isMono () const = 0;
|
||||
// true is ready to provide the AutoWB, i.e. when the image has been demosaiced for RawImageSource
|
||||
virtual bool isWBProviderReady () = 0;
|
||||
|
||||
virtual void convertColorSpace (Imagefloat* image, const ColorManagementParams &cmp, const ColorTemp &wb) = 0; // DIRTY HACK: this method is derived in rawimagesource and strimagesource, but (...,RAWParams raw) will be used ONLY for raw images
|
||||
virtual void convertColorSpace (Imagefloat* image, const procparams::ColorManagementParams &cmp, const ColorTemp &wb) = 0; // DIRTY HACK: this method is derived in rawimagesource and strimagesource, but (...,RAWParams raw) will be used ONLY for raw images
|
||||
virtual void getAutoWBMultipliers (double &rm, double &gm, double &bm) = 0;
|
||||
virtual ColorTemp getWB () const = 0;
|
||||
virtual ColorTemp getSpotWB (std::vector<Coord2D> &red, std::vector<Coord2D> &green, std::vector<Coord2D> &blue, int tran, double equal) = 0;
|
||||
@ -126,7 +136,7 @@ public:
|
||||
|
||||
virtual ImageMatrices* getImageMatrices () = 0;
|
||||
virtual bool isRAW () const = 0;
|
||||
virtual DCPProfile* getDCP (const procparams::ColorManagementParams &cmp, DCPProfile::ApplyState &as)
|
||||
virtual DCPProfile* getDCP (const procparams::ColorManagementParams &cmp, DCPProfileApplyState &as)
|
||||
{
|
||||
return nullptr;
|
||||
};
|
||||
|
@ -16,33 +16,39 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "improccoordinator.h"
|
||||
#include "curves.h"
|
||||
#include "mytime.h"
|
||||
#include "refreshmap.h"
|
||||
#include "../rtgui/ppversion.h"
|
||||
#include "colortemp.h"
|
||||
#include "improcfun.h"
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <unistd.h>
|
||||
#include "jaggedarray.h"
|
||||
#include <glibmm/thread.h>
|
||||
|
||||
#include "iccstore.h"
|
||||
#include "procparams.h"
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include "improccoordinator.h"
|
||||
|
||||
#include "cieimage.h"
|
||||
#include "color.h"
|
||||
#include "colortemp.h"
|
||||
#include "jaggedarray.h"
|
||||
#include "curves.h"
|
||||
#include "dcp.h"
|
||||
#include "iccstore.h"
|
||||
#include "image8.h"
|
||||
#include "imagefloat.h"
|
||||
#include "improcfun.h"
|
||||
#include "labimage.h"
|
||||
#include "lcp.h"
|
||||
#include "procparams.h"
|
||||
#include "refreshmap.h"
|
||||
|
||||
#include "../rtgui/options.h"
|
||||
#include "../rtgui/ppversion.h"
|
||||
|
||||
#ifdef _OPENMP
|
||||
#include <omp.h>
|
||||
#endif
|
||||
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
extern const Settings* settings;
|
||||
|
||||
ImProcCoordinator::ImProcCoordinator() :
|
||||
orig_prev(nullptr),
|
||||
oprevi(nullptr),
|
||||
@ -814,7 +820,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
||||
double ggm = 33.;
|
||||
double bbm = 33.;
|
||||
|
||||
DCPProfile::ApplyState as;
|
||||
DCPProfileApplyState as;
|
||||
DCPProfile *dcpProf = imgsrc->getDCP(params->icm, as);
|
||||
|
||||
ipf.rgbProc (oprevi, oprevl, nullptr, hltonecurve, shtonecurve, tonecurve, params->toneCurve.saturation,
|
||||
|
@ -16,21 +16,27 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _IMPROCCOORDINATOR_H_
|
||||
#define _IMPROCCOORDINATOR_H_
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "rtengine.h"
|
||||
#include "improcfun.h"
|
||||
#include "image8.h"
|
||||
#include "image16.h"
|
||||
#include "imagesource.h"
|
||||
#include "procevents.h"
|
||||
#include "array2D.h"
|
||||
#include "colortemp.h"
|
||||
#include "curves.h"
|
||||
#include "dcrop.h"
|
||||
#include "imagesource.h"
|
||||
#include "improcfun.h"
|
||||
#include "LUT.h"
|
||||
#include "procevents.h"
|
||||
#include "rtengine.h"
|
||||
|
||||
#include "../rtgui/threadutils.h"
|
||||
|
||||
namespace Glib
|
||||
{
|
||||
class Thread;
|
||||
}
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
@ -538,5 +544,5 @@ public:
|
||||
} denoiseInfoStore;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
|
@ -18,16 +18,18 @@
|
||||
*/
|
||||
#include <cmath>
|
||||
#include <glib.h>
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/ustring.h>
|
||||
#ifdef _OPENMP
|
||||
#include <omp.h>
|
||||
#endif
|
||||
|
||||
#include "alignedbuffer.h"
|
||||
#include "cieimage.h"
|
||||
#include "labimage.h"
|
||||
#include "rtengine.h"
|
||||
#include "improcfun.h"
|
||||
#include "curves.h"
|
||||
#include "mytime.h"
|
||||
#include "dcp.h"
|
||||
#include "iccstore.h"
|
||||
#include "imagesource.h"
|
||||
#include "rtthumbnail.h"
|
||||
@ -40,12 +42,16 @@
|
||||
#include "improccoordinator.h"
|
||||
#include "clutstore.h"
|
||||
#include "ciecam02.h"
|
||||
#include "satandvalueblendingcurve.h"
|
||||
#include "StopWatch.h"
|
||||
#include "procparams.h"
|
||||
#include "../rtgui/ppversion.h"
|
||||
#include "../rtgui/guiutils.h"
|
||||
#include "../rtgui/editcallbacks.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#include "mytime.h"
|
||||
#endif
|
||||
|
||||
#undef CLIPD
|
||||
#define CLIPD(a) ((a)>0.0f?((a)<1.0f?(a):1.0f):0.0f)
|
||||
|
||||
@ -273,10 +279,7 @@ namespace rtengine
|
||||
|
||||
using namespace procparams;
|
||||
|
||||
extern const Settings* settings;
|
||||
|
||||
|
||||
ImProcFunctions::~ImProcFunctions()
|
||||
ImProcFunctions::~ImProcFunctions ()
|
||||
{
|
||||
if (monitorTransform) {
|
||||
cmsDeleteTransform(monitorTransform);
|
||||
@ -2065,25 +2068,17 @@ filmlike_clip(float *r, float *g, float *b)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve,
|
||||
int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clToningcurve, LUTf & cl2Toningcurve,
|
||||
const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2, const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, DCPProfile *dcpProf, const DCPProfile::ApplyState &asIn, LUTu &histToneCurve, size_t chunkSize, bool measure)
|
||||
void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve,
|
||||
int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clToningcurve, LUTf & cl2Toningcurve,
|
||||
const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2, const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, DCPProfile *dcpProf, const DCPProfileApplyState &asIn, LUTu &histToneCurve, size_t chunkSize, bool measure)
|
||||
{
|
||||
rgbProc (working, lab, pipetteBuffer, hltonecurve, shtonecurve, tonecurve, sat, rCurve, gCurve, bCurve, satLimit, satLimitOpacity, ctColorCurve, ctOpacityCurve, opautili, clToningcurve, cl2Toningcurve, customToneCurve1, customToneCurve2, customToneCurvebw1, customToneCurvebw2, rrm, ggm, bbm, autor, autog, autob, params->toneCurve.expcomp, params->toneCurve.hlcompr, params->toneCurve.hlcomprthresh, dcpProf, asIn, histToneCurve, chunkSize, measure);
|
||||
}
|
||||
|
||||
// Process RGB image and convert to LAB space
|
||||
void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve,
|
||||
int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clToningcurve, LUTf & cl2Toningcurve,
|
||||
const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2, const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, double expcomp, int hlcompr, int hlcomprthresh, DCPProfile *dcpProf, const DCPProfile::ApplyState &asIn, LUTu &histToneCurve, size_t chunkSize, bool measure)
|
||||
void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve,
|
||||
int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clToningcurve, LUTf & cl2Toningcurve,
|
||||
const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2, const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, double expcomp, int hlcompr, int hlcomprthresh, DCPProfile *dcpProf, const DCPProfileApplyState &asIn, LUTu &histToneCurve, size_t chunkSize, bool measure)
|
||||
{
|
||||
|
||||
std::unique_ptr<StopWatch> stop;
|
||||
|
@ -16,29 +16,57 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _IMPROCFUN_H_
|
||||
#define _IMPROCFUN_H_
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "imagefloat.h"
|
||||
#include "image16.h"
|
||||
#include "image8.h"
|
||||
#include "shmap.h"
|
||||
#include "coord2d.h"
|
||||
#include "color.h"
|
||||
#include "labimage.h"
|
||||
#include "cieimage.h"
|
||||
#include "LUT.h"
|
||||
#include "lcp.h"
|
||||
#include "dcp.h"
|
||||
#include "curves.h"
|
||||
#include "cplx_wavelet_dec.h"
|
||||
#include "pipettebuffer.h"
|
||||
#include "gamutwarning.h"
|
||||
#include "jaggedarray.h"
|
||||
#include "pipettebuffer.h"
|
||||
#include "shmap.h"
|
||||
|
||||
template<typename T>
|
||||
class LUT;
|
||||
|
||||
using LUTu = LUT<uint32_t>;
|
||||
using LUTf = LUT<float>;
|
||||
|
||||
template<typename T, const size_t num>
|
||||
class multi_array2D;
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
class ColorAppearance;
|
||||
class ColorGradientCurve;
|
||||
class DCPProfile;
|
||||
class DCPProfileApplyState;
|
||||
class FlatCurve;
|
||||
class FramesMetaData;
|
||||
class LensCorrection;
|
||||
class LocCCmaskCurve;
|
||||
class LocLLmaskCurve;
|
||||
class LocHHmaskCurve;
|
||||
class LocwavCurve;
|
||||
class LocretigainCurve;
|
||||
class LocretitransCurve;
|
||||
class LocLHCurve;
|
||||
class LocHHCurve;
|
||||
class NoiseCurve;
|
||||
class OpacityCurve;
|
||||
class ToneCurve;
|
||||
class WavCurve;
|
||||
class WavOpacityCurveBY;
|
||||
class WavOpacityCurveRG;
|
||||
class WavOpacityCurveW;
|
||||
class WavOpacityCurveWL;
|
||||
|
||||
class CieImage;
|
||||
class Image8;
|
||||
class Imagefloat;
|
||||
class LabImage;
|
||||
class wavelet_decomposition;
|
||||
|
||||
namespace procparams
|
||||
{
|
||||
|
||||
@ -46,6 +74,7 @@ class ProcParams;
|
||||
|
||||
struct DehazeParams;
|
||||
struct FattalToneMappingParams;
|
||||
struct ColorManagementParams;
|
||||
struct DirPyrDenoiseParams;
|
||||
struct LocalContrastParams;
|
||||
struct LocallabParams;
|
||||
@ -64,7 +93,7 @@ class ImProcFunctions
|
||||
cmsHTRANSFORM monitorTransform;
|
||||
std::unique_ptr<GamutWarning> gamutWarning;
|
||||
|
||||
const ProcParams* params;
|
||||
const procparams::ProcParams* params;
|
||||
double scale;
|
||||
bool multiThread;
|
||||
|
||||
@ -102,7 +131,7 @@ public:
|
||||
|
||||
double lumimul[3];
|
||||
|
||||
explicit ImProcFunctions(const ProcParams* iparams, bool imultiThread = true)
|
||||
explicit ImProcFunctions(const procparams::ProcParams* iparams, bool imultiThread = true)
|
||||
: monitorTransform(nullptr), params(iparams), scale(1), multiThread(imultiThread), lumimul{} {}
|
||||
~ImProcFunctions();
|
||||
bool needsLuminanceOnly()
|
||||
@ -118,11 +147,11 @@ public:
|
||||
void updateColorProfiles(const Glib::ustring& monitorProfile, RenderingIntent monitorIntent, bool softProof, bool gamutCheck);
|
||||
void rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve,
|
||||
int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clcurve, LUTf & cl2curve, const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2,
|
||||
const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, DCPProfile *dcpProf, const DCPProfile::ApplyState &asIn, LUTu &histToneCurve, size_t chunkSize = 1, bool measure = false);
|
||||
const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, DCPProfile *dcpProf, const DCPProfileApplyState &asIn, LUTu &histToneCurve, size_t chunkSize = 1, bool measure = false);
|
||||
void rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve,
|
||||
int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clcurve, LUTf & cl2curve, const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2,
|
||||
const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob,
|
||||
double expcomp, int hlcompr, int hlcomprthresh, DCPProfile *dcpProf, const DCPProfile::ApplyState &asIn, LUTu &histToneCurve, size_t chunkSize = 1, bool measure = false);
|
||||
double expcomp, int hlcompr, int hlcomprthresh, DCPProfile *dcpProf, const DCPProfileApplyState &asIn, LUTu &histToneCurve, size_t chunkSize = 1, bool measure = false);
|
||||
void labtoning(float r, float g, float b, float &ro, float &go, float &bo, int algm, int metchrom, int twoc, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, LUTf & clToningcurve, LUTf & cl2Toningcurve, float iplow, float iphigh, double wp[3][3], double wip[3][3]);
|
||||
void toning2col(float r, float g, float b, float &ro, float &go, float &bo, float iplow, float iphigh, float rl, float gl, float bl, float rh, float gh, float bh, float SatLow, float SatHigh, float balanS, float balanH, float reducac, int mode, int preser, float strProtect);
|
||||
void toningsmh(float r, float g, float b, float &ro, float &go, float &bo, float RedLow, float GreenLow, float BlueLow, float RedMed, float GreenMed, float BlueMed, float RedHigh, float GreenHigh, float BlueHigh, float reducac, int mode, float strProtect);
|
||||
@ -134,10 +163,9 @@ public:
|
||||
void moyeqt(Imagefloat* working, float &moyS, float &eqty);
|
||||
|
||||
void luminanceCurve(LabImage* lold, LabImage* lnew, LUTf &curve);
|
||||
|
||||
void ciecamloc_02float(int sp, LabImage* lab);
|
||||
|
||||
void ciecam_02float(CieImage* ncie, float adap, int pW, int pwb, LabImage* lab, const ProcParams* params,
|
||||
void ciecam_02float(CieImage* ncie, float adap, int pW, int pwb, LabImage* lab, const procparams::ProcParams* params,
|
||||
const ColorAppearance & customColCurve1, const ColorAppearance & customColCurve, const ColorAppearance & customColCurve3,
|
||||
LUTu &histLCAM, LUTu &histCCAM, LUTf & CAMBrightCurveJ, LUTf & CAMBrightCurveQ, float &mean, int Iterates, int scale, bool execsharp, float &d, float &dj, float &yb, int rtt,
|
||||
bool showSharpMask = false);
|
||||
@ -149,7 +177,7 @@ public:
|
||||
void sharpening(LabImage* lab, const procparams::SharpeningParams &sharpenParam, bool showMask = false);
|
||||
void sharpeningcam(CieImage* ncie, float** buffer, bool showMask = false);
|
||||
void transform(Imagefloat* original, Imagefloat* transformed, int cx, int cy, int sx, int sy, int oW, int oH, int fW, int fH, const FramesMetaData *metadata, int rawRotationDeg, bool fullImage);
|
||||
float resizeScale(const ProcParams* params, int fw, int fh, int &imw, int &imh);
|
||||
float resizeScale(const procparams::ProcParams* params, int fw, int fh, int &imw, int &imh);
|
||||
void lab2monitorRgb(LabImage* lab, Image8* image);
|
||||
void resize(Imagefloat* src, Imagefloat* dst, float dScale);
|
||||
void Lanczos(const LabImage* src, LabImage* dst, float scale);
|
||||
@ -354,14 +382,14 @@ public:
|
||||
void Badpixelscam(CieImage * ncie, double radius, int thresh, int mode, float chrom, bool hotbad);
|
||||
void BadpixelsLab(LabImage * lab, double radius, int thresh, float chrom);
|
||||
|
||||
void dehaze(Imagefloat *rgb, const DehazeParams &dehazeParams);
|
||||
void ToneMapFattal02(Imagefloat *rgb, const FattalToneMappingParams &fatParams, int detail_level);
|
||||
void localContrast(LabImage *lab, float **destination, const LocalContrastParams &localContrastParams, bool fftwlc, double scale);
|
||||
void dehaze(Imagefloat *rgb, const procparams::DehazeParams &dehazeParams);
|
||||
void ToneMapFattal02(Imagefloat *rgb, const procparams::FattalToneMappingParams &fatParams, int detail_level);
|
||||
void localContrast(LabImage *lab, float **destination, const procparams::LocalContrastParams &localContrastParams, bool fftwlc, double scale);
|
||||
void colorToningLabGrid(LabImage *lab, int xstart, int xend, int ystart, int yend, bool MultiThread);
|
||||
// void shadowsHighlights(LabImage *lab);
|
||||
void shadowsHighlights(LabImage *lab, bool ena, int labmode, int hightli, int shado, int rad, int scal, int hltonal, int shtonal);
|
||||
|
||||
void softLight(LabImage *lab, const SoftLightParams &softLightParams);
|
||||
void softLight(LabImage *lab, const procparams::SoftLightParams &softLightParams);
|
||||
void labColorCorrectionRegions(LabImage *lab);
|
||||
|
||||
Image8* lab2rgb(LabImage* lab, int cx, int cy, int cw, int ch, const procparams::ColorManagementParams &icm, bool consider_histogram_settings = true);
|
||||
@ -377,5 +405,5 @@ public:
|
||||
void rgb2lab(const Imagefloat &src, LabImage &dst, const Glib::ustring &workingSpace);
|
||||
void lab2rgb(const LabImage &src, Imagefloat &dst, const Glib::ustring &workingSpace);
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "labimage.h"
|
||||
#include "improcfun.h"
|
||||
#include "cieimage.h"
|
||||
#include "sleef.c"
|
||||
#include "sleef.h"
|
||||
#include "opthelper.h"
|
||||
#include "gauss.h"
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
*/
|
||||
#include <fftw3.h>
|
||||
#include "../rtgui/profilestorecombobox.h"
|
||||
#include "color.h"
|
||||
#include "rtengine.h"
|
||||
#include "iccstore.h"
|
||||
#include "dcp.h"
|
||||
@ -42,7 +43,7 @@ const Settings* settings;
|
||||
MyMutex* lcmsMutex = nullptr;
|
||||
MyMutex *fftwMutex = nullptr;
|
||||
|
||||
int init (const Settings* s, Glib::ustring baseDir, Glib::ustring userSettingsDir, bool loadAll)
|
||||
int init (const Settings* s, const Glib::ustring& baseDir, const Glib::ustring& userSettingsDir, bool loadAll)
|
||||
{
|
||||
settings = s;
|
||||
ProcParams::init();
|
||||
|
@ -32,17 +32,22 @@
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
#include "color.h"
|
||||
#include "guidedfilter.h"
|
||||
#include "iccstore.h"
|
||||
#include "imagefloat.h"
|
||||
#include "improcfun.h"
|
||||
#include "procparams.h"
|
||||
#include "rescale.h"
|
||||
#include "rt_math.h"
|
||||
|
||||
extern Options options;
|
||||
#include "../rtgui/options.h"
|
||||
|
||||
namespace rtengine {
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
namespace {
|
||||
namespace
|
||||
{
|
||||
|
||||
float normalize(Imagefloat *rgb, bool multithread)
|
||||
{
|
||||
@ -198,7 +203,7 @@ float estimate_ambient_light(const array2D<float> &R, const array2D<float> &G, c
|
||||
}
|
||||
}
|
||||
|
||||
if (options.rtSettings.verbose) {
|
||||
if (settings->verbose) {
|
||||
std::cout << "dehaze: computing ambient light from " << patches.size()
|
||||
<< " patches" << std::endl;
|
||||
}
|
||||
@ -269,7 +274,6 @@ void extract_channels(Imagefloat *img, array2D<float> &r, array2D<float> &g, arr
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
void ImProcFunctions::dehaze(Imagefloat *img, const DehazeParams &dehazeParams)
|
||||
{
|
||||
if (!dehazeParams.enabled || dehazeParams.strength == 0.0) {
|
||||
@ -282,7 +286,7 @@ void ImProcFunctions::dehaze(Imagefloat *img, const DehazeParams &dehazeParams)
|
||||
const int H = img->getHeight();
|
||||
const float strength = LIM01(float(dehazeParams.strength) / 100.f * 0.9f);
|
||||
|
||||
if (options.rtSettings.verbose) {
|
||||
if (settings->verbose) {
|
||||
std::cout << "dehaze: strength = " << strength << std::endl;
|
||||
}
|
||||
|
||||
@ -324,7 +328,7 @@ void ImProcFunctions::dehaze(Imagefloat *img, const DehazeParams &dehazeParams)
|
||||
}
|
||||
|
||||
if (min(ambient[0], ambient[1], ambient[2]) < 0.01f) {
|
||||
if (options.rtSettings.verbose) {
|
||||
if (settings->verbose) {
|
||||
std::cout << "dehaze: no haze detected" << std::endl;
|
||||
}
|
||||
restore(img, maxChannel, multiThread);
|
||||
@ -332,7 +336,7 @@ void ImProcFunctions::dehaze(Imagefloat *img, const DehazeParams &dehazeParams)
|
||||
}
|
||||
patchsize = max(max(W, H) / 600, 2);
|
||||
|
||||
if (options.rtSettings.verbose) {
|
||||
if (settings->verbose) {
|
||||
std::cout << "dehaze: ambient light is "
|
||||
<< ambient[0] << ", " << ambient[1] << ", " << ambient[2]
|
||||
<< std::endl;
|
||||
@ -347,7 +351,7 @@ void ImProcFunctions::dehaze(Imagefloat *img, const DehazeParams &dehazeParams)
|
||||
array2D<float> guideB(W, H, img->b.ptrs, ARRAY2D_BYREFERENCE);
|
||||
guidedFilter(guideB, dark, dark, radius, epsilon, multiThread);
|
||||
|
||||
if (options.rtSettings.verbose) {
|
||||
if (settings->verbose) {
|
||||
std::cout << "dehaze: max distance is " << maxDistance << std::endl;
|
||||
}
|
||||
|
||||
@ -429,5 +433,4 @@ void ImProcFunctions::dehaze(Imagefloat *img, const DehazeParams &dehazeParams)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // namespace rtengine
|
||||
|
@ -39,10 +39,7 @@
|
||||
along with darktable. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef _OPENMP
|
||||
#include <omp.h>
|
||||
#endif
|
||||
|
||||
#include "imagefloat.h"
|
||||
#include "improcfun.h"
|
||||
#include "rt_math.h"
|
||||
|
||||
|
@ -17,13 +17,14 @@
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "rtengine.h"
|
||||
#include "image8.h"
|
||||
#include "imagefloat.h"
|
||||
#include "labimage.h"
|
||||
#include "improcfun.h"
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/ustring.h>
|
||||
#include "iccstore.h"
|
||||
#include "iccmatrices.h"
|
||||
#include "../rtgui/options.h"
|
||||
#include "settings.h"
|
||||
#include "curves.h"
|
||||
#include "alignedbuffer.h"
|
||||
#include "color.h"
|
||||
#include "procparams.h"
|
||||
@ -33,8 +34,6 @@ namespace rtengine
|
||||
|
||||
extern void filmlike_clip(float *r, float *g, float *b);
|
||||
|
||||
extern const Settings* settings;
|
||||
|
||||
namespace {
|
||||
|
||||
inline void copyAndClampLine(const float *src, unsigned char *dst, const int W)
|
||||
|
@ -18,16 +18,17 @@
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef _OPENMP
|
||||
#include <omp.h>
|
||||
#endif
|
||||
|
||||
#include "improcfun.h"
|
||||
#include "color.h"
|
||||
#include "curves.h"
|
||||
#include "guidedfilter.h"
|
||||
#include "iccstore.h"
|
||||
#include "improcfun.h"
|
||||
#include "labimage.h"
|
||||
#include "procparams.h"
|
||||
#include "sleef.h"
|
||||
|
||||
//#define BENCHMARK
|
||||
#include "StopWatch.h"
|
||||
#include "sleef.c"
|
||||
|
||||
namespace {
|
||||
|
||||
@ -51,7 +52,8 @@ void fastlin2log(float *x, float factor, float base, int w)
|
||||
|
||||
}
|
||||
|
||||
namespace rtengine {
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
void ImProcFunctions::labColorCorrectionRegions(LabImage *lab)
|
||||
{
|
||||
|
@ -22,22 +22,17 @@
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef _OPENMP
|
||||
#include <omp.h>
|
||||
#endif
|
||||
|
||||
#include "array2D.h"
|
||||
#include "gauss.h"
|
||||
#include "labimage.h"
|
||||
#include "improcfun.h"
|
||||
#include "procparams.h"
|
||||
#include "settings.h"
|
||||
|
||||
namespace rtengine
|
||||
{
|
||||
extern const Settings* settings;
|
||||
|
||||
LocallabParams locallab; ///< Local lab parameters
|
||||
|
||||
void ImProcFunctions::localContrast(LabImage *lab, float **destination, const LocalContrastParams &localContrastParams, bool fftwlc, double scale)
|
||||
void ImProcFunctions::localContrast(LabImage *lab, float **destination, const rtengine::procparams::LocalContrastParams &localContrastParams, bool fftwlc, double scale)
|
||||
{
|
||||
if (!localContrastParams.enabled) {
|
||||
return;
|
||||
|
@ -24,13 +24,17 @@
|
||||
#include <fftw3.h>
|
||||
|
||||
#include "improcfun.h"
|
||||
#include "colortemp.h"
|
||||
#include "curves.h"
|
||||
#include "gauss.h"
|
||||
#include "iccmatrices.h"
|
||||
#include "iccstore.h"
|
||||
#include "imagefloat.h"
|
||||
#include "labimage.h"
|
||||
#include "color.h"
|
||||
#include "rt_math.h"
|
||||
#include "jaggedarray.h"
|
||||
#include "rt_algo.h"
|
||||
#include "settings.h"
|
||||
|
||||
#ifdef _OPENMP
|
||||
#include <omp.h>
|
||||
@ -179,9 +183,6 @@ extern MyMutex *fftwMutex;
|
||||
|
||||
using namespace procparams;
|
||||
|
||||
extern const Settings* settings;
|
||||
|
||||
|
||||
struct local_params {
|
||||
float yc, xc;
|
||||
float ycbuf, xcbuf;
|
||||
|
@ -20,10 +20,12 @@
|
||||
#include "improcfun.h"
|
||||
|
||||
#include "alignedbuffer.h"
|
||||
#include "imagefloat.h"
|
||||
#include "labimage.h"
|
||||
#include "opthelper.h"
|
||||
#include "rt_math.h"
|
||||
#include "procparams.h"
|
||||
#include "sleef.c"
|
||||
#include "sleef.h"
|
||||
|
||||
//#define PROFILE
|
||||
|
||||
|
@ -41,8 +41,11 @@
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
#include "color.h"
|
||||
#include "curves.h"
|
||||
#include "gauss.h"
|
||||
#include "improcfun.h"
|
||||
#include "labimage.h"
|
||||
#include "median.h"
|
||||
#include "opthelper.h"
|
||||
#include "procparams.h"
|
||||
@ -181,9 +184,7 @@ void mean_stddv2(float **dst, float &mean, float &stddv, int W_L, int H_L, float
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
extern const Settings* settings;
|
||||
|
||||
void RawImageSource::MSR(float** luminance, float** originalLuminance, float **exLuminance, const 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 RawImageSource::MSR(float** luminance, float** originalLuminance, float **exLuminance, const LUTf& mapcurve, bool mapcontlutili, int width, int height, const procparams::RetinexParams &deh, const RetinextransmissionCurve & dehatransmissionCurve, const RetinexgaintransmissionCurve & dehagaintransmissionCurve, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax)
|
||||
{
|
||||
BENCHFUN
|
||||
|
||||
|
@ -20,11 +20,15 @@
|
||||
|
||||
#include "improcfun.h"
|
||||
|
||||
#include "color.h"
|
||||
#include "curves.h"
|
||||
#include "gauss.h"
|
||||
#include "guidedfilter.h"
|
||||
#include "iccstore.h"
|
||||
#include "labimage.h"
|
||||
#include "opthelper.h"
|
||||
#include "procparams.h"
|
||||
#include "sleef.c"
|
||||
#include "sleef.h"
|
||||
|
||||
namespace rtengine {
|
||||
//modifications to pass parameters needs by locallab, to avoid 2 functions - no change in process - J.Desmis march 2019
|
||||
|
@ -17,22 +17,27 @@
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "improcfun.h"
|
||||
#include "gauss.h"
|
||||
#include "bilateral2.h"
|
||||
#include "cieimage.h"
|
||||
#include "gauss.h"
|
||||
#include "improcfun.h"
|
||||
#include "jaggedarray.h"
|
||||
#include "rt_math.h"
|
||||
#include "procparams.h"
|
||||
#include "sleef.c"
|
||||
#include "labimage.h"
|
||||
#include "opthelper.h"
|
||||
#include "procparams.h"
|
||||
#include "rt_algo.h"
|
||||
#include "rt_math.h"
|
||||
#include "settings.h"
|
||||
#include "sleef.h"
|
||||
|
||||
//#define BENCHMARK
|
||||
#include "StopWatch.h"
|
||||
#include "rt_algo.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace {
|
||||
|
||||
void sharpenHaloCtrl (float** luminance, float** blurmap, float** base, float** blend, int W, int H, const SharpeningParams &sharpenParam)
|
||||
void sharpenHaloCtrl (float** luminance, float** blurmap, float** base, float** blend, int W, int H, const procparams::SharpeningParams &sharpenParam)
|
||||
{
|
||||
|
||||
const float scale = (100.f - sharpenParam.halocontrol_amount) * 0.01f;
|
||||
@ -156,9 +161,7 @@ void dcdamping (float** aI, float** aO, float damping, int W, int H)
|
||||
namespace rtengine
|
||||
{
|
||||
|
||||
extern const Settings* settings;
|
||||
|
||||
void ImProcFunctions::deconvsharpening (float** luminance, float** tmp, const float * const * blend, int W, int H, const SharpeningParams &sharpenParam, double Scale)
|
||||
void ImProcFunctions::deconvsharpening (float** luminance, float** tmp, const float * const * blend, int W, int H, const procparams::SharpeningParams &sharpenParam, double Scale)
|
||||
{
|
||||
if (sharpenParam.deconvamount == 0 && sharpenParam.blurradius < 0.25f) {
|
||||
return;
|
||||
@ -342,10 +345,7 @@ void ImProcFunctions::deconvsharpeningloc (float** luminance, float** tmp, int W
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void ImProcFunctions::sharpening (LabImage* lab, const SharpeningParams &sharpenParam, bool showMask)
|
||||
void ImProcFunctions::sharpening (LabImage* lab, const procparams::SharpeningParams &sharpenParam, bool showMask)
|
||||
{
|
||||
|
||||
if ((!sharpenParam.enabled) || sharpenParam.amount < 1 || lab->W < 8 || lab->H < 8) {
|
||||
|
@ -19,7 +19,10 @@
|
||||
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "color.h"
|
||||
#include "iccstore.h"
|
||||
#include "improcfun.h"
|
||||
#include "labimage.h"
|
||||
|
||||
#include "procparams.h"
|
||||
|
||||
@ -59,7 +62,7 @@ inline vfloat sl(vfloat blend, vfloat x)
|
||||
|
||||
//} // namespace
|
||||
|
||||
void ImProcFunctions::softLight(LabImage *lab, const SoftLightParams &softLightParams)
|
||||
void ImProcFunctions::softLight(LabImage *lab, const rtengine::procparams::SoftLightParams &softLightParams)
|
||||
{
|
||||
if (!softLightParams.enabled || !softLightParams.strength) {
|
||||
return;
|
||||
|
@ -16,9 +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/>.
|
||||
*/
|
||||
#ifndef _IPTCPAIRS_
|
||||
#define _IPTCPAIRS_
|
||||
|
||||
#pragma once
|
||||
|
||||
struct IptcPair {
|
||||
IptcTag tag;
|
||||
@ -44,6 +42,3 @@ const IptcPair strTags[] = {
|
||||
{IPTC_TAG_ORIG_TRANS_REF, 32, "TransReference"},
|
||||
{IPTC_TAG_DATE_CREATED, 8, "DateCreated"}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -18,18 +18,14 @@
|
||||
*/
|
||||
#include <array>
|
||||
|
||||
#ifdef _OPENMP
|
||||
#include <omp.h>
|
||||
#endif
|
||||
|
||||
#include "imagefloat.h"
|
||||
#include "improcfun.h"
|
||||
|
||||
#include "mytime.h"
|
||||
#include "procparams.h"
|
||||
#include "rt_math.h"
|
||||
#include "rtengine.h"
|
||||
#include "rtlensfun.h"
|
||||
#include "sleef.c"
|
||||
#include "sleef.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user