VTK  9.3.20240419
vtkLineIntegralConvolution2D.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
80 #ifndef vtkLineIntegralConvolution2D_h
81 #define vtkLineIntegralConvolution2D_h
82 
83 #include "vtkObject.h"
84 #include "vtkRenderingLICOpenGL2Module.h" // for export macro
85 #include "vtkWeakPointer.h" // for ren context
86 #include <deque> // for deque
87 
88 VTK_ABI_NAMESPACE_BEGIN
90 class vtkOpenGLHelper;
93 class vtkPixelExtent;
94 class vtkRenderWindow;
95 class vtkShaderProgram;
96 class vtkTextureObject;
97 
98 class VTKRENDERINGLICOPENGL2_EXPORT vtkLineIntegralConvolution2D : public vtkObject
99 {
100 public:
103  void PrintSelf(ostream& os, vtkIndent indent) override;
104 
108  static bool IsSupported(vtkRenderWindow* renWin);
109 
111 
118 
120 
125  vtkSetClampMacro(EnhancedLIC, int, 0, 1);
126  vtkGetMacro(EnhancedLIC, int);
127  vtkBooleanMacro(EnhancedLIC, int);
129 
131 
152  enum
153  {
154  ENHANCE_CONTRAST_OFF = 0,
155  ENHANCE_CONTRAST_ON = 1
156  };
157  vtkSetClampMacro(EnhanceContrast, int, 0, 2);
158  vtkGetMacro(EnhanceContrast, int);
159  vtkBooleanMacro(EnhanceContrast, int);
161 
163 
180  vtkSetClampMacro(LowContrastEnhancementFactor, double, 0.0, 1.0);
181  vtkGetMacro(LowContrastEnhancementFactor, double);
182  vtkSetClampMacro(HighContrastEnhancementFactor, double, 0.0, 1.0);
183  vtkGetMacro(HighContrastEnhancementFactor, double);
185 
187 
193  vtkSetClampMacro(AntiAlias, int, 0, VTK_INT_MAX);
194  vtkGetMacro(AntiAlias, int);
195  vtkBooleanMacro(AntiAlias, int);
197 
199 
203  vtkSetClampMacro(NumberOfSteps, int, 0, VTK_INT_MAX);
204  vtkGetMacro(NumberOfSteps, int);
206 
208 
215  vtkSetClampMacro(StepSize, double, 0.0, VTK_FLOAT_MAX);
216  vtkGetMacro(StepSize, double);
218 
220 
225  void SetComponentIds(int c0, int c1);
226  void SetComponentIds(int c[2]) { this->SetComponentIds(c[0], c[1]); }
227  vtkGetVector2Macro(ComponentIds, int);
229 
231 
236  vtkSetClampMacro(MaxNoiseValue, double, 0.0, 1.0);
237  vtkGetMacro(MaxNoiseValue, double);
239 
241 
247  void SetTransformVectors(int val);
248  vtkGetMacro(TransformVectors, int);
250 
263 
272  void SetNormalizeVectors(int val);
273  vtkGetMacro(NormalizeVectors, int);
275 
277 
286  vtkSetClampMacro(MaskThreshold, double, -1.0, VTK_FLOAT_MAX);
287  vtkGetMacro(MaskThreshold, double);
289 
294 
300  const int extent[4], vtkTextureObject* vectorTex, vtkTextureObject* noiseTex);
301 
313  vtkTextureObject* Execute(const vtkPixelExtent& inputTexExtent,
314  const std::deque<vtkPixelExtent>& vectorExtent, const std::deque<vtkPixelExtent>& licExtent,
315  vtkTextureObject* vectorTex, vtkTextureObject* maskVectorTex, vtkTextureObject* noiseTex);
316 
322 
324 
334 
339  virtual void GetGlobalMinMax(vtkPainterCommunicator*, float&, float&) {}
340 
347  virtual void WriteTimerLog(const char*) {}
348 
349 protected:
352 
354 
363 
364  void BuildShaders();
365 
366  void RenderQuad(float computeBounds[4], vtkPixelExtent computeExtent);
367 
368  vtkTextureObject* AllocateBuffer(unsigned int texSize[2]);
369 
375 
382  virtual void StartTimerEvent(const char*) {}
383  virtual void EndTimerEvent(const char*) {}
384 
387 
399 
401  double StepSize;
411  int ComponentIds[2];
413 
414 private:
416  void operator=(const vtkLineIntegralConvolution2D&) = delete;
417 };
418 
419 VTK_ABI_NAMESPACE_END
420 #endif
a simple class to control print indentation
Definition: vtkIndent.h:108
GPU-based implementation of Line Integral Convolution (LIC)
vtkWeakPointer< vtkOpenGLRenderWindow > Context
void SetAAHShader(vtkShaderProgram *prog)
static vtkLineIntegralConvolution2D * New()
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.
virtual void WriteTimerLog(const char *)
Methods used for parallel benchmarks.
void SetLIC0Shader(vtkShaderProgram *prog)
~vtkLineIntegralConvolution2D() override
virtual vtkPainterCommunicator * GetCommunicator()
static void SetVectorTexParameters(vtkTextureObject *vectors)
Convenience functions to ensure that the input textures are configured correctly.
void SetCEShader(vtkShaderProgram *prog)
void SetLICNShader(vtkShaderProgram *prog)
void SetContext(vtkOpenGLRenderWindow *context)
Set/Get the rendering context.
void SetNoise2TexParameters(vtkTextureObject *noise)
Convenience functions to ensure that the input textures are configured correctly.
void SetComponentIds(int c0, int c1)
If VectorField has >= 3 components, we must choose which 2 components form the (X,...
virtual void GetGlobalMinMax(vtkPainterCommunicator *, float &, float &)
For parallel operation, find global min/max min/max are in/out.
virtual void StartTimerEvent(const char *)
Methods used for parallel benchmarks.
void SetVTShader(vtkShaderProgram *prog)
void RenderQuad(float computeBounds[4], vtkPixelExtent computeExtent)
void SetComponentIds(int c[2])
If VectorField has >= 3 components, we must choose which 2 components form the (X,...
static bool IsSupported(vtkRenderWindow *renWin)
Returns if the context supports the required extensions.
virtual void EndTimerEvent(const char *)
void SetAAVShader(vtkShaderProgram *prog)
vtkTextureObject * AllocateBuffer(unsigned int texSize[2])
vtkTextureObject * Execute(vtkTextureObject *vectorTex, vtkTextureObject *noiseTex)
Compute the lic on the entire vector field texture.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetTransformVectors(int val)
This class performs LIC in the normalized image space.
vtkTextureObject * Execute(const int extent[4], vtkTextureObject *vectorTex, vtkTextureObject *noiseTex)
Compute the lic on the indicated subset of the vector field texture.
virtual void SetCommunicator(vtkPainterCommunicator *)
Set the communicator to use during parallel operation The communicator will not be duplicated or refe...
static void SetNoiseTexParameters(vtkTextureObject *noise)
void SetLICIShader(vtkShaderProgram *prog)
vtkOpenGLRenderWindow * GetContext()
Set/Get the rendering context.
void SetNormalizeVectors(int val)
Set/Get the spacing in each dimension of the plane on which the vector field is defined.
void SetEEShader(vtkShaderProgram *prog)
abstract base class for most VTK objects
Definition: vtkObject.h:162
Internal class which encapsulates OpenGL FramebufferObject.
OpenGL rendering window.
A communicator that can safely be used inside a painter.
Representation of a cartesian pixel plane and common operations on it.
create a window for renderers to draw into
The ShaderProgram uses one or more Shader objects.
abstracts an OpenGL texture object.
@ extent
Definition: vtkX3D.h:345
#define VTK_INT_MAX
Definition: vtkType.h:144
#define VTK_FLOAT_MAX
Definition: vtkType.h:152