[−][src]Struct pix::ycc::YCbCr
YCbCr color model (used in JPEG and other formats).
Methods
impl YCbCr
[src]
pub fn y<P: Pixel>(p: P) -> P::Chan where
P: Pixel<Model = Self>,
[src]
P: Pixel<Model = Self>,
Get the y component.
This is luma when gamma-encoded, or luminance with linear gamma.
Example: YCbCr Y
use pix::chan::Ch32; use pix::ycc::{YCbCr, YCbCr32}; let p = YCbCr32::new(0.25, 0.5, 1.0); assert_eq!(YCbCr::y(p), Ch32::new(0.25));
pub fn y_mut<P: Pixel>(p: &mut P) -> &mut P::Chan where
P: Pixel<Model = Self>,
[src]
P: Pixel<Model = Self>,
Get a mutable reference to the y component.
Example: Modify YCbCr Y
use pix::chan::Ch32; use pix::ycc::{YCbCr, YCbCr32}; let mut p = YCbCr32::new(0.25, 0.5, 1.0); *YCbCr::y_mut(&mut p) = Ch32::new(0.75); assert_eq!(YCbCr::y(p), Ch32::new(0.75));
pub fn cb<P: Pixel>(p: P) -> P::Chan where
P: Pixel<Model = Self>,
[src]
P: Pixel<Model = Self>,
Get the Cb component.
This the blue-difference chroma.
Example: YCbCr Cb
use pix::chan::Ch16; use pix::ycc::{YCbCr, YCbCr16}; let p = YCbCr16::new(0x2000, 0x1234, 0x8000); assert_eq!(YCbCr::cb(p), Ch16::new(0x1234));
pub fn cb_mut<P: Pixel>(p: &mut P) -> &mut P::Chan where
P: Pixel<Model = Self>,
[src]
P: Pixel<Model = Self>,
Get a mutable reference to the Cb component.
Example: Modify YCbCr Cr
use pix::chan::Ch16; use pix::ycc::{YCbCr, YCbCr16}; let mut p = YCbCr16::new(0x2000, 0x1234, 0x8000); *YCbCr::cb_mut(&mut p) = 0x4321.into(); assert_eq!(YCbCr::cb(p), Ch16::new(0x4321));
pub fn cr<P: Pixel>(p: P) -> P::Chan where
P: Pixel<Model = Self>,
[src]
P: Pixel<Model = Self>,
Get the Cr component.
This the red-difference chroma.
Example: YCbCr Cr
use pix::chan::Ch8; use pix::ycc::{YCbCr, YCbCr8}; let p = YCbCr8::new(0x93, 0x80, 0xA0); assert_eq!(YCbCr::cr(p), Ch8::new(0xA0));
pub fn cr_mut<P: Pixel>(p: &mut P) -> &mut P::Chan where
P: Pixel<Model = Self>,
[src]
P: Pixel<Model = Self>,
Get a mutable reference to the Cr component.
Example: Modify YCbCr Cr
use pix::chan::Ch8; use pix::ycc::{YCbCr, YCbCr8}; let mut p = YCbCr8::new(0x88, 0x77, 0x66); *YCbCr::cr_mut(&mut p) = 0x55.into(); assert_eq!(YCbCr::cr(p), Ch8::new(0x55));
Trait Implementations
impl Clone for YCbCr
[src]
impl ColorModel for YCbCr
[src]
const CIRCULAR: Range<usize>
[src]
const LINEAR: Range<usize>
[src]
const ALPHA: usize
[src]
fn into_rgba<P>(p: P) -> PixRgba<P> where
P: Pixel<Model = Self>,
[src]
P: Pixel<Model = Self>,
Convert into red, green, blue and alpha components
fn from_rgba<P>(rgba: PixRgba<P>) -> P where
P: Pixel<Model = Self>,
[src]
P: Pixel<Model = Self>,
Convert from red, green, blue and alpha components
impl Copy for YCbCr
[src]
impl Debug for YCbCr
[src]
impl Default for YCbCr
[src]
impl PartialEq<YCbCr> for YCbCr
[src]
impl StructuralPartialEq for YCbCr
[src]
Auto Trait Implementations
impl RefUnwindSafe for YCbCr
impl Send for YCbCr
impl Sync for YCbCr
impl Unpin for YCbCr
impl UnwindSafe for YCbCr
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,