aboutsummaryrefslogtreecommitdiff
path: root/src/buffer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.rs')
-rw-r--r--src/buffer.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/buffer.rs b/src/buffer.rs
new file mode 100644
index 0000000..a2c5708
--- /dev/null
+++ b/src/buffer.rs
@@ -0,0 +1,16 @@
+#[derive(Debug, Clone)]
+pub struct Buffer {
+ pub width: f32,
+ pub height: f32,
+ pub palette: Vec<char>,
+}
+
+impl Buffer {
+ pub fn from_height(height: f32, aspect_ratio: f32) -> Self {
+ Self {
+ height,
+ width: height * aspect_ratio,
+ palette: "$@B%8&WM#oahkbdpqwmZO0QLCJUYXzcvunxrjft/\\|()1{}[]?-_+~<>i!lI;:,\"^`'. ".chars().collect(),
+ }
+ }
+}