File: fft_plot.h

package info (click to toggle)
satdump 1.2.2%2Bgb79af48-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 81,648 kB
  • sloc: cpp: 276,768; ansic: 164,598; lisp: 1,219; sh: 283; xml: 106; makefile: 7
file content (43 lines) | stat: -rw-r--r-- 865 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once

#include "imgui/imgui.h"
#include <mutex>
#include "common/image/image.h"
#include <string>

namespace widgets
{
    class FFTPlot
    {
    private:
        float *values;
        int values_size;
        std::mutex work_mutex;

    public:
        float scale_min, scale_max;
        float scale_resolution;

        double bandwidth = 0;
        double frequency = 0;

        bool enable_freq_scale = true;

        double actual_sdr_freq = -1;

    public:
        FFTPlot(float *v, int size, float min, float max, float scale_res = 20);

        void draw(ImVec2 size);
        image::Image drawImg(int size_x, int size_y);

        void set_size(int size)
        {
            work_mutex.lock();
            values_size = size;
            work_mutex.unlock();
        }

        std::vector<std::pair<std::string, double>> vfo_freqs;
    };
}