VTK  9.0.1
vtkTextRendererStringToImage.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTextRendererStringToImage.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
22 #ifndef vtkTextRendererStringToImage_h
23 #define vtkTextRendererStringToImage_h
24 
25 #include "vtkRenderingFreeTypeModule.h" // For export macro
26 #include "vtkStringToImage.h"
27 
28 class VTKRENDERINGFREETYPE_EXPORT vtkTextRendererStringToImage : public vtkStringToImage
29 {
30 public:
32  void PrintSelf(ostream& os, vtkIndent indent) override;
33 
35 
37 
51  vtkTextProperty* property, const vtkUnicodeString& string, int dpi) override;
52  vtkVector2i GetBounds(vtkTextProperty* property, const vtkStdString& string, int dpi) override;
54 
56 
63  int RenderString(vtkTextProperty* property, const vtkUnicodeString& string, int dpi,
64  vtkImageData* data, int textDims[2] = nullptr) override;
65  int RenderString(vtkTextProperty* property, const vtkStdString& string, int dpi,
66  vtkImageData* data, int textDims[2] = nullptr) override;
68 
73  void SetScaleToPowerOfTwo(bool scale) override;
74 
79 
80 protected:
83 
84  class Internals;
85  Internals* Implementation;
86 
87 private:
89  void operator=(const vtkTextRendererStringToImage&) = delete;
90 };
91 
92 #endif // vtkTextRendererStringToImage_h
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
a simple class to control print indentation
Definition: vtkIndent.h:34
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:35
base class for classes that render supplied text to an image.
represent text properties.
uses vtkTextRenderer to render the supplied text to an image.
vtkVector2i GetBounds(vtkTextProperty *property, const vtkUnicodeString &string, int dpi) override
Given a text property and a string, get the bounding box [xmin, xmax] x [ymin, ymax].
static vtkTextRendererStringToImage * New()
void DeepCopy(vtkTextRendererStringToImage *utility)
Make a deep copy of the supplied utility class.
vtkVector2i GetBounds(vtkTextProperty *property, const vtkStdString &string, int dpi) override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int RenderString(vtkTextProperty *property, const vtkUnicodeString &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 SetScaleToPowerOfTwo(bool scale) override
Should we produce images at powers of 2, makes rendering on old OpenGL hardware easier.
~vtkTextRendererStringToImage() override
int RenderString(vtkTextProperty *property, const vtkStdString &string, int dpi, vtkImageData *data, int textDims[2]=nullptr) override
String class that stores Unicode text.
Some derived classes for the different vectors commonly used.
Definition: vtkVector.h:420
@ scale
Definition: vtkX3D.h:235
@ data
Definition: vtkX3D.h:321