VTK  9.1.0
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=========================================================================*/
135#ifndef vtkPNGWriter_h
136#define vtkPNGWriter_h
137
138#include "vtkIOImageModule.h" // For export macro
139#include "vtkImageWriter.h"
140
141class vtkImageData;
143
144class VTKIOIMAGE_EXPORT vtkPNGWriter : public vtkImageWriter
145{
146public:
147 static vtkPNGWriter* New();
149 void PrintSelf(ostream& os, vtkIndent indent) override;
150
154 void Write() override;
155
157
164 vtkSetClampMacro(CompressionLevel, int, 0, 9);
165 vtkGetMacro(CompressionLevel, int);
167
169
172 vtkSetMacro(WriteToMemory, vtkTypeUBool);
173 vtkGetMacro(WriteToMemory, vtkTypeUBool);
174 vtkBooleanMacro(WriteToMemory, vtkTypeUBool);
176
178
183 vtkGetObjectMacro(Result, vtkUnsignedCharArray);
185
193 void AddText(const char* key, const char* value);
194
198 void ClearText();
199
201
204 static const char* TITLE;
205 static const char* AUTHOR;
206 static const char* DESCRIPTION;
207 static const char* COPYRIGHT;
208 static const char* CREATION_TIME;
209 static const char* SOFTWARE;
210 static const char* DISCLAIMER;
211 static const char* WARNING;
212 static const char* SOURCE;
213 static const char* COMMENT;
215
216protected:
218 ~vtkPNGWriter() override;
219
220 void WriteSlice(vtkImageData* data, int* uExtent);
223 FILE* TempFP;
224 class vtkInternals;
225 vtkInternals* Internals;
226
227private:
228 vtkPNGWriter(const vtkPNGWriter&) = delete;
229 void operator=(const vtkPNGWriter&) = delete;
230};
231
232#endif
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
Writes images to files.
a simple class to control print indentation
Definition: vtkIndent.h:113
Writes PNG files.
Definition: vtkPNGWriter.h:145
static const char * CREATION_TIME
Standard keys.
Definition: vtkPNGWriter.h:208
vtkUnsignedCharArray * Result
Definition: vtkPNGWriter.h:222
static const char * WARNING
Standard keys.
Definition: vtkPNGWriter.h:211
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:210
static const char * COPYRIGHT
Standard keys.
Definition: vtkPNGWriter.h:207
void Write() override
The main interface which triggers the writer to start.
static const char * COMMENT
Standard keys.
Definition: vtkPNGWriter.h:213
vtkInternals * Internals
Definition: vtkPNGWriter.h:225
void ClearText()
Clear out any key/value pairs added through the AddText() member function.
static const char * SOURCE
Standard keys.
Definition: vtkPNGWriter.h:212
static const char * SOFTWARE
Standard keys.
Definition: vtkPNGWriter.h:209
static const char * TITLE
Standard keys.
Definition: vtkPNGWriter.h:204
static const char * AUTHOR
Standard keys.
Definition: vtkPNGWriter.h:205
int CompressionLevel
Definition: vtkPNGWriter.h:221
~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:206
dynamic, self-adjusting array of unsigned char
unsigned int vtkTypeUBool
Definition: vtkABI.h:70