mirror of
https://github.com/RGBCube/serenity
synced 2025-07-05 07:57:35 +00:00
ICC: Move a lambda up a bit
No behavior change.
This commit is contained in:
parent
42e9dfedc2
commit
6b4da8680d
1 changed files with 8 additions and 8 deletions
|
@ -1428,6 +1428,14 @@ ErrorOr<FloatVector3> Profile::to_pcs(ReadonlyBytes color) const
|
||||||
// "d) Use TRCs (redTRCTag, greenTRCTag, blueTRCTag, or grayTRCTag) and colorants
|
// "d) Use TRCs (redTRCTag, greenTRCTag, blueTRCTag, or grayTRCTag) and colorants
|
||||||
// (redMatrixColumnTag, greenMatrixColumnTag, blueMatrixColumnTag) when tags in a), b), and c) are not
|
// (redMatrixColumnTag, greenMatrixColumnTag, blueMatrixColumnTag) when tags in a), b), and c) are not
|
||||||
// used."
|
// used."
|
||||||
|
auto evaluate_curve = [this](TagSignature curve_tag, float f) {
|
||||||
|
auto const& trc = *m_tag_table.get(curve_tag).value();
|
||||||
|
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);
|
||||||
|
};
|
||||||
|
|
||||||
if (data_color_space() == ColorSpace::Gray) {
|
if (data_color_space() == ColorSpace::Gray) {
|
||||||
// ICC v4, F.2 grayTRCTag
|
// ICC v4, F.2 grayTRCTag
|
||||||
// FIXME
|
// FIXME
|
||||||
|
@ -1447,14 +1455,6 @@ ErrorOr<FloatVector3> Profile::to_pcs(ReadonlyBytes color) const
|
||||||
// [connection_X] = [redMatrixColumn_X greenMatrixColumn_X blueMatrixColumn_X] [ linear_r ]
|
// [connection_X] = [redMatrixColumn_X greenMatrixColumn_X blueMatrixColumn_X] [ linear_r ]
|
||||||
// [connection_Y] = [redMatrixColumn_Y greenMatrixColumn_Y blueMatrixColumn_Y] * [ linear_g ]
|
// [connection_Y] = [redMatrixColumn_Y greenMatrixColumn_Y blueMatrixColumn_Y] * [ linear_g ]
|
||||||
// [connection_Z] = [redMatrixColumn_Z greenMatrixColumn_Z blueMatrixColumn_Z] [ linear_b ]"
|
// [connection_Z] = [redMatrixColumn_Z greenMatrixColumn_Z blueMatrixColumn_Z] [ linear_b ]"
|
||||||
auto evaluate_curve = [this](TagSignature curve_tag, float f) {
|
|
||||||
auto const& trc = *m_tag_table.get(curve_tag).value();
|
|
||||||
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);
|
|
||||||
};
|
|
||||||
|
|
||||||
float linear_r = evaluate_curve(redTRCTag, color[0] / 255.f);
|
float linear_r = evaluate_curve(redTRCTag, color[0] / 255.f);
|
||||||
float linear_g = evaluate_curve(greenTRCTag, color[1] / 255.f);
|
float linear_g = evaluate_curve(greenTRCTag, color[1] / 255.f);
|
||||||
float linear_b = evaluate_curve(blueTRCTag, color[2] / 255.f);
|
float linear_b = evaluate_curve(blueTRCTag, color[2] / 255.f);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue