pub struct ConnectorCapabilities {
pub connector_id: u32,
pub max_bpc: Option<MaxBpc>,
pub has_hdr_output_metadata: bool,
/* private fields */
}Expand description
What one connector’s color properties can be set to.
Fields§
§connector_id: u32The connector this describes.
max_bpc: Option<MaxBpc>The max bpc range, if the connector has one.
has_hdr_output_metadata: boolWhether HDR_OUTPUT_METADATA is exposed.
Implementations§
Source§impl ConnectorCapabilities
impl ConnectorCapabilities
Sourcepub const fn new(connector_id: u32) -> Self
pub const fn new(connector_id: u32) -> Self
A connector with none of these properties.
The starting point for a synthetic one – a fixture, a test, a capability set read from somewhere other than a live device.
Sourcepub const fn with_colorspace(self, entry: Colorspace, value: u64) -> Self
pub const fn with_colorspace(self, entry: Colorspace, value: u64) -> Self
Give a Colorspace entry the driver integer value.
Sourcepub const fn with_broadcast_rgb(self, entry: BroadcastRgb, value: u64) -> Self
pub const fn with_broadcast_rgb(self, entry: BroadcastRgb, value: u64) -> Self
Give a Broadcast RGB entry the driver integer value.
Sourcepub const fn with_max_bpc(self, max_bpc: MaxBpc) -> Self
pub const fn with_max_bpc(self, max_bpc: MaxBpc) -> Self
Give the connector a max bpc range.
Sourcepub const fn with_hdr_output_metadata(self, present: bool) -> Self
pub const fn with_hdr_output_metadata(self, present: bool) -> Self
Say whether the connector exposes HDR_OUTPUT_METADATA.
Sourcepub fn probe(device: &Device, connector_id: u32) -> Result<Self>
pub fn probe(device: &Device, connector_id: u32) -> Result<Self>
Read a connector’s color properties.
A property the connector does not have is simply absent. The only error is not being able to read the property set at all.
§Errors
CoreError::NoSuchObject for
connector id 0; otherwise CoreError::Io
if the connector’s properties cannot be read.
Sourcepub fn from_properties(
device: &Device,
properties: &PropertyStore,
connector_id: u32,
) -> Self
pub fn from_properties( device: &Device, properties: &PropertyStore, connector_id: u32, ) -> Self
As ConnectorCapabilities::probe, from a cache the caller already
filled in.
Sourcepub const fn colorspace(&self, entry: Colorspace) -> Option<u64>
pub const fn colorspace(&self, entry: Colorspace) -> Option<u64>
The driver’s integer for a Colorspace entry, if it has one.
Sourcepub const fn broadcast_rgb(&self, entry: BroadcastRgb) -> Option<u64>
pub const fn broadcast_rgb(&self, entry: BroadcastRgb) -> Option<u64>
The driver’s integer for a Broadcast RGB entry, if it has one.
Sourcepub fn has_colorspace(&self) -> bool
pub fn has_colorspace(&self) -> bool
Whether the connector exposes Colorspace at all.
Sourcepub fn has_broadcast_rgb(&self) -> bool
pub fn has_broadcast_rgb(&self) -> bool
Whether the connector exposes Broadcast RGB at all.
Sourcepub fn can_signal_hdr(&self) -> bool
pub fn can_signal_hdr(&self) -> bool
Whether this connector could carry an HDR signal.
Both halves are needed. HDR_OUTPUT_METADATA alone at eight bits per
component gives a sink that accepts the metadata and displays banded
SDR; ten bits without the metadata is a wider SDR signal. A caller
that checks only one ships a picture that looks wrong for reasons no
error reports.