pub enum SurfaceFormat {
Rgba8UnormSrgb,
Bgra8UnormSrgb,
Rgba8Unorm,
}Expand description
Pixel format of an AppTexture. The widget composites by sampling
the texture; the backend picks a sampler / shader path that matches.
0.3.4 ships the three RGBA8 variants below — enough for 3D viewport
output (typically a surface-format-matching *Srgb), video decoded
to RGBA, and rumble-style animated frames. Future variants (HDR,
YUV) slot in here without breaking the widget surface.
Variants§
Rgba8UnormSrgb
8-bit RGBA, sRGB-encoded. Sampling decodes to linear, matching
the rest of Aetna’s pipeline (stock::image, text, rounded_rect).
Bgra8UnormSrgb
8-bit BGRA, sRGB-encoded. The native swapchain format on most platforms — apps that render their 3D scene into a swapchain- shaped texture can hand it in directly.
Rgba8Unorm
8-bit RGBA, linear. For content that’s already in linear space (e.g. tone-mapped HDR collapsed to 8-bit, ink rasterisers) and shouldn’t go through an extra sRGB decode.
Trait Implementations§
Source§impl Clone for SurfaceFormat
impl Clone for SurfaceFormat
Source§fn clone(&self) -> SurfaceFormat
fn clone(&self) -> SurfaceFormat
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SurfaceFormat
impl Debug for SurfaceFormat
Source§impl PartialEq for SurfaceFormat
impl PartialEq for SurfaceFormat
Source§fn eq(&self, other: &SurfaceFormat) -> bool
fn eq(&self, other: &SurfaceFormat) -> bool
self and other values to be equal, and is used by ==.impl Copy for SurfaceFormat
impl Eq for SurfaceFormat
impl StructuralPartialEq for SurfaceFormat
Auto Trait Implementations§
impl Freeze for SurfaceFormat
impl RefUnwindSafe for SurfaceFormat
impl Send for SurfaceFormat
impl Sync for SurfaceFormat
impl Unpin for SurfaceFormat
impl UnsafeUnpin for SurfaceFormat
impl UnwindSafe for SurfaceFormat
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
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.