blob: a919a42a820254fe8fd0bdd7437c3078f1081fca [file] [log] [blame]
Richard Hughesb24e48e2013-05-09 20:31:09 +01001/*
2 * Copyright © 2013 Richard Hughes
3 *
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.
13 *
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.
21 */
22
23#ifndef _WESTON_CMS_H_
24#define _WESTON_CMS_H_
25
26#include "compositor.h"
27
28/* General overview on how to be a CMS plugin:
29 *
30 * First, some nomenclature:
31 *
32 * CMF: Color management framework, i.e. "Use foo.icc for device $bar"
33 * CMM: Color management module that converts pixel colors, which is
34 * usually lcms2 on any modern OS.
35 * CMS: Color management system that encompasses both a CMF and CMM.
36 * ICC: International Color Consortium, the people that define the
37 * binary encoding of a .icc file.
38 * VCGT: Video Card Gamma Tag. An Apple extension to the ICC specification
39 * that allows the calibration state to be stored in the ICC profile
40 * Output: Physical port with a display attached, e.g. LVDS1
41 *
42 * As a CMF is probably something you don't want or need on an embeded install
43 * these functions will not be called if the icc_profile key is set for a
44 * specific [output] section in weston.ini
45 *
46 * Most desktop environments want the CMF to decide what profile to use in
47 * different situations, so that displays can be profiled and also so that
48 * the ICC profiles can be changed at runtime depending on the task or ambient
49 * environment.
50 *
51 * The CMF can be selected using the 'modules' key in the [core] section.
52 */
53
54struct weston_color_profile {
55 char *filename;
56 void *lcms_handle;
57};
58
59void
60weston_cms_set_color_profile(struct weston_output *o,
61 struct weston_color_profile *p);
62struct weston_color_profile *
63weston_cms_create_profile(const char *filename,
64 void *lcms_profile);
65struct weston_color_profile *
66weston_cms_load_profile(const char *filename);
67void
68weston_cms_destroy_profile(struct weston_color_profile *p);
69
70#endif