mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 01:47:34 +00:00
LibGfx/ICC: Move MatrixMatrixConversion curve type check to ctor
A bit faster: ``` N Min Max Median Avg Stddev x 50 0.97179127 1.0031381 0.98313618 0.98407591 0.0092019442 + 50 0.95996714 0.99507213 0.96965885 0.97242294 0.0095455053 Difference at 95.0% confidence -0.011653 +/- 0.00372012 -1.18415% +/- 0.378032% (Student's t, pooled s = 0.0093753) ```
This commit is contained in:
parent
5f85aff036
commit
92852b8477
2 changed files with 9 additions and 2 deletions
|
@ -175,14 +175,12 @@ private:
|
|||
inline Color MatrixMatrixConversion::map(FloatVector3 in_rgb) const
|
||||
{
|
||||
auto evaluate_curve = [](TagData const& trc, float f) {
|
||||
VERIFY(trc.type() == CurveTagData::Type || trc.type() == ParametricCurveTagData::Type);
|
||||
if (trc.type() == CurveTagData::Type)
|
||||
return static_cast<CurveTagData const&>(trc).evaluate(f);
|
||||
return static_cast<ParametricCurveTagData const&>(trc).evaluate(f);
|
||||
};
|
||||
|
||||
auto evaluate_curve_inverse = [](TagData const& trc, float f) {
|
||||
VERIFY(trc.type() == CurveTagData::Type || trc.type() == ParametricCurveTagData::Type);
|
||||
if (trc.type() == CurveTagData::Type)
|
||||
return static_cast<CurveTagData const&>(trc).evaluate_inverse(f);
|
||||
return static_cast<ParametricCurveTagData const&>(trc).evaluate_inverse(f);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue