#[repr(C)]
pub struct BGRA<ComponentType, AlphaComponentType = ComponentType> {
pub b: ComponentType,
pub g: ComponentType,
pub r: ComponentType,
pub a: AlphaComponentType,
}
pub fn new(r: T, g: T, b: T, a: T) -> Self | [src] |
Convenience function for creating a new pixel
The order of arguments is R,G,B,A
Convenience function for creating a new pixel
The order of arguments is R,G,B,A
Iterate over all components (length=4)
Copy RGB components out of the RGBA struct
Note: you can use .into()
to convert between other types
Provide a mutable view of only RGB components (leaving out alpha).
Useful to change color without changing opacity.
Create new RGBA with the same alpha value, but different RGB values
The components interpreted as an array, e.g. one RGB
expands to 3 elements. Read more
Convenience function (equivalent of self.iter().map().collect()
) for applying the same formula to every component. Read more
Reinterpret the slice as a read-only/shared slice of pixels. Multiple consecutive elements in the slice are intepreted as a single pixel (depending on format, e.g. 3 for RGB, 4 for RGBA). Read more
Reinterpret the slice as a mutable/exclusive slice of pixels. Multiple consecutive elements in the slice are intepreted as a single pixel (depending on format, e.g. 3 for RGB, 4 for RGBA). Read more
Performs copy-assignment from source
. Read more
impl<ComponentType: Copy, AlphaComponentType: Copy> Copy for BGRA<ComponentType, AlphaComponentType> | [src] |
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
fn eq(&self, other: &BGRA<ComponentType, AlphaComponentType>) -> bool | [src] |
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &BGRA<ComponentType, AlphaComponentType>) -> bool | [src] |
This method tests for !=
.
impl<ComponentType: Eq, AlphaComponentType: Eq> Eq for BGRA<ComponentType, AlphaComponentType> | [src] |
impl<ComponentType: Ord, AlphaComponentType: Ord> Ord for BGRA<ComponentType, AlphaComponentType> | [src] |
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the minimum of two values. Read more
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &BGRA<ComponentType, AlphaComponentType>) -> bool | [src] |
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &BGRA<ComponentType, AlphaComponentType>) -> bool | [src] |
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &BGRA<ComponentType, AlphaComponentType>) -> bool | [src] |
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &BGRA<ComponentType, AlphaComponentType>) -> bool | [src] |
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<ComponentType: Hash, AlphaComponentType: Hash> Hash for BGRA<ComponentType, AlphaComponentType> | [src] |
fn hash<__HComponentTypeAlphaComponentType: Hasher>( &self, state: &mut __HComponentTypeAlphaComponentType ) | [src] |
Feeds this value into the given [Hasher
]. Read more
Feeds a slice of this type into the given [Hasher
]. Read more
Returns the "default value" for a type. Read more
impl<ComponentType, AlphaComponentType> Send for BGRA<ComponentType, AlphaComponentType> where AlphaComponentType: Send, ComponentType: Send, | |
impl<ComponentType, AlphaComponentType> Sync for BGRA<ComponentType, AlphaComponentType> where AlphaComponentType: Sync, ComponentType: Sync, | |
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static