Files
pixelarium/lib/rendering/IPixelariumImageView.hpp
T

33 lines
876 B
C++
Raw Normal View History

2025-09-23 21:57:08 +02:00
#pragma once
#include <memory>
#include "imaging/IPixelariumImage.hpp"
2025-09-26 21:09:51 +02:00
#include "imgui.h"
2025-09-23 21:57:08 +02:00
namespace pixelarium::render
{
2025-09-26 21:09:51 +02:00
/// @brief An interface defining the contract on views to dedicated implementations of IPixelariumImage
2025-09-23 21:57:08 +02:00
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; }
2025-09-26 21:09:51 +02:00
virtual void SetInitialSize(float width = 700.0f, float height = 700.0f)
{
ImGui::SetNextWindowSize({width, height});
}
2025-09-23 21:57:08 +02:00
protected:
std::shared_ptr<imaging::IPixelariumImage> img_{};
std::unique_ptr<cv::Mat> cached_image_{};
bool open_p{true};
bool is_dirty_{true};
};
} // namespace pixelarium::render