Add a histogram viewer to the imager. Because it's there.

This commit is contained in:
dg
2023-04-06 08:59:05 +00:00
parent ba93dae240
commit 654cdcd3d1
7 changed files with 42 additions and 33 deletions

View File

@@ -31,6 +31,7 @@ void HistogramViewer::Redraw(const Fluxmap& fluxmap, nanoseconds_t clock)
{
_data = fluxmap.guessClock();
_clock = clock;
_blank = false;
Refresh();
}
@@ -40,6 +41,9 @@ void HistogramViewer::OnPaint(wxPaintEvent&)
dc.SetBackground(wxSystemSettings::GetColour(wxSYS_COLOUR_FRAMEBK));
dc.Clear();
if (_blank)
return;
uint32_t max =
*std::max_element(std::begin(_data.buckets), std::end(_data.buckets));
dc.SetPen(*wxGREY_PEN);
@@ -61,6 +65,7 @@ void HistogramViewer::OnPaint(wxPaintEvent&)
{2 * BORDER + WIDTH, BORDER + HEIGHT - y});
}
if (_clock != 0.0)
{
int x = _clock / NS_PER_TICK;
dc.DrawLine({BORDER + x, 2 * BORDER + HEIGHT}, {BORDER + x, 0});