VTK  9.3.1
vtkTextRendererStringToImage.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 
10 #ifndef vtkTextRendererStringToImage_h
11 #define vtkTextRendererStringToImage_h
12 
13 #include "vtkRenderingFreeTypeModule.h" // For export macro
14 #include "vtkStringToImage.h"
15 
16 VTK_ABI_NAMESPACE_BEGIN
17 class VTKRENDERINGFREETYPE_EXPORT vtkTextRendererStringToImage : public vtkStringToImage
18 {
19 public:
21  void PrintSelf(ostream& os, vtkIndent indent) override;
22 
24 
26 
39  vtkVector2i GetBounds(vtkTextProperty* property, const vtkStdString& string, int dpi) override;
41 
43 
50  int RenderString(vtkTextProperty* property, const vtkStdString& string, int dpi,
51  vtkImageData* data, int textDims[2] = nullptr) override;
53 
58  void SetScaleToPowerOfTwo(bool scale) override;
59 
63  void DeepCopy(vtkTextRendererStringToImage* utility);
64 
65 protected:
67  ~vtkTextRendererStringToImage() override;
68 
69  class Internals;
70  Internals* Implementation;
71 
72 private:
74  void operator=(const vtkTextRendererStringToImage&) = delete;
75 };
76 
77 VTK_ABI_NAMESPACE_END
78 #endif // vtkTextRendererStringToImage_h
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:28
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
uses vtkTextRenderer to render the supplied text to an image.
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...