pub struct Cmy {}
Expand description
Implementations§
source§impl Cmy
impl Cmy
sourcepub fn cyan<P>(p: P) -> P::Chanwhere
P: Pixel<Model = Self> + Pixel,
pub fn cyan<P>(p: P) -> P::Chanwhere P: Pixel<Model = Self> + Pixel,
Get the cyan component.
Example: Get CMY Cyan
use pix::cmy::{Cmy, Cmy8};
use pix::chan::Ch8;
let p = Cmy8::new(0x93, 0x80, 0xA0);
assert_eq!(Cmy::cyan(p), Ch8::new(0x93));
sourcepub fn cyan_mut<P>(p: &mut P) -> &mut P::Chanwhere
P: Pixel<Model = Self> + Pixel,
pub fn cyan_mut<P>(p: &mut P) -> &mut P::Chanwhere P: Pixel<Model = Self> + Pixel,
Get a mutable reference to the cyan component.
Example: Modify CMY Cyan
use pix::cmy::{Cmy, Cmy8};
use pix::chan::Ch8;
let mut p = Cmy8::new(0x88, 0x77, 0x66);
*Cmy::cyan_mut(&mut p) = 0x55.into();
assert_eq!(Cmy::cyan(p), Ch8::new(0x55));
sourcepub fn magenta<P>(p: P) -> P::Chanwhere
P: Pixel<Model = Self> + Pixel,
pub fn magenta<P>(p: P) -> P::Chanwhere P: Pixel<Model = Self> + Pixel,
Get the magenta component.
Example: CMY Magenta
use pix::cmy::{Cmy, Cmy16};
use pix::chan::Ch16;
let p = Cmy16::new(0x2000, 0x1234, 0x8000);
assert_eq!(Cmy::magenta(p), Ch16::new(0x1234));
sourcepub fn magenta_mut<P>(p: &mut P) -> &mut P::Chanwhere
P: Pixel<Model = Self> + Pixel,
pub fn magenta_mut<P>(p: &mut P) -> &mut P::Chanwhere P: Pixel<Model = Self> + Pixel,
Get a mutable reference to the magenta component.
Example: Modify CMY Magenta
use pix::cmy::{Cmy, Cmy16};
use pix::chan::Ch16;
let mut p = Cmy16::new(0x2000, 0x1234, 0x8000);
*Cmy::magenta_mut(&mut p) = 0x4321.into();
assert_eq!(Cmy::magenta(p), Ch16::new(0x4321));
sourcepub fn yellow<P>(p: P) -> P::Chanwhere
P: Pixel<Model = Self> + Pixel,
pub fn yellow<P>(p: P) -> P::Chanwhere P: Pixel<Model = Self> + Pixel,
Get the yellow component.
Example: CMY Yellow
use pix::cmy::{Cmy, Cmy32};
use pix::chan::Ch32;
let p = Cmy32::new(0.25, 0.5, 1.0);
assert_eq!(Cmy::yellow(p), Ch32::new(1.0));
sourcepub fn yellow_mut<P>(p: &mut P) -> &mut P::Chanwhere
P: Pixel<Model = Self> + Pixel,
pub fn yellow_mut<P>(p: &mut P) -> &mut P::Chanwhere P: Pixel<Model = Self> + Pixel,
Get a mutable reference to the yellow component.
Example: Modify CMY Yellow
use pix::cmy::{Cmy, Cmy32};
use pix::chan::Ch32;
let mut p = Cmy32::new(0.25, 0.5, 1.0);
*Cmy::yellow_mut(&mut p) = Ch32::new(0.75);
assert_eq!(Cmy::yellow(p), Ch32::new(0.75));
Trait Implementations§
source§impl ColorModel for Cmy
impl ColorModel for Cmy
impl Copy for Cmy
impl Eq for Cmy
impl StructuralEq for Cmy
impl StructuralPartialEq for Cmy
Auto Trait Implementations§
impl RefUnwindSafe for Cmy
impl Send for Cmy
impl Sync for Cmy
impl Unpin for Cmy
impl UnwindSafe for Cmy
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more