aboutsummaryrefslogtreecommitdiff
path: root/src/display/pixel.rs
diff options
context:
space:
mode:
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;
+ }
+}