VTK  9.3.0
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
26VTK_ABI_NAMESPACE_BEGIN
27class vtkImageData;
29
30class VTKIOIMAGE_EXPORT vtkPNGWriter : public vtkImageWriter
31{
32public:
33 static vtkPNGWriter* New();
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
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
102protected:
104 ~vtkPNGWriter() override;
105
106 void WriteSlice(vtkImageData* data, int* uExtent);
109 FILE* TempFP;
110 class vtkInternals;
111 vtkInternals* Internals;
112
113private:
114 vtkPNGWriter(const vtkPNGWriter&) = delete;
115 void operator=(const vtkPNGWriter&) = delete;
116};
117
118VTK_ABI_NAMESPACE_END
119#endif
topologically and geometrically regular array of data
Writes images to files.
a simple class to control print indentation
Definition vtkIndent.h:29
Writes PNG files.
static const char * CREATION_TIME
Standard keys.
vtkUnsignedCharArray * Result
static const char * WARNING
Standard keys.
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.
static const char * COPYRIGHT
Standard keys.
void Write() override
The main interface which triggers the writer to start.
static const char * COMMENT
Standard keys.
vtkInternals * Internals
void ClearText()
Clear out any key/value pairs added through the AddText() member function.
static const char * SOURCE
Standard keys.
static const char * SOFTWARE
Standard keys.
static const char * TITLE
Standard keys.
static const char * AUTHOR
Standard keys.
~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.
dynamic, self-adjusting array of unsigned char
unsigned int vtkTypeUBool
Definition vtkABI.h:65