Blue Brain BioExplorer
RenderingParameters.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2024, EPFL/Blue Brain Project
3  *
4  * The Blue Brain BioExplorer is a tool for scientists to extract and analyse
5  * scientific data from visualization
6  *
7  * This file is part of Blue Brain BioExplorer <https://github.com/BlueBrain/BioExplorer>
8  *
9  * This library is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU Lesser General Public License version 3.0 as published
11  * by the Free Software Foundation.
12  *
13  * This library is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22 
23 #pragma once
24 
26 
27 #include "AbstractParameters.h"
28 #include <deque>
29 
30 SERIALIZATION_ACCESS(RenderingParameters)
31 
32 namespace core
33 {
34 class AbstractParameters;
35 
39 {
40 public:
42 
44  void print() final;
45 
47  const auto& getRenderers() const { return _renderers; }
48  void addRenderer(const std::string& renderer)
49  {
50  if (std::find(_renderers.begin(), _renderers.end(), renderer) == _renderers.end())
51  _renderers.push_front(renderer);
52  }
53  const std::string& getCurrentCamera() const { return _camera; }
54 
56  const auto& getCameras() const { return _cameras; }
57  void addCamera(const std::string& camera) { _cameras.push_front(camera); }
62  double getVarianceThreshold() const { return _varianceThreshold; }
67  void setVarianceThreshold(const double value) { _updateValue(_varianceThreshold, value); }
68 
71  const std::string getAccumulationTypeAsString(const AccumulationType value);
72 
77  void setNumNonDenoisedFrames(const uint32_t value) { _updateValue(_numNonDenoisedFrames, value); }
78  uint32_t getNumNonDenoisedFrames() const { return _numNonDenoisedFrames; }
79 
80  /* Amount of the original image that is blended with the denoised result ranging from 0.0 to 1.0 */
81  void setDenoiseBlend(const float value) { _updateValue(_denoiseBlend, value); }
82  float getDenoiseBlend() const { return _denoiseBlend; }
83 
84  /* Tone mapper exposure */
85  void setToneMapperExposure(const float value) { _updateValue(_toneMapperExposure, value); }
86  float getToneMapperExposure() const { return _toneMapperExposure; }
87 
88  /* Tone mapper gamma */
89  void setToneMapperGamma(const float value) { _updateValue(_toneMapperGamma, value); }
90  float getToneMapperGamma() const { return _toneMapperGamma; }
91 
92 protected:
93  void parse(const po::variables_map& vm) final;
94 
95  std::deque<std::string> _renderers;
96  std::string _camera{"perspective"};
97  std::deque<std::string> _cameras;
98  double _varianceThreshold{-1.};
99  uint32_t _numNonDenoisedFrames{2};
100  float _denoiseBlend{0.1f};
101  float _toneMapperExposure{1.5f};
102  float _toneMapperGamma{1.f};
104 
106 };
107 } // namespace core
#define SERIALIZATION_FRIEND(type)
Definition: Macros.h:32
#define SERIALIZATION_ACCESS(type)
Definition: Macros.h:25
void _updateValue(T &member, const T &newValue, const bool triggerCallback=true)
Definition: BaseObject.h:87
uint32_t getNumNonDenoisedFrames() const
AccumulationType getAccumulationType() const
void setDenoiseBlend(const float value)
void setToneMapperExposure(const float value)
void setVarianceThreshold(const double value)
void parse(const po::variables_map &vm) final
void setNumNonDenoisedFrames(const uint32_t value)
void setToneMapperGamma(const float value)
const std::string & getCurrentCamera() const
void addCamera(const std::string &camera)
std::deque< std::string > _renderers
std::deque< std::string > _cameras
const auto & getRenderers() const
void addRenderer(const std::string &renderer)
const std::string getAccumulationTypeAsString(const AccumulationType value)
AccumulationType _accumulationType
const auto & getCameras() const
AccumulationType
Definition: Types.h:215