VTK  9.1.0
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 =========================================================================*/
135 #ifndef vtkPNGReader_h
136 #define vtkPNGReader_h
137 
138 #include "vtkIOImageModule.h" // For export macro
139 #include "vtkImageReader2.h"
140 
141 class VTKIOIMAGE_EXPORT vtkPNGReader : public vtkImageReader2
142 {
143 public:
144  static vtkPNGReader* New();
146  void PrintSelf(ostream& os, vtkIndent indent) override;
147 
151  int CanReadFile(VTK_FILEPATH const char* fname) override;
152 
158  const char* GetFileExtensions() override { return ".png"; }
159 
163  const char* GetDescriptiveName() override { return "PNG"; }
164 
170  void GetTextChunks(const char* key, int beginEndIndex[2]);
174  const char* GetTextKey(int index);
180  const char* GetTextValue(int index);
186 
188 
193  vtkSetMacro(ReadSpacingFromFile, bool);
194  vtkGetMacro(ReadSpacingFromFile, bool);
195  vtkBooleanMacro(ReadSpacingFromFile, bool);
197 protected:
199  ~vtkPNGReader() override;
200 
201  void ExecuteInformation() override;
203  template <class OT>
205  template <class OT>
206  void vtkPNGReaderUpdate2(OT* outPtr, int* outExt, vtkIdType* outInc, long pixSize);
207 
208 private:
209  vtkPNGReader(const vtkPNGReader&) = delete;
210  void operator=(const vtkPNGReader&) = delete;
211 
212  class vtkInternals;
213  vtkInternals* Internals;
214  bool ReadSpacingFromFile;
215 };
216 #endif
vtkPNGReader::GetNumberOfTextChunks
size_t GetNumberOfTextChunks()
Return the number of text chunks in the PNG file.
vtkPNGReader::ExecuteDataWithInformation
void ExecuteDataWithInformation(vtkDataObject *out, vtkInformation *outInfo) override
This is a convenience method that is implemented in many subclasses instead of RequestData.
VTK_FILEPATH
#define VTK_FILEPATH
Definition: vtkWrappingHints.h:46
vtkIdType
int vtkIdType
Definition: vtkType.h:332
vtkX3D::data
@ data
Definition: vtkX3D.h:321
vtkX3D::key
@ key
Definition: vtkX3D.h:263
vtkPNGReader::GetFileExtensions
const char * GetFileExtensions() override
Get the file extensions for this format.
Definition: vtkPNGReader.h:158
vtkPNGReader::vtkPNGReaderUpdate
void vtkPNGReaderUpdate(vtkImageData *data, OT *outPtr)
OT
Set of utilities for OpenTURNS<->VTK conversions.
Definition: vtkOTFilter.h:33
vtkPNGReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPNGReader::GetTextValue
const char * GetTextValue(int index)
Returns the text value stored at 'index'.
vtkPNGReader::GetTextKey
const char * GetTextKey(int index)
Returns the text key stored at 'index'.
vtkPNGReader::New
static vtkPNGReader * New()
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkPNGReader::vtkPNGReader
vtkPNGReader()
vtkImageReader2
Superclass of binary file readers.
Definition: vtkImageReader2.h:162
vtkPNGReader::CanReadFile
int CanReadFile(VTK_FILEPATH const char *fname) override
Is the given file a PNG file?
vtkPNGReader::ExecuteInformation
void ExecuteInformation() override
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkPNGReader::GetDescriptiveName
const char * GetDescriptiveName() override
Return a descriptive name for the file format that might be useful in a GUI.
Definition: vtkPNGReader.h:163
vtkPNGReader::vtkPNGReaderUpdate2
void vtkPNGReaderUpdate2(OT *outPtr, int *outExt, vtkIdType *outInc, long pixSize)
vtkPNGReader::GetTextChunks
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
read PNG files
Definition: vtkPNGReader.h:142
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:169
vtkX3D::index
@ index
Definition: vtkX3D.h:252
vtkPNGReader::~vtkPNGReader
~vtkPNGReader() override
vtkImageReader2.h