pub enum SurfaceColorFormat {
Rgba8Unorm,
Rgba8UnormSrgb,
Bgra8Unorm,
Bgra8UnormSrgb,
Rgb10a2Unorm,
Rgba16Float,
}Expand description
A supported colour surface format.
Variants§
Rgba8Unorm
8 bits per channel, sRGB-encoded. Standard SDR format.
Rgba8UnormSrgb
8 bits per channel, gamma-corrected sRGB (GPU applies sRGB encoding on store / decoding on sample).
Bgra8Unorm
8 bits per channel, BGRA byte order (common on Windows/Metal).
Bgra8UnormSrgb
8 bits per channel, BGRA, sRGB.
Rgb10a2Unorm
10 bits per colour channel + 2-bit alpha, sRGB. Increases precision for SDR content; may be used for extended-range (scRGB) content.
Rgba16Float
16 bits per channel, floating-point (linear light). HDR-capable.
Implementations§
Source§impl SurfaceColorFormat
impl SurfaceColorFormat
Sourcepub fn wgpu_format(self) -> TextureFormat
pub fn wgpu_format(self) -> TextureFormat
Return the corresponding wgpu::TextureFormat.
Sourcepub fn is_hdr(self) -> bool
pub fn is_hdr(self) -> bool
Return true if this format is capable of representing HDR values
(i.e. luminance > 1.0 in linear light).
Sourcepub fn bits_per_channel(self) -> u32
pub fn bits_per_channel(self) -> u32
Return the nominal bits per channel for this format.
Sourcepub fn expects_linear_light(self) -> bool
pub fn expects_linear_light(self) -> bool
Return true if the GPU pipeline should output linear light values
when rendering into this format (as opposed to gamma-encoded sRGB).
Rgba16Float expects linear light. The Unorm variants are usually
treated as gamma-encoded sRGB in practice; the UnormSrgb variants
have explicit sRGB encoding built into the attachment load/store.
Trait Implementations§
Source§impl Clone for SurfaceColorFormat
impl Clone for SurfaceColorFormat
Source§fn clone(&self) -> SurfaceColorFormat
fn clone(&self) -> SurfaceColorFormat
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 SurfaceColorFormat
Source§impl Debug for SurfaceColorFormat
impl Debug for SurfaceColorFormat
Source§impl Default for SurfaceColorFormat
impl Default for SurfaceColorFormat
Source§fn default() -> SurfaceColorFormat
fn default() -> SurfaceColorFormat
impl Eq for SurfaceColorFormat
Source§impl Hash for SurfaceColorFormat
impl Hash for SurfaceColorFormat
Source§impl PartialEq for SurfaceColorFormat
impl PartialEq for SurfaceColorFormat
Source§fn eq(&self, other: &SurfaceColorFormat) -> bool
fn eq(&self, other: &SurfaceColorFormat) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SurfaceColorFormat
Auto Trait Implementations§
impl Freeze for SurfaceColorFormat
impl RefUnwindSafe for SurfaceColorFormat
impl Send for SurfaceColorFormat
impl Sync for SurfaceColorFormat
impl Unpin for SurfaceColorFormat
impl UnsafeUnpin for SurfaceColorFormat
impl UnwindSafe for SurfaceColorFormat
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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