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=========================================================================*/
26#ifndef vtkPNGWriter_h
27#define vtkPNGWriter_h
28
29#include "vtkIOImageModule.h" // For export macro
30#include "vtkImageWriter.h"
31
32class vtkImageData;
34
35class VTKIOIMAGE_EXPORT vtkPNGWriter : public vtkImageWriter
36{
37public:
38 static vtkPNGWriter* New();
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
74 vtkGetObjectMacro(Result, vtkUnsignedCharArray);
76
84 void AddText(const char* key, const char* value);
85
89 void ClearText();
90
92
95 static const char* TITLE;
96 static const char* AUTHOR;
97 static const char* DESCRIPTION;
98 static const char* COPYRIGHT;
99 static const char* CREATION_TIME;
100 static const char* SOFTWARE;
101 static const char* DISCLAIMER;
102 static const char* WARNING;
103 static const char* SOURCE;
104 static const char* COMMENT;
106
107protected:
109 ~vtkPNGWriter() override;
110
111 void WriteSlice(vtkImageData* data, int* uExtent);
114 FILE* TempFP;
115 class vtkInternals;
116 vtkInternals* Internals;
117
118private:
119 vtkPNGWriter(const vtkPNGWriter&) = delete;
120 void operator=(const vtkPNGWriter&) = delete;
121};
122
123#endif
topologically and geometrically regular array of data
Definition: vtkImageData.h:48
Writes images to files.
a simple class to control print indentation
Definition: vtkIndent.h:34
Writes PNG files.
Definition: vtkPNGWriter.h:36
static const char * CREATION_TIME
Standard keys.
Definition: vtkPNGWriter.h:99
vtkUnsignedCharArray * Result
Definition: vtkPNGWriter.h:113
static const char * WARNING
Standard keys.
Definition: vtkPNGWriter.h:102
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:101
static const char * COPYRIGHT
Standard keys.
Definition: vtkPNGWriter.h:98
void Write() override
The main interface which triggers the writer to start.
static const char * COMMENT
Standard keys.
Definition: vtkPNGWriter.h:104
vtkInternals * Internals
Definition: vtkPNGWriter.h:116
void ClearText()
Clear out any key/value pairs added through the AddText() member function.
static const char * SOURCE
Standard keys.
Definition: vtkPNGWriter.h:103
static const char * SOFTWARE
Standard keys.
Definition: vtkPNGWriter.h:100
static const char * TITLE
Standard keys.
Definition: vtkPNGWriter.h:95
static const char * AUTHOR
Standard keys.
Definition: vtkPNGWriter.h:96
int CompressionLevel
Definition: vtkPNGWriter.h:112
~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:97
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