Struct Bgr

struct Bgr<T> { ... }

A Blue + Green + Red pixel.

Examples

use rgb::Bgr;

let pixel: Bgr<u8> = Bgr { b: 0, g: 0, r: 0 };

Fields

b: T

Blue Component

g: T

Green Component

r: T

Red Component

Implementations

impl<T> Bgr<T>

const fn new(r: T, g: T, b: T) -> Self

Convenience function for creating a new pixel Warning: The order of arguments is R,G,B

impl<T: Clone> Bgr<T>

fn with_alpha(self: &Self, a: T) -> BGRA<T>

Convenience function for converting to RGBA

fn new_alpha<A>(self: &Self, a: A) -> BGRA<T, A>

Convenience function for converting to RGBA with alpha channel of a different type than type of the pixels

impl<T: Clone> Bgr<T>

fn iter(self: &Self) -> Cloned<Iter<'_, T>>

Iterate over color components (R, G, and B)

impl<T: Copy> Bgr<T>

const fn new_bgr(blue: T, green: T, red: T) -> Self

Creates a new Bgr pixel type from its components.

Alternatively, you can use struct literal syntax to create the new pixel type:

use rgb::Bgr;

let pixel = Bgr {b : blue, g : green, r : red};

impl<R, S> From for Bgr<S>

fn from(value: (R, R, R)) -> Self

impl<T> Any for Bgr<T>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Bgr<T>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Bgr<T>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for Bgr<T>

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> ComponentSlice for Bgr<T>

fn as_slice(self: &Self) -> &[T]
fn as_mut_slice(self: &mut Self) -> &mut [T]

impl<T> Freeze for Bgr<T>

impl<T> From for Bgr<T>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> From for Bgr<T>

fn from(other: RGB<T>) -> Self

impl<T> RefUnwindSafe for Bgr<T>

impl<T> Send for Bgr<T>

impl<T> StructuralPartialEq for Bgr<T>

impl<T> Sync for Bgr<T>

impl<T> Unpin for Bgr<T>

impl<T> UnsafeUnpin for Bgr<T>

impl<T> UnwindSafe for Bgr<T>

impl<T, U> Into for Bgr<T>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Bgr<T>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Bgr<T>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>

impl<T: $crate::clone::Clone> Clone for Bgr<T>

fn clone(self: &Self) -> Bgr<T>

impl<T: $crate::cmp::Eq> Eq for Bgr<T>

impl<T: $crate::cmp::Ord> Ord for Bgr<T>

fn cmp(self: &Self, other: &Bgr<T>) -> Ordering

impl<T: $crate::cmp::PartialEq> PartialEq for Bgr<T>

fn eq(self: &Self, other: &Bgr<T>) -> bool

impl<T: $crate::cmp::PartialOrd> PartialOrd for Bgr<T>

fn partial_cmp(self: &Self, other: &Bgr<T>) -> Option<Ordering>

impl<T: $crate::default::Default> Default for Bgr<T>

fn default() -> Bgr<T>

impl<T: $crate::fmt::Debug> Debug for Bgr<T>

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

impl<T: $crate::hash::Hash> Hash for Bgr<T>

fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)

impl<T: $crate::marker::Copy> Copy for Bgr<T>

impl<T: Copy> From for Bgr<T>

fn from(other: [T; 3]) -> Self

impl<T: Copy, B> ColorComponentMap for Bgr<T>

fn map_colors<F>(self: &Self, f: F) -> BGR<B>
where
    F: FnMut(T) -> B

impl<T: Copy, B> ComponentMap for Bgr<T>

fn map<F>(self: &Self, f: F) -> BGR<B>
where
    F: FnMut(T) -> B

impl<T: fmt::Display> Display for Bgr<T>

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

impl<T: fmt::LowerHex> LowerHex for Bgr<T>

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

impl<T: fmt::UpperHex> UpperHex for Bgr<T>

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