From 4d241d7e1048e4550074af97d9aea9703b2e6c0b Mon Sep 17 00:00:00 2001 From: heckflosse Date: Sat, 19 Jan 2019 19:10:46 +0100 Subject: [PATCH] Wrong clipping when using the new v2 and v4 profiles, fixes #5142 --- rtengine/imagefloat.cc | 3 --- rtengine/iplab2rgb.cc | 7 ------- 2 files changed, 10 deletions(-) diff --git a/rtengine/imagefloat.cc b/rtengine/imagefloat.cc index 940806419..0d978aa5b 100644 --- a/rtengine/imagefloat.cc +++ b/rtengine/imagefloat.cc @@ -143,9 +143,6 @@ void Imagefloat::getScanline (int row, unsigned char* buffer, int bps, bool isFl float ri = r(row, i); float gi = g(row, i); float bi = b(row, i); - if (ri > 65535.f || gi > 65535.f || bi > 65535.f) { - filmlike_clip(&ri, &gi, &bi); - } if (bps == 16) { sbuffer[ix++] = CLIP(ri); sbuffer[ix++] = CLIP(gi); diff --git a/rtengine/iplab2rgb.cc b/rtengine/iplab2rgb.cc index 9ab8e1d01..04358f6af 100644 --- a/rtengine/iplab2rgb.cc +++ b/rtengine/iplab2rgb.cc @@ -41,9 +41,6 @@ inline void copyAndClampLine(const float *src, unsigned char *dst, const int W) float r = src[iy] * MAXVALF; float g = src[iy+1] * MAXVALF; float b = src[iy+2] * MAXVALF; - if (r > MAXVALF || g > MAXVALF || b > MAXVALF) { - filmlike_clip(&r, &g, &b); - } dst[iy] = uint16ToUint8Rounded(CLIP(r)); dst[iy+1] = uint16ToUint8Rounded(CLIP(g)); dst[iy+2] = uint16ToUint8Rounded(CLIP(b)); @@ -73,10 +70,6 @@ inline void copyAndClamp(const LabImage *src, unsigned char *dst, const double r Color::Lab2XYZ(rL[j], ra[j], rb[j], x_, y_, z_ ); Color::xyz2rgb(x_, y_, z_, R, G, B, rgb_xyz); - if (R > MAXVALF || G > MAXVALF || B > MAXVALF) { - filmlike_clip(&R, &G, &B); - } - dst[ix++] = uint16ToUint8Rounded(Color::gamma2curve[R]); dst[ix++] = uint16ToUint8Rounded(Color::gamma2curve[G]); dst[ix++] = uint16ToUint8Rounded(Color::gamma2curve[B]);