Initial standalone track core
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
|
||||
#include "track_core/model.hpp"
|
||||
|
||||
namespace track_core {
|
||||
|
||||
struct TrackRenderSpan {
|
||||
std::uint16_t start_led{};
|
||||
std::uint16_t led_count{};
|
||||
Color color{};
|
||||
};
|
||||
|
||||
struct TrackRenderPlan {
|
||||
static constexpr std::size_t max_spans = 4;
|
||||
|
||||
void add_fill(std::uint16_t start_led, std::uint16_t led_count, Color color);
|
||||
|
||||
[[nodiscard]]
|
||||
bool empty() const {
|
||||
return span_count == 0;
|
||||
}
|
||||
|
||||
std::array<TrackRenderSpan, max_spans> spans{};
|
||||
std::size_t span_count{};
|
||||
};
|
||||
|
||||
[[nodiscard]]
|
||||
TrackRenderPlan make_track_render_plan(
|
||||
const TrackConfig &config,
|
||||
const TrackInfo &info,
|
||||
const TrackReport &report);
|
||||
|
||||
} // namespace track_core
|
||||
Reference in New Issue
Block a user