VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkTexture.h,v $ 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 =========================================================================*/ 00047 #ifndef __vtkTexture_h 00048 #define __vtkTexture_h 00049 00050 #include "vtkImageAlgorithm.h" 00051 00052 class vtkImageData; 00053 class vtkScalarsToColors; 00054 class vtkRenderer; 00055 class vtkUnsignedCharArray; 00056 class vtkWindow; 00057 class vtkDataArray; 00058 class vtkTransform; 00059 00060 #define VTK_TEXTURE_QUALITY_DEFAULT 0 00061 #define VTK_TEXTURE_QUALITY_16BIT 16 00062 #define VTK_TEXTURE_QUALITY_32BIT 32 00063 00064 class VTK_RENDERING_EXPORT vtkTexture : public vtkImageAlgorithm 00065 { 00066 public: 00067 static vtkTexture *New(); 00068 vtkTypeRevisionMacro(vtkTexture,vtkImageAlgorithm); 00069 void PrintSelf(ostream& os, vtkIndent indent); 00070 00074 virtual void Render(vtkRenderer *ren); 00075 00079 virtual void ReleaseGraphicsResources(vtkWindow *) {}; 00080 00084 virtual void Load(vtkRenderer *) {}; 00085 00087 00089 vtkGetMacro(Repeat,int); 00090 vtkSetMacro(Repeat,int); 00091 vtkBooleanMacro(Repeat,int); 00093 00095 00098 vtkGetMacro(EdgeClamp,int); 00099 vtkSetMacro(EdgeClamp,int); 00100 vtkBooleanMacro(EdgeClamp,int); 00102 00104 00105 vtkGetMacro(Interpolate,int); 00106 vtkSetMacro(Interpolate,int); 00107 vtkBooleanMacro(Interpolate,int); 00109 00111 00113 vtkSetMacro(Quality,int); 00114 vtkGetMacro(Quality,int); 00115 void SetQualityToDefault() {this->SetQuality(VTK_TEXTURE_QUALITY_DEFAULT);}; 00116 void SetQualityTo16Bit() {this->SetQuality(VTK_TEXTURE_QUALITY_16BIT);}; 00117 void SetQualityTo32Bit() {this->SetQuality(VTK_TEXTURE_QUALITY_32BIT);}; 00119 00121 00127 vtkGetMacro(MapColorScalarsThroughLookupTable,int); 00128 vtkSetMacro(MapColorScalarsThroughLookupTable,int); 00129 vtkBooleanMacro(MapColorScalarsThroughLookupTable,int); 00131 00132 //BTX 00135 vtkImageData *GetInput(); 00136 //ETX 00137 00139 00140 void SetLookupTable(vtkScalarsToColors *); 00141 vtkGetObjectMacro(LookupTable,vtkScalarsToColors); 00143 00145 00146 vtkGetObjectMacro(MappedScalars,vtkUnsignedCharArray); 00148 00150 unsigned char *MapScalarsToColors (vtkDataArray *scalars); 00151 00153 00155 void SetTransform(vtkTransform *transform); 00156 vtkGetObjectMacro(Transform, vtkTransform); 00158 00160 00163 enum VTKTextureBlendingMode 00164 { 00165 VTK_TEXTURE_BLENDING_MODE_NONE = 0, 00166 VTK_TEXTURE_BLENDING_MODE_REPLACE, 00167 VTK_TEXTURE_BLENDING_MODE_MODULATE, 00168 VTK_TEXTURE_BLENDING_MODE_ADD, 00169 VTK_TEXTURE_BLENDING_MODE_ADD_SIGNED, 00170 VTK_TEXTURE_BLENDING_MODE_INTERPOLATE, 00171 VTK_TEXTURE_BLENDING_MODE_SUBTRACT 00172 }; 00173 //ETX 00175 00177 00179 vtkGetMacro(BlendingMode, int); 00180 vtkSetMacro(BlendingMode, int); 00182 00184 00189 vtkGetMacro(RestrictPowerOf2ImageSmaller,int); 00190 vtkSetMacro(RestrictPowerOf2ImageSmaller,int); 00191 vtkBooleanMacro(RestrictPowerOf2ImageSmaller,int); 00193 protected: 00194 vtkTexture(); 00195 ~vtkTexture(); 00196 00197 int Repeat; 00198 int EdgeClamp; 00199 int Interpolate; 00200 int Quality; 00201 int MapColorScalarsThroughLookupTable; 00202 vtkScalarsToColors *LookupTable; 00203 vtkUnsignedCharArray *MappedScalars; 00204 vtkTransform *Transform; 00205 00206 int BlendingMode; 00207 int RestrictPowerOf2ImageSmaller; 00208 // this is to duplicated the previous behavior of SelfCreatedLookUpTable 00209 int SelfAdjustingTableRange; 00210 private: 00211 vtkTexture(const vtkTexture&); // Not implemented. 00212 void operator=(const vtkTexture&); // Not implemented. 00213 }; 00214 00215 #endif