Debian Codegraph @

src/traceplot.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2016, Mike Walters <[email protected]>
3 *
4 * This file is part of inspectrum.
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #pragma once
21 #include <memory>
22 #include "abstractsamplesource.h"
23 #include "plot.h"
24 #include "util.h"
25
26 class TracePlot : public Plot
27 {
28 Q_OBJECT
29
30 public:
31 TracePlot(std::shared_ptr<AbstractSampleSource> source);
32
33 void paintMid(QPainter &painter, QRect &rect, range_t<size_t> sampleRange);
34 std::shared_ptr<AbstractSampleSource> source() { return sampleSource; };
35
36 signals:
37 void imageReady(QString key, QImage image);
38
39 public slots:
40 void handleImage(QString key, QImage image);
41
42 private:
43 QSet<QString> tasks;
44 const int tileWidth = 1000;
45
46 QPixmap getTile(size_t tileID, size_t sampleCount);
47 void drawTile(QString key, const QRect &rect, range_t<size_t> sampleRange);
48 void plotTrace(QPainter &painter, const QRect &rect, float *samples, size_t count, int step);
49 };