aboutsummaryrefslogtreecommitdiff
path: root/src/camera
diff options
context:
space:
mode:
Diffstat (limited to 'src/camera')
-rw-r--r--src/camera/film.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/camera/film.rs b/src/camera/film.rs
index 7193e1d..2ff7239 100644
--- a/src/camera/film.rs
+++ b/src/camera/film.rs
@@ -40,12 +40,13 @@ impl Pixel {
}
fn add(&mut self, c: &Spectrum, weight: Float) {
- self.rgb += &(c * weight);
+ self.rgb += &(*c * weight);
self.samples += 1;
}
fn finalize_rgb(&self) -> [u8; 3] {
- let (r, g, b) = (&self.rgb / (self.samples as Float)).to_rgb(255.0);
+ let spc = (self.rgb / (self.samples as Float)).gamma_correct();
+ let (r, g, b) = spc.to_rgb(255.0);
[
r as u8,
g as u8,