mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:07:47 +00:00
LibPDF: Use mix() in SampledFunction::evaluate()
No behavior change.
This commit is contained in:
parent
5d14691149
commit
f157cd50a1
1 changed files with 1 additions and 1 deletions
|
@ -185,7 +185,7 @@ PDFErrorOr<ReadonlySpan<float>> SampledFunction::evaluate(ReadonlySpan<float> xs
|
||||||
return Error { Error::Type::RenderingUnsupported, "Sample function with bits per sample != 8 not yet implemented" };
|
return Error { Error::Type::RenderingUnsupported, "Sample function with bits per sample != 8 not yet implemented" };
|
||||||
|
|
||||||
auto interpolate = [](float x, float x_min, float x_max, float y_min, float y_max) {
|
auto interpolate = [](float x, float x_min, float x_max, float y_min, float y_max) {
|
||||||
return y_min + (x - x_min) * (y_max - y_min) / (x_max - x_min);
|
return mix(y_min, y_max, (x - x_min) / (x_max - x_min));
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0; i < m_domain.size(); ++i) {
|
for (size_t i = 0; i < m_domain.size(); ++i) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue