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