/** * @file Types.h * @brief Plain data shared across UDPScope modules. No logic, no dependencies. */ #pragma once #include #include #include #include namespace udpscope { /** A time series as two parallel arrays, which is what ImPlot wants. */ struct Series { std::vector t; std::vector v; void clear() { t.clear(); v.clear(); } size_t size() const { return t.size(); } bool empty() const { return t.empty(); } }; /** RGBA in 0..1. Framework-free so PaneTree needs no ImGui. */ struct Color { float r = 1.f, g = 1.f, b = 1.f, a = 1.f; }; /** Screen rectangle in pixels. */ struct Rect { double x = 0.0, y = 0.0, w = 0.0, h = 0.0; bool contains(double px, double py) const { return px >= x && px < (x + w) && py >= y && py < (y + h); } }; } /* namespace udpscope */