Avogadro::QtOpenGL::QtTextRenderStrategy#

class QtTextRenderStrategy : public TextRenderStrategy#

The QtTextRenderStrategy class uses the Qt toolkit to render text.

<avogadro/qtopengl/qttextrenderstrategy.h>

Unnamed Group

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

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

Public Functions

QtTextRenderStrategy()#
~QtTextRenderStrategy() override#
virtual TextRenderStrategy *newInstance() const override#

Copy the current TextRenderStrategy implementation into an new object.

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

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 Rendering::TextProperties &tprop, unsigned char *buffer, const Vector2i &dims) const override#

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.