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

Min value

Max value

I/O base type

Required Methods

Convert to f64

Convert from f64

Provided Methods

Returns true when T is a floating point type

Get the type name

Set a value from an f64 value

Set a value from normalized float

Convert from T to normalized float

Convert to T from normalized float

Scale a value to fit between 0 and 1.0 based on the min/max values for T

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

Convert a value from one type to another

Get the number of bits for a data type

Implementations on Foreign Types

Implementors