blob: 48e81ee5952f9d8604db278d23262541dbaa556b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
pub struct Image {
pub aspect_ratio: f64,
pub width: usize,
pub height: usize,
pub samples_per_pixel: usize,
}
impl Image {
pub fn new(aspect_ratio: f64, width: usize, samples_per_pixel: usize) -> Image {
Image {
aspect_ratio,
width,
height: (width as f64 / aspect_ratio) as usize,
samples_per_pixel,
}
}
}
|