VTK
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 
48  vtkIdType GetDataMemorySize();
49 
51 
55  void GetDataDimensions(int *ptr);
57  this->GetDataDimensions(this->DataDimensions);
58  return this->DataDimensions; }
60 
66  int GetDataNumberOfScalarComponents();
67 
72  int GetDataScalarType();
73  const char *GetDataScalarTypeAsString() {
74  return vtkImageScalarTypeNameMacro(this->GetDataScalarType()); }
75 
77 
80  int *GetDataExtent() VTK_SIZEHINT(6);
81  void GetDataExtent(int *ptr);
82  double *GetDataSpacing() VTK_SIZEHINT(3);
83  void GetDataSpacing(double *ptr);
84  double *GetDataOrigin() VTK_SIZEHINT(3);
85  void GetDataOrigin(double *ptr);
87 
91  vtkImageData *GetInput();
92 
94 
102  vtkBooleanMacro(ImageLowerLeft, vtkTypeBool);
103  vtkGetMacro(ImageLowerLeft, vtkTypeBool);
104  vtkSetMacro(ImageLowerLeft, vtkTypeBool);
106 
108 
113  void SetExportVoidPointer(void *);
114  void *GetExportVoidPointer() { return this->ExportVoidPointer; };
116 
118 
123  void Export() { this->Export(this->ExportVoidPointer); };
124  virtual void Export(void *);
126 
134  void *GetPointerToData();
135 
139  void* GetCallbackUserData();
140 
142 
146  typedef void (*UpdateInformationCallbackType)(void*);
147  typedef int (*PipelineModifiedCallbackType)(void*);
148  typedef int* (*WholeExtentCallbackType)(void*);
149  typedef double* (*SpacingCallbackType)(void*);
150  typedef double* (*OriginCallbackType)(void*);
151  typedef const char* (*ScalarTypeCallbackType)(void*);
152  typedef int (*NumberOfComponentsCallbackType)(void*);
153  typedef void (*PropagateUpdateExtentCallbackType)(void*, int*);
154  typedef void (*UpdateDataCallbackType)(void*);
155  typedef int* (*DataExtentCallbackType)(void*);
156  typedef void* (*BufferPointerCallbackType)(void*);
158 
160 
163  UpdateInformationCallbackType GetUpdateInformationCallback() const;
164  PipelineModifiedCallbackType GetPipelineModifiedCallback() const;
165  WholeExtentCallbackType GetWholeExtentCallback() const;
166  SpacingCallbackType GetSpacingCallback() const;
167  OriginCallbackType GetOriginCallback() 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,
182  vtkInformationVector** inputVector,
183  vtkInformationVector* outputVector) override;
184 
185  virtual void UpdateInformationCallback();
186  virtual int PipelineModifiedCallback();
187  virtual void UpdateDataCallback();
188  virtual int* WholeExtentCallback();
189  virtual double* SpacingCallback();
190  virtual double* OriginCallback();
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 const char* ScalarTypeCallbackFunction(void*);
213  static int NumberOfComponentsCallbackFunction(void*);
214  static void PropagateUpdateExtentCallbackFunction(void*, int*);
215  static void UpdateDataCallbackFunction(void*);
216  static int* DataExtentCallbackFunction(void*);
217  static void* BufferPointerCallbackFunction(void*);
218 
221 };
222 
223 #endif
224 
225 
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
vtkAlgorithm * GetInputAlgorithm()
Equivalent to GetInputAlgorithm(0, 0).
Definition: vtkAlgorithm.h:486
vtkInformation * GetInputInformation()
Equivalent to GetInputInformation(0, 0)
Definition: vtkAlgorithm.h:518
vtkTypeBool ImageLowerLeft
int vtkIdType
Definition: vtkType.h:345
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:53
a simple class to control print indentation
Definition: vtkIndent.h:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
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