VTK  9.0.1
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 =========================================================================*/
26 #ifndef vtkPNGWriter_h
27 #define vtkPNGWriter_h
28 
29 #include "vtkIOImageModule.h" // For export macro
30 #include "vtkImageWriter.h"
31 
32 class vtkImageData;
34 
35 class VTKIOIMAGE_EXPORT vtkPNGWriter : public vtkImageWriter
36 {
37 public:
38  static vtkPNGWriter* New();
39  vtkTypeMacro(vtkPNGWriter, vtkImageWriter);
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
45  void Write() override;
46 
48 
55  vtkSetClampMacro(CompressionLevel, int, 0, 9);
56  vtkGetMacro(CompressionLevel, int);
58 
60 
63  vtkSetMacro(WriteToMemory, vtkTypeUBool);
64  vtkGetMacro(WriteToMemory, vtkTypeUBool);
65  vtkBooleanMacro(WriteToMemory, vtkTypeUBool);
67 
69 
73  virtual void SetResult(vtkUnsignedCharArray*);
74  vtkGetObjectMacro(Result, vtkUnsignedCharArray);
76 
84  void AddText(const char* key, const char* value);
86 
89  static const char* TITLE;
90  static const char* AUTHOR;
91  static const char* DESCRIPTION;
92  static const char* COPYRIGHT;
93  static const char* CREATION_TIME;
94  static const char* SOFTWARE;
95  static const char* DISCLAIMER;
96  static const char* WARNING;
97  static const char* SOURCE;
98  static const char* COMMENT;
100 
101 protected:
102  vtkPNGWriter();
103  ~vtkPNGWriter() override;
104 
105  void WriteSlice(vtkImageData* data, int* uExtent);
108  FILE* TempFP;
109  class vtkInternals;
110  vtkInternals* Internals;
111 
112 private:
113  vtkPNGWriter(const vtkPNGWriter&) = delete;
114  void operator=(const vtkPNGWriter&) = delete;
115 };
116 
117 #endif
static const char * DISCLAIMER
Standard keys.
Definition: vtkPNGWriter.h:95
vtkInternals * Internals
Definition: vtkPNGWriter.h:109
static const char * COMMENT
Standard keys.
Definition: vtkPNGWriter.h:98
Writes PNG files.
Definition: vtkPNGWriter.h:35
static const char * WARNING
Standard keys.
Definition: vtkPNGWriter.h:96
static const char * COPYRIGHT
Standard keys.
Definition: vtkPNGWriter.h:92
static const char * DESCRIPTION
Standard keys.
Definition: vtkPNGWriter.h:91
static const char * TITLE
Standard keys.
Definition: vtkPNGWriter.h:89
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkUnsignedCharArray * Result
Definition: vtkPNGWriter.h:107
topologically and geometrically regular array of data
Definition: vtkImageData.h:41
static const char * AUTHOR
Standard keys.
Definition: vtkPNGWriter.h:90
virtual void Write()
The main interface which triggers the writer to start.
unsigned int vtkTypeUBool
Definition: vtkABI.h:70
Writes images to files.
static vtkImageWriter * New()
dynamic, self-adjusting array of unsigned char
static const char * CREATION_TIME
Standard keys.
Definition: vtkPNGWriter.h:93
static const char * SOURCE
Standard keys.
Definition: vtkPNGWriter.h:97
int CompressionLevel
Definition: vtkPNGWriter.h:106
static const char * SOFTWARE
Standard keys.
Definition: vtkPNGWriter.h:94