blob: 2df11dcc4e90f0ec27bb8a0dc8c7aea7e9ca4176 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#[derive(Clone)]
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,
}
}
}
|