VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkImageInterpolator.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00027 #ifndef __vtkImageInterpolator_h 00028 #define __vtkImageInterpolator_h 00029 00030 #include "vtkImagingCoreModule.h" // For export macro 00031 #include "vtkAbstractImageInterpolator.h" 00032 00033 class VTKIMAGINGCORE_EXPORT vtkImageInterpolator : 00034 public vtkAbstractImageInterpolator 00035 { 00036 public: 00037 static vtkImageInterpolator *New(); 00038 vtkTypeMacro(vtkImageInterpolator, vtkAbstractImageInterpolator); 00039 virtual void PrintSelf(ostream& os, vtkIndent indent); 00040 00042 00045 virtual void SetInterpolationMode(int mode); 00046 void SetInterpolationModeToNearest() { 00047 this->SetInterpolationMode(VTK_NEAREST_INTERPOLATION); } 00048 void SetInterpolationModeToLinear() { 00049 this->SetInterpolationMode(VTK_LINEAR_INTERPOLATION); } 00050 void SetInterpolationModeToCubic() { 00051 this->SetInterpolationMode(VTK_CUBIC_INTERPOLATION); } 00052 int GetInterpolationMode() { return this->InterpolationMode; } 00053 virtual const char *GetInterpolationModeAsString(); 00055 00061 virtual void ComputeSupportSize(const double matrix[16], int support[3]); 00062 00065 virtual bool IsSeparable(); 00066 00068 00075 virtual void PrecomputeWeightsForExtent( 00076 const double matrix[16], const int extent[6], int newExtent[6], 00077 vtkInterpolationWeights *&weights); 00078 virtual void PrecomputeWeightsForExtent( 00079 const float matrix[16], const int extent[6], int newExtent[6], 00080 vtkInterpolationWeights *&weights); 00082 00084 virtual void FreePrecomputedWeights(vtkInterpolationWeights *&weights); 00085 00086 protected: 00087 vtkImageInterpolator(); 00088 ~vtkImageInterpolator(); 00089 00091 virtual void InternalUpdate(); 00092 00094 virtual void InternalDeepCopy(vtkAbstractImageInterpolator *obj); 00095 00097 00098 virtual void GetInterpolationFunc( 00099 void (**doublefunc)( 00100 vtkInterpolationInfo *, const double [3], double *)); 00101 virtual void GetInterpolationFunc( 00102 void (**floatfunc)( 00103 vtkInterpolationInfo *, const float [3], float *)); 00105 00107 00108 virtual void GetRowInterpolationFunc( 00109 void (**doublefunc)( 00110 vtkInterpolationWeights *, int, int, int, double *, int)); 00111 virtual void GetRowInterpolationFunc( 00112 void (**floatfunc)( 00113 vtkInterpolationWeights *, int, int, int, float *, int)); 00115 00116 int InterpolationMode; 00117 00118 private: 00119 vtkImageInterpolator(const vtkImageInterpolator&); // Not implemented. 00120 void operator=(const vtkImageInterpolator&); // Not implemented. 00121 }; 00122 00123 #endif