VTK  9.2.20230320
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 
147 VTK_ABI_NAMESPACE_BEGIN
148 class vtkImageData;
150 
151 class VTKIOIMAGE_EXPORT vtkPNGWriter : public vtkImageWriter
152 {
153 public:
154  static vtkPNGWriter* New();
155  vtkTypeMacro(vtkPNGWriter, vtkImageWriter);
156  void PrintSelf(ostream& os, vtkIndent indent) override;
157 
161  void Write() override;
162 
164 
171  vtkSetClampMacro(CompressionLevel, int, 0, 9);
172  vtkGetMacro(CompressionLevel, int);
174 
176 
179  vtkSetMacro(WriteToMemory, vtkTypeUBool);
180  vtkGetMacro(WriteToMemory, vtkTypeUBool);
181  vtkBooleanMacro(WriteToMemory, vtkTypeUBool);
183 
185 
190  vtkGetObjectMacro(Result, vtkUnsignedCharArray);
192 
200  void AddText(const char* key, const char* value);
201 
205  void ClearText();
206 
208 
211  static const char* TITLE;
212  static const char* AUTHOR;
213  static const char* DESCRIPTION;
214  static const char* COPYRIGHT;
215  static const char* CREATION_TIME;
216  static const char* SOFTWARE;
217  static const char* DISCLAIMER;
218  static const char* WARNING;
219  static const char* SOURCE;
220  static const char* COMMENT;
222 
223 protected:
225  ~vtkPNGWriter() override;
226 
227  void WriteSlice(vtkImageData* data, int* uExtent);
230  FILE* TempFP;
231  class vtkInternals;
232  vtkInternals* Internals;
233 
234 private:
235  vtkPNGWriter(const vtkPNGWriter&) = delete;
236  void operator=(const vtkPNGWriter&) = delete;
237 };
238 
239 VTK_ABI_NAMESPACE_END
240 #endif
topologically and geometrically regular array of data
Definition: vtkImageData.h:164
Writes images to files.
a simple class to control print indentation
Definition: vtkIndent.h:120
Writes PNG files.
Definition: vtkPNGWriter.h:152
static const char * CREATION_TIME
Standard keys.
Definition: vtkPNGWriter.h:215
vtkUnsignedCharArray * Result
Definition: vtkPNGWriter.h:229
static const char * WARNING
Standard keys.
Definition: vtkPNGWriter.h:218
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:217
static const char * COPYRIGHT
Standard keys.
Definition: vtkPNGWriter.h:214
void Write() override
The main interface which triggers the writer to start.
static const char * COMMENT
Standard keys.
Definition: vtkPNGWriter.h:220
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:219
static const char * SOFTWARE
Standard keys.
Definition: vtkPNGWriter.h:216
static const char * TITLE
Standard keys.
Definition: vtkPNGWriter.h:211
static const char * AUTHOR
Standard keys.
Definition: vtkPNGWriter.h:212
int CompressionLevel
Definition: vtkPNGWriter.h:228
~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:213
dynamic, self-adjusting array of unsigned char
@ key
Definition: vtkX3D.h:269
@ value
Definition: vtkX3D.h:232
@ data
Definition: vtkX3D.h:327
unsigned int vtkTypeUBool
Definition: vtkABI.h:72