library: move from f64 to f32

They are faster to compute with, take less space --which means faster
access because we use less cache lines--, and they are what is used by
`bvh`...
This commit is contained in:
Bruno BELANYI 2020-03-16 17:26:04 +01:00
parent 5d03df960c
commit 7d28e21a70
4 changed files with 12 additions and 9 deletions

View file

@ -5,9 +5,9 @@ use derive_more::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Sub, SubAssign
)]
/// A structure to represent operations in the linear RGB colorspace.
pub struct LinearColor {
pub r: f64,
pub g: f64,
pub b: f64,
pub r: f32,
pub g: f32,
pub b: f32,
}
impl LinearColor {
@ -19,7 +19,7 @@ impl LinearColor {
}
}
pub fn new(r: f64, g: f64, b: f64) -> Self {
pub fn new(r: f32, g: f32, b: f32) -> Self {
LinearColor { r, g, b }
}
}