VTK  9.0.1
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 =========================================================================*/
32 #ifndef vtkImageExport_h
33 #define vtkImageExport_h
34 
35 #include "vtkIOImageModule.h" // For export macro
36 #include "vtkImageAlgorithm.h"
37 
38 class VTKIOIMAGE_EXPORT vtkImageExport : public vtkImageAlgorithm
39 {
40 public:
41  static vtkImageExport* New();
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
49 
51 
55  void GetDataDimensions(int* ptr);
57  {
58  this->GetDataDimensions(this->DataDimensions);
59  return this->DataDimensions;
60  }
62 
69 
76  {
77  return vtkImageScalarTypeNameMacro(this->GetDataScalarType());
78  }
79 
81 
85  void GetDataExtent(int* ptr);
86  double* GetDataSpacing() VTK_SIZEHINT(3);
87  void GetDataSpacing(double* ptr);
88  double* GetDataOrigin() VTK_SIZEHINT(3);
89  void GetDataOrigin(double* ptr);
90  double* GetDataDirection() VTK_SIZEHINT(9);
91  void GetDataDirection(double* ptr);
93 
97  vtkImageData* GetInput();
98 
100 
108  vtkBooleanMacro(ImageLowerLeft, vtkTypeBool);
109  vtkGetMacro(ImageLowerLeft, vtkTypeBool);
110  vtkSetMacro(ImageLowerLeft, vtkTypeBool);
112 
114 
119  void SetExportVoidPointer(void*);
120  void* GetExportVoidPointer() { return this->ExportVoidPointer; }
122 
124 
129  void Export() { this->Export(this->ExportVoidPointer); }
130  virtual void Export(void*);
132 
141 
146 
148 
152  typedef void (*UpdateInformationCallbackType)(void*);
153  typedef int (*PipelineModifiedCallbackType)(void*);
154  typedef int* (*WholeExtentCallbackType)(void*);
155  typedef double* (*SpacingCallbackType)(void*);
156  typedef double* (*OriginCallbackType)(void*);
157  typedef double* (*DirectionCallbackType)(void*);
158  typedef const char* (*ScalarTypeCallbackType)(void*);
159  typedef int (*NumberOfComponentsCallbackType)(void*);
160  typedef void (*PropagateUpdateExtentCallbackType)(void*, int*);
161  typedef void (*UpdateDataCallbackType)(void*);
162  typedef int* (*DataExtentCallbackType)(void*);
163  typedef void* (*BufferPointerCallbackType)(void*);
165 
167 
170  UpdateInformationCallbackType GetUpdateInformationCallback() const;
171  PipelineModifiedCallbackType GetPipelineModifiedCallback() const;
172  WholeExtentCallbackType GetWholeExtentCallback() const;
173  SpacingCallbackType GetSpacingCallback() const;
174  OriginCallbackType GetOriginCallback() const;
175  DirectionCallbackType GetDirectionCallback() const;
176  ScalarTypeCallbackType GetScalarTypeCallback() const;
177  NumberOfComponentsCallbackType GetNumberOfComponentsCallback() const;
178  PropagateUpdateExtentCallbackType GetPropagateUpdateExtentCallback() const;
179  UpdateDataCallbackType GetUpdateDataCallback() const;
180  DataExtentCallbackType GetDataExtentCallback() const;
181  BufferPointerCallbackType GetBufferPointerCallback() const;
183 
184 protected:
186  ~vtkImageExport() override;
187 
188  // This is called by the superclass.
189  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
190  vtkInformationVector* outputVector) override;
191 
194  virtual void UpdateDataCallback();
195  virtual int* WholeExtentCallback();
196  virtual double* SpacingCallback();
197  virtual double* OriginCallback();
198  virtual double* DirectionCallback();
199  virtual const char* ScalarTypeCallback();
201  virtual void PropagateUpdateExtentCallback(int*);
202  virtual int* DataExtentCallback();
203  virtual void* BufferPointerCallback();
204 
206  int DataDimensions[3];
208 
210 
211 private:
212  vtkImageExport(const vtkImageExport&) = delete;
213  void operator=(const vtkImageExport&) = delete;
214 
215  static void UpdateInformationCallbackFunction(void*);
216  static int PipelineModifiedCallbackFunction(void*);
217  static int* WholeExtentCallbackFunction(void*);
218  static double* SpacingCallbackFunction(void*);
219  static double* OriginCallbackFunction(void*);
220  static double* DirectionCallbackFunction(void*);
221  static const char* ScalarTypeCallbackFunction(void*);
222  static int NumberOfComponentsCallbackFunction(void*);
223  static void PropagateUpdateExtentCallbackFunction(void*, int*);
224  static void UpdateDataCallbackFunction(void*);
225  static int* DataExtentCallbackFunction(void*);
226  static void* BufferPointerCallbackFunction(void*);
227 
230 };
231 
232 #endif
vtkImageExport::GetDataMemorySize
vtkIdType GetDataMemorySize()
Get the number of bytes required for the output C array.
vtkImageExport::GetPropagateUpdateExtentCallback
PropagateUpdateExtentCallbackType GetPropagateUpdateExtentCallback() const
vtkImageExport::GetDataExtentCallback
DataExtentCallbackType GetDataExtentCallback() const
vtkImageExport::GetNumberOfComponentsCallback
NumberOfComponentsCallbackType GetNumberOfComponentsCallback() const
vtkImageExport::GetDataDimensions
void GetDataDimensions(int *ptr)
Get the (x,y,z) index dimensions of the data.
vtkImageExport::GetDataDimensions
int * GetDataDimensions()
Definition: vtkImageExport.h:56
vtkImageExport::ExportVoidPointer
void * ExportVoidPointer
Definition: vtkImageExport.h:207
vtkImageExport::OriginCallback
virtual double * OriginCallback()
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkImageExport::GetDataScalarTypeAsString
const char * GetDataScalarTypeAsString()
Definition: vtkImageExport.h:75
vtkAlgorithm
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:54
vtkImageExport::PropagateUpdateExtentCallback
virtual void PropagateUpdateExtentCallback(int *)
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:36
vtkImageExport::BufferPointerCallback
virtual void * BufferPointerCallback()
vtkImageAlgorithm.h
vtkImageExport::~vtkImageExport
~vtkImageExport() override
vtkImageExport::GetWholeExtentCallback
WholeExtentCallbackType GetWholeExtentCallback() const
vtkImageAlgorithm
Generic algorithm superclass for image algs.
Definition: vtkImageAlgorithm.h:38
vtkImageExport::Export
virtual void Export(void *)
vtkImageExport::vtkImageExport
vtkImageExport()
vtkImageExport::GetCallbackUserData
void * GetCallbackUserData()
Get the user data that should be passed to the callback functions.
vtkImageExport::GetDirectionCallback
DirectionCallbackType GetDirectionCallback() const
vtkImageExport::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageExport::RequestData
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called in response to a REQUEST_DATA request from the executive.
vtkImageExport::DataExtentCallback
virtual int * DataExtentCallback()
vtkImageExport::GetDataScalarType
int GetDataScalarType()
Get the scalar type of the data.
vtkImageExport::WholeExtentCallback
virtual int * WholeExtentCallback()
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:45
vtkImageExport::GetOriginCallback
OriginCallbackType GetOriginCallback() const
vtkImageExport::GetPointerToData
void * GetPointerToData()
An alternative to Export(): Use with caution.
vtkImageExport::DirectionCallback
virtual double * DirectionCallback()
vtkImageExport::PipelineModifiedCallback
virtual int PipelineModifiedCallback()
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkImageExport::UpdateDataCallback
virtual void UpdateDataCallback()
vtkImageExport::NumberOfComponentsCallback
virtual int NumberOfComponentsCallback()
vtkImageExport::GetScalarTypeCallback
ScalarTypeCallbackType GetScalarTypeCallback() const
vtkImageExport::GetUpdateDataCallback
UpdateDataCallbackType GetUpdateDataCallback() const
vtkImageExport::GetDataExtent
int * GetDataExtent()
Get miscellaneous additional information about the data.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:65
vtkAlgorithm::GetInputInformation
vtkInformation * GetInputInformation()
Equivalent to GetInputInformation(0, 0)
Definition: vtkAlgorithm.h:525
vtkAlgorithm::GetInputAlgorithm
vtkAlgorithm * GetInputAlgorithm()
Equivalent to GetInputAlgorithm(0, 0).
Definition: vtkAlgorithm.h:499
vtkImageExport::LastPipelineMTime
vtkMTimeType LastPipelineMTime
Definition: vtkImageExport.h:209
vtkImageExport::GetUpdateInformationCallback
UpdateInformationCallbackType GetUpdateInformationCallback() const
Get pointers to the pipeline interface callbacks.
vtkImageExport::ImageLowerLeft
vtkTypeBool ImageLowerLeft
Definition: vtkImageExport.h:205
vtkImageExport::SpacingCallback
virtual double * SpacingCallback()
vtkImageExport::GetPipelineModifiedCallback
PipelineModifiedCallbackType GetPipelineModifiedCallback() const
vtkImageExport::Export
void Export()
The main interface: update the pipeline and export the image to the memory pointed to by SetExportVoi...
Definition: vtkImageExport.h:129
vtkImageExport
Export VTK images to third-party systems.
Definition: vtkImageExport.h:39
vtkImageExport::ScalarTypeCallback
virtual const char * ScalarTypeCallback()
vtkImageExport::GetDataNumberOfScalarComponents
int GetDataNumberOfScalarComponents()
Get the number of scalar components of the data.
vtkImageExport::UpdateInformationCallback
virtual void UpdateInformationCallback()
vtkImageExport::New
static vtkImageExport * New()
vtkImageExport::GetSpacingCallback
SpacingCallbackType GetSpacingCallback() const
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkImageExport::GetBufferPointerCallback
BufferPointerCallbackType GetBufferPointerCallback() const
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293