VTK  9.3.1
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
20 #ifndef vtkPNGWriter_h
21 #define vtkPNGWriter_h
22 
23 #include "vtkIOImageModule.h" // For export macro
24 #include "vtkImageWriter.h"
25 
26 VTK_ABI_NAMESPACE_BEGIN
27 class vtkImageData;
29 
30 class VTKIOIMAGE_EXPORT vtkPNGWriter : public vtkImageWriter
31 {
32 public:
33  static vtkPNGWriter* New();
34  vtkTypeMacro(vtkPNGWriter, vtkImageWriter);
35  void PrintSelf(ostream& os, vtkIndent indent) override;
36 
40  void Write() override;
41 
43 
50  vtkSetClampMacro(CompressionLevel, int, 0, 9);
51  vtkGetMacro(CompressionLevel, int);
53 
55 
58  vtkSetMacro(WriteToMemory, vtkTypeUBool);
59  vtkGetMacro(WriteToMemory, vtkTypeUBool);
60  vtkBooleanMacro(WriteToMemory, vtkTypeUBool);
62 
64 
68  virtual void SetResult(vtkUnsignedCharArray*);
69  vtkGetObjectMacro(Result, vtkUnsignedCharArray);
71 
79  void AddText(const char* key, const char* value);
80 
84  void ClearText();
85 
87 
90  static const char* TITLE;
91  static const char* AUTHOR;
92  static const char* DESCRIPTION;
93  static const char* COPYRIGHT;
94  static const char* CREATION_TIME;
95  static const char* SOFTWARE;
96  static const char* DISCLAIMER;
97  static const char* WARNING;
98  static const char* SOURCE;
99  static const char* COMMENT;
101 
102 protected:
103  vtkPNGWriter();
104  ~vtkPNGWriter() override;
105 
106  void WriteSlice(vtkImageData* data, int* uExtent);
109  FILE* TempFP;
110  class vtkInternals;
111  vtkInternals* Internals;
112 
113 private:
114  vtkPNGWriter(const vtkPNGWriter&) = delete;
115  void operator=(const vtkPNGWriter&) = delete;
116 };
117 
118 VTK_ABI_NAMESPACE_END
119 #endif
static const char * DISCLAIMER
Standard keys.
Definition: vtkPNGWriter.h:96
vtkInternals * Internals
Definition: vtkPNGWriter.h:110
static const char * COMMENT
Standard keys.
Definition: vtkPNGWriter.h:99
Writes PNG files.
Definition: vtkPNGWriter.h:30
static const char * WARNING
Standard keys.
Definition: vtkPNGWriter.h:97
static const char * COPYRIGHT
Standard keys.
Definition: vtkPNGWriter.h:93
static const char * DESCRIPTION
Standard keys.
Definition: vtkPNGWriter.h:92
static const char * TITLE
Standard keys.
Definition: vtkPNGWriter.h:90
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:28
vtkUnsignedCharArray * Result
Definition: vtkPNGWriter.h:108
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
static const char * AUTHOR
Standard keys.
Definition: vtkPNGWriter.h:91
virtual void Write()
The main interface which triggers the writer to start.
unsigned int vtkTypeUBool
Definition: vtkABI.h:65
Writes images to files.
static vtkImageWriter * New()
dynamic, self-adjusting array of unsigned char
static const char * CREATION_TIME
Standard keys.
Definition: vtkPNGWriter.h:94
static const char * SOURCE
Standard keys.
Definition: vtkPNGWriter.h:98
int CompressionLevel
Definition: vtkPNGWriter.h:107
static const char * SOFTWARE
Standard keys.
Definition: vtkPNGWriter.h:95