VTK  9.3.0
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
32#ifndef vtkImageExport_h
33#define vtkImageExport_h
34
35#include "vtkIOImageModule.h" // For export macro
36#include "vtkImageAlgorithm.h"
37
38VTK_ABI_NAMESPACE_BEGIN
39class VTKIOIMAGE_EXPORT vtkImageExport : public vtkImageAlgorithm
40{
41public:
44 void PrintSelf(ostream& os, vtkIndent indent) override;
45
50
52
56 void GetDataDimensions(int* ptr);
58 {
59 this->GetDataDimensions(this->DataDimensions);
60 return this->DataDimensions;
61 }
63
70
77 {
78 return vtkImageScalarTypeNameMacro(this->GetDataScalarType());
79 }
80
82
86 void GetDataExtent(int* ptr);
87 double* GetDataSpacing() VTK_SIZEHINT(3);
88 void GetDataSpacing(double* ptr);
89 double* GetDataOrigin() VTK_SIZEHINT(3);
90 void GetDataOrigin(double* ptr);
91 double* GetDataDirection() VTK_SIZEHINT(9);
92 void GetDataDirection(double* ptr);
94
98 vtkImageData* GetInput();
99
101
109 vtkBooleanMacro(ImageLowerLeft, vtkTypeBool);
110 vtkGetMacro(ImageLowerLeft, vtkTypeBool);
111 vtkSetMacro(ImageLowerLeft, vtkTypeBool);
113
115
120 void SetExportVoidPointer(void*);
121 void* GetExportVoidPointer() { return this->ExportVoidPointer; }
123
125
130 void Export() { this->Export(this->ExportVoidPointer); }
131 virtual void Export(void*);
133
142
147
149
153 typedef void (*UpdateInformationCallbackType)(void*);
154 typedef int (*PipelineModifiedCallbackType)(void*);
155 typedef int* (*WholeExtentCallbackType)(void*);
156 typedef double* (*SpacingCallbackType)(void*);
157 typedef double* (*OriginCallbackType)(void*);
158 typedef double* (*DirectionCallbackType)(void*);
159 typedef const char* (*ScalarTypeCallbackType)(void*);
160 typedef int (*NumberOfComponentsCallbackType)(void*);
161 typedef void (*PropagateUpdateExtentCallbackType)(void*, int*);
162 typedef void (*UpdateDataCallbackType)(void*);
163 typedef int* (*DataExtentCallbackType)(void*);
164 typedef void* (*BufferPointerCallbackType)(void*);
166
168
171 UpdateInformationCallbackType GetUpdateInformationCallback() const;
172 PipelineModifiedCallbackType GetPipelineModifiedCallback() const;
173 WholeExtentCallbackType GetWholeExtentCallback() const;
174 SpacingCallbackType GetSpacingCallback() const;
175 OriginCallbackType GetOriginCallback() const;
176 DirectionCallbackType GetDirectionCallback() const;
177 ScalarTypeCallbackType GetScalarTypeCallback() const;
178 NumberOfComponentsCallbackType GetNumberOfComponentsCallback() const;
179 PropagateUpdateExtentCallbackType GetPropagateUpdateExtentCallback() const;
180 UpdateDataCallbackType GetUpdateDataCallback() const;
181 DataExtentCallbackType GetDataExtentCallback() const;
182 BufferPointerCallbackType GetBufferPointerCallback() const;
184
185protected:
187 ~vtkImageExport() override;
188
189 // This is called by the superclass.
191 vtkInformationVector* outputVector) override;
192
195 virtual void UpdateDataCallback();
196 virtual int* WholeExtentCallback();
197 virtual double* SpacingCallback();
198 virtual double* OriginCallback();
199 virtual double* DirectionCallback();
200 virtual const char* ScalarTypeCallback();
203 virtual int* DataExtentCallback();
204 virtual void* BufferPointerCallback();
205
207 int DataDimensions[3];
209
211
212private:
213 vtkImageExport(const vtkImageExport&) = delete;
214 void operator=(const vtkImageExport&) = delete;
215
216 static void UpdateInformationCallbackFunction(void*);
217 static int PipelineModifiedCallbackFunction(void*);
218 static int* WholeExtentCallbackFunction(void*);
219 static double* SpacingCallbackFunction(void*);
220 static double* OriginCallbackFunction(void*);
221 static double* DirectionCallbackFunction(void*);
222 static const char* ScalarTypeCallbackFunction(void*);
223 static int NumberOfComponentsCallbackFunction(void*);
224 static void PropagateUpdateExtentCallbackFunction(void*, int*);
225 static void UpdateDataCallbackFunction(void*);
226 static int* DataExtentCallbackFunction(void*);
227 static void* BufferPointerCallbackFunction(void*);
228
231};
232
233VTK_ABI_NAMESPACE_END
234#endif
Superclass for all sources, filters, and sinks in VTK.
vtkInformation * GetInputInformation()
Equivalent to GetInputInformation(0, 0)
vtkAlgorithm * GetInputAlgorithm()
Equivalent to GetInputAlgorithm(0, 0).
Generic algorithm superclass for image algs.
topologically and geometrically regular array of data
Export VTK images to third-party systems.
void * GetPointerToData()
An alternative to Export(): Use with caution.
WholeExtentCallbackType GetWholeExtentCallback() const
Get pointers to the pipeline interface callbacks.
DataExtentCallbackType GetDataExtentCallback() const
Get pointers to the pipeline interface callbacks.
virtual int * DataExtentCallback()
int GetDataNumberOfScalarComponents()
Get the number of scalar components of the data.
NumberOfComponentsCallbackType GetNumberOfComponentsCallback() const
Get pointers to the pipeline interface callbacks.
int GetDataScalarType()
Get the scalar type of the data.
vtkTypeBool ImageLowerLeft
virtual void Export(void *)
The main interface: update the pipeline and export the image to the memory pointed to by SetExportVoi...
BufferPointerCallbackType GetBufferPointerCallback() const
Get pointers to the pipeline interface callbacks.
PipelineModifiedCallbackType GetPipelineModifiedCallback() const
Get pointers to the pipeline interface callbacks.
const char * GetDataScalarTypeAsString()
PropagateUpdateExtentCallbackType GetPropagateUpdateExtentCallback() const
Get pointers to the pipeline interface callbacks.
OriginCallbackType GetOriginCallback() const
Get pointers to the pipeline interface callbacks.
virtual int NumberOfComponentsCallback()
virtual double * OriginCallback()
virtual double * SpacingCallback()
UpdateDataCallbackType GetUpdateDataCallback() const
Get pointers to the pipeline interface callbacks.
static vtkImageExport * New()
ScalarTypeCallbackType GetScalarTypeCallback() const
Get pointers to the pipeline interface callbacks.
SpacingCallbackType GetSpacingCallback() const
Get pointers to the pipeline interface callbacks.
virtual int * WholeExtentCallback()
vtkIdType GetDataMemorySize()
Get the number of bytes required for the output C array.
virtual void * BufferPointerCallback()
int * GetDataExtent()
Get miscellaneous additional information about the data.
void Export()
The main interface: update the pipeline and export the image to the memory pointed to by SetExportVoi...
int * GetDataDimensions()
Get the (x,y,z) index dimensions of the data.
virtual double * DirectionCallback()
~vtkImageExport() override
virtual void UpdateDataCallback()
vtkMTimeType LastPipelineMTime
virtual void PropagateUpdateExtentCallback(int *)
virtual const char * ScalarTypeCallback()
void GetDataDimensions(int *ptr)
Get the (x,y,z) index dimensions of the data.
DirectionCallbackType GetDirectionCallback() const
Get pointers to the pipeline interface callbacks.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called in response to a REQUEST_DATA request from the executive.
UpdateInformationCallbackType GetUpdateInformationCallback() const
Get pointers to the pipeline interface callbacks.
void * GetCallbackUserData()
Get the user data that should be passed to the callback functions.
virtual int PipelineModifiedCallback()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void UpdateInformationCallback()
a simple class to control print indentation
Definition vtkIndent.h:38
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:315
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:270
#define VTK_SIZEHINT(...)