gfx_hal::format

Enum Format

Source
#[repr(u32)]
pub enum Format {
Show 184 variants Rg4Unorm = 1, Rgba4Unorm, Bgra4Unorm, R5g6b5Unorm, B5g6r5Unorm, R5g5b5a1Unorm, B5g5r5a1Unorm, A1r5g5b5Unorm, R8Unorm, R8Snorm, R8Uscaled, R8Sscaled, R8Uint, R8Sint, R8Srgb, Rg8Unorm, Rg8Snorm, Rg8Uscaled, Rg8Sscaled, Rg8Uint, Rg8Sint, Rg8Srgb, Rgb8Unorm, Rgb8Snorm, Rgb8Uscaled, Rgb8Sscaled, Rgb8Uint, Rgb8Sint, Rgb8Srgb, Bgr8Unorm, Bgr8Snorm, Bgr8Uscaled, Bgr8Sscaled, Bgr8Uint, Bgr8Sint, Bgr8Srgb, Rgba8Unorm, Rgba8Snorm, Rgba8Uscaled, Rgba8Sscaled, Rgba8Uint, Rgba8Sint, Rgba8Srgb, Bgra8Unorm, Bgra8Snorm, Bgra8Uscaled, Bgra8Sscaled, Bgra8Uint, Bgra8Sint, Bgra8Srgb, Abgr8Unorm, Abgr8Snorm, Abgr8Uscaled, Abgr8Sscaled, Abgr8Uint, Abgr8Sint, Abgr8Srgb, A2r10g10b10Unorm, A2r10g10b10Snorm, A2r10g10b10Uscaled, A2r10g10b10Sscaled, A2r10g10b10Uint, A2r10g10b10Sint, A2b10g10r10Unorm, A2b10g10r10Snorm, A2b10g10r10Uscaled, A2b10g10r10Sscaled, A2b10g10r10Uint, A2b10g10r10Sint, R16Unorm, R16Snorm, R16Uscaled, R16Sscaled, R16Uint, R16Sint, R16Sfloat, Rg16Unorm, Rg16Snorm, Rg16Uscaled, Rg16Sscaled, Rg16Uint, Rg16Sint, Rg16Sfloat, Rgb16Unorm, Rgb16Snorm, Rgb16Uscaled, Rgb16Sscaled, Rgb16Uint, Rgb16Sint, Rgb16Sfloat, Rgba16Unorm, Rgba16Snorm, Rgba16Uscaled, Rgba16Sscaled, Rgba16Uint, Rgba16Sint, Rgba16Sfloat, R32Uint, R32Sint, R32Sfloat, Rg32Uint, Rg32Sint, Rg32Sfloat, Rgb32Uint, Rgb32Sint, Rgb32Sfloat, Rgba32Uint, Rgba32Sint, Rgba32Sfloat, R64Uint, R64Sint, R64Sfloat, Rg64Uint, Rg64Sint, Rg64Sfloat, Rgb64Uint, Rgb64Sint, Rgb64Sfloat, Rgba64Uint, Rgba64Sint, Rgba64Sfloat, B10g11r11Ufloat, E5b9g9r9Ufloat, D16Unorm, X8D24Unorm, D32Sfloat, S8Uint, D16UnormS8Uint, D24UnormS8Uint, D32SfloatS8Uint, Bc1RgbUnorm, Bc1RgbSrgb, Bc1RgbaUnorm, Bc1RgbaSrgb, Bc2Unorm, Bc2Srgb, Bc3Unorm, Bc3Srgb, Bc4Unorm, Bc4Snorm, Bc5Unorm, Bc5Snorm, Bc6hUfloat, Bc6hSfloat, Bc7Unorm, Bc7Srgb, Etc2R8g8b8Unorm, Etc2R8g8b8Srgb, Etc2R8g8b8a1Unorm, Etc2R8g8b8a1Srgb, Etc2R8g8b8a8Unorm, Etc2R8g8b8a8Srgb, EacR11Unorm, EacR11Snorm, EacR11g11Unorm, EacR11g11Snorm, Astc4x4Unorm, Astc4x4Srgb, Astc5x4Unorm, Astc5x4Srgb, Astc5x5Unorm, Astc5x5Srgb, Astc6x5Unorm, Astc6x5Srgb, Astc6x6Unorm, Astc6x6Srgb, Astc8x5Unorm, Astc8x5Srgb, Astc8x6Unorm, Astc8x6Srgb, Astc8x8Unorm, Astc8x8Srgb, Astc10x5Unorm, Astc10x5Srgb, Astc10x6Unorm, Astc10x6Srgb, Astc10x8Unorm, Astc10x8Srgb, Astc10x10Unorm, Astc10x10Srgb, Astc12x10Unorm, Astc12x10Srgb, Astc12x12Unorm, Astc12x12Srgb, // some variants omitted
}
Expand description

