Asset -> MXF in some cases.
[libdcp.git] / test / opendcp_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 namespace opendcp
24 {
25
26 #define BIT_DEPTH      12 
27 #define BIT_PRECISION  16 
28 #define COLOR_DEPTH    (4095)
29 #define DCI_LUT_SIZE   ((COLOR_DEPTH + 1) * BIT_PRECISION)
30 #define DCI_GAMMA      (2.6)
31 #define DCI_DEGAMMA    (1/DCI_GAMMA)
32 #define DCI_COEFFICENT (48.0/52.37)
33
34 enum COLOR_PROFILE_ENUM {
35     CP_SRGB = 0,
36     CP_REC709,
37     CP_DC28,
38     CP_MAX
39 };
40
41 enum LUT_IN_ENUM {
42     LI_SRGB    = 0,
43     LI_REC709,
44     LI_MAX
45 };
46
47 enum LUT_OUT_ENUM {
48     LO_DCI    = 0,
49     LO_MAX
50 };
51
52 extern float color_matrix[3][3][3];
53 extern float lut_in[LI_MAX][4095+1];
54 extern int lut_out[1][DCI_LUT_SIZE];
55
56 }