Class Avogadro::Rendering::TextRenderStrategy#

class Avogadro::Rendering::TextRenderStrategy#

The TextRenderStrategy class defines an interface for generating text images.

<avogadro/rendering/textrenderstrategy.h>

Subclassed by QtTextRenderStrategy

Public Functions

TextRenderStrategy()#
virtual ~TextRenderStrategy()#
virtual TextRenderStrategy *newInstance() const = 0#

Copy the current TextRenderStrategy implementation into an new object.

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

Calculate a bounding box.

Parameters
  • string – The text.

  • tprop – The properties.

  • bbox – The result in pixels (left, right, top, bottom).

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

render Render the string.

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.