1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-05 08:27:35 +00:00
serenity/Userland/Libraries/LibGfx/ICC
Nico Weber cc083310a7 LibGfx/ICC: In lerp_nd(), use VLAs for coordinates
`x.size()` is 3 or 4 in practice and at most 15 in theory
(cf `number_of_components_in_color_space()` in Profile.cpp),
so using a VLA for these should be fine from a stack size PoV.

It's only accessed through a span, so there's no additional
security risk.

Takes

    Build/lagom/bin/image --no-output \
        --assign-color-profile \
            Build/lagom/Root/res/icc/Adobe/CMYK/USWebCoatedSWOP.icc \
        --convert-to-color-profile serenity-sRGB.icc \
        cmyk.jpg

from 2.74s to 2.66s on my machine, almost 3% faster.

(Don't do this in LibPDF's SampledFunction::evaluate() since there's
no bound on the dimension of the input function. Realistically,
size of the table puts a pretty low bound on that dimension though,
so we should probably enforce some bound in SampledFunction::create()
and do this there too.)
2024-02-06 08:44:53 +01:00
..
BinaryFormat.h ICC: Rename XYZ and XYZNumber fields to uppercase 2023-04-29 06:49:36 +02:00
BinaryWriter.cpp LibGfx: Drop tags of unknown type instead of writing invalid icc files 2023-02-24 19:42:00 +01:00
BinaryWriter.h LibGfx: Add start of an ICC profile writer 2023-02-17 20:05:50 -07:00
DistinctFourCC.h LibGfx/ICC: Move enums to dedicated Enums.{cpp,h} 2023-12-04 08:02:36 +00:00
Enums.cpp LibGfx/ICC: Move enums to dedicated Enums.{cpp,h} 2023-12-04 08:02:36 +00:00
Enums.h LibGfx/ICC: Move enums to dedicated Enums.{cpp,h} 2023-12-04 08:02:36 +00:00
Profile.cpp LibGfx/ICC: Add a convert_cmyk_image() method 2024-01-25 15:53:44 +01:00
Profile.h LibGfx/ICC: Add a convert_cmyk_image() method 2024-01-25 15:53:44 +01:00
Tags.cpp LibGfx: Split ICC/Profile.{h,cpp} into several files 2023-01-28 00:27:07 +00:00
Tags.h LibGfx: Add v2 "ncol" tag, expand comment 2023-02-14 19:28:13 +01:00
TagTypes.cpp LibGfx/ICC: Ensure Macintosh ScriptCode length is within expected range 2023-11-12 07:58:39 +01:00
TagTypes.h LibGfx/ICC: In lerp_nd(), use VLAs for coordinates 2024-02-06 08:44:53 +01:00
WellKnownProfiles.cpp ICC: Add comment with a link to WellKnownProfiles.cpp 2023-04-29 06:49:36 +02:00
WellKnownProfiles.h LibGfx: Forward-declare TagData in WellKnownProfiles 2023-07-20 06:56:41 +01:00