VTK  9.3.1
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 
27  static vtkFreeTypeStringToImage* New();
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 
67  void DeepCopy(vtkFreeTypeStringToImage* utility);
68 
69 protected:
71  ~vtkFreeTypeStringToImage() override;
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
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:28
render the supplied text to an image.
base class for classes that render supplied text to an image.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual vtkVector2i GetBounds(vtkTextProperty *property, const vtkStdString &string, int dpi)=0
Given a text property and a string, get the bounding box [xmin, xmax] x [ymin, ymax].
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
Some derived classes for the different vectors commonly used.
Definition: vtkVector.h:440
represent text properties.
virtual int RenderString(vtkTextProperty *property, const vtkStdString &string, int dpi, vtkImageData *data, int text_dims[2]=nullptr)=0
Given a text property and a string, this function initializes the vtkImageData *data and renders it i...
virtual void SetScaleToPowerOfTwo(bool scale)
Should we produce images at powers of 2, makes rendering on old OpenGL hardware easier.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...