Initial standalone track core

This commit is contained in:
2026-05-15 16:02:44 +08:00
commit 84598cad20
15 changed files with 1733 additions and 0 deletions
+36
View File
@@ -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