-
Notifications
You must be signed in to change notification settings - Fork 10
/
ColorConfig.ts
137 lines (120 loc) · 4.17 KB
/
ColorConfig.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
import {map, mapArray} from '../common/Mapper';
import ChromaLocation from './ChromaLocation';
import ColorPrimaries from './ColorPrimaries';
import ColorRange from './ColorRange';
import ColorSpace from './ColorSpace';
import ColorTransfer from './ColorTransfer';
import InputColorPrimaries from './InputColorPrimaries';
import InputColorRange from './InputColorRange';
import InputColorSpace from './InputColorSpace';
import InputColorTransfer from './InputColorTransfer';
/**
* @export
* @class ColorConfig
*/
export class ColorConfig {
/**
* Copy the chroma location setting from the input source
* @type {boolean}
* @memberof ColorConfig
*/
public copyChromaLocationFlag?: boolean;
/**
* Copy the color space setting from the input source
* @type {boolean}
* @memberof ColorConfig
*/
public copyColorSpaceFlag?: boolean;
/**
* Copy the color primaries setting from the input source
* @type {boolean}
* @memberof ColorConfig
*/
public copyColorPrimariesFlag?: boolean;
/**
* Copy the color range setting from the input source
* @type {boolean}
* @memberof ColorConfig
*/
public copyColorRangeFlag?: boolean;
/**
* Copy the color transfer setting from the input source
* @type {boolean}
* @memberof ColorConfig
*/
public copyColorTransferFlag?: boolean;
/**
* The chroma location to be applied
* @type {ChromaLocation}
* @memberof ColorConfig
*/
public chromaLocation?: ChromaLocation;
/**
* The color space to be applied. If used on a Dolby Vision stream, this value must be set to UNSPECIFIED.
* @type {ColorSpace}
* @memberof ColorConfig
*/
public colorSpace?: ColorSpace;
/**
* The color primaries to be applied. If used on a Dolby Vision stream, this value must be set to UNSPECIFIED.
* @type {ColorPrimaries}
* @memberof ColorConfig
*/
public colorPrimaries?: ColorPrimaries;
/**
* The color range to be applied. If used on a Dolby Vision stream, this value must be set to JPEG.
* @type {ColorRange}
* @memberof ColorConfig
*/
public colorRange?: ColorRange;
/**
* The color transfer to be applied. If used on a Dolby Vision stream, this value must be set to UNSPECIFIED.
* @type {ColorTransfer}
* @memberof ColorConfig
*/
public colorTransfer?: ColorTransfer;
/**
* Override the color space detected in the input file. If not set the input color space will be automatically detected if possible.
* @type {InputColorSpace}
* @memberof ColorConfig
*/
public inputColorSpace?: InputColorSpace;
/**
* Override the color range detected in the input file. If not set the input color range will be automatically detected if possible.
* @type {InputColorRange}
* @memberof ColorConfig
*/
public inputColorRange?: InputColorRange;
/**
* Override the color primaries detected in the input file. If not set the input color primaries will be automatically detected if possible.
* @type {InputColorPrimaries}
* @memberof ColorConfig
*/
public inputColorPrimaries?: InputColorPrimaries;
/**
* Override the color transfer detected in the input file. If not set the input color transfer will be automatically detected if possible.
* @type {InputColorTransfer}
* @memberof ColorConfig
*/
public inputColorTransfer?: InputColorTransfer;
constructor(obj?: Partial<ColorConfig>) {
if(!obj) {
return;
}
this.copyChromaLocationFlag = map(obj.copyChromaLocationFlag);
this.copyColorSpaceFlag = map(obj.copyColorSpaceFlag);
this.copyColorPrimariesFlag = map(obj.copyColorPrimariesFlag);
this.copyColorRangeFlag = map(obj.copyColorRangeFlag);
this.copyColorTransferFlag = map(obj.copyColorTransferFlag);
this.chromaLocation = map(obj.chromaLocation);
this.colorSpace = map(obj.colorSpace);
this.colorPrimaries = map(obj.colorPrimaries);
this.colorRange = map(obj.colorRange);
this.colorTransfer = map(obj.colorTransfer);
this.inputColorSpace = map(obj.inputColorSpace);
this.inputColorRange = map(obj.inputColorRange);
this.inputColorPrimaries = map(obj.inputColorPrimaries);
this.inputColorTransfer = map(obj.inputColorTransfer);
}
}
export default ColorConfig;