SDRPlusPlus/src/waterfall.h

32 wiersze
751 B
C
Czysty Zwykły widok Historia

2020-06-10 02:13:56 +00:00
#pragma once
#include <imgui.h>
#include <imgui_internal.h>
#include <vector>
#include <mutex>
#include <GL/glew.h>
namespace ImGui {
class WaterFall {
public:
WaterFall();
2020-06-15 13:53:45 +00:00
void draw(float* vfo);
2020-06-10 02:13:56 +00:00
void pushFFT(std::vector<float> data, int n);
2020-06-10 16:52:07 +00:00
float centerFrequency;
float bandWidth;
float range;
2020-06-10 02:13:56 +00:00
private:
void drawWaterfall(ImGuiWindow* window, int width, int height, ImVec2 pos);
2020-06-15 13:53:45 +00:00
void drawFFT(ImGuiWindow* window, int width, int height, ImVec2 pos, float* vfo);
2020-06-10 02:13:56 +00:00
std::vector<std::vector<float>> fftBuffer;
bool newSamples;
std::mutex buf_mtx;
GLuint textureId;
uint8_t* pixelBuffer;
2020-06-15 13:53:45 +00:00
float* fftDrawBuffer;
2020-06-10 16:52:07 +00:00
2020-06-10 02:13:56 +00:00
};
};