Skip to main content

StaticDisplayCapabilities

Struct StaticDisplayCapabilities 

Source
#[non_exhaustive]
pub struct StaticDisplayCapabilities<const MAX_MODES: usize> {
Show 50 fields pub manufacturer: Option<ManufacturerId>, pub manufacture_date: Option<ManufactureDate>, pub edid_version: Option<EdidVersion>, pub product_code: Option<u16>, pub serial_number: Option<u32>, pub serial_number_string: Option<MonitorString>, pub display_name: Option<MonitorString>, pub unspecified_text: [Option<MonitorString>; 4], pub white_points: [Option<WhitePoint>; 2], pub digital: bool, pub color_bit_depth: Option<ColorBitDepth>, pub display_technology: Option<DisplayTechnology>, pub display_subtype: Option<u8>, pub operating_mode: Option<OperatingMode>, pub backlight_type: Option<BacklightType>, pub data_enable_used: Option<bool>, pub data_enable_positive: Option<bool>, pub native_pixels: Option<(u16, u16)>, pub panel_aspect_ratio_100: Option<u8>, pub physical_orientation: Option<PhysicalOrientation>, pub rotation_capability: Option<RotationCapability>, pub zero_pixel_location: Option<ZeroPixelLocation>, pub scan_direction: Option<ScanDirection>, pub subpixel_layout: Option<SubpixelLayout>, pub pixel_pitch_hundredths_mm: Option<(u8, u8)>, pub pixel_response_time_ms: Option<u8>, pub power_sequencing: Option<PowerSequencing>, pub display_id_interface: Option<DisplayIdInterface>, pub stereo_interface: Option<DisplayIdStereoInterface>, pub tiled_topology: Option<DisplayIdTiledTopology>, pub chromaticity: Chromaticity, pub gamma: Option<DisplayGamma>, pub display_features: Option<DisplayFeatureFlags>, pub digital_color_encoding: Option<DigitalColorEncoding>, pub analog_color_type: Option<AnalogColorType>, pub video_interface: Option<VideoInterface>, pub analog_sync_level: Option<AnalogSyncLevel>, pub screen_size: Option<ScreenSize>, pub min_v_rate: Option<u16>, pub max_v_rate: Option<u16>, pub min_h_rate_khz: Option<u16>, pub max_h_rate_khz: Option<u16>, pub max_pixel_clock_mhz: Option<u16>, pub preferred_image_size_mm: Option<(u16, u16)>, pub timing_formula: Option<TimingFormula>, pub color_management: Option<ColorManagementData>, pub supported_modes: [Option<VideoMode>; MAX_MODES], pub num_modes: usize, pub warnings: [Option<EdidWarning>; 8], pub num_warnings: usize,
}
Expand description

No-alloc display capability model derived from a parsed EDID.

Contains the same scalar fields as DisplayCapabilities plus a fixed-capacity mode list. Use MAX_MODES to set the maximum number of video modes that can be stored; 64 is a reasonable default for most displays (real displays rarely declare more than ~40 modes). Modes beyond the capacity are silently dropped, matching the behaviour of the 8-entry warning cap.

Produced by capabilities_from_edid_static.

§Stack size

At MAX_MODES = 64 this struct is approximately 3 KB. On targets with very limited stack space, consider placing the value in a static mut or a statically-allocated buffer rather than on the stack.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§manufacturer: Option<ManufacturerId>

Three-character PNP manufacturer ID (e.g. GSM for LG, SAM for Samsung).

§manufacture_date: Option<ManufactureDate>

Manufacture date or model year, decoded from bytes 16–17.

§edid_version: Option<EdidVersion>

EDID specification version and revision, decoded from bytes 18–19.

§product_code: Option<u16>

Manufacturer-assigned product code.

§serial_number: Option<u32>

Manufacturer-assigned serial number, if encoded numerically in the base block.

§serial_number_string: Option<MonitorString>

Serial number string from the monitor serial number descriptor (0xFF), if present.

§display_name: Option<MonitorString>

Human-readable display name from the monitor name descriptor, if present.

§unspecified_text: [Option<MonitorString>; 4]

Unspecified ASCII text strings from 0xFE descriptors, in descriptor slot order.

Up to four entries (one per descriptor slot). Each slot is None if the corresponding descriptor was not a 0xFE entry.

§white_points: [Option<WhitePoint>; 2]

Additional white points from the 0xFB descriptor.

