From c0fc3926e06acddcc02ef086fbda688d4709e5ba Mon Sep 17 00:00:00 2001 From: lamp Date: Sun, 21 Jan 2024 13:44:51 +0000 Subject: refactor display backends, add pixelflut backend --- src/display/pixel.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/display/pixel.rs (limited to 'src/display/pixel.rs') diff --git a/src/display/pixel.rs b/src/display/pixel.rs new file mode 100644 index 0000000..c9113d9 --- /dev/null +++ b/src/display/pixel.rs @@ -0,0 +1,14 @@ +use crate::vec3::Color; + +#[derive(Clone)] +pub struct Pixel { + pub color: Color, + pub sample_count: u32, +} + +impl Pixel { + pub fn update(&mut self, color: Color) { + self.color += color; + self.sample_count += 1; + } +} -- cgit v1.2.3