Skip to main content

display_types/
lib.rs

1//! Shared display capability types for display connection negotiation.
2//!
3//! Provides the [`DisplayCapabilities`] struct and all supporting types produced by
4//! display data parsers (e.g. EDID, DisplayID) and consumed by negotiation engines.
5//!
6//! # Feature flags
7//!
8//! - **`std`** *(default)* — enables `std`-dependent types; implies `alloc`.
9//! - **`alloc`** — enables heap-allocated types (`Vec`, `Arc`, `String`) without full `std`.
10//! - **`serde`** — derives `Serialize`/`Deserialize` for all public types.
11//!
12//! With neither `std` nor `alloc` the crate compiles in bare `no_std` mode, exposing
13//! only the scalar types (enums and copy structs).
14#![no_std]
15#![forbid(unsafe_code)]
16#![deny(missing_docs)]
17
18#[cfg(feature = "alloc")]
19extern crate alloc;
20
21#[cfg(feature = "std")]
22extern crate std;
23
24/// Re-exports of `alloc`/`std` collection types used across the crate.
25pub mod prelude;
26#[cfg(any(feature = "alloc", feature = "std"))]
27pub use prelude::{Arc, Box, String, Vec};
28
29/// Color-related model types.
30pub mod color;
31pub use color::{
32    AnalogColorType, Chromaticity, ChromaticityPoint, ColorBitDepth, ColorManagementData,
33    DcmChannel, DigitalColorEncoding, DisplayGamma, WhitePoint,
34};
35
36/// Input interface model types.
37pub mod input;
38pub use input::{AnalogSyncLevel, VideoInputFlags, VideoInterface};
39
40/// Display feature flags.
41pub mod features;
42pub use features::DisplayFeatureFlags;
43
44/// Manufacture date model types.
45pub mod manufacture;
46pub use manufacture::{ManufactureDate, ManufacturerId, MonitorString};
47
48/// Screen size and aspect ratio.
49pub mod screen;
50pub use screen::ScreenSize;
51
52/// Video timing formula types.
53pub mod timing;
54pub use timing::{
55    CvtAspectRatio, CvtAspectRatios, CvtScaling, CvtSupportParams, GtfSecondaryParams,
56    TimingFormula,
57};
58
59/// Panel hardware characteristic types.
60pub mod panel;
61pub use panel::{
62    BacklightType, DisplayIdInterface, DisplayIdStereoInterface, DisplayIdTiledTopology,
63    DisplayInterfaceType, DisplayTechnology, InterfaceContentProtection, OperatingMode,
64    PhysicalOrientation, PowerSequencing, RotationCapability, ScanDirection, StereoSyncInterface,
65    StereoViewingMode, SubpixelLayout, TileBezelInfo, TileTopologyBehavior, ZeroPixelLocation,
66};
67
68/// Luminance transfer characteristic types.
69pub mod transfer;
70
71/// Consumer-facing capability types.
72pub mod capabilities;
73#[cfg(any(feature = "alloc", feature = "std"))]
74pub use capabilities::{DisplayCapabilities, ExtensionData, ParseWarning};
75pub use capabilities::{EdidVersion, StereoMode, SyncDefinition, VideoMode};
76pub use transfer::TransferPointEncoding;
77#[cfg(any(feature = "alloc", feature = "std"))]
78pub use transfer::{DisplayIdTransferCharacteristic, TransferCurve};