gfx_hal::format

Enum SurfaceType

Source
#[repr(u8)]
pub enum SurfaceType {
Show 65 variants R4_G4 = 0, R4_G4_B4_A4 = 1, B4_G4_R4_A4 = 2, R5_G6_B5 = 3, B5_G6_R5 = 4, R5_G5_B5_A1 = 5, B5_G5_R5_A1 = 6, A1_R5_G5_B5 = 7, R8 = 8, R8_G8 = 9, R8_G8_B8 = 10, B8_G8_R8 = 11, R8_G8_B8_A8 = 12, B8_G8_R8_A8 = 13, A8_B8_G8_R8 = 14, A2_R10_G10_B10 = 15, A2_B10_G10_R10 = 16, R16 = 17, R16_G16 = 18, R16_G16_B16 = 19, R16_G16_B16_A16 = 20, R32 = 21, R32_G32 = 22, R32_G32_B32 = 23, R32_G32_B32_A32 = 24, R64 = 25, R64_G64 = 26, R64_G64_B64 = 27, R64_G64_B64_A64 = 28, B10_G11_R11 = 29, E5_B9_G9_R9 = 30, D16 = 31, X8D24 = 32, D32 = 33, S8 = 34, D16_S8 = 35, D24_S8 = 36, D32_S8 = 37, BC1_RGB = 38, BC1_RGBA = 39, BC2 = 40, BC3 = 41, BC4 = 42, BC5 = 43, BC6 = 44, BC7 = 45, ETC2_R8_G8_B8 = 46, ETC2_R8_G8_B8_A1 = 47, ETC2_R8_G8_B8_A8 = 48, EAC_R11 = 49, EAC_R11_G11 = 50, ASTC_4x4 = 51, ASTC_5x4 = 52, ASTC_5x5 = 53, ASTC_6x5 = 54, ASTC_6x6 = 55, ASTC_8x5 = 56, ASTC_8x6 = 57, ASTC_8x8 = 58, ASTC_10x5 = 59, ASTC_10x6 = 60, ASTC_10x8 = 61, ASTC_10x10 = 62, ASTC_12x10 = 63, ASTC_12x12 = 64,
}
Expand description

Type of the allocated texture surface. It is supposed to only carry information about the number of bits per each channel. The actual types are up to the views to decide and interpret. The actual components are up to the swizzle to define.

Variants§

§

R4_G4 = 0

§

R4_G4_B4_A4 = 1

§

B4_G4_R4_A4 = 2

§

R5_G6_B5 = 3

§

B5_G6_R5 = 4

§

R5_G5_B5_A1 = 5

§

B5_G5_R5_A1 = 6

§

A1_R5_G5_B5 = 7

§

R8 = 8

§

R8_G8 = 9

§

R8_G8_B8 = 10

§

B8_G8_R8 = 11

§

R8_G8_B8_A8 = 12

§

B8_G8_R8_A8 = 13

§

A8_B8_G8_R8 = 14

§

A2_R10_G10_B10 = 15

§

A2_B10_G10_R10 = 16

§

R16 = 17

§

R16_G16 = 18

§

R16_G16_B16 = 19

§

R16_G16_B16_A16 = 20

§

R32 = 21

§

R32_G32 = 22

§

R32_G32_B32 = 23

§

R32_G32_B32_A32 = 24

§

R64 = 25

§

R64_G64 = 26

§

R64_G64_B64 = 27

§

R64_G64_B64_A64 = 28

§

B10_G11_R11 = 29

§

E5_B9_G9_R9 = 30

§

D16 = 31

§

X8D24 = 32

§

D32 = 33

§

S8 = 34

§

D16_S8 = 35

§

D24_S8 = 36

§

D32_S8 = 37

§

BC1_RGB = 38

§

BC1_RGBA = 39

§

BC2 = 40

§

BC3 = 41

§

BC4 = 42

§

BC5 = 43

§

BC6 = 44

§

BC7 = 45

§

ETC2_R8_G8_B8 = 46

§

ETC2_R8_G8_B8_A1 = 47

§

ETC2_R8_G8_B8_A8 = 48

§

EAC_R11 = 49

§

EAC_R11_G11 = 50

§

ASTC_4x4 = 51

§

ASTC_5x4 = 52

§

ASTC_5x5 = 53

§

ASTC_6x5 = 54

§

ASTC_6x6 = 55

§

ASTC_8x5 = 56

§

ASTC_8x6 = 57

§

ASTC_8x8 = 58

§

ASTC_10x5 = 59

§

ASTC_10x6 = 60

§

ASTC_10x8 = 61

§

ASTC_10x10 = 62

§

ASTC_12x10 = 63

§

ASTC_12x12 = 64

Implementations§

Source§

impl SurfaceType

Source

pub fn describe_bits(&self) -> FormatBits

Return the bits for this format.

Source

pub fn desc(&self) -> FormatDesc

Return the format descriptor.

Trait Implementations§

Source§

impl Clone for SurfaceType

Source§

fn clone(&self) -> SurfaceType

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 SurfaceType

Source§

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

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

impl Hash for SurfaceType

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 SurfaceType

Source§

fn cmp(&self, other: &SurfaceType) -> 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 SurfaceType

Source§

fn eq(&self, other: &SurfaceType) -> 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 SurfaceType

Source§

fn partial_cmp(&self, other: &SurfaceType) -> 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 SurfaceType

Source§

impl Eq for SurfaceType

Source§

impl StructuralPartialEq for SurfaceType

Auto Trait Implementations§

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.