Loading...
Searching...
No Matches
TextRenderStrategy Class Referenceabstract

The TextRenderStrategy class defines an interface for generating text images. More...

`#include <textrenderstrategy.h>`

Inheritance diagram for TextRenderStrategy:

## Public Member Functions

virtual TextRenderStrategy * | newInstance () const =0
virtual void | boundingBox (const std::string &string, const TextProperties &tprop, int bbox[4]) const =0
| Calculate a bounding box.
virtual void | render (const std::string &string, const TextProperties &tprop, unsigned char *buffer, const Vector2i &dims) const =0
| render Render the string.

## Detailed Description

<avogadro/rendering/textrenderstrategy.h>

## Member Function Documentation

## newInstance()

virtual TextRenderStrategy * newInstance | ( |  | ) | const

pure virtual

Copy the current TextRenderStrategy implementation into an new object.

Implemented in QtTextRenderStrategy.

## boundingBox()

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

pure virtual

Parameters

  string | The text.
  tprop | The properties.
  bbox | The result in pixels (left, right, top, bottom).

Implemented in QtTextRenderStrategy.

## render()

virtual void render | ( | const std::string & | string,
|  | const TextProperties & | tprop,
|  | unsigned char * | buffer,
|  | const Vector2i & | dims ) const

pure 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.

Implemented in QtTextRenderStrategy.

The documentation for this class was generated from the following file:

- textrenderstrategy.h