VTK  9.5.20251113
vtkPNGReader.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
131#ifndef vtkPNGReader_h
132#define vtkPNGReader_h
133
134#include "vtkIOImageModule.h" // For export macro
135#include "vtkImageReader2.h"
136#include "vtkSmartPointer.h" // For vtkSmartPointer
137
138VTK_ABI_NAMESPACE_BEGIN
139class vtkStringArray;
140VTK_ABI_NAMESPACE_END
141
142VTK_ABI_NAMESPACE_BEGIN
143class VTKIOIMAGE_EXPORT vtkPNGReader : public vtkImageReader2
144{
145public:
146 static vtkPNGReader* New();
148 void PrintSelf(ostream& os, vtkIndent indent) override;
149
153 int CanReadFile(VTK_FILEPATH const char* fname) override;
154
160 const char* GetFileExtensions() override { return ".png"; }
161
165 const char* GetDescriptiveName() override { return "PNG"; }
166
172 void GetTextChunks(const char* key, int beginEndIndex[2]);
173
175
178 const char* GetTextKey(int index);
181
183
188 const char* GetTextValue(int index);
191
197
199
204 vtkSetMacro(ReadSpacingFromFile, bool);
205 vtkGetMacro(ReadSpacingFromFile, bool);
206 vtkBooleanMacro(ReadSpacingFromFile, bool);
208protected:
210 ~vtkPNGReader() override;
211
212 void ExecuteInformation() override;
214 template <class OT>
215 void vtkPNGReaderUpdate(vtkImageData* data, OT* outPtr);
216 template <class OT>
217 void vtkPNGReaderUpdate2(OT* outPtr, int* outExt, vtkIdType* outInc, long pixSize);
218
219private:
220 vtkPNGReader(const vtkPNGReader&) = delete;
221 void operator=(const vtkPNGReader&) = delete;
222
223 class vtkInternals;
224 vtkInternals* Internals;
225 bool ReadSpacingFromFile;
226};
227VTK_ABI_NAMESPACE_END
228#endif
general representation of visualization data
topologically and geometrically regular array of data
Superclass of binary file readers.
a simple class to control print indentation
Definition vtkIndent.h:108
Store vtkAlgorithm input/output information.
read PNG files
const char * GetTextValue(int index)
Returns the text value stored at 'index'.
void ExecuteInformation() override
size_t GetNumberOfTextChunks()
Return the number of text chunks in the PNG file.
const char * GetDescriptiveName() override
Return a descriptive name for the file format that might be useful in a GUI.
vtkStringArray * GetTextValues()
Returns the text value stored at 'index'.
void vtkPNGReaderUpdate(vtkImageData *data, OT *outPtr)
void ExecuteDataWithInformation(vtkDataObject *out, vtkInformation *outInfo) override
This is a convenience method that is implemented in many subclasses instead of RequestData.
static vtkPNGReader * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int CanReadFile(const char *fname) override
Is the given file a PNG file?
void vtkPNGReaderUpdate2(OT *outPtr, int *outExt, vtkIdType *outInc, long pixSize)
const char * GetTextKey(int index)
Returns the text key stored at 'index'.
void GetTextChunks(const char *key, int beginEndIndex[2])
Given a 'key' for the text chunks, fills in 'beginEndIndex' with the begin and end indexes.
const char * GetFileExtensions() override
Get the file extensions for this format.
~vtkPNGReader() override
vtkStringArray * GetTextKeys()
Returns the text key stored at 'index'.
a vtkAbstractArray subclass for strings
Set of utilities for OpenTURNS<->VTK conversions.
Definition vtkOTFilter.h:21
int vtkIdType
Definition vtkType.h:367
#define VTK_FILEPATH