[−][src]Struct prisma::ChromaticityCoordinates
A pair of chromaticity coordinates $\alpha
$ and $\beta
$
Chromaticity coordinates are a basis set of a two-dimensional space defining the chroma and hue
of the color without the luminance. These are primarily used for computing non-approximate
(circular) HS* color values. Hsi
is an example of a color space that uses these coordinates
in its construction.
$\alpha
$ is the "redness vs blue-greenness" whereas $\beta
$ is "greenness vs blueness"
Hsv
and similar models convert from RGB using a hexagonal transformation that is then treated
as circular. This is convenient
and very easy to compute, but it is slightly off of the "correct" value for hue and chroma
obtained when using a circle.
From these coordinates, you can obtain the circular chroma and hue:
\begin{aligned}
H_{\textrm{circle}} &= atan2(\beta, \alpha) \\
C_{\textrm{circle}} &= \sqrt{\alpha^2 + \beta^2}
\end{aligned}
Fields
alpha: T
The alpha chromaticity coordinate
beta: T
The alpha chromaticity coordinate
Implementations
impl<T> ChromaticityCoordinates<T> where
T: Float,
[src]
T: Float,
Trait Implementations
impl<T: Clone> Clone for ChromaticityCoordinates<T>
[src]
fn clone(&self) -> ChromaticityCoordinates<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Copy> Copy for ChromaticityCoordinates<T>
[src]
impl<T: Debug> Debug for ChromaticityCoordinates<T>
[src]
impl<T> Default for ChromaticityCoordinates<T> where
T: Float,
[src]
T: Float,
impl<T: Hash> Hash for ChromaticityCoordinates<T>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: PartialEq> PartialEq<ChromaticityCoordinates<T>> for ChromaticityCoordinates<T>
[src]
fn eq(&self, other: &ChromaticityCoordinates<T>) -> bool
[src]
fn ne(&self, other: &ChromaticityCoordinates<T>) -> bool
[src]
impl<T: PartialOrd> PartialOrd<ChromaticityCoordinates<T>> for ChromaticityCoordinates<T>
[src]
fn partial_cmp(&self, other: &ChromaticityCoordinates<T>) -> Option<Ordering>
[src]
fn lt(&self, other: &ChromaticityCoordinates<T>) -> bool
[src]
fn le(&self, other: &ChromaticityCoordinates<T>) -> bool
[src]
fn gt(&self, other: &ChromaticityCoordinates<T>) -> bool
[src]
fn ge(&self, other: &ChromaticityCoordinates<T>) -> bool
[src]
impl<T> StructuralPartialEq for ChromaticityCoordinates<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for ChromaticityCoordinates<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for ChromaticityCoordinates<T> where
T: Send,
T: Send,
impl<T> Sync for ChromaticityCoordinates<T> where
T: Sync,
T: Sync,
impl<T> Unpin for ChromaticityCoordinates<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for ChromaticityCoordinates<T> where
T: UnwindSafe,
T: UnwindSafe,
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>,