VTK  9.2.6
vtkPNGWriter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkPNGWriter.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=========================================================================*/
141#ifndef vtkPNGWriter_h
142#define vtkPNGWriter_h
143
144#include "vtkIOImageModule.h" // For export macro
145#include "vtkImageWriter.h"
146
147class vtkImageData;
149
150class VTKIOIMAGE_EXPORT vtkPNGWriter : public vtkImageWriter
151{
152public:
153 static vtkPNGWriter* New();
155 void PrintSelf(ostream& os, vtkIndent indent) override;
156
160 void Write() override;
161
163
170 vtkSetClampMacro(CompressionLevel, int, 0, 9);
171 vtkGetMacro(CompressionLevel, int);
173
175
178 vtkSetMacro(WriteToMemory, vtkTypeUBool);
179 vtkGetMacro(WriteToMemory, vtkTypeUBool);
180 vtkBooleanMacro(WriteToMemory, vtkTypeUBool);
182
184
189 vtkGetObjectMacro(Result, vtkUnsignedCharArray);
191
199 void AddText(const char* key, const char* value);
200
204 void ClearText();
205
207
210 static const char* TITLE;
211 static const char* AUTHOR;
212 static const char* DESCRIPTION;
213 static const char* COPYRIGHT;
214 static const char* CREATION_TIME;
215 static const char* SOFTWARE;
216 static const char* DISCLAIMER;
217 static const char* WARNING;
218 static const char* SOURCE;
219 static const char* COMMENT;
221
222protected:
224 ~vtkPNGWriter() override;
225
226 void WriteSlice(vtkImageData* data, int* uExtent);
229 FILE* TempFP;
230 class vtkInternals;
231 vtkInternals* Internals;
232
233private:
234 vtkPNGWriter(const vtkPNGWriter&) = delete;
235 void operator=(const vtkPNGWriter&) = delete;
236};
237
238#endif
topologically and geometrically regular array of data
Definition: vtkImageData.h:163
Writes images to files.
a simple class to control print indentation
Definition: vtkIndent.h:119
Writes PNG files.
Definition: vtkPNGWriter.h:151
static const char * CREATION_TIME
Standard keys.
Definition: vtkPNGWriter.h:214
vtkUnsignedCharArray * Result
Definition: vtkPNGWriter.h:228
static const char * WARNING
Standard keys.
Definition: vtkPNGWriter.h:217
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.
Definition: vtkPNGWriter.h:216
static const char * COPYRIGHT
Standard keys.
Definition: vtkPNGWriter.h:213
void Write() override
The main interface which triggers the writer to start.
static const char * COMMENT
Standard keys.
Definition: vtkPNGWriter.h:219
vtkInternals * Internals
Definition: vtkPNGWriter.h:231
void ClearText()
Clear out any key/value pairs added through the AddText() member function.
static const char * SOURCE
Standard keys.
Definition: vtkPNGWriter.h:218
static const char * SOFTWARE
Standard keys.
Definition: vtkPNGWriter.h:215
static const char * TITLE
Standard keys.
Definition: vtkPNGWriter.h:210
static const char * AUTHOR
Standard keys.
Definition: vtkPNGWriter.h:211
int CompressionLevel
Definition: vtkPNGWriter.h:227
~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.
Definition: vtkPNGWriter.h:212
dynamic, self-adjusting array of unsigned char
@ key
Definition: vtkX3D.h:263
@ value
Definition: vtkX3D.h:226
@ data
Definition: vtkX3D.h:321
unsigned int vtkTypeUBool
Definition: vtkABI.h:70