MythTV master
mythhdr.cpp
Go to the documentation of this file.
1#include "libmythbase/mythconfig.h"
2
3// MythTV
4#include "mythhdr.h"
5#include "mythdisplay.h"
6
7#if CONFIG_DRM && CONFIG_QTPRIVATEHEADERS
9#endif
10
15{
16 return Other &&
21 m_whitePoint[0] == Other->m_whitePoint[0] &&
22 m_whitePoint[1] == Other->m_whitePoint[1] &&
23 m_displayPrimaries[0][0] == Other->m_displayPrimaries[0][0] &&
24 m_displayPrimaries[0][1] == Other->m_displayPrimaries[0][1] &&
25 m_displayPrimaries[1][0] == Other->m_displayPrimaries[1][0] &&
26 m_displayPrimaries[1][1] == Other->m_displayPrimaries[1][1] &&
27 m_displayPrimaries[2][0] == Other->m_displayPrimaries[2][0] &&
28 m_displayPrimaries[2][1] == Other->m_displayPrimaries[2][1];
29}
30
31MythHDRPtr MythHDR::Create([[maybe_unused]] MythDisplay* MDisplay,
32 const MythHDRDesc& Desc)
33{
34 MythHDRPtr result = nullptr;
35
36 // Only try and create a controllable device if the display supports HDR
37 if (std::get<0>(Desc) > SDR)
38 {
39#if CONFIG_DRM && CONFIG_QTPRIVATEHEADERS
40 result = MythDRMHDR::Create(MDisplay, Desc);
41#endif
42 }
43
44 if (!result)
45 result = std::shared_ptr<MythHDR>(new MythHDR(Desc));
46 return result;
47}
48
50 : m_supportedTypes(std::get<0>(Desc)),
51 m_minLuminance(std::get<1>(Desc)),
52 m_maxAvgLuminance(std::get<2>(Desc)),
53 m_maxLuminance(std::get<3>(Desc))
54{
55}
56
58{
59 return m_controllable;
60}
61
63{
64 return m_maxLuminance;
65}
66
68{
69 if (Type & HDR10) return QObject::tr("HDR10");
70 if (Type & HLG) return QObject::tr("Hybrid Log-Gamma");
71 return QObject::tr("Unknown");
72}
73
74QStringList MythHDR::TypesToString(HDRTypes Types)
75{
76 QStringList res;
77 if (Types & HDR10) res << TypeToString(HDR10);
78 if (Types & HLG) res << TypeToString(HLG);
79 if (res.empty()) res << QObject::tr("None");
80 return res;
81}
82
83QStringList MythHDR::TypesToString() const
84{
86}
static MythHDRPtr Create(class MythDisplay *MDisplay, const MythHDRDesc &Desc)
Definition: mythdrmhdr.cpp:52
Encapsulates HDR metadata conformant with Static Metadata Type 1 per CTA-861-G Final.
Definition: mythhdr.h:16
uint16_t m_maxFrameAverageLightLevel
Definition: mythhdr.h:27
uint16_t m_maxContentLightLevel
Definition: mythhdr.h:26
MythPrimariesUInt16 m_displayPrimaries
Definition: mythhdr.h:22
bool Equals(MythHDRMetadata *Other)
Definition: mythhdr.cpp:14
uint16_t m_minMasteringLuminance
Definition: mythhdr.h:25
MythPrimaryUInt16 m_whitePoint
Definition: mythhdr.h:23
uint16_t m_maxMasteringLuminance
Definition: mythhdr.h:24
double GetMaxLuminance() const
Definition: mythhdr.cpp:62
QStringList TypesToString() const
Definition: mythhdr.cpp:83
HDRType
Definition: mythhdr.h:37
@ SDR
Definition: mythhdr.h:38
@ HDR10
Definition: mythhdr.h:39
@ HLG
Definition: mythhdr.h:40
static QString TypeToString(HDRType Type)
Definition: mythhdr.cpp:67
bool m_controllable
Definition: mythhdr.h:62
bool IsControllable() const
Definition: mythhdr.cpp:57
HDRTypes m_supportedTypes
Definition: mythhdr.h:57
static MythHDRPtr Create(class MythDisplay *MDisplay, const MythHDRDesc &Desc)
Definition: mythhdr.cpp:31
double m_maxLuminance
Definition: mythhdr.h:65
std::tuple< HDRTypes, double, double, double > MythHDRDesc
Definition: mythhdr.h:45
MythHDR(const MythHDRDesc &Desc)
Definition: mythhdr.cpp:49
std::shared_ptr< class MythHDR > MythHDRPtr
Definition: mythhdr.h:30
STL namespace.