1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 21:57:35 +00:00

LibGfx/ICC: Cache inverted matrix on profile

Reduces time spent rendering page 3 of 0000849.pdf from 1.85s to 1.45s
on my machine.

As determined by running

    time Build/lagom/bin/pdf --page 3 --render out.png \
        ~/Downloads/0000/0000849.pdf

a few times and eyeballing the min time.

Also reduces the time to run Meta/test_pdf.py on 0000.zip
(without 0000849.pdf) from 1m7s to 58s.
This commit is contained in:
Nico Weber 2024-01-08 18:29:47 -05:00 committed by Sam Atkins
parent 19d434b229
commit 3365a92ead
2 changed files with 10 additions and 5 deletions

View file

@ -252,6 +252,8 @@ private:
// Only valid for RGB matrix-based profiles.
ErrorOr<FloatMatrix3x3> xyz_to_rgb_matrix() const;
FloatMatrix3x3 rgb_to_xyz_matrix() const;
mutable Optional<FloatMatrix3x3> m_cached_xyz_to_rgb_matrix;
};
}