VTK  9.7.20260928
vtkStringToImage.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
12
13#ifndef vtkStringToImage_h
14#define vtkStringToImage_h
15
16#include "vtkObject.h"
17#include "vtkRenderingCoreModule.h" // For export macro
18#include "vtkVector.h" // For vtkVector2i
19#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
20
21VTK_ABI_NAMESPACE_BEGIN
22class vtkStdString;
23class vtkTextProperty;
24class vtkImageData;
25
26class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkStringToImage : public vtkObject
27{
28public:
30 void PrintSelf(ostream& os, vtkIndent indent) override;
31
33
46 virtual vtkVector2i GetBounds(vtkTextProperty* property, const vtkStdString& string, int dpi) = 0;
48
50
57 virtual int RenderString(vtkTextProperty* property, const vtkStdString& string, int dpi,
58 vtkImageData* data, int text_dims[2] = nullptr) = 0;
60
65 virtual void SetScaleToPowerOfTwo(bool scale);
66 vtkGetMacro(ScaleToPowerOfTwo, bool);
67
68protected:
71
74
75private:
76 vtkStringToImage(const vtkStringToImage&) = delete;
77 void operator=(const vtkStringToImage&) = delete;
78};
79
80VTK_ABI_NAMESPACE_END
81#endif // vtkStringToImage_h
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:108
Wrapper around std::string to keep symbols short.
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.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkStringToImage() override
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].
represent text properties.
Some derived classes for the different vectors commonly used.
Definition vtkVector.h:450
#define VTK_MARSHALAUTO