#[non_exhaustive]pub struct VideoMode {Show 13 fields
pub width: u16,
pub height: u16,
pub refresh_rate: u8,
pub interlaced: bool,
pub h_front_porch: u16,
pub h_sync_width: u16,
pub v_front_porch: u16,
pub v_sync_width: u16,
pub h_border: u8,
pub v_border: u8,
pub stereo: StereoMode,
pub sync: Option<SyncDefinition>,
pub pixel_clock_khz: Option<u32>,
}Expand description
A display video mode expressed as resolution, refresh rate, and scan type.
Use VideoMode::new to construct a mode with only identity fields (the common case
for modes decoded from standard timing or SVD entries). Use
VideoMode::with_detailed_timing to add the blanking-interval and signal fields
available from a Detailed Timing Descriptor or equivalent.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.width: u16Horizontal resolution in pixels.
height: u16Vertical resolution in pixels.
refresh_rate: u8Refresh rate in Hz.
interlaced: booltrue for interlaced modes; false for progressive (the common case).
h_front_porch: u16Horizontal front porch in pixels (0 when not decoded from a DTD).
h_sync_width: u16Horizontal sync pulse width in pixels (0 when not decoded from a DTD).
v_front_porch: u16Vertical front porch in lines (0 when not decoded from a DTD).
v_sync_width: u16Vertical sync pulse width in lines (0 when not decoded from a DTD).
h_border: u8Horizontal border width in pixels on each side of the active area (0 when not from a DTD).
v_border: u8Vertical border height in lines on each side of the active area (0 when not from a DTD).
stereo: StereoModeStereo viewing support (default StereoMode::None for non-DTD modes).
sync: Option<SyncDefinition>Sync signal definition (None for non-DTD modes).
pixel_clock_khz: Option<u32>Pixel clock in kHz (None for modes not decoded from a Detailed Timing Descriptor).
Implementations§
Source§impl VideoMode
impl VideoMode
Sourcepub fn new(width: u16, height: u16, refresh_rate: u8, interlaced: bool) -> Self
pub fn new(width: u16, height: u16, refresh_rate: u8, interlaced: bool) -> Self
Constructs a VideoMode with the given identity fields.
All blanking-interval fields (h_front_porch, h_sync_width, v_front_porch,
v_sync_width, h_border, v_border) default to 0, stereo defaults to
StereoMode::None, and sync defaults to None. Use
with_detailed_timing to set those fields when
decoding from a Detailed Timing Descriptor.
Sourcepub fn with_detailed_timing(
self,
pixel_clock_khz: u32,
h_front_porch: u16,
h_sync_width: u16,
v_front_porch: u16,
v_sync_width: u16,
h_border: u8,
v_border: u8,
stereo: StereoMode,
sync: Option<SyncDefinition>,
) -> Self
pub fn with_detailed_timing( self, pixel_clock_khz: u32, h_front_porch: u16, h_sync_width: u16, v_front_porch: u16, v_sync_width: u16, h_border: u8, v_border: u8, stereo: StereoMode, sync: Option<SyncDefinition>, ) -> Self
Adds blanking-interval and signal fields decoded from a Detailed Timing Descriptor or equivalent source, returning the updated mode.
The 9-parameter count mirrors the DTD fields directly (EDID §3.10.3 / DisplayID §4.4).