VTK  9.3.1
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
29 #ifndef vtkToneMappingPass_h
30 #define vtkToneMappingPass_h
31 
32 #include "vtkImageProcessingPass.h"
33 #include "vtkRenderingOpenGL2Module.h" // For export macro
34 
35 VTK_ABI_NAMESPACE_BEGIN
38 class vtkTextureObject;
39 
40 class VTKRENDERINGOPENGL2_EXPORT vtkToneMappingPass : public vtkImageProcessingPass
41 {
42 public:
43  static vtkToneMappingPass* New();
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
50  void Render(const vtkRenderState* s) override;
51 
55  void ReleaseGraphicsResources(vtkWindow* w) override;
56 
58 
61  void SetGenericFilmicDefaultPresets();
62  void SetGenericFilmicUncharted2Presets();
64 
68  enum
69  {
70  Clamp = 0,
71  Reinhard = 1,
72  Exponential = 2,
73  GenericFilmic = 3
74  };
75 
77 
81  vtkSetClampMacro(ToneMappingType, int, 0, 3);
82  vtkGetMacro(ToneMappingType, int);
84 
86 
90  vtkGetMacro(Exposure, float);
91  vtkSetMacro(Exposure, float);
93 
95 
99  vtkSetClampMacro(Contrast, float, 0.0001f, VTK_FLOAT_MAX);
100  vtkGetMacro(Contrast, float);
102 
104 
109  vtkSetClampMacro(Shoulder, float, 0.0001, 1.f);
110  vtkGetMacro(Shoulder, float);
112 
114 
118  vtkSetClampMacro(MidIn, float, 0.0001, 1.f);
119  vtkGetMacro(MidIn, float);
121 
123 
127  vtkSetClampMacro(MidOut, float, 0.0001, 1.f);
128  vtkGetMacro(MidOut, float);
130 
132 
136  vtkSetClampMacro(HdrMax, float, 1.f, VTK_FLOAT_MAX);
137  vtkGetMacro(HdrMax, float);
139 
141 
145  vtkSetMacro(UseACES, bool);
146  vtkGetMacro(UseACES, bool);
148 
149 protected:
150  vtkToneMappingPass() = default;
151  ~vtkToneMappingPass() override;
152 
156  vtkOpenGLFramebufferObject* FrameBufferObject = nullptr;
157  vtkTextureObject* ColorTexture = nullptr;
158  vtkOpenGLQuadHelper* QuadHelper = nullptr;
159 
160  vtkMTimeType PreComputeMTime = 0;
161 
162  int ToneMappingType = GenericFilmic;
163  float Exposure = 1.0;
164 
168  float Contrast = 1.6773;
169  float Shoulder = 0.9714;
170  float MidIn = 0.18;
171  float MidOut = 0.18;
172  float HdrMax = 11.0785;
173  bool UseACES = true;
174 
178  bool UseACESChangeValue = true;
179 
185  float ClippingPoint = 1.117427;
186  float ToeSpeed = 0.244676;
187 
191  void PreComputeAnchorCurveGenericFilmic();
192 
193 private:
194  vtkToneMappingPass(const vtkToneMappingPass&) = delete;
195  void operator=(const vtkToneMappingPass&) = delete;
196 };
197 
198 VTK_ABI_NAMESPACE_END
199 #endif
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
void ReleaseGraphicsResources(vtkWindow *w) override
Release graphics resources and ask components to release their own resources.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Convenient class for post-processing passes.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:27
Context in which a vtkRenderPass will render.
#define VTK_FLOAT_MAX
Definition: vtkType.h:152
a simple class to control print indentation
Definition: vtkIndent.h:28
Internal class which encapsulates OpenGL FramebufferObject.
abstracts an OpenGL texture object.
virtual void Render(const vtkRenderState *s)=0
Perform rendering according to a render state s.
Class to make rendering a full screen quad easier.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
Implement a post-processing Tone Mapping.