Move things round a bit.
[dcpomatic.git] / src / lib / lut.h
1 /*
2     Taken from OpenDCP: Builds Digital Cinema Packages
3     Copyright (c) 2010-2011 Terrence Meiczinger, All Rights Reserved
4
5     This program is free software: you can redistribute it and/or modify
6     it under the terms of the GNU General Public License as published by
7     the Free Software Foundation, either version 3 of the License, or
8     (at your option) any later version.
9
10     This program is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13     GNU General Public License for more details.
14
15     You should have received a copy of the GNU General Public License
16     along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 /** @file src/lut.h
20  *  @brief Look-up tables for colour conversions (from OpenDCP)
21  */
22
23 #define BIT_DEPTH      12 
24 #define BIT_PRECISION  16 
25 #define COLOR_DEPTH    (4095)
26 #define DCI_LUT_SIZE   ((COLOR_DEPTH + 1) * BIT_PRECISION)
27 #define DCI_GAMMA      (2.6)
28 #define DCI_DEGAMMA    (1/DCI_GAMMA)
29 #define DCI_COEFFICENT (48.0/52.37)
30
31 enum COLOR_PROFILE_ENUM {
32     CP_SRGB = 0,
33     CP_REC709,
34     CP_DC28,
35     CP_MAX
36 };
37
38 enum LUT_IN_ENUM {
39     LI_SRGB    = 0,
40     LI_REC709,
41     LI_MAX
42 };
43
44 enum LUT_OUT_ENUM {
45     LO_DCI    = 0,
46     LO_MAX
47 };
48
49 extern float color_matrix[3][3][3];
50 extern float lut_in[LI_MAX][4095+1];
51 extern int lut_out[1][DCI_LUT_SIZE];