Skip to main content

ConnectorCapabilities

Struct ConnectorCapabilities 

Source
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: u32

The connector this describes.

§max_bpc: Option<MaxBpc>

The max bpc range, if the connector has one.

§has_hdr_output_metadata: bool

Whether HDR_OUTPUT_METADATA is exposed.

Implementations§

Source§

impl ConnectorCapabilities

Source

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.

Source

pub const fn with_colorspace(self, entry: Colorspace, value: u64) -> Self

Give a Colorspace entry the driver integer value.

Source

pub const fn with_broadcast_rgb(self, entry: BroadcastRgb, value: u64) -> Self

Give a Broadcast RGB entry the driver integer value.

Source

pub const fn with_max_bpc(self, max_bpc: MaxBpc) -> Self

Give the connector a max bpc range.

Source

pub const fn with_hdr_output_metadata(self, present: bool) -> Self

Say whether the connector exposes HDR_OUTPUT_METADATA.

Source

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.

Source

pub fn from_properties( device: &Device, properties: &PropertyStore, connector_id: u32, ) -> Self

As ConnectorCapabilities::probe, from a cache the caller already filled in.

Source

pub const fn colorspace(&self, entry: Colorspace) -> Option<u64>

The driver’s integer for a Colorspace entry, if it has one.

Source

pub const fn broadcast_rgb(&self, entry: BroadcastRgb) -> Option<u64>

The driver’s integer for a Broadcast RGB entry, if it has one.

Source

pub fn has_colorspace(&self) -> bool

Whether the connector exposes Colorspace at all.

Source

pub fn has_broadcast_rgb(&self) -> bool

Whether the connector exposes Broadcast RGB at all.

Source

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.

Trait Implementations§

Source§

impl Clone for ConnectorCapabilities

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ConnectorCapabilities

Source§

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

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

impl Eq for ConnectorCapabilities

Source§

impl PartialEq for ConnectorCapabilities

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ConnectorCapabilities

Auto Trait Implementations§

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.