From 1e83ea211055eb234b89c69b5d03602e3fcb98fb Mon Sep 17 00:00:00 2001 From: Julian T Date: Fri, 5 Feb 2021 20:17:20 +0100 Subject: Achieve anti aliasing with multi pixel sampling --- src/core/spectrum.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/core/spectrum.rs') 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 for &Spectrum { } } +impl std::ops::Div 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]; -- cgit v1.2.3