VTK  9.2.20230201
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 =========================================================================*/
141 #ifndef vtkPNGReader_h
142 #define vtkPNGReader_h
143 
144 #include "vtkIOImageModule.h" // For export macro
145 #include "vtkImageReader2.h"
146 
147 VTK_ABI_NAMESPACE_BEGIN
148 class VTKIOIMAGE_EXPORT vtkPNGReader : public vtkImageReader2
149 {
150 public:
151  static vtkPNGReader* New();
153  void PrintSelf(ostream& os, vtkIndent indent) override;
154 
158  int CanReadFile(VTK_FILEPATH const char* fname) override;
159 
165  const char* GetFileExtensions() override { return ".png"; }
166 
170  const char* GetDescriptiveName() override { return "PNG"; }
171 
177  void GetTextChunks(const char* key, int beginEndIndex[2]);
181  const char* GetTextKey(int index);
187  const char* GetTextValue(int index);
193 
195 
200  vtkSetMacro(ReadSpacingFromFile, bool);
201  vtkGetMacro(ReadSpacingFromFile, bool);
202  vtkBooleanMacro(ReadSpacingFromFile, bool);
204 protected:
206  ~vtkPNGReader() override;
207 
208  void ExecuteInformation() override;
210  template <class OT>
212  template <class OT>
213  void vtkPNGReaderUpdate2(OT* outPtr, int* outExt, vtkIdType* outInc, long pixSize);
214 
215 private:
216  vtkPNGReader(const vtkPNGReader&) = delete;
217  void operator=(const vtkPNGReader&) = delete;
218 
219  class vtkInternals;
220  vtkInternals* Internals;
221  bool ReadSpacingFromFile;
222 };
223 VTK_ABI_NAMESPACE_END
224 #endif
general representation of visualization data
topologically and geometrically regular array of data
Definition: vtkImageData.h:164
Superclass of binary file readers.
a simple class to control print indentation
Definition: vtkIndent.h:120
Store vtkAlgorithm input/output information.
read PNG files
Definition: vtkPNGReader.h:149
const char * GetDescriptiveName() override
Return a descriptive name for the file format that might be useful in a GUI.
Definition: vtkPNGReader.h:170
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:165
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.
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?
Set of utilities for OpenTURNS<->VTK conversions.
Definition: vtkOTFilter.h:33
@ key
Definition: vtkX3D.h:269
@ index
Definition: vtkX3D.h:258
@ data
Definition: vtkX3D.h:327
int vtkIdType
Definition: vtkType.h:327
#define VTK_FILEPATH