pub struct SurfaceDisplay {
pub known: bool,
pub hdr: bool,
pub headroom: f32,
pub potential_headroom: f32,
pub output_headroom: f32,
pub sdr_white_nits: Option<f32>,
pub peak_nits: Option<f32>,
pub full_frame_nits: Option<f32>,
pub refresh_hz: Option<f32>,
pub variable_refresh: Option<bool>,
pub refresh_period: Option<Duration>,
pub last_vblank: Option<u64>,
}Expand description
A display, in a surface’s unit: 1.0 is SDR (paper) white, as in macOS EDR and as Windows
composes SDR content, so scRGB is this scaled by Self::sdr_white_nits / 80.
Fields§
§known: boolWhether the platform reported it: not on Linux, and not before the window first drew.
hdr: boolThe display is in HDR: Windows’ HDR (PQ) mode, or a macOS screen with EDR headroom.
headroom: f32The brightest value it shows now; 1.0 on an SDR display. On macOS it follows the brightness.
potential_headroom: f32The brightest it can show (macOS at full brightness); headroom on Windows.
output_headroom: f32The brightest value a surface’s frame reaches the display with: headroom where the
window can draw HDR (Windows, macOS), else 1.0, where frames are clamped.
sdr_white_nits: Option<f32>SDR white in nits: Windows in HDR mode (its SDR content brightness setting).
peak_nits: Option<f32>The display’s peak and full-frame luminance in nits, where Windows knows them.
full_frame_nits: Option<f32>§refresh_hz: Option<f32>The refresh rate in Hz: Windows’ current mode, the screen’s maximum on macOS.
variable_refresh: Option<bool>Whether the screen refreshes at a variable rate (macOS: ProMotion, Adaptive-Sync).
refresh_period: Option<Duration>The display’s nominal refresh period: the compositor’s on Windows, else from refresh_hz.
last_vblank: Option<u64>When its last vblank was, in monotonic_ns’s clock, as info() was called. Off Windows
it is extrapolated from the last frame shown, so it is known once one was.
Implementations§
Trait Implementations§
Source§impl Clone for SurfaceDisplay
impl Clone for SurfaceDisplay
Source§fn clone(&self) -> SurfaceDisplay
fn clone(&self) -> SurfaceDisplay
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SurfaceDisplay
Source§impl Debug for SurfaceDisplay
impl Debug for SurfaceDisplay
Source§impl Default for SurfaceDisplay
impl Default for SurfaceDisplay
Source§fn default() -> SurfaceDisplay
fn default() -> SurfaceDisplay
Source§impl PartialEq for SurfaceDisplay
impl PartialEq for SurfaceDisplay
impl StructuralPartialEq for SurfaceDisplay
Auto Trait Implementations§
impl Forget for SurfaceDisplay
impl Freeze for SurfaceDisplay
impl Move for SurfaceDisplay
impl RefUnwindSafe for SurfaceDisplay
impl Send for SurfaceDisplay
impl Sync for SurfaceDisplay
impl Unpin for SurfaceDisplay
impl UnsafeUnpin for SurfaceDisplay
impl UnwindSafe for SurfaceDisplay
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more