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.)
This commit is contained in:
Nico Weber 2023-04-12 09:05:27 -04:00 committed by Linus Groh
parent 077164ae15
commit 93f5a6f217
Notes: sideshowbarker 2024-07-17 06:46:15 +09:00

View file

@ -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: