VTK  9.3.20240329
vtkToneMappingPass.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
68 #ifndef vtkToneMappingPass_h
69 #define vtkToneMappingPass_h
70 
71 #include "vtkImageProcessingPass.h"
72 #include "vtkRenderingOpenGL2Module.h" // For export macro
73 
74 VTK_ABI_NAMESPACE_BEGIN
77 class vtkTextureObject;
78 
79 class VTKRENDERINGOPENGL2_EXPORT vtkToneMappingPass : public vtkImageProcessingPass
80 {
81 public:
84  void PrintSelf(ostream& os, vtkIndent indent) override;
85 
89  void Render(const vtkRenderState* s) override;
90 
95 
97 
103 
107  enum
108  {
109  Clamp = 0,
110  Reinhard = 1,
111  Exponential = 2,
112  GenericFilmic = 3
113  };
114 
116 
120  vtkSetClampMacro(ToneMappingType, int, 0, 3);
121  vtkGetMacro(ToneMappingType, int);
123 
125 
129  vtkGetMacro(Exposure, float);
130  vtkSetMacro(Exposure, float);
132 
134 
138  vtkSetClampMacro(Contrast, float, 0.0001f, VTK_FLOAT_MAX);
139  vtkGetMacro(Contrast, float);
141 
143 
148  vtkSetClampMacro(Shoulder, float, 0.0001, 1.f);
149  vtkGetMacro(Shoulder, float);
151 
153 
157  vtkSetClampMacro(MidIn, float, 0.0001, 1.f);
158  vtkGetMacro(MidIn, float);
160 
162 
166  vtkSetClampMacro(MidOut, float, 0.0001, 1.f);
167  vtkGetMacro(MidOut, float);
169 
171 
175  vtkSetClampMacro(HdrMax, float, 1.f, VTK_FLOAT_MAX);
176  vtkGetMacro(HdrMax, float);
178 
180 
184  vtkSetMacro(UseACES, bool);
185  vtkGetMacro(UseACES, bool);
187 
188 protected:
189  vtkToneMappingPass() = default;
191 
195  vtkOpenGLFramebufferObject* FrameBufferObject = nullptr;
196  vtkTextureObject* ColorTexture = nullptr;
197  vtkOpenGLQuadHelper* QuadHelper = nullptr;
198 
199  vtkMTimeType PreComputeMTime = 0;
200 
201  int ToneMappingType = GenericFilmic;
202  float Exposure = 1.0;
203 
207  float Contrast = 1.6773;
208  float Shoulder = 0.9714;
209  float MidIn = 0.18;
210  float MidOut = 0.18;
211  float HdrMax = 11.0785;
212  bool UseACES = true;
213 
217  bool UseACESChangeValue = true;
218 
224  float ClippingPoint = 1.117427;
225  float ToeSpeed = 0.244676;
226 
231 
232 private:
233  vtkToneMappingPass(const vtkToneMappingPass&) = delete;
234  void operator=(const vtkToneMappingPass&) = delete;
235 };
236 
237 VTK_ABI_NAMESPACE_END
238 #endif
Convenient class for post-processing passes.
a simple class to control print indentation
Definition: vtkIndent.h:108
Internal class which encapsulates OpenGL FramebufferObject.
Class to make rendering a full screen quad easier.
Context in which a vtkRenderPass will render.
abstracts an OpenGL texture object.
Implement a post-processing Tone Mapping.
~vtkToneMappingPass() override
void Render(const vtkRenderState *s) override
Perform rendering according to a render state.
void PreComputeAnchorCurveGenericFilmic()
Pre compute ClippingPoint and ToeSpeed.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkToneMappingPass()=default
void SetGenericFilmicDefaultPresets()
Set function to set uncharted 2 presets, and default presets.
void ReleaseGraphicsResources(vtkWindow *w) override
Release graphics resources and ask components to release their own resources.
static vtkToneMappingPass * New()
void SetGenericFilmicUncharted2Presets()
Set function to set uncharted 2 presets, and default presets.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:48
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
#define VTK_FLOAT_MAX
Definition: vtkType.h:152