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 =========================================================================*/
32 #ifndef vtkPNGWriter_h
33 #define vtkPNGWriter_h
34 
35 #include "vtkIOImageModule.h" // For export macro
36 #include "vtkImageWriter.h"
37 
38 class vtkImageData;
40 
41 class VTKIOIMAGE_EXPORT vtkPNGWriter : public vtkImageWriter
42 {
43 public:
44  static vtkPNGWriter* New();
45  vtkTypeMacro(vtkPNGWriter, vtkImageWriter);
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
51  void Write() override;
52 
54 
61  vtkSetClampMacro(CompressionLevel, int, 0, 9);
62  vtkGetMacro(CompressionLevel, int);
64 
66 
69  vtkSetMacro(WriteToMemory, vtkTypeUBool);
70  vtkGetMacro(WriteToMemory, vtkTypeUBool);
71  vtkBooleanMacro(WriteToMemory, vtkTypeUBool);
73 
75 
79  virtual void SetResult(vtkUnsignedCharArray*);
80  vtkGetObjectMacro(Result, vtkUnsignedCharArray);
82 
90  void AddText(const char* key, const char* value);
91 
95  void ClearText();
96 
98 
101  static const char* TITLE;
102  static const char* AUTHOR;
103  static const char* DESCRIPTION;
104  static const char* COPYRIGHT;
105  static const char* CREATION_TIME;
106  static const char* SOFTWARE;
107  static const char* DISCLAIMER;
108  static const char* WARNING;
109  static const char* SOURCE;
110  static const char* COMMENT;
112 
113 protected:
114  vtkPNGWriter();
115  ~vtkPNGWriter() override;
116 
117  void WriteSlice(vtkImageData* data, int* uExtent);
120  FILE* TempFP;
121  class vtkInternals;
122  vtkInternals* Internals;
123 
124 private:
125  vtkPNGWriter(const vtkPNGWriter&) = delete;
126  void operator=(const vtkPNGWriter&) = delete;
127 };
128 
129 #endif
static const char * DISCLAIMER
Standard keys.
Definition: vtkPNGWriter.h:107
vtkInternals * Internals
Definition: vtkPNGWriter.h:121
static const char * COMMENT
Standard keys.
Definition: vtkPNGWriter.h:110
Writes PNG files.
Definition: vtkPNGWriter.h:41
static const char * WARNING
Standard keys.
Definition: vtkPNGWriter.h:108
static const char * COPYRIGHT
Standard keys.
Definition: vtkPNGWriter.h:104
static const char * DESCRIPTION
Standard keys.
Definition: vtkPNGWriter.h:103
static const char * TITLE
Standard keys.
Definition: vtkPNGWriter.h:101
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:39
vtkUnsignedCharArray * Result
Definition: vtkPNGWriter.h:119
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
static const char * AUTHOR
Standard keys.
Definition: vtkPNGWriter.h:102
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:105
static const char * SOURCE
Standard keys.
Definition: vtkPNGWriter.h:109
int CompressionLevel
Definition: vtkPNGWriter.h:118
static const char * SOFTWARE
Standard keys.
Definition: vtkPNGWriter.h:106