Skip to main content

ClearColorValue

Enum ClearColorValue 

Source
pub enum ClearColorValue {
    Float32([f32; 4]),
    Int32([i32; 4]),
    Uint32([u32; 4]),
}
Expand description

Structure specifying a clear color value.

Variants§

§

Float32([f32; 4])

Value as f32.

Use this member for color clear values when the format of the image or attachment is one of the numeric formats with a numeric type that is floating-point. Floating-point values are automatically converted to the format of the image, with the clear value being treated as linear if the image is sRGB.

§

Int32([i32; 4])

Value as i32.

Use this member for color clear values when the format of the image or attachment has a numeric type that is signed integer. Signed integer values are converted to the format of the image by casting to the smaller type (with negative 32-bit values mapping to negative values in the smaller type). If the integer clear value is not representable in the target type (e.g. would overflow in conversion to that type), the clear value is undefined.

§

Uint32([u32; 4])

Value as u32.

Use this member for color clear values when the format of the image or attachment has a numeric type that is unsigned integer. Unsigned integer values are converted to the format of the image by casting to the integer type with fewer bits.

Implementations§

Source§

impl ClearColorValue

Source

pub const BLACK_ALPHA_ONE: Self

RGB zeros and alpha ones.

Source

pub const BLACK_ALPHA_ZERO: Self

All zeros.

Source

pub const WHITE_ALPHA_ONE: Self

RGB zeros and alpha ones.

Source

pub const WHITE_ALPHA_ZERO: Self

RGB ones and alpha zeros.

Source

pub const fn rgba(r: f32, g: f32, b: f32, a: f32) -> Self

Convenience constructor for clear color values.

Source

pub const fn from_f32(r: f32, g: f32, b: f32, a: f32) -> Self

Convert RGB+A values into a ClearColorValue.

Source

pub const fn from_u8(r: u8, g: u8, b: u8, a: u8) -> Self

Convert RGB+A values into a ClearColorValue.

Trait Implementations§

Source§

impl Clone for ClearColorValue

Source§

fn clone(&self) -> ClearColorValue

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ClearColorValue

Source§

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

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

impl Default for ClearColorValue

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<[f32; 4]> for ClearColorValue

Source§

fn from(float32: [f32; 4]) -> Self

Converts to this type from the input type.
Source§

impl From<[i32; 4]> for ClearColorValue

Source§

fn from(int32: [i32; 4]) -> Self

Converts to this type from the input type.
Source§

impl From<[u32; 4]> for ClearColorValue

Source§

fn from(uint32: [u32; 4]) -> Self

Converts to this type from the input type.
Source§

impl From<[u8; 4]> for ClearColorValue

Source§

fn from(uint8: [u8; 4]) -> Self

Converts to this type from the input type.
Source§

impl From<ClearColorValue> for ClearColorValue

Source§

fn from(value: ClearColorValue) -> Self

Converts to this type from the input type.
Source§

impl Copy for ClearColorValue

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