[][src]Struct pix::Rgb

#[repr(C)]
pub struct Rgb<C: Channel> { /* fields omitted */ }

Linear RGB pixel format.

The channels are red, green and blue. They are encoded in linear intensity.

Methods

impl<C: Channel> Rgb<C>[src]

pub fn new<V>(red: V, green: V, blue: V) -> Self where
    C: From<V>, 
[src]

Build a color by specifying red, green and blue values.

pub fn red(self) -> C[src]

Get the red channel.

pub fn green(self) -> C[src]

Get the green channel.

pub fn blue(self) -> C[src]

Get the blue channel.

Trait Implementations

impl<C: Channel> PixFmt for Rgb<C>[src]

fn mask_over_fallback(dst: &mut [Self], mask: &[u8], src: Self)[src]

Blend pixels with an alpha mask (slow fallback).

  • dst Destination pixels.
  • mask Alpha mask for compositing.
  • src Source color.

fn mask_over(dst: &mut [Self], mask: &[u8], src: Self)[src]

Blend pixels with an alpha mask. Read more

fn as_u8_slice(pix: &[Self]) -> &[u8][src]

Convert a pixel slice into a u8 slice. Read more

fn as_u8_slice_mut(pix: &mut [Self]) -> &mut [u8][src]

Convert a pixel slice into a mutable u8 slice. Read more

fn as_slice(pix: &[u8]) -> &[Self][src]

Convert a u8 slice into a pixel slice. Read more

fn as_slice_mut(pix: &mut [u8]) -> &mut [Self][src]

Convert a u8 slice into a mutable pixel slice. Read more

impl<C: Channel, H: Channel> From<Rgb<H>> for Gray<C> where
    C: From<H>, 
[src]

fn from(rgb: Rgb<H>) -> Self[src]

Get a gray from an rgb

impl<C: Channel> From<Rgb<C>> for i32[src]

fn from(rgb: Rgb<C>) -> i32[src]

Get an i32 from a Rgb

impl<C: Channel, H: Channel> From<Alpha<H>> for Rgb<C> where
    C: From<H>, 
[src]

fn from(_: Alpha<H>) -> Self[src]

Get an Rgb from an Alpha

impl<C: Channel, H: Channel> From<Gray<H>> for Rgb<C> where
    C: From<H>, 
[src]

fn from(c: Gray<H>) -> Self[src]

Get an Rgb from a Gray

impl<C: Channel, H: Channel> From<Rgba<H>> for Rgb<C> where
    C: From<H>, 
[src]

fn from(rgb: Rgba<H>) -> Self[src]

Get an Rgb from an Rgba

impl<C: Channel, H: Channel> From<Rgb<H>> for Rgba<C> where
    C: From<H>, 
[src]

fn from(rgb: Rgb<H>) -> Self[src]

Get an Rgba from an Rgb

impl<C: Channel, H: Channel> From<Rgb<H>> for Srgb<C> where
    C: From<H>, 
[src]

fn from(rgb: Rgb<H>) -> Self[src]

Get an Srgb from an Rgb

impl<C: Copy + Channel> Copy for Rgb<C>[src]

impl<C: Clone + Channel> Clone for Rgb<C>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<C: PartialEq + Channel> PartialEq<Rgb<C>> for Rgb<C>[src]

impl<C: Default + Channel> Default for Rgb<C>[src]

impl<C: Debug + Channel> Debug for Rgb<C>[src]

Auto Trait Implementations

impl<C> Send for Rgb<C> where
    C: Send

impl<C> Sync for Rgb<C> where
    C: Sync

Blanket Implementations

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

impl<T> From for T[src]

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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