This commit is contained in:
@@ -27,16 +27,16 @@ impl Texture for ImageTexture {
|
||||
let x = (u % 1. * (self.width - 1.)) as u32;
|
||||
let y = ((1. - v % 1.) * (self.height - 1.)) as u32;
|
||||
if x >= self.width as u32 {
|
||||
panic!(format!(
|
||||
panic!(
|
||||
"u {} v {} x {} y {} w {} h {}",
|
||||
u, v, x, y, self.width, self.height
|
||||
));
|
||||
);
|
||||
}
|
||||
if y >= self.height as u32 {
|
||||
panic!(format!(
|
||||
panic!(
|
||||
"u {} v {} x {} y {} w {} h {}",
|
||||
u, v, x, y, self.width, self.height
|
||||
));
|
||||
);
|
||||
}
|
||||
let pixel = self.img.get_pixel(x, y);
|
||||
Vec3::new(
|
||||
|
||||
@@ -27,7 +27,7 @@ fn hsv_to_rgb(h: f32, s: f32, v: f32) -> Vec3 {
|
||||
3 => Vec3::new(p, q, v),
|
||||
4 => Vec3::new(t, p, v),
|
||||
5 => Vec3::new(v, p, q),
|
||||
_ => panic!(format!("Unknown H value {}", h_i)),
|
||||
_ => panic!("Unknown H value {}", h_i),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user