[][src]Struct prisma::Hsi

#[repr(C)]pub struct Hsi<T, A = Deg<T>> { /* fields omitted */ }

The HSI device-dependent polar color space

HSI is defined by a hue (base color), saturation (colorfulness) and intensity (brightness). While HSI has a construction very similar to HSV and HSL, it is a space with very different properties. It shares a strong similarity to HSL except that it uses $I = \frac{R + G + B}{3}$ instead of $L = \frac{max(R,G,B) + min(R,G,B)}{2}$ and is also a bi-cone space. However, HSI is not distorted to fit a cylinder as the other HS* spaces are, meaning that there are no degeneracies but also that not all $H,S,I \in [0,1]$ are valid.

HSI is often used in imaging processing for this lack of distortion, but it is notably less convenient for a human to reason through.

An extension to HSI titled eHSI and implemented as eHsi was developed to map HSI into a cylinder as well as fix a few deficiencies in the original HSI model.

Implementations

impl<T, A> Hsi<T, A> where
    T: PosNormalChannelScalar + Float,
    A: AngularChannelScalar + Angle<Scalar = T>, 
[src]

pub fn new(hue: A, saturation: T, intensity: T) -> Self[src]

Construct an Hsi instance from hue, saturation and intensity

pub fn color_cast<TOut, AOut>(&self) -> Hsi<TOut, AOut> where
    T: ChannelFormatCast<TOut>,
    A: ChannelFormatCast<AOut>,
    AOut: AngularChannelScalar,
    TOut: PosNormalChannelScalar
[src]

Convert the internal channel scalar format

pub fn hue(&self) -> A[src]

Returns the scalar hue

pub fn saturation(&self) -> T[src]

Returns the scalar saturation

pub fn intensity(&self) -> T[src]

Returns the scalar intensity

pub fn hue_mut(&mut self) -> &mut A[src]

Returns a mutable reference to the hue scalar

pub fn saturation_mut(&mut self) -> &mut T[src]

Returns a mutable reference to the saturation scalar

pub fn intensity_mut(&mut self) -> &mut T[src]

Returns a mutable reference to the intensity scalar

pub fn set_hue(&mut self, val: A)[src]

Set the hue channel value

pub fn set_saturation(&mut self, val: T)[src]

Set the saturation channel value

pub fn set_intensity(&mut self, val: T)[src]

Set the intensity channel value

pub fn is_same_as_ehsi(&self) -> bool[src]

Returns whether the Hsi instance would be equivalent in eHsi

impl<T, A> Hsi<T, A> where
    T: PosNormalChannelScalar + Float,
    A: AngularChannelScalar + Angle<Scalar = T> + FromAngle<Rad<T>> + Display
[src]

pub fn to_rgb(&self, out_of_gamut_mode: HsiOutOfGamutMode) -> Rgb<T>[src]

Convert an Hsi value to an Rgbvalue with out_of_gamut_mode specifying how to handle out-of-gamut output

Trait Implementations

impl<T, A> AbsDiffEq<Hsi<T, A>> for Hsi<T, A> where
    T: PosNormalChannelScalar + AbsDiffEq<Epsilon = A::Epsilon>,
    A: AngularChannelScalar + AbsDiffEq,
    A::Epsilon: Clone + Float
[src]

type Epsilon = T::Epsilon

Used for specifying relative comparisons.

impl<T, A> Bounded for Hsi<T, A> where
    T: PosNormalChannelScalar,
    A: AngularChannelScalar
[src]

impl<T: Clone, A: Clone> Clone for Hsi<T, A>[src]

impl<T, A> Color for Hsi<T, A> where
    T: PosNormalChannelScalar,
    A: AngularChannelScalar
[src]

type Tag = HsiTag

The unique tag unit struct identifying the color type

type ChannelsTuple = (A, T, T)

A tuple of types for each channel in the color

impl<T: Copy, A: Copy> Copy for Hsi<T, A>[src]

impl<T: Debug, A: Debug> Debug for Hsi<T, A>[src]

impl<T, A> Default for Hsi<T, A> where
    T: PosNormalChannelScalar + Zero,
    A: AngularChannelScalar + Zero
[src]

impl<T, A> Display for Hsi<T, A> where
    T: PosNormalChannelScalar + Display,
    A: AngularChannelScalar + Display
[src]

impl<T, A> EncodableColor for Hsi<T, A> where
    T: PosNormalChannelScalar + Float,
    A: AngularChannelScalar + Angle<Scalar = T>, 
[src]

impl<T, A> From<Rgb<T>> for Hsi<T, A> where
    T: PosNormalChannelScalar + Float,
    A: AngularChannelScalar + Angle<Scalar = T> + FromAngle<Rad<T>>, 
[src]

impl<T, A> FromColor<Rgb<T>> for Hsi<T, A> where
    T: PosNormalChannelScalar + Float,
    A: AngularChannelScalar + Angle<Scalar = T> + FromAngle<Rad<T>>, 
[src]

impl<T, A> FromHsi<Hsi<T, A>> for Rgb<T> where
    T: PosNormalChannelScalar + Float,
    A: AngularChannelScalar + Angle<Scalar = T> + IntoAngle<Rad<T>, OutputScalar = T>, 
[src]

impl<T, A> FromTuple for Hsi<T, A> where
    T: PosNormalChannelScalar + Float,
    A: AngularChannelScalar + Angle<Scalar = T>, 
[src]

impl<T: Hash, A: Hash> Hash for Hsi<T, A>[src]

impl<T, A> Invert for Hsi<T, A> where
    T: PosNormalChannelScalar,
    A: AngularChannelScalar
[src]

impl<T, A> Lerp for Hsi<T, A> where
    T: PosNormalChannelScalar + Lerp,
    A: AngularChannelScalar + Lerp
[src]

type Position = A::Position

The type of the pos argument

impl<T: PartialEq, A: PartialEq> PartialEq<Hsi<T, A>> for Hsi<T, A>[src]

impl<T: PartialOrd, A: PartialOrd> PartialOrd<Hsi<T, A>> for Hsi<T, A>[src]

impl<T, A> PolarColor for Hsi<T, A> where
    T: PosNormalChannelScalar,
    A: AngularChannelScalar
[src]

type Angular = A

The angular channel's scalar type

type Cartesian = T

The remaining channels' scalar types

impl<T, A> RelativeEq<Hsi<T, A>> for Hsi<T, A> where
    T: PosNormalChannelScalar + RelativeEq<Epsilon = A::Epsilon>,
    A: AngularChannelScalar + RelativeEq,
    A::Epsilon: Clone + Float
[src]

impl<T, A> StructuralPartialEq for Hsi<T, A>[src]

impl<T, A> UlpsEq<Hsi<T, A>> for Hsi<T, A> where
    T: PosNormalChannelScalar + UlpsEq<Epsilon = A::Epsilon>,
    A: AngularChannelScalar + UlpsEq,
    A::Epsilon: Clone + Float
[src]

Auto Trait Implementations

impl<T, A> RefUnwindSafe for Hsi<T, A> where
    A: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, A> Send for Hsi<T, A> where
    A: Send,
    T: Send

impl<T, A> Sync for Hsi<T, A> where
    A: Sync,
    T: Sync

impl<T, A> Unpin for Hsi<T, A> where
    A: Unpin,
    T: Unpin

impl<T, A> UnwindSafe for Hsi<T, A> where
    A: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.