VTK  9.1.0
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=========================================================================*/
35#ifndef vtkPNGWriter_h
36#define vtkPNGWriter_h
37
38#include "vtkIOImageModule.h" // For export macro
39#include "vtkImageWriter.h"
40
41class vtkImageData;
43
44class VTKIOIMAGE_EXPORT vtkPNGWriter : public vtkImageWriter
45{
46public:
47 static vtkPNGWriter* New();
49 void PrintSelf(ostream& os, vtkIndent indent) override;
50
54 void Write() override;
55
57
64 vtkSetClampMacro(CompressionLevel, int, 0, 9);
65 vtkGetMacro(CompressionLevel, int);
67
69
72 vtkSetMacro(WriteToMemory, vtkTypeUBool);
73 vtkGetMacro(WriteToMemory, vtkTypeUBool);
74 vtkBooleanMacro(WriteToMemory, vtkTypeUBool);
76
78
83 vtkGetObjectMacro(Result, vtkUnsignedCharArray);
85
93 void AddText(const char* key, const char* value);
94
98 void ClearText();
99
101
104 static const char* TITLE;
105 static const char* AUTHOR;
106 static const char* DESCRIPTION;
107 static const char* COPYRIGHT;
108 static const char* CREATION_TIME;
109 static const char* SOFTWARE;
110 static const char* DISCLAIMER;
111 static const char* WARNING;
112 static const char* SOURCE;
113 static const char* COMMENT;
115
116protected:
118 ~vtkPNGWriter() override;
119
120 void WriteSlice(vtkImageData* data, int* uExtent);
123 FILE* TempFP;
124 class vtkInternals;
125 vtkInternals* Internals;
126
127private:
128 vtkPNGWriter(const vtkPNGWriter&) = delete;
129 void operator=(const vtkPNGWriter&) = delete;
130};
131
132#endif
topologically and geometrically regular array of data
Definition: vtkImageData.h:57
Writes images to files.
a simple class to control print indentation
Definition: vtkIndent.h:43
Writes PNG files.
Definition: vtkPNGWriter.h:45
static const char * CREATION_TIME
Standard keys.
Definition: vtkPNGWriter.h:108
vtkUnsignedCharArray * Result
Definition: vtkPNGWriter.h:122
static const char * WARNING
Standard keys.
Definition: vtkPNGWriter.h:111
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:110
static const char * COPYRIGHT
Standard keys.
Definition: vtkPNGWriter.h:107
void Write() override
The main interface which triggers the writer to start.
static const char * COMMENT
Standard keys.
Definition: vtkPNGWriter.h:113
vtkInternals * Internals
Definition: vtkPNGWriter.h:125
void ClearText()
Clear out any key/value pairs added through the AddText() member function.
static const char * SOURCE
Standard keys.
Definition: vtkPNGWriter.h:112
static const char * SOFTWARE
Standard keys.
Definition: vtkPNGWriter.h:109
static const char * TITLE
Standard keys.
Definition: vtkPNGWriter.h:104
static const char * AUTHOR
Standard keys.
Definition: vtkPNGWriter.h:105
int CompressionLevel
Definition: vtkPNGWriter.h:121
~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:106
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