#[non_exhaustive]#[repr(u32)]pub enum TextureFormat {
R8G8B8A8_SRGB = 1,
R8G8B8A8_UNORM = 2,
}
Expand description
Describes how a texture stores its data.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
R8G8B8A8_SRGB = 1
32-bit-per-pixel, fixed-point pixel format assuming premultiplied alpha. SRGB encoded.
R8G8B8A8_UNORM = 2
32-bit-per-pixel, fixed-point pixel format assuming premultiplied alpha. Linear.
Implementations§
Source§impl TextureFormat
impl TextureFormat
Sourcepub fn bytes_per_pixel(&self) -> u64
pub fn bytes_per_pixel(&self) -> u64
The amount of storage required for a single texture pixel.
Trait Implementations§
Source§impl CheckedBitPattern for TextureFormat
impl CheckedBitPattern for TextureFormat
Source§type Bits = u32
type Bits = u32
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.Source§impl Clone for TextureFormat
impl Clone for TextureFormat
Source§fn clone(&self) -> TextureFormat
fn clone(&self) -> TextureFormat
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TextureFormat
impl Debug for TextureFormat
Source§impl PartialEq for TextureFormat
impl PartialEq for TextureFormat
impl Copy for TextureFormat
impl Eq for TextureFormat
impl NoUninit for TextureFormat
impl StructuralPartialEq for TextureFormat
Auto Trait Implementations§
impl Freeze for TextureFormat
impl RefUnwindSafe for TextureFormat
impl Send for TextureFormat
impl Sync for TextureFormat
impl Unpin for TextureFormat
impl UnwindSafe for TextureFormat
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
Mutably borrows from an owned value. Read more