VTK
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 =========================================================================*/
26 #ifndef vtkPNGReader_h
27 #define vtkPNGReader_h
28 
29 #include "vtkIOImageModule.h" // For export macro
30 #include "vtkImageReader2.h"
31 
32 class VTKIOIMAGE_EXPORT vtkPNGReader : public vtkImageReader2
33 {
34 public:
35  static vtkPNGReader *New();
37  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
38 
42  int CanReadFile(const char* fname) VTK_OVERRIDE;
43 
49  const char* GetFileExtensions() VTK_OVERRIDE
50  {
51  return ".png";
52  }
53 
57  const char* GetDescriptiveName() VTK_OVERRIDE
58  {
59  return "PNG";
60  }
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() VTK_OVERRIDE;
97 
98  void ExecuteInformation() VTK_OVERRIDE;
99  void ExecuteDataWithInformation(vtkDataObject *out, vtkInformation *outInfo) VTK_OVERRIDE;
100  template <class OT>
101  void vtkPNGReaderUpdate(vtkImageData *data, OT *outPtr);
102  template <class OT>
103  void vtkPNGReaderUpdate2(
104  OT *outPtr, int *outExt, vtkIdType *outInc, long pixSize);
105 
106 
107 private:
108  vtkPNGReader(const vtkPNGReader&) VTK_DELETE_FUNCTION;
109  void operator=(const vtkPNGReader&) VTK_DELETE_FUNCTION;
110 
111  class vtkInternals;
112  vtkInternals* Internals;
113  bool ReadSpacingFromFile;
114 };
115 #endif
static vtkImageReader2 * New()
Store vtkAlgorithm input/output information.
int vtkIdType
Definition: vtkType.h:345
const char * GetFileExtensions() override
Get the file extensions for this format.
Definition: vtkPNGReader.h:49
virtual int CanReadFile(const char *vtkNotUsed(fname))
Return non zero if the reader can read the given file name.
a simple class to control print indentation
Definition: vtkIndent.h:33
read PNG files
Definition: vtkPNGReader.h:32
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
const char * GetDescriptiveName() override
Return a descriptive name for the file format that might be useful in a GUI.
Definition: vtkPNGReader.h:57
Superclass of binary file readers.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
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:58