VTK
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 "vtkRenderingFreeTypeModule.h" // For export macro
26 #include "vtkSmartPointer.h" // For SP ivars
27 #include "vtkStringToImage.h"
28 
29 class VTKRENDERINGFREETYPE_EXPORT vtkFreeTypeStringToImage : public vtkStringToImage
30 {
31 public:
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
35  static vtkFreeTypeStringToImage* New();
36 
38 
52  vtkTextProperty* property, const vtkUnicodeString& string, int dpi) override;
53  vtkVector2i GetBounds(vtkTextProperty* property, const vtkStdString& string, int dpi) override;
55 
57 
64  int RenderString(vtkTextProperty* property, const vtkUnicodeString& string, int dpi,
65  vtkImageData* data, int textDims[2] = nullptr) override;
66  int RenderString(vtkTextProperty* property, const vtkStdString& string, int dpi,
67  vtkImageData* data, int textDims[2] = nullptr) override;
69 
74  void SetScaleToPowerOfTwo(bool scale) override;
75 
79  void DeepCopy(vtkFreeTypeStringToImage* utility);
80 
81 protected:
83  ~vtkFreeTypeStringToImage() override;
84 
85  class Internals;
86  Internals* Implementation;
87 
88 private:
90  void operator=(const vtkFreeTypeStringToImage&) = delete;
91 };
92 
93 #endif // vtkFreeTypeStringToImage_h
vtkX3D::scale
Definition: vtkX3D.h:235
vtkX3D::data
Definition: vtkX3D.h:321
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkStringToImage
base class for classes that render supplied text to an image.
Definition: vtkStringToImage.h:37
vtkStringToImage::RenderString
virtual int RenderString(vtkTextProperty *property, const vtkUnicodeString &string, int dpi, vtkImageData *data, int textDims[2]=nullptr)=0
Given a text property and a string, this function initializes the vtkImageData *data and renders it i...
vtkStringToImage::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkFreeTypeStringToImage::Implementation
Internals * Implementation
Definition: vtkFreeTypeStringToImage.h:85
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:41
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkUnicodeString
String class that stores Unicode text.
Definition: vtkUnicodeString.h:69
vtkSmartPointer.h
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:33
vtkStringToImage.h
vtkStringToImage::SetScaleToPowerOfTwo
virtual void SetScaleToPowerOfTwo(bool scale)
Should we produce images at powers of 2, makes rendering on old OpenGL hardware easier.
vtkStringToImage::GetBounds
virtual vtkVector2i GetBounds(vtkTextProperty *property, const vtkUnicodeString &string, int dpi)=0
Given a text property and a string, get the bounding box [xmin, xmax] x [ymin, ymax].
vtkVector2i
Some derived classes for the different vectors commonly used.
Definition: vtkVector.h:419
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:34
vtkFreeTypeStringToImage
render the supplied text to an image.
Definition: vtkFreeTypeStringToImage.h:29