AvogadroLibs 1.98.1
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QtTextRenderStrategy Class Reference

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

#include <qttextrenderstrategy.h>

Inheritance diagram for QtTextRenderStrategy:
TextRenderStrategy

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
overridevirtual

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
overridevirtual
Parameters
stringThe text.
tpropThe properties.
bboxThe 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
stringThe text.
tpropThe properties.
bufferThe 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.
dimsDimensions 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: