diff --git a/src/universe/d3/entity/shape.rs b/src/universe/d3/entity/shape.rs index d2543a9..b786981 100644 --- a/src/universe/d3/entity/shape.rs +++ b/src/universe/d3/entity/shape.rs @@ -10,7 +10,6 @@ use util::CustomFloat; use util::VecLazy; use util::IterLazy; use universe::entity::material::Material; -use universe::entity::material::Vacuum; use universe::entity::shape::Shape; use universe::entity::shape::Plane; use universe::entity::shape::HalfSpace; diff --git a/src/universe/entity/shape.rs b/src/universe/entity/shape.rs index e6638f8..89fdda7 100644 --- a/src/universe/entity/shape.rs +++ b/src/universe/entity/shape.rs @@ -12,7 +12,6 @@ use palette::Rgba; use universe::entity::Traceable; use universe::entity::material::Material; use universe::entity::material::TransitionHandlers; -use universe::entity::material::Vacuum; use util::CustomFloat; use util::CustomPoint; use util::CustomVector; diff --git a/src/util.rs b/src/util.rs index f1cb5c3..fccc92b 100644 --- a/src/util.rs +++ b/src/util.rs @@ -37,7 +37,6 @@ use num::traits::ParseFloatError; use num::traits::NumCast; use num::traits::ToPrimitive; use palette; -use image::Rgb; use image::Rgba; use na; use na::BaseFloat; @@ -285,48 +284,6 @@ pub fn combine_palette_color(a: palette::Rgba, } } -pub fn overlay_color(bottom: Rgb, top: Rgba) -> Rgb { - if top.data[3] == 0 { - bottom - } else if top.data[3] == std::u8::MAX { - let mut data = [0; 3]; - data.clone_from_slice(&top.data[..3]); - Rgb { data: data } - } else { - let u8_max_f: F = NumCast::from(std::u8::MAX).unwrap(); - let alpha: F = ::from(top.data[3]).unwrap() / u8_max_f; - Rgb { - data: [::from((::from(::one() - alpha).unwrap() * - (::from(bottom.data[0]).unwrap() / - u8_max_f) - .powi(2) + - alpha * - (::from(top.data[0]).unwrap() / u8_max_f)) - .sqrt() * - ::from(255.0).unwrap()) - .unwrap(), - ::from((::from(::one() - alpha).unwrap() * - (::from(bottom.data[1]).unwrap() / - u8_max_f) - .powi(2) + - alpha * - (::from(top.data[1]).unwrap() / u8_max_f)) - .sqrt() * - ::from(255.0).unwrap()) - .unwrap(), - ::from((::from(::one() - alpha).unwrap() * - (::from(bottom.data[2]).unwrap() / - u8_max_f) - .powi(2) + - alpha * - (::from(top.data[2]).unwrap() / u8_max_f)) - .sqrt() * - ::from(255.0).unwrap()) - .unwrap()], - } - } -} - pub fn remainder + Rem + PartialOrd + Zero + Copy>(a: T, b: T) -> T {