Skip to main content

Cam16

Struct Cam16 

Source
pub struct Cam16 {
    pub hue: f64,
    pub chroma: f64,
    pub j: f64,
    pub q: f64,
    pub m: f64,
    pub s: f64,
    pub jstar: f64,
    pub astar: f64,
    pub bstar: f64,
}
Expand description

A color in CAM16, the appearance model behind HCT’s hue and chroma.

Fields§

§hue: f64

Hue in degrees.

§chroma: f64

Chroma: colorfulness relative to white.

§j: f64

Lightness.

§q: f64

Brightness.

§m: f64

Colorfulness.

§s: f64

Saturation.

§jstar: f64

CAM16-UCS J coordinate.

§astar: f64

CAM16-UCS a coordinate.

§bstar: f64

CAM16-UCS b coordinate.

Implementations§

Source§

impl Cam16

Source

pub fn distance(&self, other: &Self) -> f64

Perceptual distance in CAM16-UCS.

Source

pub fn from_argb(argb: u32) -> Self

An ARGB color in the standard viewing conditions.

Source

pub fn from_xyz_in(x: f64, y: f64, z: f64, vc: &ViewingConditions) -> Self

An XYZ color seen in vc.

Source

pub fn from_jch(j: f64, c: f64, h: f64) -> Self

From lightness, chroma and hue in the standard viewing conditions.

Source

pub fn from_jch_in(j: f64, c: f64, h: f64, vc: &ViewingConditions) -> Self

From lightness, chroma and hue in vc.

Source

pub fn from_ucs(jstar: f64, astar: f64, bstar: f64) -> Self

From CAM16-UCS coordinates in the standard viewing conditions.

Source

pub fn to_argb(&self) -> u32

The ARGB color in the standard viewing conditions.

Source

pub fn xyz_in(&self, vc: &ViewingConditions) -> [f64; 3]

The XYZ coordinates of this color seen in vc.

Trait Implementations§

Source§

impl Clone for Cam16

Source§

fn clone(&self) -> Cam16

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Cam16

Source§

impl Debug for Cam16

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Cam16

Source§

fn eq(&self, other: &Cam16) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Cam16

Auto Trait Implementations§

§

impl Freeze for Cam16

§

impl RefUnwindSafe for Cam16

§

impl Send for Cam16

§

impl Sync for Cam16

§

impl Unpin for Cam16

§

impl UnsafeUnpin for Cam16

§

impl UnwindSafe for Cam16

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.