VTK  9.1.0
vtkFreeTypeStringToImage.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkFreeTypeStringToImage.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 vtkFreeTypeStringToImage_h
23#define vtkFreeTypeStringToImage_h
24
25#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_1_0
26#include "vtkRenderingFreeTypeModule.h" // For export macro
27#include "vtkSmartPointer.h" // For SP ivars
28#include "vtkStringToImage.h"
29
30class VTKRENDERINGFREETYPE_EXPORT vtkFreeTypeStringToImage : public vtkStringToImage
31{
32public:
34 void PrintSelf(ostream& os, vtkIndent indent) override;
35
37
39
53 vtkTextProperty* property, const vtkUnicodeString& string, int dpi) override;
54 vtkVector2i GetBounds(vtkTextProperty* property, const vtkStdString& string, int dpi) override;
56
58
65 int RenderString(vtkTextProperty* property, const vtkUnicodeString& string, int dpi,
66 vtkImageData* data, int textDims[2] = nullptr) override;
67 int RenderString(vtkTextProperty* property, const vtkStdString& string, int dpi,
68 vtkImageData* data, int textDims[2] = nullptr) override;
70
75 void SetScaleToPowerOfTwo(bool scale) override;
76
81
82protected:
85
86 class Internals;
87 Internals* Implementation;
88
89private:
91 void operator=(const vtkFreeTypeStringToImage&) = delete;
92};
93
94#endif // vtkFreeTypeStringToImage_h
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].
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 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...
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
Definition: vtkImageData.h:157
a simple class to control print indentation
Definition: vtkIndent.h:113
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:105
base class for classes that render supplied text to an image.
represent text properties.
String class that stores Unicode text.
Some derived classes for the different vectors commonly used.
Definition: vtkVector.h:478