feat(udpscope): build scaffold and min/max envelope decimation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
2d62e1808b
commit
fba4360c80
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @file Types.h
|
||||
* @brief Plain data shared across UDPScope modules. No logic, no dependencies.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace udpscope {
|
||||
|
||||
/** A time series as two parallel arrays, which is what ImPlot wants. */
|
||||
struct Series {
|
||||
std::vector<double> t;
|
||||
std::vector<double> 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 */
|
||||
Reference in New Issue
Block a user