[][src]Struct pix::bgr::Bgr

pub struct Bgr {}

BGR arrangement of RGB color model.

The components are blue, green, red and optional alpha.

Methods

impl Bgr[src]

pub fn blue<P: Pixel>(p: P) -> P::Chan where
    P: Pixel<Model = Self>, 
[src]

Get the blue component.

Example: Get BGR Blue

use pix::bgr::{Bgr, Bgr8};
use pix::chan::Ch8;

let p = Bgr8::new(0x93, 0x80, 0xA0);
assert_eq!(Bgr::blue(p), Ch8::new(0x93));

pub fn blue_mut<P: Pixel>(p: &mut P) -> &mut P::Chan where
    P: Pixel<Model = Self>, 
[src]

Get a mutable reference to the blue component.

Example: Modify BGR Blue

use pix::bgr::{Bgr, Bgr8};
use pix::chan::Ch8;

let mut p = Bgr8::new(0x88, 0x77, 0x66);
*Bgr::blue_mut(&mut p) = 0x55.into();
assert_eq!(Bgr::blue(p), Ch8::new(0x55));

pub fn green<P: Pixel>(p: P) -> P::Chan where
    P: Pixel<Model = Self>, 
[src]

Get the green component.

Example: BGR Green

use pix::bgr::{Bgr, Bgr16};
use pix::chan::Ch16;

let p = Bgr16::new(0x2000, 0x1234, 0x8000);
assert_eq!(Bgr::green(p), Ch16::new(0x1234));

pub fn green_mut<P: Pixel>(p: &mut P) -> &mut P::Chan where
    P: Pixel<Model = Self>, 
[src]

Get a mutable reference to the green component.

Example: Modify BGR Green

use pix::bgr::{Bgr, Bgr16};
use pix::chan::Ch16;

let mut p = Bgr16::new(0x2000, 0x1234, 0x8000);
*Bgr::green_mut(&mut p) = 0x4321.into();
assert_eq!(Bgr::green(p), Ch16::new(0x4321));

pub fn red<P: Pixel>(p: P) -> P::Chan where
    P: Pixel<Model = Self>, 
[src]

Get the red component.

Example: BGR Red

use pix::bgr::{Bgr, Bgr32};
use pix::chan::Ch32;

let p = Bgr32::new(0.25, 0.5, 1.0);
assert_eq!(Bgr::red(p), Ch32::new(1.0));

pub fn red_mut<P: Pixel>(p: &mut P) -> &mut P::Chan where
    P: Pixel<Model = Self>, 
[src]

Get a mutable reference to the red component.

Example: Modify BGR Red

use pix::bgr::{Bgr, Bgr32};
use pix::chan::Ch32;

let mut p = Bgr32::new(0.25, 0.5, 1.0);
*Bgr::red_mut(&mut p) = Ch32::new(0.75);
assert_eq!(Bgr::red(p), Ch32::new(0.75));

Trait Implementations

impl Clone for Bgr[src]

impl ColorModel for Bgr[src]

fn into_rgba<P>(p: P) -> PixRgba<P> where
    P: Pixel<Model = Self>, 
[src]

Convert into red, green, blue and alpha components

fn from_rgba<P>(rgba: PixRgba<P>) -> P where
    P: Pixel<Model = Self>, 
[src]

Convert from red, green, blue and alpha components

impl Copy for Bgr[src]

impl Debug for Bgr[src]

impl Default for Bgr[src]

impl PartialEq<Bgr> for Bgr[src]

impl StructuralPartialEq for Bgr[src]

Auto Trait Implementations

impl RefUnwindSafe for Bgr

impl Send for Bgr

impl Sync for Bgr

impl Unpin for Bgr

impl UnwindSafe for Bgr

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<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.