scene/tables/spectra.h
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // SPDX-License-Identifier: BSD-3-Clause | ||
| 2 | #pragma once | ||
| 3 | |||
| 4 | #include <span> | ||
| 5 | #include <string_view> | ||
| 6 | #include <vector> | ||
| 7 | |||
| 8 | #include "chrono_batch_render/device/buffer.h" | ||
| 9 | #include "chrono_batch_render/device/ref.h" | ||
| 10 | #include "chrono_batch_render/scene/records/spectra.h" | ||
| 11 | #include "chrono_batch_render/scene/tables/table.h" | ||
| 12 | #include "chrono_batch_render/stage/structure/structure.h" | ||
| 13 | |||
| 14 | namespace chrono::batch_render { | ||
| 15 | |||
| 16 | class SpectralTable : public RenderTable { | ||
| 17 | public: | ||
| 18 | 353 | explicit SpectralTable(Structure& structure) : m_structure(structure) {} | |
| 19 | |||
| 20 | 928 | std::string_view Name() const override { | |
| 21 | 928 | return "spectra"; | |
| 22 | } | ||
| 23 | |||
| 24 | std::span<const ColumnRef> Inputs() const override; | ||
| 25 | void Run(const ChangeSet& changes, TableVersions& versions) override; | ||
| 26 | void Describe(RenderTables& tables) const override; | ||
| 27 | |||
| 28 | 928 | void Hold(std::vector<Ref<const RefCounted>>& held) const override { | |
| 29 | 7424 | HoldBuffers(held, {m_rgb, m_bands, m_ranges, m_samples, m_sigmoids, m_sigmoidScales}); | |
| 30 | 1856 | } | |
| 31 | |||
| 32 | private: | ||
| 33 | Structure& m_structure; | ||
| 34 | Ref<device::Buffer> m_rgb; | ||
| 35 | Ref<device::Buffer> m_bands; | ||
| 36 | Ref<device::Buffer> m_ranges; | ||
| 37 | Ref<device::Buffer> m_samples; | ||
| 38 | Ref<device::Buffer> m_sigmoids; | ||
| 39 | Ref<device::Buffer> m_sigmoidScales; | ||
| 40 | uint32_t m_count = 0; | ||
| 41 | uint32_t m_detectors = 0; | ||
| 42 | }; | ||
| 43 | |||
| 44 | } | ||
| 45 |