Color management architecture: color profiles
This MR depends on !596 (merged).
Roughly speaking, a color profile describes the color space of content or an output. Under the hood, the description includes one or more ways to map colors between the profile space and some standard profile connecting space (PCS).
This object is not called a color space. A color space has a unique definition, while a color profile may contain multiple different mappings depending on render intent. Some of these mappings may be subjective, with an artistic touch.
When a source color profile and a destination color profile are combined under a specific render intent, they produce a color transformation. Color transformations are already presented by weston_color_transform
.
This MR adds the basic API for color profile objects. Everything worthwhile of these objects is implemented in the color managers: color-noop never creates these, and in color-lcms they are basically a container for cmsHPROFILE
, the Little CMS object for color profiles. Color profile objects will not be interpreted outside of the color managers, unlike color transformations.
For a start, the color manager API has one function to create color profiles: from ICC profile data. More creation functions for other sources will be added later. ICC profiles have various types which raises enum weston_color_profile_kind
. Output profiles have different requirements from content profiles.
To exercise the the API, if color management is enabled, Weston will now recognize icc_profile
key in an [output]
section in weston.ini
for DRM, headless, wayland, and x11 backends.
This code is very much based on @swick's earlier work on Weston color management, but structured and named differently.
This MR is a draft until it has been tested with color-lcms actually using an output color profile. The color-lcms implementation may be added to this MR or it may come as another MR on top of this.
Without the color-lcms implementation, Weston will refuse to start if you specify an output color profile and have turned the experimental color management option on.
Cc @vitalyp
Merge request reports
Activity
added Colour management Core compositor Weston frontend libweston API labels
mentioned in issue #467
@pq Thanks, I am looking now how to plug-in LCMS and your comments in the code are very helpful
added 32 commits
- 2d06d328 - libweston: introduce CMS component architecture
- 71006c89 - color: add output color transform API
- 0e041cc8 - color: add from sRGB to output color transformation
- 21256414 - color: add from sRGB to blending color transformation
- ebb0086a - libweston: begin color-lcms plugin
- d55d3e57 - compositor: add weston.ini option to enable color management
- ba584116 - tests: ensure color-lcms plugin loads
- a8e236b8 - gl-renderer: do not unbind the context on output destroy
- 14fe3aae - Revert "gl-renderer: Make dummy surface current after all outputs are gone"
- ac1d55e1 - gl-renderer: require GL ES 3.0 for color management
- 19ea978f - gl-renderer: define fragment shader compile_const
- bb95f65a - gl-renderer: use shadow framebuffer automatically
- 9dc8a869 - Revert "compositor: add weston.ini option use-renderer-shadow"
- f78dd9c7 - libweston: remove weston_output_set_renderer_shadow_buffer()
- 0c3f8176 - gl-renderer: add shader bit input_is_premult
- 0d4fefdf - gl-renderer: fragment shader precision to high
- 0130c08a - gl-renderer: implement SHADER_COLOR_CURVE_LUT_3x1D
- 60dd6faa - gl-renderer: implement 3 x 1D LUT color pre-curve
- 19757315 - gl-renderer: color transform censor fill and triangle fan
- 1556f2a6 - gl-renderer: color transform output borders
- 67361def - gl-renderer: color transform in blit_shadow_to_output()
- 59a6825e - color-lcms: use sRGB EOTF
- f7288e0a - tests/alpha-blending: refactor into get_middle_row()
- 7824ea33 - tests/alpha-blending: reference blending
- 0bc72a97 - tests/alpha-blending: add sRGB linear light case
- 5c0d0f56 - libweston: fix crash on never used output's tear-down
- 27efb5a0 - shared: add str_printf()
- d33d1930 - color: introduce weston_color_profile
- 4b15202e - color: add weston_compositor_load_icc_file()
- 45854512 - libweston: refactor into weston_output_set_color_transforms()
- c9fd7dfb - libweston: add weston_output::color_profile
- d0f2039a - compositor: add icc_profile weston.ini option for outputs
Toggle commit listTrivial rebase after all the changes done in !596 (merged).
- Resolved by Pekka Paalanen
@pq Regarding your recent changes in MR!637, it looks very good to me.
weston_output_set_color_profile is trying to set if (output->enabled), but it is not enabled yet. cmlcms_get_output_color_transform /* TODO: use output color profile */ │ if (output->color_profile) │
Your comment:
so trying this will fail until support is implemented.
looks very clear to me, are you going to work on this or you want me to do this?
mentioned in merge request !640 (merged)
added 41 commits
-
d0f2039a...819054ce - 23 commits from branch
wayland:main
- 25a4bb53 - gl-renderer: add shader bit input_is_premult
- 36124f4c - gl-renderer: fragment shader precision to high
- 6fd39db3 - gl-renderer: implement SHADER_COLOR_CURVE_LUT_3x1D
- e82425c3 - gl-renderer: implement 3 x 1D LUT color pre-curve
- f204b546 - gl-renderer: color transform censor fill and triangle fan
- 0e5a8629 - gl-renderer: color transform output borders
- d2cc275e - gl-renderer: color transform in blit_shadow_to_output()
- 23b2119b - color-lcms: use sRGB EOTF
- c00fc091 - tests/alpha-blending: refactor into get_middle_row()
- 5562b30e - tests/alpha-blending: reference blending
- efb53f52 - tests/alpha-blending: add sRGB linear light case
- 4c8d927a - libweston: fix crash on never used output's tear-down
- 4a884ce1 - shared: add str_printf()
- 224f3775 - color: introduce weston_color_profile
- fd0872ec - color: add weston_compositor_load_icc_file()
- 53838909 - libweston: refactor into weston_output_set_color_transforms()
- 887147b5 - libweston: add weston_output::color_profile
- eae859ce - compositor: add icc_profile weston.ini option for outputs
Toggle commit list-
d0f2039a...819054ce - 23 commits from branch
Trivial rebase after the trivial rebase of !596 (merged).
added 18 commits
- 8588ef76 - gl-renderer: add shader bit input_is_premult
- c174b0e9 - gl-renderer: fragment shader precision to high
- 427b8392 - gl-renderer: implement SHADER_COLOR_CURVE_LUT_3x1D
- 6654fe2d - gl-renderer: implement 3 x 1D LUT color pre-curve
- 3ef00fed - gl-renderer: color transform censor fill and triangle fan
- c9c3ccf1 - gl-renderer: color transform output borders
- f5589b29 - gl-renderer: color transform in blit_shadow_to_output()
- 64f9e48f - color-lcms: use sRGB EOTF
- 9b21a07b - tests/alpha-blending: refactor into get_middle_row()
- 77edb997 - tests/alpha-blending: reference blending
- 9d5e1231 - tests/alpha-blending: add sRGB linear light case
- ccb6522d - libweston: fix crash on never used output's tear-down
- df09ac53 - shared: add str_printf()
- c2e51ae3 - color: introduce weston_color_profile
- 84744fa3 - color: add weston_compositor_load_icc_file()
- 20ed7a2b - libweston: refactor into weston_output_set_color_transforms()
- 434dd7ca - libweston: add weston_output::color_profile
- 52cd2bc5 - compositor: add icc_profile weston.ini option for outputs
Toggle commit listTrivially rebased due to changes in !596 (merged).
- Resolved by Pekka Paalanen
- Resolved by Pekka Paalanen
added 5 commits
- cac07537 - color: introduce weston_color_profile
- 6102ea35 - color: add weston_compositor_load_icc_file()
- e7db098b - libweston: refactor into weston_output_set_color_transforms()
- 2e02ee92 - libweston: add weston_output::color_profile
- 1b26f454 - compositor: add icc_profile weston.ini option for outputs
Toggle commit listmentioned in issue #510
added 43 commits
-
1b26f454...7a44ee7f - 36 commits from branch
wayland:main
- d6009f8d - libweston: fix crash on never used output's tear-down
- 020ce000 - shared: add str_printf()
- 9bb22989 - color: introduce weston_color_profile
- 5f5383af - color: add weston_compositor_load_icc_file()
- 4f4171ad - libweston: refactor into weston_output_set_color_transforms()
- d19b8d4c - libweston: add weston_output::color_profile
- edca04a4 - compositor: add icc_profile weston.ini option for outputs
Toggle commit list-
1b26f454...7a44ee7f - 36 commits from branch
mentioned in merge request !658 (merged)
added 57 commits
-
edca04a4...348e3a9a - 51 commits from branch
wayland:main
- d6e8fe5e - libweston: fix crash on never used output's tear-down
- 2bd657d9 - color: introduce weston_color_profile
- f0d6b572 - color: add weston_compositor_load_icc_file()
- 27d3db1a - libweston: refactor into weston_output_set_color_transforms()
- ed29a118 - libweston: add weston_output::color_profile
- 6b6a661c - compositor: add icc_profile weston.ini option for outputs
Toggle commit list-
edca04a4...348e3a9a - 51 commits from branch