Struct Abgr
struct Abgr<T, A = T> { ... }
An Alpha + Blue + Green + Red pixel.
Examples
use Abgr;
let pixel: = Abgr ;
Fields
a: AAlpha Component
b: TBlue Component
g: TGreen Component
r: TRed Component
Implementations
impl<T> Abgr<T>
const fn new(r: T, g: T, b: T, a: T) -> SelfConvenience function for creating a new pixel The order of arguments is R,G,B,A
impl<T, A> Abgr<T, A>
const fn new_alpha(r: T, g: T, b: T, a: A) -> SelfConvenience function for creating a new pixel The order of arguments is R,G,B,A
impl<T: Clone> Abgr<T>
fn iter(self: &Self) -> Cloned<Iter<'_, T>>Iterate over all components (length=4)
impl<T: Clone, A> Abgr<T, A>
fn bgr(self: &Self) -> BGR<T>Copy RGB components out of the RGBA struct
Note: you can use
.into()to convert between other types
impl<T: Copy> Abgr<T>
const fn new_abgr(alpha: T, blue: T, green: T, red: T) -> SelfCreates a new
Abgrpixel type from its components.Alternatively, you can use struct literal syntax to create the new pixel type:
use rgb::Abgr; let pixel = Abgr {a : alpha, b : blue, g : green, r : red};
impl<T: Copy, A: Clone> Abgr<T, A>
fn map_rgb<F, U, B>(self: &Self, f: F) -> ABGR<U, B> where F: FnMut(T) -> U, U: Clone, B: From<A> + CloneCreate new RGBA with the same alpha value, but different RGB values
fn with_alpha(self: &Self, a: A) -> SelfCreate a new RGBA with the new alpha value, but same RGB values
fn map_alpha<F, B>(self: &Self, f: F) -> ABGR<T, B> where F: FnOnce(A) -> BCreate a new RGBA with a new alpha value created by the callback. Allows changing of the type used for the alpha channel.
impl<R, S> From for Abgr<S>
fn from(value: (R, R, R, R)) -> Self
impl<T> Any for Abgr<T, A>
fn type_id(self: &Self) -> TypeId
impl<T> AsRef for Abgr<T>
fn as_ref(self: &Self) -> &[T; 4]
impl<T> Borrow for Abgr<T, A>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Abgr<T, A>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for Abgr<T, A>
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> ComponentSlice for Abgr<T>
fn as_slice(self: &Self) -> &[T]fn as_mut_slice(self: &mut Self) -> &mut [T]
impl<T> From for Abgr<T>
fn from(other: BGRA<T>) -> Self
impl<T> From for Abgr<T>
fn from(other: RGBA<T>) -> Self
impl<T> From for Abgr<T>
fn from(other: ARGB<T>) -> Self
impl<T> From for Abgr<T, A>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, A> Freeze for Abgr<T, A>
impl<T, A> RefUnwindSafe for Abgr<T, A>
impl<T, A> Send for Abgr<T, A>
impl<T, A> StructuralPartialEq for Abgr<T, A>
impl<T, A> Sync for Abgr<T, A>
impl<T, A> Unpin for Abgr<T, A>
impl<T, A> UnsafeUnpin for Abgr<T, A>
impl<T, A> UnwindSafe for Abgr<T, A>
impl<T, U> Into for Abgr<T, A>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Abgr<T, A>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Abgr<T, A>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T: $crate::clone::Clone, A: $crate::clone::Clone> Clone for Abgr<T, A>
fn clone(self: &Self) -> Abgr<T, A>
impl<T: $crate::cmp::Eq, A: $crate::cmp::Eq> Eq for Abgr<T, A>
impl<T: $crate::cmp::Ord, A: $crate::cmp::Ord> Ord for Abgr<T, A>
fn cmp(self: &Self, other: &Abgr<T, A>) -> Ordering
impl<T: $crate::cmp::PartialEq, A: $crate::cmp::PartialEq> PartialEq for Abgr<T, A>
fn eq(self: &Self, other: &Abgr<T, A>) -> bool
impl<T: $crate::cmp::PartialOrd, A: $crate::cmp::PartialOrd> PartialOrd for Abgr<T, A>
fn partial_cmp(self: &Self, other: &Abgr<T, A>) -> Option<Ordering>
impl<T: $crate::default::Default, A: $crate::default::Default> Default for Abgr<T, A>
fn default() -> Abgr<T, A>
impl<T: $crate::fmt::Debug, A: $crate::fmt::Debug> Debug for Abgr<T, A>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<T: $crate::hash::Hash, A: $crate::hash::Hash> Hash for Abgr<T, A>
fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)
impl<T: $crate::marker::Copy, A: $crate::marker::Copy> Copy for Abgr<T, A>
impl<T: Copy> From for Abgr<T, u16>
fn from(other: RGB<T>) -> Self
impl<T: Copy> From for Abgr<T, u16>
fn from(other: BGR<T>) -> Self
impl<T: Copy> From for Abgr<T, u8>
fn from(other: RGB<T>) -> Self
impl<T: Copy> From for Abgr<T, u8>
fn from(other: BGR<T>) -> Self
impl<T: Copy, A: Copy, B> ColorComponentMap for Abgr<T, A>
fn map_colors<F>(self: &Self, f: F) -> ABGR<B, A> where F: FnMut(T) -> B
impl<T: Copy, B> ComponentMap for Abgr<T>
fn map<F>(self: &Self, f: F) -> ABGR<B> where F: FnMut(T) -> B