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=========================================================================*/
35#ifndef vtkPNGReader_h
36#define vtkPNGReader_h
37
38#include "vtkIOImageModule.h" // For export macro
39#include "vtkImageReader2.h"
40
41class VTKIOIMAGE_EXPORT vtkPNGReader : public vtkImageReader2
42{
43public:
44 static vtkPNGReader* New();
46 void PrintSelf(ostream& os, vtkIndent indent) override;
47
51 int CanReadFile(VTK_FILEPATH const char* fname) override;
52
58 const char* GetFileExtensions() override { return ".png"; }
59
63 const char* GetDescriptiveName() override { return "PNG"; }
64
70 void GetTextChunks(const char* key, int beginEndIndex[2]);
74 const char* GetTextKey(int index);
80 const char* GetTextValue(int index);
86
88
93 vtkSetMacro(ReadSpacingFromFile, bool);
94 vtkGetMacro(ReadSpacingFromFile, bool);
95 vtkBooleanMacro(ReadSpacingFromFile, bool);
97protected:
99 ~vtkPNGReader() override;
100
101 void ExecuteInformation() override;
103 template <class OT>
105 template <class OT>
106 void vtkPNGReaderUpdate2(OT* outPtr, int* outExt, vtkIdType* outInc, long pixSize);
107
108private:
109 vtkPNGReader(const vtkPNGReader&) = delete;
110 void operator=(const vtkPNGReader&) = delete;
111
112 class vtkInternals;
113 vtkInternals* Internals;
114 bool ReadSpacingFromFile;
115};
116#endif
general representation of visualization data
Definition: vtkDataObject.h:69
topologically and geometrically regular array of data
Definition: vtkImageData.h:57
Superclass of binary file readers.
a simple class to control print indentation
Definition: vtkIndent.h:43
Store vtkAlgorithm input/output information.
read PNG files
Definition: vtkPNGReader.h:42
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 * GetDescriptiveName() override
Return a descriptive name for the file format that might be useful in a GUI.
Definition: vtkPNGReader.h:63
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.
static vtkPNGReader * New()
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)
const char * GetTextKey(int index)
Returns the text key stored at 'index'.
void GetTextChunks(const char *key, int beginEndIndex[2])
Given a 'key' for the text chunks, fills in 'beginEndIndex' with the begin and end indexes.
const char * GetFileExtensions() override
Get the file extensions for this format.
Definition: vtkPNGReader.h:58
~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:263
@ index
Definition: vtkX3D.h:252
@ data
Definition: vtkX3D.h:321
int vtkIdType
Definition: vtkType.h:332
#define VTK_FILEPATH