color: introduce weston_color_profile
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 preresented by weston_color_transform. This patch 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. The API has errmsg return parameter for error messages. These are not simply weston_log()'d, because CM&HDR protocol will allow clients to trigger errors and the protocol handles that gracefully. Therefore instead of flooding the compositor logs, the error messages will probably need to be relayed back to clients. Color-lcms is expected to create a cmsHPROFILE for all kinds of color profiles, not just for those created from ICC profile data. Hence, color-lcms will fingerprint color profiles by the MD5 hash which Little CMS computes for us. The fingerprint is used for de-duplication: instead of creating copies, reference existing color profiles. This code is very much based on Sebastian Wick's earlier work on Weston color management, but structured and named differently. Co-authored-by:Sebastian Wick <sebastian@sebastianwick.net> Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.com>
parent
d6e8fe5e
This commit is part of merge request !637. Comments created here will be created in the context of that merge request.
Showing
- include/libweston/libweston.h 22 additions, 0 deletionsinclude/libweston/libweston.h
- libweston/color-lcms/color-lcms.c 4 additions, 0 deletionslibweston/color-lcms/color-lcms.c
- libweston/color-lcms/color-lcms.h 33 additions, 0 deletionslibweston/color-lcms/color-lcms.h
- libweston/color-lcms/color-profile.c 260 additions, 0 deletionslibweston/color-lcms/color-profile.c
- libweston/color-lcms/meson.build 1 addition, 0 deletionslibweston/color-lcms/meson.build
- libweston/color-noop.c 22 additions, 0 deletionslibweston/color-noop.c
- libweston/color.c 73 additions, 0 deletionslibweston/color.c
- libweston/color.h 49 additions, 0 deletionslibweston/color.h
Loading
Please register or sign in to comment