liboptic_edid/structures/
basic_info.rs1use rust_decimal::Decimal;
4
5#[repr(C)]
6#[derive(Clone, Debug, PartialEq, PartialOrd)]
7pub struct BasicDisplayInfo {
8 pub input_definition: vsi::VideoSignalInterface,
9
10 pub screen_size_or_aspect_ratio: Option<SizeOrRatio>,
14
15 pub reported_gamma: Option<Decimal>,
19
20 pub feature_support: feature_support::FeatureSupport,
22}
23
24pub mod vsi {
25 #[repr(C)]
27 #[derive(Clone, Debug, PartialEq, PartialOrd)]
28 pub enum VideoSignalInterface {
29 Analog {
35 signal_level_standard: analog::SignalLevelStandard,
36 video_setup: analog::VideoSetup,
37 sync_types: analog::SyncTypes,
38 serrations: bool,
40 },
41
42 Digital {
43 color_bit_depth: digital::ColorBitDepth,
44 supported_interface: Option<digital::SupportedVideoInterface>,
45 },
46 }
47
48 pub mod analog {
49 #[repr(C)]
51 #[expect(non_camel_case_types)]
52 #[derive(Clone, Debug, PartialEq, PartialOrd)]
53 pub enum SignalLevelStandard {
54 _0700S_0300L_1000T,
56
57 _0714S_0286L_1000T,
59
60 _1000S_0400L_1400T,
62
63 _0700S_0000L_0700T,
65 }
66
67 #[repr(C)]
69 #[derive(Clone, Debug, PartialEq, PartialOrd)]
70 pub enum VideoSetup {
71 BlackLevel,
72 B2BOrPedestal,
73 }
74
75 #[repr(C)]
79 #[derive(Clone, Debug, PartialEq, PartialOrd)]
80 pub struct SyncTypes {
81 pub separate_sync_h_and_v: bool,
82 pub composite_sync_horizontal: bool,
83 pub composite_sync_green_video: bool,
84 }
85 }
86
87 pub mod digital {
88 #[repr(C)]
90 #[derive(Clone, Debug, PartialEq, PartialOrd)]
91 pub enum ColorBitDepth {
92 Undefined,
94 D6Bits,
95 D8Bits,
96 D10Bits,
97 D12Bits,
98 D14Bits,
99 D16Bits,
100 Reserved,
102 }
103
104 #[repr(C)]
106 #[derive(Clone, Debug, PartialEq, PartialOrd)]
107 pub enum SupportedVideoInterface {
108 Dvi,
109 HdmiA,
110 HdmiB,
111 Mddi,
112 DisplayPort,
113 }
114 }
115}
116
117#[repr(C)]
119#[derive(Clone, Debug, PartialEq, PartialOrd)]
120pub enum SizeOrRatio {
121 ScreenSize { horizontal_cm: u8, vertical_cm: u8 },
123
124 AspectRatio { horizontal: u16, vertical: u16 },
126}
127
128pub mod feature_support {
129 #[repr(C)]
130 #[derive(Clone, Debug, PartialEq, PartialOrd)]
131 pub struct FeatureSupport {
132 pub power_management: PowerManagement,
133 pub color_support: ColorSupport,
137
138 pub srgb_std: bool,
140
141 pub says_pixel_format_and_refresh: bool,
144
145 pub is_continuous_freq: bool,
147 }
148
149 #[repr(C)]
156 #[derive(Clone, Debug, PartialEq, PartialOrd)]
157 pub struct PowerManagement {
158 pub standby: bool,
159 pub suspend: bool,
160 pub active_off: bool,
161 }
162
163 #[repr(C)]
164 #[derive(Clone, Debug, PartialEq, PartialOrd)]
165 pub enum ColorSupport {
166 Type(ColorType),
167 EncodingFormats(ColorEncodingFormats),
168 }
169
170 #[repr(C)]
171 #[derive(Clone, Debug, PartialEq, PartialOrd)]
172 pub enum ColorType {
173 MonochromeOrGrayscale,
174 RgbColor,
175 NonRgbColor,
176 Undefined,
177 }
178
179 #[repr(C)]
180 #[expect(non_camel_case_types)]
181 #[derive(Clone, Debug, PartialEq, PartialOrd)]
182 pub enum ColorEncodingFormats {
183 Rgb444,
184 Rgb444_YCrCb444,
185 Rgb444_YCrCb422,
186 Rgb444_YCrCb444_YCrCb422,
187 }
188}