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, ColorBitDepths,
33    ColorCapabilities, ColorFormat, ColorManagementData, DcmChannel, DigitalColorEncoding,
34    DisplayGamma, WhitePoint, color_capabilities_from_edid,
35};
36
37/// Input interface model types.
38pub mod input;
39pub use input::{AnalogSyncLevel, VideoInputFlags, VideoInterface};
40
41/// Display feature flags.
42pub mod features;
43pub use features::DisplayFeatureFlags;
44
45/// Manufacture date model types.
46pub mod manufacture;
47pub use manufacture::{ManufactureDate, ManufacturerId, MonitorString};
48
49/// Screen size and aspect ratio.
50pub mod screen;
51pub use screen::ScreenSize;
52
53/// Video timing formula types.
54pub mod timing;
55pub use timing::{
56    CvtAspectRatio, CvtAspectRatios, CvtScaling, CvtSupportParams, GtfSecondaryParams,
57    TimingFormula, pixel_clock_khz_cvt_rb_estimate,
58};
59
60/// Panel hardware characteristic types.
61pub mod panel;
62pub use panel::{
63    BacklightType, DisplayIdInterface, DisplayIdStereoInterface, DisplayIdTiledTopology,
64    DisplayInterfaceType, DisplayTechnology, InterfaceContentProtection, OperatingMode,
65    PhysicalOrientation, PowerSequencing, RotationCapability, ScanDirection, StereoSyncInterface,
66    StereoViewingMode, SubpixelLayout, TileBezelInfo, TileTopologyBehavior, ZeroPixelLocation,
67};
68
69/// Luminance transfer characteristic types.
70pub mod transfer;
71
72/// CEA-861 / CTA-861 extension block types.
73pub mod cea861;
74
75/// DisplayID 1.x extension block types.
76pub mod displayid;
77#[cfg(any(feature = "alloc", feature = "std"))]
78pub use displayid::DisplayIdCapabilities;
79
80/// Consumer-facing capability types.
81pub mod capabilities;
82#[cfg(any(feature = "alloc", feature = "std"))]
83pub use capabilities::{DisplayCapabilities, ExtensionData, ParseWarning};
84pub use capabilities::{EdidVersion, StereoMode, SyncDefinition, VideoMode};
85pub use transfer::TransferPointEncoding;
86#[cfg(any(feature = "alloc", feature = "std"))]
87pub use transfer::{DisplayIdTransferCharacteristic, TransferCurve};