VTK  9.4.20241218
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
42#ifndef vtkImageExport_h
43#define vtkImageExport_h
44
45#include "vtkIOImageModule.h" // For export macro
46#include "vtkImageAlgorithm.h"
47
48VTK_ABI_NAMESPACE_BEGIN
49class VTKIOIMAGE_EXPORT vtkImageExport : public vtkImageAlgorithm
50{
51public:
54 void PrintSelf(ostream& os, vtkIndent indent) override;
55
60
62
66 void GetDataDimensions(int* ptr);
68 {
69 this->GetDataDimensions(this->DataDimensions);
70 return this->DataDimensions;
71 }
73
80
87 {
88 return vtkImageScalarTypeNameMacro(this->GetDataScalarType());
89 }
90
92
96 void GetDataExtent(int* ptr);
97 double* GetDataSpacing() VTK_SIZEHINT(3);
98 void GetDataSpacing(double* ptr);
99 double* GetDataOrigin() VTK_SIZEHINT(3);
100 void GetDataOrigin(double* ptr);
101 double* GetDataDirection() VTK_SIZEHINT(9);
102 void GetDataDirection(double* ptr);
104
108 vtkImageData* GetInput();
109
111
119 vtkBooleanMacro(ImageLowerLeft, vtkTypeBool);
120 vtkGetMacro(ImageLowerLeft, vtkTypeBool);
121 vtkSetMacro(ImageLowerLeft, vtkTypeBool);
123
125
130 void SetExportVoidPointer(void*);
131 void* GetExportVoidPointer() { return this->ExportVoidPointer; }
133
135
140 void Export() { this->Export(this->ExportVoidPointer); }
141 virtual void Export(void*);
143
152
157
159
163 typedef void (*UpdateInformationCallbackType)(void*);
164 typedef int (*PipelineModifiedCallbackType)(void*);
165 typedef int* (*WholeExtentCallbackType)(void*);
166 typedef double* (*SpacingCallbackType)(void*);
167 typedef double* (*OriginCallbackType)(void*);
168 typedef double* (*DirectionCallbackType)(void*);
169 typedef const char* (*ScalarTypeCallbackType)(void*);
170 typedef int (*NumberOfComponentsCallbackType)(void*);
171 typedef void (*PropagateUpdateExtentCallbackType)(void*, int*);
172 typedef void (*UpdateDataCallbackType)(void*);
173 typedef int* (*DataExtentCallbackType)(void*);
174 typedef void* (*BufferPointerCallbackType)(void*);
176
178
181 UpdateInformationCallbackType GetUpdateInformationCallback() const;
182 PipelineModifiedCallbackType GetPipelineModifiedCallback() const;
183 WholeExtentCallbackType GetWholeExtentCallback() const;
184 SpacingCallbackType GetSpacingCallback() const;
185 OriginCallbackType GetOriginCallback() const;
186 DirectionCallbackType GetDirectionCallback() const;
187 ScalarTypeCallbackType GetScalarTypeCallback() const;
188 NumberOfComponentsCallbackType GetNumberOfComponentsCallback() const;
189 PropagateUpdateExtentCallbackType GetPropagateUpdateExtentCallback() const;
190 UpdateDataCallbackType GetUpdateDataCallback() const;
191 DataExtentCallbackType GetDataExtentCallback() const;
192 BufferPointerCallbackType GetBufferPointerCallback() const;
194
195protected:
197 ~vtkImageExport() override;
198
199 // This is called by the superclass.
201 vtkInformationVector* outputVector) override;
202
205 virtual void UpdateDataCallback();
206 virtual int* WholeExtentCallback();
207 virtual double* SpacingCallback();
208 virtual double* OriginCallback();
209 virtual double* DirectionCallback();
210 virtual const char* ScalarTypeCallback();
213 virtual int* DataExtentCallback();
214 virtual void* BufferPointerCallback();
215
217 int DataDimensions[3];
219
221
222private:
223 vtkImageExport(const vtkImageExport&) = delete;
224 void operator=(const vtkImageExport&) = delete;
225
226 static void UpdateInformationCallbackFunction(void*);
227 static int PipelineModifiedCallbackFunction(void*);
228 static int* WholeExtentCallbackFunction(void*);
229 static double* SpacingCallbackFunction(void*);
230 static double* OriginCallbackFunction(void*);
231 static double* DirectionCallbackFunction(void*);
232 static const char* ScalarTypeCallbackFunction(void*);
233 static int NumberOfComponentsCallbackFunction(void*);
234 static void PropagateUpdateExtentCallbackFunction(void*, int*);
235 static void UpdateDataCallbackFunction(void*);
236 static int* DataExtentCallbackFunction(void*);
237 static void* BufferPointerCallbackFunction(void*);
238
241};
242
243VTK_ABI_NAMESPACE_END
244#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:108
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(...)