diff options
| author | Sakarias Johansson <sakarias.johansson@goodbyekansas.com> | 2023-01-17 19:43:40 +0100 |
|---|---|---|
| committer | Sakarias Johansson <sakarias.johansson@goodbyekansas.com> | 2023-01-17 19:43:40 +0100 |
| commit | 38e9bf130fc1075d576626f0c2ade582ccc3c57f (patch) | |
| tree | ec1d32d4610dbd7541007602847cd7d45594f314 /racer-tracer/src/image.rs | |
| parent | 03e5a88f9b7da79749370685e8f5afaf03a25b4a (diff) | |
| download | racer-tracer-38e9bf130fc1075d576626f0c2ade582ccc3c57f.tar.gz racer-tracer-38e9bf130fc1075d576626f0c2ade582ccc3c57f.tar.xz racer-tracer-38e9bf130fc1075d576626f0c2ade582ccc3c57f.zip | |
📜 Add config support
Diffstat (limited to 'racer-tracer/src/image.rs')
| -rw-r--r-- | racer-tracer/src/image.rs | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/racer-tracer/src/image.rs b/racer-tracer/src/image.rs index 502a15a..1df4cc5 100644 --- a/racer-tracer/src/image.rs +++ b/racer-tracer/src/image.rs @@ -2,16 +2,14 @@ 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 { + pub fn new(width: usize, height: usize) -> Image { Image { - aspect_ratio, + aspect_ratio: width as f64 / height as f64, width, - height: (width as f64 / aspect_ratio) as usize, - samples_per_pixel, + height, } } } @@ -24,7 +22,6 @@ impl From<&Image> for SubImage { y: 0, width: image.width, height: image.height, - samples: image.samples_per_pixel, screen_width: image.width, screen_height: image.height, } @@ -38,7 +35,6 @@ pub struct SubImage { pub screen_height: usize, pub width: usize, pub height: usize, - pub samples: usize, } pub trait QuadSplit { @@ -57,7 +53,6 @@ impl QuadSplit for SubImage { y: self.y, width: half_w, height: half_h, - samples: self.samples, screen_width: self.screen_width, screen_height: self.screen_height, }, @@ -67,7 +62,6 @@ impl QuadSplit for SubImage { y: self.y, width: half_w, height: half_h, - samples: self.samples, screen_width: self.screen_width, screen_height: self.screen_height, }, @@ -77,7 +71,6 @@ impl QuadSplit for SubImage { y: self.y + half_h, width: half_w, height: half_h, - samples: self.samples, screen_width: self.screen_width, screen_height: self.screen_height, }, @@ -87,7 +80,6 @@ impl QuadSplit for SubImage { y: self.y + half_h, width: half_w, height: half_h, - samples: self.samples, screen_width: self.screen_width, screen_height: self.screen_height, }, |
