aboutsummaryrefslogtreecommitdiff
path: root/src/buffer.rs
blob: 61b33746cf589ddee26e4104c5622740683932f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[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(),
        }
    }
}