Showing the changes to libraries/render-utils/src/RenderScriptingInterface.cpp (1 of 9 files). Show all
Unified · Split
| @@ -0,0 +1,41 @@ | ||
| 1 | +// | |
| 2 | +// RenderScriptingInterface.cpp | |
| 3 | +// libraries/render-utils | |
| 4 | +// | |
| 5 | +// Created by Zach Pomerantz on 12/16/15. | |
| 6 | +// Copyright 2015 High Fidelity, Inc. | |
| 7 | +// | |
| 8 | +// Distributed under the Apache License, Version 2.0. | |
| 9 | +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html | |
| 10 | +// | |
| 11 | + | |
| 12 | +#include "RenderScriptingInterface.h" | |
| 13 | + | |
| 14 | +RenderScriptingInterface::RenderScriptingInterface() {}; | |
| 15 | + | |
| 16 | +void RenderScriptingInterface::setEngineToneMappingToneCurve(const QString& toneCurve) { | |
| 17 | + if (toneCurve == QString("None")) { | |
| 18 | + _tone._toneCurve = 0; | |
| 19 | + } else if (toneCurve == QString("Gamma22")) { | |
| 20 | + _tone._toneCurve = 1; | |
| 21 | + } else if (toneCurve == QString("Reinhard")) { | |
| 22 | + _tone._toneCurve = 2; | |
| 23 | + } else if (toneCurve == QString("Filmic")) { | |
| 24 | + _tone._toneCurve = 3; | |
| 25 | + } | |
| 26 | +} | |
| 27 | + | |
| 28 | +QString RenderScriptingInterface::getEngineToneMappingToneCurve() const { | |
| 29 | + switch (_tone._toneCurve) { | |
| 30 | + case 0: | |
| 31 | + return QString("None"); | |
| 32 | + case 1: | |
| 33 | + return QString("Gamma22"); | |
| 34 | + case 2: | |
| 35 | + return QString("Reinhard"); | |
| 36 | + case 3: | |
| 37 | + return QString("Filmic"); | |
| 38 | + default: | |
| 39 | + return QString("Filmic"); | |
| 40 | + }; | |
| 41 | +} | |