MythTV master
mythhdr.h
Go to the documentation of this file.
1#ifndef MYTHHDR_H
2#define MYTHHDR_H
3
4// Qt
5#include <QObject>
6
7// Std
8#include <memory>
9
10// MythTV
11#include "mythuiexp.h"
12#include "mythcolourspace.h"
13
14using MythHDRMetaPtr = std::shared_ptr<class MythHDRMetadata>;
16{
17 public:
18 MythHDRMetadata() = default;
19 explicit MythHDRMetadata(const MythHDRMetadata& Other) = default;
20 bool Equals(MythHDRMetadata* Other);
21
22 MythPrimariesUInt16 m_displayPrimaries {{{ 0 }}};
23 MythPrimaryUInt16 m_whitePoint {{ 0 }};
24 uint16_t m_maxMasteringLuminance { 0 };
25 uint16_t m_minMasteringLuminance { 0 };
26 uint16_t m_maxContentLightLevel { 0 };
27 uint16_t m_maxFrameAverageLightLevel { 0 };
28};
29
30using MythHDRPtr = std::shared_ptr<class MythHDR>;
32{
33 Q_GADGET
34
35 public:
36 enum HDRType : std::uint8_t
37 {
38 SDR = 0x00,
39 HDR10 = 0x01,
40 HLG = 0x02
41 };
42 Q_DECLARE_FLAGS(HDRTypes, HDRType)
43 Q_FLAG(HDRTypes)
44
45 using MythHDRDesc = std::tuple<HDRTypes,double,double,double>;
46 static MythHDRPtr Create(class MythDisplay* MDisplay, const MythHDRDesc& Desc);
47 virtual ~MythHDR() = default;
48 virtual void SetHDRMetadata(HDRType /*Type*/, const MythHDRMetaPtr& /*Metadata*/) {}
49
50 static QString TypeToString (HDRType Type);
51 static QStringList TypesToString(HDRTypes Types);
52 QStringList TypesToString() const;
53 bool IsControllable() const;
54 double GetMaxLuminance() const;
55
56 HDRType m_currentType { SDR };
57 HDRTypes m_supportedTypes { SDR };
58
59 protected:
60 explicit MythHDR(const MythHDRDesc& Desc);
61
62 bool m_controllable { false };
63 double m_minLuminance { 0.0 };
64 double m_maxAvgLuminance { 0.0 };
65 double m_maxLuminance { 0.0 };
66
67 private:
68 Q_DISABLE_COPY(MythHDR)
69};
70
71#endif
Encapsulates HDR metadata conformant with Static Metadata Type 1 per CTA-861-G Final.
Definition: mythhdr.h:16
MythHDRMetadata()=default
MythHDRMetadata(const MythHDRMetadata &Other)=default
HDRType
Definition: mythhdr.h:37
std::tuple< HDRTypes, double, double, double > MythHDRDesc
Definition: mythhdr.h:45
unsigned short uint16_t
Definition: iso6937tables.h:3
std::array< uint16_t, 2 > MythPrimaryUInt16
std::array< MythPrimaryUInt16, 3 > MythPrimariesUInt16
std::tuple< MythHDR::HDRTypes, double, double, double > MythHDRDesc
Definition: mythedid.h:18
std::shared_ptr< class MythHDR > MythHDRPtr
Definition: mythhdr.h:30
std::shared_ptr< class MythHDRMetadata > MythHDRMetaPtr
Definition: mythhdr.h:14
#define MUI_PUBLIC
Definition: mythuiexp.h:9
STL namespace.