pub struct FacsIntensity(pub f32);Expand description
A FACS intensity value on a normalized [0.0, 1.0] scale.
In the FACS literature, intensity is often described with a five-letter scale: A (trace) through E (maximum).
Tuple Fields§
§0: f32Implementations§
Source§impl FacsIntensity
impl FacsIntensity
Sourcepub fn from_letter(letter: char) -> Option<Self>
pub fn from_letter(letter: char) -> Option<Self>
Parse a FACS letter-scale intensity.
| Letter | Label | Normalized |
|---|---|---|
| A | Trace | 0.10 |
| B | Slight | 0.30 |
| C | Marked | 0.50 |
| D | Extreme | 0.75 |
| E | Maximum | 1.00 |
Sourcepub fn to_normalized(&self) -> f32
pub fn to_normalized(&self) -> f32
Return the normalized [0.0, 1.0] intensity.
Sourcepub fn from_normalized(v: f32) -> Self
pub fn from_normalized(v: f32) -> Self
Construct from a normalized [0.0, 1.0] value.
Auto Trait Implementations§
impl Freeze for FacsIntensity
impl RefUnwindSafe for FacsIntensity
impl Send for FacsIntensity
impl Sync for FacsIntensity
impl Unpin for FacsIntensity
impl UnsafeUnpin for FacsIntensity
impl UnwindSafe for FacsIntensity
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more