#include "imgui.h" #include #include #if defined(__APPLE__) #include #if defined(IMGUI_IMPL_OPENGL_ES2) #include #else #include #endif #else #include #if defined(IMGUI_IMPL_OPENGL_ES2) #include #else #include #endif #endif class ImageBundle { public: int width; int height; int channels; ImTextureID texture; GLuint *glTextureID; std::string_view raw_buffer; uint8_t *image; bool loaded; std::string fname; ImageBundle() { fname = ""; loaded = false; } float aspectRatio() { return (float)width / (float)height; } int calcResizedWidth(int newHeight) { return (int)((float)newHeight * (1.0 / aspectRatio())); } int calcResizedHeight(int newWidth) { return (int)((float)newWidth * (aspectRatio())); } };