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 =========================================================================*/
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();
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
48  int CanReadFile(const char* fname) override;
49 
55  const char* GetFileExtensions() override
56  {
57  return ".png";
58  }
59 
63  const char* GetDescriptiveName() override
64  {
65  return "PNG";
66  }
67 
73  void GetTextChunks(const char* key, int beginEndIndex[2]);
77  const char* GetTextKey(int index);
83  const char* GetTextValue(int index);
88  size_t GetNumberOfTextChunks();
89 
91 
96  vtkSetMacro(ReadSpacingFromFile, bool);
97  vtkGetMacro(ReadSpacingFromFile, bool);
98  vtkBooleanMacro(ReadSpacingFromFile, bool);
100 protected:
101  vtkPNGReader();
102  ~vtkPNGReader() override;
103 
104  void ExecuteInformation() override;
105  void ExecuteDataWithInformation(vtkDataObject *out, vtkInformation *outInfo) override;
106  template <class OT>
107  void vtkPNGReaderUpdate(vtkImageData *data, OT *outPtr);
108  template <class OT>
109  void vtkPNGReaderUpdate2(
110  OT *outPtr, int *outExt, vtkIdType *outInc, long pixSize);
111 
112 
113 private:
114  vtkPNGReader(const vtkPNGReader&) = delete;
115  void operator=(const vtkPNGReader&) = delete;
116 
117  class vtkInternals;
118  vtkInternals* Internals;
119  bool ReadSpacingFromFile;
120 };
121 #endif
vtkImageReader2::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageReader2::ExecuteDataWithInformation
void ExecuteDataWithInformation(vtkDataObject *data, vtkInformation *outInfo) override
This is a convenience method that is implemented in many subclasses instead of RequestData.
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkX3D::data
Definition: vtkX3D.h:315
vtkX3D::key
Definition: vtkX3D.h:257
vtkPNGReader::GetFileExtensions
const char * GetFileExtensions() override
Get the file extensions for this format.
Definition: vtkPNGReader.h:55
OT
Set of utilities for OpenTURNS<->VTK conversions.
Definition: vtkOTFilter.h:32
vtkImageReader2::New
static vtkImageReader2 * New()
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkImageReader2
Superclass of binary file readers.
Definition: vtkImageReader2.h:58
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkPNGReader::GetDescriptiveName
const char * GetDescriptiveName() override
Return a descriptive name for the file format that might be useful in a GUI.
Definition: vtkPNGReader.h:63
vtkPNGReader
read PNG files
Definition: vtkPNGReader.h:38
vtkImageReader2::ExecuteInformation
virtual void ExecuteInformation()
vtkImageReader2::CanReadFile
virtual int CanReadFile(const char *vtkNotUsed(fname))
Return non zero if the reader can read the given file name.
Definition: vtkImageReader2.h:285
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:64
vtkX3D::index
Definition: vtkX3D.h:246
vtkImageReader2.h