VTK  9.3.1
vtkImageExport.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
23 #ifndef vtkImageExport_h
24 #define vtkImageExport_h
25 
26 #include "vtkIOImageModule.h" // For export macro
27 #include "vtkImageAlgorithm.h"
28 
29 VTK_ABI_NAMESPACE_BEGIN
30 class VTKIOIMAGE_EXPORT vtkImageExport : public vtkImageAlgorithm
31 {
32 public:
33  static vtkImageExport* New();
35  void PrintSelf(ostream& os, vtkIndent indent) override;
36 
40  vtkIdType GetDataMemorySize();
41 
43 
47  void GetDataDimensions(int* ptr);
49  {
50  this->GetDataDimensions(this->DataDimensions);
51  return this->DataDimensions;
52  }
54 
60  int GetDataNumberOfScalarComponents();
61 
66  int GetDataScalarType();
68  {
69  return vtkImageScalarTypeNameMacro(this->GetDataScalarType());
70  }
71 
73 
76  int* GetDataExtent() VTK_SIZEHINT(6);
77  void GetDataExtent(int* ptr);
78  double* GetDataSpacing() VTK_SIZEHINT(3);
79  void GetDataSpacing(double* ptr);
80  double* GetDataOrigin() VTK_SIZEHINT(3);
81  void GetDataOrigin(double* ptr);
82  double* GetDataDirection() VTK_SIZEHINT(9);
83  void GetDataDirection(double* ptr);
85 
89  vtkImageData* GetInput();
90 
92 
100  vtkBooleanMacro(ImageLowerLeft, vtkTypeBool);
101  vtkGetMacro(ImageLowerLeft, vtkTypeBool);
102  vtkSetMacro(ImageLowerLeft, vtkTypeBool);
104 
106 
111  void SetExportVoidPointer(void*);
112  void* GetExportVoidPointer() { return this->ExportVoidPointer; }
114 
116 
121  void Export() { this->Export(this->ExportVoidPointer); }
122  virtual void Export(void*);
124 
132  void* GetPointerToData();
133 
137  void* GetCallbackUserData();
138 
140 
144  typedef void (*UpdateInformationCallbackType)(void*);
145  typedef int (*PipelineModifiedCallbackType)(void*);
146  typedef int* (*WholeExtentCallbackType)(void*);
147  typedef double* (*SpacingCallbackType)(void*);
148  typedef double* (*OriginCallbackType)(void*);
149  typedef double* (*DirectionCallbackType)(void*);
150  typedef const char* (*ScalarTypeCallbackType)(void*);
151  typedef int (*NumberOfComponentsCallbackType)(void*);
152  typedef void (*PropagateUpdateExtentCallbackType)(void*, int*);
153  typedef void (*UpdateDataCallbackType)(void*);
154  typedef int* (*DataExtentCallbackType)(void*);
155  typedef void* (*BufferPointerCallbackType)(void*);
157 
159 
162  UpdateInformationCallbackType GetUpdateInformationCallback() const;
163  PipelineModifiedCallbackType GetPipelineModifiedCallback() const;
164  WholeExtentCallbackType GetWholeExtentCallback() const;
165  SpacingCallbackType GetSpacingCallback() const;
166  OriginCallbackType GetOriginCallback() const;
167  DirectionCallbackType GetDirectionCallback() const;
168  ScalarTypeCallbackType GetScalarTypeCallback() const;
169  NumberOfComponentsCallbackType GetNumberOfComponentsCallback() const;
170  PropagateUpdateExtentCallbackType GetPropagateUpdateExtentCallback() const;
171  UpdateDataCallbackType GetUpdateDataCallback() const;
172  DataExtentCallbackType GetDataExtentCallback() const;
173  BufferPointerCallbackType GetBufferPointerCallback() const;
175 
176 protected:
177  vtkImageExport();
178  ~vtkImageExport() override;
179 
180  // This is called by the superclass.
181  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
182  vtkInformationVector* outputVector) override;
183 
184  virtual void UpdateInformationCallback();
185  virtual int PipelineModifiedCallback();
186  virtual void UpdateDataCallback();
187  virtual int* WholeExtentCallback();
188  virtual double* SpacingCallback();
189  virtual double* OriginCallback();
190  virtual double* DirectionCallback();
191  virtual const char* ScalarTypeCallback();
192  virtual int NumberOfComponentsCallback();
193  virtual void PropagateUpdateExtentCallback(int*);
194  virtual int* DataExtentCallback();
195  virtual void* BufferPointerCallback();
196 
198  int DataDimensions[3];
200 
202 
203 private:
204  vtkImageExport(const vtkImageExport&) = delete;
205  void operator=(const vtkImageExport&) = delete;
206 
207  static void UpdateInformationCallbackFunction(void*);
208  static int PipelineModifiedCallbackFunction(void*);
209  static int* WholeExtentCallbackFunction(void*);
210  static double* SpacingCallbackFunction(void*);
211  static double* OriginCallbackFunction(void*);
212  static double* DirectionCallbackFunction(void*);
213  static const char* ScalarTypeCallbackFunction(void*);
214  static int NumberOfComponentsCallbackFunction(void*);
215  static void PropagateUpdateExtentCallbackFunction(void*, int*);
216  static void UpdateDataCallbackFunction(void*);
217  static int* DataExtentCallbackFunction(void*);
218  static void* BufferPointerCallbackFunction(void*);
219 
222 };
223 
224 VTK_ABI_NAMESPACE_END
225 #endif
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
vtkAlgorithm * GetInputAlgorithm()
Equivalent to GetInputAlgorithm(0, 0).
Definition: vtkAlgorithm.h:531
vtkInformation * GetInputInformation()
Equivalent to GetInputInformation(0, 0)
Definition: vtkAlgorithm.h:557
vtkTypeBool ImageLowerLeft
int vtkIdType
Definition: vtkType.h:315
Export VTK images to third-party systems.
int vtkTypeBool
Definition: vtkABI.h:64
int * GetDataDimensions()
Get the (x,y,z) index dimensions of the data.
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:51
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
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