resizable images

This commit is contained in:
Kueffner, Maximilian
2025-03-17 17:33:31 +01:00
parent 8d8480bac1
commit ee39b254b4
5 changed files with 101 additions and 27 deletions
+8 -5
View File
@@ -6,12 +6,14 @@
#include "Image.hpp"
#include "imgui.h"
#include "imgui_impl_glfw.h"
#include "imgui_impl_opengl3.h"
#include "rendering/CvMatRender.hpp"
namespace pixelarium::ui
{
static bool dim_changed_p(const ImVec2& ref_rect, const ImVec2& new_rect);
static ImVec2 ascpet_const_dimensions(const pixelarium::imaging::Image& img, const ImVec2& curr_dim);
enum LogLevelSelection
{
Debug = 0,
@@ -31,16 +33,17 @@ class AppGLFW
void LoadImageProt();
private:
LogLevelSelection log_level_ = static_cast<LogLevelSelection>(0);
// LogLevelSelection log_level_ = static_cast<LogLevelSelection>(0);
GLFWwindow* window = nullptr;
ImGuiWindowFlags window_flags = 0;
std::shared_ptr<pixelarium::imaging::Image> _img;
pixelarium::render::CvMatRender _render;
bool _imagep { false };
bool _imagep{false};
ImVec2 _curr_dim;
};
static void glfw_error_callback(int error, const char* description)
{
fprintf(stderr, "GLFW Error %d: %s\n", error, description);
}
} // namespace ui
} // namespace pixelarium::ui