VTK  9.2.20230201
vtkOpenGLFXAAFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOpenGLFXAAFilter.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 =========================================================================*/
15 
40 #ifndef vtkOpenGLFXAAFilter_h
41 #define vtkOpenGLFXAAFilter_h
42 
43 #include "vtkFXAAOptions.h" // For DebugOptions enum
44 #include "vtkObject.h"
45 #include "vtkRenderingOpenGL2Module.h" // For export macro
46 
47 #include <string> // For std::string
48 
49 VTK_ABI_NAMESPACE_BEGIN
50 class vtkFXAAOptions;
51 class vtkOpenGLRenderer;
53 class vtkShaderProgram;
54 class vtkTextureObject;
56 
57 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLFXAAFilter : public vtkObject
58 {
59 public:
62  void PrintSelf(ostream& os, vtkIndent indent) override;
63 
68 
73 
80 
82 
86  vtkSetClampMacro(RelativeContrastThreshold, float, 0.f, 1.f);
87  vtkGetMacro(RelativeContrastThreshold, float);
88  vtkSetClampMacro(HardContrastThreshold, float, 0.f, 1.f);
89  vtkGetMacro(HardContrastThreshold, float);
90  vtkSetClampMacro(SubpixelBlendLimit, float, 0.f, 1.f);
91  vtkGetMacro(SubpixelBlendLimit, float);
92  vtkSetClampMacro(SubpixelContrastThreshold, float, 0.f, 1.f);
93  vtkGetMacro(SubpixelContrastThreshold, float);
94  virtual void SetUseHighQualityEndpoints(bool val);
95  vtkGetMacro(UseHighQualityEndpoints, bool);
96  vtkBooleanMacro(UseHighQualityEndpoints, bool);
97  vtkSetClampMacro(EndpointSearchIterations, int, 0, VTK_INT_MAX);
98  vtkGetMacro(EndpointSearchIterations, int);
100  vtkGetMacro(DebugOptionValue, vtkFXAAOptions::DebugOption);
102 
103 protected:
106 
107  void Prepare();
110  void LoadInput();
111  void ApplyFilter();
113  void Finalize();
114 
118 
119  // Cache GL state that we modify
122 
123  int Viewport[4]; // x, y, width, height
124 
125  // Used to measure execution time:
128 
129  // Parameters:
135 
138 
139  // Set to true when the shader definitions change so we know when to rebuild.
141 
144 
146 
147 private:
148  vtkOpenGLFXAAFilter(const vtkOpenGLFXAAFilter&) = delete;
149  void operator=(const vtkOpenGLFXAAFilter&) = delete;
150 };
151 
152 VTK_ABI_NAMESPACE_END
153 #endif // vtkOpenGLFXAAFilter_h
Configuration for FXAA implementations.
DebugOption
Debugging options that affect the output color buffer.
a simple class to control print indentation
Definition: vtkIndent.h:120
abstract base class for most VTK objects
Definition: vtkObject.h:83
Perform FXAA antialiasing on the current framebuffer.
virtual void SetDebugOptionValue(vtkFXAAOptions::DebugOption opt)
Parameter for tuning the FXAA implementation.
vtkFXAAOptions::DebugOption DebugOptionValue
vtkTextureObject * Input
void Execute(vtkOpenGLRenderer *ren)
Perform FXAA on the current render buffer in ren.
vtkOpenGLQuadHelper * QHelper
void EndTimeQuery(vtkOpenGLRenderTimer *timer)
~vtkOpenGLFXAAFilter() override
vtkOpenGLRenderTimer * FXAATimer
void UpdateConfiguration(vtkFXAAOptions *opts)
Copy the configuration values from opts into this filter.
vtkOpenGLRenderTimer * PreparationTimer
vtkOpenGLRenderer * Renderer
void ReleaseGraphicsResources()
Release all OpenGL state.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SubstituteFragmentShader(std::string &fragShader)
void StartTimeQuery(vtkOpenGLRenderTimer *timer)
static vtkOpenGLFXAAFilter * New()
virtual void SetUseHighQualityEndpoints(bool val)
Parameter for tuning the FXAA implementation.
Class to make rendering a full screen quad easier.
Asynchronously measures GPU execution time for a single event.
OpenGL renderer.
The ShaderProgram uses one or more Shader objects.
abstracts an OpenGL texture object.
@ string
Definition: vtkX3D.h:502
#define VTK_INT_MAX
Definition: vtkType.h:156