• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright © 2013 Richard Hughes
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining
5  * a copy of this software and associated documentation files (the
6  * "Software"), to deal in the Software without restriction, including
7  * without limitation the rights to use, copy, modify, merge, publish,
8  * distribute, sublicense, and/or sell copies of the Software, and to
9  * permit persons to whom the Software is furnished to do so, subject to
10  * the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the
13  * next paragraph) shall be included in all copies or substantial
14  * portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19  * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
20  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23  * SOFTWARE.
24  */
25 
26 #ifndef _WESTON_CMS_H_
27 #define _WESTON_CMS_H_
28 
29 #include "config.h"
30 
31 #include <libweston/libweston.h>
32 
33 /* General overview on how to be a CMS plugin:
34  *
35  * First, some nomenclature:
36  *
37  *  CMF:       Color management framework, i.e. "Use foo.icc for device $bar"
38  *  CMM:       Color management module that converts pixel colors, which is
39  *             usually lcms2 on any modern OS.
40  *  CMS:       Color management system that encompasses both a CMF and CMM.
41  *  ICC:       International Color Consortium, the people that define the
42  *             binary encoding of a .icc file.
43  *  VCGT:      Video Card Gamma Tag. An Apple extension to the ICC specification
44  *             that allows the calibration state to be stored in the ICC profile
45  *  Output:    Physical port with a display attached, e.g. LVDS1
46  *
47  * As a CMF is probably something you don't want or need on an embedded install
48  * these functions will not be called if the icc_profile key is set for a
49  * specific [output] section in weston.ini
50  *
51  * Most desktop environments want the CMF to decide what profile to use in
52  * different situations, so that displays can be profiled and also so that
53  * the ICC profiles can be changed at runtime depending on the task or ambient
54  * environment.
55  *
56  * The CMF can be selected using the 'modules' key in the [core] section.
57  */
58 
59 struct weston_color_profile {
60 	char	*filename;
61 	void	*lcms_handle;
62 };
63 
64 void
65 weston_cms_set_color_profile(struct weston_output *o,
66 			     struct weston_color_profile *p);
67 struct weston_color_profile *
68 weston_cms_create_profile(const char *filename,
69 			  void *lcms_profile);
70 struct weston_color_profile *
71 weston_cms_load_profile(const char *filename);
72 void
73 weston_cms_destroy_profile(struct weston_color_profile *p);
74 
75 #endif
76