VTK  9.3.0
vtkPNGWriter.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
29#ifndef vtkPNGWriter_h
30#define vtkPNGWriter_h
31
32#include "vtkIOImageModule.h" // For export macro
33#include "vtkImageWriter.h"
34
35VTK_ABI_NAMESPACE_BEGIN
36class vtkImageData;
38
39class VTKIOIMAGE_EXPORT vtkPNGWriter : public vtkImageWriter
40{
41public:
42 static vtkPNGWriter* New();
44 void PrintSelf(ostream& os, vtkIndent indent) override;
45
49 void Write() override;
50
52
59 vtkSetClampMacro(CompressionLevel, int, 0, 9);
60 vtkGetMacro(CompressionLevel, int);
62
64
67 vtkSetMacro(WriteToMemory, vtkTypeUBool);
68 vtkGetMacro(WriteToMemory, vtkTypeUBool);
69 vtkBooleanMacro(WriteToMemory, vtkTypeUBool);
71
73
78 vtkGetObjectMacro(Result, vtkUnsignedCharArray);
80
88 void AddText(const char* key, const char* value);
89
93 void ClearText();
94
96
99 static const char* TITLE;
100 static const char* AUTHOR;
101 static const char* DESCRIPTION;
102 static const char* COPYRIGHT;
103 static const char* CREATION_TIME;
104 static const char* SOFTWARE;
105 static const char* DISCLAIMER;
106 static const char* WARNING;
107 static const char* SOURCE;
108 static const char* COMMENT;
110
111protected:
113 ~vtkPNGWriter() override;
114
115 void WriteSlice(vtkImageData* data, int* uExtent);
118 FILE* TempFP;
119 class vtkInternals;
120 vtkInternals* Internals;
121
122private:
123 vtkPNGWriter(const vtkPNGWriter&) = delete;
124 void operator=(const vtkPNGWriter&) = delete;
125};
126
127VTK_ABI_NAMESPACE_END
128#endif
topologically and geometrically regular array of data
Writes images to files.
a simple class to control print indentation
Definition vtkIndent.h:38
Writes PNG files.
static const char * CREATION_TIME
Standard keys.
vtkUnsignedCharArray * Result
static const char * WARNING
Standard keys.
void WriteSlice(vtkImageData *data, int *uExtent)
virtual void SetResult(vtkUnsignedCharArray *)
When writing to memory this is the result, it will be nullptr until the data is written the first tim...
static const char * DISCLAIMER
Standard keys.
static const char * COPYRIGHT
Standard keys.
void Write() override
The main interface which triggers the writer to start.
static const char * COMMENT
Standard keys.
vtkInternals * Internals
void ClearText()
Clear out any key/value pairs added through the AddText() member function.
static const char * SOURCE
Standard keys.
static const char * SOFTWARE
Standard keys.
static const char * TITLE
Standard keys.
static const char * AUTHOR
Standard keys.
~vtkPNGWriter() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void AddText(const char *key, const char *value)
Adds a text chunk to the PNG.
static vtkPNGWriter * New()
static const char * DESCRIPTION
Standard keys.
dynamic, self-adjusting array of unsigned char
unsigned int vtkTypeUBool
Definition vtkABI.h:65