Loading...
Searching...
No Matches
QtTextRenderStrategy Class Reference

The QtTextRenderStrategy class uses the Qt toolkit to render text. More...

`#include <qttextrenderstrategy.h>`

Inheritance diagram for QtTextRenderStrategy:

## Public Member Functions

TextRenderStrategy * | newInstance () const override
void | boundingBox (const std::string &string, const Rendering::TextProperties &tprop, int bbox[4]) const override
| Calculate a bounding box.
void | render (const std::string &string, const Rendering::TextProperties &tprop, unsigned char *buffer, const Vector2i &dims) const override
| render Render the string.
bool | preserveArgb () const
void | setPreserveArgb (bool b)

## Detailed Description

<avogadro/qtopengl/qttextrenderstrategy.h>

## Member Function Documentation

## newInstance()

TextRenderStrategy * newInstance | ( |  | ) | const

override virtual

Copy the current TextRenderStrategy implementation into an new object.

Implements TextRenderStrategy.

## boundingBox()

void boundingBox | ( | const std::string & | string,
|  | const Rendering::TextProperties & | tprop,
|  | int | bbox[4] ) const

override virtual

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

override virtual

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:

- qttextrenderstrategy.h