Text image drawer, used to draw arbitrary text onto an image. This needs to be its own class as the font needs to be loaded and kept around as a pointer.
More...
#include <text.h>
|
| void | init_font (std::string font_path) |
| | Init the font.
|
|
void | init_font () |
| | Init with the default font.
|
| bool | font_ready () |
| | Is the font ready?
|
| int | draw_text (Image &img, int xs0, int ys0, std::vector< double > color, int size, std::string text) |
| | Draw text onto an image.
|
|
|
font_info | font |
|
bool | has_font = false |
|
uint8_t * | ttf_buffer |
Text image drawer, used to draw arbitrary text onto an image. This needs to be its own class as the font needs to be loaded and kept around as a pointer.
◆ draw_text()
| int satdump::image::TextDrawer::draw_text |
( |
Image & | img, |
|
|
int | xs0, |
|
|
int | ys0, |
|
|
std::vector< double > | color, |
|
|
int | size, |
|
|
std::string | text ) |
Draw text onto an image.
- Parameters
-
| img | to draw onto |
| xs0 | start X position |
| ys0 | start Y position |
| color | of the text |
| size | size/height (in pixels) of the text to draw |
| text | string the draw |
- Returns
- text length on X axis in pixels
◆ font_ready()
| bool satdump::image::TextDrawer::font_ready |
( |
| ) |
|
|
inline |
Is the font ready?
- Returns
- true if the font is ready
◆ init_font()
| void satdump::image::TextDrawer::init_font |
( |
std::string | font_path | ) |
|
Init the font.
- Parameters
-
| font_path | path to a .ttf file |
The documentation for this class was generated from the following files:
- src-core/image/text.h
- src-core/image/text.cpp