Add Ingo's gamma_srgbclipped patch

This commit is contained in:
Flössie 2016-05-01 10:41:21 +02:00
parent beaea22779
commit eceb024ba8
2 changed files with 11 additions and 7 deletions

View File

@ -1079,6 +1079,10 @@ public:
{ {
return gammatab_srgb[x]; return gammatab_srgb[x];
} }
static inline float gamma_srgbclipped (float x)
{
return gamma2curve[x];
}
static inline float gamma (float x) static inline float gamma (float x)
{ {
return gammatab[x]; return gammatab[x];

View File

@ -19,6 +19,9 @@
#include <cmath> #include <cmath>
#include <glib.h> #include <glib.h>
#include <glibmm.h> #include <glibmm.h>
#ifdef _OPENMP
#include <omp.h>
#endif
#include "rtengine.h" #include "rtengine.h"
#include "improcfun.h" #include "improcfun.h"
@ -38,9 +41,6 @@
#include "clutstore.h" #include "clutstore.h"
#include "ciecam02.h" #include "ciecam02.h"
#ifdef _OPENMP
#include <omp.h>
#endif
#undef CLIPD #undef CLIPD
#define CLIPD(a) ((a)>0.0f?((a)<1.0f?(a):1.0f):0.0f) #define CLIPD(a) ((a)>0.0f?((a)<1.0f?(a):1.0f):0.0f)
@ -4396,10 +4396,10 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer
float &sourceG = gtemp[ti * TS + tj]; float &sourceG = gtemp[ti * TS + tj];
float &sourceB = btemp[ti * TS + tj]; float &sourceB = btemp[ti * TS + tj];
//appply gamma sRGB (default RT) //apply gamma sRGB (default RT)
sourceR = CLIP<float>( Color::gamma_srgb( sourceR ) ); sourceR = Color::gamma_srgbclipped( sourceR );
sourceG = CLIP<float>( Color::gamma_srgb( sourceG ) ); sourceG = Color::gamma_srgbclipped( sourceG );
sourceB = CLIP<float>( Color::gamma_srgb( sourceB ) ); sourceB = Color::gamma_srgbclipped( sourceB );
} }
const std::size_t line_offset = ti * TS; const std::size_t line_offset = ti * TS;