Up to two entries (the EDID 0xFB descriptor has two fixed slots). Each slot is None if the corresponding entry was unused (index byte 0x00).

§digital: bool

true if the display uses a digital input interface.

§color_bit_depth: Option<ColorBitDepth>

Color bit depth per primary channel, decoded from byte 0x14 bits 6–4. None for analog displays or when the field is undefined or reserved.

§display_technology: Option<DisplayTechnology>

Physical display technology (e.g. TFT, OLED, PDP), from DisplayID 0x0C byte 0 bits 7:4. None when the Display Device Data Block is absent.

§display_subtype: Option<u8>

Technology-specific sub-type code, from DisplayID 0x0C byte 0 bits 3:0 (raw, 0–15). None when the Display Device Data Block is absent.

§operating_mode: Option<OperatingMode>

Panel operating mode (continuous or non-continuous refresh), from DisplayID 0x0C byte 1 bits 3:0. None when the Display Device Data Block is absent.

§backlight_type: Option<BacklightType>

Backlight type, from DisplayID 0x0C byte 1 bits 5:4. None when the Display Device Data Block is absent.

§data_enable_used: Option<bool>

Whether the panel uses a Data Enable (DE) signal, from DisplayID 0x0C byte 1 bit 6. None when the Display Device Data Block is absent.

§data_enable_positive: Option<bool>

Data Enable signal polarity: true = positive, false = negative. From DisplayID 0x0C byte 1 bit 7. Valid only when data_enable_used is Some(true). None when the Display Device Data Block is absent.

§native_pixels: Option<(u16, u16)>

Native pixel format (width_px, height_px) from DisplayID 0x0C bytes 2–5. None when the Display Device Data Block is absent or either dimension is zero.

§panel_aspect_ratio_100: Option<u8>

Panel aspect ratio encoded as (AR − 1) × 100 (raw byte), from DisplayID 0x0C byte 6. For example 77 represents approximately 16:9 (AR ≈ 1.77). None when the block is absent.

§physical_orientation: Option<PhysicalOrientation>

Physical mounting orientation of the panel, from DisplayID 0x0C byte 7 bits 1:0. None when the Display Device Data Block is absent.

§rotation_capability: Option<RotationCapability>

Panel rotation capability, from DisplayID 0x0C byte 7 bits 3:2. None when the Display Device Data Block is absent.

§zero_pixel_location: Option<ZeroPixelLocation>

Location of the zero (origin) pixel in the framebuffer, from DisplayID 0x0C byte 7 bits 5:4. None when the Display Device Data Block is absent.

§scan_direction: Option<ScanDirection>

Fast-scan direction relative to H-sync, from DisplayID 0x0C byte 7 bits 7:6. None when the Display Device Data Block is absent.

§subpixel_layout: Option<SubpixelLayout>

Sub-pixel color filter arrangement, from DisplayID 0x0C byte 8. None when the Display Device Data Block is absent.

§pixel_pitch_hundredths_mm: Option<(u8, u8)>

Pixel pitch (horizontal_hundredths_mm, vertical_hundredths_mm) in 0.01 mm units, from DisplayID 0x0C bytes 9–10. None when the Display Device Data Block is absent or either pitch is zero.

§pixel_response_time_ms: Option<u8>

Pixel response time in milliseconds, from DisplayID 0x0C byte 12. None when the Display Device Data Block is absent or the value is zero.

§power_sequencing: Option<PowerSequencing>

Interface power sequencing timing parameters from DisplayID 0x0D. None when the Interface Power Sequencing Block is absent.

§display_id_interface: Option<DisplayIdInterface>

Physical display interface capabilities from DisplayID 0x0F. None when the Display Interface Data Block is absent.

§stereo_interface: Option<DisplayIdStereoInterface>

Stereo display interface parameters from DisplayID 0x10. None when the Stereo Display Interface Data Block is absent.

§tiled_topology: Option<DisplayIdTiledTopology>

Tiled display topology from DisplayID 0x12. None when the Tiled Display Topology Data Block is absent.

§chromaticity: Chromaticity

CIE xy chromaticity coordinates for the color primaries and white point, decoded from bytes 0x190x22.

§gamma: Option<DisplayGamma>

Display gamma from byte 0x17. None if the display did not specify a gamma value.

§display_features: Option<DisplayFeatureFlags>

Display feature support flags from byte 0x18.

§digital_color_encoding: Option<DigitalColorEncoding>

