blob: 0e08b418126957f9e5d6a39c3ebc6da2d5c41503 [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
Daniel Stone8e7a8bd2013-08-15 01:10:24 +010026#include "config.h"
27
Richard Hughesb24e48e2013-05-09 20:31:09 +010028#include "compositor.h"
29
30/* General overview on how to be a CMS plugin:
31 *
32 * First, some nomenclature:
33 *
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
43 *
Bryce Harringtona86c3ee2015-03-18 18:42:00 -070044 * As a CMF is probably something you don't want or need on an embedded install
Richard Hughesb24e48e2013-05-09 20:31:09 +010045 * these functions will not be called if the icc_profile key is set for a
46 * specific [output] section in weston.ini
47 *
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
51 * environment.
52 *
53 * The CMF can be selected using the 'modules' key in the [core] section.
54 */
55
56struct weston_color_profile {
57 char *filename;
58 void *lcms_handle;
59};
60
61void
62weston_cms_set_color_profile(struct weston_output *o,
63 struct weston_color_profile *p);
64struct weston_color_profile *
65weston_cms_create_profile(const char *filename,
66 void *lcms_profile);
67struct weston_color_profile *
68weston_cms_load_profile(const char *filename);
69void
70weston_cms_destroy_profile(struct weston_color_profile *p);
71
72#endif