VTK  9.4.20241226
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
13#ifndef vtkStringToImage_h
14#define vtkStringToImage_h
15
16#include "vtkObject.h"
17#include "vtkRenderingCoreModule.h" // For export macro
18
19VTK_ABI_NAMESPACE_BEGIN
20class vtkStdString;
21class vtkTextProperty;
22class vtkImageData;
23class vtkVector2i;
24
25class VTKRENDERINGCORE_EXPORT vtkStringToImage : public vtkObject
26{
27public:
29 void PrintSelf(ostream& os, vtkIndent indent) override;
30
32
45 virtual vtkVector2i GetBounds(vtkTextProperty* property, const vtkStdString& string, int dpi) = 0;
47
49
56 virtual int RenderString(vtkTextProperty* property, const vtkStdString& string, int dpi,
57 vtkImageData* data, int text_dims[2] = nullptr) = 0;
59
64 virtual void SetScaleToPowerOfTwo(bool scale);
65 vtkGetMacro(ScaleToPowerOfTwo, bool);
66
67protected:
70
73
74private:
75 vtkStringToImage(const vtkStringToImage&) = delete;
76 void operator=(const vtkStringToImage&) = delete;
77};
78
79VTK_ABI_NAMESPACE_END
80#endif // vtkStringToImage_h
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
Wrapper around std::string to keep symbols short.
base class for classes that render supplied text to an image.
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:440