Supported color encoding formats, decoded from byte 0x18 bits 4–3. Only populated for EDID 1.4+ digital displays.

§analog_color_type: Option<AnalogColorType>

Color type, decoded from byte 0x18 bits 4–3. Only populated for analog displays; None for the undefined value (0b11).

§video_interface: Option<VideoInterface>

Video interface type, decoded from byte 0x14 bits 3–0. None for analog displays or when the field is undefined or reserved.

§analog_sync_level: Option<AnalogSyncLevel>

Analog sync and video white levels, decoded from byte 0x14 bits 6–5. Only populated for analog displays.

§screen_size: Option<ScreenSize>

Physical screen dimensions or aspect ratio, decoded from bytes 0x150x16. None when both bytes are zero (undefined).

§min_v_rate: Option<u16>

Minimum supported vertical refresh rate in Hz.

§max_v_rate: Option<u16>

Maximum supported vertical refresh rate in Hz.

§min_h_rate_khz: Option<u16>

Minimum supported horizontal scan rate in kHz.

§max_h_rate_khz: Option<u16>

Maximum supported horizontal scan rate in kHz.

§max_pixel_clock_mhz: Option<u16>

Maximum pixel clock in MHz.

§preferred_image_size_mm: Option<(u16, u16)>

Physical image area dimensions in millimetres (width_mm, height_mm), decoded from the first detailed timing descriptor that provides non-zero values (bytes 12–14).

More precise than screen_size (which is in cm from the base block header). None when all DTD image-size fields are zero.

§timing_formula: Option<TimingFormula>

Video timing formula reported in the display range limits descriptor (0xFD), byte 10.

§color_management: Option<ColorManagementData>

DCM polynomial coefficients decoded from a Color Management Data descriptor (0xF9).

§supported_modes: [Option<VideoMode>; MAX_MODES]

Video modes decoded from the base block and extension handlers.

Populated up to MAX_MODES entries. Use iter_modes for a safe iterator that respects num_modes.

§num_modes: usize

Number of valid entries in supported_modes.

§warnings: [Option<EdidWarning>; 8]

Non-fatal conditions collected from the parser and all handlers.

Capped at 8 entries; warnings beyond the first 8 are silently dropped. Use iter_warnings for a safe iterator.

§num_warnings: usize

Number of valid entries in warnings.

Implementations§

Source§

impl<const MAX_MODES: usize> StaticDisplayCapabilities<MAX_MODES>

Source

pub fn iter_modes(&self) -> impl Iterator<Item = &VideoMode>

Returns an iterator over decoded video modes.

Source

pub fn iter_warnings(&self) -> impl Iterator<Item = &EdidWarning>

Returns an iterator over collected warnings.

Trait Implementations§

Source§

impl<const MAX_MODES: usize> Clone for StaticDisplayCapabilities<MAX_MODES>

Source§

fn clone(&self) -> StaticDisplayCapabilities<MAX_MODES>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const MAX_MODES: usize> Debug for StaticDisplayCapabilities<MAX_MODES>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const MAX_MODES: usize> Default for StaticDisplayCapabilities<MAX_MODES>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<const MAX_MODES: usize> ModeSink for StaticDisplayCapabilities<MAX_MODES>

Source§

fn push_mode(&mut self, mode: VideoMode)

Push a decoded video mode. Duplicate modes (same width, height, refresh rate, and interlace flag) are silently ignored.
Source§

fn push_warning(&mut self, w: EdidWarning)

Push a non-fatal warning encountered while processing a block.

Auto Trait Implementations§

§

impl<const MAX_MODES: usize> Freeze for StaticDisplayCapabilities<MAX_MODES>

§

impl<const MAX_MODES: usize> RefUnwindSafe for StaticDisplayCapabilities<MAX_MODES>

§

impl<const MAX_MODES: usize> Send for StaticDisplayCapabilities<MAX_MODES>

§

impl<const MAX_MODES: usize> Sync for StaticDisplayCapabilities<MAX_MODES>

§

impl<const MAX_MODES: usize> Unpin for StaticDisplayCapabilities<MAX_MODES>

§

impl<const MAX_MODES: usize> UnsafeUnpin for StaticDisplayCapabilities<MAX_MODES>

§

impl<const MAX_MODES: usize> UnwindSafe for StaticDisplayCapabilities<MAX_MODES>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ExtensionData for T
where T: Any + Debug + Send + Sync,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Returns self as &dyn Any to enable downcasting.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.