blob: 402652e69a162cb790c393d1bae806c0c650808a [file] [log] [blame]
Richard Hughesb24e48e2013-05-09 20:31:09 +01001/*
2 * Copyright © 2013 Richard Hughes
3 *
Bryce Harringtona0bbfea2015-06-11 15:35:43 -07004 * 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:
Richard Hughesb24e48e2013-05-09 20:31:09 +010011 *
Bryce Harringtona0bbfea2015-06-11 15:35:43 -070012 * 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.
Richard Hughesb24e48e2013-05-09 20:31:09 +010024 */
25
26#ifndef _WESTON_CMS_H_
27#define _WESTON_CMS_H_
28
Daniel Stone8e7a8bd2013-08-15 01:10:24 +010029#include "config.h"
30
Richard Hughesb24e48e2013-05-09 20:31:09 +010031#include "compositor.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 *
Bryce Harringtona86c3ee2015-03-18 18:42:00 -070047 * As a CMF is probably something you don't want or need on an embedded install
Richard Hughesb24e48e2013-05-09 20:31:09 +010048 * 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
59struct weston_color_profile {
60 char *filename;
61 void *lcms_handle;
62};
63
64void
65weston_cms_set_color_profile(struct weston_output *o,
66 struct weston_color_profile *p);
67struct weston_color_profile *
68weston_cms_create_profile(const char *filename,
69 void *lcms_profile);
70struct weston_color_profile *
71weston_cms_load_profile(const char *filename);
72void
73weston_cms_destroy_profile(struct weston_color_profile *p);
74
75#endif