Enum SampleBits

Source
#[non_exhaustive]
#[repr(u8)]
pub enum SampleBits {
Show 38 variants Int8 = 0, UInt8 = 1, UInt1x8 = 2, UInt2x4 = 3, UInt332 = 4, UInt233 = 5, Int16 = 6, UInt16 = 7, UInt4x2 = 8, UInt4x4 = 9, UInt4x6 = 10, UInt_444 = 11, UInt444_ = 12, UInt565 = 13, UInt8x2 = 14, UInt8x3 = 15, UInt8x4 = 16, UInt8x6 = 17, Int8x2 = 18, Int8x3 = 19, Int8x4 = 20, UInt16x2 = 21, UInt16x3 = 22, UInt16x4 = 23, Int16x2 = 24, Int16x3 = 25, Int16x4 = 26, UInt16x6 = 27, UInt1010102 = 28, UInt2101010 = 29, UInt101010_ = 30, UInt_101010 = 31, Float16x4 = 32, Float32 = 33, Float32x2 = 34, Float32x3 = 35, Float32x4 = 36, Float32x6 = 37,
}
Expand description

The bit-placement of samples within a texel.

We start with low-order bits in a little-endian representation of the surrounding numbers. So, for example, Int332 has the first sample in the three lowest bits of a u8 (byte-order independent) and a Int565 has its first channel in the first 5 low-order bits of a u16 little endian interpretation of the bytes.

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.
§

Int8 = 0

A single 8-bit signed integer.

§

UInt8 = 1

A single 8-bit integer.

§

UInt1x8 = 2

Eight 1-bit integer.

§

UInt2x4 = 3

Four 2-bit integer.

§

UInt332 = 4

Three packed integer.

§

UInt233 = 5

Three packed integer.

§

Int16 = 6

A single 8-bit signed integer.

§

UInt16 = 7

A single 16-bit integer.

§

UInt4x2 = 8

Two packed integer.

§

UInt4x4 = 9

Four packed integer.

§

UInt4x6 = 10

Six packed integer.

§

UInt_444 = 11

Four packed integer, one component ignored.

§

UInt444_ = 12

Four packed integer, one component ignored.

§

UInt565 = 13

Three packed integer.

§

UInt8x2 = 14

Two 8-bit integers.

§

UInt8x3 = 15

Three 8-bit integer.

§

UInt8x4 = 16

Four 8-bit integer.

§

UInt8x6 = 17

Six 8-bit integer.

§

Int8x2 = 18

Two 8-bit integers.

§

Int8x3 = 19

Three 8-bit integer.

§

Int8x4 = 20

Four 8-bit integer.

§

UInt16x2 = 21

Two 16-bit integers.

§

UInt16x3 = 22

Three 16-bit integer.

§

UInt16x4 = 23

Four 16-bit integer.

§

Int16x2 = 24

Two 16-bit signed integers.

§

Int16x3 = 25

Three 16-bit integer.

§

Int16x4 = 26

Four 16-bit integer.

§

UInt16x6 = 27

Six 16-bit integer.

§

UInt1010102 = 28

Four packed integer.

§

UInt2101010 = 29

Four packed integer.

§

UInt101010_ = 30

Three packed integer, one component ignored.

§

UInt_101010 = 31

Three packed integer, one component ignored.

§

Float16x4 = 32

Four half-floats.

§

Float32 = 33

A single floating-point channel.

§

Float32x2 = 34

Two float channels.

§

Float32x3 = 35

Three float channels.

§

Float32x4 = 36

Four floats.

§

Float32x6 = 37

Six floats.

Implementations§

Source§

impl SampleBits

Source

pub fn bytes(self) -> u16

Determine the number of bytes for texels containing these samples.

Trait Implementations§

Source§

impl Clone for SampleBits

Source§

fn clone(&self) -> SampleBits

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

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SampleBits

Source§

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

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

impl Hash for SampleBits

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 PartialEq for SampleBits

Source§

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

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

const 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 Copy for SampleBits

Source§

impl Eq for SampleBits

Source§

impl StructuralPartialEq for SampleBits

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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<P, L> PlaneOf<&L> for P
where P: PlaneOf<L>,

Source§

type Plane = <P as PlaneOf<L>>::Plane

Source§

fn get_plane(self, layout: &&L) -> Option<<P as PlaneOf<&L>>::Plane>

Get the layout describing the plane.
Source§

impl<P, L> PlaneOf<&mut L> for P
where P: PlaneOf<L>,

Source§

type Plane = <P as PlaneOf<L>>::Plane

Source§

fn get_plane(self, layout: &&mut L) -> Option<<P as PlaneOf<&mut L>>::Plane>

Get the layout describing the plane.
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.