add: Basic Font Rendering

This commit is contained in:
Simon Hardt
2022-03-05 02:37:08 +01:00
parent df1ce5583b
commit 0553927dad
15 changed files with 386 additions and 9 deletions

View File

@@ -17,6 +17,15 @@ namespace frame
{
}
void Image::Create(uint32_t pWidth, uint32_t pHeight)
{
mWidth = pWidth;
mHeight = pHeight;
mBuffer.clear();
mBuffer.resize(mWidth * mHeight);
}
uint8_t& Image::at(uint32_t x, uint32_t y)
{
return mBuffer.at(toInternal(x, y));
@@ -27,6 +36,13 @@ namespace frame
return mBuffer.at(toInternal(x, y));
}
void Image::operator=(Image const& image)
{
mHeight = image.mHeight;
mWidth = image.mWidth;
mBuffer = image.mBuffer;
}
size_t Image::toInternal(uint32_t x, uint32_t y) const
{
return x + mWidth * y;