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 =========================================================================*/
35 #ifndef vtkImageExport_h
36 #define vtkImageExport_h
37 
38 #include "vtkIOImageModule.h" // For export macro
39 #include "vtkImageAlgorithm.h"
40 
41 class VTKIOIMAGE_EXPORT vtkImageExport : public vtkImageAlgorithm
42 {
43 public:
44  static vtkImageExport *New();
46  void PrintSelf(ostream& os, vtkIndent indent);
47 
52 
54 
58  void GetDataDimensions(int *ptr);
60  this->GetDataDimensions(this->DataDimensions);
61  return this->DataDimensions; }
63 
70 
76  const char *GetDataScalarTypeAsString() {
77  return vtkImageScalarTypeNameMacro(this->GetDataScalarType()); }
78 
80 
83  int *GetDataExtent();
84  void GetDataExtent(int *ptr);
85  double *GetDataSpacing();
86  void GetDataSpacing(double *ptr);
87  double *GetDataOrigin();
88  void GetDataOrigin(double *ptr);
90 
95 
97 
105  vtkBooleanMacro(ImageLowerLeft, int);
106  vtkGetMacro(ImageLowerLeft, int);
107  vtkSetMacro(ImageLowerLeft, int);
109 
111 
116  void SetExportVoidPointer(void *);
117  void *GetExportVoidPointer() { return this->ExportVoidPointer; };
119 
121 
126  void Export() { this->Export(this->ExportVoidPointer); };
127  virtual void Export(void *);
129 
138 
143 
145 
149  typedef void (*UpdateInformationCallbackType)(void*);
150  typedef int (*PipelineModifiedCallbackType)(void*);
151  typedef int* (*WholeExtentCallbackType)(void*);
152  typedef double* (*SpacingCallbackType)(void*);
153  typedef double* (*OriginCallbackType)(void*);
154  typedef const char* (*ScalarTypeCallbackType)(void*);
155  typedef int (*NumberOfComponentsCallbackType)(void*);
156  typedef void (*PropagateUpdateExtentCallbackType)(void*, int*);
157  typedef void (*UpdateDataCallbackType)(void*);
158  typedef int* (*DataExtentCallbackType)(void*);
159  typedef void* (*BufferPointerCallbackType)(void*);
161 
163 
166  UpdateInformationCallbackType GetUpdateInformationCallback() const;
167  PipelineModifiedCallbackType GetPipelineModifiedCallback() const;
168  WholeExtentCallbackType GetWholeExtentCallback() const;
169  SpacingCallbackType GetSpacingCallback() const;
170  OriginCallbackType GetOriginCallback() const;
171  ScalarTypeCallbackType GetScalarTypeCallback() const;
172  NumberOfComponentsCallbackType GetNumberOfComponentsCallback() const;
173  PropagateUpdateExtentCallbackType GetPropagateUpdateExtentCallback() const;
174  UpdateDataCallbackType GetUpdateDataCallback() const;
175  DataExtentCallbackType GetDataExtentCallback() const;
176  BufferPointerCallbackType GetBufferPointerCallback() const;
178 
179 protected:
182 
183  // This is called by the superclass.
184  virtual int RequestData(vtkInformation *request,
185  vtkInformationVector** inputVector,
186  vtkInformationVector* outputVector);
187 
190  virtual void UpdateDataCallback();
191  virtual int* WholeExtentCallback();
192  virtual double* SpacingCallback();
193  virtual double* OriginCallback();
194  virtual const char* ScalarTypeCallback();
196  virtual void PropagateUpdateExtentCallback(int*);
197  virtual int* DataExtentCallback();
198  virtual void* BufferPointerCallback();
199 
201  int DataDimensions[3];
203 
205 
206 private:
207  vtkImageExport(const vtkImageExport&) VTK_DELETE_FUNCTION;
208  void operator=(const vtkImageExport&) VTK_DELETE_FUNCTION;
209 
210  static void UpdateInformationCallbackFunction(void*);
211  static int PipelineModifiedCallbackFunction(void*);
212  static int* WholeExtentCallbackFunction(void*);
213  static double* SpacingCallbackFunction(void*);
214  static double* OriginCallbackFunction(void*);
215  static const char* ScalarTypeCallbackFunction(void*);
216  static int NumberOfComponentsCallbackFunction(void*);
217  static void PropagateUpdateExtentCallbackFunction(void*, int*);
218  static void UpdateDataCallbackFunction(void*);
219  static int* DataExtentCallbackFunction(void*);
220  static void* BufferPointerCallbackFunction(void*);
221 
224 };
225 
226 #endif
227 
228 
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::GetDataOrigin
double * GetDataOrigin()
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:59
vtkImageExport::ExportVoidPointer
void * ExportVoidPointer
Definition: vtkImageExport.h:202
vtkImageExport::OriginCallback
virtual double * OriginCallback()
vtkIdType
int vtkIdType
Definition: vtkType.h:287
vtkImageExport::GetDataScalarTypeAsString
const char * GetDataScalarTypeAsString()
Definition: vtkImageExport.h:76
vtkImageExport::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkAlgorithm
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:60
vtkImageExport::GetDataExtent
void GetDataExtent(int *ptr)
vtkImageExport::PropagateUpdateExtentCallback
virtual void PropagateUpdateExtentCallback(int *)
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkImageExport::BufferPointerCallback
virtual void * BufferPointerCallback()
vtkImageAlgorithm.h
vtkImageExport::GetWholeExtentCallback
WholeExtentCallbackType GetWholeExtentCallback() const
vtkImageAlgorithm
Generic algorithm superclass for image algs.
Definition: vtkImageAlgorithm.h:41
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.
vtkMTimeType
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
vtkImageExport::DataExtentCallback
virtual int * DataExtentCallback()
vtkImageExport::GetDataOrigin
void GetDataOrigin(double *ptr)
vtkImageExport::GetDataScalarType
int GetDataScalarType()
Get the scalar type of the data.
vtkImageExport::WholeExtentCallback
virtual int * WholeExtentCallback()
vtkImageExport::GetOriginCallback
OriginCallbackType GetOriginCallback() const
vtkImageExport::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called in response to a REQUEST_DATA request from the executive.
vtkImageExport::GetPointerToData
void * GetPointerToData()
An alternative to Export(): Use with caution.
vtkImageExport::SetExportVoidPointer
void SetExportVoidPointer(void *)
Set the void pointer of the C array to export the data to.
vtkImageExport::GetDataSpacing
double * GetDataSpacing()
vtkImageExport::PipelineModifiedCallback
virtual int PipelineModifiedCallback()
vtkImageExport::GetDataSpacing
void GetDataSpacing(double *ptr)
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkImageExport::GetInput
vtkImageData * GetInput()
Get the input object from the image pipeline.
vtkImageExport::UpdateDataCallback
virtual void UpdateDataCallback()
vtkImageExport::GetExportVoidPointer
void * GetExportVoidPointer()
Definition: vtkImageExport.h:117
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.
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkAlgorithm::GetInputInformation
vtkInformation * GetInputInformation()
Equivalent to GetInputInformation(0, 0)
Definition: vtkAlgorithm.h:523
vtkAlgorithm::GetInputAlgorithm
vtkAlgorithm * GetInputAlgorithm()
Equivalent to GetInputAlgorithm(0, 0).
Definition: vtkAlgorithm.h:491
vtkImageExport::LastPipelineMTime
vtkMTimeType LastPipelineMTime
Definition: vtkImageExport.h:204
vtkImageExport::GetUpdateInformationCallback
UpdateInformationCallbackType GetUpdateInformationCallback() const
Get pointers to the pipeline interface callbacks.
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:126
vtkImageExport
Export VTK images to third-party systems.
Definition: vtkImageExport.h:42
vtkImageExport::ImageLowerLeft
int ImageLowerLeft
Definition: vtkImageExport.h:200
vtkImageExport::~vtkImageExport
~vtkImageExport()
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
vtkImageExport::GetBufferPointerCallback
BufferPointerCallbackType GetBufferPointerCallback() const
int
int
Definition: vtkVectorOperators.h:164