pub trait Type: Unpin + Default + Clone + Copy + Sync + Send + PartialEq + PartialOrd + Debug {
const MIN: f64;
const MAX: f64;
const BASE: BaseType;
Show 13 methods
fn to_f64(&self) -> f64;
fn from_f64(f: f64) -> Self;
fn is_float() -> bool { ... }
fn type_name() -> &'static str { ... }
fn set_from_f64(&mut self, f: f64) { ... }
fn set_from_norm(&mut self, f: f64) { ... }
fn to_norm(&self) -> f64 { ... }
fn from_norm(f: f64) -> Self { ... }
fn normalize(f: f64) -> f64 { ... }
fn denormalize(f: f64) -> f64 { ... }
fn clamp(f: f64) -> f64 { ... }
fn convert<X: Type>(&self) -> X { ... }
fn bits() -> usize { ... }
}
Expand description
Type is used to represent supported image data types
Required Associated Constants
Required Methods
Provided Methods
fn set_from_f64(&mut self, f: f64)
fn set_from_f64(&mut self, f: f64)
Set a value from an f64 value
fn set_from_norm(&mut self, f: f64)
fn set_from_norm(&mut self, f: f64)
Set a value from normalized float
Scale a value to fit between 0 and 1.0 based on the min/max values for T
fn denormalize(f: f64) -> f64
fn denormalize(f: f64) -> f64
Scale an f64 value to fit the range supported by T
Ensure the given value is less than the max allowed and greater than or equal to the minimum value