mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:07:35 +00:00
LibGfx/ICC: Gently rewrite CurveTagData::evaluate()
One less redundant expression. No behavior change.
This commit is contained in:
parent
a39eebeb74
commit
15bddf5de3
1 changed files with 3 additions and 3 deletions
|
@ -171,12 +171,12 @@ public:
|
|||
if (values().size() == 1)
|
||||
return powf(x, values()[0] / (float)0x100);
|
||||
|
||||
size_t i = static_cast<size_t>(x * (values().size() - 1));
|
||||
size_t n = values().size() - 1;
|
||||
size_t i = static_cast<size_t>(x * n);
|
||||
if (i == values().size() - 1)
|
||||
--i;
|
||||
|
||||
float f = x * (values().size() - 1) - i;
|
||||
return mix(values()[i] / 65535.f, values()[i + 1] / 65535.f, f);
|
||||
return mix(values()[i] / 65535.f, values()[i + 1] / 65535.f, x * n - i);
|
||||
}
|
||||
|
||||
// y must be in [0..1].
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue