VTK
vtkLineIntegralConvolution2D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkLineIntegralConvolution2D.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 =========================================================================*/
92 #ifndef vtkLineIntegralConvolution2D_h
93 #define vtkLineIntegralConvolution2D_h
94 
95 #include "vtkObject.h"
96 #include "vtkWeakPointer.h" // for ren context
97 #include "vtkRenderingLICOpenGL2Module.h" // for export macro
98 #include <deque> // for deque
99 
101 class vtkOpenGLHelper;
104 class vtkPixelExtent;
105 class vtkRenderWindow;
106 class vtkShaderProgram;
107 class vtkTextureObject;
108 
109 class VTKRENDERINGLICOPENGL2_EXPORT vtkLineIntegralConvolution2D : public vtkObject
110 {
111 public:
114  void PrintSelf(ostream & os, vtkIndent indent) override;
115 
119  static bool IsSupported(vtkRenderWindow * renWin);
120 
122 
129 
131 
136  vtkSetClampMacro(EnhancedLIC, int, 0, 1);
137  vtkGetMacro(EnhancedLIC, int);
138  vtkBooleanMacro(EnhancedLIC, int);
140 
142 
163  enum {
164  ENHANCE_CONTRAST_OFF=0,
165  ENHANCE_CONTRAST_ON=1};
166  vtkSetClampMacro(EnhanceContrast, int, 0, 2);
167  vtkGetMacro(EnhanceContrast, int);
168  vtkBooleanMacro(EnhanceContrast, int);
170 
172 
189  vtkSetClampMacro(LowContrastEnhancementFactor, double, 0.0, 1.0);
190  vtkGetMacro(LowContrastEnhancementFactor, double);
191  vtkSetClampMacro(HighContrastEnhancementFactor, double, 0.0, 1.0);
192  vtkGetMacro(HighContrastEnhancementFactor, double);
194 
196 
202  vtkSetClampMacro(AntiAlias, int, 0, VTK_INT_MAX);
203  vtkGetMacro(AntiAlias, int);
204  vtkBooleanMacro(AntiAlias, int);
206 
208 
212  vtkSetClampMacro(NumberOfSteps, int, 0, VTK_INT_MAX);
213  vtkGetMacro(NumberOfSteps, int);
215 
217 
224  vtkSetClampMacro(StepSize, double, 0.0, VTK_FLOAT_MAX);
225  vtkGetMacro(StepSize, double);
227 
229 
234  void SetComponentIds(int c0, int c1);
235  void SetComponentIds(int c[2]){ this->SetComponentIds(c[0], c[1]); }
236  vtkGetVector2Macro(ComponentIds, int);
238 
240 
245  vtkSetClampMacro(MaxNoiseValue, double, 0.0, 1.0);
246  vtkGetMacro(MaxNoiseValue, double);
248 
250 
256  void SetTransformVectors(int val);
257  vtkGetMacro(TransformVectors, int);
259 
281  void SetNormalizeVectors(int val);
282  vtkGetMacro(NormalizeVectors, int);
284 
286 
295  vtkSetClampMacro(MaskThreshold, double, -1.0, VTK_FLOAT_MAX);
296  vtkGetMacro(MaskThreshold, double);
298 
299 
304  vtkTextureObject *vectorTex,
305  vtkTextureObject *noiseTex);
306 
312  const int extent[4],
313  vtkTextureObject *vectorTex,
314  vtkTextureObject *noiseTex);
315 
328  const vtkPixelExtent &inputTexExtent,
329  const std::deque<vtkPixelExtent> &vectorExtent,
330  const std::deque<vtkPixelExtent> &licExtent,
331  vtkTextureObject *vectorTex,
332  vtkTextureObject *maskVectorTex,
333  vtkTextureObject *noiseTex);
334 
339  static
341 
342  static
344 
354 
359  virtual void GetGlobalMinMax(
361  float&,
362  float&) {}
363 
370  virtual void WriteTimerLog(const char *){}
371 
372 protected:
375 
377 
386 
387  void BuildShaders();
388 
390  float computeBounds[4],
391  vtkPixelExtent computeExtent);
392 
393  vtkTextureObject *AllocateBuffer(unsigned int texSize[2]);
394 
400 
407  virtual void StartTimerEvent(const char *){}
408  virtual void EndTimerEvent(const char *){}
409 
410 protected:
413 
425 
427  double StepSize;
437  int ComponentIds[2];
439 
440 private:
442  void operator = (const vtkLineIntegralConvolution2D &) = delete;
443 };
444 
445 #endif
vtkLineIntegralConvolution2D::SetVectorTexParameters
static void SetVectorTexParameters(vtkTextureObject *vectors)
Convenience functions to ensure that the input textures are configured correctly.
vtkLineIntegralConvolution2D::LICNShader
vtkOpenGLHelper * LICNShader
Definition: vtkLineIntegralConvolution2D.h:420
vtkLineIntegralConvolution2D::GetCommunicator
virtual vtkPainterCommunicator * GetCommunicator()
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:159
vtkLineIntegralConvolution2D::FinalBlendProgram
vtkOpenGLHelper * FinalBlendProgram
Definition: vtkLineIntegralConvolution2D.h:415
vtkLineIntegralConvolution2D::LIC0Shader
vtkOpenGLHelper * LIC0Shader
Definition: vtkLineIntegralConvolution2D.h:418
vtkLineIntegralConvolution2D::EndTimerEvent
virtual void EndTimerEvent(const char *)
Definition: vtkLineIntegralConvolution2D.h:408
vtkLineIntegralConvolution2D::FBO
vtkOpenGLFramebufferObject * FBO
Definition: vtkLineIntegralConvolution2D.h:412
vtkLineIntegralConvolution2D::Execute
vtkTextureObject * Execute(vtkTextureObject *vectorTex, vtkTextureObject *noiseTex)
Compute the lic on the entire vector field texture.
vtkLineIntegralConvolution2D::SetNoise2TexParameters
void SetNoise2TexParameters(vtkTextureObject *noise)
Convenience functions to ensure that the input textures are configured correctly.
vtkOpenGLFramebufferObject
Internal class which encapsulates OpenGL FramebufferObject.
Definition: vtkOpenGLFramebufferObject.h:183
vtkLineIntegralConvolution2D::Execute
vtkTextureObject * Execute(const vtkPixelExtent &inputTexExtent, const std::deque< vtkPixelExtent > &vectorExtent, const std::deque< vtkPixelExtent > &licExtent, vtkTextureObject *vectorTex, vtkTextureObject *maskVectorTex, vtkTextureObject *noiseTex)
Compute LIC over the desired subset of the input texture.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkLineIntegralConvolution2D::StepSize
double StepSize
Definition: vtkLineIntegralConvolution2D.h:427
vtkLineIntegralConvolution2D::NoiseTextureLookupCompatibilityMode
int NoiseTextureLookupCompatibilityMode
Definition: vtkLineIntegralConvolution2D.h:433
vtkLineIntegralConvolution2D::NormalizeVectors
int NormalizeVectors
Definition: vtkLineIntegralConvolution2D.h:436
vtkLineIntegralConvolution2D::SetComponentIds
void SetComponentIds(int c[2])
Definition: vtkLineIntegralConvolution2D.h:235
vtkLineIntegralConvolution2D::vtkLineIntegralConvolution2D
vtkLineIntegralConvolution2D()
vtkLineIntegralConvolution2D::HighContrastEnhancementFactor
double HighContrastEnhancementFactor
Definition: vtkLineIntegralConvolution2D.h:431
vtkLineIntegralConvolution2D::StartTimerEvent
virtual void StartTimerEvent(const char *)
Methods used for parallel benchmarks.
Definition: vtkLineIntegralConvolution2D.h:407
vtkLineIntegralConvolution2D::SetEEShader
void SetEEShader(vtkShaderProgram *prog)
vtkLineIntegralConvolution2D::SetVTShader
void SetVTShader(vtkShaderProgram *prog)
vtkPixelExtent
Representation of a cartesian pixel plane and common operations on it.
Definition: vtkPixelExtent.h:42
vtkLineIntegralConvolution2D::Execute
vtkTextureObject * Execute(const int extent[4], vtkTextureObject *vectorTex, vtkTextureObject *noiseTex)
Compute the lic on the indicated subset of the vector field texture.
vtkLineIntegralConvolution2D::SetNormalizeVectors
void SetNormalizeVectors(int val)
Set/Get the spacing in each dimension of the plane on which the vector field is defined.
vtkLineIntegralConvolution2D::Context
vtkWeakPointer< vtkOpenGLRenderWindow > Context
Definition: vtkLineIntegralConvolution2D.h:411
vtkLineIntegralConvolution2D::BuildShaders
void BuildShaders()
vtkLineIntegralConvolution2D::Comm
vtkPainterCommunicator * Comm
Definition: vtkLineIntegralConvolution2D.h:376
vtkShaderProgram
The ShaderProgram uses one or more Shader objects.
Definition: vtkShaderProgram.h:48
vtkOpenGLHelper
Definition: vtkOpenGLHelper.h:31
vtkLineIntegralConvolution2D::~vtkLineIntegralConvolution2D
~vtkLineIntegralConvolution2D() override
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkTextureObject
abstracts an OpenGL texture object.
Definition: vtkTextureObject.h:45
vtkLineIntegralConvolution2D::ShadersNeedBuild
int ShadersNeedBuild
Definition: vtkLineIntegralConvolution2D.h:414
vtkLineIntegralConvolution2D::EnhancedLIC
int EnhancedLIC
Definition: vtkLineIntegralConvolution2D.h:428
vtkLineIntegralConvolution2D::SetLICNShader
void SetLICNShader(vtkShaderProgram *prog)
vtkLineIntegralConvolution2D::MaskThreshold
double MaskThreshold
Definition: vtkLineIntegralConvolution2D.h:434
vtkLineIntegralConvolution2D::SetComponentIds
void SetComponentIds(int c0, int c1)
If VectorField has >= 3 components, we must choose which 2 components form the (X,...
vtkLineIntegralConvolution2D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkLineIntegralConvolution2D::SetAAVShader
void SetAAVShader(vtkShaderProgram *prog)
vtkLineIntegralConvolution2D::SetTransformVectors
void SetTransformVectors(int val)
This class performs LIC in the normalized image space.
vtkWeakPointer.h
VTK_FLOAT_MAX
#define VTK_FLOAT_MAX
Definition: vtkType.h:167
vtkLineIntegralConvolution2D::SetContext
void SetContext(vtkOpenGLRenderWindow *context)
Set/Get the rendering context.
vtkLineIntegralConvolution2D::EnhanceContrast
int EnhanceContrast
Definition: vtkLineIntegralConvolution2D.h:429
vtkLineIntegralConvolution2D::SetLIC0Shader
void SetLIC0Shader(vtkShaderProgram *prog)
vtkLineIntegralConvolution2D::GetContext
vtkOpenGLRenderWindow * GetContext()
vtkLineIntegralConvolution2D::LowContrastEnhancementFactor
double LowContrastEnhancementFactor
Definition: vtkLineIntegralConvolution2D.h:430
vtkObject.h
vtkLineIntegralConvolution2D::SetCEShader
void SetCEShader(vtkShaderProgram *prog)
vtkPainterCommunicator
A communicator that can safely be used inside a painter.
Definition: vtkPainterCommunicator.h:31
vtkLineIntegralConvolution2D::EEShader
vtkOpenGLHelper * EEShader
Definition: vtkLineIntegralConvolution2D.h:421
vtkLineIntegralConvolution2D::AAVShader
vtkOpenGLHelper * AAVShader
Definition: vtkLineIntegralConvolution2D.h:424
vtkLineIntegralConvolution2D
GPU-based implementation of Line Integral Convolution (LIC)
Definition: vtkLineIntegralConvolution2D.h:110
vtkLineIntegralConvolution2D::SetAAHShader
void SetAAHShader(vtkShaderProgram *prog)
vtkLineIntegralConvolution2D::AllocateBuffer
vtkTextureObject * AllocateBuffer(unsigned int texSize[2])
vtkLineIntegralConvolution2D::TransformVectors
int TransformVectors
Definition: vtkLineIntegralConvolution2D.h:435
vtkLineIntegralConvolution2D::IntermediateBlendProgram
vtkOpenGLHelper * IntermediateBlendProgram
Definition: vtkLineIntegralConvolution2D.h:416
vtkLineIntegralConvolution2D::LICIShader
vtkOpenGLHelper * LICIShader
Definition: vtkLineIntegralConvolution2D.h:419
vtkLineIntegralConvolution2D::SetLICIShader
void SetLICIShader(vtkShaderProgram *prog)
vtkLineIntegralConvolution2D::IsSupported
static bool IsSupported(vtkRenderWindow *renWin)
Returns if the context supports the required extensions.
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:54
vtkX3D::extent
@ extent
Definition: vtkX3D.h:345
vtkLineIntegralConvolution2D::SetCommunicator
virtual void SetCommunicator(vtkPainterCommunicator *)
Set the communicator to use during parallel operation The communicator will not be duplicated or refe...
Definition: vtkLineIntegralConvolution2D.h:352
vtkLineIntegralConvolution2D::MaxNoiseValue
double MaxNoiseValue
Definition: vtkLineIntegralConvolution2D.h:438
vtkLineIntegralConvolution2D::New
static vtkLineIntegralConvolution2D * New()
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:88
vtkLineIntegralConvolution2D::RenderQuad
void RenderQuad(float computeBounds[4], vtkPixelExtent computeExtent)
vtkLineIntegralConvolution2D::CEShader
vtkOpenGLHelper * CEShader
Definition: vtkLineIntegralConvolution2D.h:422
vtkLineIntegralConvolution2D::WriteTimerLog
virtual void WriteTimerLog(const char *)
Methods used for parallel benchmarks.
Definition: vtkLineIntegralConvolution2D.h:370
vtkLineIntegralConvolution2D::GetGlobalMinMax
virtual void GetGlobalMinMax(vtkPainterCommunicator *, float &, float &)
For parallel operation, find global min/max min/max are in/out.
Definition: vtkLineIntegralConvolution2D.h:359
vtkLineIntegralConvolution2D::VTShader
vtkOpenGLHelper * VTShader
Definition: vtkLineIntegralConvolution2D.h:417
vtkWeakPointer< vtkOpenGLRenderWindow >
vtkLineIntegralConvolution2D::SetNoiseTexParameters
static void SetNoiseTexParameters(vtkTextureObject *noise)
vtkLineIntegralConvolution2D::AAHShader
vtkOpenGLHelper * AAHShader
Definition: vtkLineIntegralConvolution2D.h:423
vtkLineIntegralConvolution2D::AntiAlias
int AntiAlias
Definition: vtkLineIntegralConvolution2D.h:432
vtkLineIntegralConvolution2D::NumberOfSteps
int NumberOfSteps
Definition: vtkLineIntegralConvolution2D.h:426