Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Hlusička committed Aug 2, 2016
1 parent a1919ab commit 6a91891
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 45 deletions.
1 change: 0 additions & 1 deletion src/universe/d3/entity/shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/universe/entity/shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
43 changes: 0 additions & 43 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -285,48 +284,6 @@ pub fn combine_palette_color<F: CustomFloat>(a: palette::Rgba<F>,
}
}

pub fn overlay_color<F: CustomFloat>(bottom: Rgb<u8>, top: Rgba<u8>) -> Rgb<u8> {
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 = <F as NumCast>::from(top.data[3]).unwrap() / u8_max_f;
Rgb {
data: [<u8 as NumCast>::from((<F as NumCast>::from(<F as One>::one() - alpha).unwrap() *
(<F as NumCast>::from(bottom.data[0]).unwrap() /
u8_max_f)
.powi(2) +
alpha *
(<F as NumCast>::from(top.data[0]).unwrap() / u8_max_f))
.sqrt() *
<F as NumCast>::from(255.0).unwrap())
.unwrap(),
<u8 as NumCast>::from((<F as NumCast>::from(<F as One>::one() - alpha).unwrap() *
(<F as NumCast>::from(bottom.data[1]).unwrap() /
u8_max_f)
.powi(2) +
alpha *
(<F as NumCast>::from(top.data[1]).unwrap() / u8_max_f))
.sqrt() *
<F as NumCast>::from(255.0).unwrap())
.unwrap(),
<u8 as NumCast>::from((<F as NumCast>::from(<F as One>::one() - alpha).unwrap() *
(<F as NumCast>::from(bottom.data[2]).unwrap() /
u8_max_f)
.powi(2) +
alpha *
(<F as NumCast>::from(top.data[2]).unwrap() / u8_max_f))
.sqrt() *
<F as NumCast>::from(255.0).unwrap())
.unwrap()],
}
}
}

pub fn remainder<T: Add<Output = T> + Rem<Output = T> + PartialOrd<T> + Zero + Copy>(a: T,
b: T)
-> T {
Expand Down

0 comments on commit 6a91891

Please sign in to comment.