b37814204f
* get image returns optional<Mat> instead of unique_ptr<Mat> * introduce complexity * rename image load function * add example for a basic reader for binary image files * fix windows build? * add a status bar underneath the menu bar * use status bar in custom_0 example app * clang formats * packing w/ pragma push * add "Save As" functions to image views * resize over reserve * rm local override uri * add simple thread pool * rename to simple_thread_pool * get rid of useless renderlib * document version inc * extract hardcoded values to in-header * clang format patch * clone registered image in custom_0 * document binary-file header * minor fixes * clang format * rm unused render cmake
41 lines
1.1 KiB
C++
41 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <memory>
|
|
|
|
#include "imaging/IPixelariumImage.hpp"
|
|
#include "imgui.h"
|
|
|
|
namespace pixelarium::application
|
|
{
|
|
/// @brief An interface defining the contract on views to dedicated implementations of IPixelariumImage
|
|
class IPixelariumImageView
|
|
{
|
|
public:
|
|
virtual ~IPixelariumImageView() = default;
|
|
virtual void ShowImage() = 0;
|
|
|
|
// default implemented
|
|
public:
|
|
virtual const bool* GetStatus() const noexcept { return &this->open_p; }
|
|
virtual void ForceUpdate() noexcept { this->is_dirty_ = true; }
|
|
|
|
// this must be called immediately before a "ImGui::Begin" context
|
|
// as it will affect the next window and result in undeterministic effects
|
|
// when called "out of sync"
|
|
virtual void SetInitialSize(float width = 700.0f, float height = 700.0f)
|
|
{
|
|
ImGui::SetNextWindowSize({width, height});
|
|
}
|
|
|
|
protected:
|
|
virtual void ImageViewMenuBar();
|
|
|
|
protected:
|
|
std::shared_ptr<imaging::IPixelariumImageCvMat> img_{};
|
|
cv::Mat cached_image_{};
|
|
bool open_p{true};
|
|
bool is_dirty_{true};
|
|
bool first_render_{true};
|
|
};
|
|
} // namespace pixelarium::application
|