Krita Source Code Documentation
Loading...
Searching...
No Matches
KisHDRMetadataOptions.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2019 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-or-later
5 */
6
8
10
11
13 : predefinedMasterDisplayId("p2100-pq")
14{
15}
16
18{
20
21 config->setProperty("predefinedMasterDisplayId", predefinedMasterDisplayId);
22
23 config->setProperty("redX", cvi.red.x);
24 config->setProperty("redY", cvi.red.y);
25
26 config->setProperty("greenX", cvi.green.x);
27 config->setProperty("greenY", cvi.green.y);
28
29 config->setProperty("blueX", cvi.blue.x);
30 config->setProperty("blueY", cvi.blue.y);
31
32 config->setProperty("whiteX", cvi.white.x);
33 config->setProperty("whiteY", cvi.white.y);
34
35 config->setProperty("minLuminance", cvi.maxLuminance);
36 config->setProperty("maxLuminance", cvi.minLuminance);
37
38 config->setProperty("maxCLL", clli.maxContentLightLevel);
39 config->setProperty("maxFALL", clli.maxFrameAverageLightLevel);
40
41 config->setProperty("hdrReferenceWhite", hdrReferenceWhite);
42
43 return config;
44}
45
47{
48 predefinedMasterDisplayId = config->getPropertyLazy("predefinedMasterDisplayId", predefinedMasterDisplayId);
49
50 cvi.red.x = config->getPropertyLazy("redX", cvi.red.x);
51 cvi.red.y = config->getPropertyLazy("redX", cvi.red.y);
52
53 cvi.green.x = (config->getPropertyLazy("greenX", cvi.green.x));
54 cvi.green.y = (config->getPropertyLazy("greenY", cvi.green.y));
55
56 cvi.blue.x = (config->getPropertyLazy("blueX", cvi.blue.x));
57 cvi.blue.y = (config->getPropertyLazy("blueY", cvi.blue.y));
58
59 cvi.white.x = (config->getPropertyLazy("whiteX", cvi.white.x));
60 cvi.white.y = (config->getPropertyLazy("whiteY", cvi.white.y));
61
62 cvi.minLuminance = config->getPropertyLazy("minLuminance", cvi.minLuminance);
63 cvi.maxLuminance = config->getPropertyLazy("maxLuminance", cvi.maxLuminance);
64
65 clli.maxContentLightLevel = config->getPropertyLazy("maxCLL", clli.maxContentLightLevel);
66 clli.maxFrameAverageLightLevel = config->getPropertyLazy("maxFALL", clli.maxFrameAverageLightLevel);
67
68 hdrReferenceWhite = config->getPropertyLazy("hdrReferenceWhite", hdrReferenceWhite);
69}
70
72{
73 auto cprim = [] (qreal x) { return int(x / 0.00002); };
74 auto lum = [] (qreal x) { return int(x / 0.0001); };
75
76 QString x265Params =
77 QString("-x265-params ");
78
80 x265Params += QString("master-display=G(%3,%4)B(%5,%6)R(%1,%2)WP(%7,%8)L(%9,%10):")
81 .arg(cprim(cvi.red.x)).arg(cprim(cvi.red.y))
82 .arg(cprim(cvi.green.x)).arg(cprim(cvi.green.y))
83 .arg(cprim(cvi.blue.x)).arg(cprim(cvi.blue.y))
84 .arg(cprim(cvi.white.x)).arg(cprim(cvi.white.y))
85 .arg(lum(cvi.maxLuminance)).arg(lum(cvi.minLuminance));
86 }
88 x265Params += QString("max-cll=%11,%12:")
91 }
92
93 x265Params += QString(
94 "colorprim=bt2020:"
95 "colormatrix=bt2020nc:"
96 "transfer=smpte2084:"
97 "range=full");
98
99 return x265Params;
100}
The KisColorVolumeInformation class is a struct that represents the 'mastering' display....
double maxLuminance
Maximum screen brightness in cd/m²
KoColorimetryUtils::xy blue
xyY location of the blue colorant.
double minLuminance
Minimum screen brightness in cd/m²
KoColorimetryUtils::xy white
xyY location of the whitepoint.
KoColorimetryUtils::xy red
xyY location of the red colorant.
KoColorimetryUtils::xy green
xyY location of the green colorant.
QString generateFFMpegOptions() const
KisRelativeContentLightLevelInformation clli
KisColorVolumeInformation cvi
KisPropertiesConfigurationSP toProperties() const
void fromProperties(KisPropertiesConfigurationSP config)
double maxFrameAverageLightLevel
maxFrameAverage MaxFrameAverageLightLevel or MaxFALL is the average of average pixel brightnesses in ...