VTK  9.3.20240424
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
129#ifndef vtkPNGReader_h
130#define vtkPNGReader_h
131
132#include "vtkIOImageModule.h" // For export macro
133#include "vtkImageReader2.h"
134#include "vtkSmartPointer.h" // For vtkSmartPointer
135
136VTK_ABI_NAMESPACE_BEGIN
137class vtkStringArray;
138VTK_ABI_NAMESPACE_END
139
140VTK_ABI_NAMESPACE_BEGIN
141class VTKIOIMAGE_EXPORT vtkPNGReader : public vtkImageReader2
142{
143public:
144 static vtkPNGReader* New();
146 void PrintSelf(ostream& os, vtkIndent indent) override;
147
151 int CanReadFile(VTK_FILEPATH const char* fname) override;
152
158 const char* GetFileExtensions() override { return ".png"; }
159
163 const char* GetDescriptiveName() override { return "PNG"; }
164
170 void GetTextChunks(const char* key, int beginEndIndex[2]);
171
173
176 const char* GetTextKey(int index);
179
181
186 const char* GetTextValue(int index);
189
195
197
202 vtkSetMacro(ReadSpacingFromFile, bool);
203 vtkGetMacro(ReadSpacingFromFile, bool);
204 vtkBooleanMacro(ReadSpacingFromFile, bool);
206protected:
208 ~vtkPNGReader() override;
209
210 void ExecuteInformation() override;
212 template <class OT>
213 void vtkPNGReaderUpdate(vtkImageData* data, OT* outPtr);
214 template <class OT>
215 void vtkPNGReaderUpdate2(OT* outPtr, int* outExt, vtkIdType* outInc, long pixSize);
216
217private:
218 vtkPNGReader(const vtkPNGReader&) = delete;
219 void operator=(const vtkPNGReader&) = delete;
220
221 class vtkInternals;
222 vtkInternals* Internals;
223 bool ReadSpacingFromFile;
224};
225VTK_ABI_NAMESPACE_END
226#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.
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'.
int CanReadFile(VTK_FILEPATH const char *fname) override
Is the given file a PNG file?
a vtkAbstractArray subclass for strings
Set of utilities for OpenTURNS<->VTK conversions.
Definition vtkOTFilter.h:21
int vtkIdType
Definition vtkType.h:315
#define VTK_FILEPATH