[fb] Change to embedding PSF file
Moved old PSF parsing code from kernel, and switched to embedding whole PSF instead of just glyph data to make font class the same code paths for both cases.
This commit is contained in:
28
src/drivers/fb/screen.h
Normal file
28
src/drivers/fb/screen.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
class screen
|
||||
{
|
||||
public:
|
||||
using pixel_t = uint32_t;
|
||||
|
||||
enum class pixel_order : uint8_t { bgr8, rgb8, };
|
||||
|
||||
screen(void *addr, unsigned hres, unsigned vres, pixel_order order);
|
||||
|
||||
unsigned width() const { return m_resx; }
|
||||
unsigned height() const { return m_resy; }
|
||||
|
||||
pixel_t color(uint8_t r, uint8_t g, uint8_t b) const;
|
||||
|
||||
void fill(pixel_t color);
|
||||
void draw_pixel(unsigned x, unsigned y, pixel_t color);
|
||||
|
||||
private:
|
||||
pixel_t *m_fb;
|
||||
pixel_order m_order;
|
||||
unsigned m_resx, m_resy;
|
||||
|
||||
screen() = delete;
|
||||
};
|
||||
Reference in New Issue
Block a user