Czi rendering (#10)
* add dimension selector sliders to czi view * version doc & version bump * cosmetic * fix build? * multi-dimension selection enabled in czi view * remove the parameterized reset function of the renderer it is not and is conceptually questionable doc updates & some minor improvements auto-update CZI-view when sliders are moved set initial window size fix windows build and msvc build For reasons I don not comprehend, on Windows, we must include =opencv2/core/mat.hpp= as the very last header in the =CvMatRender.hpp=. If this is at any other position building on Windows, compilation will break w/ all kinds of cryptic errors regarding OpenCV. When building w/ msvc =__PRETTY_FUNCTION__= is not defined. =ILog.hpp= now defines it. This should be revised to only be set when the compiler is msvc. For the time being, it is considered sufficient though.
This commit is contained in:
committed by
Maximilian Kueffner
parent
e60203b57d
commit
1ea83d9d11
@@ -2,7 +2,6 @@
|
||||
// windows.h must come before GL/GL.h here.
|
||||
// clang format would change this, effectively rendering the build broken.
|
||||
// clang-format off
|
||||
#include <memory>
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <GL/GL.h>
|
||||
@@ -13,11 +12,12 @@
|
||||
#endif
|
||||
#include <GLFW/glfw3.h> // Will drag system OpenGL headers
|
||||
#endif
|
||||
#include "imaging/IPixelariumImage.hpp"
|
||||
#include <opencv2/core/mat.hpp>
|
||||
// clang-format on
|
||||
|
||||
namespace pixelarium::render
|
||||
{
|
||||
/// @brief Renders cv::Mat bitmaps as OpenGL textures.
|
||||
class CvMatRender
|
||||
{
|
||||
public:
|
||||
@@ -26,25 +26,24 @@ class CvMatRender
|
||||
// get removed in the future)
|
||||
// as the using AppGLFW constructs it empty as a member
|
||||
// when coming to life.
|
||||
CvMatRender() = default;
|
||||
// CvMatRender() = default;
|
||||
CvMatRender(CvMatRender&) = delete;
|
||||
CvMatRender(const CvMatRender&) = delete;
|
||||
CvMatRender(CvMatRender&&) = delete;
|
||||
CvMatRender& operator=(CvMatRender&) = default;
|
||||
CvMatRender& operator=(CvMatRender&& other) = default;
|
||||
CvMatRender& operator=(CvMatRender&) = delete;
|
||||
CvMatRender& operator=(CvMatRender&& other) = delete;
|
||||
~CvMatRender();
|
||||
explicit CvMatRender(std::shared_ptr<pixelarium::imaging::IPixelariumImage>& img);
|
||||
explicit CvMatRender(const cv::Mat& img);
|
||||
|
||||
public:
|
||||
GLuint Render();
|
||||
GLuint Render(float factor);
|
||||
GLuint Render(size_t width, size_t height);
|
||||
void ResetRenderImage();
|
||||
void ResetRenderImage(std::shared_ptr<pixelarium::imaging::IPixelariumImage>& img);
|
||||
|
||||
private:
|
||||
cv::Mat img_;
|
||||
std::shared_ptr<pixelarium::imaging::IPixelariumImage> base_;
|
||||
const cv::Mat& base_;
|
||||
GLuint texture_;
|
||||
|
||||
GLuint uploadTexture();
|
||||
|
||||
Reference in New Issue
Block a user