2 * Copyright © 2013 Richard Hughes
4 * Permission to use, copy, modify, distribute, and sell this software and
5 * its documentation for any purpose is hereby granted without fee, provided
6 * that the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation, and that the name of the copyright holders not be used in
9 * advertising or publicity pertaining to distribution of the software
10 * without specific, written prior permission. The copyright holders make
11 * no representations about the suitability of this software for any
12 * purpose. It is provided "as is" without express or implied warranty.
14 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
15 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
17 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
18 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
19 * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
20 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 #ifndef _WESTON_CMS_H_
24 #define _WESTON_CMS_H_
28 #include "compositor.h"
30 /* General overview on how to be a CMS plugin:
32 * First, some nomenclature:
34 * CMF: Color management framework, i.e. "Use foo.icc for device $bar"
35 * CMM: Color management module that converts pixel colors, which is
36 * usually lcms2 on any modern OS.
37 * CMS: Color management system that encompasses both a CMF and CMM.
38 * ICC: International Color Consortium, the people that define the
39 * binary encoding of a .icc file.
40 * VCGT: Video Card Gamma Tag. An Apple extension to the ICC specification
41 * that allows the calibration state to be stored in the ICC profile
42 * Output: Physical port with a display attached, e.g. LVDS1
44 * As a CMF is probably something you don't want or need on an embeded install
45 * these functions will not be called if the icc_profile key is set for a
46 * specific [output] section in weston.ini
48 * Most desktop environments want the CMF to decide what profile to use in
49 * different situations, so that displays can be profiled and also so that
50 * the ICC profiles can be changed at runtime depending on the task or ambient
53 * The CMF can be selected using the 'modules' key in the [core] section.
56 struct weston_color_profile {
62 weston_cms_set_color_profile(struct weston_output *o,
63 struct weston_color_profile *p);
64 struct weston_color_profile *
65 weston_cms_create_profile(const char *filename,
67 struct weston_color_profile *
68 weston_cms_load_profile(const char *filename);
70 weston_cms_destroy_profile(struct weston_color_profile *p);