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 =========================================================================*/ 00033 #ifndef __vtkImageCast_h 00034 #define __vtkImageCast_h 00035 00036 00037 #include "vtkThreadedImageAlgorithm.h" 00038 00039 class VTK_IMAGING_EXPORT vtkImageCast : public vtkThreadedImageAlgorithm 00040 { 00041 public: 00042 static vtkImageCast *New(); 00043 vtkTypeMacro(vtkImageCast,vtkThreadedImageAlgorithm); 00044 void PrintSelf(ostream& os, vtkIndent indent); 00045 00047 00048 vtkSetMacro(OutputScalarType,int); 00049 vtkGetMacro(OutputScalarType,int); 00050 void SetOutputScalarTypeToFloat(){this->SetOutputScalarType(VTK_FLOAT);}; 00051 void SetOutputScalarTypeToDouble(){this->SetOutputScalarType(VTK_DOUBLE);}; 00052 void SetOutputScalarTypeToInt(){this->SetOutputScalarType(VTK_INT);}; 00053 void SetOutputScalarTypeToUnsignedInt() 00054 {this->SetOutputScalarType(VTK_UNSIGNED_INT);}; 00055 void SetOutputScalarTypeToLong(){this->SetOutputScalarType(VTK_LONG);}; 00056 void SetOutputScalarTypeToUnsignedLong() 00057 {this->SetOutputScalarType(VTK_UNSIGNED_LONG);}; 00058 void SetOutputScalarTypeToShort(){this->SetOutputScalarType(VTK_SHORT);}; 00059 void SetOutputScalarTypeToUnsignedShort() 00060 {this->SetOutputScalarType(VTK_UNSIGNED_SHORT);}; 00061 void SetOutputScalarTypeToUnsignedChar() 00062 {this->SetOutputScalarType(VTK_UNSIGNED_CHAR);}; 00063 void SetOutputScalarTypeToChar() 00064 {this->SetOutputScalarType(VTK_CHAR);}; 00066 00068 00071 vtkSetMacro(ClampOverflow, int); 00072 vtkGetMacro(ClampOverflow, int); 00073 vtkBooleanMacro(ClampOverflow, int); 00075 00076 00077 protected: 00078 vtkImageCast(); 00079 ~vtkImageCast() {}; 00080 00081 int ClampOverflow; 00082 int OutputScalarType; 00083 virtual int RequestInformation (vtkInformation *, vtkInformationVector**, vtkInformationVector *); 00084 00085 void ThreadedExecute (vtkImageData *inData, vtkImageData *outData, 00086 int ext[6], int id); 00087 00088 private: 00089 vtkImageCast(const vtkImageCast&); // Not implemented. 00090 void operator=(const vtkImageCast&); // Not implemented. 00091 }; 00092 00093 #endif 00094 00095 00096 00097