Ver código fonte

LibGfx/ICC: Use mix() in CurveTagData::evaluate()

No behavior change.

(Well, technically mix() uses the other simple implementation of lerp
and the two have slightly different behavior if the arguments are of
very different magnitude and in various corner cases. But in practice,
for ICC profiles, it shouldn't matter. For a few profiles I tested, it
didn't have a measurable effect.)
Nico Weber 2 anos atrás
pai
commit
93f5a6f217
1 arquivos alterados com 1 adições e 2 exclusões
  1. 1 2
      Userland/Libraries/LibGfx/ICC/TagTypes.h

+ 1 - 2
Userland/Libraries/LibGfx/ICC/TagTypes.h

@@ -176,8 +176,7 @@ public:
             --i;
 
         float f = x * (values().size() - 1) - i;
-
-        return (1 - f) * (values()[i] / 65535.f) + f * (values()[i + 1] / 65535.f);
+        return mix(values()[i] / 65535.f, values()[i + 1] / 65535.f, f);
     }
 
 private: