[−][src]Struct prisma::eHsi
The eHSI device-dependent polar color model
eHSI has the same components as Hsi
: hue, saturation, intensity
but has additional logic for rescaling saturation in the case of what would be out-of-gamut
colors in the original HSI model. eHSI was adapted from the algorithm described in:
K. Yoshinari, Y. Hoshi and A. Taguchi, "Color image enhancement in HSI color space without gamut problem," 2014 6th International Symposium on Communications, Control and Signal Processing (ISCCSP), Athens, 2014, pp. 578-581.
found freely here.
eHSI is fully defined over the cylinder, and is generally visually better at adjusting intensity.
Implementations
impl<T, A> eHsi<T, A> where
T: PosNormalChannelScalar + Float,
A: AngularChannelScalar + Angle<Scalar = T>,
[src]
T: PosNormalChannelScalar + Float,
A: AngularChannelScalar + Angle<Scalar = T>,
pub fn new(hue: A, saturation: T, intensity: T) -> Self
[src]
Construct an eHsi instance from hue, saturation and intensity.
pub fn color_cast<TOut, AOut>(&self) -> eHsi<TOut, AOut> where
T: ChannelFormatCast<TOut>,
A: ChannelFormatCast<AOut>,
AOut: AngularChannelScalar,
TOut: PosNormalChannelScalar,
[src]
T: ChannelFormatCast<TOut>,
A: ChannelFormatCast<AOut>,
AOut: AngularChannelScalar,
TOut: PosNormalChannelScalar,
Convert the internal channel scalar format
pub fn hue(&self) -> A
[src]
Returns the hue scalar
pub fn saturation(&self) -> T
[src]
Returns the saturation scalar
pub fn intensity(&self) -> T
[src]
Returns the intensity scalar
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_hsi(&self) -> bool
[src]
Returns whether the eHsi
instance would be the same in Hsi
pub fn to_hsi(&self) -> Option<Hsi<T, A>>
[src]
Returns an Hsi
instance that is the same as self
if they would be equivalent, or None
otherwise
pub fn from_hsi(hsi: &Hsi<T, A>) -> Option<eHsi<T, A>>
[src]
Construct an eHsi
instance from an Hsi
instance if both would be equivalent
If they would not be equivalent, returns None
.
Trait Implementations
impl<T, A> AbsDiffEq<eHsi<T, A>> for eHsi<T, A> where
T: PosNormalChannelScalar + AbsDiffEq<Epsilon = A::Epsilon>,
A: AngularChannelScalar + AbsDiffEq,
A::Epsilon: Clone + Float,
[src]
T: PosNormalChannelScalar + AbsDiffEq<Epsilon = A::Epsilon>,
A: AngularChannelScalar + AbsDiffEq,
A::Epsilon: Clone + Float,
type Epsilon = T::Epsilon
Used for specifying relative comparisons.
fn default_epsilon() -> Self::Epsilon
[src]
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
[src]
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
[src]
impl<T, A> Bounded for eHsi<T, A> where
T: PosNormalChannelScalar,
A: AngularChannelScalar,
[src]
T: PosNormalChannelScalar,
A: AngularChannelScalar,
fn normalize(self) -> Self
[src]
fn is_normalized(&self) -> bool
[src]
impl<T: Clone, A: Clone> Clone for eHsi<T, A>
[src]
impl<T, A> Color for eHsi<T, A> where
T: PosNormalChannelScalar,
A: AngularChannelScalar,
[src]
T: PosNormalChannelScalar,
A: AngularChannelScalar,
type Tag = EHsiTag
The unique tag unit struct identifying the color type
type ChannelsTuple = (A, T, T)
A tuple of types for each channel in the color
fn num_channels() -> u32
[src]
fn to_tuple(self) -> Self::ChannelsTuple
[src]
impl<T: Copy, A: Copy> Copy for eHsi<T, A>
[src]
impl<T: Debug, A: Debug> Debug for eHsi<T, A>
[src]
impl<T, A> Default for eHsi<T, A> where
T: PosNormalChannelScalar + Zero,
A: AngularChannelScalar + Zero,
[src]
T: PosNormalChannelScalar + Zero,
A: AngularChannelScalar + Zero,
impl<T, A> Display for eHsi<T, A> where
T: PosNormalChannelScalar + Display,
A: AngularChannelScalar + Display,
[src]
T: PosNormalChannelScalar + Display,
A: AngularChannelScalar + Display,
impl<T, A> EncodableColor for eHsi<T, A> where
T: PosNormalChannelScalar + Float,
A: AngularChannelScalar + Angle<Scalar = T> + FromAngle<Turns<T>>,
[src]
T: PosNormalChannelScalar + Float,
A: AngularChannelScalar + Angle<Scalar = T> + FromAngle<Turns<T>>,
fn encoded_as<E>(self, encoding: E) -> EncodedColor<Self, E> where
E: ColorEncoding,
[src]
E: ColorEncoding,
fn linear(self) -> EncodedColor<Self, LinearEncoding>
[src]
fn srgb_encoded(self) -> EncodedColor<Self, SrgbEncoding>
[src]
fn gamma_encoded<T: Float>(
self,
gamma: T
) -> EncodedColor<Self, GammaEncoding<T>>
[src]
self,
gamma: T
) -> EncodedColor<Self, GammaEncoding<T>>
impl<T, A> From<Rgb<T>> for eHsi<T, A> where
T: PosNormalChannelScalar + Float,
A: AngularChannelScalar + Angle<Scalar = T> + FromAngle<Rad<T>>,
[src]
T: PosNormalChannelScalar + Float,
A: AngularChannelScalar + Angle<Scalar = T> + FromAngle<Rad<T>>,
impl<T, A> FromColor<Rgb<T>> for eHsi<T, A> where
T: PosNormalChannelScalar + Float,
A: AngularChannelScalar + Angle<Scalar = T> + FromAngle<Rad<T>>,
[src]
T: PosNormalChannelScalar + Float,
A: AngularChannelScalar + Angle<Scalar = T> + FromAngle<Rad<T>>,
fn from_color(from: &Rgb<T>) -> Self
[src]
impl<T, A> FromColor<eHsi<T, A>> for Rgb<T> where
T: PosNormalChannelScalar + Float,
A: AngularChannelScalar + Angle<Scalar = T>,
[src]
T: PosNormalChannelScalar + Float,
A: AngularChannelScalar + Angle<Scalar = T>,
fn from_color(from: &eHsi<T, A>) -> Rgb<T>
[src]
impl<T, A> FromTuple for eHsi<T, A> where
T: PosNormalChannelScalar + Float,
A: AngularChannelScalar + Angle<Scalar = T>,
[src]
T: PosNormalChannelScalar + Float,
A: AngularChannelScalar + Angle<Scalar = T>,
fn from_tuple(values: Self::ChannelsTuple) -> Self
[src]
impl<T: Hash, A: Hash> Hash for eHsi<T, A>
[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, A> Invert for eHsi<T, A> where
T: PosNormalChannelScalar,
A: AngularChannelScalar,
[src]
T: PosNormalChannelScalar,
A: AngularChannelScalar,
impl<T, A> Lerp for eHsi<T, A> where
T: PosNormalChannelScalar + Lerp,
A: AngularChannelScalar + Lerp,
[src]
T: PosNormalChannelScalar + Lerp,
A: AngularChannelScalar + Lerp,
type Position = A::Position
The type of the pos
argument
fn lerp(&self, right: &Self, pos: Self::Position) -> Self
[src]
impl<T: PartialEq, A: PartialEq> PartialEq<eHsi<T, A>> for eHsi<T, A>
[src]
impl<T: PartialOrd, A: PartialOrd> PartialOrd<eHsi<T, A>> for eHsi<T, A>
[src]
fn partial_cmp(&self, other: &eHsi<T, A>) -> Option<Ordering>
[src]
fn lt(&self, other: &eHsi<T, A>) -> bool
[src]
fn le(&self, other: &eHsi<T, A>) -> bool
[src]
fn gt(&self, other: &eHsi<T, A>) -> bool
[src]
fn ge(&self, other: &eHsi<T, A>) -> bool
[src]
impl<T, A> PolarColor for eHsi<T, A> where
T: PosNormalChannelScalar,
A: AngularChannelScalar,
[src]
T: PosNormalChannelScalar,
A: AngularChannelScalar,
type Angular = A
The angular channel's scalar type
type Cartesian = T
The remaining channels' scalar types
impl<T, A> RelativeEq<eHsi<T, A>> for eHsi<T, A> where
T: PosNormalChannelScalar + RelativeEq<Epsilon = A::Epsilon>,
A: AngularChannelScalar + RelativeEq,
A::Epsilon: Clone + Float,
[src]
T: PosNormalChannelScalar + RelativeEq<Epsilon = A::Epsilon>,
A: AngularChannelScalar + RelativeEq,
A::Epsilon: Clone + Float,
fn default_max_relative() -> Self::Epsilon
[src]
fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
impl<T, A> StructuralPartialEq for eHsi<T, A>
[src]
impl<T, A> UlpsEq<eHsi<T, A>> for eHsi<T, A> where
T: PosNormalChannelScalar + UlpsEq<Epsilon = A::Epsilon>,
A: AngularChannelScalar + UlpsEq,
A::Epsilon: Clone + Float,
[src]
T: PosNormalChannelScalar + UlpsEq<Epsilon = A::Epsilon>,
A: AngularChannelScalar + UlpsEq,
A::Epsilon: Clone + Float,
Auto Trait Implementations
impl<T, A> RefUnwindSafe for eHsi<T, A> where
A: RefUnwindSafe,
T: RefUnwindSafe,
A: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, A> Send for eHsi<T, A> where
A: Send,
T: Send,
A: Send,
T: Send,
impl<T, A> Sync for eHsi<T, A> where
A: Sync,
T: Sync,
A: Sync,
T: Sync,
impl<T, A> Unpin for eHsi<T, A> where
A: Unpin,
T: Unpin,
A: Unpin,
T: Unpin,
impl<T, A> UnwindSafe for eHsi<T, A> where
A: UnwindSafe,
T: UnwindSafe,
A: 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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,