VTK  9.2.6
vtkPNGReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPNGReader.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
32 #ifndef vtkPNGReader_h
33 #define vtkPNGReader_h
34 
35 #include "vtkIOImageModule.h" // For export macro
36 #include "vtkImageReader2.h"
37 
38 class VTKIOIMAGE_EXPORT vtkPNGReader : public vtkImageReader2
39 {
40 public:
41  static vtkPNGReader* New();
42  vtkTypeMacro(vtkPNGReader, vtkImageReader2);
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
48  int CanReadFile(VTK_FILEPATH const char* fname) override;
49 
55  const char* GetFileExtensions() override { return ".png"; }
56 
60  const char* GetDescriptiveName() override { return "PNG"; }
61 
67  void GetTextChunks(const char* key, int beginEndIndex[2]);
71  const char* GetTextKey(int index);
77  const char* GetTextValue(int index);
82  size_t GetNumberOfTextChunks();
83 
85 
90  vtkSetMacro(ReadSpacingFromFile, bool);
91  vtkGetMacro(ReadSpacingFromFile, bool);
92  vtkBooleanMacro(ReadSpacingFromFile, bool);
94 protected:
95  vtkPNGReader();
96  ~vtkPNGReader() override;
97 
98  void ExecuteInformation() override;
99  void ExecuteDataWithInformation(vtkDataObject* out, vtkInformation* outInfo) override;
100  template <class OT>
101  void vtkPNGReaderUpdate(vtkImageData* data, OT* outPtr);
102  template <class OT>
103  void vtkPNGReaderUpdate2(OT* outPtr, int* outExt, vtkIdType* outInc, long pixSize);
104 
105 private:
106  vtkPNGReader(const vtkPNGReader&) = delete;
107  void operator=(const vtkPNGReader&) = delete;
108 
109  class vtkInternals;
110  vtkInternals* Internals;
111  bool ReadSpacingFromFile;
112 };
113 #endif
static vtkImageReader2 * New()
Store vtkAlgorithm input/output information.
virtual int CanReadFile(VTK_FILEPATH const char *vtkNotUsed(fname))
Return non zero if the reader can read the given file name.
int vtkIdType
Definition: vtkType.h:332
const char * GetFileExtensions() override
Get the file extensions for this format.
Definition: vtkPNGReader.h:55
void ExecuteDataWithInformation(vtkDataObject *data, vtkInformation *outInfo) override
This is a convenience method that is implemented in many subclasses instead of RequestData.
a simple class to control print indentation
Definition: vtkIndent.h:39
read PNG files
Definition: vtkPNGReader.h:38
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
virtual void ExecuteInformation()
const char * GetDescriptiveName() override
Return a descriptive name for the file format that might be useful in a GUI.
Definition: vtkPNGReader.h:60
Superclass of binary file readers.
#define VTK_FILEPATH
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
general representation of visualization data
Definition: vtkDataObject.h:65
Set of utilities for OpenTURNS<->VTK conversions.
Definition: vtkOTFilter.h:32