Thomas Kolb
d5357b2021
To accomplish this, the following changes were made: - Added an image-scrolling animation - Implemented a bitmap font engine to generate an image from text - On startup, an image-scrolling animation is set up with an image generated from the local IP address
34 lines
542 B
C++
34 lines
542 B
C++
#pragma once
|
|
|
|
#include "Fader.h"
|
|
|
|
class Bitmap
|
|
{
|
|
public:
|
|
std::vector<Fader::Color> m_pixdata;
|
|
|
|
uint32_t width;
|
|
uint32_t height;
|
|
|
|
Bitmap(uint32_t w, uint32_t h)
|
|
: m_pixdata(w * h, Fader::Color{0, 0, 0, 0}),
|
|
width(w),
|
|
height(h)
|
|
{
|
|
}
|
|
|
|
Bitmap() : Bitmap(0, 0) {}
|
|
|
|
Fader::Color &pixel(uint32_t x, uint32_t y)
|
|
{
|
|
return m_pixdata[idx(x, y)];
|
|
}
|
|
|
|
uint32_t idx(uint32_t x, uint32_t y)
|
|
{
|
|
return x * height + y;
|
|
}
|
|
|
|
void resize(uint32_t w, uint32_t h);
|
|
};
|