Skip to main content

display_types/
features.rs

1bitflags::bitflags! {
2    /// Boolean capability flags from EDID base block byte `0x18` (Display Feature Support).
3    ///
4    /// Bits 4–3 of this byte encode a color type / supported encoding field whose meaning
5    /// differs for digital and analog displays. That field is not represented here — it
6    /// requires a dedicated enum and will be added alongside color encoding support.
7    ///
8    /// | Bit | Mask   | Meaning                                                      |
9    /// |-----|--------|--------------------------------------------------------------|
10    /// | 7   | `0x80` | DPMS standby supported                                      |
11    /// | 6   | `0x40` | DPMS suspend supported                                       |
12    /// | 5   | `0x20` | DPMS active-off supported                                    |
13    /// | 2   | `0x04` | sRGB is the default color space                             |
14    /// | 1   | `0x02` | Preferred timing includes native pixel format and rate       |
15    /// | 0   | `0x01` | Continuous timings supported (GTF or CVT, EDID 1.4+)         |
16    #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
17    #[derive(Debug, Clone, Copy, PartialEq, Eq)]
18    pub struct DisplayFeatureFlags: u8 {
19        /// DPMS standby mode is supported.
20        const DPMS_STANDBY        = 0x80;
21        /// DPMS suspend mode is supported.
22        const DPMS_SUSPEND        = 0x40;
23        /// DPMS active-off mode is supported.
24        const DPMS_ACTIVE_OFF     = 0x20;
25        /// sRGB is the default color space for this display.
26        const SRGB                = 0x04;
27        /// The preferred timing mode (first DTD) includes the native pixel format
28        /// and preferred refresh rate.
29        const PREFERRED_TIMING    = 0x02;
30        /// Continuous timings are supported via GTF or CVT (EDID 1.4+).
31        const CONTINUOUS_TIMINGS  = 0x01;
32    }
33}