VTK  9.1.0
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 =========================================================================*/
51 #ifndef vtkImageExport_h
52 #define vtkImageExport_h
53 
54 #include "vtkIOImageModule.h" // For export macro
55 #include "vtkImageAlgorithm.h"
56 
57 class VTKIOIMAGE_EXPORT vtkImageExport : public vtkImageAlgorithm
58 {
59 public:
60  static vtkImageExport* New();
62  void PrintSelf(ostream& os, vtkIndent indent) override;
63 
68 
70 
74  void GetDataDimensions(int* ptr);
76  {
77  this->GetDataDimensions(this->DataDimensions);
78  return this->DataDimensions;
79  }
81 
88 
95  {
96  return vtkImageScalarTypeNameMacro(this->GetDataScalarType());
97  }
98 
100 
104  void GetDataExtent(int* ptr);
105  double* GetDataSpacing() VTK_SIZEHINT(3);
106  void GetDataSpacing(double* ptr);
107  double* GetDataOrigin() VTK_SIZEHINT(3);
108  void GetDataOrigin(double* ptr);
109  double* GetDataDirection() VTK_SIZEHINT(9);
110  void GetDataDirection(double* ptr);
112 
116  vtkImageData* GetInput();
117 
119 
127  vtkBooleanMacro(ImageLowerLeft, vtkTypeBool);
128  vtkGetMacro(ImageLowerLeft, vtkTypeBool);
129  vtkSetMacro(ImageLowerLeft, vtkTypeBool);
131 
133 
138  void SetExportVoidPointer(void*);
139  void* GetExportVoidPointer() { return this->ExportVoidPointer; }
141 
143 
148  void Export() { this->Export(this->ExportVoidPointer); }
149  virtual void Export(void*);
151 
160 
165 
167 
171  typedef void (*UpdateInformationCallbackType)(void*);
172  typedef int (*PipelineModifiedCallbackType)(void*);
173  typedef int* (*WholeExtentCallbackType)(void*);
174  typedef double* (*SpacingCallbackType)(void*);
175  typedef double* (*OriginCallbackType)(void*);
176  typedef double* (*DirectionCallbackType)(void*);
177  typedef const char* (*ScalarTypeCallbackType)(void*);
178  typedef int (*NumberOfComponentsCallbackType)(void*);
179  typedef void (*PropagateUpdateExtentCallbackType)(void*, int*);
180  typedef void (*UpdateDataCallbackType)(void*);
181  typedef int* (*DataExtentCallbackType)(void*);
182  typedef void* (*BufferPointerCallbackType)(void*);
184 
186 
189  UpdateInformationCallbackType GetUpdateInformationCallback() const;
190  PipelineModifiedCallbackType GetPipelineModifiedCallback() const;
191  WholeExtentCallbackType GetWholeExtentCallback() const;
192  SpacingCallbackType GetSpacingCallback() const;
193  OriginCallbackType GetOriginCallback() const;
194  DirectionCallbackType GetDirectionCallback() const;
195  ScalarTypeCallbackType GetScalarTypeCallback() const;
196  NumberOfComponentsCallbackType GetNumberOfComponentsCallback() const;
197  PropagateUpdateExtentCallbackType GetPropagateUpdateExtentCallback() const;
198  UpdateDataCallbackType GetUpdateDataCallback() const;
199  DataExtentCallbackType GetDataExtentCallback() const;
200  BufferPointerCallbackType GetBufferPointerCallback() const;
202 
203 protected:
205  ~vtkImageExport() override;
206 
207  // This is called by the superclass.
208  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
209  vtkInformationVector* outputVector) override;
210 
213  virtual void UpdateDataCallback();
214  virtual int* WholeExtentCallback();
215  virtual double* SpacingCallback();
216  virtual double* OriginCallback();
217  virtual double* DirectionCallback();
218  virtual const char* ScalarTypeCallback();
220  virtual void PropagateUpdateExtentCallback(int*);
221  virtual int* DataExtentCallback();
222  virtual void* BufferPointerCallback();
223 
225  int DataDimensions[3];
227 
229 
230 private:
231  vtkImageExport(const vtkImageExport&) = delete;
232  void operator=(const vtkImageExport&) = delete;
233 
234  static void UpdateInformationCallbackFunction(void*);
235  static int PipelineModifiedCallbackFunction(void*);
236  static int* WholeExtentCallbackFunction(void*);
237  static double* SpacingCallbackFunction(void*);
238  static double* OriginCallbackFunction(void*);
239  static double* DirectionCallbackFunction(void*);
240  static const char* ScalarTypeCallbackFunction(void*);
241  static int NumberOfComponentsCallbackFunction(void*);
242  static void PropagateUpdateExtentCallbackFunction(void*, int*);
243  static void UpdateDataCallbackFunction(void*);
244  static int* DataExtentCallbackFunction(void*);
245  static void* BufferPointerCallbackFunction(void*);
246 
249 };
250 
251 #endif
vtkImageExport::GetDataMemorySize
vtkIdType GetDataMemorySize()
Get the number of bytes required for the output C array.
vtkImageExport::GetPropagateUpdateExtentCallback
PropagateUpdateExtentCallbackType GetPropagateUpdateExtentCallback() const
Get pointers to the pipeline interface callbacks.
vtkImageExport::GetDataExtentCallback
DataExtentCallbackType GetDataExtentCallback() const
Get pointers to the pipeline interface callbacks.
vtkImageExport::GetNumberOfComponentsCallback
NumberOfComponentsCallbackType GetNumberOfComponentsCallback() const
Get pointers to the pipeline interface callbacks.
vtkImageExport::GetDataDimensions
void GetDataDimensions(int *ptr)
Get the (x,y,z) index dimensions of the data.
vtkImageExport::GetDataDimensions
int * GetDataDimensions()
Get the (x,y,z) index dimensions of the data.
Definition: vtkImageExport.h:75
vtkImageExport::ExportVoidPointer
void * ExportVoidPointer
Definition: vtkImageExport.h:226
vtkImageExport::OriginCallback
virtual double * OriginCallback()
vtkIdType
int vtkIdType
Definition: vtkType.h:332
vtkImageExport::GetDataScalarTypeAsString
const char * GetDataScalarTypeAsString()
Definition: vtkImageExport.h:94
vtkAlgorithm
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:123
vtkImageExport::PropagateUpdateExtentCallback
virtual void PropagateUpdateExtentCallback(int *)
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkImageExport::BufferPointerCallback
virtual void * BufferPointerCallback()
vtkImageAlgorithm.h
vtkImageExport::~vtkImageExport
~vtkImageExport() override
vtkImageExport::GetWholeExtentCallback
WholeExtentCallbackType GetWholeExtentCallback() const
Get pointers to the pipeline interface callbacks.
vtkImageAlgorithm
Generic algorithm superclass for image algs.
Definition: vtkImageAlgorithm.h:57
vtkImageExport::Export
virtual void Export(void *)
The main interface: update the pipeline and export the image to the memory pointed to by SetExportVoi...
vtkImageExport::vtkImageExport
vtkImageExport()
vtkImageExport::GetCallbackUserData
void * GetCallbackUserData()
Get the user data that should be passed to the callback functions.
vtkImageExport::GetDirectionCallback
DirectionCallbackType GetDirectionCallback() const
Get pointers to the pipeline interface callbacks.
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:48
vtkImageExport::GetOriginCallback
OriginCallbackType GetOriginCallback() const
Get pointers to the pipeline interface callbacks.
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:157
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkImageExport::UpdateDataCallback
virtual void UpdateDataCallback()
vtkImageExport::NumberOfComponentsCallback
virtual int NumberOfComponentsCallback()
vtkImageExport::GetScalarTypeCallback
ScalarTypeCallbackType GetScalarTypeCallback() const
Get pointers to the pipeline interface callbacks.
vtkImageExport::GetUpdateDataCallback
UpdateDataCallbackType GetUpdateDataCallback() const
Get pointers to the pipeline interface callbacks.
vtkImageExport::GetDataExtent
int * GetDataExtent()
Get miscellaneous additional information about the data.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkAlgorithm::GetInputInformation
vtkInformation * GetInputInformation()
Equivalent to GetInputInformation(0, 0)
Definition: vtkAlgorithm.h:595
vtkAlgorithm::GetInputAlgorithm
vtkAlgorithm * GetInputAlgorithm()
Equivalent to GetInputAlgorithm(0, 0).
Definition: vtkAlgorithm.h:569
vtkImageExport::LastPipelineMTime
vtkMTimeType LastPipelineMTime
Definition: vtkImageExport.h:228
vtkImageExport::GetUpdateInformationCallback
UpdateInformationCallbackType GetUpdateInformationCallback() const
Get pointers to the pipeline interface callbacks.
vtkImageExport::ImageLowerLeft
vtkTypeBool ImageLowerLeft
Definition: vtkImageExport.h:224
vtkImageExport::SpacingCallback
virtual double * SpacingCallback()
vtkImageExport::GetPipelineModifiedCallback
PipelineModifiedCallbackType GetPipelineModifiedCallback() const
Get pointers to the pipeline interface callbacks.
vtkImageExport::Export
void Export()
The main interface: update the pipeline and export the image to the memory pointed to by SetExportVoi...
Definition: vtkImageExport.h:148
vtkImageExport
Export VTK images to third-party systems.
Definition: vtkImageExport.h:58
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
Get pointers to the pipeline interface callbacks.
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkImageExport::GetBufferPointerCallback
BufferPointerCallbackType GetBufferPointerCallback() const
Get pointers to the pipeline interface callbacks.
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287