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 
36 VTK_ABI_NAMESPACE_BEGIN
37 class vtkStringArray;
38 VTK_ABI_NAMESPACE_END
39 
40 VTK_ABI_NAMESPACE_BEGIN
41 class VTKIOIMAGE_EXPORT vtkPNGReader : public vtkImageReader2
42 {
43 public:
44  static vtkPNGReader* New();
45  vtkTypeMacro(vtkPNGReader, vtkImageReader2);
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);
106 protected:
108  ~vtkPNGReader() override;
109 
110  void ExecuteInformation() override;
112  template <class OT>
114  template <class OT>
115  void vtkPNGReaderUpdate2(OT* outPtr, int* outExt, vtkIdType* outInc, long pixSize);
116 
117 private:
118  vtkPNGReader(const vtkPNGReader&) = delete;
119  void operator=(const vtkPNGReader&) = delete;
120 
121  class vtkInternals;
122  vtkInternals* Internals;
123  bool ReadSpacingFromFile;
124 };
125 VTK_ABI_NAMESPACE_END
126 #endif
general representation of visualization data
Definition: vtkDataObject.h:64
topologically and geometrically regular array of data
Definition: vtkImageData.h:52
Superclass of binary file readers.
a simple class to control print indentation
Definition: vtkIndent.h:38
Store vtkAlgorithm input/output information.
read PNG files
Definition: vtkPNGReader.h:42
const char * GetDescriptiveName() override
Return a descriptive name for the file format that might be useful in a GUI.
Definition: vtkPNGReader.h:63
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:58
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