Mir
edid.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2016-2020 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Nick Dedekind <nick.dedekind@canonical.com>
17  */
18 
19 #ifndef MIROIL_EDID_H
20 #define MIROIL_EDID_H
21 
22 #include <string>
23 #include <vector>
24 
25 namespace miroil
26 {
27 
28 struct Edid
29 {
30  std::string vendor;
31  uint16_t product_code{0};
32  uint32_t serial_number{0};
33 
34  struct PhysicalSizeMM { int width; int height; };
36 
37  struct Descriptor {
38  enum class Type : uint8_t {
39  timing_identifiers = 0xfa,
40  white_point_data = 0xfb,
41  monitor_name = 0xfc,
42  monitor_limits = 0xfd,
43  unspecified_text = 0xfe,
44  serial_number = 0xff,
45 
46  undefined = 0x00,
47  };
48 
49  union Value {
50  char monitor_name[13];
51  char unspecified_text[13];
52  char serial_number[13];
53  };
54 
56  Value value{{0}};
57 
58  std::string string_value() const;
59  };
61 
62  Edid& parse_data(std::vector<uint8_t> const&);
63 };
64 
65 }
66 
67 #endif // MIROIL_EDID_H
Definition: compositor.h:21
Definition: edid.h:37
std::string string_value() const
Value value
Definition: edid.h:56
Type
Definition: edid.h:38
Type type
Definition: edid.h:55
Definition: edid.h:34
int height
Definition: edid.h:34
int width
Definition: edid.h:34
Definition: edid.h:29
uint16_t product_code
Definition: edid.h:31
Edid & parse_data(std::vector< uint8_t > const &)
std::string vendor
Definition: edid.h:30
PhysicalSizeMM size
Definition: edid.h:35
Descriptor descriptors[4]
Definition: edid.h:60
uint32_t serial_number
Definition: edid.h:32
Definition: edid.h:49
char unspecified_text[13]
Definition: edid.h:51
char monitor_name[13]
Definition: edid.h:50
char serial_number[13]
Definition: edid.h:52

Copyright © 2012-2022 Canonical Ltd.
Generated on Fri Feb 25 18:01:13 UTC 2022
This documentation is licensed under the GPL version 2 or 3.