VTK  9.3.0
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
29#ifndef vtkPNGReader_h
30#define vtkPNGReader_h
31
32#include "vtkIOImageModule.h" // For export macro
33#include "vtkImageReader2.h"
34#include "vtkSmartPointer.h" // For vtkSmartPointer
35
36VTK_ABI_NAMESPACE_BEGIN
37class vtkStringArray;
38VTK_ABI_NAMESPACE_END
39
40VTK_ABI_NAMESPACE_BEGIN
41class VTKIOIMAGE_EXPORT vtkPNGReader : public vtkImageReader2
42{
43public:
44 static vtkPNGReader* New();
46 void PrintSelf(ostream& os, vtkIndent indent) override;
47
51 int CanReadFile(VTK_FILEPATH const char* fname) override;
52
58 const char* GetFileExtensions() override { return ".png"; }
59
63 const char* GetDescriptiveName() override { return "PNG"; }
64
70 void GetTextChunks(const char* key, int beginEndIndex[2]);
71
73
76 const char* GetTextKey(int index);
79
81
86 const char* GetTextValue(int index);
89
95
97
102 vtkSetMacro(ReadSpacingFromFile, bool);
103 vtkGetMacro(ReadSpacingFromFile, bool);
104 vtkBooleanMacro(ReadSpacingFromFile, bool);
106protected:
108 ~vtkPNGReader() override;
109
110 void ExecuteInformation() override;
112 template <class OT>
113 void vtkPNGReaderUpdate(vtkImageData* data, OT* outPtr);
114 template <class OT>
115 void vtkPNGReaderUpdate2(OT* outPtr, int* outExt, vtkIdType* outInc, long pixSize);
116
117private:
118 vtkPNGReader(const vtkPNGReader&) = delete;
119 void operator=(const vtkPNGReader&) = delete;
120
121 class vtkInternals;
122 vtkInternals* Internals;
123 bool ReadSpacingFromFile;
124};
125VTK_ABI_NAMESPACE_END
126#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:38
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