Krita Source Code Documentation
Loading...
Searching...
No Matches
KisHDRMetadataOptions Struct Reference

#include <KisHDRMetadataOptions.h>

Public Member Functions

void fromProperties (KisPropertiesConfigurationSP config)
 
QString generateFFMpegOptions () const
 
 KisHDRMetadataOptions ()
 
KisPropertiesConfigurationSP toProperties () const
 

Public Attributes

KisRelativeContentLightLevelInformation clli
 
KisColorVolumeInformation cvi
 
double hdrReferenceWhite = 80
 
QString predefinedMasterDisplayId
 

Detailed Description

Definition at line 14 of file KisHDRMetadataOptions.h.

Constructor & Destructor Documentation

◆ KisHDRMetadataOptions()

KisHDRMetadataOptions::KisHDRMetadataOptions ( )

Definition at line 12 of file KisHDRMetadataOptions.cpp.

13 : predefinedMasterDisplayId("p2100-pq")
14{
15}

Member Function Documentation

◆ fromProperties()

void KisHDRMetadataOptions::fromProperties ( KisPropertiesConfigurationSP config)

Definition at line 46 of file KisHDRMetadataOptions.cpp.

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}
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.
KisRelativeContentLightLevelInformation clli
KisColorVolumeInformation cvi
double maxFrameAverageLightLevel
maxFrameAverage MaxFrameAverageLightLevel or MaxFALL is the average of average pixel brightnesses in ...

References KisColorVolumeInformation::blue, clli, cvi, KisColorVolumeInformation::green, hdrReferenceWhite, KisRelativeContentLightLevelInformation::maxContentLightLevel, KisRelativeContentLightLevelInformation::maxFrameAverageLightLevel, KisColorVolumeInformation::maxLuminance, KisColorVolumeInformation::minLuminance, predefinedMasterDisplayId, KisColorVolumeInformation::red, KisColorVolumeInformation::white, KoColorimetryUtils::xy::x, and KoColorimetryUtils::xy::y.

◆ generateFFMpegOptions()

QString KisHDRMetadataOptions::generateFFMpegOptions ( ) const

Definition at line 71 of file KisHDRMetadataOptions.cpp.

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....

References KisColorVolumeInformation::blue, clli, cvi, KisColorVolumeInformation::green, hdrReferenceWhite, KisRelativeContentLightLevelInformation::maxContentLightLevel, KisRelativeContentLightLevelInformation::maxFrameAverageLightLevel, KisColorVolumeInformation::maxLuminance, KisColorVolumeInformation::minLuminance, KisColorVolumeInformation::red, KisColorVolumeInformation::white, KoColorimetryUtils::xy::x, and KoColorimetryUtils::xy::y.

◆ toProperties()

KisPropertiesConfigurationSP KisHDRMetadataOptions::toProperties ( ) const

Definition at line 17 of file KisHDRMetadataOptions.cpp.

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}

References KisColorVolumeInformation::blue, clli, cvi, KisColorVolumeInformation::green, hdrReferenceWhite, KisRelativeContentLightLevelInformation::maxContentLightLevel, KisRelativeContentLightLevelInformation::maxFrameAverageLightLevel, KisColorVolumeInformation::maxLuminance, KisColorVolumeInformation::minLuminance, predefinedMasterDisplayId, KisColorVolumeInformation::red, KisColorVolumeInformation::white, KoColorimetryUtils::xy::x, and KoColorimetryUtils::xy::y.

Member Data Documentation

◆ clli

KisRelativeContentLightLevelInformation KisHDRMetadataOptions::clli

Definition at line 22 of file KisHDRMetadataOptions.h.

◆ cvi

KisColorVolumeInformation KisHDRMetadataOptions::cvi

Definition at line 20 of file KisHDRMetadataOptions.h.

◆ hdrReferenceWhite

double KisHDRMetadataOptions::hdrReferenceWhite = 80

Definition at line 24 of file KisHDRMetadataOptions.h.

◆ predefinedMasterDisplayId

QString KisHDRMetadataOptions::predefinedMasterDisplayId

Definition at line 18 of file KisHDRMetadataOptions.h.


The documentation for this struct was generated from the following files: