[][src]Struct ffimage::color::bgr::Bgr

#[repr(C)]pub struct Bgr<T: StorageType>(pub [T; 3]);

BGR pixel

Implementations

impl<T: StorageType> Bgr<T>[src]

pub fn new(channels: [T; 3]) -> Self[src]

Returns a new pixel

Arguments

  • channels - Channel values

Example

use std::array;
use std::convert::{From, TryFrom};
use std::ops::{Index, IndexMut};

use ffimage::{create_pixel, define_pixel, impl_Pixel};
use ffimage::core::{Pixel, StorageType};

// define a new pixel type
create_pixel!(Rgb, 3, #[doc = "RGB pixel"]);

// use the newly created type
let pix = Rgb::<u8>::new([0, 0, 0]);

Trait Implementations

impl<T: Clone + StorageType> Clone for Bgr<T>[src]

impl<T: Copy + StorageType> Copy for Bgr<T>[src]

impl<T: Debug + StorageType> Debug for Bgr<T>[src]

impl<T: Default + StorageType> Default for Bgr<T>[src]

impl<T: Eq + StorageType> Eq for Bgr<T>[src]

impl<I: StorageType + AsPrimitive<f32>, O: StorageType + FromPrimitive> From<Bgr<I>> for Gray<O>[src]

impl<I: StorageType + AsPrimitive<O>, O: StorageType + 'static> From<Bgr<I>> for Rgb<O>[src]

impl<I: StorageType + AsPrimitive<O>, O: StorageType + Bounded + 'static> From<Bgr<I>> for Rgba<O>[src]

impl<I: StorageType + AsPrimitive<O>, O: StorageType + Bounded + 'static> From<Bgr<I>> for Bgra<O>[src]

impl<I: StorageType + AsPrimitive<O>, O: StorageType + 'static> From<Bgra<I>> for Bgr<O>[src]

impl<I: StorageType + AsPrimitive<O>, O: StorageType + 'static> From<Gray<I>> for Bgr<O>[src]

impl<I: StorageType + AsPrimitive<O>, O: StorageType + 'static> From<Rgb<I>> for Bgr<O>[src]

impl<I: StorageType + AsPrimitive<O>, O: StorageType + 'static> From<Rgba<I>> for Bgr<O>[src]

impl<T: StorageType> Index<usize> for Bgr<T>[src]

type Output = T

The returned type after indexing.

impl<T: StorageType> IndexMut<usize> for Bgr<T>[src]

impl<T: PartialEq + StorageType> PartialEq<Bgr<T>> for Bgr<T>[src]

impl<T: StorageType> Pixel for Bgr<T>[src]

type T = T

Type of the container elements

impl<T: StorageType> StructuralEq for Bgr<T>[src]

impl<T: StorageType> StructuralPartialEq for Bgr<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Bgr<T> where
    T: RefUnwindSafe

impl<T> Send for Bgr<T>

impl<T> Sync for Bgr<T>

impl<T> Unpin for Bgr<T> where
    T: Unpin

impl<T> UnwindSafe for Bgr<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<SP, DP> TryConvertSlice<DP> for SP where
    DP: Pixel + From<SP>,
    SP: Pixel
[src]

type Error = ()

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.