VTK  9.3.20240420
vtkFreeTypeStringToImage.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
3
13#ifndef vtkFreeTypeStringToImage_h
14#define vtkFreeTypeStringToImage_h
15
16#include "vtkRenderingFreeTypeModule.h" // For export macro
17#include "vtkSmartPointer.h" // For SP ivars
18#include "vtkStringToImage.h"
19
20VTK_ABI_NAMESPACE_BEGIN
21class VTKRENDERINGFREETYPE_EXPORT vtkFreeTypeStringToImage : public vtkStringToImage
22{
23public:
25 void PrintSelf(ostream& os, vtkIndent indent) override;
26
28
30
43 vtkVector2i GetBounds(vtkTextProperty* property, const vtkStdString& string, int dpi) override;
45
47
54 int RenderString(vtkTextProperty* property, const vtkStdString& string, int dpi,
55 vtkImageData* data, int textDims[2] = nullptr) override;
57
62 void SetScaleToPowerOfTwo(bool scale) override;
63
68
69protected:
72
73 class Internals;
74 Internals* Implementation;
75
76private:
78 void operator=(const vtkFreeTypeStringToImage&) = delete;
79};
80
81VTK_ABI_NAMESPACE_END
82#endif // vtkFreeTypeStringToImage_h
render the supplied text to an image.
vtkVector2i GetBounds(vtkTextProperty *property, const vtkStdString &string, int dpi) override
Given a text property and a string, get the bounding box [xmin, xmax] x [ymin, ymax].
static vtkFreeTypeStringToImage * New()
void SetScaleToPowerOfTwo(bool scale) override
Should we produce images at powers of 2, makes rendering on old OpenGL hardware easier.
int RenderString(vtkTextProperty *property, const vtkStdString &string, int dpi, vtkImageData *data, int textDims[2]=nullptr) override
Given a text property and a string, this function initializes the vtkImageData *data and renders it i...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkFreeTypeStringToImage() override
void DeepCopy(vtkFreeTypeStringToImage *utility)
Make a deep copy of the supplied utility class.
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:108
Wrapper around std::string to keep symbols short.
base class for classes that render supplied text to an image.
represent text properties.
Some derived classes for the different vectors commonly used.
Definition vtkVector.h:470