VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkImageCast.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 =========================================================================*/ 00038 #ifndef __vtkImageCast_h 00039 #define __vtkImageCast_h 00040 00041 00042 #include "vtkImagingCoreModule.h" // For export macro 00043 #include "vtkThreadedImageAlgorithm.h" 00044 00045 class VTKIMAGINGCORE_EXPORT vtkImageCast : public vtkThreadedImageAlgorithm 00046 { 00047 public: 00048 static vtkImageCast *New(); 00049 vtkTypeMacro(vtkImageCast,vtkThreadedImageAlgorithm); 00050 void PrintSelf(ostream& os, vtkIndent indent); 00051 00053 00054 vtkSetMacro(OutputScalarType,int); 00055 vtkGetMacro(OutputScalarType,int); 00056 void SetOutputScalarTypeToFloat(){this->SetOutputScalarType(VTK_FLOAT);}; 00057 void SetOutputScalarTypeToDouble(){this->SetOutputScalarType(VTK_DOUBLE);}; 00058 void SetOutputScalarTypeToInt(){this->SetOutputScalarType(VTK_INT);}; 00059 void SetOutputScalarTypeToUnsignedInt() 00060 {this->SetOutputScalarType(VTK_UNSIGNED_INT);}; 00061 void SetOutputScalarTypeToLong(){this->SetOutputScalarType(VTK_LONG);}; 00062 void SetOutputScalarTypeToUnsignedLong() 00063 {this->SetOutputScalarType(VTK_UNSIGNED_LONG);}; 00064 void SetOutputScalarTypeToShort(){this->SetOutputScalarType(VTK_SHORT);}; 00065 void SetOutputScalarTypeToUnsignedShort() 00066 {this->SetOutputScalarType(VTK_UNSIGNED_SHORT);}; 00067 void SetOutputScalarTypeToUnsignedChar() 00068 {this->SetOutputScalarType(VTK_UNSIGNED_CHAR);}; 00069 void SetOutputScalarTypeToChar() 00070 {this->SetOutputScalarType(VTK_CHAR);}; 00072 00074 00077 vtkSetMacro(ClampOverflow, int); 00078 vtkGetMacro(ClampOverflow, int); 00079 vtkBooleanMacro(ClampOverflow, int); 00081 00082 00083 protected: 00084 vtkImageCast(); 00085 ~vtkImageCast() {}; 00086 00087 int ClampOverflow; 00088 int OutputScalarType; 00089 virtual int RequestInformation (vtkInformation *, vtkInformationVector**, vtkInformationVector *); 00090 00091 void ThreadedExecute (vtkImageData *inData, vtkImageData *outData, 00092 int ext[6], int id); 00093 00094 private: 00095 vtkImageCast(const vtkImageCast&); // Not implemented. 00096 void operator=(const vtkImageCast&); // Not implemented. 00097 }; 00098 00099 #endif 00100 00101 00102 00103