Bug 221193 - Avoid unnecessary chromatic adaptation when converting between colors with the same white point
Summary: Avoid unnecessary chromatic adaptation when converting between colors with th...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sam Weinig
URL:
Keywords: InRadar
Depends on:
Blocks: 221190
  Show dependency treegraph
 
Reported: 2021-01-31 17:20 PST by Sam Weinig
Modified: 2021-02-01 09:51 PST (History)
3 users (show)

See Also:


Attachments
Patch (32.98 KB, patch)
2021-01-31 17:29 PST, Sam Weinig
no flags Details | Formatted Diff | Diff
Patch (32.97 KB, patch)
2021-01-31 17:34 PST, Sam Weinig
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2021-01-31 17:20:00 PST
We currently always use the XYZ space with the D65 white point as our universal conversion space (the space we require each type to be able to convert to and from), but this is not ideal when converting between colors like ProPhotoRGB and Lab, which both use the D50 white point, since it requires an extra two matrix multiplications for the chromatic adaptations to and from D65.

Additionally, to support color(xyz ...), which also use D50, we will need an explicit XYZ color with a D50 white point. 

We can solve both of these problems by further generalizing XYZA<T> to support a white point parameter, XYZA<T, WhitePoint>, and annotate all the colors with which whitepoint they are defined in (or what XYZA color is their reference). Then, we can use that information to lazily (though at compile time) determine whether chromatic adaptation is needed in the generic conversion functions.
Comment 1 Sam Weinig 2021-01-31 17:29:49 PST Comment hidden (obsolete)
Comment 2 Sam Weinig 2021-01-31 17:34:45 PST
Created attachment 418836 [details]
Patch
Comment 3 EWS 2021-02-01 09:50:12 PST
Committed r272146: <https://trac.webkit.org/changeset/272146>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 418836 [details].
Comment 4 Radar WebKit Bug Importer 2021-02-01 09:51:15 PST
<rdar://problem/73833214>