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 "vtkRenderingCoreModule.h" // For export macro
55 #include "vtkImageAlgorithm.h"
56 
57 class vtkImageData;
58 class vtkScalarsToColors;
59 class vtkRenderer;
61 class vtkWindow;
62 class vtkDataArray;
63 class vtkTransform;
64 
65 #define VTK_TEXTURE_QUALITY_DEFAULT 0
66 #define VTK_TEXTURE_QUALITY_16BIT 16
67 #define VTK_TEXTURE_QUALITY_32BIT 32
68 
70 {
71 public:
72  static vtkTexture* New();
74  void PrintSelf(ostream& os, vtkIndent indent);
75 
79  virtual void Render(vtkRenderer* ren);
80 
83  virtual void PostRender(vtkRenderer*) {}
84 
89 
93  virtual void Load(vtkRenderer*) {}
94 
96 
98  vtkGetMacro(Repeat, int);
99  vtkSetMacro(Repeat, int);
100  vtkBooleanMacro(Repeat, int);
102 
104 
107  vtkGetMacro(EdgeClamp, int);
108  vtkSetMacro(EdgeClamp, int);
109  vtkBooleanMacro(EdgeClamp, int);
111 
113 
114  vtkGetMacro(Interpolate, int);
115  vtkSetMacro(Interpolate, int);
116  vtkBooleanMacro(Interpolate, int);
118 
120 
122  vtkSetMacro(Quality, int);
123  vtkGetMacro(Quality, int);
125  { this->SetQuality(VTK_TEXTURE_QUALITY_DEFAULT); }
127  { this->SetQuality(VTK_TEXTURE_QUALITY_16BIT); }
129  { this->SetQuality(VTK_TEXTURE_QUALITY_32BIT); }
131 
133 
139  vtkGetMacro(MapColorScalarsThroughLookupTable, int);
140  vtkSetMacro(MapColorScalarsThroughLookupTable, int);
141  vtkBooleanMacro(MapColorScalarsThroughLookupTable, int);
143 
144 //BTX
146 
149 //ETX
151 
153 
154  void SetLookupTable(vtkScalarsToColors *);
157 
159 
160  vtkGetObjectMacro(MappedScalars, vtkUnsignedCharArray);
162 
164  unsigned char* MapScalarsToColors(vtkDataArray* scalars);
165 
167 
169  void SetTransform(vtkTransform *transform);
172 
173 //BTX
175 
178  {
179  VTK_TEXTURE_BLENDING_MODE_NONE = 0,
185  VTK_TEXTURE_BLENDING_MODE_SUBTRACT
186  };
187 //ETX
189 
191 
193  vtkGetMacro(BlendingMode, int);
194  vtkSetMacro(BlendingMode, int);
196 
198 
200  vtkGetMacro(PremultipliedAlpha, bool);
201  vtkSetMacro(PremultipliedAlpha, bool);
202  vtkBooleanMacro(PremultipliedAlpha, bool);
204 
206 
211  vtkGetMacro(RestrictPowerOf2ImageSmaller, int);
212  vtkSetMacro(RestrictPowerOf2ImageSmaller, int);
213  vtkBooleanMacro(RestrictPowerOf2ImageSmaller, int);
215 
219  virtual int IsTranslucent();
220 
221 protected:
222  vtkTexture();
223  ~vtkTexture();
224 
225  int Repeat;
228  int Quality;
233 
236  // this is to duplicated the previous behavior of SelfCreatedLookUpTable
239 
240  // the result of HasTranslucentPolygonalGeometry is cached
243 
244 private:
245  vtkTexture(const vtkTexture&); // Not implemented.
246  void operator=(const vtkTexture&); // Not implemented.
247 };
248 
249 #endif
GLuint GLenum GLenum transform
Definition: vtkgl.h:16451
virtual void PostRender(vtkRenderer *)
Definition: vtkTexture.h:83
VTKTextureBlendingMode
Definition: vtkTexture.h:177
#define VTK_TEXTURE_QUALITY_16BIT
Definition: vtkTexture.h:66
void SetQualityTo16Bit()
Definition: vtkTexture.h:126
int Interpolate
Definition: vtkTexture.h:227
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:83
record modification and/or execution time
Definition: vtkTimeStamp.h:34
vtkScalarsToColors * LookupTable
Definition: vtkTexture.h:230
int TranslucentCachedResult
Definition: vtkTexture.h:242
bool PremultipliedAlpha
Definition: vtkTexture.h:238
virtual void ReleaseGraphicsResources(vtkWindow *)
Definition: vtkTexture.h:88
vtkDataObject * GetInput()
abstract specification for renderers
Definition: vtkRenderer.h:63
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:59
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
virtual void Load(vtkRenderer *)
Definition: vtkTexture.h:93
#define VTK_TEXTURE_QUALITY_DEFAULT
Definition: vtkTexture.h:65
Superclass for mapping scalar values to colors.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:33
int MapColorScalarsThroughLookupTable
Definition: vtkTexture.h:229
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkTransform * Transform
Definition: vtkTexture.h:232
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
vtkTimeStamp TranslucentComputationTime
Definition: vtkTexture.h:241
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:53
handles properties associated with a texture map
Definition: vtkTexture.h:69
void SetQualityToDefault()
Definition: vtkTexture.h:124
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:222
vtkUnsignedCharArray * MappedScalars
Definition: vtkTexture.h:231
dynamic, self-adjusting array of unsigned char
int SelfAdjustingTableRange
Definition: vtkTexture.h:237
int EdgeClamp
Definition: vtkTexture.h:226
void SetQualityTo32Bit()
Definition: vtkTexture.h:128
#define VTKRENDERINGCORE_EXPORT
int RestrictPowerOf2ImageSmaller
Definition: vtkTexture.h:235
Generic algorithm superclass for image algs.
void PrintSelf(ostream &os, vtkIndent indent)
static vtkAlgorithm * New()
#define vtkBooleanMacro(name, type)
Definition: vtkSetGet.h:234
#define VTK_TEXTURE_QUALITY_32BIT
Definition: vtkTexture.h:67
int BlendingMode
Definition: vtkTexture.h:234
#define vtkSetMacro(name, type)
Definition: vtkSetGet.h:69