aboutsummaryrefslogtreecommitdiff
path: root/src/core/spectrum.rs
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2021-02-07 14:25:06 +0100
committerJulian T <julian@jtle.dk>2021-02-07 14:26:20 +0100
commit33e747fa1c0957546c10e4d7b490ac7fbb0fd2d2 (patch)
tree515b2b2e017329cbcada60e898fb5795fbceb5cd /src/core/spectrum.rs
parenta43ab40a75e9d4c6ee3fbdd583bc93574db19124 (diff)
Abstracted lambertian into material
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 727a1b6..9cca7dc 100644
--- a/src/core/spectrum.rs
+++ b/src/core/spectrum.rs
@@ -41,6 +41,18 @@ impl std::ops::Mul<Float> for Spectrum {
}
}
+impl std::ops::Mul for Spectrum {
+ type Output = Spectrum;
+
+ fn mul(self, op: Self) -> Self::Output {
+ Self::Output::new_rgb(
+ self.c[0] * op.c[0],
+ self.c[1] * op.c[1],
+ self.c[2] * op.c[2],
+ )
+ }
+}
+
impl std::ops::Div<Float> for Spectrum {
type Output = Spectrum;