VTK  9.6.1
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
21
22#ifndef vtkPNGReader_h
23#define vtkPNGReader_h
24
25#include "vtkIOImageModule.h" // For export macro
26#include "vtkImageReader2.h"
27#include "vtkSmartPointer.h" // For vtkSmartPointer
28
29VTK_ABI_NAMESPACE_BEGIN
30class vtkStringArray;
31VTK_ABI_NAMESPACE_END
32
33VTK_ABI_NAMESPACE_BEGIN
34class VTKIOIMAGE_EXPORT vtkPNGReader : public vtkImageReader2
35{
36public:
37 static vtkPNGReader* New();
39 void PrintSelf(ostream& os, vtkIndent indent) override;
40
44 int CanReadFile(VTK_FILEPATH const char* fname) override;
45
51 const char* GetFileExtensions() override { return ".png"; }
52
56 const char* GetDescriptiveName() override { return "PNG"; }
57
63 void GetTextChunks(const char* key, int beginEndIndex[2]);
64
66
69 const char* GetTextKey(int index);
72
74
79 const char* GetTextValue(int index);
82
88
90
95 vtkSetMacro(ReadSpacingFromFile, bool);
96 vtkGetMacro(ReadSpacingFromFile, bool);
97 vtkBooleanMacro(ReadSpacingFromFile, bool);
99protected:
101 ~vtkPNGReader() override;
102
103 void ExecuteInformation() override;
105 template <class OT>
106 void vtkPNGReaderUpdate(vtkImageData* data, OT* outPtr);
107 template <class OT>
108 void vtkPNGReaderUpdate2(OT* outPtr, int* outExt, vtkIdType* outInc, long pixSize);
109
110private:
111 vtkPNGReader(const vtkPNGReader&) = delete;
112 void operator=(const vtkPNGReader&) = delete;
113
114 class vtkInternals;
115 vtkInternals* Internals;
116 bool ReadSpacingFromFile;
117};
118VTK_ABI_NAMESPACE_END
119#endif
general representation of visualization data
topologically and geometrically regular array of data
vtkImageReader2()
Return a descriptive name for the file format that might be useful in a GUI.
a simple class to control print indentation
Definition vtkIndent.h:29
Store vtkAlgorithm input/output information.
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:368
#define VTK_FILEPATH