VTK  9.0.1
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 "vtkRenderingLICOpenGL2Module.h" // for export macro
97 #include "vtkWeakPointer.h" // for ren context
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  {
165  ENHANCE_CONTRAST_OFF = 0,
166  ENHANCE_CONTRAST_ON = 1
167  };
168  vtkSetClampMacro(EnhanceContrast, int, 0, 2);
169  vtkGetMacro(EnhanceContrast, int);
170  vtkBooleanMacro(EnhanceContrast, int);
172 
174 
191  vtkSetClampMacro(LowContrastEnhancementFactor, double, 0.0, 1.0);
192  vtkGetMacro(LowContrastEnhancementFactor, double);
193  vtkSetClampMacro(HighContrastEnhancementFactor, double, 0.0, 1.0);
194  vtkGetMacro(HighContrastEnhancementFactor, double);
196 
198 
204  vtkSetClampMacro(AntiAlias, int, 0, VTK_INT_MAX);
205  vtkGetMacro(AntiAlias, int);
206  vtkBooleanMacro(AntiAlias, int);
208 
210 
214  vtkSetClampMacro(NumberOfSteps, int, 0, VTK_INT_MAX);
215  vtkGetMacro(NumberOfSteps, int);
217 
219 
226  vtkSetClampMacro(StepSize, double, 0.0, VTK_FLOAT_MAX);
227  vtkGetMacro(StepSize, double);
229 
231 
236  void SetComponentIds(int c0, int c1);
237  void SetComponentIds(int c[2]) { this->SetComponentIds(c[0], c[1]); }
238  vtkGetVector2Macro(ComponentIds, int);
240 
242 
247  vtkSetClampMacro(MaxNoiseValue, double, 0.0, 1.0);
248  vtkGetMacro(MaxNoiseValue, double);
250 
252 
258  void SetTransformVectors(int val);
259  vtkGetMacro(TransformVectors, int);
261 
283  void SetNormalizeVectors(int val);
284  vtkGetMacro(NormalizeVectors, int);
286 
288 
297  vtkSetClampMacro(MaskThreshold, double, -1.0, VTK_FLOAT_MAX);
298  vtkGetMacro(MaskThreshold, double);
300 
305 
311  const int extent[4], vtkTextureObject* vectorTex, vtkTextureObject* noiseTex);
312 
324  vtkTextureObject* Execute(const vtkPixelExtent& inputTexExtent,
325  const std::deque<vtkPixelExtent>& vectorExtent, const std::deque<vtkPixelExtent>& licExtent,
326  vtkTextureObject* vectorTex, vtkTextureObject* maskVectorTex, vtkTextureObject* noiseTex);
327 
333 
335 
345 
350  virtual void GetGlobalMinMax(vtkPainterCommunicator*, float&, float&) {}
351 
358  virtual void WriteTimerLog(const char*) {}
359 
360 protected:
363 
365 
374 
375  void BuildShaders();
376 
377  void RenderQuad(float computeBounds[4], vtkPixelExtent computeExtent);
378 
379  vtkTextureObject* AllocateBuffer(unsigned int texSize[2]);
380 
386 
393  virtual void StartTimerEvent(const char*) {}
394  virtual void EndTimerEvent(const char*) {}
395 
396 protected:
399 
411 
413  double StepSize;
423  int ComponentIds[2];
425 
426 private:
428  void operator=(const vtkLineIntegralConvolution2D&) = delete;
429 };
430 
431 #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:406
vtkLineIntegralConvolution2D::GetCommunicator
virtual vtkPainterCommunicator * GetCommunicator()
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:155
vtkLineIntegralConvolution2D::FinalBlendProgram
vtkOpenGLHelper * FinalBlendProgram
Definition: vtkLineIntegralConvolution2D.h:401
vtkLineIntegralConvolution2D::LIC0Shader
vtkOpenGLHelper * LIC0Shader
Definition: vtkLineIntegralConvolution2D.h:404
vtkLineIntegralConvolution2D::EndTimerEvent
virtual void EndTimerEvent(const char *)
Definition: vtkLineIntegralConvolution2D.h:394
vtkLineIntegralConvolution2D::FBO
vtkOpenGLFramebufferObject * FBO
Definition: vtkLineIntegralConvolution2D.h:398
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:182
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:54
vtkLineIntegralConvolution2D::StepSize
double StepSize
Definition: vtkLineIntegralConvolution2D.h:413
vtkLineIntegralConvolution2D::NoiseTextureLookupCompatibilityMode
int NoiseTextureLookupCompatibilityMode
Definition: vtkLineIntegralConvolution2D.h:419
vtkLineIntegralConvolution2D::NormalizeVectors
int NormalizeVectors
Definition: vtkLineIntegralConvolution2D.h:422
vtkLineIntegralConvolution2D::SetComponentIds
void SetComponentIds(int c[2])
Definition: vtkLineIntegralConvolution2D.h:237
vtkLineIntegralConvolution2D::vtkLineIntegralConvolution2D
vtkLineIntegralConvolution2D()
vtkLineIntegralConvolution2D::HighContrastEnhancementFactor
double HighContrastEnhancementFactor
Definition: vtkLineIntegralConvolution2D.h:417
vtkLineIntegralConvolution2D::StartTimerEvent
virtual void StartTimerEvent(const char *)
Methods used for parallel benchmarks.
Definition: vtkLineIntegralConvolution2D.h:393
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:39
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:397
vtkLineIntegralConvolution2D::BuildShaders
void BuildShaders()
vtkLineIntegralConvolution2D::Comm
vtkPainterCommunicator * Comm
Definition: vtkLineIntegralConvolution2D.h:364
vtkShaderProgram
The ShaderProgram uses one or more Shader objects.
Definition: vtkShaderProgram.h:45
vtkOpenGLHelper
Definition: vtkOpenGLHelper.h:31
vtkLineIntegralConvolution2D::~vtkLineIntegralConvolution2D
~vtkLineIntegralConvolution2D() override
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkTextureObject
abstracts an OpenGL texture object.
Definition: vtkTextureObject.h:41
vtkLineIntegralConvolution2D::ShadersNeedBuild
int ShadersNeedBuild
Definition: vtkLineIntegralConvolution2D.h:400
vtkLineIntegralConvolution2D::EnhancedLIC
int EnhancedLIC
Definition: vtkLineIntegralConvolution2D.h:414
vtkLineIntegralConvolution2D::SetLICNShader
void SetLICNShader(vtkShaderProgram *prog)
vtkLineIntegralConvolution2D::MaskThreshold
double MaskThreshold
Definition: vtkLineIntegralConvolution2D.h:420
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:163
vtkLineIntegralConvolution2D::SetContext
void SetContext(vtkOpenGLRenderWindow *context)
Set/Get the rendering context.
vtkLineIntegralConvolution2D::EnhanceContrast
int EnhanceContrast
Definition: vtkLineIntegralConvolution2D.h:415
vtkLineIntegralConvolution2D::SetLIC0Shader
void SetLIC0Shader(vtkShaderProgram *prog)
vtkLineIntegralConvolution2D::GetContext
vtkOpenGLRenderWindow * GetContext()
vtkLineIntegralConvolution2D::LowContrastEnhancementFactor
double LowContrastEnhancementFactor
Definition: vtkLineIntegralConvolution2D.h:416
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:407
vtkLineIntegralConvolution2D::AAVShader
vtkOpenGLHelper * AAVShader
Definition: vtkLineIntegralConvolution2D.h:410
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:421
vtkLineIntegralConvolution2D::IntermediateBlendProgram
vtkOpenGLHelper * IntermediateBlendProgram
Definition: vtkLineIntegralConvolution2D.h:402
vtkLineIntegralConvolution2D::LICIShader
vtkOpenGLHelper * LICIShader
Definition: vtkLineIntegralConvolution2D.h:405
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:52
vtkX3D::extent
@ extent
Definition: vtkX3D.h:351
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:343
vtkLineIntegralConvolution2D::MaxNoiseValue
double MaxNoiseValue
Definition: vtkLineIntegralConvolution2D.h:424
vtkLineIntegralConvolution2D::New
static vtkLineIntegralConvolution2D * New()
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:85
vtkLineIntegralConvolution2D::RenderQuad
void RenderQuad(float computeBounds[4], vtkPixelExtent computeExtent)
vtkLineIntegralConvolution2D::CEShader
vtkOpenGLHelper * CEShader
Definition: vtkLineIntegralConvolution2D.h:408
vtkLineIntegralConvolution2D::WriteTimerLog
virtual void WriteTimerLog(const char *)
Methods used for parallel benchmarks.
Definition: vtkLineIntegralConvolution2D.h:358
vtkLineIntegralConvolution2D::GetGlobalMinMax
virtual void GetGlobalMinMax(vtkPainterCommunicator *, float &, float &)
For parallel operation, find global min/max min/max are in/out.
Definition: vtkLineIntegralConvolution2D.h:350
vtkLineIntegralConvolution2D::VTShader
vtkOpenGLHelper * VTShader
Definition: vtkLineIntegralConvolution2D.h:403
vtkWeakPointer< vtkOpenGLRenderWindow >
vtkLineIntegralConvolution2D::SetNoiseTexParameters
static void SetNoiseTexParameters(vtkTextureObject *noise)
vtkLineIntegralConvolution2D::AAHShader
vtkOpenGLHelper * AAHShader
Definition: vtkLineIntegralConvolution2D.h:409
vtkLineIntegralConvolution2D::AntiAlias
int AntiAlias
Definition: vtkLineIntegralConvolution2D.h:418
vtkLineIntegralConvolution2D::NumberOfSteps
int NumberOfSteps
Definition: vtkLineIntegralConvolution2D.h:412