mirror of
https://github.com/SatDump/SatDump
synced 2026-08-13 17:47:30 -04:00
35 lines
No EOL
683 B
C++
35 lines
No EOL
683 B
C++
#pragma once
|
|
|
|
#include "imgui/imgui.h"
|
|
#include "common/image/image.h"
|
|
#include <mutex>
|
|
#include <vector>
|
|
|
|
class ImageViewWidget
|
|
{
|
|
private:
|
|
unsigned int texture_id = 0;
|
|
std::vector<uint32_t> texture_buffer;
|
|
|
|
int img_width;
|
|
int img_height;
|
|
|
|
bool has_to_update = false;
|
|
std::mutex image_mtx;
|
|
|
|
float img_scale = 1;
|
|
bool first_run = true;
|
|
|
|
void handleMouseDrag();
|
|
|
|
std::string id_str;
|
|
|
|
public:
|
|
ImageViewWidget();
|
|
~ImageViewWidget();
|
|
|
|
std::function<void(int x, int y)> mouseCallback = [](int, int) {}; // Function that can be used to handle mouse events
|
|
|
|
void update(image::Image<uint16_t> image);
|
|
void draw(ImVec2 win_size);
|
|
}; |