diff options
author | Marti Maria <marti.maria@littlecms.com> | 2023-04-22 17:49:44 +0200 |
---|---|---|
committer | Marti Maria <marti.maria@littlecms.com> | 2023-04-22 17:49:44 +0200 |
commit | b3144b8018a26df755b46a02583ff6ea466f532c (patch) | |
tree | 09a5b269e626fa4bd917d8511c88fc917f0b5659 /plugins | |
parent | 7984408c8fe800a27175e4a8bd6115663c553ec1 (diff) | |
download | lcms2-b3144b8018a26df755b46a02583ff6ea466f532c.tar.gz |
Floating point plug-in no longer clamps values on matrix-shaper
Should fix #375
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/fast_float/include/lcms2_fast_float.h | 2 | ||||
-rw-r--r-- | plugins/fast_float/src/fast_float_internal.h | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/plugins/fast_float/include/lcms2_fast_float.h b/plugins/fast_float/include/lcms2_fast_float.h index 6dacd7a..6515c6b 100644 --- a/plugins/fast_float/include/lcms2_fast_float.h +++ b/plugins/fast_float/include/lcms2_fast_float.h @@ -30,7 +30,7 @@ extern "C" { # endif #endif -#define LCMS2_FAST_FLOAT_VERSION 1501 +#define LCMS2_FAST_FLOAT_VERSION 1502 // Configuration toggles diff --git a/plugins/fast_float/src/fast_float_internal.h b/plugins/fast_float/src/fast_float_internal.h index 35d7c25..e5bdf8d 100644 --- a/plugins/fast_float/src/fast_float_internal.h +++ b/plugins/fast_float/src/fast_float_internal.h @@ -134,12 +134,15 @@ cmsINLINE cmsFloat32Number flerp(const cmsFloat32Number LutTable[], cmsFloat32Nu cmsFloat32Number rest; int cell0, cell1; - if ((v < 1.0e-9f) || isnan(v)) { - return LutTable[0]; + if (isnan(v)) + return LutTable[0]; + + if (v < 1.0e-9f) { + return v; } else if (v >= 1.0) { - return LutTable[MAX_NODES_IN_CURVE - 1]; + return v; } v *= (MAX_NODES_IN_CURVE - 1); |