mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:07:35 +00:00
LibGfx/ICC: Stop using VectorN::length() as the vector size
VectorN::length() returns the vector length (aka the square root of the dot product of the vector with itself), not the count of components. This is seemingly both wrong and slow.
This commit is contained in:
parent
05f382fc6e
commit
5129c8b766
1 changed files with 2 additions and 2 deletions
|
@ -1093,7 +1093,7 @@ inline ErrorOr<FloatVector3> Lut16TagData::evaluate(ColorSpace input_space, Colo
|
|||
// Each output table entry is appropriately normalized to the range 0 to 65535.
|
||||
// The outputTable is of size (OutputChannels x outputTableEntries x 2) bytes.
|
||||
// When stored in this tag, the one-dimensional lookup tables are packed one after another"
|
||||
for (u8 c = 0; c < output_color.length(); ++c)
|
||||
for (u8 c = 0; c < 3; ++c)
|
||||
output_color[c] = lerp_1d(m_output_tables.span().slice(c * m_number_of_output_table_entries, m_number_of_output_table_entries), output_color[c]) / 65535.0f;
|
||||
|
||||
if (connection_space == ColorSpace::PCSXYZ) {
|
||||
|
@ -1181,7 +1181,7 @@ inline ErrorOr<FloatVector3> Lut8TagData::evaluate(ColorSpace input_space, Color
|
|||
// Each output table entry is appropriately normalized to the range 0 to 255.
|
||||
// The outputTable is of size (OutputChannels x 256) bytes.
|
||||
// When stored in this tag, the one-dimensional lookup tables are packed one after another"
|
||||
for (u8 c = 0; c < output_color.length(); ++c)
|
||||
for (u8 c = 0; c < 3; ++c)
|
||||
output_color[c] = lerp_1d(m_output_tables.span().slice(c * 256, 256), output_color[c]) / 255.0f;
|
||||
|
||||
if (connection_space == ColorSpace::PCSXYZ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue