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 =========================================================================*/
41 #ifndef vtkPNGWriter_h
42 #define vtkPNGWriter_h
43 
44 #include "vtkIOImageModule.h" // For export macro
45 #include "vtkImageWriter.h"
46 
47 class vtkImageData;
49 
50 class VTKIOIMAGE_EXPORT vtkPNGWriter : public vtkImageWriter
51 {
52 public:
53  static vtkPNGWriter* New();
54  vtkTypeMacro(vtkPNGWriter, vtkImageWriter);
55  void PrintSelf(ostream& os, vtkIndent indent) override;
56 
60  void Write() override;
61 
63 
70  vtkSetClampMacro(CompressionLevel, int, 0, 9);
71  vtkGetMacro(CompressionLevel, int);
73 
75 
78  vtkSetMacro(WriteToMemory, vtkTypeUBool);
79  vtkGetMacro(WriteToMemory, vtkTypeUBool);
80  vtkBooleanMacro(WriteToMemory, vtkTypeUBool);
82 
84 
89  vtkGetObjectMacro(Result, vtkUnsignedCharArray);
91 
99  void AddText(const char* key, const char* value);
100 
104  void ClearText();
105 
107 
110  static const char* TITLE;
111  static const char* AUTHOR;
112  static const char* DESCRIPTION;
113  static const char* COPYRIGHT;
114  static const char* CREATION_TIME;
115  static const char* SOFTWARE;
116  static const char* DISCLAIMER;
117  static const char* WARNING;
118  static const char* SOURCE;
119  static const char* COMMENT;
121 
122 protected:
124  ~vtkPNGWriter() override;
125 
126  void WriteSlice(vtkImageData* data, int* uExtent);
129  FILE* TempFP;
130  class vtkInternals;
131  vtkInternals* Internals;
132 
133 private:
134  vtkPNGWriter(const vtkPNGWriter&) = delete;
135  void operator=(const vtkPNGWriter&) = delete;
136 };
137 
138 #endif
topologically and geometrically regular array of data
Definition: vtkImageData.h:63
Writes images to files.
a simple class to control print indentation
Definition: vtkIndent.h:49
Writes PNG files.
Definition: vtkPNGWriter.h:51
static const char * CREATION_TIME
Standard keys.
Definition: vtkPNGWriter.h:114
vtkUnsignedCharArray * Result
Definition: vtkPNGWriter.h:128
static const char * WARNING
Standard keys.
Definition: vtkPNGWriter.h:117
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:116
static const char * COPYRIGHT
Standard keys.
Definition: vtkPNGWriter.h:113
void Write() override
The main interface which triggers the writer to start.
static const char * COMMENT
Standard keys.
Definition: vtkPNGWriter.h:119
vtkInternals * Internals
Definition: vtkPNGWriter.h:130
void ClearText()
Clear out any key/value pairs added through the AddText() member function.
static const char * SOURCE
Standard keys.
Definition: vtkPNGWriter.h:118
static const char * SOFTWARE
Standard keys.
Definition: vtkPNGWriter.h:115
static const char * TITLE
Standard keys.
Definition: vtkPNGWriter.h:110
static const char * AUTHOR
Standard keys.
Definition: vtkPNGWriter.h:111
int CompressionLevel
Definition: vtkPNGWriter.h:127
~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:112
dynamic, self-adjusting array of unsigned char
@ key
Definition: vtkX3D.h:263
@ value
Definition: vtkX3D.h:226
@ data
Definition: vtkX3D.h:321
unsigned int vtkTypeUBool
Definition: vtkABI.h:70