16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 17:29:18 +02:00

extcam camera preview

This commit is contained in:
milek7
2019-09-07 02:06:09 +02:00
parent 4b50fba6bc
commit c651ba21a2
10 changed files with 283 additions and 5 deletions

View File

@@ -0,0 +1,32 @@
#include "stdafx.h"
#include "uilayer.h"
#include "translation.h"
#include "extras/VS_Dev.h"
namespace ui
{
class cameraview_panel : public ui_panel
{
std::atomic_bool exit_thread = true;
std::thread workthread;
uint8_t* image_ptr = nullptr;
int image_w, image_h;
std::mutex mutex;
std::condition_variable cv;
std::optional<opengl_texture> texture;
std::unique_ptr<VSDev> device;
void workthread_func();
public:
cameraview_panel();
~cameraview_panel();
void render() override;
void render_contents() override;
};
} // namespace ui