VTK  9.3.20240423
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
129#ifndef vtkPNGWriter_h
130#define vtkPNGWriter_h
131
132#include "vtkIOImageModule.h" // For export macro
133#include "vtkImageWriter.h"
134
135VTK_ABI_NAMESPACE_BEGIN
136class vtkImageData;
138
139class VTKIOIMAGE_EXPORT vtkPNGWriter : public vtkImageWriter
140{
141public:
142 static vtkPNGWriter* New();
144 void PrintSelf(ostream& os, vtkIndent indent) override;
145
149 void Write() override;
150
152
159 vtkSetClampMacro(CompressionLevel, int, 0, 9);
160 vtkGetMacro(CompressionLevel, int);
162
164
167 vtkSetMacro(WriteToMemory, vtkTypeUBool);
168 vtkGetMacro(WriteToMemory, vtkTypeUBool);
169 vtkBooleanMacro(WriteToMemory, vtkTypeUBool);
171
173
178 vtkGetObjectMacro(Result, vtkUnsignedCharArray);
180
188 void AddText(const char* key, const char* value);
189
193 void ClearText();
194
196
199 static const char* TITLE;
200 static const char* AUTHOR;
201 static const char* DESCRIPTION;
202 static const char* COPYRIGHT;
203 static const char* CREATION_TIME;
204 static const char* SOFTWARE;
205 static const char* DISCLAIMER;
206 static const char* WARNING;
207 static const char* SOURCE;
208 static const char* COMMENT;
210
211protected:
213 ~vtkPNGWriter() override;
214
215 void WriteSlice(vtkImageData* data, int* uExtent);
218 FILE* TempFP;
219 class vtkInternals;
220 vtkInternals* Internals;
221
222private:
223 vtkPNGWriter(const vtkPNGWriter&) = delete;
224 void operator=(const vtkPNGWriter&) = delete;
225};
226
227VTK_ABI_NAMESPACE_END
228#endif
topologically and geometrically regular array of data
Writes images to files.
a simple class to control print indentation
Definition vtkIndent.h:108
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