material/uplift.h
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // SPDX-License-Identifier: BSD-3-Clause | ||
| 2 | #pragma once | ||
| 3 | |||
| 4 | #include <array> | ||
| 5 | #include <cstdint> | ||
| 6 | #include <vector> | ||
| 7 | |||
| 8 | #include "chrono_batch_render/util/disk_cache.h" | ||
| 9 | |||
| 10 | namespace chrono::batch_render { | ||
| 11 | |||
| 12 | inline constexpr uint32_t kSigmoidResolution = 32; | ||
| 13 | inline constexpr float kSigmoidFirstNm = 360; | ||
| 14 | inline constexpr float kSigmoidLastNm = 830; | ||
| 15 | |||
| 16 | 9 | struct SigmoidTable { | |
| 17 | std::vector<float> scales; | ||
| 18 | std::vector<float> coefficients; | ||
| 19 | }; | ||
| 20 | |||
| 21 | SigmoidTable CachedSigmoids(const DiskCache& cache); | ||
| 22 | |||
| 23 | const SigmoidTable& Sigmoids(); | ||
| 24 | |||
| 25 | std::array<float, 3> FitSigmoid(std::array<float, 3> rgb, std::array<float, 3> start); | ||
| 26 | |||
| 27 | float SigmoidValue(const std::array<float, 3>& coefficients, float nanometers); | ||
| 28 | |||
| 29 | std::array<float, 3> SigmoidRgb(const std::array<float, 3>& coefficients); | ||
| 30 | |||
| 31 | inline constexpr float kLinearUpliftFirstNm = 300; | ||
| 32 | inline constexpr float kLinearUpliftStepNm = 5; | ||
| 33 | inline constexpr uint32_t kLinearUpliftSamples = 181; | ||
| 34 | |||
| 35 | std::vector<std::array<float, 3>> LinearUplift(); | ||
| 36 | |||
| 37 | } | ||
| 38 |