buffer-graphics-lib 0.19.2

Simple graphics library for buffers
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::prelude::Renderable;
use crate::Graphics;
use ici_files::color::Color;
use noto_sans_mono_bitmap::RasterizedChar;

impl Renderable<RasterizedChar> for RasterizedChar {
    fn render(&self, graphics: &mut Graphics) {
        for (y, row) in self.raster().iter().enumerate() {
            for (x, pixel) in row.iter().enumerate() {
                graphics.set_pixel(x as isize, y as isize, Color::gray(*pixel));
            }
        }
    }
}