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 "vtkAbstractImageInterpolator.h" 00031 00032 class VTK_FILTERING_EXPORT vtkImageInterpolator : 00033 public vtkAbstractImageInterpolator 00034 { 00035 public: 00036 static vtkImageInterpolator *New(); 00037 vtkTypeMacro(vtkImageInterpolator, vtkAbstractImageInterpolator); 00038 virtual void PrintSelf(ostream& os, vtkIndent indent); 00039 00041 00044 virtual void SetInterpolationMode(int mode); 00045 void SetInterpolationModeToNearest() { 00046 this->SetInterpolationMode(VTK_NEAREST_INTERPOLATION); } 00047 void SetInterpolationModeToLinear() { 00048 this->SetInterpolationMode(VTK_LINEAR_INTERPOLATION); } 00049 void SetInterpolationModeToCubic() { 00050 this->SetInterpolationMode(VTK_CUBIC_INTERPOLATION); } 00051 int GetInterpolationMode() { return this->InterpolationMode; } 00052 virtual const char *GetInterpolationModeAsString(); 00054 00060 virtual void ComputeSupportSize(const double matrix[16], int support[3]); 00061 00064 virtual bool IsSeparable(); 00065 00067 00074 virtual void PrecomputeWeightsForExtent( 00075 const double matrix[16], const int extent[6], int newExtent[6], 00076 vtkInterpolationWeights *&weights); 00077 virtual void PrecomputeWeightsForExtent( 00078 const float matrix[16], const int extent[6], int newExtent[6], 00079 vtkInterpolationWeights *&weights); 00081 00083 virtual void FreePrecomputedWeights(vtkInterpolationWeights *&weights); 00084 00085 protected: 00086 vtkImageInterpolator(); 00087 ~vtkImageInterpolator(); 00088 00090 virtual void InternalUpdate(); 00091 00093 virtual void InternalDeepCopy(vtkAbstractImageInterpolator *obj); 00094 00096 00097 virtual void GetInterpolationFunc( 00098 void (**doublefunc)( 00099 vtkInterpolationInfo *, const double [3], double *)); 00100 virtual void GetInterpolationFunc( 00101 void (**floatfunc)( 00102 vtkInterpolationInfo *, const float [3], float *)); 00104 00106 00107 virtual void GetRowInterpolationFunc( 00108 void (**doublefunc)( 00109 vtkInterpolationWeights *, int, int, int, double *, int)); 00110 virtual void GetRowInterpolationFunc( 00111 void (**floatfunc)( 00112 vtkInterpolationWeights *, int, int, int, float *, int)); 00114 00115 int InterpolationMode; 00116 00117 private: 00118 vtkImageInterpolator(const vtkImageInterpolator&); // Not implemented. 00119 void operator=(const vtkImageInterpolator&); // Not implemented. 00120 }; 00121 00122 #endif