VTK  9.2.6
vtkToneMappingPass.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkToneMappingPass.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 =========================================================================*/
41 #ifndef vtkToneMappingPass_h
42 #define vtkToneMappingPass_h
43 
44 #include "vtkImageProcessingPass.h"
45 #include "vtkRenderingOpenGL2Module.h" // For export macro
46 
49 class vtkTextureObject;
50 
51 class VTKRENDERINGOPENGL2_EXPORT vtkToneMappingPass : public vtkImageProcessingPass
52 {
53 public:
54  static vtkToneMappingPass* New();
56  void PrintSelf(ostream& os, vtkIndent indent) override;
57 
61  void Render(const vtkRenderState* s) override;
62 
66  void ReleaseGraphicsResources(vtkWindow* w) override;
67 
69 
72  void SetGenericFilmicDefaultPresets();
73  void SetGenericFilmicUncharted2Presets();
75 
79  enum
80  {
81  Clamp = 0,
82  Reinhard = 1,
83  Exponential = 2,
84  GenericFilmic = 3
85  };
86 
88 
92  vtkSetClampMacro(ToneMappingType, int, 0, 3);
93  vtkGetMacro(ToneMappingType, int);
95 
97 
101  vtkGetMacro(Exposure, float);
102  vtkSetMacro(Exposure, float);
104 
106 
110  vtkSetClampMacro(Contrast, float, 0.0001f, VTK_FLOAT_MAX);
111  vtkGetMacro(Contrast, float);
113 
115 
120  vtkSetClampMacro(Shoulder, float, 0.0001, 1.f);
121  vtkGetMacro(Shoulder, float);
123 
125 
129  vtkSetClampMacro(MidIn, float, 0.0001, 1.f);
130  vtkGetMacro(MidIn, float);
132 
134 
138  vtkSetClampMacro(MidOut, float, 0.0001, 1.f);
139  vtkGetMacro(MidOut, float);
141 
143 
147  vtkSetClampMacro(HdrMax, float, 1.f, VTK_FLOAT_MAX);
148  vtkGetMacro(HdrMax, float);
150 
152 
156  vtkSetMacro(UseACES, bool);
157  vtkGetMacro(UseACES, bool);
159 
160 protected:
161  vtkToneMappingPass() = default;
162  ~vtkToneMappingPass() override;
163 
167  vtkOpenGLFramebufferObject* FrameBufferObject = nullptr;
168  vtkTextureObject* ColorTexture = nullptr;
169  vtkOpenGLQuadHelper* QuadHelper = nullptr;
170 
171  vtkMTimeType PreComputeMTime = 0;
172 
173  int ToneMappingType = GenericFilmic;
174  float Exposure = 1.0;
175 
179  float Contrast = 1.6773;
180  float Shoulder = 0.9714;
181  float MidIn = 0.18;
182  float MidOut = 0.18;
183  float HdrMax = 11.0785;
184  bool UseACES = true;
185 
189  bool UseACESChangeValue = true;
190 
196  float ClippingPoint = 1.117427;
197  float ToeSpeed = 0.244676;
198 
202  void PreComputeAnchorCurveGenericFilmic();
203 
204 private:
205  vtkToneMappingPass(const vtkToneMappingPass&) = delete;
206  void operator=(const vtkToneMappingPass&) = delete;
207 };
208 
209 #endif
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
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:38
Context in which a vtkRenderPass will render.
#define VTK_FLOAT_MAX
Definition: vtkType.h:163
a simple class to control print indentation
Definition: vtkIndent.h:39
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.