![]() |
Visual Servoing Platform version 3.7.0
|
#include <vpFont.h>
Public Types | |
| enum | vpFontFamily { GENERIC_MONOSPACE , TRUETYPE_FILE } |
Public Member Functions | |
| vpFont (unsigned int height=16, const vpFontFamily &fontFamily=TRUETYPE_FILE, const std::string &ttfFilename=std::string(VISP_RUBIK_REGULAR_FONT_RESOURCES)) | |
| ~vpFont () | |
| bool | drawText (vpImage< unsigned char > &I, const std::string &text, const vpImagePoint &position, unsigned char color) const |
| bool | drawText (vpImage< unsigned char > &I, const std::string &text, const vpImagePoint &position, unsigned char color, unsigned char background) const |
| bool | drawText (vpImage< vpRGBa > &I, const std::string &text, const vpImagePoint &position, const vpColor &color) const |
| bool | drawText (vpImage< vpRGBa > &I, const std::string &text, const vpImagePoint &position, const vpColor &color, const vpColor &background) const |
| unsigned int | getHeight () const |
| vpImagePoint | getMeasure (const std::string &text) const |
| bool | setHeight (unsigned int height) |
Font drawing functions for image.
| enum vpFont::vpFontFamily |
| Enumerator | |
|---|---|
| GENERIC_MONOSPACE | |
| TRUETYPE_FILE | |
| BEGIN_VISP_NAMESPACE vpFont::vpFont | ( | unsigned int | height = 16, |
| const vpFontFamily & | fontFamily = TRUETYPE_FILE, | ||
| const std::string & | ttfFilename = std::string(VISP_RUBIK_REGULAR_FONT_RESOURCES) ) |
Creates a new font class with given height.
| [in] | height | : Initial font height value in pixels. By default it is equal to 16 pixels. |
| [in] | fontFamily | : Font family in TTF format. |
| [in] | ttfFilename | : Path to the TTF file if needed. Can contain multiple paths separated by ;character. The first valid path that is found is used. |
Definition at line 2617 of file vpFont.cpp.
| vpFont::~vpFont | ( | ) |
Destructor.
Definition at line 2624 of file vpFont.cpp.
| bool vpFont::drawText | ( | vpImage< unsigned char > & | I, |
| const std::string & | text, | ||
| const vpImagePoint & | position, | ||
| unsigned char | color ) const |
Draws a text at the image.
| [in,out] | I | : Image where we draw text. |
| [in] | text | : A text to draw. |
| [in] | position | : A position to draw text. |
| [in] | color | : A color of the text. |
Definition at line 2636 of file vpFont.cpp.
| bool vpFont::drawText | ( | vpImage< unsigned char > & | I, |
| const std::string & | text, | ||
| const vpImagePoint & | position, | ||
| unsigned char | color, | ||
| unsigned char | background ) const |
Draws a text at the image. Fills the text background by given color.
| [in,out] | I | : Image where we draw text. |
| [in] | text | : A text to draw. |
| [in] | position | : A position to draw text. |
| [in] | color | : A color of the text. |
| [in] | background | : Background color. |
Definition at line 2653 of file vpFont.cpp.
| bool vpFont::drawText | ( | vpImage< vpRGBa > & | I, |
| const std::string & | text, | ||
| const vpImagePoint & | position, | ||
| const vpColor & | color ) const |
Draws a text at the image.
| [in,out] | I | : Image where we draw text. |
| [in] | text | : A text to draw. |
| [in] | position | : A position to draw text. |
| [in] | color | : A color of the text. |
Definition at line 2669 of file vpFont.cpp.
| bool vpFont::drawText | ( | vpImage< vpRGBa > & | I, |
| const std::string & | text, | ||
| const vpImagePoint & | position, | ||
| const vpColor & | color, | ||
| const vpColor & | background ) const |
Draws a text at the image. Fills the text background by given color.
| [in,out] | I | : Image where we draw text. |
| [in] | text | : A text to draw. |
| [in] | position | : A position to draw text. |
| [in] | color | : A color of the text. |
| [in] | background | : Background color. |
Definition at line 2686 of file vpFont.cpp.
| unsigned int vpFont::getHeight | ( | ) | const |
Gets height of the font in pixels.
Definition at line 2697 of file vpFont.cpp.
| vpImagePoint vpFont::getMeasure | ( | const std::string & | text | ) | const |
Gets text bounding box size.
Definition at line 2704 of file vpFont.cpp.
| bool vpFont::setHeight | ( | unsigned int | height | ) |
Sets a new height value to font.
| [in] | height | : A new height value in pixels. |
Definition at line 2713 of file vpFont.cpp.