A format descriptor that describes the channels present in a texture or view, how they are laid out, what size they are, and how the elements of the channels are interpreted (integer, float, etc.)

Variants§

§

Rg4Unorm = 1

§

Rgba4Unorm

§

Bgra4Unorm

§

R5g6b5Unorm

§

B5g6r5Unorm

§

R5g5b5a1Unorm

§

B5g5r5a1Unorm

§

A1r5g5b5Unorm

§

R8Unorm

§

R8Snorm

§

R8Uscaled

§

R8Sscaled

§

R8Uint

§

R8Sint

§

R8Srgb

§

Rg8Unorm

§

Rg8Snorm

§

Rg8Uscaled

§

Rg8Sscaled

§

Rg8Uint

§

Rg8Sint

§

Rg8Srgb

§

Rgb8Unorm

§

Rgb8Snorm

§

Rgb8Uscaled

§

Rgb8Sscaled

§

Rgb8Uint

§

Rgb8Sint

§

Rgb8Srgb

§

Bgr8Unorm

§

Bgr8Snorm

§

Bgr8Uscaled

§

Bgr8Sscaled

§

Bgr8Uint

§

Bgr8Sint

§

Bgr8Srgb

§

Rgba8Unorm

§

Rgba8Snorm

§

Rgba8Uscaled

§

Rgba8Sscaled

§

Rgba8Uint

§

Rgba8Sint

§

Rgba8Srgb

§

Bgra8Unorm

§

Bgra8Snorm

§

Bgra8Uscaled

§

Bgra8Sscaled

§

Bgra8Uint

§

Bgra8Sint

§

Bgra8Srgb

§

Abgr8Unorm

§

Abgr8Snorm

§

Abgr8Uscaled

§

Abgr8Sscaled

§

Abgr8Uint

§

Abgr8Sint

§

Abgr8Srgb

§

A2r10g10b10Unorm

§

A2r10g10b10Snorm

§

A2r10g10b10Uscaled

§

A2r10g10b10Sscaled

§

A2r10g10b10Uint

§

A2r10g10b10Sint

§

A2b10g10r10Unorm

§

A2b10g10r10Snorm

§

A2b10g10r10Uscaled

§

A2b10g10r10Sscaled

§

A2b10g10r10Uint

§

A2b10g10r10Sint

§

R16Unorm

§

R16Snorm

§

R16Uscaled

§

R16Sscaled

§

R16Uint

§

R16Sint

§

R16Sfloat

§

Rg16Unorm

§

Rg16Snorm

§

Rg16Uscaled

§

Rg16Sscaled

§

Rg16Uint

§

Rg16Sint

§

Rg16Sfloat

§

Rgb16Unorm

§

Rgb16Snorm

§

Rgb16Uscaled

§

Rgb16Sscaled

§

Rgb16Uint

§

Rgb16Sint

§

Rgb16Sfloat

§

Rgba16Unorm

§

Rgba16Snorm

§

Rgba16Uscaled

§

Rgba16Sscaled

