00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00048 #ifndef __vtkTexture_h
00049 #define __vtkTexture_h
00050
00051 #include "vtkImageAlgorithm.h"
00052
00053 class vtkImageData;
00054 class vtkScalarsToColors;
00055 class vtkRenderer;
00056 class vtkUnsignedCharArray;
00057 class vtkWindow;
00058 class vtkDataArray;
00059 class vtkTransform;
00060
00061 #define VTK_TEXTURE_QUALITY_DEFAULT 0
00062 #define VTK_TEXTURE_QUALITY_16BIT 16
00063 #define VTK_TEXTURE_QUALITY_32BIT 32
00064
00065 class VTK_RENDERING_EXPORT vtkTexture : public vtkImageAlgorithm
00066 {
00067 public:
00068 static vtkTexture *New();
00069 vtkTypeRevisionMacro(vtkTexture,vtkImageAlgorithm);
00070 void PrintSelf(ostream& os, vtkIndent indent);
00071
00075 virtual void Render(vtkRenderer *ren);
00076
00079 virtual void PostRender(vtkRenderer *) {};
00080
00084 virtual void ReleaseGraphicsResources(vtkWindow *) {};
00085
00089 virtual void Load(vtkRenderer *) {};
00090
00092
00094 vtkGetMacro(Repeat,int);
00095 vtkSetMacro(Repeat,int);
00096 vtkBooleanMacro(Repeat,int);
00098
00100
00103 vtkGetMacro(EdgeClamp,int);
00104 vtkSetMacro(EdgeClamp,int);
00105 vtkBooleanMacro(EdgeClamp,int);
00107
00109
00110 vtkGetMacro(Interpolate,int);
00111 vtkSetMacro(Interpolate,int);
00112 vtkBooleanMacro(Interpolate,int);
00114
00116
00118 vtkSetMacro(Quality,int);
00119 vtkGetMacro(Quality,int);
00120 void SetQualityToDefault() {this->SetQuality(VTK_TEXTURE_QUALITY_DEFAULT);};
00121 void SetQualityTo16Bit() {this->SetQuality(VTK_TEXTURE_QUALITY_16BIT);};
00122 void SetQualityTo32Bit() {this->SetQuality(VTK_TEXTURE_QUALITY_32BIT);};
00124
00126
00132 vtkGetMacro(MapColorScalarsThroughLookupTable,int);
00133 vtkSetMacro(MapColorScalarsThroughLookupTable,int);
00134 vtkBooleanMacro(MapColorScalarsThroughLookupTable,int);
00136
00137
00140 vtkImageData *GetInput();
00141
00142
00144
00145 void SetLookupTable(vtkScalarsToColors *);
00146 vtkGetObjectMacro(LookupTable,vtkScalarsToColors);
00148
00150
00151 vtkGetObjectMacro(MappedScalars,vtkUnsignedCharArray);
00153
00155 unsigned char *MapScalarsToColors (vtkDataArray *scalars);
00156
00158
00160 void SetTransform(vtkTransform *transform);
00161 vtkGetObjectMacro(Transform, vtkTransform);
00163
00165
00168 enum VTKTextureBlendingMode
00169 {
00170 VTK_TEXTURE_BLENDING_MODE_NONE = 0,
00171 VTK_TEXTURE_BLENDING_MODE_REPLACE,
00172 VTK_TEXTURE_BLENDING_MODE_MODULATE,
00173 VTK_TEXTURE_BLENDING_MODE_ADD,
00174 VTK_TEXTURE_BLENDING_MODE_ADD_SIGNED,
00175 VTK_TEXTURE_BLENDING_MODE_INTERPOLATE,
00176 VTK_TEXTURE_BLENDING_MODE_SUBTRACT
00177 };
00178
00180
00182
00184 vtkGetMacro(BlendingMode, int);
00185 vtkSetMacro(BlendingMode, int);
00187
00189
00191 vtkGetMacro(PremultipliedAlpha,bool);
00192 vtkSetMacro(PremultipliedAlpha,bool);
00193 vtkBooleanMacro(PremultipliedAlpha,bool);
00195
00197
00202 vtkGetMacro(RestrictPowerOf2ImageSmaller,int);
00203 vtkSetMacro(RestrictPowerOf2ImageSmaller,int);
00204 vtkBooleanMacro(RestrictPowerOf2ImageSmaller,int);
00206 protected:
00207 vtkTexture();
00208 ~vtkTexture();
00209
00210 int Repeat;
00211 int EdgeClamp;
00212 int Interpolate;
00213 int Quality;
00214 int MapColorScalarsThroughLookupTable;
00215 vtkScalarsToColors *LookupTable;
00216 vtkUnsignedCharArray *MappedScalars;
00217 vtkTransform *Transform;
00218
00219 int BlendingMode;
00220 int RestrictPowerOf2ImageSmaller;
00221
00222 int SelfAdjustingTableRange;
00223 bool PremultipliedAlpha;
00224 private:
00225 vtkTexture(const vtkTexture&);
00226 void operator=(const vtkTexture&);
00227 };
00228
00229 #endif