VTK
vtkTexture.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTexture.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
51 #ifndef __vtkTexture_h
52 #define __vtkTexture_h
53 
54 #include "vtkImageAlgorithm.h"
55 
56 class vtkImageData;
57 class vtkScalarsToColors;
58 class vtkRenderer;
60 class vtkWindow;
61 class vtkDataArray;
62 class vtkTransform;
63 
64 #define VTK_TEXTURE_QUALITY_DEFAULT 0
65 #define VTK_TEXTURE_QUALITY_16BIT 16
66 #define VTK_TEXTURE_QUALITY_32BIT 32
67 
69 {
70 public:
71  static vtkTexture *New();
73  void PrintSelf(ostream& os, vtkIndent indent);
74 
78  virtual void Render(vtkRenderer *ren);
79 
82  virtual void PostRender(vtkRenderer *) {};
83 
87  virtual void ReleaseGraphicsResources(vtkWindow *) {};
88 
92  virtual void Load(vtkRenderer *) {};
93 
95 
97  vtkGetMacro(Repeat,int);
98  vtkSetMacro(Repeat,int);
99  vtkBooleanMacro(Repeat,int);
101 
103 
106  vtkGetMacro(EdgeClamp,int);
107  vtkSetMacro(EdgeClamp,int);
108  vtkBooleanMacro(EdgeClamp,int);
110 
112 
113  vtkGetMacro(Interpolate,int);
114  vtkSetMacro(Interpolate,int);
115  vtkBooleanMacro(Interpolate,int);
117 
119 
121  vtkSetMacro(Quality,int);
122  vtkGetMacro(Quality,int);
124  void SetQualityTo16Bit() {this->SetQuality(VTK_TEXTURE_QUALITY_16BIT);};
125  void SetQualityTo32Bit() {this->SetQuality(VTK_TEXTURE_QUALITY_32BIT);};
127 
129 
135  vtkGetMacro(MapColorScalarsThroughLookupTable,int);
136  vtkSetMacro(MapColorScalarsThroughLookupTable,int);
137  vtkBooleanMacro(MapColorScalarsThroughLookupTable,int);
139 
140 //BTX
142 
145 //ETX
147 
149 
150  void SetLookupTable(vtkScalarsToColors *);
151  vtkGetObjectMacro(LookupTable,vtkScalarsToColors);
153 
155 
156  vtkGetObjectMacro(MappedScalars,vtkUnsignedCharArray);
158 
160  unsigned char *MapScalarsToColors (vtkDataArray *scalars);
161 
163 
165  void SetTransform(vtkTransform *transform);
166  vtkGetObjectMacro(Transform, vtkTransform);
168 
169 //BTX
171 
174  {
175  VTK_TEXTURE_BLENDING_MODE_NONE = 0,
181  VTK_TEXTURE_BLENDING_MODE_SUBTRACT
182  };
183 //ETX
185 
187 
189  vtkGetMacro(BlendingMode, int);
190  vtkSetMacro(BlendingMode, int);
192 
194 
196  vtkGetMacro(PremultipliedAlpha,bool);
197  vtkSetMacro(PremultipliedAlpha,bool);
198  vtkBooleanMacro(PremultipliedAlpha,bool);
200 
202 
207  vtkGetMacro(RestrictPowerOf2ImageSmaller,int);
208  vtkSetMacro(RestrictPowerOf2ImageSmaller,int);
209  vtkBooleanMacro(RestrictPowerOf2ImageSmaller,int);
211 
215  virtual int IsTranslucent();
216 
217 protected:
218  vtkTexture();
219  ~vtkTexture();
220 
221  int Repeat;
224  int Quality;
229 
232  // this is to duplicated the previous behavior of SelfCreatedLookUpTable
235 
236  // the result of HasTranslucentPolygonalGeometry is cached
239 
240 private:
241  vtkTexture(const vtkTexture&); // Not implemented.
242  void operator=(const vtkTexture&); // Not implemented.
243 };
244 
245 #endif
virtual void PostRender(vtkRenderer *)
Definition: vtkTexture.h:82
VTKTextureBlendingMode
Definition: vtkTexture.h:173
#define VTK_TEXTURE_QUALITY_16BIT
Definition: vtkTexture.h:65
void SetQualityTo16Bit()
Definition: vtkTexture.h:124
int Interpolate
Definition: vtkTexture.h:223
record modification and/or execution time
Definition: vtkTimeStamp.h:33
vtkScalarsToColors * LookupTable
Definition: vtkTexture.h:226
int TranslucentCachedResult
Definition: vtkTexture.h:238
bool PremultipliedAlpha
Definition: vtkTexture.h:234
virtual void ReleaseGraphicsResources(vtkWindow *)
Definition: vtkTexture.h:87
vtkDataObject * GetInput()
abstract specification for renderers
Definition: vtkRenderer.h:69
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:58
virtual void Load(vtkRenderer *)
Definition: vtkTexture.h:92
#define VTK_TEXTURE_QUALITY_DEFAULT
Definition: vtkTexture.h:64
Superclass for mapping scalar values into colors.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
int MapColorScalarsThroughLookupTable
Definition: vtkTexture.h:225
a simple class to control print indentation
Definition: vtkIndent.h:37
vtkTransform * Transform
Definition: vtkTexture.h:228
topologically and geometrically regular array of data
Definition: vtkImageData.h:43
vtkTimeStamp TranslucentComputationTime
Definition: vtkTexture.h:237
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:53
handles properties associated with a texture map
Definition: vtkTexture.h:68
void SetQualityToDefault()
Definition: vtkTexture.h:123
vtkUnsignedCharArray * MappedScalars
Definition: vtkTexture.h:227
dynamic, self-adjusting array of unsigned char
#define VTK_RENDERING_EXPORT
int SelfAdjustingTableRange
Definition: vtkTexture.h:233
int EdgeClamp
Definition: vtkTexture.h:222
void SetQualityTo32Bit()
Definition: vtkTexture.h:125
int RestrictPowerOf2ImageSmaller
Definition: vtkTexture.h:231
Generic algorithm superclass for image algs.
void PrintSelf(ostream &os, vtkIndent indent)
static vtkAlgorithm * New()
#define VTK_TEXTURE_QUALITY_32BIT
Definition: vtkTexture.h:66
int BlendingMode
Definition: vtkTexture.h:230