pub trait Type: 'static + Unpin + Default + Clone + Copy + Sync + Send + PartialEq + PartialOrd + Debug {
const MIN: f64;
const MAX: f64;
const BASE: BaseType;
Show 13 methods
// Required methods
fn to_f64(&self) -> f64;
fn from_f64(f: f64) -> Self;
// Provided methods
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§
sourcefn set_from_f64(&mut self, f: f64)
fn set_from_f64(&mut self, f: f64)
Set a value from an f64 value
sourcefn set_from_norm(&mut self, f: f64)
fn set_from_norm(&mut self, f: f64)
Set a value from normalized float
sourcefn normalize(f: f64) -> f64
fn normalize(f: f64) -> f64
Scale a value to fit between 0 and 1.0 based on the min/max values for T
sourcefn denormalize(f: f64) -> f64
fn denormalize(f: f64) -> f64
Scale an f64 value to fit the range supported by T