Richard Hughes | b24e48e | 2013-05-09 20:31:09 +0100 | [diff] [blame] | 1 | /* |
| 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 Stone | 8e7a8bd | 2013-08-15 01:10:24 +0100 | [diff] [blame] | 26 | #include "config.h" |
| 27 | |
Richard Hughes | b24e48e | 2013-05-09 20:31:09 +0100 | [diff] [blame] | 28 | #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 Harrington | a86c3ee | 2015-03-18 18:42:00 -0700 | [diff] [blame^] | 44 | * As a CMF is probably something you don't want or need on an embedded install |
Richard Hughes | b24e48e | 2013-05-09 20:31:09 +0100 | [diff] [blame] | 45 | * 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 | |
| 56 | struct weston_color_profile { |
| 57 | char *filename; |
| 58 | void *lcms_handle; |
| 59 | }; |
| 60 | |
| 61 | void |
| 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, |
| 66 | void *lcms_profile); |
| 67 | struct weston_color_profile * |
| 68 | weston_cms_load_profile(const char *filename); |
| 69 | void |
| 70 | weston_cms_destroy_profile(struct weston_color_profile *p); |
| 71 | |
| 72 | #endif |