Graphics/Image: dont store PixelFormat, instead define a new enum for number of channels.
The image class has a strict internal representation so we dont need "format". PixelFormat enum can be passed to functions that modify the pixel data (like setPixels()) so that a proper convertion can be done.
This commit is contained in:
parent
6f9b33be8f
commit
f7fcc2633c
4 changed files with 53 additions and 86 deletions
|
|
@ -99,10 +99,7 @@ Glyph FreeTypeEngine::loadGlyph(unsigned int codepoint, Image& img, unsigned int
|
|||
FT_Glyph_To_Bitmap(&glyph_info, FT_RENDER_MODE_NORMAL, 0, true);
|
||||
FT_Bitmap& bmp = reinterpret_cast<FT_BitmapGlyph>(glyph_info)->bitmap;
|
||||
|
||||
img.create(PixelFormat::PF_Alpha,
|
||||
bmp.width,
|
||||
bmp.rows,
|
||||
bmp.buffer);
|
||||
img.create(bmp.width, bmp.rows, bmp.buffer, PixelFormat::PF_Alpha);
|
||||
|
||||
glyph.offset.x = static_cast<unsigned char>(metrics.horiBearingX / (1 << 6));
|
||||
glyph.offset.y = static_cast<unsigned char>(metrics.horiBearingY / (1 << 6));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue