VTK  9.2.6
vtkImageExport.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageExport.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 vtkImageExport_h
36 #define vtkImageExport_h
37 
38 #include "vtkIOImageModule.h" // For export macro
39 #include "vtkImageAlgorithm.h"
40 
41 class VTKIOIMAGE_EXPORT vtkImageExport : public vtkImageAlgorithm
42 {
43 public:
44  static vtkImageExport* New();
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
51  vtkIdType GetDataMemorySize();
52 
54 
58  void GetDataDimensions(int* ptr);
60  {
61  this->GetDataDimensions(this->DataDimensions);
62  return this->DataDimensions;
63  }
65 
71  int GetDataNumberOfScalarComponents();
72 
77  int GetDataScalarType();
79  {
80  return vtkImageScalarTypeNameMacro(this->GetDataScalarType());
81  }
82 
84 
87  int* GetDataExtent() VTK_SIZEHINT(6);
88  void GetDataExtent(int* ptr);
89  double* GetDataSpacing() VTK_SIZEHINT(3);
90  void GetDataSpacing(double* ptr);
91  double* GetDataOrigin() VTK_SIZEHINT(3);
92  void GetDataOrigin(double* ptr);
93  double* GetDataDirection() VTK_SIZEHINT(9);
94  void GetDataDirection(double* ptr);
96 
100  vtkImageData* GetInput();
101 
103 
111  vtkBooleanMacro(ImageLowerLeft, vtkTypeBool);
112  vtkGetMacro(ImageLowerLeft, vtkTypeBool);
113  vtkSetMacro(ImageLowerLeft, vtkTypeBool);
115 
117 
122  void SetExportVoidPointer(void*);
123  void* GetExportVoidPointer() { return this->ExportVoidPointer; }
125 
127 
132  void Export() { this->Export(this->ExportVoidPointer); }
133  virtual void Export(void*);
135 
143  void* GetPointerToData();
144 
148  void* GetCallbackUserData();
149 
151 
155  typedef void (*UpdateInformationCallbackType)(void*);
156  typedef int (*PipelineModifiedCallbackType)(void*);
157  typedef int* (*WholeExtentCallbackType)(void*);
158  typedef double* (*SpacingCallbackType)(void*);
159  typedef double* (*OriginCallbackType)(void*);
160  typedef double* (*DirectionCallbackType)(void*);
161  typedef const char* (*ScalarTypeCallbackType)(void*);
162  typedef int (*NumberOfComponentsCallbackType)(void*);
163  typedef void (*PropagateUpdateExtentCallbackType)(void*, int*);
164  typedef void (*UpdateDataCallbackType)(void*);
165  typedef int* (*DataExtentCallbackType)(void*);
166  typedef void* (*BufferPointerCallbackType)(void*);
168 
170 
173  UpdateInformationCallbackType GetUpdateInformationCallback() const;
174  PipelineModifiedCallbackType GetPipelineModifiedCallback() const;
175  WholeExtentCallbackType GetWholeExtentCallback() const;
176  SpacingCallbackType GetSpacingCallback() const;
177  OriginCallbackType GetOriginCallback() const;
178  DirectionCallbackType GetDirectionCallback() const;
179  ScalarTypeCallbackType GetScalarTypeCallback() const;
180  NumberOfComponentsCallbackType GetNumberOfComponentsCallback() const;
181  PropagateUpdateExtentCallbackType GetPropagateUpdateExtentCallback() const;
182  UpdateDataCallbackType GetUpdateDataCallback() const;
183  DataExtentCallbackType GetDataExtentCallback() const;
184  BufferPointerCallbackType GetBufferPointerCallback() const;
186 
187 protected:
188  vtkImageExport();
189  ~vtkImageExport() override;
190 
191  // This is called by the superclass.
192  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
193  vtkInformationVector* outputVector) override;
194 
195  virtual void UpdateInformationCallback();
196  virtual int PipelineModifiedCallback();
197  virtual void UpdateDataCallback();
198  virtual int* WholeExtentCallback();
199  virtual double* SpacingCallback();
200  virtual double* OriginCallback();
201  virtual double* DirectionCallback();
202  virtual const char* ScalarTypeCallback();
203  virtual int NumberOfComponentsCallback();
204  virtual void PropagateUpdateExtentCallback(int*);
205  virtual int* DataExtentCallback();
206  virtual void* BufferPointerCallback();
207 
209  int DataDimensions[3];
211 
213 
214 private:
215  vtkImageExport(const vtkImageExport&) = delete;
216  void operator=(const vtkImageExport&) = delete;
217 
218  static void UpdateInformationCallbackFunction(void*);
219  static int PipelineModifiedCallbackFunction(void*);
220  static int* WholeExtentCallbackFunction(void*);
221  static double* SpacingCallbackFunction(void*);
222  static double* OriginCallbackFunction(void*);
223  static double* DirectionCallbackFunction(void*);
224  static const char* ScalarTypeCallbackFunction(void*);
225  static int NumberOfComponentsCallbackFunction(void*);
226  static void PropagateUpdateExtentCallbackFunction(void*, int*);
227  static void UpdateDataCallbackFunction(void*);
228  static int* DataExtentCallbackFunction(void*);
229  static void* BufferPointerCallbackFunction(void*);
230 
233 };
234 
235 #endif
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
vtkAlgorithm * GetInputAlgorithm()
Equivalent to GetInputAlgorithm(0, 0).
Definition: vtkAlgorithm.h:501
vtkInformation * GetInputInformation()
Equivalent to GetInputInformation(0, 0)
Definition: vtkAlgorithm.h:527
vtkTypeBool ImageLowerLeft
int vtkIdType
Definition: vtkType.h:332
Export VTK images to third-party systems.
int vtkTypeBool
Definition: vtkABI.h:69
int * GetDataDimensions()
Get the (x,y,z) index dimensions of the data.
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:62
a simple class to control print indentation
Definition: vtkIndent.h:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
void Export()
The main interface: update the pipeline and export the image to the memory pointed to by SetExportVoi...
const char * GetDataScalarTypeAsString()
#define VTK_SIZEHINT(...)
vtkMTimeType LastPipelineMTime
Generic algorithm superclass for image algs.
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called in response to a REQUEST_DATA request from the executive.
void * ExportVoidPointer