aboutsummaryrefslogtreecommitdiff
path: root/src/core/spectrum.rs
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2021-02-05 20:17:20 +0100
committerJulian T <julian@jtle.dk>2021-02-05 20:17:20 +0100
commit1e83ea211055eb234b89c69b5d03602e3fcb98fb (patch)
tree7b58c7e6d7d174906541e9f2acf546294f8e9ca5 /src/core/spectrum.rs
parent9235e74dfbc41895a5f8807e1ab93508268a39ea (diff)
Achieve anti aliasing with multi pixel sampling
Diffstat (limited to 'src/core/spectrum.rs')
-rw-r--r--src/core/spectrum.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/spectrum.rs b/src/core/spectrum.rs
index fb82a9e..41b3342 100644
--- a/src/core/spectrum.rs
+++ b/src/core/spectrum.rs
@@ -33,6 +33,18 @@ impl std::ops::Mul<Float> for &Spectrum {
}
}
+impl std::ops::Div<Float> for &Spectrum {
+ type Output = Spectrum;
+
+ fn div(self, op: Float) -> Self::Output {
+ Self::Output::new_rgb(
+ self.c[0] / op,
+ self.c[1] / op,
+ self.c[2] / op,
+ )
+ }
+}
+
impl std::ops::AddAssign<&Self> for Spectrum {
fn add_assign(&mut self, op: &Self) {
self.c[0] += op.c[0];