§

Rgba16Uint

§

Rgba16Sint

§

Rgba16Sfloat

§

R32Uint

§

R32Sint

§

R32Sfloat

§

Rg32Uint

§

Rg32Sint

§

Rg32Sfloat

§

Rgb32Uint

§

Rgb32Sint

§

Rgb32Sfloat

§

Rgba32Uint

§

Rgba32Sint

§

Rgba32Sfloat

§

R64Uint

§

R64Sint

§

R64Sfloat

§

Rg64Uint

§

Rg64Sint

§

Rg64Sfloat

§

Rgb64Uint

§

Rgb64Sint

§

Rgb64Sfloat

§

Rgba64Uint

§

Rgba64Sint

§

Rgba64Sfloat

§

B10g11r11Ufloat

§

E5b9g9r9Ufloat

§

D16Unorm

§

X8D24Unorm

§

D32Sfloat

§

S8Uint

§

D16UnormS8Uint

§

D24UnormS8Uint

§

D32SfloatS8Uint

§

Bc1RgbUnorm

§

Bc1RgbSrgb

§

Bc1RgbaUnorm

§

Bc1RgbaSrgb

§

Bc2Unorm

§

Bc2Srgb

§

Bc3Unorm

§

Bc3Srgb

§

Bc4Unorm

§

Bc4Snorm

§

Bc5Unorm

§

Bc5Snorm

§

Bc6hUfloat

§

Bc6hSfloat

§

Bc7Unorm

§

Bc7Srgb

§

Etc2R8g8b8Unorm

§

Etc2R8g8b8Srgb

§

Etc2R8g8b8a1Unorm

§

Etc2R8g8b8a1Srgb

§

Etc2R8g8b8a8Unorm

§

Etc2R8g8b8a8Srgb

§

EacR11Unorm

§

EacR11Snorm

§

EacR11g11Unorm

§

EacR11g11Snorm

§

Astc4x4Unorm

§

Astc4x4Srgb

§

Astc5x4Unorm

§

Astc5x4Srgb

§

Astc5x5Unorm

§

Astc5x5Srgb

§

Astc6x5Unorm

§

Astc6x5Srgb

§

Astc6x6Unorm

§

Astc6x6Srgb

§

Astc8x5Unorm

§

Astc8x5Srgb

§

Astc8x6Unorm

§

Astc8x6Srgb

§

Astc8x8Unorm

§

Astc8x8Srgb

§

Astc10x5Unorm

§

Astc10x5Srgb

§

Astc10x6Unorm

§

Astc10x6Srgb

§

Astc10x8Unorm

§

Astc10x8Srgb

§

Astc10x10Unorm

§

Astc10x10Srgb

§

Astc12x10Unorm

§

Astc12x10Srgb

§

Astc12x12Unorm

§

Astc12x12Srgb

Implementations§

Source§

impl Format

Source

pub fn base_format(self) -> BaseFormat

Get base format.

Returns None if format is Undefined.

Source

pub fn surface_desc(&self) -> FormatDesc

A shortcut to obtain surface format description.

Source

pub fn is_color(self) -> bool

Returns if the format has a color aspect.

Source

pub fn is_depth(self) -> bool

Returns if the format has a depth aspect.

Source

pub fn is_stencil(self) -> bool

Returns if the format has a stencil aspect.

Trait Implementations§

Source§

impl Clone for Format

Source§

fn clone(&self) -> Format

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Format

Source§

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

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

impl Hash for Format

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Format

Source§

fn cmp(&self, other: &Format) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Format

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Format

Source§

fn partial_cmp(&self, other: &Format) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for Format

Source§

impl Eq for Format

Source§

impl StructuralPartialEq for Format

Auto Trait Implementations§

§

impl Freeze for Format

§

impl RefUnwindSafe for Format

§

impl Send for Format

§

impl Sync for Format

§

impl Unpin for Format

§

impl UnwindSafe for Format

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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.