aboutsummaryrefslogtreecommitdiff
path: root/src/display/pixel.rs
diff options
context:
space:
mode:
authorlamp2024-01-21 13:44:51 +0000
committerlamp2024-01-21 13:44:51 +0000
commitc0fc3926e06acddcc02ef086fbda688d4709e5ba (patch)
treee9f752758a49bedf1936003a7a2cd883e7d8e3cf /src/display/pixel.rs
parent78ddaff5855bf8446adef9e18eb0d7b7ddcee52a (diff)
refactor display backends, add pixelflut backend
Diffstat (limited to 'src/display/pixel.rs')
-rw-r--r--src/display/pixel.rs14
1 files changed, 14 insertions, 0 deletions
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;
+ }
+}