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
20 #ifndef vtkPNGReader_h
21 #define vtkPNGReader_h
22 
23 #include "vtkIOImageModule.h" // For export macro
24 #include "vtkImageReader2.h"
25 #include "vtkSmartPointer.h" // For vtkSmartPointer
26 
27 VTK_ABI_NAMESPACE_BEGIN
28 class vtkStringArray;
29 VTK_ABI_NAMESPACE_END
30 
31 VTK_ABI_NAMESPACE_BEGIN
32 class VTKIOIMAGE_EXPORT vtkPNGReader : public vtkImageReader2
33 {
34 public:
35  static vtkPNGReader* New();
36  vtkTypeMacro(vtkPNGReader, vtkImageReader2);
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
42  int CanReadFile(VTK_FILEPATH const char* fname) override;
43 
49  const char* GetFileExtensions() override { return ".png"; }
50 
54  const char* GetDescriptiveName() override { return "PNG"; }
55 
61  void GetTextChunks(const char* key, int beginEndIndex[2]);
62 
64 
67  const char* GetTextKey(int index);
70 
72 
77  const char* GetTextValue(int index);
80 
86 
88 
93  vtkSetMacro(ReadSpacingFromFile, bool);
94  vtkGetMacro(ReadSpacingFromFile, bool);
95  vtkBooleanMacro(ReadSpacingFromFile, bool);
97 protected:
99  ~vtkPNGReader() override;
100 
101  void ExecuteInformation() override;
103  template <class OT>
105  template <class OT>
106  void vtkPNGReaderUpdate2(OT* outPtr, int* outExt, vtkIdType* outInc, long pixSize);
107 
108 private:
109  vtkPNGReader(const vtkPNGReader&) = delete;
110  void operator=(const vtkPNGReader&) = delete;
111 
112  class vtkInternals;
113  vtkInternals* Internals;
114  bool ReadSpacingFromFile;
115 };
116 VTK_ABI_NAMESPACE_END
117 #endif
general representation of visualization data
Definition: vtkDataObject.h:55
topologically and geometrically regular array of data
Definition: vtkImageData.h:43
Superclass of binary file readers.
a simple class to control print indentation
Definition: vtkIndent.h:29
Store vtkAlgorithm input/output information.
read PNG files
Definition: vtkPNGReader.h:33
const char * GetDescriptiveName() override
Return a descriptive name for the file format that might be useful in a GUI.
Definition: vtkPNGReader.h:54
vtkStringArray * GetTextKeys()
Returns the text key stored at 'index'.
static vtkPNGReader * New()
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 * GetFileExtensions() override
Get the file extensions for this format.
Definition: vtkPNGReader.h:49
const char * GetTextKey(int index)
Returns the text key 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.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkStringArray * GetTextValues()
Returns the text value stored at 'index'.
void vtkPNGReaderUpdate2(OT *outPtr, int *outExt, vtkIdType *outInc, long pixSize)
void GetTextChunks(const char *key, int beginEndIndex[2])
Given a 'key' for the text chunks, fills in 'beginEndIndex' with the begin and end indexes.
~vtkPNGReader() override
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
@ key
Definition: vtkX3D.h:257
@ index
Definition: vtkX3D.h:246
@ data
Definition: vtkX3D.h:315
int vtkIdType
Definition: vtkType.h:315
#define VTK_FILEPATH