Выделил переиспользуемые модули из проекта.
This commit is contained in:
parent
3fe2a87e35
commit
7c83d9c93e
15 changed files with 287 additions and 207 deletions
14
main.cpp
14
main.cpp
|
@ -1,6 +1,6 @@
|
|||
#include <iostream>
|
||||
#include "bmpimage.h"
|
||||
#include "psf.h"
|
||||
#include <image-lib/bmpimage.h>
|
||||
#include <image-lib/filters.h>
|
||||
|
||||
auto font = readPSF("../fonts/ruscii_8x16_2.psf");
|
||||
|
||||
|
@ -190,11 +190,11 @@ void test2() {
|
|||
auto background_color = Pixel{0, 0, 0};
|
||||
auto font_color = Pixel{255, 255, 255};
|
||||
auto glyph = font._glyphs[u'б'];
|
||||
auto w = glyph.width;
|
||||
auto h = glyph.height;
|
||||
auto w = glyph->width;
|
||||
auto h = glyph->height;
|
||||
|
||||
uint32_t imgWidth = 16 * glyph.width;
|
||||
uint32_t imgHeight = 16 * glyph.height;
|
||||
uint32_t imgWidth = 16 * glyph->width;
|
||||
uint32_t imgHeight = 16 * glyph->height;
|
||||
PixelArray test(imgWidth, imgHeight);
|
||||
std::u16string str = u"Hello, World! Привет, Мир!";
|
||||
uint32_t k = 0;
|
||||
|
@ -205,7 +205,7 @@ void test2() {
|
|||
glyph = it.second;
|
||||
for (int i = 0; i < h; ++i) {
|
||||
for (int j = 0; j < w; ++j) {
|
||||
if (glyph.glyph[i][j])
|
||||
if (glyph->glyph[i][j])
|
||||
test((k / 16) * h + i, (k % 16) * w + j) = font_color;
|
||||
else
|
||||
test((k / 16) * h + i, (k % 16) * w + j) = background_color;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue