The QtTextRenderStrategy class uses the Qt toolkit to render text.
More...
#include <qttextrenderstrategy.h>
|
TextRenderStrategy * | newInstance () const override |
|
void | boundingBox (const std::string &string, const Rendering::TextProperties &tprop, int bbox[4]) const override |
| Calculate a bounding box. More...
|
|
void | render (const std::string &string, const Rendering::TextProperties &tprop, unsigned char *buffer, const Vector2i &dims) const override |
| render Render the string. More...
|
|
|
bool | preserveArgb () const |
|
void | setPreserveArgb (bool b) |
|
virtual TextRenderStrategy * | newInstance () const =0 |
|
virtual void | boundingBox (const std::string &string, const TextProperties &tprop, int bbox[4]) const =0 |
| Calculate a bounding box. More...
|
|
virtual void | render (const std::string &string, const TextProperties &tprop, unsigned char *buffer, const Vector2i &dims) const =0 |
| render Render the string. More...
|
|
<avogadro/qtopengl/qttextrenderstrategy.h>
◆ newInstance()
TextRenderStrategy * newInstance |
( |
| ) |
const |
|
overridevirtual |
Copy the current TextRenderStrategy implementation into an new object.
Implements TextRenderStrategy.
◆ boundingBox()
- Parameters
-
string | The text. |
tprop | The properties. |
bbox | The result in pixels (left, right, top, bottom). |
Implements TextRenderStrategy.
◆ render()
void render |
( |
const std::string & |
string, |
|
|
const Rendering::TextProperties & |
tprop, |
|
|
unsigned char * |
buffer, |
|
|
const Vector2i & |
dims |
|
) |
| const |
|
overridevirtual |
- Parameters
-
string | The text. |
tprop | The properties. |
buffer | The target. Must be dims[0]*dims[1]*4 bytes. The buffer will be filled with RGBA image data, with the top scan row at the beginning. |
dims | Dimensions in pixels of the target buffer. |
Implements TextRenderStrategy.
◆ preserveArgb()
bool preserveArgb |
( |
| ) |
const |
Keep the buffer as a QImage::Format_ARGB32_Premultiplied image. Useful for testing.
- Note
- The result buffer may or may not actually be ARGB ordered depending on system endianness. See the QImage docs for more info.
◆ setPreserveArgb()
void setPreserveArgb |
( |
bool |
b | ) |
|
Keep the buffer as a QImage::Format_ARGB32_Premultiplied image. Useful for testing.
- Note
- The result buffer may or may not actually be ARGB ordered depending on system endianness. See the QImage docs for more info.
The documentation for this class was generated from the following file: