Skip to content
Snippets Groups Projects

Color management architecture: color profiles

Merged Pekka Paalanen requested to merge pq/weston:mr/color-output into main

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

Edited by Pekka Paalanen

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Alexandros Frantzis
  • Pekka Paalanen added 5 commits

    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

    Compare with previous version

  • Author Owner

    Added free(cprof->base.description);.

  • Pekka Paalanen mentioned in issue #510

    mentioned in issue #510

  • Pekka Paalanen added 43 commits

    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

    Compare with previous version

  • Author Owner

    Trivial rebase.

    All depended-on MRs have been merged, so now this MR contains only this MR's commits.

  • Pekka Paalanen mentioned in merge request !658 (merged)

    mentioned in merge request !658 (merged)

  • Pekka Paalanen added 57 commits

    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

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading