VTK  9.4.20241222
vtkOpenGLFXAAFilter.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
3
28#ifndef vtkOpenGLFXAAFilter_h
29#define vtkOpenGLFXAAFilter_h
30
31#include "vtkFXAAOptions.h" // For DebugOptions enum
32#include "vtkObject.h"
33#include "vtkRenderingOpenGL2Module.h" // For export macro
34
35#include <string> // For std::string
36
37VTK_ABI_NAMESPACE_BEGIN
38class vtkFXAAOptions;
44
45class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLFXAAFilter : public vtkObject
46{
47public:
50 void PrintSelf(ostream& os, vtkIndent indent) override;
51
56
61
68
70
74 vtkSetClampMacro(RelativeContrastThreshold, float, 0.f, 1.f);
75 vtkGetMacro(RelativeContrastThreshold, float);
76 vtkSetClampMacro(HardContrastThreshold, float, 0.f, 1.f);
77 vtkGetMacro(HardContrastThreshold, float);
78 vtkSetClampMacro(SubpixelBlendLimit, float, 0.f, 1.f);
79 vtkGetMacro(SubpixelBlendLimit, float);
80 vtkSetClampMacro(SubpixelContrastThreshold, float, 0.f, 1.f);
81 vtkGetMacro(SubpixelContrastThreshold, float);
82 virtual void SetUseHighQualityEndpoints(bool val);
83 vtkGetMacro(UseHighQualityEndpoints, bool);
84 vtkBooleanMacro(UseHighQualityEndpoints, bool);
85 vtkSetClampMacro(EndpointSearchIterations, int, 0, VTK_INT_MAX);
86 vtkGetMacro(EndpointSearchIterations, int);
88 vtkGetMacro(DebugOptionValue, vtkFXAAOptions::DebugOption);
90
91protected:
94
95 void Prepare();
98 void LoadInput();
100 void SubstituteFragmentShader(std::string& fragShader);
101 void Finalize();
102
106
107 // Cache GL state that we modify
110
111 int Viewport[4]; // x, y, width, height
112
113 // Used to measure execution time:
116
117 // Parameters:
123
126
127 // Set to true when the shader definitions change so we know when to rebuild.
129
132
134
135private:
137 void operator=(const vtkOpenGLFXAAFilter&) = delete;
138};
139
140VTK_ABI_NAMESPACE_END
141#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:108
abstract base class for most VTK objects
Definition vtkObject.h:162
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)
virtual void SetUseHighQualityEndpoints(bool val)
Parameter for tuning the FXAA implementation.
static vtkOpenGLFXAAFilter * New()
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.
#define VTK_INT_MAX
Definition vtkType.h:144