Struct rgb::alt::BGRA [−][src]
BGR+A
Fields
b: ComponentType
Blue first
g: ComponentType
Green
r: ComponentType
Red
a: AlphaComponentType
Alpha last
Implementations
impl<T> BGRA<T>
[src]
pub const fn new(r: T, g: T, b: T, a: T) -> Self
[src]
This function has a misleading order of arguments. Use BGRA{} literal instead
Convenience function for creating a new pixel Warning: The order of arguments is R,G,B,A
impl<T, A> BGRA<T, A>
[src]
pub const fn new_alpha(r: T, g: T, b: T, a: A) -> Self
[src]
This function has a misleading order of arguments. Use BGRA{} literal instead
Convenience function for creating a new pixel Warning: The order of arguments is R,G,B,A
impl<T, A> BGRA<T, A>
[src]
pub fn rgb_mut(&mut self) -> &mut BGR<T>
[src]
This function will change. Use bgr_mut()
Provide a mutable view of only RGB components (leaving out alpha). Useful to change color without changing opacity.
pub fn bgr_mut(&mut self) -> &mut BGR<T>
[src]
Provide a mutable view of only RGB components (leaving out alpha). Useful to change color without changing opacity.
impl<T: Clone, A> BGRA<T, A>
[src]
pub fn rgb(&self) -> BGR<T>
[src]
This function will change. Use bgr()
Copy RGB components out of the RGBA struct
Note: you can use .into()
to convert between other types
impl<T: Clone> BGRA<T>
[src]
impl<T: Clone, A> BGRA<T, A>
[src]
pub fn bgr(&self) -> BGR<T>
[src]
Copy RGB components out of the RGBA struct
Note: you can use .into()
to convert between other types
impl<T: Copy, A: Clone> BGRA<T, A>
[src]
pub fn map_rgb<F, U, B>(&self, f: F) -> BGRA<U, B> where
F: FnMut(T) -> U,
U: Clone,
B: From<A> + Clone,
[src]
F: FnMut(T) -> U,
U: Clone,
B: From<A> + Clone,
Create new RGBA with the same alpha value, but different RGB values
pub fn alpha(&self, a: A) -> Self
[src]
Create a new RGBA with the new alpha value, but same RGB values
pub fn map_alpha<F, B>(&self, f: F) -> BGRA<T, B> where
F: FnOnce(A) -> B,
[src]
F: FnOnce(A) -> B,
Create a new RGBA with a new alpha value created by the callback. Allows changing of the type used for the alpha channel.
Trait Implementations
impl<T> AsPixels<BGRA<T, T>> for [T]
[src]
impl<ComponentType: Clone, AlphaComponentType: Clone> Clone for BGRA<ComponentType, AlphaComponentType>
[src]
fn clone(&self) -> BGRA<ComponentType, AlphaComponentType>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Copy, B> ComponentMap<BGRA<B, B>, T, B> for BGRA<T>
[src]
impl<T> ComponentSlice<T> for BGRA<T>
[src]
impl<ComponentType: Copy, AlphaComponentType: Copy> Copy for BGRA<ComponentType, AlphaComponentType>
[src]
impl<ComponentType: Debug, AlphaComponentType: Debug> Debug for BGRA<ComponentType, AlphaComponentType>
[src]
impl<ComponentType: Default, AlphaComponentType: Default> Default for BGRA<ComponentType, AlphaComponentType>
[src]
impl<'de, ComponentType, AlphaComponentType> Deserialize<'de> for BGRA<ComponentType, AlphaComponentType> where
ComponentType: Deserialize<'de>,
AlphaComponentType: Deserialize<'de>,
[src]
ComponentType: Deserialize<'de>,
AlphaComponentType: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<T: Display, A: Display> Display for BGRA<T, A>
[src]
impl<ComponentType: Eq, AlphaComponentType: Eq> Eq for BGRA<ComponentType, AlphaComponentType>
[src]
impl<T: Copy> From<[T; 4]> for BGRA<T>
[src]
impl<T, A> From<(T, T, T, A)> for BGRA<T, A>
[src]
impl<T: Copy> From<BGR<T>> for BGRA<T, u8>
[src]
Assumes 255 is opaque
impl<T: Copy> From<BGR<T>> for BGRA<T, u16>
[src]
Assumes 65535 is opaque
impl<T> From<BGRA<T, T>> for RGBA<T>
[src]
impl<T: Copy> From<RGB<T>> for BGRA<T, u8>
[src]
Assumes 255 is opaque
impl<T: Copy> From<RGB<T>> for BGRA<T, u16>
[src]
Assumes 65535 is opaque
impl<T> From<RGBA<T, T>> for BGRA<T>
[src]
impl<ComponentType: Hash, AlphaComponentType: Hash> Hash for BGRA<ComponentType, AlphaComponentType>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T> Into<[T; 4]> for BGRA<T>
[src]
impl<T, A> Into<(T, T, T, A)> for BGRA<T, A>
[src]
impl<ComponentType: Ord, AlphaComponentType: Ord> Ord for BGRA<ComponentType, AlphaComponentType>
[src]
fn cmp(&self, other: &BGRA<ComponentType, AlphaComponentType>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<ComponentType: PartialEq, AlphaComponentType: PartialEq> PartialEq<BGRA<ComponentType, AlphaComponentType>> for BGRA<ComponentType, AlphaComponentType>
[src]
fn eq(&self, other: &BGRA<ComponentType, AlphaComponentType>) -> bool
[src]
fn ne(&self, other: &BGRA<ComponentType, AlphaComponentType>) -> bool
[src]
impl<ComponentType: PartialOrd, AlphaComponentType: PartialOrd> PartialOrd<BGRA<ComponentType, AlphaComponentType>> for BGRA<ComponentType, AlphaComponentType>
[src]
fn partial_cmp(
&self,
other: &BGRA<ComponentType, AlphaComponentType>
) -> Option<Ordering>
[src]
&self,
other: &BGRA<ComponentType, AlphaComponentType>
) -> Option<Ordering>
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T, A> Pod for BGRA<T, A> where
T: Pod,
A: Pod,
[src]
T: Pod,
A: Pod,
impl<ComponentType, AlphaComponentType> Serialize for BGRA<ComponentType, AlphaComponentType> where
ComponentType: Serialize,
AlphaComponentType: Serialize,
[src]
ComponentType: Serialize,
AlphaComponentType: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<ComponentType, AlphaComponentType> StructuralEq for BGRA<ComponentType, AlphaComponentType>
[src]
impl<ComponentType, AlphaComponentType> StructuralPartialEq for BGRA<ComponentType, AlphaComponentType>
[src]
impl<T, A> Zeroable for BGRA<T, A> where
T: Zeroable,
A: Zeroable,
[src]
T: Zeroable,
A: Zeroable,
Auto Trait Implementations
impl<ComponentType, AlphaComponentType> RefUnwindSafe for BGRA<ComponentType, AlphaComponentType> where
AlphaComponentType: RefUnwindSafe,
ComponentType: RefUnwindSafe,
AlphaComponentType: RefUnwindSafe,
ComponentType: RefUnwindSafe,
impl<ComponentType, AlphaComponentType> Send for BGRA<ComponentType, AlphaComponentType> where
AlphaComponentType: Send,
ComponentType: Send,
AlphaComponentType: Send,
ComponentType: Send,
impl<ComponentType, AlphaComponentType> Sync for BGRA<ComponentType, AlphaComponentType> where
AlphaComponentType: Sync,
ComponentType: Sync,
AlphaComponentType: Sync,
ComponentType: Sync,
impl<ComponentType, AlphaComponentType> Unpin for BGRA<ComponentType, AlphaComponentType> where
AlphaComponentType: Unpin,
ComponentType: Unpin,
AlphaComponentType: Unpin,
ComponentType: Unpin,
impl<ComponentType, AlphaComponentType> UnwindSafe for BGRA<ComponentType, AlphaComponentType> where
AlphaComponentType: UnwindSafe,
ComponentType: UnwindSafe,
AlphaComponentType: UnwindSafe,
ComponentType: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,