VTK  9.3.20240328
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 
20 VTK_ABI_NAMESPACE_BEGIN
21 class VTKRENDERINGFREETYPE_EXPORT vtkFreeTypeStringToImage : public vtkStringToImage
22 {
23 public:
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 
69 protected:
72 
73  class Internals;
74  Internals* Implementation;
75 
76 private:
78  void operator=(const vtkFreeTypeStringToImage&) = delete;
79 };
80 
81 VTK_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].
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.
static vtkFreeTypeStringToImage * New()
~vtkFreeTypeStringToImage() override
void DeepCopy(vtkFreeTypeStringToImage *utility)
Make a deep copy of the supplied utility class.
topologically and geometrically regular array of data
Definition: vtkImageData.h:155
a simple class to control print indentation
Definition: vtkIndent.h:108
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:78
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
@ scale
Definition: vtkX3D.h:229
@ data
Definition: vtkX3D.h:315