MythTV  master
mythedid.h
Go to the documentation of this file.
1 #ifndef MYTHEDID_H
2 #define MYTHEDID_H
3 
4 // C++
5 #include <array>
6 
7 // Qt
8 #include <QSize>
9 #include <QStringList>
10 
11 // MythTV
12 #include "mythuiexp.h"
13 
14 using PrimarySpace = std::array<std::array<float,2>,3>;
15 using WhiteSpace = std::array<float,2>;
16 
18 {
19  public:
20  // This structure matches VideoColourSpace::ColourPrimaries
21  // TODO move ColourPrimaries into MythDisplay
22  struct Primaries
23  {
26  };
27 
28  MythEDID(void) = default;
29  explicit MythEDID(QByteArray &Data);
30  MythEDID(const char* Data, int Length);
31 
32  bool Valid (void) const;
33  QStringList SerialNumbers (void) const;
34  QSize DisplaySize (void) const;
35  double DisplayAspect (void) const;
36  uint16_t PhysicalAddress (void) const;
37  float Gamma (void) const;
38  bool IsHDMI (void) const;
39  bool IsSRGB (void) const;
40  bool IsLikeSRGB (void) const;
41  Primaries ColourPrimaries (void) const;
42  int AudioLatency (bool Interlaced) const;
43  int VideoLatency (bool Interlaced) const;
44  void Debug (void) const;
45 
46  private:
47  void Parse (void);
48  bool ParseBaseBlock (const quint8 *Data);
49  bool ParseCTA861 (const quint8 *Data, uint Offset);
50  bool ParseCTABlock (const quint8 *Data, uint Offset);
51  bool ParseVSDB (const quint8 *Data, uint Offset, uint Length);
52 
53  bool m_valid { false };
54  QByteArray m_data { };
55  uint m_size { 0 };
56  quint8 m_minorVersion { 0 };
57  QSize m_displaySize { }; // N.B. Either size or aspect are valid
58  double m_displayAspect { 0.0 };
59  QStringList m_serialNumbers { };
60  float m_gamma { 0.0F }; // Invalid
61  bool m_sRGB { false };
62  bool m_likeSRGB { false }; // Temporary until Colourspace handling in libmythui
63  Primaries m_primaries { {{{0.0F, 0.0F}, {0.0F, 0.0F}, {0.0F, 0.0F}}}, {0.0F, 0.0F} };
64  bool m_isHDMI { false };
65  uint16_t m_physicalAddress { 0 };
66  bool m_latencies { false };
67  bool m_interLatencies { false };
68  std::array<int,2> m_audioLatency { 0 };
69  std::array<int,2> m_videoLatency { 0 };
70 };
71 
72 #endif // MYTHEDID_H
MythEDID::Primaries::primaries
PrimarySpace primaries
Definition: mythedid.h:24
PrimarySpace
std::array< std::array< float, 2 >, 3 > PrimarySpace
Definition: mythvideocolourspace.h:17
MUI_PUBLIC
#define MUI_PUBLIC
Definition: mythuiexp.h:9
MythEDID::Primaries::whitepoint
WhiteSpace whitepoint
Definition: mythedid.h:25
Parse
Definition: rssparse.h:189
WhiteSpace
std::array< float, 2 > WhiteSpace
Definition: mythvideocolourspace.h:18
MythEDID::MythEDID
MythEDID(void)=default
uint
unsigned int uint
Definition: compat.h:141
ColourPrimaries
static HostComboBoxSetting * ColourPrimaries()
Definition: globalsettings.cpp:74
MythEDID::Primaries
Definition: mythedid.h:23
uint16_t
unsigned short uint16_t
Definition: iso6937tables.h:3
mythuiexp.h
MythEDID
Definition: mythedid.h:18